tenjin-cli 0.1.0-alpha.19 → 0.1.0-alpha.20
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/dist/{_esm-OVVGTKHH.js → _esm-CE7KNONL.js} +4 -4
- package/dist/{chunk-AMG4SONW.js → chunk-2E6GVIRP.js} +9 -9
- package/dist/{chunk-2SQEFBAM.js → chunk-3BS55ANY.js} +21 -4
- package/dist/chunk-3BS55ANY.js.map +1 -0
- package/dist/{chunk-XNP6VUAJ.js → chunk-4AS52HUG.js} +3 -3
- package/dist/{chunk-LSWVVSFX.js → chunk-4M5FBWT5.js} +18 -50
- package/dist/chunk-4M5FBWT5.js.map +1 -0
- package/dist/{chunk-ZDKEU2GF.js → chunk-5FYKPQNX.js} +3 -3
- package/dist/{chunk-5DOHKQ24.js → chunk-5KD5HRAJ.js} +10 -2
- package/dist/{chunk-5DOHKQ24.js.map → chunk-5KD5HRAJ.js.map} +1 -1
- package/dist/{chunk-ZTFIQC4C.js → chunk-72UHZRG6.js} +2 -2
- package/dist/{chunk-TDGN476R.js → chunk-7ACHDNJA.js} +3 -3
- package/dist/{chunk-Y66XUXVI.js → chunk-AWQPGIR6.js} +5 -5
- package/dist/{chunk-A6CY6BUW.js → chunk-BTX2QE2Y.js} +3 -3
- package/dist/{chunk-UNV4K45L.js → chunk-CCDOV45D.js} +6 -2
- package/dist/{chunk-UNV4K45L.js.map → chunk-CCDOV45D.js.map} +1 -1
- package/dist/{chunk-AISBL7EY.js → chunk-CXUYCDPX.js} +4 -4
- package/dist/{chunk-VFVFVQM6.js → chunk-HH3PDYIG.js} +5 -5
- package/dist/{chunk-FPUPBQHX.js → chunk-HPWO4O6S.js} +2 -2
- package/dist/{chunk-3VYGDRRL.js → chunk-LI44XLMB.js} +5 -5
- package/dist/{chunk-WUU3BH6G.js → chunk-LN2HISWU.js} +2 -2
- package/dist/{chunk-6DCELMQA.js → chunk-N35E6CM2.js} +6 -6
- package/dist/{chunk-FHBGTOFA.js → chunk-NSG5TVZQ.js} +8 -8
- package/dist/{chunk-PZQRSZJV.js → chunk-P42QX3QF.js} +2 -2
- package/dist/{chunk-PZQRSZJV.js.map → chunk-P42QX3QF.js.map} +1 -1
- package/dist/{chunk-SCAOYGKX.js → chunk-PO4HAXAW.js} +55 -31
- package/dist/chunk-PO4HAXAW.js.map +1 -0
- package/dist/{chunk-KTAW4KGH.js → chunk-RGVOODF4.js} +5 -5
- package/dist/chunk-RPR2C2JO.js +112 -0
- package/dist/chunk-RPR2C2JO.js.map +1 -0
- package/dist/{chunk-2BKS2FVE.js → chunk-TU7XH3JJ.js} +5 -1
- package/dist/chunk-TU7XH3JJ.js.map +1 -0
- package/dist/{chunk-XDADPAWW.js → chunk-YEBNE5NW.js} +23 -23
- package/dist/{chunk-BG2EXNAA.js → chunk-YREKMJPP.js} +3 -3
- package/dist/{cli-456F77ZY.js → cli-XJQYUOHI.js} +32 -24
- package/dist/{cli-456F77ZY.js.map → cli-XJQYUOHI.js.map} +1 -1
- package/dist/{config-BLUWOH6S.js → config-KMJLFPSI.js} +8 -8
- package/dist/{doctor-PS45CR3T.js → doctor-KMN55D7U.js} +23 -23
- package/dist/{fund-4SW2ZBWC.js → fund-LT6ZPGEQ.js} +20 -20
- package/dist/{hook-command-YTV7X333.js → hook-command-U5XPEHAJ.js} +31 -23
- package/dist/hook-command-U5XPEHAJ.js.map +1 -0
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/{install-U4BIDCHH.js → install-MMNXJ5LM.js} +11 -11
- package/dist/install-identity-B7FVIWML.js +27 -0
- package/dist/{install-wallet-EYHELQMG.js → install-wallet-XMVUBCHS.js} +14 -14
- package/dist/{mcp-AC4PIXH5.js → mcp-TUPRIPSI.js} +33 -29
- package/dist/{mcp-AC4PIXH5.js.map → mcp-TUPRIPSI.js.map} +1 -1
- package/dist/{paths-P2N4JTDZ.js → paths-LRMWNTJP.js} +4 -2
- package/dist/{pay-VJOP6TFT.js → pay-XAWW3NV3.js} +19 -19
- package/dist/{send-YH75Z6LB.js → send-HESQYRKM.js} +14 -14
- package/dist/{status-5CHCDLUE.js → status-ANZPRZJJ.js} +6 -6
- package/dist/{status-line-CZAZUOAY.js → status-line-J3TUWVRQ.js} +7 -7
- package/dist/{status-line-wiring-2ABDVXSJ.js → status-line-wiring-HSV7DXO5.js} +5 -5
- package/dist/tenjin-daemon.mjs +141 -4
- package/dist/{uninstall-BYVGAQMO.js → uninstall-GUU34YKP.js} +11 -11
- package/dist/{update-7QJDSHST.js → update-KO2NZRJ5.js} +6 -6
- package/dist/{viemAdapter-By13KInL-N2GIVMZ7.js → viemAdapter-By13KInL-X2VY6CY3.js} +2 -2
- package/dist/{wallet-YZOXIXBC.js → wallet-3URC5QPK.js} +14 -14
- package/dist/wallet-3URC5QPK.js.map +1 -0
- package/docs/agent-permissions.md +1 -1
- package/package.json +1 -1
- package/dist/chunk-2BKS2FVE.js.map +0 -1
- package/dist/chunk-2SQEFBAM.js.map +0 -1
- package/dist/chunk-LSWVVSFX.js.map +0 -1
- package/dist/chunk-SCAOYGKX.js.map +0 -1
- package/dist/hook-command-YTV7X333.js.map +0 -1
- /package/dist/{_esm-OVVGTKHH.js.map → _esm-CE7KNONL.js.map} +0 -0
- /package/dist/{chunk-AMG4SONW.js.map → chunk-2E6GVIRP.js.map} +0 -0
- /package/dist/{chunk-XNP6VUAJ.js.map → chunk-4AS52HUG.js.map} +0 -0
- /package/dist/{chunk-ZDKEU2GF.js.map → chunk-5FYKPQNX.js.map} +0 -0
- /package/dist/{chunk-ZTFIQC4C.js.map → chunk-72UHZRG6.js.map} +0 -0
- /package/dist/{chunk-TDGN476R.js.map → chunk-7ACHDNJA.js.map} +0 -0
- /package/dist/{chunk-Y66XUXVI.js.map → chunk-AWQPGIR6.js.map} +0 -0
- /package/dist/{chunk-A6CY6BUW.js.map → chunk-BTX2QE2Y.js.map} +0 -0
- /package/dist/{chunk-AISBL7EY.js.map → chunk-CXUYCDPX.js.map} +0 -0
- /package/dist/{chunk-VFVFVQM6.js.map → chunk-HH3PDYIG.js.map} +0 -0
- /package/dist/{chunk-FPUPBQHX.js.map → chunk-HPWO4O6S.js.map} +0 -0
- /package/dist/{chunk-3VYGDRRL.js.map → chunk-LI44XLMB.js.map} +0 -0
- /package/dist/{chunk-WUU3BH6G.js.map → chunk-LN2HISWU.js.map} +0 -0
- /package/dist/{chunk-6DCELMQA.js.map → chunk-N35E6CM2.js.map} +0 -0
- /package/dist/{chunk-FHBGTOFA.js.map → chunk-NSG5TVZQ.js.map} +0 -0
- /package/dist/{chunk-KTAW4KGH.js.map → chunk-RGVOODF4.js.map} +0 -0
- /package/dist/{chunk-XDADPAWW.js.map → chunk-YEBNE5NW.js.map} +0 -0
- /package/dist/{chunk-BG2EXNAA.js.map → chunk-YREKMJPP.js.map} +0 -0
- /package/dist/{config-BLUWOH6S.js.map → config-KMJLFPSI.js.map} +0 -0
- /package/dist/{doctor-PS45CR3T.js.map → doctor-KMN55D7U.js.map} +0 -0
- /package/dist/{fund-4SW2ZBWC.js.map → fund-LT6ZPGEQ.js.map} +0 -0
- /package/dist/{install-U4BIDCHH.js.map → install-MMNXJ5LM.js.map} +0 -0
- /package/dist/{paths-P2N4JTDZ.js.map → install-identity-B7FVIWML.js.map} +0 -0
- /package/dist/{install-wallet-EYHELQMG.js.map → install-wallet-XMVUBCHS.js.map} +0 -0
- /package/dist/{pay-VJOP6TFT.js.map → paths-LRMWNTJP.js.map} +0 -0
- /package/dist/{status-line-wiring-2ABDVXSJ.js.map → pay-XAWW3NV3.js.map} +0 -0
- /package/dist/{send-YH75Z6LB.js.map → send-HESQYRKM.js.map} +0 -0
- /package/dist/{status-5CHCDLUE.js.map → status-ANZPRZJJ.js.map} +0 -0
- /package/dist/{status-line-CZAZUOAY.js.map → status-line-J3TUWVRQ.js.map} +0 -0
- /package/dist/{viemAdapter-By13KInL-N2GIVMZ7.js.map → status-line-wiring-HSV7DXO5.js.map} +0 -0
- /package/dist/{uninstall-BYVGAQMO.js.map → uninstall-GUU34YKP.js.map} +0 -0
- /package/dist/{update-7QJDSHST.js.map → update-KO2NZRJ5.js.map} +0 -0
- /package/dist/{wallet-YZOXIXBC.js.map → viemAdapter-By13KInL-X2VY6CY3.js.map} +0 -0
|
@@ -167,13 +167,13 @@ import {
|
|
|
167
167
|
} from "./chunk-XZKD7DIF.js";
|
|
168
168
|
import {
|
|
169
169
|
sha256
|
|
170
|
-
} from "./chunk-
|
|
171
|
-
import {
|
|
172
|
-
keccak_256
|
|
173
|
-
} from "./chunk-KG3D7FIF.js";
|
|
170
|
+
} from "./chunk-N35E6CM2.js";
|
|
174
171
|
import {
|
|
175
172
|
secp256k1
|
|
176
173
|
} from "./chunk-JRGFKVAZ.js";
|
|
174
|
+
import {
|
|
175
|
+
keccak_256
|
|
176
|
+
} from "./chunk-KG3D7FIF.js";
|
|
177
177
|
import {
|
|
178
178
|
__commonJS,
|
|
179
179
|
__export,
|
|
@@ -14907,4 +14907,4 @@ export {
|
|
|
14907
14907
|
SIWX_HEADER,
|
|
14908
14908
|
buildSiwxHeader
|
|
14909
14909
|
};
|
|
14910
|
-
//# sourceMappingURL=chunk-
|
|
14910
|
+
//# sourceMappingURL=chunk-RGVOODF4.js.map
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
setTenjinIdentity
|
|
4
|
+
} from "./chunk-3BS55ANY.js";
|
|
5
|
+
import {
|
|
6
|
+
hasCode
|
|
7
|
+
} from "./chunk-2I4QTOLB.js";
|
|
8
|
+
import {
|
|
9
|
+
isTeamModeConfig
|
|
10
|
+
} from "./chunk-5KD5HRAJ.js";
|
|
11
|
+
import {
|
|
12
|
+
knownDeploymentOrigins,
|
|
13
|
+
loadRawConfig,
|
|
14
|
+
resolveSettings
|
|
15
|
+
} from "./chunk-CCDOV45D.js";
|
|
16
|
+
import {
|
|
17
|
+
writeFileAtomicExclusive
|
|
18
|
+
} from "./chunk-JLEF5WHM.js";
|
|
19
|
+
import {
|
|
20
|
+
installIdPath
|
|
21
|
+
} from "./chunk-TU7XH3JJ.js";
|
|
22
|
+
|
|
23
|
+
// src/lib/install-identity.ts
|
|
24
|
+
import { randomUUID } from "node:crypto";
|
|
25
|
+
import { readFile } from "node:fs/promises";
|
|
26
|
+
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
27
|
+
function parseInstallId(raw) {
|
|
28
|
+
const id = raw.trim();
|
|
29
|
+
return UUID_RE.test(id) ? id : void 0;
|
|
30
|
+
}
|
|
31
|
+
async function readOrCreateInstallId(dir) {
|
|
32
|
+
const path = installIdPath(dir);
|
|
33
|
+
try {
|
|
34
|
+
return parseInstallId(await readFile(path, "utf8"));
|
|
35
|
+
} catch (err) {
|
|
36
|
+
if (!hasCode(err, "ENOENT")) return void 0;
|
|
37
|
+
}
|
|
38
|
+
const id = randomUUID();
|
|
39
|
+
try {
|
|
40
|
+
await writeFileAtomicExclusive(path, `${id}
|
|
41
|
+
`, { mode: 384, dirMode: 448 });
|
|
42
|
+
return id;
|
|
43
|
+
} catch (err) {
|
|
44
|
+
if (!hasCode(err, "EEXIST")) return void 0;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
return parseInstallId(await readFile(path, "utf8"));
|
|
48
|
+
} catch {
|
|
49
|
+
return void 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function tryOrigin(url) {
|
|
53
|
+
try {
|
|
54
|
+
return new URL(url).origin;
|
|
55
|
+
} catch {
|
|
56
|
+
return void 0;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function tenjinOrigins(s) {
|
|
60
|
+
const origins = new Set(knownDeploymentOrigins());
|
|
61
|
+
const baseOrigin = tryOrigin(s.baseUrl);
|
|
62
|
+
if (baseOrigin !== void 0 && !s.teamMode) origins.add(baseOrigin);
|
|
63
|
+
return [...origins];
|
|
64
|
+
}
|
|
65
|
+
function identityFor(dir, origins) {
|
|
66
|
+
let install;
|
|
67
|
+
return {
|
|
68
|
+
origins,
|
|
69
|
+
installId: () => install ??= readOrCreateInstallId(dir)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
var baseUrlFlag;
|
|
73
|
+
function noteBaseUrlFlag(flag) {
|
|
74
|
+
baseUrlFlag = flag;
|
|
75
|
+
}
|
|
76
|
+
function enableCliIdentity(dir, env = process.env) {
|
|
77
|
+
let origins;
|
|
78
|
+
setTenjinIdentity(
|
|
79
|
+
identityFor(dir, () => {
|
|
80
|
+
origins ??= (async () => {
|
|
81
|
+
const config = await loadRawConfig(dir);
|
|
82
|
+
const s = resolveSettings({ config, flags: { baseUrl: baseUrlFlag }, env });
|
|
83
|
+
return tenjinOrigins({
|
|
84
|
+
baseUrl: s.baseUrl.value,
|
|
85
|
+
teamMode: isTeamModeConfig(config)
|
|
86
|
+
});
|
|
87
|
+
})();
|
|
88
|
+
return origins;
|
|
89
|
+
})
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
function enableDaemonIdentity(dir, config) {
|
|
93
|
+
setTenjinIdentity(
|
|
94
|
+
identityFor(dir, async () => {
|
|
95
|
+
const c = config();
|
|
96
|
+
return tenjinOrigins({
|
|
97
|
+
baseUrl: c.baseUrl,
|
|
98
|
+
teamMode: isTeamModeConfig(c)
|
|
99
|
+
});
|
|
100
|
+
})
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
readOrCreateInstallId,
|
|
106
|
+
tenjinOrigins,
|
|
107
|
+
identityFor,
|
|
108
|
+
noteBaseUrlFlag,
|
|
109
|
+
enableCliIdentity,
|
|
110
|
+
enableDaemonIdentity
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=chunk-RPR2C2JO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/install-identity.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { readFile } from 'node:fs/promises';\nimport { writeFileAtomicExclusive } from './atomic-json';\nimport { loadRawConfig, resolveSettings } from './config';\nimport { hasCode } from './errno';\nimport { setTenjinIdentity, type TenjinIdentity } from './http';\nimport { installIdPath } from './paths';\nimport { knownDeploymentOrigins } from './production-origin';\nimport { isTeamModeConfig } from './settings';\n\n/**\n * The install id the transport attaches to Tenjin-bound requests (see\n * `TenjinIdentity` in lib/http), and the rule for which origins are Tenjin's.\n *\n * Nothing here may fail a request: every read that goes wrong is an absent\n * header. There is no opt-out for alpha; the id is random, anonymous, and not a\n * credential.\n */\n\nconst UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\nfunction parseInstallId(raw: string): string | undefined {\n const id = raw.trim();\n return UUID_RE.test(id) ? id : undefined;\n}\n\n/**\n * This data dir's install id, minted on first need. Created no-clobber, so two\n * processes racing on a first run agree on the winner's id rather than each\n * keeping its own. A file that exists but does not hold a UUID is left alone and\n * sends nothing: overwriting it would be a new id for the same install.\n */\nexport async function readOrCreateInstallId(dir: string): Promise<string | undefined> {\n const path = installIdPath(dir);\n try {\n return parseInstallId(await readFile(path, 'utf8'));\n } catch (err) {\n if (!hasCode(err, 'ENOENT')) return undefined;\n }\n const id = randomUUID();\n try {\n await writeFileAtomicExclusive(path, `${id}\\n`, { mode: 0o600, dirMode: 0o700 });\n return id;\n } catch (err) {\n if (!hasCode(err, 'EEXIST')) return undefined;\n }\n try {\n return parseInstallId(await readFile(path, 'utf8'));\n } catch {\n return undefined;\n }\n}\n\nfunction tryOrigin(url: string): string | undefined {\n try {\n return new URL(url).origin;\n } catch {\n return undefined;\n }\n}\n\n/**\n * The origins that get the header: Tenjin's own deployments and the base URL\n * this run is pointed at, overrides included (a local dev server is Tenjin too).\n * Not `publicShelfUrl`: its default is already one of Tenjin's deployments, and\n * a custom one may be a host Tenjin does not run.\n *\n * NOT a team shelf. In team mode `baseUrl` is the team's own deployment, which\n * Tenjin does not operate, so on a team machine the base URL is left out unless\n * it is one of Tenjin's own origins anyway. `isTeamModeConfig` reads the file,\n * so a `--base-url` on one run cannot switch that exclusion off.\n */\nexport function tenjinOrigins(s: { baseUrl: string; teamMode: boolean }): string[] {\n const origins = new Set(knownDeploymentOrigins());\n const baseOrigin = tryOrigin(s.baseUrl);\n if (baseOrigin !== undefined && !s.teamMode) origins.add(baseOrigin);\n return [...origins];\n}\n\n/** An identity for one data dir. The install id is read once per process. */\nexport function identityFor(\n dir: string,\n origins: () => Promise<readonly string[]>,\n): TenjinIdentity {\n let install: Promise<string | undefined> | undefined;\n return {\n origins,\n installId: () => (install ??= readOrCreateInstallId(dir)),\n };\n}\n\n/**\n * The run's `--base-url`, recorded by the CLI once it has parsed the global\n * flags. The origins are resolved on the first request, which comes after that.\n */\nlet baseUrlFlag: string | undefined;\n\nexport function noteBaseUrlFlag(flag: string | undefined): void {\n baseUrlFlag = flag;\n}\n\n/**\n * Turn the header on for this CLI process. Called from the entry only, never\n * from `main`, so in-process tests of the command tree never mint an id.\n */\nexport function enableCliIdentity(dir: string, env: NodeJS.ProcessEnv = process.env): void {\n let origins: Promise<readonly string[]> | undefined;\n setTenjinIdentity(\n identityFor(dir, () => {\n origins ??= (async () => {\n const config = await loadRawConfig(dir);\n const s = resolveSettings({ config, flags: { baseUrl: baseUrlFlag }, env });\n return tenjinOrigins({\n baseUrl: s.baseUrl.value,\n teamMode: isTeamModeConfig(config),\n });\n })();\n return origins;\n }),\n );\n}\n\n/**\n * Turn the header on for the loop daemon. No flag or env layer, like the rest\n * of the daemon's config, and re-read per request because the daemon reloads\n * config.json when it changes.\n */\nexport function enableDaemonIdentity(\n dir: string,\n config: () => { baseUrl: string; publicShelfUrl: string; shelfBypassSecret: string },\n): void {\n setTenjinIdentity(\n identityFor(dir, async () => {\n const c = config();\n return tenjinOrigins({\n baseUrl: c.baseUrl,\n teamMode: isTeamModeConfig(c),\n });\n }),\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AAkBzB,IAAM,UAAU;AAEhB,SAAS,eAAe,KAAiC;AACvD,QAAM,KAAK,IAAI,KAAK;AACpB,SAAO,QAAQ,KAAK,EAAE,IAAI,KAAK;AACjC;AAQA,eAAsB,sBAAsB,KAA0C;AACpF,QAAM,OAAO,cAAc,GAAG;AAC9B,MAAI;AACF,WAAO,eAAe,MAAM,SAAS,MAAM,MAAM,CAAC;AAAA,EACpD,SAAS,KAAK;AACZ,QAAI,CAAC,QAAQ,KAAK,QAAQ,EAAG,QAAO;AAAA,EACtC;AACA,QAAM,KAAK,WAAW;AACtB,MAAI;AACF,UAAM,yBAAyB,MAAM,GAAG,EAAE;AAAA,GAAM,EAAE,MAAM,KAAO,SAAS,IAAM,CAAC;AAC/E,WAAO;AAAA,EACT,SAAS,KAAK;AACZ,QAAI,CAAC,QAAQ,KAAK,QAAQ,EAAG,QAAO;AAAA,EACtC;AACA,MAAI;AACF,WAAO,eAAe,MAAM,SAAS,MAAM,MAAM,CAAC;AAAA,EACpD,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,UAAU,KAAiC;AAClD,MAAI;AACF,WAAO,IAAI,IAAI,GAAG,EAAE;AAAA,EACtB,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAaO,SAAS,cAAc,GAAqD;AACjF,QAAM,UAAU,IAAI,IAAI,uBAAuB,CAAC;AAChD,QAAM,aAAa,UAAU,EAAE,OAAO;AACtC,MAAI,eAAe,UAAa,CAAC,EAAE,SAAU,SAAQ,IAAI,UAAU;AACnE,SAAO,CAAC,GAAG,OAAO;AACpB;AAGO,SAAS,YACd,KACA,SACgB;AAChB,MAAI;AACJ,SAAO;AAAA,IACL;AAAA,IACA,WAAW,MAAO,YAAY,sBAAsB,GAAG;AAAA,EACzD;AACF;AAMA,IAAI;AAEG,SAAS,gBAAgB,MAAgC;AAC9D,gBAAc;AAChB;AAMO,SAAS,kBAAkB,KAAa,MAAyB,QAAQ,KAAW;AACzF,MAAI;AACJ;AAAA,IACE,YAAY,KAAK,MAAM;AACrB,mBAAa,YAAY;AACvB,cAAM,SAAS,MAAM,cAAc,GAAG;AACtC,cAAM,IAAI,gBAAgB,EAAE,QAAQ,OAAO,EAAE,SAAS,YAAY,GAAG,IAAI,CAAC;AAC1E,eAAO,cAAc;AAAA,UACnB,SAAS,EAAE,QAAQ;AAAA,UACnB,UAAU,iBAAiB,MAAM;AAAA,QACnC,CAAC;AAAA,MACH,GAAG;AACH,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AACF;AAOO,SAAS,qBACd,KACA,QACM;AACN;AAAA,IACE,YAAY,KAAK,YAAY;AAC3B,YAAM,IAAI,OAAO;AACjB,aAAO,cAAc;AAAA,QACnB,SAAS,EAAE;AAAA,QACX,UAAU,iBAAiB,CAAC;AAAA,MAC9B,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -17,6 +17,9 @@ function configPath(dir = dataDir()) {
|
|
|
17
17
|
function walletPath(dir = dataDir()) {
|
|
18
18
|
return join(dir, "wallet.json");
|
|
19
19
|
}
|
|
20
|
+
function installIdPath(dir = dataDir()) {
|
|
21
|
+
return join(dir, "install-id");
|
|
22
|
+
}
|
|
20
23
|
function sessionPath(dir = dataDir()) {
|
|
21
24
|
return join(dir, "session.json");
|
|
22
25
|
}
|
|
@@ -72,6 +75,7 @@ export {
|
|
|
72
75
|
defaultDataDir,
|
|
73
76
|
configPath,
|
|
74
77
|
walletPath,
|
|
78
|
+
installIdPath,
|
|
75
79
|
sessionPath,
|
|
76
80
|
spendLedgerPath,
|
|
77
81
|
updateCheckPath,
|
|
@@ -90,4 +94,4 @@ export {
|
|
|
90
94
|
VITEST_REPORTER_FILE,
|
|
91
95
|
vitestReporterPath
|
|
92
96
|
};
|
|
93
|
-
//# sourceMappingURL=chunk-
|
|
97
|
+
//# sourceMappingURL=chunk-TU7XH3JJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/paths.ts"],"sourcesContent":["import { homedir } from 'node:os';\nimport { join, resolve } from 'node:path';\n\n/**\n * Where the CLI keeps its config and wallet. Defaults to ~/.tenjin, overridable\n * via TENJIN_DATA_DIR (CI, ephemeral agents, and every test — which point it at\n * a temp dir so the real home is never touched).\n */\nexport function dataDir(env: NodeJS.ProcessEnv = process.env): string {\n const override = env.TENJIN_DATA_DIR;\n // Absolute, always: the daemon compares this string against its own\n // `data_dir` and is spawned with it as `cwd`, so a relative override must\n // mean the same directory from every process.\n if (override !== undefined && override.length > 0) return resolve(override);\n return defaultDataDir();\n}\n\n/**\n * The data dir a run with no override resolves. Split out of {@link dataDir} so\n * a caller holding a home directory can ask whether some other profile IS the\n * default one, without a second copy of the `.tenjin` literal.\n */\nexport function defaultDataDir(home: string = homedir()): string {\n return join(home, '.tenjin');\n}\n\nexport function configPath(dir: string = dataDir()): string {\n return join(dir, 'config.json');\n}\n\nexport function walletPath(dir: string = dataDir()): string {\n return join(dir, 'wallet.json');\n}\n\n/**\n * The anonymous install id sent to Tenjin as `X-Tenjin-Install` (lib/install-identity).\n * Under the data dir so it survives upgrades and reinstalls of the CLI itself.\n */\nexport function installIdPath(dir: string = dataDir()): string {\n return join(dir, 'install-id');\n}\n\n/**\n * Where the delegated P-256 session key + its wallet-signed SIWX delegation are\n * cached (B3, D35). A short-lived (≤24h) hot key: lower stakes than wallet.json,\n * but still written 0600 and address-bound so a wallet change invalidates it.\n */\nexport function sessionPath(dir: string = dataDir()): string {\n return join(dir, 'session.json');\n}\n\n/**\n * Where the client-side rolling spend ledger lives (lib/wallet/spend.ts).\n *\n * Its own file, NOT session.json: the two schemas are incompatible and both\n * readers treat a parse failure as \"absent\", so a shared path meant each writer\n * silently destroyed the other's file — a session key wiped the spend window, and\n * the next spend wiped the session key.\n */\nexport function spendLedgerPath(dir: string = dataDir()): string {\n return join(dir, 'spend.json');\n}\n\n/**\n * Where the once-a-day \"a newer tenjin-cli exists\" check caches the registry\n * answer. A pure cache: nothing here is authoritative, so an unreadable file is\n * simply re-fetched.\n */\nexport function updateCheckPath(dir: string = dataDir()): string {\n return join(dir, 'update-check.json');\n}\n\n/**\n * Where `install` writes the standalone harness hook scripts. Under the data dir\n * rather than the harness's own config directory: the scripts are ours, a harness\n * only ever holds the path to them, and one location serves every harness.\n */\nexport function hooksDir(dir: string = dataDir()): string {\n return join(dir, 'hooks');\n}\n\n/**\n * How the marketplace has been answering the dispatch hook lately, so a run of\n * failures stops the arm instead of paying the fetch budget per subagent through\n * an outage. Hook-written, unlocked, and cheap to lose, since a missing file\n * reads as \"healthy\". Its own file because two hooks writing one unlocked file\n * would erase each other.\n */\nexport function hookHealthPath(dir: string = dataDir()): string {\n return join(dir, 'hook-health.json');\n}\n\n/**\n * Where the LEGACY (pre-per-wallet) Windows DPAPI passphrase blob lives. The\n * file holds a DPAPI CurrentUser ciphertext, not the passphrase in plaintext.\n * New writes go to the per-wallet path below; this one is only read as a\n * migration fallback and removed after a verified per-wallet copy exists.\n */\nexport function passphraseBlobPath(dir: string = dataDir()): string {\n return join(dir, 'passphrase.dpapi');\n}\n\n/**\n * The per-wallet Windows DPAPI passphrase blob: one file per wallet address\n * (lowercase), so creating a new wallet never clobbers an old wallet's blob.\n * Only ever written on win32; other platforms use their own OS store.\n */\nexport function passphraseBlobPathFor(account: string, dir: string = dataDir()): string {\n return join(dir, `passphrase.${account}.dpapi`);\n}\n\n/**\n * Where `wallet create --replace` parks the outgoing wallet's keystore, keyed by\n * its lowercase address so successive replaces can never collide. Together with\n * the wallet's per-address passphrase entry in the OS store, this file keeps the\n * replaced wallet's funds recoverable; it is never read by the active-wallet\n * path.\n */\nexport function archivedWalletPath(account: string, dir: string = dataDir()): string {\n return join(dir, `wallet.${account}.json.bak`);\n}\n\n/**\n * The loop daemon's own state, all under the data dir (tenjin-notes\n * loop-redesign/02-redesign.md §4, §10).\n */\nexport function loopDbPath(dir: string = dataDir()): string {\n return join(dir, 'loop.db');\n}\n\n/** 32 random bytes, hex, 0600. Minted by `tenjin daemon start`, rotated only by\n * reinstall, NEVER deleted by the daemon: every transport reads it, and an idle\n * exit that removed it would strand them all. */\nexport function daemonTokenPath(dir: string = dataDir()): string {\n return join(dir, 'daemon.token');\n}\n\n/** `{ pid, port, started_at, data_dir }`, advisory: written after the bind,\n * removed at exit only by the process whose pid it names. Liveness is\n * `GET /health`, never this file alone. */\nexport function daemonPidPath(dir: string = dataDir()): string {\n return join(dir, 'daemon.pid');\n}\n\n/** Where a detached daemon's stdout and stderr go, and where the shim writes its\n * one `daemon-down` line when it cannot reach one. */\nexport function daemonLogPath(dir: string = dataDir()): string {\n return join(dir, 'daemon.log');\n}\n\n/** An empty file whose mtime is the last spawn attempt; the shim's backoff. */\nexport function daemonSpawnPath(dir: string = dataDir()): string {\n return join(dir, 'daemon.spawn');\n}\n\n/** The single-file daemon bundle `tenjin daemon start` copies from `dist`. */\nexport function daemonBundlePath(dir: string = dataDir()): string {\n return join(hooksDir(dir), 'tenjin-daemon.mjs');\n}\n\n/** The ensure-and-forward shim the two `command` hook entries run. */\nexport function shimBundlePath(dir: string = dataDir()): string {\n return join(hooksDir(dir), 'tenjin-shim.mjs');\n}\n\n/** Tenjin's own vitest reporter, copied beside the bundles. NOT A HOOK ENTRY\n * and never spawned: a repo's own `vitest.config.ts` imports it by this\n * absolute path, which is why `doctor` can hint at it verbatim. */\nexport const VITEST_REPORTER_FILE = 'tenjin-vitest-reporter.mjs';\n\nexport function vitestReporterPath(dir: string = dataDir()): string {\n return join(hooksDir(dir), VITEST_REPORTER_FILE);\n}\n"],"mappings":";;;AAAA,SAAS,eAAe;AACxB,SAAS,MAAM,eAAe;AAOvB,SAAS,QAAQ,MAAyB,QAAQ,KAAa;AACpE,QAAM,WAAW,IAAI;AAIrB,MAAI,aAAa,UAAa,SAAS,SAAS,EAAG,QAAO,QAAQ,QAAQ;AAC1E,SAAO,eAAe;AACxB;AAOO,SAAS,eAAe,OAAe,QAAQ,GAAW;AAC/D,SAAO,KAAK,MAAM,SAAS;AAC7B;AAEO,SAAS,WAAW,MAAc,QAAQ,GAAW;AAC1D,SAAO,KAAK,KAAK,aAAa;AAChC;AAEO,SAAS,WAAW,MAAc,QAAQ,GAAW;AAC1D,SAAO,KAAK,KAAK,aAAa;AAChC;AAMO,SAAS,cAAc,MAAc,QAAQ,GAAW;AAC7D,SAAO,KAAK,KAAK,YAAY;AAC/B;AAOO,SAAS,YAAY,MAAc,QAAQ,GAAW;AAC3D,SAAO,KAAK,KAAK,cAAc;AACjC;AAUO,SAAS,gBAAgB,MAAc,QAAQ,GAAW;AAC/D,SAAO,KAAK,KAAK,YAAY;AAC/B;AAOO,SAAS,gBAAgB,MAAc,QAAQ,GAAW;AAC/D,SAAO,KAAK,KAAK,mBAAmB;AACtC;AAOO,SAAS,SAAS,MAAc,QAAQ,GAAW;AACxD,SAAO,KAAK,KAAK,OAAO;AAC1B;AASO,SAAS,eAAe,MAAc,QAAQ,GAAW;AAC9D,SAAO,KAAK,KAAK,kBAAkB;AACrC;AAQO,SAAS,mBAAmB,MAAc,QAAQ,GAAW;AAClE,SAAO,KAAK,KAAK,kBAAkB;AACrC;AAOO,SAAS,sBAAsB,SAAiB,MAAc,QAAQ,GAAW;AACtF,SAAO,KAAK,KAAK,cAAc,OAAO,QAAQ;AAChD;AASO,SAAS,mBAAmB,SAAiB,MAAc,QAAQ,GAAW;AACnF,SAAO,KAAK,KAAK,UAAU,OAAO,WAAW;AAC/C;AAMO,SAAS,WAAW,MAAc,QAAQ,GAAW;AAC1D,SAAO,KAAK,KAAK,SAAS;AAC5B;AAKO,SAAS,gBAAgB,MAAc,QAAQ,GAAW;AAC/D,SAAO,KAAK,KAAK,cAAc;AACjC;AAKO,SAAS,cAAc,MAAc,QAAQ,GAAW;AAC7D,SAAO,KAAK,KAAK,YAAY;AAC/B;AAIO,SAAS,cAAc,MAAc,QAAQ,GAAW;AAC7D,SAAO,KAAK,KAAK,YAAY;AAC/B;AAGO,SAAS,gBAAgB,MAAc,QAAQ,GAAW;AAC/D,SAAO,KAAK,KAAK,cAAc;AACjC;AAGO,SAAS,iBAAiB,MAAc,QAAQ,GAAW;AAChE,SAAO,KAAK,SAAS,GAAG,GAAG,mBAAmB;AAChD;AAGO,SAAS,eAAe,MAAc,QAAQ,GAAW;AAC9D,SAAO,KAAK,SAAS,GAAG,GAAG,iBAAiB;AAC9C;AAKO,IAAM,uBAAuB;AAE7B,SAAS,mBAAmB,MAAc,QAAQ,GAAW;AAClE,SAAO,KAAK,SAAS,GAAG,GAAG,oBAAoB;AACjD;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
createLocalSpendAuthorizer
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YREKMJPP.js";
|
|
5
5
|
import {
|
|
6
6
|
hashAuthorization,
|
|
7
7
|
hashMessage,
|
|
@@ -10,7 +10,12 @@ import {
|
|
|
10
10
|
publicKeyToAddress,
|
|
11
11
|
serializeSignature,
|
|
12
12
|
serializeTransaction
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-N35E6CM2.js";
|
|
14
|
+
import {
|
|
15
|
+
hmac,
|
|
16
|
+
secp256k1,
|
|
17
|
+
sha256
|
|
18
|
+
} from "./chunk-JRGFKVAZ.js";
|
|
14
19
|
import {
|
|
15
20
|
InvalidAddressError,
|
|
16
21
|
concat3 as concat,
|
|
@@ -26,15 +31,27 @@ import {
|
|
|
26
31
|
toHex,
|
|
27
32
|
toHex2
|
|
28
33
|
} from "./chunk-EGELTSPU.js";
|
|
34
|
+
import {
|
|
35
|
+
ahash,
|
|
36
|
+
anumber,
|
|
37
|
+
asyncLoop,
|
|
38
|
+
checkOpts,
|
|
39
|
+
clean,
|
|
40
|
+
createView,
|
|
41
|
+
kdfInputToBytes,
|
|
42
|
+
rotl,
|
|
43
|
+
swap32IfBE,
|
|
44
|
+
u32
|
|
45
|
+
} from "./chunk-BPMWXTFX.js";
|
|
29
46
|
import {
|
|
30
47
|
emitNotice
|
|
31
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-72UHZRG6.js";
|
|
32
49
|
import {
|
|
33
50
|
hasCode
|
|
34
51
|
} from "./chunk-2I4QTOLB.js";
|
|
35
52
|
import {
|
|
36
53
|
external_exports
|
|
37
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-CCDOV45D.js";
|
|
38
55
|
import {
|
|
39
56
|
CliError,
|
|
40
57
|
fsyncDir,
|
|
@@ -47,24 +64,7 @@ import {
|
|
|
47
64
|
passphraseBlobPathFor,
|
|
48
65
|
spendLedgerPath,
|
|
49
66
|
walletPath
|
|
50
|
-
} from "./chunk-
|
|
51
|
-
import {
|
|
52
|
-
hmac,
|
|
53
|
-
secp256k1,
|
|
54
|
-
sha256
|
|
55
|
-
} from "./chunk-JRGFKVAZ.js";
|
|
56
|
-
import {
|
|
57
|
-
ahash,
|
|
58
|
-
anumber,
|
|
59
|
-
asyncLoop,
|
|
60
|
-
checkOpts,
|
|
61
|
-
clean,
|
|
62
|
-
createView,
|
|
63
|
-
kdfInputToBytes,
|
|
64
|
-
rotl,
|
|
65
|
-
swap32IfBE,
|
|
66
|
-
u32
|
|
67
|
-
} from "./chunk-BPMWXTFX.js";
|
|
67
|
+
} from "./chunk-TU7XH3JJ.js";
|
|
68
68
|
|
|
69
69
|
// src/lib/wallet/store.ts
|
|
70
70
|
import { readFile, stat } from "node:fs/promises";
|
|
@@ -1678,4 +1678,4 @@ export {
|
|
|
1678
1678
|
@noble/ciphers/esm/utils.js:
|
|
1679
1679
|
(*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *)
|
|
1680
1680
|
*/
|
|
1681
|
-
//# sourceMappingURL=chunk-
|
|
1681
|
+
//# sourceMappingURL=chunk-YEBNE5NW.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
evaluateSpendPolicy,
|
|
7
7
|
readLedger,
|
|
8
8
|
spentOf
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7ACHDNJA.js";
|
|
10
10
|
import {
|
|
11
11
|
withFileLock
|
|
12
12
|
} from "./chunk-MEFB5KHA.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-JLEF5WHM.js";
|
|
16
16
|
import {
|
|
17
17
|
spendLedgerPath
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-TU7XH3JJ.js";
|
|
19
19
|
|
|
20
20
|
// src/lib/wallet/spend.ts
|
|
21
21
|
import { mkdir } from "node:fs/promises";
|
|
@@ -128,4 +128,4 @@ function createLocalSpendAuthorizer(deps) {
|
|
|
128
128
|
export {
|
|
129
129
|
createLocalSpendAuthorizer
|
|
130
130
|
};
|
|
131
|
-
//# sourceMappingURL=chunk-
|
|
131
|
+
//# sourceMappingURL=chunk-YREKMJPP.js.map
|
|
@@ -2,27 +2,34 @@ import { createRequire as __tenjinCreateRequire } from 'node:module'; const requ
|
|
|
2
2
|
import {
|
|
3
3
|
maybeUpdate,
|
|
4
4
|
readUpdateSignal
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HH3PDYIG.js";
|
|
6
6
|
import {
|
|
7
7
|
defaultIo,
|
|
8
8
|
emitFailure,
|
|
9
9
|
emitSuccess
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-72UHZRG6.js";
|
|
11
|
+
import {
|
|
12
|
+
noteBaseUrlFlag
|
|
13
|
+
} from "./chunk-RPR2C2JO.js";
|
|
14
|
+
import "./chunk-3BS55ANY.js";
|
|
11
15
|
import {
|
|
12
16
|
PERMISSIONS_DOC_URL
|
|
13
17
|
} from "./chunk-A36LQPHV.js";
|
|
18
|
+
import "./chunk-2I4QTOLB.js";
|
|
19
|
+
import "./chunk-5KD5HRAJ.js";
|
|
20
|
+
import "./chunk-O2JYBOUO.js";
|
|
14
21
|
import {
|
|
15
22
|
external_exports
|
|
16
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-CCDOV45D.js";
|
|
17
24
|
import {
|
|
18
25
|
package_default
|
|
19
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-P42QX3QF.js";
|
|
20
27
|
import {
|
|
21
28
|
CliError
|
|
22
29
|
} from "./chunk-JLEF5WHM.js";
|
|
23
30
|
import {
|
|
24
31
|
dataDir
|
|
25
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-TU7XH3JJ.js";
|
|
26
33
|
import {
|
|
27
34
|
__commonJS,
|
|
28
35
|
__require,
|
|
@@ -3506,8 +3513,8 @@ Learn more:
|
|
|
3506
3513
|
).action(async function() {
|
|
3507
3514
|
await runCommand("install", this, async (ctx) => {
|
|
3508
3515
|
const o = this.opts();
|
|
3509
|
-
const { runRouterInstall } = await import("./install-
|
|
3510
|
-
const { statusLineMode } = await import("./status-line-wiring-
|
|
3516
|
+
const { runRouterInstall } = await import("./install-MMNXJ5LM.js");
|
|
3517
|
+
const { statusLineMode } = await import("./status-line-wiring-HSV7DXO5.js");
|
|
3511
3518
|
return runRouterInstall(
|
|
3512
3519
|
{
|
|
3513
3520
|
...o.project === true ? { project: true } : {},
|
|
@@ -3524,7 +3531,7 @@ Learn more:
|
|
|
3524
3531
|
).option("--project", "remove from this project's .claude/settings.json").action(async function() {
|
|
3525
3532
|
await runCommand("uninstall", this, async (ctx) => {
|
|
3526
3533
|
const o = this.opts();
|
|
3527
|
-
const { runRouterUninstall } = await import("./uninstall-
|
|
3534
|
+
const { runRouterUninstall } = await import("./uninstall-GUU34YKP.js");
|
|
3528
3535
|
return runRouterUninstall({ ...o.project === true ? { project: true } : {} }, ctx);
|
|
3529
3536
|
});
|
|
3530
3537
|
});
|
|
@@ -3540,7 +3547,7 @@ Examples:
|
|
|
3540
3547
|
`
|
|
3541
3548
|
).action(async function() {
|
|
3542
3549
|
await runCommand("doctor", this, async (ctx) => {
|
|
3543
|
-
const { runRouterDoctor } = await import("./doctor-
|
|
3550
|
+
const { runRouterDoctor } = await import("./doctor-KMN55D7U.js");
|
|
3544
3551
|
return runRouterDoctor(ctx, this.opts().project === true ? { project: true } : {});
|
|
3545
3552
|
});
|
|
3546
3553
|
});
|
|
@@ -3548,7 +3555,7 @@ Examples:
|
|
|
3548
3555
|
"Update tenjin-cli to the newest version npm publishes on the latest tag. It then runs `install --refresh` on the new binary, so every profile on this machine gets the skills and hook scripts of the build that just landed."
|
|
3549
3556
|
).option("--check", "report whether a newer version exists without installing it").action(async function() {
|
|
3550
3557
|
await runCommand("update", this, async (ctx) => {
|
|
3551
|
-
const { runUpdate } = await import("./update-
|
|
3558
|
+
const { runUpdate } = await import("./update-KO2NZRJ5.js");
|
|
3552
3559
|
return runUpdate({ check: this.opts().check === true }, ctx);
|
|
3553
3560
|
});
|
|
3554
3561
|
});
|
|
@@ -3567,7 +3574,7 @@ Examples:
|
|
|
3567
3574
|
);
|
|
3568
3575
|
config.action(async function() {
|
|
3569
3576
|
await runCommand("config", this, async (ctx) => {
|
|
3570
|
-
const { runConfigList } = await import("./config-
|
|
3577
|
+
const { runConfigList } = await import("./config-KMJLFPSI.js");
|
|
3571
3578
|
return runConfigList(ctx);
|
|
3572
3579
|
});
|
|
3573
3580
|
});
|
|
@@ -3575,7 +3582,7 @@ Examples:
|
|
|
3575
3582
|
"Print one effective config value by key. The effective value is what the command would use, defaults and environment overrides included."
|
|
3576
3583
|
).action(async function(key) {
|
|
3577
3584
|
await runCommand("config.get", this, async (ctx) => {
|
|
3578
|
-
const { runConfigGet } = await import("./config-
|
|
3585
|
+
const { runConfigGet } = await import("./config-KMJLFPSI.js");
|
|
3579
3586
|
return runConfigGet({ key }, ctx);
|
|
3580
3587
|
});
|
|
3581
3588
|
});
|
|
@@ -3587,7 +3594,7 @@ Examples:
|
|
|
3587
3594
|
).option("--local", "with --project, write .tenjin/config.local.json instead, which is yours").action(async function(key, value) {
|
|
3588
3595
|
const o = this.opts();
|
|
3589
3596
|
await runCommand("config.set", this, async (ctx) => {
|
|
3590
|
-
const { runConfigSet } = await import("./config-
|
|
3597
|
+
const { runConfigSet } = await import("./config-KMJLFPSI.js");
|
|
3591
3598
|
return runConfigSet(
|
|
3592
3599
|
{ key, value, project: o.project === true, local: o.local === true },
|
|
3593
3600
|
ctx
|
|
@@ -3609,7 +3616,7 @@ Examples:
|
|
|
3609
3616
|
).action(async function() {
|
|
3610
3617
|
await runCommand("wallet.create", this, async (ctx) => {
|
|
3611
3618
|
const o = this.opts();
|
|
3612
|
-
const { runWalletCreate } = await import("./wallet-
|
|
3619
|
+
const { runWalletCreate } = await import("./wallet-3URC5QPK.js");
|
|
3613
3620
|
return runWalletCreate(ctx, o.replace === true ? { replace: true } : {});
|
|
3614
3621
|
});
|
|
3615
3622
|
});
|
|
@@ -3617,7 +3624,7 @@ Examples:
|
|
|
3617
3624
|
"Print the active wallet address and where its key comes from. The private key is never printed, by any flag."
|
|
3618
3625
|
).action(async function() {
|
|
3619
3626
|
await runCommand("wallet.show", this, async (ctx) => {
|
|
3620
|
-
const { runWalletShow } = await import("./wallet-
|
|
3627
|
+
const { runWalletShow } = await import("./wallet-3URC5QPK.js");
|
|
3621
3628
|
return runWalletShow(ctx);
|
|
3622
3629
|
});
|
|
3623
3630
|
});
|
|
@@ -3625,7 +3632,7 @@ Examples:
|
|
|
3625
3632
|
"Read the wallet USDC balance on Base. It is a chain read: no key is unlocked and nothing is spent."
|
|
3626
3633
|
).action(async function() {
|
|
3627
3634
|
await runCommand("wallet.balance", this, async (ctx) => {
|
|
3628
|
-
const { runWalletBalance } = await import("./wallet-
|
|
3635
|
+
const { runWalletBalance } = await import("./wallet-3URC5QPK.js");
|
|
3629
3636
|
return runWalletBalance(ctx);
|
|
3630
3637
|
});
|
|
3631
3638
|
});
|
|
@@ -3637,7 +3644,7 @@ Examples:
|
|
|
3637
3644
|
).action(async function(amountUsd) {
|
|
3638
3645
|
await runCommand("wallet.fund", this, async (ctx) => {
|
|
3639
3646
|
const o = this.opts();
|
|
3640
|
-
const { runFund } = await import("./fund-
|
|
3647
|
+
const { runFund } = await import("./fund-LT6ZPGEQ.js");
|
|
3641
3648
|
return runFund(ctx, {
|
|
3642
3649
|
...amountUsd !== void 0 ? { amountUsd } : {},
|
|
3643
3650
|
...o.open === false ? { open: false } : {},
|
|
@@ -3656,7 +3663,7 @@ Examples:
|
|
|
3656
3663
|
).action(async function(amount, token, to) {
|
|
3657
3664
|
await runCommand("wallet.send", this, async (ctx) => {
|
|
3658
3665
|
const o = this.opts();
|
|
3659
|
-
const { runSend } = await import("./send-
|
|
3666
|
+
const { runSend } = await import("./send-HESQYRKM.js");
|
|
3660
3667
|
return runSend({ amount, token, to, ...o.yes === true ? { yes: true } : {} }, ctx);
|
|
3661
3668
|
});
|
|
3662
3669
|
});
|
|
@@ -3676,7 +3683,7 @@ Examples:
|
|
|
3676
3683
|
).action(async function(url) {
|
|
3677
3684
|
await runCommand("pay", this, async (ctx) => {
|
|
3678
3685
|
const o = this.opts();
|
|
3679
|
-
const { runPay } = await import("./pay-
|
|
3686
|
+
const { runPay } = await import("./pay-XAWW3NV3.js");
|
|
3680
3687
|
return runPay(
|
|
3681
3688
|
{
|
|
3682
3689
|
url,
|
|
@@ -3710,7 +3717,7 @@ function registerRouter(reg) {
|
|
|
3710
3717
|
]) {
|
|
3711
3718
|
addGlobalFlags2(hook.command(name)).summary(summary).action(async function() {
|
|
3712
3719
|
const ctx = buildContext2(this);
|
|
3713
|
-
const { runHookCommand } = await import("./hook-command-
|
|
3720
|
+
const { runHookCommand } = await import("./hook-command-U5XPEHAJ.js");
|
|
3714
3721
|
await runHookCommand(name, io, {
|
|
3715
3722
|
dataDir: ctx.dataDir,
|
|
3716
3723
|
...ctx.flags.baseUrl !== void 0 ? { baseUrl: ctx.flags.baseUrl } : {}
|
|
@@ -3723,21 +3730,21 @@ function registerRouter(reg) {
|
|
|
3723
3730
|
"Run the local stdio MCP server that carries the `request` tool: one paid routing decision per lookup, then the provider call, under your local spend policy. It speaks on stdin and stdout and runs until the client disconnects, so it prints no envelope of its own."
|
|
3724
3731
|
).action(async function() {
|
|
3725
3732
|
const ctx = buildContext2(this);
|
|
3726
|
-
const { runRouterMcpServer } = await import("./mcp-
|
|
3733
|
+
const { runRouterMcpServer } = await import("./mcp-TUPRIPSI.js");
|
|
3727
3734
|
await runRouterMcpServer({ dataDir: ctx.dataDir, flags: ctx.flags });
|
|
3728
3735
|
});
|
|
3729
3736
|
leaf2(INTEGRATION, "status-line", "the live footer, for Claude Code's status line").description(
|
|
3730
3737
|
"Print one line naming what this session is looking up right now: the provider actually being called, its bounded parameters, and what it cost. It reads Claude Code's status event on stdin for the session identity, reads that session's own progress records, writes nothing, and prints `x402 \xB7 ready` when this session has no activity. `tenjin install` registers it; you never run it by hand."
|
|
3731
3738
|
).action(async function() {
|
|
3732
3739
|
const ctx = buildContext2(this);
|
|
3733
|
-
const { runStatusLine } = await import("./status-line-
|
|
3740
|
+
const { runStatusLine } = await import("./status-line-J3TUWVRQ.js");
|
|
3734
3741
|
await runStatusLine(io, { dataDir: ctx.dataDir });
|
|
3735
3742
|
});
|
|
3736
3743
|
leaf2(SETUP, "status", "what this machine has spent, and what is still open").description(
|
|
3737
3744
|
"Report the rolling 24h spend window from spend.json: what has settled, what is reserved by a request still in flight, and the per-call and per-day caps in force."
|
|
3738
3745
|
).action(async function() {
|
|
3739
3746
|
await runCommand("status", this, async (ctx) => {
|
|
3740
|
-
const { runRouterStatus } = await import("./status-
|
|
3747
|
+
const { runRouterStatus } = await import("./status-ANZPRZJJ.js");
|
|
3741
3748
|
return runRouterStatus(ctx);
|
|
3742
3749
|
});
|
|
3743
3750
|
});
|
|
@@ -3779,6 +3786,7 @@ function buildContext(cmd, io) {
|
|
|
3779
3786
|
timeout: parsed.data.timeout,
|
|
3780
3787
|
baseUrl: parsed.data.baseUrl
|
|
3781
3788
|
};
|
|
3789
|
+
noteBaseUrlFlag(flags.baseUrl);
|
|
3782
3790
|
return { flags, dataDir: dataDir(process.env), io };
|
|
3783
3791
|
}
|
|
3784
3792
|
var PRODUCTS = [registerCore, registerRouter];
|
|
@@ -3886,4 +3894,4 @@ export {
|
|
|
3886
3894
|
buildProgram,
|
|
3887
3895
|
main
|
|
3888
3896
|
};
|
|
3889
|
-
//# sourceMappingURL=cli-
|
|
3897
|
+
//# sourceMappingURL=cli-XJQYUOHI.js.map
|