Skip to content

oil-oil/see-skill / see

使用外部视觉服务或本地 OCR 分析本地图片、截图、视频及明确提供的媒体 URL,输出 Markdown。用户明确要求 see,或当前主模型缺少完成媒体分析所需的视觉能力时使用。不拦截普通文本、任意 URL 或已有原生视觉可以直接完成的任务;不用于生图、编辑图片或自动操作屏幕。使用外部服务前说明发送的媒体与服务范围,无法识别时如实说明限制。

FileKindSize
SKILL.mdskill md4.8 KB
agents/openai.yamlconfig368 B
references/api-key-setup.mdmarkdown4.0 KB
scripts/credential-ui/README.mdmarkdown8.0 KB
scripts/credential-ui/component.jsonconfig2.2 KB
scripts/credential-ui/manifests/bailian.jsonconfig227 B
scripts/credential-ui/manifests/default.jsonconfig226 B
scripts/credential-ui/manifests/openrouter.jsonconfig230 B
scripts/credential-ui/manifests/profiles.jsonconfig494 B
scripts/credential-ui/manifests/tokendance.jsonconfig230 B
scripts/credential-ui/package-lock.jsonmanifest8.5 KB
scripts/credential-ui/package.jsonmanifest656 B
scripts/credential-ui/public/app.jsscript6.3 KB
scripts/credential-ui/public/favicon.svgother315 B
scripts/credential-ui/public/index.htmlother1.2 KB
scripts/credential-ui/public/style.cssother3.1 KB
scripts/credential-ui/src/cli.tsscript6.3 KB
scripts/credential-ui/src/config.tsscript5.7 KB
scripts/credential-ui/src/page.tsscript1.7 KB
scripts/credential-ui/src/profile.tsscript4.7 KB
scripts/credential-ui/src/run.tsscript3.3 KB
scripts/credential-ui/src/server.tsscript11.3 KB
scripts/credential-ui/tests/configure.test.tsscript2.5 KB
scripts/credential-ui/tests/credentials.test.tsscript6.4 KB
scripts/credential-ui/tests/multi-key.test.tsscript9.7 KB
scripts/credential-ui/tests/native-smoke.tsscript4.1 KB
scripts/credential-ui/tests/page.test.tsscript2.0 KB
scripts/credential-ui/tests/profile.test.tsscript4.1 KB
scripts/credential-ui/tests/run.test.tsscript2.7 KB
scripts/credential-ui/tests/ui.test.tsscript5.0 KB
scripts/credential-ui/tsconfig.jsonconfig353 B
scripts/credential-ui/tsconfig.web.jsonconfig237 B
scripts/credential-ui/web/app.tsscript6.3 KB
scripts/ocr_macos.jsscript2.5 KB
scripts/ocr_macos.swiftscript5.7 KB
scripts/ocr_windows.ps1script3.3 KB
scripts/onboard.pyexecutablescript12.0 KB
scripts/parse_media.pyexecutablescript47.0 KB
scripts/requirements-credentials.txtmarkdown73 B
scripts/secure_credentials.pyscript1.8 KB
scripts/see.shexecutablescript146 B

scripts/credential-ui/src/profile.ts

View on GitHub
import { readFile } from 'node:fs/promises';
import { spawn } from 'node:child_process';
import path from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import { loadManifest, nativeBackend, object, PublicError } from './config.ts';
import { validateFields } from './page.ts';
import { parseBindings, prepareCommand } from './run.ts';
import { startServer } from './server.ts';

