tenjin-cli 0.1.0-alpha.13 → 0.1.0-alpha.15
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 +51 -3
- package/dist/buy-VIRNSYGN.js +47 -0
- package/dist/{chunk-OC3EIDCP.js → chunk-2MYQN7HM.js} +71 -26
- package/dist/chunk-2MYQN7HM.js.map +1 -0
- package/dist/{chunk-XXY77EZJ.js → chunk-2RF2GIJQ.js} +57 -226
- package/dist/chunk-2RF2GIJQ.js.map +1 -0
- package/dist/chunk-3GL2Z5QK.js +57 -0
- package/dist/chunk-3GL2Z5QK.js.map +1 -0
- package/dist/{chunk-OXUJ3FXU.js → chunk-4CQIDQOT.js} +41 -8
- package/dist/chunk-4CQIDQOT.js.map +1 -0
- package/dist/{chunk-YMUJZWHB.js → chunk-4KG27W2S.js} +10 -10
- package/dist/chunk-4KG27W2S.js.map +1 -0
- package/dist/{chunk-SPUORKD7.js → chunk-5QQTYWEU.js} +13 -13
- package/dist/chunk-5QQTYWEU.js.map +1 -0
- package/dist/chunk-65DTCCJ7.js +21 -0
- package/dist/chunk-65DTCCJ7.js.map +1 -0
- package/dist/{chunk-BRAVLUGI.js → chunk-A5DKHMUN.js} +28 -13
- package/dist/chunk-A5DKHMUN.js.map +1 -0
- package/dist/chunk-B63XPWQ4.js +246 -0
- package/dist/chunk-B63XPWQ4.js.map +1 -0
- package/dist/{chunk-47YKYDOF.js → chunk-CAR6FHK6.js} +5 -5
- package/dist/{chunk-JVBMPU5G.js → chunk-CPCX67TI.js} +22 -22
- package/dist/{chunk-TXVC46SA.js → chunk-CQBVCYI2.js} +40 -53
- package/dist/chunk-CQBVCYI2.js.map +1 -0
- package/dist/chunk-DBU5CXBV.js +4731 -0
- package/dist/chunk-DBU5CXBV.js.map +1 -0
- package/dist/chunk-DHJD77OW.js +81 -0
- package/dist/chunk-DHJD77OW.js.map +1 -0
- package/dist/{chunk-XGZ5EVMB.js → chunk-EDZSNPE5.js} +2 -2
- package/dist/{chunk-736DW4V3.js → chunk-EFWZPUTC.js} +2 -2
- package/dist/chunk-EPFL6CTE.js +448 -0
- package/dist/chunk-EPFL6CTE.js.map +1 -0
- package/dist/{chunk-3P3ES4XU.js → chunk-GHLVXVZD.js} +3 -5
- package/dist/{chunk-3P3ES4XU.js.map → chunk-GHLVXVZD.js.map} +1 -1
- package/dist/{chunk-UUARTUY2.js → chunk-H3SOOJ2I.js} +264 -33
- package/dist/chunk-H3SOOJ2I.js.map +1 -0
- package/dist/{chunk-OUJDDY5L.js → chunk-HPJGOLTN.js} +32 -32
- package/dist/chunk-HPJGOLTN.js.map +1 -0
- package/dist/{chunk-J6FUAIRR.js → chunk-HRGBS2PA.js} +4 -6
- package/dist/{chunk-J6FUAIRR.js.map → chunk-HRGBS2PA.js.map} +1 -1
- package/dist/{chunk-NKN4YC5C.js → chunk-ITUXPJIS.js} +55 -58
- package/dist/chunk-ITUXPJIS.js.map +1 -0
- package/dist/{chunk-CA3JV7FX.js → chunk-JBIKAAT3.js} +2 -2
- package/dist/{chunk-CA3JV7FX.js.map → chunk-JBIKAAT3.js.map} +1 -1
- package/dist/{chunk-6JKD46OJ.js → chunk-KAJZHIQ4.js} +13 -10
- package/dist/chunk-KAJZHIQ4.js.map +1 -0
- package/dist/{chunk-OWVVI4VQ.js → chunk-KINZ23CV.js} +107 -4535
- package/dist/chunk-KINZ23CV.js.map +1 -0
- package/dist/{chunk-WMFRCSNC.js → chunk-LRYV3SK7.js} +9 -7
- package/dist/{chunk-WMFRCSNC.js.map → chunk-LRYV3SK7.js.map} +1 -1
- package/dist/{chunk-T4UWMVKV.js → chunk-NIKXHWOL.js} +11 -13
- package/dist/{chunk-T4UWMVKV.js.map → chunk-NIKXHWOL.js.map} +1 -1
- package/dist/chunk-OKDRDT74.js +209 -0
- package/dist/chunk-OKDRDT74.js.map +1 -0
- package/dist/chunk-OKYSNAS3.js +2144 -0
- package/dist/chunk-OKYSNAS3.js.map +1 -0
- package/dist/{chunk-B676GPS2.js → chunk-OLWTRUTS.js} +7 -3
- package/dist/{chunk-B676GPS2.js.map → chunk-OLWTRUTS.js.map} +1 -1
- package/dist/{chunk-WU5CZPLD.js → chunk-QQ6ELLSA.js} +6 -8
- package/dist/{chunk-WU5CZPLD.js.map → chunk-QQ6ELLSA.js.map} +1 -1
- package/dist/{chunk-WVHPGQH5.js → chunk-QZ6ROAJU.js} +8 -4
- package/dist/chunk-QZ6ROAJU.js.map +1 -0
- package/dist/{chunk-L4XNT3UW.js → chunk-R7RSCBI7.js} +167 -52
- package/dist/chunk-R7RSCBI7.js.map +1 -0
- package/dist/{chunk-ELVDOTU7.js → chunk-U6VPKMGC.js} +128 -28
- package/dist/chunk-U6VPKMGC.js.map +1 -0
- package/dist/{chunk-FKSAUOJU.js → chunk-UO22YNY4.js} +1 -69
- package/dist/chunk-UO22YNY4.js.map +1 -0
- package/dist/{chunk-IAR25V2E.js → chunk-US456VUI.js} +6 -6
- package/dist/{chunk-IKAJSA7E.js → chunk-V44J2MXV.js} +80 -34
- package/dist/chunk-V44J2MXV.js.map +1 -0
- package/dist/{chunk-IFPKA32J.js → chunk-VJQKL3YH.js} +10 -7
- package/dist/{chunk-IFPKA32J.js.map → chunk-VJQKL3YH.js.map} +1 -1
- package/dist/{chunk-GCGMXA2O.js → chunk-VJSQSLBM.js} +52 -20
- package/dist/chunk-VJSQSLBM.js.map +1 -0
- package/dist/{chunk-IGHSLJUF.js → chunk-VYOJOX4Z.js} +9 -7
- package/dist/chunk-VYOJOX4Z.js.map +1 -0
- package/dist/chunk-WY2K35OL.js +269 -0
- package/dist/chunk-WY2K35OL.js.map +1 -0
- package/dist/{chunk-PAOVPSP6.js → chunk-ZFJJ3EXC.js} +53 -5
- package/dist/chunk-ZFJJ3EXC.js.map +1 -0
- package/dist/chunk-ZOBNS7CX.js +73 -0
- package/dist/chunk-ZOBNS7CX.js.map +1 -0
- package/dist/{cli-XK5JZWU6.js → cli-KKRKBU5T.js} +76 -47
- package/dist/{cli-XK5JZWU6.js.map → cli-KKRKBU5T.js.map} +1 -1
- package/dist/config-JMRUNYE6.js +37 -0
- package/dist/discover-B5HF6SHM.js +102 -0
- package/dist/discover-B5HF6SHM.js.map +1 -0
- package/dist/doctor-ZBG7X66D.js +32 -0
- package/dist/edit-PZJIILQE.js +40 -0
- package/dist/{fund-JF6A76YS.js → fund-EUDH5KPA.js} +19 -17
- package/dist/index.js +1 -1
- package/dist/inspect-QC6WEQPN.js +37 -0
- package/dist/{install-YQVM3SUW.js → install-GNK2W3PI.js} +286 -447
- package/dist/install-GNK2W3PI.js.map +1 -0
- package/dist/outcome-KSGWZHUS.js +24 -0
- package/dist/pay-BC4UICPA.js +361 -0
- package/dist/pay-BC4UICPA.js.map +1 -0
- package/dist/publish-LXWFDIKF.js +42 -0
- package/dist/{read-UF7QVQOU.js → read-JMNUQ56P.js} +22 -20
- package/dist/{read-UF7QVQOU.js.map → read-JMNUQ56P.js.map} +1 -1
- package/dist/{run-GDZWHNWZ.js → run-XYTQ5TWQ.js} +54 -45
- package/dist/{run-GDZWHNWZ.js.map → run-XYTQ5TWQ.js.map} +1 -1
- package/dist/search-TSQAB45E.js +25 -0
- package/dist/{send-SI254H3R.js → send-G746D7PQ.js} +14 -14
- package/dist/{session-GJZJEXLJ.js → session-JBKWMJ24.js} +18 -17
- package/dist/{session-GJZJEXLJ.js.map → session-JBKWMJ24.js.map} +1 -1
- package/dist/{skill-heal-BPFT22XS.js → skill-heal-WKD67SLJ.js} +17 -9
- package/dist/skill-heal-WKD67SLJ.js.map +1 -0
- package/dist/skill-placement-RIU4AMC2.js +20 -0
- package/dist/{uninstall-7ZZG6WQ5.js → uninstall-5E263VTS.js} +15 -9
- package/dist/uninstall-5E263VTS.js.map +1 -0
- package/dist/{update-FPSBITLB.js → update-R76LHOZW.js} +18 -16
- package/dist/update-R76LHOZW.js.map +1 -0
- package/dist/{wallet-NS7TYWNN.js → wallet-TQ7D5EQ7.js} +7 -7
- package/dist/{wallet-TZVD2M4I.js → wallet-ZAVXWLWP.js} +11 -11
- package/dist/wallet-ZAVXWLWP.js.map +1 -0
- package/docs/agent-permissions.md +117 -18
- package/docs/command-reference.md +102 -50
- package/docs/safety-model.md +9 -0
- package/package.json +1 -1
- package/skills/tenjin/SKILL.md +38 -29
- package/skills/tenjin-pay/SKILL.md +76 -0
- package/skills/tenjin-publish/SKILL.md +184 -205
- package/skills/tenjin-publish/references/maintain.md +39 -0
- package/skills/tenjin-search/SKILL.md +92 -280
- package/skills/tenjin-search/references/permissions.md +112 -0
- package/dist/buy-X4VPHFUA.js +0 -44
- package/dist/chunk-3NZCU6SD.js +0 -125
- package/dist/chunk-3NZCU6SD.js.map +0 -1
- package/dist/chunk-6JKD46OJ.js.map +0 -1
- package/dist/chunk-BRAVLUGI.js.map +0 -1
- package/dist/chunk-ELVDOTU7.js.map +0 -1
- package/dist/chunk-FKSAUOJU.js.map +0 -1
- package/dist/chunk-GCGMXA2O.js.map +0 -1
- package/dist/chunk-IGHSLJUF.js.map +0 -1
- package/dist/chunk-IKAJSA7E.js.map +0 -1
- package/dist/chunk-L4XNT3UW.js.map +0 -1
- package/dist/chunk-NKN4YC5C.js.map +0 -1
- package/dist/chunk-OC3EIDCP.js.map +0 -1
- package/dist/chunk-OE36HRWG.js +0 -939
- package/dist/chunk-OE36HRWG.js.map +0 -1
- package/dist/chunk-OUJDDY5L.js.map +0 -1
- package/dist/chunk-OWVVI4VQ.js.map +0 -1
- package/dist/chunk-OXUJ3FXU.js.map +0 -1
- package/dist/chunk-PAOVPSP6.js.map +0 -1
- package/dist/chunk-SPUORKD7.js.map +0 -1
- package/dist/chunk-TXVC46SA.js.map +0 -1
- package/dist/chunk-UUARTUY2.js.map +0 -1
- package/dist/chunk-WVHPGQH5.js.map +0 -1
- package/dist/chunk-XXY77EZJ.js.map +0 -1
- package/dist/chunk-YMUJZWHB.js.map +0 -1
- package/dist/chunk-ZQIQ55KK.js +0 -51
- package/dist/chunk-ZQIQ55KK.js.map +0 -1
- package/dist/config-CNK7MYUR.js +0 -26
- package/dist/doctor-R7N7FUX5.js +0 -27
- package/dist/edit-QSUEG7CL.js +0 -38
- package/dist/inspect-NFNAA4LA.js +0 -35
- package/dist/install-YQVM3SUW.js.map +0 -1
- package/dist/outcome-IUSYFJTN.js +0 -22
- package/dist/publish-O2I6IAEL.js +0 -40
- package/dist/search-JVOHEF3E.js +0 -23
- package/dist/skill-heal-BPFT22XS.js.map +0 -1
- package/dist/uninstall-7ZZG6WQ5.js.map +0 -1
- package/dist/update-FPSBITLB.js.map +0 -1
- /package/dist/{buy-X4VPHFUA.js.map → buy-VIRNSYGN.js.map} +0 -0
- /package/dist/{chunk-47YKYDOF.js.map → chunk-CAR6FHK6.js.map} +0 -0
- /package/dist/{chunk-JVBMPU5G.js.map → chunk-CPCX67TI.js.map} +0 -0
- /package/dist/{chunk-XGZ5EVMB.js.map → chunk-EDZSNPE5.js.map} +0 -0
- /package/dist/{chunk-736DW4V3.js.map → chunk-EFWZPUTC.js.map} +0 -0
- /package/dist/{chunk-IAR25V2E.js.map → chunk-US456VUI.js.map} +0 -0
- /package/dist/{config-CNK7MYUR.js.map → config-JMRUNYE6.js.map} +0 -0
- /package/dist/{doctor-R7N7FUX5.js.map → doctor-ZBG7X66D.js.map} +0 -0
- /package/dist/{edit-QSUEG7CL.js.map → edit-PZJIILQE.js.map} +0 -0
- /package/dist/{fund-JF6A76YS.js.map → fund-EUDH5KPA.js.map} +0 -0
- /package/dist/{inspect-NFNAA4LA.js.map → inspect-QC6WEQPN.js.map} +0 -0
- /package/dist/{outcome-IUSYFJTN.js.map → outcome-KSGWZHUS.js.map} +0 -0
- /package/dist/{publish-O2I6IAEL.js.map → publish-LXWFDIKF.js.map} +0 -0
- /package/dist/{search-JVOHEF3E.js.map → search-TSQAB45E.js.map} +0 -0
- /package/dist/{send-SI254H3R.js.map → send-G746D7PQ.js.map} +0 -0
- /package/dist/{wallet-NS7TYWNN.js.map → skill-placement-RIU4AMC2.js.map} +0 -0
- /package/dist/{wallet-TZVD2M4I.js.map → wallet-TQ7D5EQ7.js.map} +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/lib/lock.ts
|
|
4
|
+
import { mkdirSync, rmSync } from "fs";
|
|
5
|
+
import { writeFile } from "fs/promises";
|
|
6
|
+
import { join } from "path";
|
|
7
|
+
var owned = /* @__PURE__ */ new Set();
|
|
8
|
+
function ownsAnyLock() {
|
|
9
|
+
return owned.size > 0;
|
|
10
|
+
}
|
|
11
|
+
function releaseOwnedLocks() {
|
|
12
|
+
for (const path of owned) {
|
|
13
|
+
try {
|
|
14
|
+
rmSync(path, { recursive: true, force: true });
|
|
15
|
+
} catch {
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
owned.clear();
|
|
19
|
+
}
|
|
20
|
+
var DEFAULTS = { timeoutMs: 5e3, retryMs: 25 };
|
|
21
|
+
var LockTimeoutError = class extends Error {
|
|
22
|
+
lockPath;
|
|
23
|
+
constructor(lockPath, timeoutMs) {
|
|
24
|
+
super(
|
|
25
|
+
`Timed out waiting for lock at ${lockPath} after ${timeoutMs}ms; if no other tenjin process is running, remove that directory and retry.`
|
|
26
|
+
);
|
|
27
|
+
this.name = "LockTimeoutError";
|
|
28
|
+
this.lockPath = lockPath;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
async function withFileLock(lockPath, fn, opts = {}) {
|
|
32
|
+
const { timeoutMs, retryMs } = { ...DEFAULTS, ...opts };
|
|
33
|
+
const metaPath = join(lockPath, "meta");
|
|
34
|
+
const deadline = Date.now() + timeoutMs;
|
|
35
|
+
for (; ; ) {
|
|
36
|
+
try {
|
|
37
|
+
mkdirSync(lockPath);
|
|
38
|
+
owned.add(lockPath);
|
|
39
|
+
break;
|
|
40
|
+
} catch (err) {
|
|
41
|
+
if (!isEexist(err)) throw err;
|
|
42
|
+
if (Date.now() >= deadline) throw new LockTimeoutError(lockPath, timeoutMs);
|
|
43
|
+
await delay(retryMs);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
await writeFile(metaPath, JSON.stringify({ pid: process.pid, acquiredAt: Date.now() })).catch(
|
|
47
|
+
() => void 0
|
|
48
|
+
);
|
|
49
|
+
try {
|
|
50
|
+
return await fn();
|
|
51
|
+
} finally {
|
|
52
|
+
try {
|
|
53
|
+
rmSync(lockPath, { recursive: true, force: true });
|
|
54
|
+
owned.delete(lockPath);
|
|
55
|
+
} catch (err) {
|
|
56
|
+
opts.onReleaseError?.(lockPath, err);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function isEexist(err) {
|
|
61
|
+
return typeof err === "object" && err !== null && err.code === "EEXIST";
|
|
62
|
+
}
|
|
63
|
+
function delay(ms) {
|
|
64
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
ownsAnyLock,
|
|
69
|
+
releaseOwnedLocks,
|
|
70
|
+
LockTimeoutError,
|
|
71
|
+
withFileLock
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=chunk-ZOBNS7CX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/lock.ts"],"sourcesContent":["import { mkdirSync, rmSync } from 'node:fs';\nimport { writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\n/**\n * Locks this process currently holds. Ownership starts the instant `mkdir`\n * succeeds and ends when the release has removed the directory, so there is no\n * window where a lock is on disk and unaccounted for. A removal that FAILS keeps\n * the lock owned: the directory is still on disk, no successor can claim the path\n * while it exists, and a signal-time release gets another attempt. The one place\n * ownership is dropped without a successful removal is `releaseOwnedLocks`, which\n * runs only as the process exits, where a claim held by a dying process helps\n * nobody.\n *\n * It exists because the default signal action terminates WITHOUT running\n * `finally`: without this, one Ctrl-C leaves a lock nothing will ever clean and\n * every later run of the same command times out on it.\n */\nconst owned = new Set<string>();\n\n/** Does this process hold any lock right now? */\nexport function ownsAnyLock(): boolean {\n return owned.size > 0;\n}\n\n/**\n * Synchronously attempt to release every lock this process holds. BEST EFFORT: a\n * path that refuses to be removed is left on disk and the next run's timeout names\n * it. Safe to call from a signal handler, and a no-op when this process holds\n * none, so a run merely QUEUED behind another cannot remove that other run's lock.\n */\nexport function releaseOwnedLocks(): void {\n for (const path of owned) {\n // NEVER throws. This runs inside a signal handler, and a throw there is an\n // uncaught exception: the process dies with code 1 and a stack trace instead\n // of the diagnostic and exit 130 the handler promises. One lock we could not\n // remove must not cost the report, or the exit code, or the other locks.\n try {\n rmSync(path, { recursive: true, force: true });\n } catch {\n // Left behind; the next run's timeout names the path.\n }\n }\n owned.clear();\n}\n\nexport interface FileLockOptions {\n /** Give up acquiring after this long (ms). */\n timeoutMs?: number;\n /** Poll interval between acquisition attempts (ms). */\n retryMs?: number;\n /**\n * Called when the lock could not be removed on release. The protected work\n * succeeded, so this is not a failure of the command; it is a leftover that will\n * block later runs, and the caller is the only one able to say so.\n */\n onReleaseError?: (lockPath: string, err: unknown) => void;\n}\n\nconst DEFAULTS = { timeoutMs: 5000, retryMs: 25 };\n\n/** Thrown when the lock cannot be acquired within `timeoutMs`. Carries the lock\n * path so a caller can surface the manual-recovery step in its own error contract. */\nexport class LockTimeoutError extends Error {\n readonly lockPath: string;\n constructor(lockPath: string, timeoutMs: number) {\n super(\n `Timed out waiting for lock at ${lockPath} after ${timeoutMs}ms; if no other tenjin process is running, remove that directory and retry.`,\n );\n this.name = 'LockTimeoutError';\n this.lockPath = lockPath;\n }\n}\n\n/**\n * Minimal cross-process mutex: the lock IS a directory, and mkdir is atomic, so a\n * second holder gets EEXIST and retries with backoff until `timeoutMs`, then\n * throws LockTimeoutError. There is deliberately NO auto-steal of a \"stale\" lock:\n * concurrent waiters each judging a lock stale could remove a fresh holder's\n * directory and lose its update. A crashed holder's lock is recovered by hand (the\n * timeout error names the path); the pid+acquiredAt meta exists only to make that\n * manual call diagnosable. Always released in the finally.\n *\n * ⚠ MIRRORED, MUST UPDATE TOGETHER. The generated WebSearch hook script in\n * lib/hook-scripts.ts (`withStoreLock`) reimplements this protocol byte for byte,\n * because it runs as a standalone .mjs outside the CLI and cannot import this\n * module, yet writes the same searches.json. If you change what the lock IS\n * (directory vs file), where it lives, or the no-stale-steal rule, change it\n * there too. Two writers of one file that disagree about the mutex have no mutex.\n * lib/hook-scripts.test.ts pins the two together and fails loudly on drift.\n */\nexport async function withFileLock<T>(\n lockPath: string,\n fn: () => Promise<T>,\n opts: FileLockOptions = {},\n): Promise<T> {\n const { timeoutMs, retryMs } = { ...DEFAULTS, ...opts };\n const metaPath = join(lockPath, 'meta');\n const deadline = Date.now() + timeoutMs;\n for (;;) {\n try {\n // SYNCHRONOUS, for the same reason the release is: `await mkdir` finishes the\n // syscall before the continuation records ownership, so between the two the\n // directory is on disk and unclaimed. A signal there exits without removing\n // it and, with no stale recovery, nothing ever will. mkdirSync and the add\n // are one uninterruptible step.\n mkdirSync(lockPath);\n owned.add(lockPath); // owned from here, released only in the finally below\n break; // acquired\n } catch (err) {\n if (!isEexist(err)) throw err;\n if (Date.now() >= deadline) throw new LockTimeoutError(lockPath, timeoutMs);\n await delay(retryMs);\n }\n }\n await writeFile(metaPath, JSON.stringify({ pid: process.pid, acquiredAt: Date.now() })).catch(\n () => undefined,\n );\n try {\n return await fn();\n } finally {\n // SYNCHRONOUS, and in this order, because both are load-bearing. A signal\n // handler cannot run between two synchronous statements, so there is no instant\n // where the lock is on disk but unclaimed (a signal would exit without removing\n // it, and with no stale recovery nothing ever would) nor one where it is\n // claimed after release (a signal would remove whatever SUCCESSOR had since\n // acquired the path). An `await` here reopens the first window: `rm` yields, the\n // handler runs, sees no ownership, and leaves the directory behind.\n //\n // With no stealing, nothing else ever removes or replaces this directory, so\n // the lock here is provably the one we created — the unconditional rm is sound.\n try {\n rmSync(lockPath, { recursive: true, force: true });\n owned.delete(lockPath);\n } catch (err) {\n // KEEP ownership when the removal fails: the successor-steal risk only\n // exists once the directory is gone and someone else can take the path, so a\n // removal that failed leaves it on disk and still ours, and a signal-time\n // release gets another attempt. That only helps while THIS process lives,\n // though; once it exits normally the leftover blocks every later run, so the\n // caller is told rather than left to discover it as a timeout.\n opts.onReleaseError?.(lockPath, err);\n }\n }\n}\n\nfunction isEexist(err: unknown): boolean {\n return typeof err === 'object' && err !== null && (err as { code?: unknown }).code === 'EEXIST';\n}\n\nfunction delay(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"],"mappings":";;;AAAA,SAAS,WAAW,cAAc;AAClC,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AAgBrB,IAAM,QAAQ,oBAAI,IAAY;AAGvB,SAAS,cAAuB;AACrC,SAAO,MAAM,OAAO;AACtB;AAQO,SAAS,oBAA0B;AACxC,aAAW,QAAQ,OAAO;AAKxB,QAAI;AACF,aAAO,MAAM,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,IAC/C,QAAQ;AAAA,IAER;AAAA,EACF;AACA,QAAM,MAAM;AACd;AAeA,IAAM,WAAW,EAAE,WAAW,KAAM,SAAS,GAAG;AAIzC,IAAM,mBAAN,cAA+B,MAAM;AAAA,EACjC;AAAA,EACT,YAAY,UAAkB,WAAmB;AAC/C;AAAA,MACE,iCAAiC,QAAQ,UAAU,SAAS;AAAA,IAC9D;AACA,SAAK,OAAO;AACZ,SAAK,WAAW;AAAA,EAClB;AACF;AAmBA,eAAsB,aACpB,UACA,IACA,OAAwB,CAAC,GACb;AACZ,QAAM,EAAE,WAAW,QAAQ,IAAI,EAAE,GAAG,UAAU,GAAG,KAAK;AACtD,QAAM,WAAW,KAAK,UAAU,MAAM;AACtC,QAAM,WAAW,KAAK,IAAI,IAAI;AAC9B,aAAS;AACP,QAAI;AAMF,gBAAU,QAAQ;AAClB,YAAM,IAAI,QAAQ;AAClB;AAAA,IACF,SAAS,KAAK;AACZ,UAAI,CAAC,SAAS,GAAG,EAAG,OAAM;AAC1B,UAAI,KAAK,IAAI,KAAK,SAAU,OAAM,IAAI,iBAAiB,UAAU,SAAS;AAC1E,YAAM,MAAM,OAAO;AAAA,IACrB;AAAA,EACF;AACA,QAAM,UAAU,UAAU,KAAK,UAAU,EAAE,KAAK,QAAQ,KAAK,YAAY,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE;AAAA,IACtF,MAAM;AAAA,EACR;AACA,MAAI;AACF,WAAO,MAAM,GAAG;AAAA,EAClB,UAAE;AAWA,QAAI;AACF,aAAO,UAAU,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AACjD,YAAM,OAAO,QAAQ;AAAA,IACvB,SAAS,KAAK;AAOZ,WAAK,iBAAiB,UAAU,GAAG;AAAA,IACrC;AAAA,EACF;AACF;AAEA,SAAS,SAAS,KAAuB;AACvC,SAAO,OAAO,QAAQ,YAAY,QAAQ,QAAS,IAA2B,SAAS;AACzF;AAEA,SAAS,MAAM,IAA2B;AACxC,SAAO,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,EAAE,CAAC;AACzD;","names":[]}
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
PERMISSIONS_DOC_URL
|
|
4
|
-
} from "./chunk-OXUJ3FXU.js";
|
|
5
2
|
import {
|
|
6
3
|
maybeUpdate,
|
|
7
4
|
readUpdateSignal
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
package_default
|
|
11
|
-
} from "./chunk-CA3JV7FX.js";
|
|
5
|
+
} from "./chunk-HPJGOLTN.js";
|
|
12
6
|
import {
|
|
13
7
|
defaultIo,
|
|
14
8
|
emitFailure,
|
|
15
9
|
emitSuccess
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-ELVDOTU7.js";
|
|
10
|
+
} from "./chunk-OLWTRUTS.js";
|
|
18
11
|
import {
|
|
19
|
-
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
12
|
+
PERMISSIONS_DOC_URL
|
|
13
|
+
} from "./chunk-4CQIDQOT.js";
|
|
14
|
+
import "./chunk-U6VPKMGC.js";
|
|
15
|
+
import {
|
|
16
|
+
package_default
|
|
17
|
+
} from "./chunk-JBIKAAT3.js";
|
|
18
|
+
import "./chunk-2MYQN7HM.js";
|
|
22
19
|
import {
|
|
23
20
|
CliError,
|
|
21
|
+
dataDir,
|
|
24
22
|
external_exports
|
|
25
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-ZFJJ3EXC.js";
|
|
26
24
|
import {
|
|
27
25
|
__commonJS,
|
|
28
26
|
__require,
|
|
@@ -3523,7 +3521,7 @@ function buildProgram(io, setExit) {
|
|
|
3523
3521
|
}
|
|
3524
3522
|
if (command !== "install") {
|
|
3525
3523
|
try {
|
|
3526
|
-
const { healWiredSkills } = await import("./skill-heal-
|
|
3524
|
+
const { healWiredSkills } = await import("./skill-heal-WKD67SLJ.js");
|
|
3527
3525
|
await healWiredSkills({ io });
|
|
3528
3526
|
} catch {
|
|
3529
3527
|
}
|
|
@@ -3542,10 +3540,10 @@ function buildProgram(io, setExit) {
|
|
|
3542
3540
|
}
|
|
3543
3541
|
}).exitOverride();
|
|
3544
3542
|
addGlobalFlags(program2.command("install")).description(
|
|
3545
|
-
"Detect installed harnesses (Claude Code, Codex), wire
|
|
3543
|
+
"Detect installed harnesses (Claude Code, Codex, Hermes), wire Tenjin, then run doctor last"
|
|
3546
3544
|
).option(
|
|
3547
3545
|
"--harness <name>",
|
|
3548
|
-
"target a specific harness: claude | codex | shared (repeatable; overrides detection)",
|
|
3546
|
+
"target a specific harness: claude | codex | hermes | shared (repeatable; overrides detection)",
|
|
3549
3547
|
collect,
|
|
3550
3548
|
[]
|
|
3551
3549
|
).option("--dry-run", "print what would change without writing anything").option(
|
|
@@ -3564,13 +3562,13 @@ function buildProgram(io, setExit) {
|
|
|
3564
3562
|
`write no harness permission rules at all; the default allowlist is the free tier only: none can spend USDC or move your keys, doctor may check your wallet still opens, full caveats: ${PERMISSIONS_DOC_URL}`
|
|
3565
3563
|
).option(
|
|
3566
3564
|
"--search-hooks <mode>",
|
|
3567
|
-
"harness search hooks: auto (check Tenjin before a WebSearch) | remind (static reminder) | off; persisted to hooks.
|
|
3565
|
+
"harness search hooks: auto (check Tenjin before a WebSearch) | remind (static reminder) | off; persisted to hooks.webSearch and hooks.agentDispatch (both auto by default, disjoint)"
|
|
3568
3566
|
).option("--no-hooks", "register no harness hooks this run (writes no config)").action(async function() {
|
|
3569
3567
|
await runCommand("install", this, async (ctx) => {
|
|
3570
3568
|
const o = this.opts();
|
|
3571
3569
|
const claudeMdGiven = this.getOptionValueSource("claudeMd") !== "default";
|
|
3572
3570
|
const allowGiven = this.getOptionValueSource("allowFreeVerbs") !== "default";
|
|
3573
|
-
const { runInstall } = await import("./install-
|
|
3571
|
+
const { runInstall } = await import("./install-GNK2W3PI.js");
|
|
3574
3572
|
return runInstall(
|
|
3575
3573
|
{
|
|
3576
3574
|
...Array.isArray(o.harness) && o.harness.length > 0 ? { harness: o.harness } : {},
|
|
@@ -3587,24 +3585,22 @@ function buildProgram(io, setExit) {
|
|
|
3587
3585
|
});
|
|
3588
3586
|
});
|
|
3589
3587
|
addGlobalFlags(program2.command("uninstall")).description(
|
|
3590
|
-
"Remove everything `tenjin install` wrote: the skills, the harness hooks and their settings entries, and the tenjin permission rules.
|
|
3588
|
+
"Remove everything `tenjin install` wrote: the skills, the harness hooks and their settings entries, the generated hook scripts in ~/.tenjin/hooks, and the tenjin permission rules. Your wallet, config, library and search history are kept"
|
|
3591
3589
|
).action(async function() {
|
|
3592
3590
|
await runCommand("uninstall", this, async (ctx) => {
|
|
3593
|
-
const { runUninstall } = await import("./uninstall-
|
|
3591
|
+
const { runUninstall } = await import("./uninstall-5E263VTS.js");
|
|
3594
3592
|
return runUninstall(ctx);
|
|
3595
3593
|
});
|
|
3596
3594
|
});
|
|
3597
3595
|
addGlobalFlags(program2.command("doctor")).description("Check the local environment and Tenjin API reachability").action(async function() {
|
|
3598
3596
|
await runCommand("doctor", this, async (ctx) => {
|
|
3599
|
-
const { runDoctor } = await import("./doctor-
|
|
3597
|
+
const { runDoctor } = await import("./doctor-ZBG7X66D.js");
|
|
3600
3598
|
return runDoctor(ctx);
|
|
3601
3599
|
});
|
|
3602
3600
|
});
|
|
3603
|
-
addGlobalFlags(program2.command("update")).description(
|
|
3604
|
-
"Update tenjin-cli to the newest version on its release channel (an alpha build follows @alpha)"
|
|
3605
|
-
).option("--check", "report whether a newer version exists without installing it").action(async function() {
|
|
3601
|
+
addGlobalFlags(program2.command("update")).description("Update tenjin-cli to the newest version npm publishes on the latest tag").option("--check", "report whether a newer version exists without installing it").action(async function() {
|
|
3606
3602
|
await runCommand("update", this, async (ctx) => {
|
|
3607
|
-
const { runUpdate } = await import("./update-
|
|
3603
|
+
const { runUpdate } = await import("./update-R76LHOZW.js");
|
|
3608
3604
|
return runUpdate({ check: this.opts().check === true }, ctx);
|
|
3609
3605
|
});
|
|
3610
3606
|
});
|
|
@@ -3613,19 +3609,19 @@ function buildProgram(io, setExit) {
|
|
|
3613
3609
|
);
|
|
3614
3610
|
config.action(async function() {
|
|
3615
3611
|
await runCommand("config", this, async (ctx) => {
|
|
3616
|
-
const { runConfigList } = await import("./config-
|
|
3612
|
+
const { runConfigList } = await import("./config-JMRUNYE6.js");
|
|
3617
3613
|
return runConfigList(ctx);
|
|
3618
3614
|
});
|
|
3619
3615
|
});
|
|
3620
3616
|
addGlobalFlags(config.command("get <key>")).description("Print one effective config value").action(async function(key) {
|
|
3621
3617
|
await runCommand("config.get", this, async (ctx) => {
|
|
3622
|
-
const { runConfigGet } = await import("./config-
|
|
3618
|
+
const { runConfigGet } = await import("./config-JMRUNYE6.js");
|
|
3623
3619
|
return runConfigGet({ key }, ctx);
|
|
3624
3620
|
});
|
|
3625
3621
|
});
|
|
3626
3622
|
addGlobalFlags(config.command("set <key> <value>")).description("Set a config value (decimal USD accepted for spend keys)").action(async function(key, value) {
|
|
3627
3623
|
await runCommand("config.set", this, async (ctx) => {
|
|
3628
|
-
const { runConfigSet } = await import("./config-
|
|
3624
|
+
const { runConfigSet } = await import("./config-JMRUNYE6.js");
|
|
3629
3625
|
return runConfigSet({ key, value }, ctx);
|
|
3630
3626
|
});
|
|
3631
3627
|
});
|
|
@@ -3638,19 +3634,19 @@ function buildProgram(io, setExit) {
|
|
|
3638
3634
|
).action(async function() {
|
|
3639
3635
|
await runCommand("wallet.create", this, async (ctx) => {
|
|
3640
3636
|
const o = this.opts();
|
|
3641
|
-
const { runWalletCreate } = await import("./wallet-
|
|
3637
|
+
const { runWalletCreate } = await import("./wallet-ZAVXWLWP.js");
|
|
3642
3638
|
return runWalletCreate(ctx, o.replace === true ? { replace: true } : {});
|
|
3643
3639
|
});
|
|
3644
3640
|
});
|
|
3645
3641
|
addGlobalFlags(wallet.command("show")).description("Show the wallet address and key source (never the key)").action(async function() {
|
|
3646
3642
|
await runCommand("wallet.show", this, async (ctx) => {
|
|
3647
|
-
const { runWalletShow } = await import("./wallet-
|
|
3643
|
+
const { runWalletShow } = await import("./wallet-ZAVXWLWP.js");
|
|
3648
3644
|
return runWalletShow(ctx);
|
|
3649
3645
|
});
|
|
3650
3646
|
});
|
|
3651
3647
|
addGlobalFlags(wallet.command("balance")).description("Show the wallet USDC balance on Base").action(async function() {
|
|
3652
3648
|
await runCommand("wallet.balance", this, async (ctx) => {
|
|
3653
|
-
const { runWalletBalance } = await import("./wallet-
|
|
3649
|
+
const { runWalletBalance } = await import("./wallet-ZAVXWLWP.js");
|
|
3654
3650
|
return runWalletBalance(ctx);
|
|
3655
3651
|
});
|
|
3656
3652
|
});
|
|
@@ -3662,7 +3658,7 @@ function buildProgram(io, setExit) {
|
|
|
3662
3658
|
).action(async function(amountUsd) {
|
|
3663
3659
|
await runCommand("fund", this, async (ctx) => {
|
|
3664
3660
|
const o = this.opts();
|
|
3665
|
-
const { runFund } = await import("./fund-
|
|
3661
|
+
const { runFund } = await import("./fund-EUDH5KPA.js");
|
|
3666
3662
|
return runFund(ctx, {
|
|
3667
3663
|
...amountUsd !== void 0 ? { amountUsd } : {},
|
|
3668
3664
|
...o.open === false ? { open: false } : {},
|
|
@@ -3675,7 +3671,7 @@ function buildProgram(io, setExit) {
|
|
|
3675
3671
|
).option("--yes", "skip the interactive confirm (required to send when not at a TTY)").action(async function(amount, token, to) {
|
|
3676
3672
|
await runCommand("send", this, async (ctx) => {
|
|
3677
3673
|
const o = this.opts();
|
|
3678
|
-
const { runSend } = await import("./send-
|
|
3674
|
+
const { runSend } = await import("./send-G746D7PQ.js");
|
|
3679
3675
|
return runSend({ amount, token, to, ...o.yes === true ? { yes: true } : {} }, ctx);
|
|
3680
3676
|
});
|
|
3681
3677
|
});
|
|
@@ -3684,7 +3680,7 @@ function buildProgram(io, setExit) {
|
|
|
3684
3680
|
).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) {
|
|
3685
3681
|
await runCommand("search", this, async (ctx) => {
|
|
3686
3682
|
const o = this.opts();
|
|
3687
|
-
const { runSearch } = await import("./search-
|
|
3683
|
+
const { runSearch } = await import("./search-TSQAB45E.js");
|
|
3688
3684
|
return runSearch(
|
|
3689
3685
|
{
|
|
3690
3686
|
question,
|
|
@@ -3701,7 +3697,7 @@ function buildProgram(io, setExit) {
|
|
|
3701
3697
|
"Show a candidate's pre-purchase card / preview. Use after search, before buy, to check price, scope, and freshness; it never pays"
|
|
3702
3698
|
).action(async function(resource) {
|
|
3703
3699
|
await runCommand("inspect", this, async (ctx) => {
|
|
3704
|
-
const { runInspect } = await import("./inspect-
|
|
3700
|
+
const { runInspect } = await import("./inspect-QC6WEQPN.js");
|
|
3705
3701
|
return runInspect({ ref: resource }, ctx);
|
|
3706
3702
|
});
|
|
3707
3703
|
});
|
|
@@ -3713,7 +3709,7 @@ function buildProgram(io, setExit) {
|
|
|
3713
3709
|
).action(async function(resource) {
|
|
3714
3710
|
await runCommand("read", this, async (ctx) => {
|
|
3715
3711
|
const o = this.opts();
|
|
3716
|
-
const { runRead } = await import("./read-
|
|
3712
|
+
const { runRead } = await import("./read-JMNUQ56P.js");
|
|
3717
3713
|
return runRead(
|
|
3718
3714
|
{
|
|
3719
3715
|
ref: resource,
|
|
@@ -3734,10 +3730,37 @@ function buildProgram(io, setExit) {
|
|
|
3734
3730
|
).option("--scope <scope>", "session scope; this version mints `read` only (default: read)").action(async function() {
|
|
3735
3731
|
await runCommand("session.start", this, async (ctx) => {
|
|
3736
3732
|
const o = this.opts();
|
|
3737
|
-
const { runSessionStart } = await import("./session-
|
|
3733
|
+
const { runSessionStart } = await import("./session-JBKWMJ24.js");
|
|
3738
3734
|
return runSessionStart(typeof o.scope === "string" ? { scope: o.scope } : {}, ctx);
|
|
3739
3735
|
});
|
|
3740
3736
|
});
|
|
3737
|
+
addGlobalFlags(program2.command("pay <url>")).description(
|
|
3738
|
+
"Pay any x402 endpoint (exact scheme, USDC on Base): probe, then pay a 402 under the spend policy. The configured base URL is always payable; other origins need the bazaarPay toggle and a registry-verified listing. Every paid call pays: no library, no dedupe (that is `buy`)"
|
|
3739
|
+
).option("-X, --method <method>", "GET (default) or POST (implied by --data)").option("-d, --data <json>", "JSON request body (sent as application/json)").option("--max-price <usd>", "hard price cap in decimal USD (never bypassed by --yes)").option("--yes", "bypass the interactive confirm only (not the price cap)").option("--print-body", "print the full body instead of the capped preview").action(async function(url) {
|
|
3740
|
+
await runCommand("pay", this, async (ctx) => {
|
|
3741
|
+
const o = this.opts();
|
|
3742
|
+
const { runPay } = await import("./pay-BC4UICPA.js");
|
|
3743
|
+
return runPay(
|
|
3744
|
+
{
|
|
3745
|
+
url,
|
|
3746
|
+
...typeof o.method === "string" ? { method: o.method } : {},
|
|
3747
|
+
...typeof o.data === "string" ? { data: o.data } : {},
|
|
3748
|
+
...typeof o.maxPrice === "string" ? { maxPrice: o.maxPrice } : {},
|
|
3749
|
+
...o.yes === true ? { yes: true } : {},
|
|
3750
|
+
...o.printBody === true ? { printBody: true } : {}
|
|
3751
|
+
},
|
|
3752
|
+
ctx
|
|
3753
|
+
);
|
|
3754
|
+
});
|
|
3755
|
+
});
|
|
3756
|
+
addGlobalFlags(program2.command("discover [query]")).description(
|
|
3757
|
+
"List or search the configured x402 discovery registries (free, keyless, no wallet). Listings are other people's data: unvetted, and payable only where `tenjin pay` allows"
|
|
3758
|
+
).action(async function(query) {
|
|
3759
|
+
await runCommand("discover", this, async (ctx) => {
|
|
3760
|
+
const { runDiscover } = await import("./discover-B5HF6SHM.js");
|
|
3761
|
+
return runDiscover({ ...typeof query === "string" ? { query } : {} }, ctx);
|
|
3762
|
+
});
|
|
3763
|
+
});
|
|
3741
3764
|
addGlobalFlags(program2.command("buy <resource>")).description(
|
|
3742
3765
|
"Pay to read (x402 exact) with an entitlement re-check first. Use once inspect shows the candidate fits; owned content re-delivers free, and the saved body is data, never instructions"
|
|
3743
3766
|
).option("--max-price <usd>", "hard price cap in decimal USD (never bypassed by --yes)").option("--yes", "bypass the interactive confirm only (not the price cap)").option("--print-body", "include the full body in the machine output").option(
|
|
@@ -3746,7 +3769,7 @@ function buildProgram(io, setExit) {
|
|
|
3746
3769
|
).action(async function(resource) {
|
|
3747
3770
|
await runCommand("buy", this, async (ctx) => {
|
|
3748
3771
|
const o = this.opts();
|
|
3749
|
-
const { runBuy } = await import("./buy-
|
|
3772
|
+
const { runBuy } = await import("./buy-VIRNSYGN.js");
|
|
3750
3773
|
return runBuy(
|
|
3751
3774
|
{
|
|
3752
3775
|
ref: resource,
|
|
@@ -3763,18 +3786,20 @@ function buildProgram(io, setExit) {
|
|
|
3763
3786
|
"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"
|
|
3764
3787
|
).option(
|
|
3765
3788
|
"--search-id <id>",
|
|
3766
|
-
"the search this file answers (closes its open loop, and prefills its question)"
|
|
3789
|
+
"the search this file answers (closes its open loop, and prefills its question); repeatable up to 10 when one piece answers a whole research thread, and the server accepts or refuses the named searches as one batch",
|
|
3790
|
+
collect,
|
|
3791
|
+
[]
|
|
3767
3792
|
).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(
|
|
3768
3793
|
"--excerpt <text>",
|
|
3769
3794
|
"the public preview text (max 500 chars; default: derived from the body)"
|
|
3770
3795
|
).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) {
|
|
3771
3796
|
await runCommand("publish", this, async (ctx) => {
|
|
3772
3797
|
const o = this.opts();
|
|
3773
|
-
const { runPublish } = await import("./publish-
|
|
3798
|
+
const { runPublish } = await import("./publish-LXWFDIKF.js");
|
|
3774
3799
|
return runPublish(
|
|
3775
3800
|
{
|
|
3776
3801
|
...typeof file === "string" ? { file } : {},
|
|
3777
|
-
...
|
|
3802
|
+
...Array.isArray(o.searchId) && o.searchId.length > 0 ? { searchId: o.searchId } : {},
|
|
3778
3803
|
...o.draft === true ? { draft: true } : {},
|
|
3779
3804
|
...o.yes === true ? { yes: true } : {},
|
|
3780
3805
|
...typeof o.mode === "string" ? { mode: o.mode } : {},
|
|
@@ -3826,7 +3851,7 @@ function buildProgram(io, setExit) {
|
|
|
3826
3851
|
).action(async function(postId) {
|
|
3827
3852
|
await runCommand("edit", this, async (ctx) => {
|
|
3828
3853
|
const o = this.opts();
|
|
3829
|
-
const { runEdit } = await import("./edit-
|
|
3854
|
+
const { runEdit } = await import("./edit-PZJIILQE.js");
|
|
3830
3855
|
return runEdit(
|
|
3831
3856
|
{
|
|
3832
3857
|
postId,
|
|
@@ -3857,21 +3882,25 @@ function buildProgram(io, setExit) {
|
|
|
3857
3882
|
});
|
|
3858
3883
|
addGlobalFlags(program2.command("outcome")).description(
|
|
3859
3884
|
"Report how a search ended, honestly (used, partially_used, rejected, regenerated, purchase_declined). Use after acting on a search; this closes the loop the marketplace learns from"
|
|
3860
|
-
).option("--search-id <id>", "the search to report against").option(
|
|
3885
|
+
).option("--search-id <id>", "the search to report against (repeatable)", collect, []).option(
|
|
3861
3886
|
"--last",
|
|
3862
3887
|
"target the most recent tenjin search (entries the WebSearch hook recorded are skipped; use --search-id for those)"
|
|
3888
|
+
).option(
|
|
3889
|
+
"--all-open",
|
|
3890
|
+
"close this session's open WebSearch-hook MISSes (requires --status regenerated; deliberate and answered searches are left open)"
|
|
3863
3891
|
).requiredOption(
|
|
3864
3892
|
"--status <status>",
|
|
3865
3893
|
"used | partially_used | rejected | regenerated | purchase_declined"
|
|
3866
3894
|
).option("--resource <id>", "the resourceId the outcome concerns").option("--content-hash <hash>", "sha256:<64hex> of the exact body read").action(async function() {
|
|
3867
3895
|
await runCommand("outcome", this, async (ctx) => {
|
|
3868
3896
|
const o = this.opts();
|
|
3869
|
-
const { runOutcome } = await import("./outcome-
|
|
3897
|
+
const { runOutcome } = await import("./outcome-KSGWZHUS.js");
|
|
3870
3898
|
return runOutcome(
|
|
3871
3899
|
{
|
|
3872
3900
|
status: String(o.status),
|
|
3873
|
-
...
|
|
3901
|
+
...Array.isArray(o.searchId) && o.searchId.length > 0 ? { searchId: o.searchId } : {},
|
|
3874
3902
|
...o.last === true ? { last: true } : {},
|
|
3903
|
+
...o.allOpen === true ? { allOpen: true } : {},
|
|
3875
3904
|
...typeof o.resource === "string" ? { resource: o.resource } : {},
|
|
3876
3905
|
...typeof o.contentHash === "string" ? { contentHash: o.contentHash } : {}
|
|
3877
3906
|
},
|
|
@@ -3881,7 +3910,7 @@ function buildProgram(io, setExit) {
|
|
|
3881
3910
|
});
|
|
3882
3911
|
addGlobalFlags(program2.command("mcp")).description("Run a local stdio MCP server exposing the Tenjin command cores to an MCP client").action(async function() {
|
|
3883
3912
|
const ctx = buildContext(this, io);
|
|
3884
|
-
const { runMcpServer } = await import("./run-
|
|
3913
|
+
const { runMcpServer } = await import("./run-XYTQ5TWQ.js");
|
|
3885
3914
|
await runMcpServer({ dataDir: ctx.dataDir, flags: ctx.flags });
|
|
3886
3915
|
});
|
|
3887
3916
|
return program2;
|
|
@@ -3923,4 +3952,4 @@ export {
|
|
|
3923
3952
|
buildProgram,
|
|
3924
3953
|
main
|
|
3925
3954
|
};
|
|
3926
|
-
//# sourceMappingURL=cli-
|
|
3955
|
+
//# sourceMappingURL=cli-KKRKBU5T.js.map
|