tenjin-cli 0.1.0-alpha.2 → 0.1.0-alpha.3
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 +11 -8
- package/dist/{buy-U35DQ6XM.js → buy-EE6SEXP6.js} +7 -7
- package/dist/{candidate-RLYCQMF5.js → candidate-ERMSYYQZ.js} +3 -3
- package/dist/{chunk-QNP7H47L.js → chunk-4ONXEEQL.js} +2 -2
- package/dist/{chunk-YIYQ2ZNT.js → chunk-662MSGZB.js} +2 -2
- package/dist/{chunk-7PHSZKQS.js → chunk-AWPAWHNX.js} +3 -3
- package/dist/{chunk-27ONARHV.js → chunk-DXTQ3CSI.js} +3 -3
- package/dist/{chunk-IYLHQMT5.js → chunk-ESPNTPQ2.js} +4 -8
- package/dist/chunk-ESPNTPQ2.js.map +1 -0
- package/dist/{chunk-N62ROTMC.js → chunk-FJPLRISB.js} +2 -2
- package/dist/{chunk-N62ROTMC.js.map → chunk-FJPLRISB.js.map} +1 -1
- package/dist/{chunk-UPIEAMGH.js → chunk-GO75V3NZ.js} +2 -2
- package/dist/{chunk-TFGSOPWR.js → chunk-XHC6FCGZ.js} +3 -3
- package/dist/{cli-4NNBEQYH.js → cli-SBXI5AMS.js} +18 -18
- package/dist/{config-2VSXWWHK.js → config-VELDKLHY.js} +4 -4
- package/dist/{doctor-JJPNIBYH.js → doctor-T3KWNNP2.js} +5 -5
- package/dist/index.js +1 -1
- package/dist/{inspect-JGYJWFDP.js → inspect-LMKOXE4Y.js} +7 -7
- package/dist/{install-ZQRMSRGW.js → install-LEX3ENQ6.js} +21 -12
- package/dist/install-LEX3ENQ6.js.map +1 -0
- package/dist/{lookup-WYVTOMVY.js → lookup-ZPN2Q67N.js} +22 -6
- package/dist/lookup-ZPN2Q67N.js.map +1 -0
- package/dist/{outcome-HKKT6QIA.js → outcome-N7TAK6WR.js} +6 -6
- package/dist/{publish-D76B3MBK.js → publish-BKBQQAW4.js} +12 -14
- package/dist/publish-BKBQQAW4.js.map +1 -0
- package/dist/{wallet-6QKS6UHW.js → wallet-CWEMYVIH.js} +2 -2
- package/package.json +1 -1
- package/skills/tenjin-publish/SKILL.md +40 -25
- package/skills/tenjin-search/SKILL.md +29 -18
- package/dist/chunk-IYLHQMT5.js.map +0 -1
- package/dist/install-ZQRMSRGW.js.map +0 -1
- package/dist/lookup-WYVTOMVY.js.map +0 -1
- package/dist/publish-D76B3MBK.js.map +0 -1
- /package/dist/{buy-U35DQ6XM.js.map → buy-EE6SEXP6.js.map} +0 -0
- /package/dist/{candidate-RLYCQMF5.js.map → candidate-ERMSYYQZ.js.map} +0 -0
- /package/dist/{chunk-QNP7H47L.js.map → chunk-4ONXEEQL.js.map} +0 -0
- /package/dist/{chunk-YIYQ2ZNT.js.map → chunk-662MSGZB.js.map} +0 -0
- /package/dist/{chunk-7PHSZKQS.js.map → chunk-AWPAWHNX.js.map} +0 -0
- /package/dist/{chunk-27ONARHV.js.map → chunk-DXTQ3CSI.js.map} +0 -0
- /package/dist/{chunk-UPIEAMGH.js.map → chunk-GO75V3NZ.js.map} +0 -0
- /package/dist/{chunk-TFGSOPWR.js.map → chunk-XHC6FCGZ.js.map} +0 -0
- /package/dist/{cli-4NNBEQYH.js.map → cli-SBXI5AMS.js.map} +0 -0
- /package/dist/{config-2VSXWWHK.js.map → config-VELDKLHY.js.map} +0 -0
- /package/dist/{doctor-JJPNIBYH.js.map → doctor-T3KWNNP2.js.map} +0 -0
- /package/dist/{inspect-JGYJWFDP.js.map → inspect-LMKOXE4Y.js.map} +0 -0
- /package/dist/{outcome-HKKT6QIA.js.map → outcome-N7TAK6WR.js.map} +0 -0
- /package/dist/{wallet-6QKS6UHW.js.map → wallet-CWEMYVIH.js.map} +0 -0
package/README.md
CHANGED
|
@@ -173,13 +173,16 @@ true` opts into 90-day retention of the question for retrieval evaluation.
|
|
|
173
173
|
|
|
174
174
|
### Consent modes and pricing
|
|
175
175
|
|
|
176
|
-
`publish`
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
176
|
+
`publish.mode` governs ALL publishing uniformly. A piece you asked for and a
|
|
177
|
+
reusable answer your agent derived after a lookup both go through it, after a
|
|
178
|
+
deterministic local scan (secrets, keys, PII, wallet addresses) that runs in
|
|
179
|
+
every mode:
|
|
180
|
+
|
|
181
|
+
- **`review`** (the default) asks a one-click yes/no for every publish, even a
|
|
182
|
+
clean scan. This is the safe default: nothing leaves your machine unseen.
|
|
183
|
+
- **`auto`** publishes a clean scan immediately, including answers your agent
|
|
184
|
+
derives; any warning finding stops and asks; a hard block (a live secret or
|
|
185
|
+
private key) always refuses.
|
|
183
186
|
- **`full-auto`** does not stop for warnings, only for hard blocks. It is honored
|
|
184
187
|
from your global config, an env var, a flag, or a gitignored `.tenjin.json`. Only
|
|
185
188
|
a committed `.tenjin.json` asking for `full-auto` is downgraded to `auto`, so
|
|
@@ -188,7 +191,7 @@ on every publish, then applies your `publish.mode`:
|
|
|
188
191
|
`--yes` clears the warning findings and the review confirm; it never clears a hard
|
|
189
192
|
block. Set the mode with `tenjin config set publish.mode <mode>`, or per run with
|
|
190
193
|
`--mode`. `tenjin install` asks once on an interactive setup and otherwise leaves
|
|
191
|
-
the default (
|
|
194
|
+
the default (review); change it any time with `tenjin config set publish.mode`.
|
|
192
195
|
|
|
193
196
|
Pricing: `--price` (or a frontmatter `price:`) wins, otherwise `publish.defaultPrice`
|
|
194
197
|
(default $0.10). A card never auto-prices; the `tenjin-publish` skill's rubric is
|
|
@@ -1,7 +1,7 @@
|
|
|
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-DXTQ3CSI.js";
|
|
5
5
|
import {
|
|
6
6
|
buildSiwxHeader,
|
|
7
7
|
createPublicClient,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
findLookupForResource
|
|
25
25
|
} from "./chunk-JPHG2JW3.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-662MSGZB.js";
|
|
27
27
|
import {
|
|
28
28
|
SLUG_RE,
|
|
29
29
|
UUID_RE
|
|
@@ -31,8 +31,8 @@ import {
|
|
|
31
31
|
import {
|
|
32
32
|
sanitizeForTerminal
|
|
33
33
|
} from "./chunk-Z52RA3NC.js";
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-4ONXEEQL.js";
|
|
35
|
+
import "./chunk-FJPLRISB.js";
|
|
36
36
|
import {
|
|
37
37
|
encodeFunctionData,
|
|
38
38
|
getAddress as getAddress2,
|
|
@@ -46,11 +46,11 @@ import "./chunk-ZABPQJ3M.js";
|
|
|
46
46
|
import "./chunk-HSDCI7OV.js";
|
|
47
47
|
import {
|
|
48
48
|
resolveContextSettings
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-GO75V3NZ.js";
|
|
50
50
|
import {
|
|
51
51
|
parseUsdToAtomic,
|
|
52
52
|
toMoney
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-ESPNTPQ2.js";
|
|
54
54
|
import {
|
|
55
55
|
describeWallet,
|
|
56
56
|
resolveSpendAuthorizer,
|
|
@@ -1595,4 +1595,4 @@ function promptYesNo(prompt) {
|
|
|
1595
1595
|
export {
|
|
1596
1596
|
runBuy
|
|
1597
1597
|
};
|
|
1598
|
-
//# sourceMappingURL=buy-
|
|
1598
|
+
//# sourceMappingURL=buy-EE6SEXP6.js.map
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
} from "./chunk-Z52RA3NC.js";
|
|
13
13
|
import {
|
|
14
14
|
pathExists
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-GO75V3NZ.js";
|
|
16
|
+
import "./chunk-ESPNTPQ2.js";
|
|
17
17
|
import "./chunk-2I4QTOLB.js";
|
|
18
18
|
import "./chunk-UO22YNY4.js";
|
|
19
19
|
import "./chunk-MUBUQVC3.js";
|
|
@@ -124,4 +124,4 @@ export {
|
|
|
124
124
|
runCandidateDrop,
|
|
125
125
|
runCandidateList
|
|
126
126
|
};
|
|
127
|
-
//# sourceMappingURL=candidate-
|
|
127
|
+
//# sourceMappingURL=candidate-ERMSYYQZ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
package_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FJPLRISB.js";
|
|
5
5
|
|
|
6
6
|
// src/lib/http.ts
|
|
7
7
|
async function fetchJson(url, opts) {
|
|
@@ -149,4 +149,4 @@ export {
|
|
|
149
149
|
CLIENT_HEADER,
|
|
150
150
|
trimSlash
|
|
151
151
|
};
|
|
152
|
-
//# sourceMappingURL=chunk-
|
|
152
|
+
//# sourceMappingURL=chunk-4ONXEEQL.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
CLIENT_HEADER,
|
|
8
8
|
httpRequest,
|
|
9
9
|
trimSlash
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4ONXEEQL.js";
|
|
11
11
|
import {
|
|
12
12
|
CliError,
|
|
13
13
|
external_exports
|
|
@@ -283,4 +283,4 @@ export {
|
|
|
283
283
|
buildOutcomeItem,
|
|
284
284
|
postOutcomes
|
|
285
285
|
};
|
|
286
|
-
//# sourceMappingURL=chunk-
|
|
286
|
+
//# sourceMappingURL=chunk-662MSGZB.js.map
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
CLIENT_HEADER,
|
|
4
4
|
fetchJson,
|
|
5
5
|
trimSlash
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4ONXEEQL.js";
|
|
7
7
|
import {
|
|
8
8
|
loadRawConfig,
|
|
9
9
|
resolveSettings,
|
|
10
10
|
toMoney
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ESPNTPQ2.js";
|
|
12
12
|
import {
|
|
13
13
|
walletFileExists
|
|
14
14
|
} from "./chunk-YN5SHIXQ.js";
|
|
@@ -330,4 +330,4 @@ export {
|
|
|
330
330
|
runDoctor,
|
|
331
331
|
renderDoctorHuman
|
|
332
332
|
};
|
|
333
|
-
//# sourceMappingURL=chunk-
|
|
333
|
+
//# sourceMappingURL=chunk-AWPAWHNX.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-S3IGX57D.js";
|
|
7
7
|
import {
|
|
8
8
|
rateLimitError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-662MSGZB.js";
|
|
10
10
|
import {
|
|
11
11
|
SLUG_RE,
|
|
12
12
|
UUID_RE
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
CLIENT_HEADER,
|
|
16
16
|
httpRequest
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-4ONXEEQL.js";
|
|
18
18
|
import {
|
|
19
19
|
CliError,
|
|
20
20
|
external_exports
|
|
@@ -168,4 +168,4 @@ function readMessage(json) {
|
|
|
168
168
|
export {
|
|
169
169
|
fetchRead
|
|
170
170
|
};
|
|
171
|
-
//# sourceMappingURL=chunk-
|
|
171
|
+
//# sourceMappingURL=chunk-DXTQ3CSI.js.map
|
|
@@ -44,7 +44,7 @@ var CONFIG_DEFAULTS = {
|
|
|
44
44
|
baseUrl: "https://tenjin.blog",
|
|
45
45
|
rpcUrl: "https://mainnet.base.org",
|
|
46
46
|
evalCohort: false,
|
|
47
|
-
publish: { mode: "
|
|
47
|
+
publish: { mode: "review", defaultPrice: "100000" }
|
|
48
48
|
};
|
|
49
49
|
var CONFIG_KEYS = Object.keys(CONFIG_DEFAULTS).filter(
|
|
50
50
|
(key) => key !== "publish"
|
|
@@ -189,15 +189,12 @@ function atomicToUsd(atomic) {
|
|
|
189
189
|
function toMoney(atomic) {
|
|
190
190
|
return { atomic, usd: atomicToUsd(atomic) };
|
|
191
191
|
}
|
|
192
|
-
function formatUsdDisplay(atomic) {
|
|
193
|
-
const [whole, frac = ""] = atomicToUsd(atomic).split(".");
|
|
194
|
-
return `${whole}.${frac.padEnd(2, "0")}`;
|
|
195
|
-
}
|
|
196
192
|
|
|
197
193
|
export {
|
|
198
194
|
PublishModeSchema,
|
|
199
195
|
parsePublishModeFlag,
|
|
200
196
|
RawConfigSchema,
|
|
197
|
+
CONFIG_DEFAULTS,
|
|
201
198
|
CONFIG_KEYS,
|
|
202
199
|
PUBLISH_CONFIG_KEYS,
|
|
203
200
|
loadRawConfig,
|
|
@@ -205,7 +202,6 @@ export {
|
|
|
205
202
|
resolvePublishMode,
|
|
206
203
|
resolvePublishDefaultPrice,
|
|
207
204
|
parseUsdToAtomic,
|
|
208
|
-
toMoney
|
|
209
|
-
formatUsdDisplay
|
|
205
|
+
toMoney
|
|
210
206
|
};
|
|
211
|
-
//# sourceMappingURL=chunk-
|
|
207
|
+
//# sourceMappingURL=chunk-ESPNTPQ2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/config.ts","../src/lib/money.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { CliError } from './errors';\nimport { configPath } from './paths';\nimport { writeFileAtomic } from './atomic-json';\n\n/** A non-negative integer string in USDC atomic units (6-decimal base). */\nconst atomicString = z.string().regex(/^\\d+$/, 'expected an atomic USDC integer string');\n\n/** The publish consent mode (B3, D38). `full-auto` is loosening-gated, below. */\nexport const PublishModeSchema = z.enum(['review', 'auto', 'full-auto']);\nexport type PublishMode = z.infer<typeof PublishModeSchema>;\n\n/**\n * Validate a publish-mode value at a command edge (`--mode`, `--publish-mode`):\n * an unrecognized value is USAGE (exit 2), never silently dropped. `flagName` is\n * woven into the message so the failing flag is named.\n */\nexport function parsePublishModeFlag(value: string, flagName: string): PublishMode {\n const parsed = PublishModeSchema.safeParse(value);\n if (parsed.success) return parsed.data;\n throw new CliError('USAGE', `Invalid ${flagName} ${JSON.stringify(value)}`, {\n fix: 'Use \"review\", \"auto\", or \"full-auto\".',\n });\n}\n\n/**\n * The publish block (B3): `mode` governs the confirm cascade a `publish` runs,\n * `defaultPrice` is the atomic USDC price a card is published at when no\n * per-publish price is given. Stored atomic like the spend keys.\n */\nconst PublishConfigSchema = z.object({\n mode: PublishModeSchema,\n defaultPrice: atomicString,\n});\n\n/**\n * The persisted config shape. Spend keys are stored atomic (accepted as decimal\n * USD at the command edge, see lib/money); `confirm` is the stored form\n * \"always\" | \"above:<atomic>\". These are client-enforced guardrails, not a\n * security boundary — any process that runs the CLI can also edit this file.\n */\nexport const ConfigSchema = z.object({\n maxAutoSpend: atomicString,\n sessionBudget: atomicString,\n confirm: z.union([z.literal('always'), z.string().regex(/^above:\\d+$/)]),\n allowlistCreators: z.array(z.string()),\n baseUrl: z.url(),\n rpcUrl: z.url(),\n /**\n * Evaluation-cohort opt-in (spec 09 §3): when true, lookup sends\n * X-Tenjin-Eval-Cohort: 1 and the server stores the generalized question for\n * 90 days. Off by default; no query text is retained server-side without it.\n */\n evalCohort: z.boolean(),\n publish: PublishConfigSchema,\n});\nexport type Config = z.infer<typeof ConfigSchema>;\n\n/**\n * Values as they may appear in config.json — every known key optional; absent =\n * default. `.passthrough()` PRESERVES unknown keys through load + persist: without\n * it an older binary's `config set` would strip (and re-serialize away) any newer\n * block a later CLI wrote, e.g. B3's `publish.*`. Known keys are still validated;\n * unknown keys ride along untouched.\n */\nexport const RawConfigSchema = ConfigSchema.partial()\n // The publish block is itself partial + passthrough: `config set publish.mode`\n // writes only the one subkey, and a subkey a newer CLI adds (e.g. publish.*\n // beyond mode/defaultPrice) survives an older binary's set, same reason the\n // outer object passes unknown keys through.\n .extend({ publish: PublishConfigSchema.partial().passthrough().optional() })\n .passthrough();\nexport type PartialConfig = z.infer<typeof RawConfigSchema>;\n\nexport const CONFIG_DEFAULTS: Config = {\n maxAutoSpend: '0',\n sessionBudget: '0',\n confirm: 'always',\n allowlistCreators: [],\n baseUrl: 'https://tenjin.blog',\n rpcUrl: 'https://mainnet.base.org',\n evalCohort: false,\n publish: { mode: 'review', defaultPrice: '100000' },\n};\n\n/**\n * Scalar keys `config get/set/list` render one line each. `publish` is excluded:\n * it is a nested block addressed by the dotted `publish.mode`/`publish.defaultPrice`\n * keys (see PUBLISH_CONFIG_KEYS), so it is never rendered as a bare scalar.\n */\nexport type ScalarConfigKey = Exclude<keyof Config, 'publish'>;\nexport const CONFIG_KEYS = (Object.keys(CONFIG_DEFAULTS) as Array<keyof Config>).filter(\n (key): key is ScalarConfigKey => key !== 'publish',\n);\n\n/** The dotted keys `config get/set` accept for the nested publish block. */\nexport const PUBLISH_CONFIG_KEYS = ['publish.mode', 'publish.defaultPrice'] as const;\nexport type PublishConfigKey = (typeof PUBLISH_CONFIG_KEYS)[number];\n\n/**\n * Read and validate config.json WITHOUT applying defaults, so provenance can\n * distinguish \"present in file\" from \"absent\". Missing file is fine (returns\n * {}); malformed JSON or a failed schema is CONFIG_INVALID with a fix.\n */\nexport async function loadRawConfig(dir: string): Promise<PartialConfig> {\n const path = configPath(dir);\n let raw: string;\n try {\n raw = await readFile(path, 'utf8');\n } catch (err) {\n if (isNotFound(err)) return {};\n throw new CliError('CONFIG_INVALID', `Could not read config at ${path}`, {\n fix: `Check file permissions on ${path}.`,\n cause: err,\n });\n }\n let json: unknown;\n try {\n json = JSON.parse(raw);\n } catch (err) {\n throw new CliError('CONFIG_INVALID', `Config at ${path} is not valid JSON`, {\n fix: `Fix the JSON syntax in ${path}, or delete it to restore defaults.`,\n cause: err,\n });\n }\n const parsed = RawConfigSchema.safeParse(json);\n if (!parsed.success) {\n throw new CliError('CONFIG_INVALID', `Config at ${path} is invalid`, {\n fix: `Correct the reported keys in ${path}, or delete it to restore defaults.`,\n details: parsed.error.issues,\n });\n }\n return parsed.data;\n}\n\n/** File values merged over defaults — the effective persisted config. The nested\n * publish block is merged per-subkey so a file that sets only publish.mode keeps\n * the default defaultPrice (a shallow spread would drop it). */\nexport async function loadConfig(dir: string): Promise<Config> {\n const raw = await loadRawConfig(dir);\n return {\n ...CONFIG_DEFAULTS,\n ...raw,\n publish: {\n mode: raw.publish?.mode ?? CONFIG_DEFAULTS.publish.mode,\n defaultPrice: raw.publish?.defaultPrice ?? CONFIG_DEFAULTS.publish.defaultPrice,\n },\n };\n}\n\nexport type Provenance = 'default' | 'file' | 'project' | 'env' | 'flag';\n\nexport interface ResolvedSetting<T> {\n value: T;\n source: Provenance;\n}\n\n/**\n * The per-project `.tenjin.json` layer (B3, D38): publish overrides discovered by\n * walking up from cwd, plus whether that file is gitignored. `gitignored` gates\n * `full-auto` — a committed file requesting it is downgraded (loosening gate).\n */\nexport interface ProjectPublishLayer {\n publish?: { mode?: PublishMode; defaultPrice?: string };\n gitignored: boolean;\n}\n\n/** publish.mode resolution: value, source, and the downgrade warning (if any). */\nexport interface PublishModeResolution {\n value: PublishMode;\n source: Provenance;\n /** Set when a committed `.tenjin.json`'s `full-auto` was downgraded to `auto`. */\n downgradedWarning?: string;\n}\n\n/** Effective value + where it came from, per key. What `config` (bare) renders. */\nexport interface EffectiveSettings {\n maxAutoSpend: ResolvedSetting<string>;\n sessionBudget: ResolvedSetting<string>;\n confirm: ResolvedSetting<string>;\n allowlistCreators: ResolvedSetting<string[]>;\n baseUrl: ResolvedSetting<string>;\n rpcUrl: ResolvedSetting<string>;\n evalCohort: ResolvedSetting<boolean>;\n publishMode: PublishModeResolution;\n publishDefaultPrice: ResolvedSetting<string>;\n}\n\n/** CLI flags that participate in settings precedence (`--base-url`). */\nexport interface SettingsFlags {\n baseUrl?: string;\n}\n\nexport interface ResolveSettingsInput {\n /** Raw file values (present keys only) — from loadRawConfig, not loadConfig. */\n config: PartialConfig;\n flags: SettingsFlags;\n env: NodeJS.ProcessEnv;\n /** The nearest `.tenjin.json` layer, when one was found (see publish-settings). */\n project?: ProjectPublishLayer;\n}\n\n/**\n * Apply precedence flag > env > file > default per key, returning each effective\n * value with its source. In B1 only baseUrl has flag/env overrides\n * (`--base-url`, TENJIN_BASE_URL); the rest resolve file-or-default. B3 adds the\n * publish keys, which additionally fold in the per-project `.tenjin.json` layer.\n */\nexport function resolveSettings(input: ResolveSettingsInput): EffectiveSettings {\n const { config, flags, env, project } = input;\n return {\n maxAutoSpend: fileOrDefault('maxAutoSpend', config),\n sessionBudget: fileOrDefault('sessionBudget', config),\n confirm: fileOrDefault('confirm', config),\n allowlistCreators: fileOrDefault('allowlistCreators', config),\n baseUrl: resolveBaseUrl(config, flags, env),\n rpcUrl: fileOrDefault('rpcUrl', config),\n evalCohort: fileOrDefault('evalCohort', config),\n publishMode: resolvePublishMode({ config, project, env }),\n publishDefaultPrice: resolvePublishDefaultPrice({ config, project }),\n };\n}\n\n/**\n * The loosening gate (D38): a committed (not-gitignored) `.tenjin.json` requesting\n * `full-auto` is downgraded to `auto`, never silently honored — cloning a repo\n * must not enable auto-publish. `full-auto` from global config / env / flag (all\n * inherently local, not cloned) is always honored.\n */\nconst FULL_AUTO_DOWNGRADE_WARNING =\n 'Ignoring publish.mode \"full-auto\" from a committed .tenjin.json (cloning a repo must not enable auto-publish); using \"auto\". Add .tenjin.json to .gitignore to opt in.';\n\nfunction coercePublishMode(raw: string | undefined): PublishMode | undefined {\n if (raw === undefined || raw.length === 0) return undefined;\n const parsed = PublishModeSchema.safeParse(raw);\n return parsed.success ? parsed.data : undefined;\n}\n\n/**\n * Resolve publish.mode through global file < project `.tenjin.json` < env\n * (TENJIN_PUBLISH_MODE) < flag (`--mode`). Total: an invalid env/flag value is\n * ignored (validation lives at the command edge, like baseUrl). The project\n * layer's `full-auto` is gated on that file being gitignored.\n */\nexport function resolvePublishMode(input: {\n config: PartialConfig;\n project?: ProjectPublishLayer;\n env: NodeJS.ProcessEnv;\n flag?: string;\n}): PublishModeResolution {\n const { config, project, env, flag } = input;\n let winner: PublishModeResolution = { value: CONFIG_DEFAULTS.publish.mode, source: 'default' };\n\n const fromFile = config.publish?.mode;\n if (fromFile !== undefined) winner = { value: fromFile, source: 'file' };\n\n if (project !== undefined && project.publish?.mode !== undefined) {\n const fromProject = project.publish.mode;\n if (fromProject === 'full-auto' && !project.gitignored) {\n winner = { value: 'auto', source: 'project', downgradedWarning: FULL_AUTO_DOWNGRADE_WARNING };\n } else {\n winner = { value: fromProject, source: 'project' };\n }\n }\n\n const fromEnv = coercePublishMode(env.TENJIN_PUBLISH_MODE);\n if (fromEnv !== undefined) winner = { value: fromEnv, source: 'env' };\n\n const fromFlag = coercePublishMode(flag);\n if (fromFlag !== undefined) winner = { value: fromFlag, source: 'flag' };\n\n return winner;\n}\n\n/** Resolve publish.defaultPrice (atomic) through global file < project < default. */\nexport function resolvePublishDefaultPrice(input: {\n config: PartialConfig;\n project?: ProjectPublishLayer;\n}): ResolvedSetting<string> {\n const { config, project } = input;\n let result: ResolvedSetting<string> = {\n value: CONFIG_DEFAULTS.publish.defaultPrice,\n source: 'default',\n };\n if (config.publish?.defaultPrice !== undefined) {\n result = { value: config.publish.defaultPrice, source: 'file' };\n }\n if (project?.publish?.defaultPrice !== undefined) {\n result = { value: project.publish.defaultPrice, source: 'project' };\n }\n return result;\n}\n\n/** Persist a full, validated config via the atomic writer (0700 dir, 0644 file). */\nexport async function writeConfig(dir: string, config: Config): Promise<void> {\n const validated = ConfigSchema.parse(config);\n await writeFileAtomic(configPath(dir), `${JSON.stringify(validated, null, 2)}\\n`, {\n mode: 0o644,\n dirMode: 0o700,\n });\n}\n\nfunction fileOrDefault<K extends keyof Config>(\n key: K,\n config: PartialConfig,\n): ResolvedSetting<Config[K]> {\n const fromFile = config[key];\n // PartialConfig[K] is Config[K] | undefined; narrowing an indexed access of a\n // type parameter doesn't refine K, so assert the excluded-undefined type.\n if (fromFile !== undefined) return { value: fromFile as Config[K], source: 'file' };\n return { value: CONFIG_DEFAULTS[key], source: 'default' };\n}\n\nfunction resolveBaseUrl(\n config: PartialConfig,\n flags: SettingsFlags,\n env: NodeJS.ProcessEnv,\n): ResolvedSetting<string> {\n if (flags.baseUrl !== undefined && flags.baseUrl.length > 0) {\n return { value: flags.baseUrl, source: 'flag' };\n }\n const fromEnv = env.TENJIN_BASE_URL;\n if (fromEnv !== undefined && fromEnv.length > 0) {\n return { value: fromEnv, source: 'env' };\n }\n if (config.baseUrl !== undefined) return { value: config.baseUrl, source: 'file' };\n return { value: CONFIG_DEFAULTS.baseUrl, source: 'default' };\n}\n\nfunction isNotFound(err: unknown): boolean {\n return (\n typeof err === 'object' &&\n err !== null &&\n 'code' in err &&\n (err as { code?: unknown }).code === 'ENOENT'\n );\n}\n","import { CliError } from './errors';\nimport type { Money } from '../schemas';\n\n/** USDC is a 6-decimal token; one dollar is 1_000_000 atomic units. */\nconst USDC_DECIMALS = 6;\n\n/**\n * Decimal USD at the CLI edge -> atomic USDC string (O1). Accepts \"0\", \"0.25\",\n * \"5\"; rejects negatives, non-numeric input, and more than 6 decimal places as\n * USAGE so a fat-fingered amount fails loudly instead of truncating money.\n * String math throughout — a float would lose precision at the 6th decimal.\n */\nexport function parseUsdToAtomic(input: string): string {\n const trimmed = input.trim();\n if (!/^\\d+(\\.\\d+)?$/.test(trimmed)) {\n throw new CliError('USAGE', `Invalid USD amount: ${JSON.stringify(input)}`, {\n fix: 'Pass a non-negative decimal like 0.25 or 5.',\n });\n }\n const [whole, frac = ''] = trimmed.split('.');\n if (frac.length > USDC_DECIMALS) {\n throw new CliError(\n 'USAGE',\n `USD amount ${JSON.stringify(input)} has more than 6 decimal places`,\n {\n fix: 'USDC supports at most 6 decimal places (micro-dollars).',\n },\n );\n }\n const atomic = BigInt(`${whole}${frac.padEnd(USDC_DECIMALS, '0')}`);\n return atomic.toString();\n}\n\n/**\n * Atomic USDC string -> decimal USD string, trailing zeros trimmed (\"250000\" ->\n * \"0.25\", \"5000000\" -> \"5\", \"0\" -> \"0\"). Throws INTERNAL on a malformed atomic\n * value: atomic strings come from validated config or on-chain reads, so a bad\n * one is a bug, not user input.\n */\nexport function atomicToUsd(atomic: string): string {\n const trimmed = atomic.trim();\n if (!/^\\d+$/.test(trimmed)) {\n throw new CliError('INTERNAL', `Malformed atomic amount: ${JSON.stringify(atomic)}`);\n }\n const value = BigInt(trimmed);\n const base = 10n ** BigInt(USDC_DECIMALS);\n const whole = value / base;\n const frac = (value % base).toString().padStart(USDC_DECIMALS, '0').replace(/0+$/, '');\n return frac.length > 0 ? `${whole}.${frac}` : whole.toString();\n}\n\n/** Dual-form money object for machine output. */\nexport function toMoney(atomic: string): Money {\n return { atomic, usd: atomicToUsd(atomic) };\n}\n\n/**\n * Canonical USD for human COPY (a price a person reads): always at least two\n * decimals (\"0.10\", \"5.00\"), keeping any finer precision below a cent\n * (\"0.000001\"). Distinct from `atomicToUsd`, which trims to the shortest exact\n * form for machine output; use this only where a dollar amount is shown to a human.\n */\nexport function formatUsdDisplay(atomic: string): string {\n const [whole, frac = ''] = atomicToUsd(atomic).split('.');\n return `${whole}.${frac.padEnd(2, '0')}`;\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,gBAAgB;AAOzB,IAAM,eAAe,iBAAE,OAAO,EAAE,MAAM,SAAS,wCAAwC;AAGhF,IAAM,oBAAoB,iBAAE,KAAK,CAAC,UAAU,QAAQ,WAAW,CAAC;AAQhE,SAAS,qBAAqB,OAAe,UAA+B;AACjF,QAAM,SAAS,kBAAkB,UAAU,KAAK;AAChD,MAAI,OAAO,QAAS,QAAO,OAAO;AAClC,QAAM,IAAI,SAAS,SAAS,WAAW,QAAQ,IAAI,KAAK,UAAU,KAAK,CAAC,IAAI;AAAA,IAC1E,KAAK;AAAA,EACP,CAAC;AACH;AAOA,IAAM,sBAAsB,iBAAE,OAAO;AAAA,EACnC,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAQM,IAAM,eAAe,iBAA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AS,EAAE,SAAS,eAAe,GAAG,EAAE,QAAQ,OAAO,EAAE;AACrF,SAAO,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,IAAI,KAAK,MAAM,SAAS;AAC/D;AAGO,SAAS,QAAQ,QAAuB;AAC7C,SAAO,EAAE,QAAQ,KAAK,YAAY,MAAM,EAAE;AAC5C;","names":[]}
|
|
@@ -3,7 +3,7 @@ import { createRequire as __tenjinCreateRequire } from 'node:module'; const requ
|
|
|
3
3
|
// package.json
|
|
4
4
|
var package_default = {
|
|
5
5
|
name: "tenjin-cli",
|
|
6
|
-
version: "0.1.0-alpha.
|
|
6
|
+
version: "0.1.0-alpha.3",
|
|
7
7
|
type: "module",
|
|
8
8
|
description: "Tenjin agent CLI for the x402 knowledge marketplace.",
|
|
9
9
|
license: "MIT",
|
|
@@ -76,4 +76,4 @@ var package_default = {
|
|
|
76
76
|
export {
|
|
77
77
|
package_default
|
|
78
78
|
};
|
|
79
|
-
//# sourceMappingURL=chunk-
|
|
79
|
+
//# sourceMappingURL=chunk-FJPLRISB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"tenjin-cli\",\n \"version\": \"0.1.0-alpha.
|
|
1
|
+
{"version":3,"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"tenjin-cli\",\n \"version\": \"0.1.0-alpha.3\",\n \"type\": \"module\",\n \"description\": \"Tenjin agent CLI for the x402 knowledge marketplace.\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/BackTrackCo/tenjin-agent.git\"\n },\n \"homepage\": \"https://tenjin.blog/agents\",\n \"bugs\": \"https://github.com/BackTrackCo/tenjin-agent/issues\",\n \"keywords\": [\n \"x402\",\n \"usdc\",\n \"base\",\n \"ai-agents\",\n \"agent-payments\",\n \"mcp\",\n \"knowledge-marketplace\",\n \"micropayments\",\n \"claude\",\n \"codex\",\n \"cli\"\n ],\n \"bin\": {\n \"tenjin\": \"dist/index.js\"\n },\n \"engines\": {\n \"node\": \">=22\"\n },\n \"files\": [\n \"dist\",\n \"skills\",\n \"NOTICE.md\"\n ],\n \"packageManager\": \"pnpm@11.11.0\",\n \"scripts\": {\n \"build\": \"tsup\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc --noEmit\",\n \"lint\": \"eslint .\",\n \"format\": \"prettier --write .\",\n \"format:check\": \"prettier --check .\",\n \"check\": \"pnpm run build && pnpm run test\",\n \"sync:skill\": \"node scripts/sync-skill.mjs\",\n \"pack-smoke\": \"bash scripts/pack-smoke.sh\",\n \"changeset\": \"changeset\",\n \"prepublishOnly\": \"pnpm run build\",\n \"prepare\": \"git config core.hooksPath .githooks || true\"\n },\n \"devDependencies\": {\n \"@changesets/cli\": \"^2.31.1\",\n \"@eslint/js\": \"^9\",\n \"@types/node\": \"^25\",\n \"@x402/core\": \"2.17.0\",\n \"@x402/evm\": \"2.17.0\",\n \"@x402/extensions\": \"2.17.0\",\n \"commander\": \"^14.0.1\",\n \"eslint\": \"^9\",\n \"eslint-config-prettier\": \"^10\",\n \"ox\": \"0.14.30\",\n \"prettier\": \"^3\",\n \"tsup\": \"^8.5.0\",\n \"typescript\": \"^6\",\n \"typescript-eslint\": \"^8\",\n \"viem\": \"^2.53.1\",\n \"vitest\": \"^4.1.9\",\n \"zod\": \"^4.4.3\"\n }\n}\n"],"mappings":";;;AAAA;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,MAAQ;AAAA,EACR,aAAe;AAAA,EACf,SAAW;AAAA,EACX,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,EACT;AAAA,EACA,UAAY;AAAA,EACZ,MAAQ;AAAA,EACR,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,KAAO;AAAA,IACL,QAAU;AAAA,EACZ;AAAA,EACA,SAAW;AAAA,IACT,MAAQ;AAAA,EACV;AAAA,EACA,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,gBAAkB;AAAA,EAClB,SAAW;AAAA,IACT,OAAS;AAAA,IACT,MAAQ;AAAA,IACR,WAAa;AAAA,IACb,MAAQ;AAAA,IACR,QAAU;AAAA,IACV,gBAAgB;AAAA,IAChB,OAAS;AAAA,IACT,cAAc;AAAA,IACd,cAAc;AAAA,IACd,WAAa;AAAA,IACb,gBAAkB;AAAA,IAClB,SAAW;AAAA,EACb;AAAA,EACA,iBAAmB;AAAA,IACjB,mBAAmB;AAAA,IACnB,cAAc;AAAA,IACd,eAAe;AAAA,IACf,cAAc;AAAA,IACd,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,WAAa;AAAA,IACb,QAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B,IAAM;AAAA,IACN,UAAY;AAAA,IACZ,MAAQ;AAAA,IACR,YAAc;AAAA,IACd,qBAAqB;AAAA,IACrB,MAAQ;AAAA,IACR,QAAU;AAAA,IACV,KAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
resolvePublishDefaultPrice,
|
|
7
7
|
resolvePublishMode,
|
|
8
8
|
resolveSettings
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ESPNTPQ2.js";
|
|
10
10
|
import {
|
|
11
11
|
parseConfirmPolicy
|
|
12
12
|
} from "./chunk-UO22YNY4.js";
|
|
@@ -157,4 +157,4 @@ export {
|
|
|
157
157
|
loadProjectConfig,
|
|
158
158
|
pathExists
|
|
159
159
|
};
|
|
160
|
-
//# sourceMappingURL=chunk-
|
|
160
|
+
//# sourceMappingURL=chunk-GO75V3NZ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
loadProjectConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GO75V3NZ.js";
|
|
5
5
|
import {
|
|
6
6
|
CONFIG_KEYS,
|
|
7
7
|
PUBLISH_CONFIG_KEYS,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
parseUsdToAtomic,
|
|
12
12
|
resolveSettings,
|
|
13
13
|
toMoney
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ESPNTPQ2.js";
|
|
15
15
|
import {
|
|
16
16
|
LockTimeoutError,
|
|
17
17
|
withFileLock
|
|
@@ -258,4 +258,4 @@ export {
|
|
|
258
258
|
runConfigSet,
|
|
259
259
|
persistPublishMode
|
|
260
260
|
};
|
|
261
|
-
//# sourceMappingURL=chunk-
|
|
261
|
+
//# sourceMappingURL=chunk-XHC6FCGZ.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-Z52RA3NC.js";
|
|
7
7
|
import {
|
|
8
8
|
package_default
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FJPLRISB.js";
|
|
10
10
|
import {
|
|
11
11
|
CliError,
|
|
12
12
|
dataDir,
|
|
@@ -3529,7 +3529,7 @@ function buildProgram(io, setExit) {
|
|
|
3529
3529
|
).action(async function() {
|
|
3530
3530
|
await runCommand("install", this, async (ctx) => {
|
|
3531
3531
|
const o = this.opts();
|
|
3532
|
-
const { runInstall } = await import("./install-
|
|
3532
|
+
const { runInstall } = await import("./install-LEX3ENQ6.js");
|
|
3533
3533
|
return runInstall(
|
|
3534
3534
|
{
|
|
3535
3535
|
...Array.isArray(o.harness) && o.harness.length > 0 ? { harness: o.harness } : {},
|
|
@@ -3542,7 +3542,7 @@ function buildProgram(io, setExit) {
|
|
|
3542
3542
|
});
|
|
3543
3543
|
addGlobalFlags(program2.command("doctor")).description("Check the local environment and Tenjin API reachability").action(async function() {
|
|
3544
3544
|
await runCommand("doctor", this, async (ctx) => {
|
|
3545
|
-
const { runDoctor } = await import("./doctor-
|
|
3545
|
+
const { runDoctor } = await import("./doctor-T3KWNNP2.js");
|
|
3546
3546
|
return runDoctor(ctx);
|
|
3547
3547
|
});
|
|
3548
3548
|
});
|
|
@@ -3551,19 +3551,19 @@ function buildProgram(io, setExit) {
|
|
|
3551
3551
|
);
|
|
3552
3552
|
config.action(async function() {
|
|
3553
3553
|
await runCommand("config", this, async (ctx) => {
|
|
3554
|
-
const { runConfigList } = await import("./config-
|
|
3554
|
+
const { runConfigList } = await import("./config-VELDKLHY.js");
|
|
3555
3555
|
return runConfigList(ctx);
|
|
3556
3556
|
});
|
|
3557
3557
|
});
|
|
3558
3558
|
addGlobalFlags(config.command("get <key>")).description("Print one effective config value").action(async function(key) {
|
|
3559
3559
|
await runCommand("config.get", this, async (ctx) => {
|
|
3560
|
-
const { runConfigGet } = await import("./config-
|
|
3560
|
+
const { runConfigGet } = await import("./config-VELDKLHY.js");
|
|
3561
3561
|
return runConfigGet({ key }, ctx);
|
|
3562
3562
|
});
|
|
3563
3563
|
});
|
|
3564
3564
|
addGlobalFlags(config.command("set <key> <value>")).description("Set a config value (decimal USD accepted for spend keys)").action(async function(key, value) {
|
|
3565
3565
|
await runCommand("config.set", this, async (ctx) => {
|
|
3566
|
-
const { runConfigSet } = await import("./config-
|
|
3566
|
+
const { runConfigSet } = await import("./config-VELDKLHY.js");
|
|
3567
3567
|
return runConfigSet({ key, value }, ctx);
|
|
3568
3568
|
});
|
|
3569
3569
|
});
|
|
@@ -3572,19 +3572,19 @@ function buildProgram(io, setExit) {
|
|
|
3572
3572
|
);
|
|
3573
3573
|
addGlobalFlags(wallet.command("create")).description("Create a new local wallet").action(async function() {
|
|
3574
3574
|
await runCommand("wallet.create", this, async (ctx) => {
|
|
3575
|
-
const { runWalletCreate } = await import("./wallet-
|
|
3575
|
+
const { runWalletCreate } = await import("./wallet-CWEMYVIH.js");
|
|
3576
3576
|
return runWalletCreate(ctx);
|
|
3577
3577
|
});
|
|
3578
3578
|
});
|
|
3579
3579
|
addGlobalFlags(wallet.command("show")).description("Show the wallet address and key source (never the key)").action(async function() {
|
|
3580
3580
|
await runCommand("wallet.show", this, async (ctx) => {
|
|
3581
|
-
const { runWalletShow } = await import("./wallet-
|
|
3581
|
+
const { runWalletShow } = await import("./wallet-CWEMYVIH.js");
|
|
3582
3582
|
return runWalletShow(ctx);
|
|
3583
3583
|
});
|
|
3584
3584
|
});
|
|
3585
3585
|
addGlobalFlags(wallet.command("balance")).description("Show the wallet USDC balance on Base").action(async function() {
|
|
3586
3586
|
await runCommand("wallet.balance", this, async (ctx) => {
|
|
3587
|
-
const { runWalletBalance } = await import("./wallet-
|
|
3587
|
+
const { runWalletBalance } = await import("./wallet-CWEMYVIH.js");
|
|
3588
3588
|
return runWalletBalance(ctx);
|
|
3589
3589
|
});
|
|
3590
3590
|
});
|
|
@@ -3593,7 +3593,7 @@ function buildProgram(io, setExit) {
|
|
|
3593
3593
|
).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) {
|
|
3594
3594
|
await runCommand("lookup", this, async (ctx) => {
|
|
3595
3595
|
const o = this.opts();
|
|
3596
|
-
const { runLookup } = await import("./lookup-
|
|
3596
|
+
const { runLookup } = await import("./lookup-ZPN2Q67N.js");
|
|
3597
3597
|
return runLookup(
|
|
3598
3598
|
{
|
|
3599
3599
|
question,
|
|
@@ -3610,7 +3610,7 @@ function buildProgram(io, setExit) {
|
|
|
3610
3610
|
"Show a candidate's pre-purchase card / preview. Use after lookup, before buy, to check price, scope, and freshness; it never pays"
|
|
3611
3611
|
).action(async function(resource) {
|
|
3612
3612
|
await runCommand("inspect", this, async (ctx) => {
|
|
3613
|
-
const { runInspect } = await import("./inspect-
|
|
3613
|
+
const { runInspect } = await import("./inspect-LMKOXE4Y.js");
|
|
3614
3614
|
return runInspect({ ref: resource }, ctx);
|
|
3615
3615
|
});
|
|
3616
3616
|
});
|
|
@@ -3622,7 +3622,7 @@ function buildProgram(io, setExit) {
|
|
|
3622
3622
|
).action(async function(resource) {
|
|
3623
3623
|
await runCommand("buy", this, async (ctx) => {
|
|
3624
3624
|
const o = this.opts();
|
|
3625
|
-
const { runBuy } = await import("./buy-
|
|
3625
|
+
const { runBuy } = await import("./buy-EE6SEXP6.js");
|
|
3626
3626
|
return runBuy(
|
|
3627
3627
|
{
|
|
3628
3628
|
ref: resource,
|
|
@@ -3643,7 +3643,7 @@ function buildProgram(io, setExit) {
|
|
|
3643
3643
|
).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("--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) {
|
|
3644
3644
|
await runCommand("publish", this, async (ctx) => {
|
|
3645
3645
|
const o = this.opts();
|
|
3646
|
-
const { runPublish } = await import("./publish-
|
|
3646
|
+
const { runPublish } = await import("./publish-BKBQQAW4.js");
|
|
3647
3647
|
return runPublish(
|
|
3648
3648
|
{
|
|
3649
3649
|
...typeof file === "string" ? { file } : {},
|
|
@@ -3676,7 +3676,7 @@ function buildProgram(io, setExit) {
|
|
|
3676
3676
|
).option("--resource <id>", "the resourceId the outcome concerns").option("--content-hash <hash>", "sha256:<64hex> of the exact body read").action(async function() {
|
|
3677
3677
|
await runCommand("outcome", this, async (ctx) => {
|
|
3678
3678
|
const o = this.opts();
|
|
3679
|
-
const { runOutcome } = await import("./outcome-
|
|
3679
|
+
const { runOutcome } = await import("./outcome-N7TAK6WR.js");
|
|
3680
3680
|
return runOutcome(
|
|
3681
3681
|
{
|
|
3682
3682
|
status: String(o.status),
|
|
@@ -3697,7 +3697,7 @@ function buildProgram(io, setExit) {
|
|
|
3697
3697
|
addGlobalFlags(candidate.command("add <file>")).description("Park a Markdown draft as a publish candidate, tied to a lookup").requiredOption("--lookup-id <id>", "the lookup whose unmet demand this draft answers").option("--question <q>", "the question this draft answers").action(async function(file) {
|
|
3698
3698
|
await runCommand("candidate.add", this, async (ctx) => {
|
|
3699
3699
|
const o = this.opts();
|
|
3700
|
-
const { runCandidateAdd } = await import("./candidate-
|
|
3700
|
+
const { runCandidateAdd } = await import("./candidate-ERMSYYQZ.js");
|
|
3701
3701
|
return runCandidateAdd(
|
|
3702
3702
|
{
|
|
3703
3703
|
file,
|
|
@@ -3710,13 +3710,13 @@ function buildProgram(io, setExit) {
|
|
|
3710
3710
|
});
|
|
3711
3711
|
addGlobalFlags(candidate.command("list")).description("List pending candidates, newest first").action(async function() {
|
|
3712
3712
|
await runCommand("candidate.list", this, async (ctx) => {
|
|
3713
|
-
const { runCandidateList } = await import("./candidate-
|
|
3713
|
+
const { runCandidateList } = await import("./candidate-ERMSYYQZ.js");
|
|
3714
3714
|
return runCandidateList(ctx);
|
|
3715
3715
|
});
|
|
3716
3716
|
});
|
|
3717
3717
|
addGlobalFlags(candidate.command("drop <id>")).description("Discard a pending candidate (never auto-deleted)").action(async function(id) {
|
|
3718
3718
|
await runCommand("candidate.drop", this, async (ctx) => {
|
|
3719
|
-
const { runCandidateDrop } = await import("./candidate-
|
|
3719
|
+
const { runCandidateDrop } = await import("./candidate-ERMSYYQZ.js");
|
|
3720
3720
|
return runCandidateDrop({ id }, ctx);
|
|
3721
3721
|
});
|
|
3722
3722
|
});
|
|
@@ -3756,4 +3756,4 @@ export {
|
|
|
3756
3756
|
buildProgram,
|
|
3757
3757
|
main
|
|
3758
3758
|
};
|
|
3759
|
-
//# sourceMappingURL=cli-
|
|
3759
|
+
//# sourceMappingURL=cli-SBXI5AMS.js.map
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
runConfigGet,
|
|
5
5
|
runConfigList,
|
|
6
6
|
runConfigSet
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-XHC6FCGZ.js";
|
|
8
|
+
import "./chunk-GO75V3NZ.js";
|
|
9
|
+
import "./chunk-ESPNTPQ2.js";
|
|
10
10
|
import "./chunk-YBMMV4Y4.js";
|
|
11
11
|
import "./chunk-UO22YNY4.js";
|
|
12
12
|
import "./chunk-MUBUQVC3.js";
|
|
@@ -18,4 +18,4 @@ export {
|
|
|
18
18
|
runConfigList,
|
|
19
19
|
runConfigSet
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=config-
|
|
21
|
+
//# sourceMappingURL=config-VELDKLHY.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
collectDoctorChecks,
|
|
4
4
|
renderDoctorHuman,
|
|
5
5
|
runDoctor
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-AWPAWHNX.js";
|
|
7
|
+
import "./chunk-4ONXEEQL.js";
|
|
8
|
+
import "./chunk-FJPLRISB.js";
|
|
9
|
+
import "./chunk-ESPNTPQ2.js";
|
|
10
10
|
import "./chunk-YN5SHIXQ.js";
|
|
11
11
|
import "./chunk-2I4QTOLB.js";
|
|
12
12
|
import "./chunk-MUBUQVC3.js";
|
|
@@ -17,4 +17,4 @@ export {
|
|
|
17
17
|
renderDoctorHuman,
|
|
18
18
|
runDoctor
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=doctor-
|
|
20
|
+
//# sourceMappingURL=doctor-T3KWNNP2.js.map
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,6 @@ if (Number.isNaN(nodeMajor) || nodeMajor < MIN_NODE_MAJOR) {
|
|
|
21
21
|
`);
|
|
22
22
|
process.exit(1);
|
|
23
23
|
}
|
|
24
|
-
var { main } = await import("./cli-
|
|
24
|
+
var { main } = await import("./cli-SBXI5AMS.js");
|
|
25
25
|
process.exit(await main(process.argv.slice(2)));
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
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-DXTQ3CSI.js";
|
|
5
5
|
import {
|
|
6
6
|
headingOutline
|
|
7
7
|
} from "./chunk-S3IGX57D.js";
|
|
@@ -9,23 +9,23 @@ import {
|
|
|
9
9
|
resolveResourceRef
|
|
10
10
|
} from "./chunk-7KUW4MJD.js";
|
|
11
11
|
import "./chunk-JPHG2JW3.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-662MSGZB.js";
|
|
13
13
|
import "./chunk-3OV7E5G5.js";
|
|
14
14
|
import {
|
|
15
15
|
sanitizeForTerminal
|
|
16
16
|
} from "./chunk-Z52RA3NC.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-4ONXEEQL.js";
|
|
18
|
+
import "./chunk-FJPLRISB.js";
|
|
19
19
|
import "./chunk-RRN3YTK7.js";
|
|
20
20
|
import "./chunk-CYOF7ROH.js";
|
|
21
21
|
import "./chunk-ZABPQJ3M.js";
|
|
22
22
|
import "./chunk-HSDCI7OV.js";
|
|
23
23
|
import {
|
|
24
24
|
resolveContextSettings
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-GO75V3NZ.js";
|
|
26
26
|
import {
|
|
27
27
|
toMoney
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-ESPNTPQ2.js";
|
|
29
29
|
import "./chunk-YBMMV4Y4.js";
|
|
30
30
|
import "./chunk-UO22YNY4.js";
|
|
31
31
|
import "./chunk-MUBUQVC3.js";
|
|
@@ -93,4 +93,4 @@ async function runInspect(args, ctx, deps = {}) {
|
|
|
93
93
|
export {
|
|
94
94
|
runInspect
|
|
95
95
|
};
|
|
96
|
-
//# sourceMappingURL=inspect-
|
|
96
|
+
//# sourceMappingURL=inspect-LMKOXE4Y.js.map
|