tenjin-cli 0.1.0-alpha.10 → 0.1.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -30
- package/dist/{buy-FMDBZ4NY.js → buy-THMVOPUH.js} +17 -17
- package/dist/{chunk-AWQ6A4CI.js → chunk-2SDUV6MQ.js} +83 -72
- package/dist/chunk-2SDUV6MQ.js.map +1 -0
- package/dist/{chunk-DKQMJTG7.js → chunk-3GSZUADW.js} +14 -3
- package/dist/{chunk-DKQMJTG7.js.map → chunk-3GSZUADW.js.map} +1 -1
- package/dist/{chunk-5SE6BJRP.js → chunk-4NTZETIL.js} +25 -2
- package/dist/chunk-4NTZETIL.js.map +1 -0
- package/dist/{chunk-TWRYSGAW.js → chunk-4TCU3YRD.js} +8 -12
- package/dist/chunk-4TCU3YRD.js.map +1 -0
- package/dist/{chunk-7WDY4AXV.js → chunk-6BGYHARE.js} +18 -18
- package/dist/{chunk-UOJRKQTZ.js → chunk-6UY2UQMY.js} +3 -3
- package/dist/{chunk-36X2CA3N.js → chunk-ALUNME53.js} +1 -6
- package/dist/{chunk-36X2CA3N.js.map → chunk-ALUNME53.js.map} +1 -1
- package/dist/{chunk-GECSWJ7O.js → chunk-CNUXRXI2.js} +2 -2
- package/dist/chunk-E6YOODH7.js +913 -0
- package/dist/chunk-E6YOODH7.js.map +1 -0
- package/dist/{chunk-O6CAUZGY.js → chunk-EDVI7RRD.js} +3 -3
- package/dist/{chunk-MD7WGYYI.js → chunk-GKV6VZSZ.js} +9 -9
- package/dist/{chunk-JSSIMGQT.js → chunk-GUUAYR3K.js} +27 -26
- package/dist/chunk-GUUAYR3K.js.map +1 -0
- package/dist/{chunk-ZUAQRIVP.js → chunk-IAFYUFIC.js} +64 -25
- package/dist/chunk-IAFYUFIC.js.map +1 -0
- package/dist/{chunk-R2VLGNFD.js → chunk-IB63U6BM.js} +5 -1
- package/dist/chunk-IB63U6BM.js.map +1 -0
- package/dist/chunk-IXTENA2H.js +235 -0
- package/dist/chunk-IXTENA2H.js.map +1 -0
- package/dist/{chunk-BJJ5BQO6.js → chunk-JTYIX6OD.js} +3 -4
- package/dist/{chunk-5JXAZP7H.js → chunk-NUF2PKJO.js} +2 -1
- package/dist/{chunk-KYH4KPE5.js → chunk-O25VWJCG.js} +26 -26
- package/dist/{chunk-BUDHTDKL.js → chunk-OCN27NJV.js} +6 -6
- package/dist/{chunk-GSDZRCGF.js → chunk-OZHJ3FLR.js} +4 -4
- package/dist/{chunk-X3OOVSPX.js → chunk-RSBN67PA.js} +2 -4
- package/dist/{chunk-5JMKIDMM.js → chunk-SFGXAZ3M.js} +3 -3
- package/dist/{chunk-POF7HPRV.js → chunk-TDDN5GXR.js} +3 -3
- package/dist/{chunk-STND72DS.js → chunk-UFPJBS4C.js} +4 -4
- package/dist/chunk-UFPJBS4C.js.map +1 -0
- package/dist/{chunk-A6KCZPNQ.js → chunk-UY6CGULW.js} +2 -2
- package/dist/{chunk-A6KCZPNQ.js.map → chunk-UY6CGULW.js.map} +1 -1
- package/dist/{chunk-VRRLTZ2Q.js → chunk-VWY3U732.js} +40 -17
- package/dist/chunk-VWY3U732.js.map +1 -0
- package/dist/{chunk-6BZLSRNU.js → chunk-XWHXX2BI.js} +6 -6
- package/dist/{chunk-V4WWTZHZ.js → chunk-ZE7KOO7A.js} +7 -7
- package/dist/{cli-HK2XAWNW.js → cli-Y2HBOSGK.js} +57 -60
- package/dist/{cli-HK2XAWNW.js.map → cli-Y2HBOSGK.js.map} +1 -1
- package/dist/{config-LYCHHNAJ.js → config-WDGMZKHU.js} +4 -4
- package/dist/{doctor-2KPUQURC.js → doctor-CSIWKWM2.js} +9 -9
- package/dist/{edit-TST3OCKQ.js → edit-E7N6F3OY.js} +15 -15
- package/dist/fund-OKK627GL.js +38 -0
- package/dist/index.js +1 -1
- package/dist/{inspect-TPTHVPBB.js → inspect-573WHEV4.js} +13 -13
- package/dist/{install-PT3XEDJ6.js → install-SQAYMNQC.js} +88 -823
- package/dist/install-SQAYMNQC.js.map +1 -0
- package/dist/{outcome-NPNSF2Q7.js → outcome-W3KYGF23.js} +9 -9
- package/dist/{publish-XP5SEWST.js → publish-N5U4XYVA.js} +16 -17
- package/dist/{read-D4VXRWOG.js → read-PJ7Z6UGF.js} +18 -18
- package/dist/{run-3IPGEXW7.js → run-FSO3MMXN.js} +71 -90
- package/dist/{run-3IPGEXW7.js.map → run-FSO3MMXN.js.map} +1 -1
- package/dist/{search-YOBD6VDI.js → search-ZWOP4EGK.js} +10 -11
- package/dist/{send-BWNP6WN4.js → send-F34ZDXDZ.js} +5 -5
- package/dist/{session-GZEZBOMI.js → session-4N4ZT3AH.js} +13 -13
- package/dist/{skill-heal-OK6YALW6.js → skill-heal-XBEK272G.js} +3 -3
- package/dist/uninstall-BTKPHPDL.js +68 -0
- package/dist/uninstall-BTKPHPDL.js.map +1 -0
- package/dist/{wallet-YEGQBWWL.js → wallet-UL4P2JRO.js} +3 -3
- package/dist/{wallet-5RHDFPN2.js → wallet-WJ6UP5OU.js} +5 -5
- package/docs/agent-permissions.md +42 -29
- package/package.json +1 -1
- package/skills/tenjin-publish/SKILL.md +49 -36
- package/skills/tenjin-search/SKILL.md +34 -28
- package/dist/candidate-7LAELUQD.js +0 -23
- package/dist/chunk-2GSRYTZS.js +0 -127
- package/dist/chunk-2GSRYTZS.js.map +0 -1
- package/dist/chunk-5SE6BJRP.js.map +0 -1
- package/dist/chunk-AWQ6A4CI.js.map +0 -1
- package/dist/chunk-JSSIMGQT.js.map +0 -1
- package/dist/chunk-R2VLGNFD.js.map +0 -1
- package/dist/chunk-STND72DS.js.map +0 -1
- package/dist/chunk-TEL27PR5.js +0 -124
- package/dist/chunk-TEL27PR5.js.map +0 -1
- package/dist/chunk-TWRYSGAW.js.map +0 -1
- package/dist/chunk-VRRLTZ2Q.js.map +0 -1
- package/dist/chunk-ZUAQRIVP.js.map +0 -1
- package/dist/install-PT3XEDJ6.js.map +0 -1
- /package/dist/{buy-FMDBZ4NY.js.map → buy-THMVOPUH.js.map} +0 -0
- /package/dist/{chunk-7WDY4AXV.js.map → chunk-6BGYHARE.js.map} +0 -0
- /package/dist/{chunk-UOJRKQTZ.js.map → chunk-6UY2UQMY.js.map} +0 -0
- /package/dist/{chunk-GECSWJ7O.js.map → chunk-CNUXRXI2.js.map} +0 -0
- /package/dist/{chunk-O6CAUZGY.js.map → chunk-EDVI7RRD.js.map} +0 -0
- /package/dist/{chunk-MD7WGYYI.js.map → chunk-GKV6VZSZ.js.map} +0 -0
- /package/dist/{chunk-BJJ5BQO6.js.map → chunk-JTYIX6OD.js.map} +0 -0
- /package/dist/{chunk-5JXAZP7H.js.map → chunk-NUF2PKJO.js.map} +0 -0
- /package/dist/{chunk-KYH4KPE5.js.map → chunk-O25VWJCG.js.map} +0 -0
- /package/dist/{chunk-BUDHTDKL.js.map → chunk-OCN27NJV.js.map} +0 -0
- /package/dist/{chunk-GSDZRCGF.js.map → chunk-OZHJ3FLR.js.map} +0 -0
- /package/dist/{chunk-X3OOVSPX.js.map → chunk-RSBN67PA.js.map} +0 -0
- /package/dist/{chunk-5JMKIDMM.js.map → chunk-SFGXAZ3M.js.map} +0 -0
- /package/dist/{chunk-POF7HPRV.js.map → chunk-TDDN5GXR.js.map} +0 -0
- /package/dist/{chunk-6BZLSRNU.js.map → chunk-XWHXX2BI.js.map} +0 -0
- /package/dist/{chunk-V4WWTZHZ.js.map → chunk-ZE7KOO7A.js.map} +0 -0
- /package/dist/{candidate-7LAELUQD.js.map → config-WDGMZKHU.js.map} +0 -0
- /package/dist/{config-LYCHHNAJ.js.map → doctor-CSIWKWM2.js.map} +0 -0
- /package/dist/{doctor-2KPUQURC.js.map → edit-E7N6F3OY.js.map} +0 -0
- /package/dist/{edit-TST3OCKQ.js.map → fund-OKK627GL.js.map} +0 -0
- /package/dist/{inspect-TPTHVPBB.js.map → inspect-573WHEV4.js.map} +0 -0
- /package/dist/{outcome-NPNSF2Q7.js.map → outcome-W3KYGF23.js.map} +0 -0
- /package/dist/{publish-XP5SEWST.js.map → publish-N5U4XYVA.js.map} +0 -0
- /package/dist/{read-D4VXRWOG.js.map → read-PJ7Z6UGF.js.map} +0 -0
- /package/dist/{search-YOBD6VDI.js.map → search-ZWOP4EGK.js.map} +0 -0
- /package/dist/{send-BWNP6WN4.js.map → send-F34ZDXDZ.js.map} +0 -0
- /package/dist/{session-GZEZBOMI.js.map → session-4N4ZT3AH.js.map} +0 -0
- /package/dist/{skill-heal-OK6YALW6.js.map → skill-heal-XBEK272G.js.map} +0 -0
- /package/dist/{wallet-5RHDFPN2.js.map → wallet-UL4P2JRO.js.map} +0 -0
- /package/dist/{wallet-YEGQBWWL.js.map → wallet-WJ6UP5OU.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/doctor.ts"],"sourcesContent":["import { styleText } from 'node:util';\nimport { Stream } from 'node:stream';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { resolveSkillsSource } from '../lib/skills-source';\nimport { CliError } from '../lib/errors';\nimport {\n CLI_SKILL_NAMES,\n HOSTED_SKILL_NAME,\n anyTenjinSkill,\n cliSkillsWired,\n detectHarnesses,\n harnessFlagFor,\n harnessInPlay,\n harnessReads,\n harnessRequested,\n missingCliSkills,\n onPath,\n readAllWiring,\n readSkillFile,\n shadowedCliSkills,\n} from '../lib/skill-wiring';\nimport type {\n DirState,\n HarnessTarget,\n HarnessWiring,\n NotInvocableReason,\n} from '../lib/skill-wiring';\nimport { fetchJson } from '../lib/http';\nimport { loadRawConfig, resolveSettings } from '../lib/config';\nimport { tryOriginOf, trimSlash } from '../lib/url';\nimport { configPath, sessionPath } from '../lib/paths';\nimport { toMoney } from '../lib/money';\nimport { walletFileExists } from '../lib/wallet/store';\nimport { isSessionPresentable, readSessionFile, scopeSatisfies } from '../lib/session-present';\nimport { sanitizeForTerminal } from '../lib/output';\nimport { permissionsPointer, recommendedPermissions } from '../lib/permissions';\nimport type { PartialConfig } from '../lib/config';\nimport type { ErrorCode } from '../schemas';\nimport type { Io } from '../lib/output';\nimport type {\n PassphraseOverrides,\n WalletDescription,\n WalletProvider,\n WalletVerification,\n} from '../lib/wallet';\nimport type { CommandContext, CommandResult } from '../context';\n\n/**\n * One environment/reachability check. The doctor agent builds the check list\n * against this shape without changing it: `required` drives the exit code (exit\n * 0 iff every required check is ok), `status` drives the TTY rendering, and a\n * `fix` is mandatory on every failure (spec 10). Warn-level checks never fail\n * the command.\n */\nexport interface CheckResult {\n name: string;\n status: 'ok' | 'warn' | 'fail';\n required: boolean;\n detail: string;\n fix?: string;\n /**\n * Optional structured payload for machine consumers, so `--json` carries the\n * check's findings as data instead of only as the prose in `detail`. Additive\n * and per-check; the human renderer ignores it.\n */\n data?: unknown;\n}\n\n/** ~$20 in atomic USDC (6 decimals). Above this, the pocket-money wallet warns. */\nconst POCKET_MONEY_CEILING_ATOMIC = 20_000_000n;\n\n/**\n * `doctor` is an allowlisted verb an unattended agent runs on its own, and its\n * `fix:` lines reach that agent both on the TTY and in `error.details.checks`.\n * So they name the CONFIGURED base URL and the operator command that changes it,\n * never `--base-url`: the flag rides every allowlisted verb (see FLAG_CAVEAT in\n * lib/permissions), and a fix line telling the agent to pass it would be the CLI\n * coaching the exact move the skills forbid. `config set` is not allowlisted, so\n * pointing there routes the change through the operator by construction.\n */\nconst FIX_POINT_AT_TENJIN_API =\n 'Point the configured base URL at a Tenjin API (expected an OpenAPI document): `tenjin config set baseUrl <url>`.';\nconst FIX_CHECK_NETWORK_AND_BASE_URL =\n 'Check your network connection and the configured base URL (`tenjin config get baseUrl`).';\n\n/**\n * A CheckResult plus the error code to raise if it is a *required* failure. Only\n * required checks carry a `failCode`; the outcome step raises the first one, so\n * the failure envelope's `error.code` names what actually broke (api-contract\n * unreachable vs malformed differ) while still carrying the whole check list.\n */\ninterface BuiltCheck {\n result: CheckResult;\n failCode?: ErrorCode;\n}\n\nexport interface DoctorDeps {\n /** Environment for wallet-key detection and settings precedence. */\n env?: NodeJS.ProcessEnv;\n /** Injected fetch for the reachability checks; tests pass a canned stub. */\n fetchImpl?: typeof fetch;\n /** Inject the active wallet provider. When set, NO local fs/env is consulted —\n * the provider owns its own describe() and diagnostics(), so a remote provider's\n * checks can't be contaminated by a stale local wallet file. */\n provider?: WalletProvider;\n /** Home directory root for the skill-wiring check. Defaults to os.homedir(); tests\n * (and `install`, which reuses these checks) inject their own. */\n homeDir?: string;\n /** PATH probe for the `claude`/`codex` binaries, half of harness detection. Defaults\n * to probing `env.PATH`, so a test passing `env: {}` detects neither. */\n which?: (bin: string) => boolean;\n /** Clock seam (ms since epoch) for the session-expiry check. */\n now?: () => number;\n /** Packaged skills to compare the wired copies against; defaults to this build's. */\n skillsSourceDir?: string;\n /**\n * Passphrase seams for the wallet verification (#70), which reads the OS\n * credential store. Tests inject a platform with no store, or a stubbed exec,\n * so no assertion here depends on what is in the developer's real keychain.\n */\n walletPassphrase?: Omit<PassphraseOverrides, 'isTTY'>;\n}\n\n/**\n * The full check list plus the first required failure, if any. `install` reuses\n * this to run the doctor checks as its last step and EMBED the summary without\n * throwing (D39: doctor is diagnostics, it never blocks the caller); `runDoctor`\n * wraps it and turns a required failure into the thrown failure envelope.\n */\nexport interface DoctorChecks {\n checks: CheckResult[];\n failure?: { code: ErrorCode; result: CheckResult };\n}\n\nexport async function collectDoctorChecks(\n ctx: CommandContext,\n deps: DoctorDeps = {},\n): Promise<DoctorChecks> {\n const env = deps.env ?? process.env;\n const { config, check: configCheck } = await loadConfigForDoctor(ctx.dataDir);\n const settings = resolveSettings({ config, flags: { baseUrl: ctx.flags.baseUrl }, env });\n const baseUrl = settings.baseUrl.value;\n\n const built: BuiltCheck[] = [\n checkNode(),\n configCheck,\n await checkApiContract(baseUrl, ctx.flags.timeout, deps.fetchImpl),\n await checkReadPath(baseUrl, ctx.flags.timeout, deps.fetchImpl),\n await checkSearchContract(baseUrl, ctx.flags.timeout, deps.fetchImpl),\n await checkSkills(\n deps.homeDir ?? homedir(),\n deps.which ?? ((bin) => onPath(bin, env)),\n config.install?.harness ?? [],\n deps.skillsSourceDir,\n ),\n await checkSession(ctx.dataDir, deps.now ?? Date.now, tryOriginOf(baseUrl)),\n ];\n\n // The wallet/custody/balance checks all come from the ACTIVE provider: it owns\n // describe() and diagnostics(), so doctor never runs its own fs/env probe.\n for (const result of await checkWallet(ctx, deps, env, settings.rpcUrl.value)) {\n built.push({ result });\n }\n\n const checks = built.map((b) => b.result);\n const firstFail = built.find((b) => b.result.required && b.result.status === 'fail');\n if (firstFail === undefined) return { checks };\n return { checks, failure: { code: firstFail.failCode ?? 'INTERNAL', result: firstFail.result } };\n}\n\nexport async function runDoctor(\n ctx: CommandContext,\n deps: DoctorDeps = {},\n): Promise<CommandResult> {\n const { checks, failure } = await collectDoctorChecks(ctx, deps);\n if (failure !== undefined) {\n const r = failure.result;\n // The allowlist rides on the FAILURE envelope too. An operator whose fresh\n // install is broken is the likeliest one to be reading doctor output at all,\n // and the earlier version dropped the block on exactly that path while the\n // comment below claimed otherwise. The human failure path still renders only\n // the error and its fix (that is emitFailure's contract, not doctor's), so\n // the machine payload is where this has to land.\n throw new CliError(failure.code, r.detail, {\n ...(r.fix !== undefined ? { fix: r.fix } : {}),\n details: { checks, permissions: recommendedPermissions() },\n });\n }\n\n // The discoverability surface for the auto-mode denial problem (#33), now one\n // line rather than the ~60 that used to bury the check list this command was\n // run for: an operator whose agent just got denied still learns the allowlist\n // exists and where to get it. It reports nothing about the local machine, so it\n // is deliberately NOT a check: it can never pass or fail. `--json` is unchanged\n // and still carries the whole recommendation as data.\n return {\n data: { status: 'pass', checks, permissions: recommendedPermissions() },\n humanLines: [...renderDoctorHuman(ctx.io, checks), '', permissionsPointer()],\n };\n}\n\nfunction checkNode(): BuiltCheck {\n const version = process.versions.node;\n const major = Number.parseInt(version.split('.')[0] ?? '0', 10);\n if (major >= 22) {\n return { result: { name: 'node', status: 'ok', required: true, detail: `Node ${version}` } };\n }\n return {\n result: {\n name: 'node',\n status: 'fail',\n required: true,\n detail: `Node ${version} is unsupported (need >= 22)`,\n fix: 'Install Node 22 or newer',\n },\n failCode: 'NODE_UNSUPPORTED',\n };\n}\n\n/**\n * loadRawConfig throws CONFIG_INVALID on a bad file (which we convert into a\n * failing check) but the config value is also needed for baseUrl/rpcUrl\n * resolution; an invalid file falls back to {} so the reachability checks still\n * run and appear in the list, and config is reported as the first required fail.\n */\nasync function loadConfigForDoctor(\n dataDir: string,\n): Promise<{ config: PartialConfig; check: BuiltCheck }> {\n try {\n const config = await loadRawConfig(dataDir);\n const detail =\n Object.keys(config).length === 0\n ? 'No config file; using defaults'\n : `Config at ${configPath(dataDir)} is valid`;\n return { config, check: { result: { name: 'config', status: 'ok', required: true, detail } } };\n } catch (err) {\n if (err instanceof CliError && err.code === 'CONFIG_INVALID') {\n return {\n config: {},\n check: {\n result: {\n name: 'config',\n status: 'fail',\n required: true,\n detail: err.message,\n ...(err.fix !== undefined ? { fix: err.fix } : {}),\n },\n failCode: 'CONFIG_INVALID',\n },\n };\n }\n throw err;\n }\n}\n\nasync function checkApiContract(\n baseUrl: string,\n timeoutMs: number,\n fetchImpl?: typeof fetch,\n): Promise<BuiltCheck> {\n const url = `${trimSlash(baseUrl)}/openapi.json`;\n const res = await fetchJson(url, { timeoutMs, fetchImpl });\n if (!res.ok) {\n const malformed = res.kind === 'invalid-json';\n return {\n result: {\n name: 'api-contract',\n status: 'fail',\n required: true,\n detail: malformed\n ? `OpenAPI document at ${url} was not valid JSON`\n : `Could not reach the Tenjin API at ${url}: ${res.message}`,\n fix: malformed ? FIX_POINT_AT_TENJIN_API : FIX_CHECK_NETWORK_AND_BASE_URL,\n },\n failCode: malformed ? 'CONTRACT_MISMATCH' : 'API_UNREACHABLE',\n };\n }\n const version = infoVersion(res.json);\n if (version === undefined) {\n return {\n result: {\n name: 'api-contract',\n status: 'fail',\n required: true,\n detail: `OpenAPI document at ${url} is missing a string info.version`,\n fix: FIX_POINT_AT_TENJIN_API,\n },\n failCode: 'CONTRACT_MISMATCH',\n };\n }\n return {\n result: {\n name: 'api-contract',\n status: 'ok',\n required: true,\n detail: `Tenjin API ${version} at ${baseUrl}`,\n },\n };\n}\n\n/**\n * WARN-level (never fails doctor): is the A2 search endpoint advertised in the\n * OpenAPI doc? Absent means the deployment predates A2 (the buy/search path will\n * not work against it yet). Warn-only because doctor's job is a working READ path,\n * and search is additive.\n */\nasync function checkSearchContract(\n baseUrl: string,\n timeoutMs: number,\n fetchImpl?: typeof fetch,\n): Promise<BuiltCheck> {\n const url = `${trimSlash(baseUrl)}/openapi.json`;\n const res = await fetchJson(url, { timeoutMs, fetchImpl });\n if (!res.ok) {\n return {\n result: {\n name: 'search-contract',\n status: 'warn',\n required: false,\n detail: `Could not confirm the search endpoint at ${url}`,\n fix: 'Check the configured base URL (`tenjin config get baseUrl`); search/buy need the A2 endpoints deployed.',\n },\n };\n }\n const present = hasSearchPath(res.json);\n return {\n result: present\n ? {\n name: 'search-contract',\n status: 'ok',\n required: false,\n detail: 'Search endpoint advertised',\n }\n : {\n name: 'search-contract',\n status: 'warn',\n required: false,\n detail: 'This deployment does not advertise POST /api/agent/search (A2 not deployed)',\n fix: 'search/buy need A2 deployed; point the configured base URL at a deploy that has it (`tenjin config set baseUrl <url>`).',\n },\n };\n}\n\nfunction hasSearchPath(json: unknown): boolean {\n if (!isRecord(json)) return false;\n const paths = json.paths;\n return isRecord(paths) && '/api/agent/search' in paths;\n}\n\n/**\n * WARN-level (never fails doctor): is the harness skill wiring usable? #35 was\n * invisible without a screen recording, because the publish skill was on disk yet\n * the model never saw it and only the hosted skill answered publish asks.\n *\n * Verdicts are per DIRECTORY, never unioned across them — in EITHER direction.\n * Unioning the problems contradicts itself on a real machine: a Claude-only install\n * leaves a stray hosted skill in ~/.agents/skills, and flat-mapping announced both\n * CLI skills \"missing\" in the same sentence that listed them wired. Unioning the\n * successes is the same bug inverted, and worse: Claude Code reads ~/.claude/skills\n * and Codex reads ~/.agents/skills, so a wired .agents cannot answer for .claude,\n * and asking whether SOME directory is wired reported `ok` on a machine where\n * `tenjin-publish` was unreachable from Claude Code — exactly the #35 shape.\n *\n * So each directory is judged alone, and only when a harness on this machine\n * actually reads it (`harnessReads`, the probes `install` picks targets with). That\n * gate is what keeps a leftover mirror quiet: a hosted-only ~/.agents/skills with no\n * Codex is nobody's problem, while a hosted-only ~/.claude/skills with Claude Code\n * installed is the bug.\n *\n * Warn and never required: a CI or server machine legitimately has no harness, so\n * this must not move the exit code.\n */\n/**\n * `requested` is the `--harness` set a past `install` recorded (config `install.harness`).\n * It joins detection in deciding which directories are in play, and rides in the data as\n * its own field so `harnessPresent` keeps meaning \"a harness detected here reads this\".\n */\nasync function checkSkills(\n home: string,\n which: (bin: string) => boolean,\n requested: readonly HarnessTarget[],\n skillsSourceDir?: string,\n): Promise<BuiltCheck> {\n const present = detectHarnesses(home, which);\n const wiring = await readAllWiring(home);\n const data = {\n directories: wiring.map((w) => ({\n ...w,\n harnessPresent: harnessReads(home, w.dir, present),\n requested: harnessRequested(home, w.dir, requested),\n })),\n };\n const inPlay = wiring.filter((w) => anyTenjinSkill(w));\n\n if (inPlay.length === 0) {\n // Same fixFor path every other branch uses, over the same harnessInPlay\n // predicate (detected OR requested) — filtering on `requested` alone named\n // only the recorded directory and left a DETECTED one unwired, which just\n // swapped which directory the first command missed. Gated on\n // `requested.length > 0` so a machine with no record at all keeps the plain\n // `tenjin install` rather than newly spelling out a detected harness that\n // nobody asked to see named.\n const targeted =\n requested.length > 0\n ? wiring.filter((w) => harnessInPlay(home, w.dir, present, requested))\n : [];\n return {\n result: {\n name: 'skills',\n status: 'warn',\n required: false,\n detail: `No Tenjin skills wired under ${home} (looked in .claude/skills and .agents/skills)`,\n fix: targeted.length > 0 ? fixFor(home, targeted) : 'tenjin install',\n data,\n },\n };\n }\n\n // Every directory in play must carry BOTH CLI skills, model-invocable. Anything less\n // is the defect, whether it is shadowed, half-installed, hosted-only or absent; a\n // directory neither detected nor asked for is described but never warned about.\n const broken = wiring.filter(\n (w) => harnessInPlay(home, w.dir, present, requested) && !cliSkillsWired(w),\n );\n if (broken.length > 0) {\n return {\n result: {\n name: 'skills',\n status: 'warn',\n required: false,\n detail: `${broken.map(describeProblem).join('; ')}. Full state: ${describeWiring(inPlay)}`,\n fix: fixFor(home, broken),\n data,\n },\n };\n }\n\n // Wired is not the same as CURRENT. `npm i -g tenjin-cli` updates the binary and\n // nothing else, so the copies install wrote stay at whatever version wrote them\n // until someone re-runs install, and every check above passes the whole time.\n //\n // EVERY directory, not just the ones in play. The checks above ask what a\n // harness on this machine reads; this one has to cover what the self-heal\n // writes, which is any directory holding one of our adapters. A ~/.agents/skills\n // that fell out of play (a fallback install, then Claude Code arrives) is where\n // the heal keeps working and, when it cannot, keeps quiet: reporting a narrower\n // set than it writes would leave a stale directory nothing ever names.\n const { stale, verifiable } = await compareWiredSkills(\n wiring.map((w) => w.dir),\n skillsSourceDir,\n );\n if (!verifiable) {\n return {\n result: {\n name: 'skills',\n status: 'warn',\n required: false,\n detail: `${CLI_SKILL_NAMES.join(' + ')} wired, but this build's packaged copies could not be read, so whether they are current is unknown`,\n fix: 'Reinstall the CLI: `npm i -g tenjin-cli`, then `tenjin install`.',\n data,\n },\n };\n }\n if (stale.length > 0) {\n return {\n result: {\n name: 'skills',\n status: 'warn',\n required: false,\n detail: `${CLI_SKILL_NAMES.join(' + ')} wired but not from this CLI build (${stale.join(', ')}); agents are reading an older version's instructions`,\n // fixFor, like every neighbouring branch: a plain `tenjin install` targets\n // DETECTED harnesses only, so for a directory that exists because someone\n // passed --harness it would be a fix that never clears the warning.\n fix: fixFor(\n home,\n wiring.filter((w) => stale.includes(w.dir)),\n ),\n data,\n },\n };\n }\n\n return {\n result: {\n name: 'skills',\n status: 'ok',\n required: false,\n detail: `${CLI_SKILL_NAMES.join(' + ')} wired: ${describeWiring(inPlay)}`,\n data,\n },\n };\n}\n\n/**\n * How the wired CLI adapter skills compare to the packaged ones.\n *\n * `verifiable` is false when this build cannot read its own packaged copies, which\n * is a broken package rather than evidence of no drift; reporting that as current\n * would make the check quietly green on exactly the install doctor should describe.\n *\n * Only the ADAPTERS are compared: the hosted mirror is a copy of\n * tenjin.blog/skills.md that an operator may legitimately have re-fetched newer\n * than this package ships.\n *\n * This is also where a skill the post-command self-heal could NOT rewrite\n * surfaces. That writer stays silent about its failures on purpose: a cause it\n * cannot clear (an unwritable skills directory) would otherwise print the same\n * line on every command forever. Stale here means exactly that, and the fix names\n * the harness. For the handoff to hold, the CALLER has to pass every directory\n * the heal can reach, not only the ones a detected harness reads.\n */\nasync function compareWiredSkills(\n dirs: readonly string[],\n sourceDir?: string,\n): Promise<{ stale: string[]; verifiable: boolean }> {\n let source: string;\n try {\n source = sourceDir ?? resolveSkillsSource(fileURLToPath(new URL('.', import.meta.url)));\n } catch {\n return { stale: [], verifiable: false };\n }\n // Read once, not once per directory.\n const packaged = new Map<string, Buffer>();\n for (const name of CLI_SKILL_NAMES) {\n const read = await readSkillFile(join(source, name, 'SKILL.md'));\n if (read.kind === 'ok') packaged.set(name, read.bytes);\n }\n if (packaged.size !== CLI_SKILL_NAMES.length) return { stale: [], verifiable: false };\n\n const stale: string[] = [];\n for (const dir of dirs) {\n for (const name of CLI_SKILL_NAMES) {\n // Guarded: a pipe or device at this path would otherwise block the whole\n // diagnostic. Anything but a readable regular file is the wiring check's\n // business, not this one's.\n const onDisk = await readSkillFile(join(dir, name, 'SKILL.md'));\n if (onDisk.kind !== 'ok') continue;\n if (!packaged.get(name)!.equals(onDisk.bytes)) {\n stale.push(dir);\n break;\n }\n }\n }\n return { stale, verifiable: true };\n}\n\n/** What is wrong in ONE directory, naming the directory and the skills. */\nfunction describeProblem(w: HarnessWiring): string {\n const shadowed = shadowedCliSkills(w);\n const missing = missingCliSkills(w);\n const parts: string[] = [];\n // Grouped BY REASON, not into one clause: the two claims differ in strength. A\n // readable file with the flag set is a fact; an unreadable one is a disjunction,\n // because the whole reason we cannot assert the flag is that we could not read it.\n // Merging them would spread that hedge onto a skill we know the answer for.\n const unreadable = shadowed.filter((n) => reasonFor(w, n) === 'unreadable');\n const disabled = shadowed.filter((n) => reasonFor(w, n) !== 'unreadable');\n if (disabled.length > 0) {\n parts.push(\n `${disabled.join(', ')} installed but not model-invocable (disable-model-invocation: true)`,\n );\n }\n if (unreadable.length > 0) {\n parts.push(\n `${unreadable.join(', ')} installed but not model-invocable (unreadable or disable-model-invocation: true)`,\n );\n }\n // Naming both by name reads as a half-install; when NEITHER is there the state is\n // \"this harness has no CLI skills at all\", which is a different sentence.\n if (missing.length === CLI_SKILL_NAMES.length) {\n parts.push(\n w.state === 'hosted-only'\n ? `the hosted ${HOSTED_SKILL_NAME} skill is here but neither CLI skill is wired`\n : 'neither CLI skill is wired',\n );\n } else if (missing.length > 0) parts.push(`${missing.join(', ')} missing`);\n return `${w.dir}: ${parts.join(' and ')}`;\n}\n\nfunction reasonFor(w: HarnessWiring, name: string): NotInvocableReason | undefined {\n return w.skills.find((s) => s.name === name)?.reason;\n}\n\n/** Is the hosted zero-install mirror in THIS directory? */\nfunction hostedHere(w: HarnessWiring): boolean {\n return w.skills.find((s) => s.name === HOSTED_SKILL_NAME)?.present === true;\n}\n\n/**\n * A fix that can actually clear the warning. A bare `tenjin install` only targets\n * the directories detection picks, so a problem in ~/.agents/skills on a\n * Claude-only machine needs `--harness shared` spelled out.\n */\nfunction fixFor(home: string, dirs: HarnessWiring[]): string {\n const flags = [...new Set(dirs.map((w) => harnessFlagFor(home, w.dir)))];\n return `tenjin install ${flags.map((f) => `--harness ${f}`).join(' ')}`;\n}\n\n/** One-line per-directory summary: `<dir> -> <skills> (<posture>)`. */\nfunction describeWiring(wiring: HarnessWiring[]): string {\n return wiring\n .map((w) => {\n const parts = w.skills\n .filter((s) => s.present)\n .map((s) =>\n s.modelInvocable === false ? `${s.name} [${s.reason ?? 'shadowed'}]` : s.name,\n );\n return `${w.dir} -> ${parts.join(', ')} (${posture(w)})`;\n })\n .join('; ');\n}\n\n/**\n * The precedence half of the `wired` posture is only true when there is a mirror\n * here to take precedence OVER. `classify` keys `wired` off the two CLI skills\n * alone, so a directory whose mirror was deleted is `wired` with no `tenjin` in it,\n * and the unconditional string claimed a file the same line had just not listed.\n */\nfunction posture(w: HarnessWiring): string {\n if (w.state !== 'wired') return POSTURE[w.state];\n return hostedHere(w)\n ? 'CLI skills wired, take precedence over the hosted mirror'\n : 'CLI skills wired';\n}\n\nconst POSTURE: Record<DirState, string> = {\n empty: 'no Tenjin skills',\n 'hosted-only': 'hosted skill only, no CLI skills here',\n partial: 'only one CLI skill',\n // \"at least one\": a directory with one CLI skill shadowed and the other absent\n // classifies as `shadowed` too, and \"CLI skills present\" would be false there.\n shadowed: 'at least one CLI skill present but not model-invocable',\n wired: 'CLI skills wired, take precedence over the hosted mirror',\n};\n\n/**\n * The delegated session key `tenjin read` presents to recover a piece this wallet\n * already owns (`tenjin session start --scope read` mints it). Never required and\n * never a fail — `read` works without one — so ABSENT is `ok`: the normal\n * posture, not a defect. So are the states that are ordinary decay rather than\n * damage: an older CLI's file, a spent 24h expiry, a scope that does not cover\n * reading. One command re-mints all of them, and a check that yellowed on them\n * would be permanently yellow on any machine that ever minted a key.\n *\n * A genuine fault still warns, and the states are kept apart on purpose. A 0600 file\n * that is now group-readable, or one whose contents no longer parse, is a TAMPER\n * signal on a wallet-derived credential; `loadSessionFile` fails closed on both\n * and collapses them to \"no session\", which is the right instruction for a caller\n * that can re-mint and exactly the wrong report for the verb an operator runs\n * when something looks wrong. `readSessionFile` keeps them distinguishable and\n * this is the one caller that needs them.\n *\n * An unreadable file (EACCES after a `sudo` run, EIO) warns rather than throwing:\n * doctor is diagnostics, and a session cache nobody asked about must never take\n * down the run that was going to explain the rest of the machine.\n *\n * Reports address / origin / scope / expiry and nothing else. The delegation and\n * the private JWK never reach this output — doctor's payload is the single most\n * likely thing in this CLI to be pasted into an issue.\n */\nasync function checkSession(\n dataDir: string,\n now: () => number,\n origin: string | null,\n): Promise<BuiltCheck> {\n const warn = (detail: string, data?: unknown): BuiltCheck => ({\n result: {\n name: 'session',\n status: 'warn',\n required: false,\n detail,\n fix: 'tenjin session start --scope read',\n ...(data !== undefined ? { data } : {}),\n },\n });\n\n const state = await readSessionFile(dataDir);\n if (state.kind === 'absent') {\n return {\n result: {\n name: 'session',\n status: 'ok',\n required: false,\n detail:\n 'No session key; `tenjin read` delivers free and locally-cached pieces (`tenjin session start --scope read` adds owned-piece recovery)',\n },\n };\n }\n if (state.kind === 'loosened') {\n return warn(\n `Session key at ${sessionPath(dataDir)} is mode 0${state.mode.toString(8)}, not 0600, so it is refused; it holds a wallet-derived credential and was changed out of band. Delete it and re-mint`,\n );\n }\n // Same standing as `absent`: a cache this CLI cannot use, re-minted by one\n // command. A failing check here meant a permanent post-update warning.\n if (state.kind === 'outdated') {\n return {\n result: {\n name: 'session',\n status: 'ok',\n required: false,\n detail: `Cached session key at ${sessionPath(dataDir)} predates this CLI version (no \\`${state.field}\\`) and is not used; \\`tenjin session start --scope read\\` mints a current one`,\n },\n };\n }\n if (state.kind === 'corrupt') {\n return warn(`Session key at ${sessionPath(dataDir)} could not be parsed (${state.reason})`);\n }\n if (state.kind === 'unreadable') {\n return warn(`Session key at ${sessionPath(dataDir)} could not be read: ${state.message}`);\n }\n\n const file = state.file;\n // A base URL that is not an http(s) origin cannot be compared against, and this\n // is the diagnostic verb: it reports that and keeps going. The `config` check\n // above owns the fix for the value itself.\n if (origin === null) {\n return {\n result: {\n name: 'session',\n status: 'warn',\n required: false,\n detail: `Session key was minted for ${file.origin}, but the configured base URL is not an http(s) origin, so it cannot be matched`,\n fix: 'Set an absolute http(s) base URL: `tenjin config set baseUrl <url>`.',\n data: { address: file.address, origin: file.origin, scope: file.scope, exp: file.exp },\n },\n };\n }\n const data = { address: file.address, origin: file.origin, scope: file.scope, exp: file.exp };\n if (file.origin !== origin) {\n return warn(\n `Session key was minted for ${file.origin}, but the configured base URL is ${origin}; it is not presented off its own origin`,\n data,\n );\n }\n // Expiry and scope are DESIGNED DECAY, not faults. A delegation lives 24h by\n // construction, so warning on a spent one made every machine that ever ran\n // `tenjin session start` permanently yellow for behaving exactly as intended —\n // the same permanent-warning trap `outdated` above was already pulled out of.\n // Both are re-minted by the one command named in the detail. An expiry that\n // does not PARSE is a different thing and stays a warning: that is a malformed\n // file, not a spent one.\n if (!Number.isFinite(Date.parse(file.exp))) {\n return warn(\n `Session key for ${file.address} carries an unparseable expiry (exp ${file.exp})`,\n data,\n );\n }\n if (!scopeSatisfies(file.scope, 'read')) {\n return {\n result: {\n name: 'session',\n status: 'ok',\n required: false,\n detail: `Session key has scope ${file.scope}, which does not cover reading; \\`tenjin session start --scope read\\` mints one that does`,\n data,\n },\n };\n }\n if (!isSessionPresentable(file, now(), 'read', origin)) {\n return {\n result: {\n name: 'session',\n status: 'ok',\n required: false,\n detail:\n 'Session key expired (normal after 24h); mint one with `tenjin session start --scope read` when you want free re-reads of owned pieces',\n data,\n },\n };\n }\n return {\n result: {\n name: 'session',\n status: 'ok',\n required: false,\n detail: `Session key ${file.address}, scope ${file.scope}, for ${file.origin}, expires ${file.exp}`,\n data,\n },\n };\n}\n\nasync function checkReadPath(\n baseUrl: string,\n timeoutMs: number,\n fetchImpl?: typeof fetch,\n): Promise<BuiltCheck> {\n // The shipped public read path. The A2 search-contract check is a B2 follow-up.\n // Probe the UNFILTERED listing: the server logs every nonblank first-page `q`\n // as agent search demand, so a `q` here would fabricate that demand into the\n // experiment this CLI exists to measure. Never add a `q` to this probe.\n const url = `${trimSlash(baseUrl)}/api/articles?limit=1`;\n const res = await fetchJson(url, { timeoutMs, fetchImpl });\n if (!res.ok) {\n return {\n result: {\n name: 'read-path',\n status: 'fail',\n required: true,\n detail: `Read path ${url} failed: ${res.message}`,\n fix: FIX_CHECK_NETWORK_AND_BASE_URL,\n },\n failCode: 'API_UNREACHABLE',\n };\n }\n const items = isRecord(res.json) ? res.json.items : undefined;\n if (!Array.isArray(items)) {\n return {\n result: {\n name: 'read-path',\n status: 'fail',\n required: true,\n detail: `Read path ${url} did not return an items array`,\n fix: 'Point the configured base URL at a Tenjin API: `tenjin config set baseUrl <url>`.',\n },\n failCode: 'API_UNREACHABLE',\n };\n }\n return {\n result: { name: 'read-path', status: 'ok', required: true, detail: `Read path OK at ${url}` },\n };\n}\n\n/**\n * Diagnose the wallet the CLI would actually use, entirely through the ACTIVE\n * provider. An injected provider owns everything — no local file or env is touched.\n * With no injected provider we do ONE cheap fs/env probe purely to decide whether\n * any credential exists: none → emit the \"no wallet\" warn WITHOUT importing the\n * wallet lib (that import statically pulls viem, and a no-wallet run must not parse\n * it). Otherwise the provider describes itself (address + source), PROVES the\n * credential can sign when it can do so without prompting (#70), reports its own\n * custody warnings, and the balance probes describe()'s address. A custody problem\n * (bad key, provider refusal) is warn-level, never a hard fail.\n */\nasync function checkWallet(\n ctx: CommandContext,\n deps: DoctorDeps,\n env: NodeJS.ProcessEnv,\n rpcUrl: string,\n): Promise<CheckResult[]> {\n const provider = deps.provider ?? (await resolveLocalProviderOrNull(ctx, env, deps));\n if (provider === null) return [noWalletCheck()];\n\n const { describeWallet } = await import('../lib/wallet');\n let desc: WalletDescription;\n try {\n desc = await describeWallet(provider);\n } catch (err) {\n if (err instanceof CliError && err.code === 'WALLET_MISSING') return [noWalletCheck()];\n return [walletWarn(err)];\n }\n\n const checks: CheckResult[] = [walletCheck(desc, await verifyWallet(provider))];\n // Custody warnings are the provider's own (perms, env-shadow for the local\n // provider; none for a remote one). Render each as a warn check; the fix text,\n // when there is one, is carried inline in the warning string.\n for (const warning of (await provider.diagnostics()).warnings) {\n checks.push({ name: 'wallet-custody', status: 'warn', required: false, detail: warning });\n }\n checks.push(await checkBalance(desc.address, rpcUrl));\n return checks;\n}\n\n/**\n * The active local provider, or null when no credential exists at all. The null\n * path never imports the wallet lib, keeping a no-wallet doctor run off viem.\n */\nasync function resolveLocalProviderOrNull(\n ctx: CommandContext,\n env: NodeJS.ProcessEnv,\n deps: DoctorDeps,\n): Promise<WalletProvider | null> {\n const envKey = env.TENJIN_WALLET_KEY;\n const envKeySet = typeof envKey === 'string' && envKey.length > 0;\n if (!envKeySet && !(await walletFileExists(ctx.dataDir))) return null;\n const { resolveWalletProvider } = await import('../lib/wallet');\n return resolveWalletProvider(ctx, {\n ...(deps.walletPassphrase !== undefined ? { passphrase: deps.walletPassphrase } : {}),\n });\n}\n\n/**\n * Ask the provider to prove the credential can sign (#70). A provider without a\n * `verify` is not a failure and not a pass: it is the `unverified` state, same as\n * a keystore whose passphrase only a human could supply. A provider that throws\n * is treated the same way — doctor reports what it could not establish and keeps\n * going; it never turns a diagnostic's own failure into a verdict about the\n * wallet.\n */\nasync function verifyWallet(provider: WalletProvider): Promise<WalletVerification> {\n if (provider.verify === undefined) {\n return {\n status: 'unverified',\n detail: `provider \"${provider.id}\" cannot verify without a key`,\n };\n }\n try {\n return await provider.verify();\n } catch (err) {\n return {\n status: 'unverified',\n detail: `verification could not run (${err instanceof Error ? err.message : String(err)})`,\n };\n }\n}\n\n/**\n * The wallet check, with the verification folded INTO its status rather than\n * reported beside it. #70 was exactly a green `wallet` line above an unopenable\n * keystore, so an `ok` here has to mean the key is usable, not merely that a file\n * parsed. Still never `required` and never a `fail`: a wallet nobody can open is\n * a real problem, but `read` and `search` work without one, so it must not move\n * the exit code.\n */\nfunction walletCheck(desc: WalletDescription, v: WalletVerification): CheckResult {\n const head = `Wallet ${desc.address} (${desc.credentialSource})`;\n if (v.status === 'broken') {\n return {\n name: 'wallet',\n status: 'warn',\n required: false,\n detail: `${head}: ${v.detail}`,\n fix: v.fix,\n };\n }\n if (v.status === 'unverified') {\n return {\n name: 'wallet',\n status: 'warn',\n required: false,\n detail: `${head} present, not verified: ${v.detail}`,\n fix: 'Set TENJIN_WALLET_PASSPHRASE, or store the passphrase in your OS credential store, so doctor can prove the keystore still opens.',\n };\n }\n return { name: 'wallet', status: 'ok', required: false, detail: `${head}, ${v.detail}` };\n}\n\nfunction noWalletCheck(): CheckResult {\n return {\n name: 'wallet',\n status: 'warn',\n required: false,\n detail: 'No wallet; needed only for buy/publish',\n fix: 'tenjin wallet create',\n data: { credential: 'absent' },\n };\n}\n\n/**\n * Is this the check that says there is no credential at all? `install` prints its\n * own line for that state and drops the duplicate, so it has to recognise THIS\n * check and not merely one named `wallet`: a warn about a credential that exists\n * and does not work (an unopenable keystore, an invalid TENJIN_WALLET_KEY) shares\n * the name and is the one wallet state nothing else in install's output carries.\n */\nexport function isNoWalletCheck(c: CheckResult): boolean {\n return c.name === 'wallet' && isRecord(c.data) && c.data.credential === 'absent';\n}\n\nfunction walletWarn(err: unknown): CheckResult {\n return {\n name: 'wallet',\n status: 'warn',\n required: false,\n detail: err instanceof Error ? err.message : String(err),\n ...(err instanceof CliError && err.fix !== undefined ? { fix: err.fix } : {}),\n };\n}\n\n/**\n * Balance is best-effort: a zero balance is a fundable warning and an RPC flake\n * must never fail doctor. viem loads only here, via a lazy import, so a doctor\n * run without a wallet never parses the viem chunk.\n */\nasync function checkBalance(address: string, rpcUrl: string): Promise<CheckResult> {\n try {\n const { getUsdcBalance } = await import('../lib/usdc');\n const balance = await getUsdcBalance(address as `0x${string}`, rpcUrl);\n if (balance === 0n) {\n return {\n name: 'balance',\n status: 'warn',\n required: false,\n detail: 'Wallet USDC balance is 0',\n fix: 'Fund it with `tenjin fund` (card via Coinbase), or send USDC on Base. $5 covers ~50 typical resources.',\n };\n }\n const money = toMoney(balance.toString());\n // Pocket-money posture (roadmap B2): a plaintext-adjacent local key should\n // hold only small change, so a balance over ~$20 is a warn, not an error.\n if (balance > POCKET_MONEY_CEILING_ATOMIC) {\n return {\n name: 'balance',\n status: 'warn',\n required: false,\n detail: `Balance ${money.usd} USDC is above the ~$20 pocket-money ceiling`,\n fix: 'Keep only small change in the CLI wallet; sweep the excess to cold storage.',\n };\n }\n return {\n name: 'balance',\n status: 'ok',\n required: false,\n detail: `Balance ${money.usd} USDC (${money.atomic} atomic)`,\n };\n } catch (err) {\n return {\n name: 'balance',\n status: 'warn',\n required: false,\n detail: `Could not read balance: ${err instanceof Error ? err.message : String(err)}`,\n fix: 'Check rpcUrl or retry; a balance read failure never fails doctor.',\n };\n }\n}\n\nexport function renderDoctorHuman(io: Io, checks: CheckResult[]): string[] {\n const nameWidth = Math.max(...checks.map((c) => c.name.length));\n const lines: string[] = [];\n for (const c of checks) {\n const icon =\n c.status === 'ok'\n ? paint(io, 'green', '✓')\n : c.status === 'warn'\n ? paint(io, 'yellow', '!')\n : paint(io, 'red', '✗');\n // `detail` and `fix` interpolate SERVER-sourced strings (the OpenAPI\n // info.version, a provider's error text), so a newline or ANSI in a hostile\n // deployment's version string could forge extra lines here — including a\n // convincing closing pointer at a URL of its choosing. Sanitize at the render\n // seam: output.ts exempts doctor on the assumption it only paints its OWN\n // text, which has not been true since these lines began carrying server text.\n lines.push(\n `${icon} ${c.name.padEnd(nameWidth)} ${paint(io, 'dim', sanitizeForTerminal(c.detail))}`,\n );\n if (c.status !== 'ok' && c.fix !== undefined) {\n lines.push(` ${paint(io, 'dim', `fix: ${sanitizeForTerminal(c.fix)}`)}`);\n }\n }\n return lines;\n}\n\n/**\n * Color for stderr, honoring NO_COLOR and the target's color depth: styleText\n * takes the stderr stream when it is a genuine Stream (it throws on anything\n * else, so a test/redirected sink falls back to the default plain check).\n */\nfunction paint(io: Io, format: Parameters<typeof styleText>[0], text: string): string {\n if (io.stdout instanceof Stream) return styleText(format, text, { stream: io.stdout });\n return styleText(format, text);\n}\n\nfunction infoVersion(json: unknown): string | undefined {\n if (!isRecord(json)) return undefined;\n const info = json.info;\n if (!isRecord(info)) return undefined;\n return typeof info.version === 'string' ? info.version : undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,cAAc;AACvB,SAAS,eAAe;AACxB,SAAS,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AAAA,IACzF;AACA,QAAI,EAAE,WAAW,QAAQ,EAAE,QAAQ,QAAW;AAC5C,YAAM,KAAK,OAAO,MAAM,IAAI,OAAO,QAAQ,oBAAoB,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE;AAAA,IAC5E;AAAA,EACF;AACA,SAAO;AACT;AAOA,SAAS,MAAM,IAAQ,QAAyC,MAAsB;AACpF,MAAI,GAAG,kBAAkB,OAAQ,QAAO,UAAU,QAAQ,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC;AACrF,SAAO,UAAU,QAAQ,IAAI;AAC/B;AAEA,SAAS,YAAY,MAAmC;AACtD,MAAI,CAAC,SAAS,IAAI,EAAG,QAAO;AAC5B,QAAM,OAAO,KAAK;AAClB,MAAI,CAAC,SAAS,IAAI,EAAG,QAAO;AAC5B,SAAO,OAAO,KAAK,YAAY,WAAW,KAAK,UAAU;AAC3D;AAEA,SAAS,SAAS,OAAkD;AAClE,SAAO,OAAO,UAAU,YAAY,UAAU;AAChD;","names":["data"]}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
fetchRead
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZE7KOO7A.js";
|
|
5
5
|
import {
|
|
6
6
|
headingOutline
|
|
7
7
|
} from "./chunk-SGK2B724.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveResourceRef
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6UY2UQMY.js";
|
|
11
11
|
import {
|
|
12
12
|
sanitizeForTerminal
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-IB63U6BM.js";
|
|
14
14
|
import {
|
|
15
15
|
resolveContextSettings
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JTYIX6OD.js";
|
|
17
17
|
import {
|
|
18
18
|
toMoney
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ALUNME53.js";
|
|
20
20
|
|
|
21
21
|
// src/commands/inspect.ts
|
|
22
22
|
async function runInspect(args, ctx, deps = {}) {
|
|
@@ -146,4 +146,4 @@ function freshness(card) {
|
|
|
146
146
|
export {
|
|
147
147
|
runInspect
|
|
148
148
|
};
|
|
149
|
-
//# sourceMappingURL=chunk-
|
|
149
|
+
//# sourceMappingURL=chunk-XWHXX2BI.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
rateLimitError
|
|
4
|
+
} from "./chunk-EDVI7RRD.js";
|
|
2
5
|
import {
|
|
3
6
|
SIWX_HEADER,
|
|
4
7
|
decodePaymentRequiredHeader,
|
|
5
8
|
decodePaymentResponseHeader
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
rateLimitError
|
|
9
|
-
} from "./chunk-O6CAUZGY.js";
|
|
9
|
+
} from "./chunk-6BGYHARE.js";
|
|
10
10
|
import {
|
|
11
11
|
httpRequest
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3GSZUADW.js";
|
|
13
13
|
import {
|
|
14
14
|
SLUG_RE,
|
|
15
15
|
UUID_RE
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ALUNME53.js";
|
|
17
17
|
import {
|
|
18
18
|
CliError,
|
|
19
19
|
external_exports
|
|
@@ -230,4 +230,4 @@ function readMessage(json) {
|
|
|
230
230
|
export {
|
|
231
231
|
fetchRead
|
|
232
232
|
};
|
|
233
|
-
//# sourceMappingURL=chunk-
|
|
233
|
+
//# sourceMappingURL=chunk-ZE7KOO7A.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
PERMISSIONS_DOC_URL
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4TCU3YRD.js";
|
|
5
5
|
import {
|
|
6
6
|
package_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UY6CGULW.js";
|
|
8
8
|
import {
|
|
9
9
|
defaultIo,
|
|
10
10
|
emitFailure,
|
|
11
11
|
emitNotice,
|
|
12
12
|
emitSuccess
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-IB63U6BM.js";
|
|
14
14
|
import {
|
|
15
15
|
dataDir,
|
|
16
16
|
updateCheckPath
|
|
@@ -3626,7 +3626,7 @@ function buildProgram(io, setExit) {
|
|
|
3626
3626
|
await maybeNudgeUpdate({ dir: dataDir(process.env), io, json });
|
|
3627
3627
|
if (command !== "install") {
|
|
3628
3628
|
try {
|
|
3629
|
-
const { healWiredSkills } = await import("./skill-heal-
|
|
3629
|
+
const { healWiredSkills } = await import("./skill-heal-XBEK272G.js");
|
|
3630
3630
|
await healWiredSkills({ io });
|
|
3631
3631
|
} catch {
|
|
3632
3632
|
}
|
|
@@ -3654,7 +3654,7 @@ function buildProgram(io, setExit) {
|
|
|
3654
3654
|
).option("--dry-run", "print what would change without writing anything").option(
|
|
3655
3655
|
"--publish-mode <mode>",
|
|
3656
3656
|
"set the publish consent mode non-interactively: review | auto | full-auto"
|
|
3657
|
-
).option("--no-wallet", "create no wallet (the default is to create one)").addOption(new Option("--claude-md", "compat no-op;
|
|
3657
|
+
).option("--no-wallet", "create no wallet (the default is to create one)").addOption(new Option("--claude-md", "compat no-op; no nudge is written").hideHelp()).addOption(new Option("--no-claude-md", "compat no-op; no nudge is written").hideHelp()).addOption(
|
|
3658
3658
|
new Option(
|
|
3659
3659
|
"--allow-free-verbs",
|
|
3660
3660
|
// The absolute URL, like every other pointer: `docs/agent-permissions.md`
|
|
@@ -3673,7 +3673,7 @@ function buildProgram(io, setExit) {
|
|
|
3673
3673
|
const o = this.opts();
|
|
3674
3674
|
const claudeMdGiven = this.getOptionValueSource("claudeMd") !== "default";
|
|
3675
3675
|
const allowGiven = this.getOptionValueSource("allowFreeVerbs") !== "default";
|
|
3676
|
-
const { runInstall } = await import("./install-
|
|
3676
|
+
const { runInstall } = await import("./install-SQAYMNQC.js");
|
|
3677
3677
|
return runInstall(
|
|
3678
3678
|
{
|
|
3679
3679
|
...Array.isArray(o.harness) && o.harness.length > 0 ? { harness: o.harness } : {},
|
|
@@ -3689,9 +3689,17 @@ function buildProgram(io, setExit) {
|
|
|
3689
3689
|
);
|
|
3690
3690
|
});
|
|
3691
3691
|
});
|
|
3692
|
+
addGlobalFlags(program2.command("uninstall")).description(
|
|
3693
|
+
"Remove everything `tenjin install` wrote: the skills, the harness hooks and their settings entries, and the tenjin permission rules. Nothing under ~/.tenjin is touched"
|
|
3694
|
+
).action(async function() {
|
|
3695
|
+
await runCommand("uninstall", this, async (ctx) => {
|
|
3696
|
+
const { runUninstall } = await import("./uninstall-BTKPHPDL.js");
|
|
3697
|
+
return runUninstall(ctx);
|
|
3698
|
+
});
|
|
3699
|
+
});
|
|
3692
3700
|
addGlobalFlags(program2.command("doctor")).description("Check the local environment and Tenjin API reachability").action(async function() {
|
|
3693
3701
|
await runCommand("doctor", this, async (ctx) => {
|
|
3694
|
-
const { runDoctor } = await import("./doctor-
|
|
3702
|
+
const { runDoctor } = await import("./doctor-CSIWKWM2.js");
|
|
3695
3703
|
return runDoctor(ctx);
|
|
3696
3704
|
});
|
|
3697
3705
|
});
|
|
@@ -3700,19 +3708,19 @@ function buildProgram(io, setExit) {
|
|
|
3700
3708
|
);
|
|
3701
3709
|
config.action(async function() {
|
|
3702
3710
|
await runCommand("config", this, async (ctx) => {
|
|
3703
|
-
const { runConfigList } = await import("./config-
|
|
3711
|
+
const { runConfigList } = await import("./config-WDGMZKHU.js");
|
|
3704
3712
|
return runConfigList(ctx);
|
|
3705
3713
|
});
|
|
3706
3714
|
});
|
|
3707
3715
|
addGlobalFlags(config.command("get <key>")).description("Print one effective config value").action(async function(key) {
|
|
3708
3716
|
await runCommand("config.get", this, async (ctx) => {
|
|
3709
|
-
const { runConfigGet } = await import("./config-
|
|
3717
|
+
const { runConfigGet } = await import("./config-WDGMZKHU.js");
|
|
3710
3718
|
return runConfigGet({ key }, ctx);
|
|
3711
3719
|
});
|
|
3712
3720
|
});
|
|
3713
3721
|
addGlobalFlags(config.command("set <key> <value>")).description("Set a config value (decimal USD accepted for spend keys)").action(async function(key, value) {
|
|
3714
3722
|
await runCommand("config.set", this, async (ctx) => {
|
|
3715
|
-
const { runConfigSet } = await import("./config-
|
|
3723
|
+
const { runConfigSet } = await import("./config-WDGMZKHU.js");
|
|
3716
3724
|
return runConfigSet({ key, value }, ctx);
|
|
3717
3725
|
});
|
|
3718
3726
|
});
|
|
@@ -3725,28 +3733,44 @@ function buildProgram(io, setExit) {
|
|
|
3725
3733
|
).action(async function() {
|
|
3726
3734
|
await runCommand("wallet.create", this, async (ctx) => {
|
|
3727
3735
|
const o = this.opts();
|
|
3728
|
-
const { runWalletCreate } = await import("./wallet-
|
|
3736
|
+
const { runWalletCreate } = await import("./wallet-WJ6UP5OU.js");
|
|
3729
3737
|
return runWalletCreate(ctx, o.replace === true ? { replace: true } : {});
|
|
3730
3738
|
});
|
|
3731
3739
|
});
|
|
3732
3740
|
addGlobalFlags(wallet.command("show")).description("Show the wallet address and key source (never the key)").action(async function() {
|
|
3733
3741
|
await runCommand("wallet.show", this, async (ctx) => {
|
|
3734
|
-
const { runWalletShow } = await import("./wallet-
|
|
3742
|
+
const { runWalletShow } = await import("./wallet-WJ6UP5OU.js");
|
|
3735
3743
|
return runWalletShow(ctx);
|
|
3736
3744
|
});
|
|
3737
3745
|
});
|
|
3738
3746
|
addGlobalFlags(wallet.command("balance")).description("Show the wallet USDC balance on Base").action(async function() {
|
|
3739
3747
|
await runCommand("wallet.balance", this, async (ctx) => {
|
|
3740
|
-
const { runWalletBalance } = await import("./wallet-
|
|
3748
|
+
const { runWalletBalance } = await import("./wallet-WJ6UP5OU.js");
|
|
3741
3749
|
return runWalletBalance(ctx);
|
|
3742
3750
|
});
|
|
3743
3751
|
});
|
|
3752
|
+
addGlobalFlags(program2.command("fund [amountUsd]")).description(
|
|
3753
|
+
"Fund THIS wallet by card via Coinbase Onramp: mint a checkout link bound to this machine, open it in the browser, and wait for the USDC to land on Base"
|
|
3754
|
+
).option("--no-open", "print the checkout link without opening a browser").option(
|
|
3755
|
+
"--no-wait",
|
|
3756
|
+
"return once the link is issued instead of polling the balance (already the default when not at a TTY)"
|
|
3757
|
+
).action(async function(amountUsd) {
|
|
3758
|
+
await runCommand("fund", this, async (ctx) => {
|
|
3759
|
+
const o = this.opts();
|
|
3760
|
+
const { runFund } = await import("./fund-OKK627GL.js");
|
|
3761
|
+
return runFund(ctx, {
|
|
3762
|
+
...amountUsd !== void 0 ? { amountUsd } : {},
|
|
3763
|
+
...o.open === false ? { open: false } : {},
|
|
3764
|
+
...o.wait === false ? { wait: false } : {}
|
|
3765
|
+
});
|
|
3766
|
+
});
|
|
3767
|
+
});
|
|
3744
3768
|
addGlobalFlags(program2.command("send <amount> <token> <to>")).description(
|
|
3745
3769
|
"Move funds OUT of the agent wallet (escape hatch): preview the resolved recipient and amount, confirm explicitly, then transfer on Base and print the tx hash. USDC only"
|
|
3746
3770
|
).option("--yes", "skip the interactive confirm (required to send when not at a TTY)").action(async function(amount, token, to) {
|
|
3747
3771
|
await runCommand("send", this, async (ctx) => {
|
|
3748
3772
|
const o = this.opts();
|
|
3749
|
-
const { runSend } = await import("./send-
|
|
3773
|
+
const { runSend } = await import("./send-F34ZDXDZ.js");
|
|
3750
3774
|
return runSend({ amount, token, to, ...o.yes === true ? { yes: true } : {} }, ctx);
|
|
3751
3775
|
});
|
|
3752
3776
|
});
|
|
@@ -3755,7 +3779,7 @@ function buildProgram(io, setExit) {
|
|
|
3755
3779
|
).option("--max-price <usd>", "only candidates at or below this decimal-USD price").option("--fresh-within <window>", "freshness window, e.g. P30D, P2W, P1Y").option("--limit <n>", "maximum candidates (1-10, default 5)").option("--applies-to <pair>", "applicability filter key=value (repeatable)", collect, []).action(async function(question) {
|
|
3756
3780
|
await runCommand("search", this, async (ctx) => {
|
|
3757
3781
|
const o = this.opts();
|
|
3758
|
-
const { runSearch } = await import("./search-
|
|
3782
|
+
const { runSearch } = await import("./search-ZWOP4EGK.js");
|
|
3759
3783
|
return runSearch(
|
|
3760
3784
|
{
|
|
3761
3785
|
question,
|
|
@@ -3772,7 +3796,7 @@ function buildProgram(io, setExit) {
|
|
|
3772
3796
|
"Show a candidate's pre-purchase card / preview. Use after search, before buy, to check price, scope, and freshness; it never pays"
|
|
3773
3797
|
).action(async function(resource) {
|
|
3774
3798
|
await runCommand("inspect", this, async (ctx) => {
|
|
3775
|
-
const { runInspect } = await import("./inspect-
|
|
3799
|
+
const { runInspect } = await import("./inspect-573WHEV4.js");
|
|
3776
3800
|
return runInspect({ ref: resource }, ctx);
|
|
3777
3801
|
});
|
|
3778
3802
|
});
|
|
@@ -3784,7 +3808,7 @@ function buildProgram(io, setExit) {
|
|
|
3784
3808
|
).action(async function(resource) {
|
|
3785
3809
|
await runCommand("read", this, async (ctx) => {
|
|
3786
3810
|
const o = this.opts();
|
|
3787
|
-
const { runRead } = await import("./read-
|
|
3811
|
+
const { runRead } = await import("./read-PJ7Z6UGF.js");
|
|
3788
3812
|
return runRead(
|
|
3789
3813
|
{
|
|
3790
3814
|
ref: resource,
|
|
@@ -3805,7 +3829,7 @@ function buildProgram(io, setExit) {
|
|
|
3805
3829
|
).option("--scope <scope>", "session scope; this version mints `read` only (default: read)").action(async function() {
|
|
3806
3830
|
await runCommand("session.start", this, async (ctx) => {
|
|
3807
3831
|
const o = this.opts();
|
|
3808
|
-
const { runSessionStart } = await import("./session-
|
|
3832
|
+
const { runSessionStart } = await import("./session-4N4ZT3AH.js");
|
|
3809
3833
|
return runSessionStart(typeof o.scope === "string" ? { scope: o.scope } : {}, ctx);
|
|
3810
3834
|
});
|
|
3811
3835
|
});
|
|
@@ -3817,7 +3841,7 @@ function buildProgram(io, setExit) {
|
|
|
3817
3841
|
).action(async function(resource) {
|
|
3818
3842
|
await runCommand("buy", this, async (ctx) => {
|
|
3819
3843
|
const o = this.opts();
|
|
3820
|
-
const { runBuy } = await import("./buy-
|
|
3844
|
+
const { runBuy } = await import("./buy-THMVOPUH.js");
|
|
3821
3845
|
return runBuy(
|
|
3822
3846
|
{
|
|
3823
3847
|
ref: resource,
|
|
@@ -3831,22 +3855,26 @@ function buildProgram(io, setExit) {
|
|
|
3831
3855
|
});
|
|
3832
3856
|
});
|
|
3833
3857
|
addGlobalFlags(program2.command("publish [file]")).description(
|
|
3834
|
-
"Publish a Markdown file
|
|
3858
|
+
"Publish a Markdown file as a paid or free piece with an optional answer card, gated by the local scan and your publish.mode consent. Use to ship knowledge others can buy; a secret in the file hard-blocks, and soft findings need --yes"
|
|
3835
3859
|
).option(
|
|
3836
|
-
"--
|
|
3837
|
-
"
|
|
3838
|
-
).option("--draft", "save as a private draft instead of publishing").option("--yes", "clear soft findings and the review confirm (never a hard block)").option("--mode <mode>", "consent mode for this run: review | auto | full-auto").option("--price <usd>", "post price in decimal USD (defaults to publish.defaultPrice)").option(
|
|
3860
|
+
"--search-id <id>",
|
|
3861
|
+
"the search this file answers (closes its open loop, and prefills its question)"
|
|
3862
|
+
).option("--draft", "save as a private draft instead of publishing").option("--yes", "clear soft findings and the review confirm (never a hard block)").option("--mode <mode>", "consent mode for this run: review | auto | full-auto").option("--price <usd>", "post price in decimal USD (defaults to publish.defaultPrice)").option(
|
|
3863
|
+
"--excerpt <text>",
|
|
3864
|
+
"the public preview text (max 500 chars; default: derived from the body)"
|
|
3865
|
+
).option("--question <text>", "a question this piece answers (repeatable)", collect, []).option("--task <text>", "a task this piece supports (repeatable)", collect, []).option("--scope <text>", "what the piece covers (card scope)").option("--exclusions <text>", "what the piece does not cover (card exclusions)").option("--applies-to <pair>", "applicability key=value (repeatable)", collect, []).option("--as-of <iso>", "as-of timestamp, ISO-8601 with offset").option("--valid-until <iso>", "valid-until timestamp, ISO-8601 with offset").option("--artifact-type <type>", "document | skill | dataset").option("--temporal-mode <mode>", "snapshot | maintained | evergreen").option("--provenance <text>", "provenance summary (card)").option("--methodology <text>", "methodology summary (card)").action(async function(file) {
|
|
3839
3866
|
await runCommand("publish", this, async (ctx) => {
|
|
3840
3867
|
const o = this.opts();
|
|
3841
|
-
const { runPublish } = await import("./publish-
|
|
3868
|
+
const { runPublish } = await import("./publish-N5U4XYVA.js");
|
|
3842
3869
|
return runPublish(
|
|
3843
3870
|
{
|
|
3844
3871
|
...typeof file === "string" ? { file } : {},
|
|
3845
|
-
...typeof o.
|
|
3872
|
+
...typeof o.searchId === "string" ? { searchId: o.searchId } : {},
|
|
3846
3873
|
...o.draft === true ? { draft: true } : {},
|
|
3847
3874
|
...o.yes === true ? { yes: true } : {},
|
|
3848
3875
|
...typeof o.mode === "string" ? { mode: o.mode } : {},
|
|
3849
3876
|
...typeof o.price === "string" ? { price: o.price } : {},
|
|
3877
|
+
...typeof o.excerpt === "string" ? { excerpt: o.excerpt } : {},
|
|
3850
3878
|
...Array.isArray(o.question) && o.question.length > 0 ? { question: o.question } : {},
|
|
3851
3879
|
...Array.isArray(o.task) && o.task.length > 0 ? { task: o.task } : {},
|
|
3852
3880
|
...typeof o.scope === "string" ? { scope: o.scope } : {},
|
|
@@ -3893,7 +3921,7 @@ function buildProgram(io, setExit) {
|
|
|
3893
3921
|
).action(async function(postId) {
|
|
3894
3922
|
await runCommand("edit", this, async (ctx) => {
|
|
3895
3923
|
const o = this.opts();
|
|
3896
|
-
const { runEdit } = await import("./edit-
|
|
3924
|
+
const { runEdit } = await import("./edit-E7N6F3OY.js");
|
|
3897
3925
|
return runEdit(
|
|
3898
3926
|
{
|
|
3899
3927
|
postId,
|
|
@@ -3933,7 +3961,7 @@ function buildProgram(io, setExit) {
|
|
|
3933
3961
|
).option("--resource <id>", "the resourceId the outcome concerns").option("--content-hash <hash>", "sha256:<64hex> of the exact body read").action(async function() {
|
|
3934
3962
|
await runCommand("outcome", this, async (ctx) => {
|
|
3935
3963
|
const o = this.opts();
|
|
3936
|
-
const { runOutcome } = await import("./outcome-
|
|
3964
|
+
const { runOutcome } = await import("./outcome-W3KYGF23.js");
|
|
3937
3965
|
return runOutcome(
|
|
3938
3966
|
{
|
|
3939
3967
|
status: String(o.status),
|
|
@@ -3946,40 +3974,9 @@ function buildProgram(io, setExit) {
|
|
|
3946
3974
|
);
|
|
3947
3975
|
});
|
|
3948
3976
|
});
|
|
3949
|
-
const candidate = addGlobalFlags(
|
|
3950
|
-
program2.command("candidate").description(
|
|
3951
|
-
"Manage local publish candidates (parked drafts; nothing uploads until publish)"
|
|
3952
|
-
)
|
|
3953
|
-
);
|
|
3954
|
-
addGlobalFlags(candidate.command("add <file>")).description("Park a Markdown draft as a publish candidate, tied to a search").requiredOption("--search-id <id>", "the search whose unmet demand this draft answers").option("--question <q>", "the question this draft answers").action(async function(file) {
|
|
3955
|
-
await runCommand("candidate.add", this, async (ctx) => {
|
|
3956
|
-
const o = this.opts();
|
|
3957
|
-
const { runCandidateAdd } = await import("./candidate-7LAELUQD.js");
|
|
3958
|
-
return runCandidateAdd(
|
|
3959
|
-
{
|
|
3960
|
-
file,
|
|
3961
|
-
searchId: String(o.searchId),
|
|
3962
|
-
...typeof o.question === "string" ? { question: o.question } : {}
|
|
3963
|
-
},
|
|
3964
|
-
ctx
|
|
3965
|
-
);
|
|
3966
|
-
});
|
|
3967
|
-
});
|
|
3968
|
-
addGlobalFlags(candidate.command("list")).description("List pending candidates, newest first").action(async function() {
|
|
3969
|
-
await runCommand("candidate.list", this, async (ctx) => {
|
|
3970
|
-
const { runCandidateList } = await import("./candidate-7LAELUQD.js");
|
|
3971
|
-
return runCandidateList(ctx);
|
|
3972
|
-
});
|
|
3973
|
-
});
|
|
3974
|
-
addGlobalFlags(candidate.command("drop <id>")).description("Discard a pending candidate (never auto-deleted)").action(async function(id) {
|
|
3975
|
-
await runCommand("candidate.drop", this, async (ctx) => {
|
|
3976
|
-
const { runCandidateDrop } = await import("./candidate-7LAELUQD.js");
|
|
3977
|
-
return runCandidateDrop({ id }, ctx);
|
|
3978
|
-
});
|
|
3979
|
-
});
|
|
3980
3977
|
addGlobalFlags(program2.command("mcp")).description("Run a local stdio MCP server exposing the Tenjin command cores to an MCP client").action(async function() {
|
|
3981
3978
|
const ctx = buildContext(this, io);
|
|
3982
|
-
const { runMcpServer } = await import("./run-
|
|
3979
|
+
const { runMcpServer } = await import("./run-FSO3MMXN.js");
|
|
3983
3980
|
await runMcpServer({ dataDir: ctx.dataDir, flags: ctx.flags });
|
|
3984
3981
|
});
|
|
3985
3982
|
return program2;
|
|
@@ -4021,4 +4018,4 @@ export {
|
|
|
4021
4018
|
buildProgram,
|
|
4022
4019
|
main
|
|
4023
4020
|
};
|
|
4024
|
-
//# sourceMappingURL=cli-
|
|
4021
|
+
//# sourceMappingURL=cli-Y2HBOSGK.js.map
|