@moda-ai/cli 1.32.0 → 1.34.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 CHANGED
@@ -148,23 +148,52 @@ moda prompts sync --analyst=claude
148
148
  moda prompts sync --no-analyze
149
149
  ```
150
150
 
151
- Every sync reuses the prompt-specific harness analyzer. The default is a bounded,
152
- deterministic local scan with no agent calls. Successful sync saves newly verified
153
- mappings in `.moda/prompts.yml`; existing keys and legacy prompt-file metadata are
154
- preserved. Explicit negative `prompt_paths` patterns also exclude new discoveries.
155
- Analysis diagnostics and partial coverage are returned in the sync result. A dry
156
- run performs deterministic discovery without changing the manifest or lockfile.
157
- `--watch` starts with analysis and then watches mapped definitions; re-run sync to
158
- look for newly added sources that do not affect an existing mapping.
159
-
160
- For unresolved candidates, select `--analyst=claude`, `codex`, or `cursor` on sync.
161
- The CLI launches a bounded investigation through the installed coding-agent CLI.
162
- It accepts source selectors, then reads and validates the source itself; agent
163
- text never becomes registered prompt content. `--assist=none` disables assistance.
164
- You can still run `harness analyze --experimental --concern=prompts` separately
165
- and import its report with `prompts init --from-harness=<report>`.
166
- Discovery reports partial coverage explicitly; finding some prompts does not
167
- prove that every model call is covered.
151
+ Every sync reuses the prompt-specific harness analyzer. It discovers candidates
152
+ locally, then uses an installed Claude Code, Codex, or Cursor CLI to follow
153
+ unresolved relationships and repair mappings. A separate agent session reviews
154
+ new candidates. Source resolution reads the actual files; agent-written prompt
155
+ text never becomes registry content. Uncertain candidates remain pending and
156
+ are reported separately from sources eligible for sync.
157
+
158
+ Use `--analyst=local-scan` or `--assist=none` to disable agent calls, or
159
+ `--no-analyze` to sync only configured sources. Existing mappings remain
160
+ authoritative. Successful sync saves new accepted mappings in
161
+ `.moda/prompts.yml`, preserving existing keys, legacy metadata, and negative
162
+ `prompt_paths` patterns. Builders are stored as source definitions, not as
163
+ claims about their rendered runtime text.
164
+
165
+ A plain `--dry-run` uses deterministic discovery. Add `--analyst=claude`,
166
+ `--analyst=codex`, `--analyst=cursor`, or `--analyst=auto` to preview agent-assisted
167
+ discovery without saving the manifest, lockfile, or registry versions. Agent
168
+ investigations have no fixed wall-clock timeout and consume the installed
169
+ agent's usage; interrupt the command to cancel. Sync prints scan and verification
170
+ progress to stderr, including periodic analyst heartbeats while waiting. JSON
171
+ results on stdout remain unchanged; `--quiet` suppresses progress and
172
+ `--agent --stream` delivers progress as structured events.
173
+
174
+ `--watch` starts with analysis and then watches mapped definitions; re-run sync
175
+ to discover new sources that do not affect an existing mapping. You can also
176
+ run `harness analyze --experimental --concern=prompts` and import its report
177
+ with `prompts init --from-harness=<report>`. Discovery reports partial coverage:
178
+ finding a prompt fragment does not prove that every composition or model call
179
+ has been covered.
180
+
181
+ Prompt discovery keeps semantic role separate from mechanical extraction kind.
182
+ Independent review can classify a source as an authored definition, builder,
183
+ prompt transport, runtime context, non-prompt, or uncertain even when the
184
+ resolver stored it as text, messages, template, or builder. Usage is tracked
185
+ separately as active, conditional, display-only, or unknown, with an endpoint
186
+ verification flag; unknown usage does not reject an otherwise verified authored
187
+ definition or builder. Helpers that forward prompt configuration or carry
188
+ runtime context are retained as related discovery candidates and diagnostics,
189
+ but are not synced as prompt sources. Builder provenance remains the source
190
+ mapping and dependency evidence, so discovery does not claim complete
191
+ whole-codebase classification.
192
+
193
+ The reviewer receives the complete parser-selected definition and can inspect
194
+ surrounding relationships. Its definition citations, source hash, and source
195
+ stability are checked locally. Malformed review JSON gets one format-only repair
196
+ attempt; a repair that changes an already stated role or decision stays pending.
168
197
 
169
198
  You can also configure `.moda/prompts.yml` directly:
170
199
 
@@ -648,7 +648,7 @@ function validateConfig() {
648
648
  }
649
649
  }
650
650
 
651
- // ../../packages/harness-snapshot/src/policy.ts
651
+ // ../../../ModaObservability-prompt-sync/packages/harness-snapshot/src/policy.ts
652
652
  var MAX_SCANNED_FILE_BYTES = 512 * 1024;
653
653
  var DEFAULT_MAX_INVENTORY_FILES = 12000;
654
654
  var DEFAULT_MAX_INVENTORY_TEXT_BYTES = 48 * 1024 * 1024;
@@ -790,7 +790,7 @@ function isSecretishPath(path) {
790
790
  return name === ".env" || name.startsWith(".env.") || name.includes("secret") || name.includes("private-key") || name.endsWith(".pem");
791
791
  }
792
792
 
793
- // ../../packages/harness-snapshot/src/redact.ts
793
+ // ../../../ModaObservability-prompt-sync/packages/harness-snapshot/src/redact.ts
794
794
  var REDACTED = "[REDACTED]";
795
795
  var MAX_DEPTH = 256;
796
796
  var SECRET_KEYS = new Set([
@@ -887,7 +887,7 @@ function redactSnapshotText(text) {
887
887
  return { text: parts.join(""), redactionCount };
888
888
  }
889
889
 
890
- // ../../packages/harness-snapshot/src/pack.ts
890
+ // ../../../ModaObservability-prompt-sync/packages/harness-snapshot/src/pack.ts
891
891
  function utf8ByteLength(value) {
892
892
  let bytes = 0;
893
893
  for (let index = 0;index < value.length; index += 1) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  authFetch,
3
3
  getCachedLoginContext
4
- } from "./cli-yz99t7n8.js";
4
+ } from "./cli-eggpzt87.js";
5
5
  import {
6
6
  CliAccessError,
7
7
  CliInputError,
@@ -15,7 +15,7 @@ import {
15
15
  resolveTenantIdFromActiveProfile,
16
16
  saveCliConfig,
17
17
  writeSecretJsonFile
18
- } from "./cli-drabjmaj.js";
18
+ } from "./cli-0h32yvwq.js";
19
19
 
20
20
  // src/init/tenant.ts
21
21
  import { randomUUID } from "node:crypto";
@@ -8,7 +8,7 @@ import {
8
8
  saveProfileConfig,
9
9
  secretFilePathFromRef,
10
10
  writeSecretJsonFile
11
- } from "./cli-drabjmaj.js";
11
+ } from "./cli-0h32yvwq.js";
12
12
 
13
13
  // src/auth-storage.ts
14
14
  import { existsSync, readFileSync, rmSync } from "node:fs";