@moda-ai/cli 1.31.1 → 1.32.0
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 +87 -13
- package/dist/cli-bh8gxmm8.js +187022 -0
- package/dist/{cli-59yacef3.js → cli-drabjmaj.js} +90 -63
- package/dist/{cli-pq6rte0w.js → cli-scjxgaba.js} +2 -2
- package/dist/cli-w22qhyk4.js +8524 -0
- package/dist/{cli-9xw5bq1j.js → cli-yz99t7n8.js} +1 -1
- package/dist/cli.js +20 -14
- package/dist/harness-4s8pybt1.js +91 -0
- package/dist/{harness-github-actions-kbw4z7q4.js → harness-github-actions-53mhczg2.js} +2 -2
- package/dist/{index-4enh6fq6.js → index-tbrrfhhf.js} +14 -6
- package/dist/{provision-r0cq3g2v.js → provision-d242y9qd.js} +3 -3
- package/package.json +3 -1
- package/skills/integration/index.json +2 -2
- package/skills/integration/integration-cloudflare-think/SKILL.md +25 -22
- package/dist/cli-j3rr0nh7.js +0 -2972
- package/dist/cli-p3271yp2.js +0 -7789
package/dist/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
runPromptsCommand,
|
|
9
9
|
runSkillsCommand,
|
|
10
10
|
runStatusCommand
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-w22qhyk4.js";
|
|
12
12
|
import {
|
|
13
13
|
ApiError,
|
|
14
14
|
HARNESS_REPORT_APPROVAL_PATH,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
summarizeHarness,
|
|
30
30
|
terminalStyles,
|
|
31
31
|
validateHarnessReport
|
|
32
|
-
} from "./cli-
|
|
32
|
+
} from "./cli-bh8gxmm8.js";
|
|
33
33
|
import {
|
|
34
34
|
authFetch,
|
|
35
35
|
clearAuthSession,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
loadAuthSession,
|
|
38
38
|
login,
|
|
39
39
|
revokeCliSessionToken
|
|
40
|
-
} from "./cli-
|
|
40
|
+
} from "./cli-yz99t7n8.js";
|
|
41
41
|
import {
|
|
42
42
|
AGENT_ERROR_CODES,
|
|
43
43
|
CliAccessError,
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
validateConfig,
|
|
85
85
|
wasOutputCancelled,
|
|
86
86
|
writeSecretJsonFile
|
|
87
|
-
} from "./cli-
|
|
87
|
+
} from "./cli-drabjmaj.js";
|
|
88
88
|
|
|
89
89
|
// src/cli.ts
|
|
90
90
|
import { z as z2 } from "zod";
|
|
@@ -5394,7 +5394,7 @@ Commands:
|
|
|
5394
5394
|
prompts init Create .moda/prompts.yml
|
|
5395
5395
|
prompts status Show local prompt changes
|
|
5396
5396
|
prompts diff Show local prompt changes
|
|
5397
|
-
prompts sync
|
|
5397
|
+
prompts sync Analyze prompt sources and upload versions
|
|
5398
5398
|
prompts sync --watch Upload again when prompt files change
|
|
5399
5399
|
prompts promote <key> Move a dev/staging/prod label
|
|
5400
5400
|
prompts ab Run a judged prompt A/B replay experiment
|
|
@@ -5538,6 +5538,7 @@ Init flags:
|
|
|
5538
5538
|
--analyst-model=MODEL Model for the claude analyst (default: sonnet;
|
|
5539
5539
|
"default" = the claude CLI's own default;
|
|
5540
5540
|
env: MODA_HARNESS_ANALYST_MODEL)
|
|
5541
|
+
--assist=none Disable agent fallback for prompt discovery
|
|
5541
5542
|
--concern=topology|tools|prompts|evals
|
|
5542
5543
|
Harness analyze: restrict the pass to one
|
|
5543
5544
|
concern (whole repo, one report scope); an
|
|
@@ -5597,7 +5598,7 @@ Examples:
|
|
|
5597
5598
|
moda --agent doctor
|
|
5598
5599
|
moda agent context
|
|
5599
5600
|
moda agent next-action
|
|
5600
|
-
moda agent evidence doctor:
|
|
5601
|
+
moda agent evidence doctor:api_key_resolves
|
|
5601
5602
|
moda investigate
|
|
5602
5603
|
moda failures
|
|
5603
5604
|
moda ask "what should I fix first?"
|
|
@@ -6579,7 +6580,7 @@ var commandRegistry = createCommandRegistry([
|
|
|
6579
6580
|
resetApiRequestCountBeforeRun: true,
|
|
6580
6581
|
telemetry: "result",
|
|
6581
6582
|
handler: async (context) => {
|
|
6582
|
-
const { runInit } = await import("./index-
|
|
6583
|
+
const { runInit } = await import("./index-tbrrfhhf.js");
|
|
6583
6584
|
if (context.outputMode === "agent-stream") {
|
|
6584
6585
|
context.output.writeEvent({
|
|
6585
6586
|
event: "started",
|
|
@@ -6620,7 +6621,7 @@ var commandRegistry = createCommandRegistry([
|
|
|
6620
6621
|
resetApiRequestCountBeforeRun: true,
|
|
6621
6622
|
telemetry: "result-and-error",
|
|
6622
6623
|
handler: async (context) => {
|
|
6623
|
-
const { runProvision } = await import("./provision-
|
|
6624
|
+
const { runProvision } = await import("./provision-d242y9qd.js");
|
|
6624
6625
|
return runProvision(context, {
|
|
6625
6626
|
resumeCommand: buildResumeCommand("provision", context.rawFlags)
|
|
6626
6627
|
});
|
|
@@ -6822,7 +6823,7 @@ var commandRegistry = createCommandRegistry([
|
|
|
6822
6823
|
"moda agent context",
|
|
6823
6824
|
"moda agent investigate",
|
|
6824
6825
|
"moda agent next-action",
|
|
6825
|
-
"moda agent evidence doctor:
|
|
6826
|
+
"moda agent evidence doctor:api_key_resolves"
|
|
6826
6827
|
],
|
|
6827
6828
|
auth: "none",
|
|
6828
6829
|
outputModes: ["agent", "agent-stream", "json"],
|
|
@@ -7054,8 +7055,8 @@ var commandRegistry = createCommandRegistry([
|
|
|
7054
7055
|
{
|
|
7055
7056
|
name: "init",
|
|
7056
7057
|
description: "Create .moda/prompts.yml in the current directory (never overwrites)",
|
|
7057
|
-
usage: "moda prompts init",
|
|
7058
|
-
flags: [],
|
|
7058
|
+
usage: "moda prompts init [--from-harness=<report>]",
|
|
7059
|
+
flags: [{ name: "--from-harness=<report>", description: "Register verified source mappings from a harness report; source files stay in place." }],
|
|
7059
7060
|
examples: ["moda prompts init", "cd /path/to/project && moda prompts init"]
|
|
7060
7061
|
},
|
|
7061
7062
|
{
|
|
@@ -7072,10 +7073,15 @@ var commandRegistry = createCommandRegistry([
|
|
|
7072
7073
|
},
|
|
7073
7074
|
{
|
|
7074
7075
|
name: "sync",
|
|
7075
|
-
description: "
|
|
7076
|
-
usage: "moda prompts sync [--watch] [--dry-run]",
|
|
7076
|
+
description: "Analyze prompt sources and upload verified versions to Moda Cloud",
|
|
7077
|
+
usage: "moda prompts sync [--analyst=local-scan|claude|codex|cursor|auto] [--no-analyze] [--from-harness=<report>] [--watch] [--dry-run]",
|
|
7077
7078
|
flags: [
|
|
7078
|
-
{ name: "--
|
|
7079
|
+
{ name: "--analyst=local-scan|claude|codex|cursor|auto", description: "Prompt discovery analyst; defaults to deterministic local-scan. Other values enable bounded agent fallback." },
|
|
7080
|
+
{ name: "--assist=none", description: "Disable agent fallback, including with an explicit analyst." },
|
|
7081
|
+
{ name: "--no-analyze", description: "Skip discovery and sync only configured sources." },
|
|
7082
|
+
{ name: "--from-harness=<report>", description: "Read and register harness prompt source mappings before sync." },
|
|
7083
|
+
{ name: "--allow-untrack", description: "Explicitly remove missing keys from local tracking; registry history remains." },
|
|
7084
|
+
{ name: "--watch", description: "Analyze before syncing; re-upload when mapped prompt files change." },
|
|
7079
7085
|
{ name: "--dry-run", description: "Show what would be uploaded without writing." }
|
|
7080
7086
|
],
|
|
7081
7087
|
examples: ["moda prompts sync", "moda prompts sync --dry-run"]
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CONCERN_CANDIDATE_KINDS,
|
|
3
|
+
HARNESS_ANALYZE_CONCERNS,
|
|
4
|
+
SEED_CANDIDATE_KIND_LABELS,
|
|
5
|
+
analystEventProgress,
|
|
6
|
+
analyzeHarnessPrompts,
|
|
7
|
+
assertHarnessGraphSyncQuality,
|
|
8
|
+
buildSourceSnapshot,
|
|
9
|
+
codingAgentDisplayName,
|
|
10
|
+
computeDeterministicFloor,
|
|
11
|
+
deriveRelationshipsFromGraph,
|
|
12
|
+
describeCodingAgentEvent,
|
|
13
|
+
describeSyncIdentity,
|
|
14
|
+
describeSyncTenantLabel,
|
|
15
|
+
detectAvailableCodingAgents,
|
|
16
|
+
emitWrittenArtifacts,
|
|
17
|
+
findFresherHarnessReports,
|
|
18
|
+
graphForSync,
|
|
19
|
+
inventoryFiles,
|
|
20
|
+
isDeterministicLocalAnalyst,
|
|
21
|
+
isRetryableExternalAnalystFailure,
|
|
22
|
+
mergeDeterministicArtifacts,
|
|
23
|
+
numericEnv,
|
|
24
|
+
numericEnvAllowZero,
|
|
25
|
+
promptNameFromPath,
|
|
26
|
+
readHarnessSyncState,
|
|
27
|
+
renderAnalystCandidateLines,
|
|
28
|
+
renderAnalystSeedLines,
|
|
29
|
+
renderExternalHarnessAnalystPrompt,
|
|
30
|
+
repairExternalAnalystReport,
|
|
31
|
+
resolveAnalystModel,
|
|
32
|
+
resolveHarnessAnalyzeConcern,
|
|
33
|
+
runCodingAgent,
|
|
34
|
+
runHarnessCommand,
|
|
35
|
+
scanHarness,
|
|
36
|
+
sleep,
|
|
37
|
+
stableId,
|
|
38
|
+
summarizeHarness,
|
|
39
|
+
summarizeInvalidAnalystReport,
|
|
40
|
+
titleFromId,
|
|
41
|
+
truncateText,
|
|
42
|
+
writeHarnessAnalyzeResult,
|
|
43
|
+
writeHarnessArtifacts,
|
|
44
|
+
writeHumanProgress
|
|
45
|
+
} from "./cli-bh8gxmm8.js";
|
|
46
|
+
import"./cli-drabjmaj.js";
|
|
47
|
+
export {
|
|
48
|
+
writeHumanProgress,
|
|
49
|
+
writeHarnessArtifacts,
|
|
50
|
+
writeHarnessAnalyzeResult,
|
|
51
|
+
truncateText,
|
|
52
|
+
titleFromId,
|
|
53
|
+
summarizeInvalidAnalystReport,
|
|
54
|
+
summarizeHarness,
|
|
55
|
+
stableId,
|
|
56
|
+
sleep,
|
|
57
|
+
scanHarness,
|
|
58
|
+
runHarnessCommand,
|
|
59
|
+
runCodingAgent,
|
|
60
|
+
resolveHarnessAnalyzeConcern,
|
|
61
|
+
resolveAnalystModel,
|
|
62
|
+
repairExternalAnalystReport,
|
|
63
|
+
renderExternalHarnessAnalystPrompt,
|
|
64
|
+
renderAnalystSeedLines,
|
|
65
|
+
renderAnalystCandidateLines,
|
|
66
|
+
readHarnessSyncState,
|
|
67
|
+
promptNameFromPath,
|
|
68
|
+
numericEnvAllowZero,
|
|
69
|
+
numericEnv,
|
|
70
|
+
mergeDeterministicArtifacts,
|
|
71
|
+
isRetryableExternalAnalystFailure,
|
|
72
|
+
isDeterministicLocalAnalyst,
|
|
73
|
+
inventoryFiles,
|
|
74
|
+
graphForSync,
|
|
75
|
+
findFresherHarnessReports,
|
|
76
|
+
emitWrittenArtifacts,
|
|
77
|
+
detectAvailableCodingAgents,
|
|
78
|
+
describeSyncTenantLabel,
|
|
79
|
+
describeSyncIdentity,
|
|
80
|
+
describeCodingAgentEvent,
|
|
81
|
+
deriveRelationshipsFromGraph,
|
|
82
|
+
computeDeterministicFloor,
|
|
83
|
+
codingAgentDisplayName,
|
|
84
|
+
buildSourceSnapshot,
|
|
85
|
+
assertHarnessGraphSyncQuality,
|
|
86
|
+
analyzeHarnessPrompts,
|
|
87
|
+
analystEventProgress,
|
|
88
|
+
SEED_CANDIDATE_KIND_LABELS,
|
|
89
|
+
HARNESS_ANALYZE_CONCERNS,
|
|
90
|
+
CONCERN_CANDIDATE_KINDS
|
|
91
|
+
};
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
runPromptSync,
|
|
11
11
|
runSkillSync,
|
|
12
12
|
upsertSkillManifestRecord
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-w22qhyk4.js";
|
|
14
14
|
import {
|
|
15
15
|
codingAgentDisplayName,
|
|
16
16
|
describeCodingAgentEvent,
|
|
@@ -28,14 +28,14 @@ import {
|
|
|
28
28
|
runHarnessCommand,
|
|
29
29
|
startRemoteAnalyze,
|
|
30
30
|
stripAnsi
|
|
31
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-bh8gxmm8.js";
|
|
32
32
|
import {
|
|
33
33
|
selectTenantAndCreateKey
|
|
34
|
-
} from "./cli-
|
|
34
|
+
} from "./cli-scjxgaba.js";
|
|
35
35
|
import {
|
|
36
36
|
loadToken,
|
|
37
37
|
login
|
|
38
|
-
} from "./cli-
|
|
38
|
+
} from "./cli-yz99t7n8.js";
|
|
39
39
|
import {
|
|
40
40
|
CliAuthError,
|
|
41
41
|
CliInputError,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
createCommandContext,
|
|
44
44
|
resolveIngestUrl,
|
|
45
45
|
resolveModaBaseUrl
|
|
46
|
-
} from "./cli-
|
|
46
|
+
} from "./cli-drabjmaj.js";
|
|
47
47
|
|
|
48
48
|
// src/init/index.ts
|
|
49
49
|
import { existsSync as existsSync6, mkdirSync as mkdirSync5, readdirSync as readdirSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "node:fs";
|
|
@@ -2025,7 +2025,15 @@ Harness analysis keeps running on Moda. Resume anytime with \`${HARNESS_PULL_REC
|
|
|
2025
2025
|
await initPrompts({ silent: true });
|
|
2026
2026
|
laneBoard?.startLane("prompts", "Prompts", { detail: "Created or verified .moda/prompts.yml" });
|
|
2027
2027
|
try {
|
|
2028
|
-
const
|
|
2028
|
+
const reportPath = join6(process.cwd(), ".moda/harness-report.json");
|
|
2029
|
+
let sourceReport;
|
|
2030
|
+
if (existsSync6(reportPath)) {
|
|
2031
|
+
const report = JSON.parse(readFileSync5(reportPath, "utf8"));
|
|
2032
|
+
const prompts = report?.graph?.artifacts?.filter((item) => item.type === "prompt") ?? [];
|
|
2033
|
+
if (prompts.length)
|
|
2034
|
+
sourceReport = reportPath;
|
|
2035
|
+
}
|
|
2036
|
+
const promptSync = await runPromptSync(sourceReport ? { "from-harness": sourceReport } : {}, { profile });
|
|
2029
2037
|
laneBoard?.complete("prompts", promptSync.synced.length > 0 ? `${promptSync.synced.length} prompt(s) synced` : "manifest ready (no prompt files to sync yet)");
|
|
2030
2038
|
} catch (err) {
|
|
2031
2039
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
selectTenantAndCreateKey
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-scjxgaba.js";
|
|
4
4
|
import {
|
|
5
5
|
loadAuthSession
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-yz99t7n8.js";
|
|
7
7
|
import {
|
|
8
8
|
CliAuthError,
|
|
9
9
|
resolveIngestUrl,
|
|
10
10
|
resolveModaBaseUrl,
|
|
11
11
|
stringOption
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-drabjmaj.js";
|
|
13
13
|
|
|
14
14
|
// src/provision.ts
|
|
15
15
|
async function runProvision(context, options = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moda-ai/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0",
|
|
4
4
|
"description": "CLI for Moda - AI agent analytics and observability",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -48,7 +48,9 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@inquirer/prompts": "^8.4.1",
|
|
51
|
+
"fast-glob": "^3.3.3",
|
|
51
52
|
"open": "^11.0.0",
|
|
53
|
+
"yaml": "^2.9.1",
|
|
52
54
|
"zod": "^3.24.1"
|
|
53
55
|
},
|
|
54
56
|
"devDependencies": {
|
|
@@ -63,30 +63,33 @@ runtime termination does not have durable archival guarantees.
|
|
|
63
63
|
|
|
64
64
|
## 4. Ingest reusable prompts when requested
|
|
65
65
|
|
|
66
|
-
Find the source prompt (`getSystemPrompt` or context configuration)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
Use the CLI's actual JSON fields, for example:
|
|
75
|
-
|
|
76
|
-
```json
|
|
77
|
-
{
|
|
78
|
-
"key": "task-agent.system",
|
|
79
|
-
"name": "Task agent system prompt",
|
|
80
|
-
"systemPrompt": "The exact existing getSystemPrompt text goes here."
|
|
81
|
-
}
|
|
66
|
+
Find the source prompt (`getSystemPrompt` or context configuration), preserving
|
|
67
|
+
its current location and assembly logic. With a CLI supporting source selectors:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
moda harness analyze --experimental --concern=prompts --analyst=local-scan
|
|
71
|
+
moda prompts init --from-harness=.moda/harness-report.json
|
|
72
|
+
moda prompts sync --dry-run
|
|
82
73
|
```
|
|
83
74
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
75
|
+
Inspect each mapping and dry-run definition. Resolve missing sources with explicit
|
|
76
|
+
`.moda/prompts.yml` `sources` entries (stable `key`, repository-relative `path`,
|
|
77
|
+
`selector.symbol` or JSON/YAML `selector.pointer`). For unresolved code, an
|
|
78
|
+
installed coding agent can investigate via `--analyst=claude|codex|cursor`;
|
|
79
|
+
source resolution must still verify its mappings. Never substitute agent-written
|
|
80
|
+
prompt text or relocate inline code merely to satisfy discovery.
|
|
81
|
+
|
|
82
|
+
Static definitions can register as text/messages; runtime joins, conditions, and
|
|
83
|
+
functions register as builders with source/dependency fingerprints. Preserve
|
|
84
|
+
incomplete dependency coverage in the result. Do not replay builder source as
|
|
85
|
+
instructions. If the installed CLI lacks source selectors, report the release
|
|
86
|
+
prerequisite instead of rewriting the application's prompt construction.
|
|
87
|
+
|
|
88
|
+
Run `moda prompts sync` only after the expected definitions are present. Import
|
|
89
|
+
`.moda/prompts.lock.json` at build time and pass the matching
|
|
90
|
+
`{ key, promptId, versionId }` entry as `prompt`. Re-sync changed definitions before
|
|
91
|
+
building. Verify registered content/kind; a version ID alone does not prove that
|
|
92
|
+
the correct definition was registered.
|
|
90
93
|
|
|
91
94
|
Keep memory and variable substitutions separate from reusable template
|
|
92
95
|
versions. Think adds instructions/tools: verify actual system instructions
|