const root = fileURLToPath(new URL('../', import.meta.url));
type Binding = { manifest: string; env: string };
export async function loadProfile(name: string, directory = root): Promise<Binding[]> {
  let value: unknown;
  try { value = JSON.parse(await readFile(path.join(directory, 'manifests/profiles.json'), 'utf8')); }
  catch { throw new PublicError('未找到业务凭据配置。'); }
  if (!/^[a-z0-9-]+$/.test(name) || !object(value) || value.version !== 1 || !object(value.profiles)
    || !Object.hasOwn(value.profiles, name)) throw new PublicError('请选择已声明的业务配置。');
  const items = value.profiles[name];
  if (!Array.isArray(items) || !items.length || items.length > 16) throw new PublicError('业务凭据配置不合法。');
  const bindings: Binding[] = items.map(item => {
    if (!object(item) || Object.keys(item).some(k => !['manifest', 'env'].includes(k))
      || typeof item.manifest !== 'string' || !/^[a-z0-9-]+\.json$/.test(item.manifest)
      || typeof item.env !== 'string') throw new PublicError('业务凭据绑定不合法。');
    return { manifest: path.join(directory, 'manifests', item.manifest), env: item.env };
  });
  parseBindings([...bindingArgs(bindings), '--', 'check']);
  validateFields(await Promise.all(bindings.map(b => loadManifest(b.manifest))));
  return bindings;
}
function bindingArgs(bindings: Binding[]) {
  return bindings.flatMap(b => ['--manifest', b.manifest, '--env', b.env]);
}
export async function profileStatus(bindings: Binding[], environment = process.env,
  read = async (ref: string) => (await nativeBackend(ref)).get()) {
  const fields = [];
  for (const b of bindings) {
    const m = await loadManifest(b.manifest);
    const fromEnv = Boolean(environment[b.env]?.trim());
    const configured = fromEnv || Boolean(await read(m.credential));
    fields.push({ credential: m.credential, configured, source: fromEnv ? 'environment' : 'system-store' });
  }
  return { configured: fields.every(f => f.configured), fields };
}
export async function prepareProfile(bindings: Binding[], command: string[], environment = process.env,
  read = async (ref: string) => (await nativeBackend(ref)).get()) {
  if (!command.length) throw new PublicError('请指定真实业务程序。');
  // 环境注入优先;本次只读取所选业务需要的凭据。
  const missing = bindings.filter(b => !environment[b.env]?.trim());
  if (!missing.length) return { command: command[0], args: command.slice(1), env: { ...environment } };
  return prepareCommand([...bindingArgs(missing), '--', ...command], read, environment);
}
async function main() {
  const [action, name, ...args] = process.argv.slice(2);
  if (!['status', 'setup', 'run'].includes(action) || !name || (action !== 'run' && args.length)
    || (action === 'run' && (args[0] !== '--' || args.length < 2)))
    throw new PublicError('用法:node src/profile.ts status|setup 配置名;node src/profile.ts run 配置名 -- 程序 参数');
  const bindings = await loadProfile(name);
  if (action === 'status') {
    const status = await profileStatus(bindings);
    process.stdout.write(JSON.stringify(status) + '\n');
    if (!status.configured) process.exitCode = 2;
  } else if (action === 'setup') {
    const manifests = await Promise.all(bindings.map(b => loadManifest(b.manifest)));
    const app = await startServer({ manifests, onComplete: result => process.stdout.write(JSON.stringify(result) + '\n') });
    process.stdout.write(`本机配置页面(由用户亲自填写,30 分钟内有效):\n${app.url}\n`);
    process.once('SIGINT', app.close); process.once('SIGTERM', app.close);
  } else {
    const plan = await prepareProfile(bindings, args.slice(1));
    const child = spawn(plan.command, plan.args, { env: plan.env, stdio: 'inherit', shell: false });
    for (const b of bindings) delete plan.env[b.env];
    child.once('error', () => { process.stderr.write('业务程序启动失败。\n'); process.exitCode = 1; });
    child.once('exit', code => { process.exitCode = code ?? 1; });
  }
}
if (process.argv[1] && pathToFileURL(path.resolve(process.argv[1])).href === import.meta.url)
  main().catch(error => {
    process.stderr.write((error instanceof PublicError ? error.message : '配置未完成,请检查依赖与系统凭据服务。') + '\n');
    process.exitCode = 1;
  });
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall