@aiwg/cli 2026.10.1 → 2026.10.4
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 +2 -2
- package/agentic/code/providers/capability-matrix.yaml +270 -0
- package/agentic/code/providers/model-capabilities.v1.json +3183 -24
- package/bin/aiwg.mjs +135 -47
- package/dist/src/a2a/codecs.js +9 -0
- package/dist/src/agents/grounding/knowledge-base.js +54 -6
- package/dist/src/artifacts/browser-export.js +6 -0
- package/dist/src/artifacts/checksum-manifest.js +1 -0
- package/dist/src/artifacts/citation-parser.js +173 -92
- package/dist/src/artifacts/citation-table-schema.js +59 -0
- package/dist/src/artifacts/cli.js +57 -18
- package/dist/src/artifacts/corpus-tools/snapshot.js +1 -1
- package/dist/src/artifacts/corpus-tools/vision-extract.js +107 -15
- package/dist/src/artifacts/corpus-views/ref-parser.js +3 -1
- package/dist/src/artifacts/corpus-views/renderers.js +3 -3
- package/dist/src/artifacts/discovery-eval.js +6 -4
- package/dist/src/artifacts/fortemi-core-query-adapter.js +36 -3
- package/dist/src/artifacts/fortemi-core-sync.js +166 -40
- package/dist/src/artifacts/framework-capabilities.js +171 -0
- package/dist/src/artifacts/framework-index-paths.js +73 -0
- package/dist/src/artifacts/framework-source-digest.js +75 -0
- package/dist/src/artifacts/index-builder.js +285 -131
- package/dist/src/artifacts/index-files.js +132 -18
- package/dist/src/artifacts/index-preparation.js +65 -0
- package/dist/src/artifacts/index-refresh.js +576 -0
- package/dist/src/artifacts/index-worker.mjs +9 -0
- package/dist/src/artifacts/prebuilt-build-lock.js +47 -4
- package/dist/src/artifacts/prebuilt-deployment.js +46 -0
- package/dist/src/artifacts/prebuilt-relations.js +80 -0
- package/dist/src/artifacts/query-engine.js +410 -88
- package/dist/src/artifacts/relations-builder.js +168 -0
- package/dist/src/artifacts/relations.js +148 -0
- package/dist/src/artifacts/repair.js +9 -4
- package/dist/src/artifacts/stats.js +5 -2
- package/dist/src/artifacts/types.js +30 -10
- package/dist/src/artifacts/watcher.js +1 -1
- package/dist/src/auth/credential-store.js +2 -1
- package/dist/src/catalog/cli.d.mts +5 -0
- package/dist/src/channel/manager.d.mts +20 -0
- package/dist/src/channel/manager.mjs +78 -12
- package/dist/src/cli/child-process-result.js +40 -0
- package/dist/src/cli/command-log.js +2 -3
- package/dist/src/cli/env.js +38 -16
- package/dist/src/cli/flag-parsing.js +236 -0
- package/dist/src/cli/handlers/artifacts.js +3 -0
- package/dist/src/cli/handlers/auth.js +3 -0
- package/dist/src/cli/handlers/decision.js +218 -5
- package/dist/src/cli/handlers/diagnose.js +13 -5
- package/dist/src/cli/handlers/effect.js +4 -2
- package/dist/src/cli/handlers/evidence.js +3 -0
- package/dist/src/cli/handlers/feedback.js +14 -5
- package/dist/src/cli/handlers/help.js +1 -0
- package/dist/src/cli/handlers/index.js +3 -1
- package/dist/src/cli/handlers/init.js +248 -30
- package/dist/src/cli/handlers/lint.js +5 -0
- package/dist/src/cli/handlers/mc.js +23 -0
- package/dist/src/cli/handlers/models.js +169 -10
- package/dist/src/cli/handlers/ralph-launcher.js +2 -0
- package/dist/src/cli/handlers/ralph.js +3 -0
- package/dist/src/cli/handlers/refresh.js +28 -0
- package/dist/src/cli/handlers/regenerate.js +14 -0
- package/dist/src/cli/handlers/resource-versions.js +3 -0
- package/dist/src/cli/handlers/rules.js +195 -0
- package/dist/src/cli/handlers/run.js +4 -0
- package/dist/src/cli/handlers/runtime-info.js +25 -11
- package/dist/src/cli/handlers/script-runner.js +19 -8
- package/dist/src/cli/handlers/session.js +406 -62
- package/dist/src/cli/handlers/sessions.js +243 -76
- package/dist/src/cli/handlers/setup-manifest.js +474 -79
- package/dist/src/cli/handlers/setup.js +180 -39
- package/dist/src/cli/handlers/steward.js +11 -0
- package/dist/src/cli/handlers/subcommands.js +60 -3
- package/dist/src/cli/handlers/team.js +18 -8
- package/dist/src/cli/handlers/uhp.js +3 -0
- package/dist/src/cli/handlers/use.js +307 -55
- package/dist/src/cli/handlers/utilities.js +125 -26
- package/dist/src/cli/handlers/version.js +8 -0
- package/dist/src/cli/prompt-utils.js +72 -0
- package/dist/src/cli/provider-resolution.js +11 -0
- package/dist/src/cli/router.js +15 -1
- package/dist/src/cli/services/deployment-verification.js +19 -9
- package/dist/src/cli/services/provider-prepare-coordinator.js +24 -0
- package/dist/src/cli/skill-usage.js +2 -3
- package/dist/src/config/aiwg-config.js +349 -35
- package/dist/src/config/cli.js +256 -23
- package/dist/src/config/decision-config.js +106 -0
- package/dist/src/config/dispatch-thresholds-runtime.d.mts +8 -0
- package/dist/src/config/dispatch-thresholds-runtime.mjs +38 -0
- package/dist/src/config/gitignore.js +50 -0
- package/dist/src/config/index-graph-overrides.js +36 -0
- package/dist/src/config/project-artifacts-health.d.mts +37 -0
- package/dist/src/config/project-artifacts-health.mjs +14 -3
- package/dist/src/config/project-artifacts-runtime.d.mts +16 -0
- package/dist/src/config/user-config-dir.d.mts +9 -0
- package/dist/src/config/user-config.js +38 -11
- package/dist/src/config/user-registry.js +23 -15
- package/dist/src/config/user-state.js +7 -0
- package/dist/src/decision/adapters/jev.js +75 -27
- package/dist/src/decision/ask.js +203 -43
- package/dist/src/decision/context-live-qualification.js +2 -2
- package/dist/src/decision/driver.js +14 -7
- package/dist/src/decision/ensemble/aggregate.js +23 -10
- package/dist/src/decision/ensemble-study/multifact-study.js +6 -2
- package/dist/src/decision/entry.js +25 -6
- package/dist/src/decision/graph-live-qualification.js +1 -1
- package/dist/src/decision/graph-run.js +9 -0
- package/dist/src/decision/heldout/collector.js +15 -14
- package/dist/src/decision/heldout/contract.js +30 -7
- package/dist/src/decision/index.js +1 -0
- package/dist/src/decision/interop.js +60 -8
- package/dist/src/decision/jev-credentials.js +15 -1
- package/dist/src/decision/ledger.js +942 -0
- package/dist/src/decision/offload-activation.js +137 -0
- package/dist/src/decision/offload.js +550 -0
- package/dist/src/decision/qualification/load.js +4 -6
- package/dist/src/decision/savings.js +28 -0
- package/dist/src/decision/validate.js +6 -3
- package/dist/src/effects/dispatch-verifier.js +252 -0
- package/dist/src/effects/index.js +1 -0
- package/dist/src/effects/types.js +5 -1
- package/dist/src/effects/verifiers/git.js +2 -1
- package/dist/src/effects/verifiers/tracker.js +26 -14
- package/dist/src/extensions/commands/definitions.js +19 -0
- package/dist/src/extensions/project-local-remove.js +36 -1
- package/dist/src/features/installer.js +2 -2
- package/dist/src/flow/graph-metadata.js +5 -0
- package/dist/src/gates/providers/loader.js +64 -18
- package/dist/src/installation/manager-command.d.mts +18 -0
- package/dist/src/installation/manager-command.mjs +15 -3
- package/dist/src/installation/manager.d.mts +49 -0
- package/dist/src/installation/manager.mjs +95 -5
- package/dist/src/issues/cli.js +4 -4
- package/dist/src/issues/local.js +24 -5
- package/dist/src/jobs/runner.js +1 -1
- package/dist/src/lint/cli.js +27 -1
- package/dist/src/lint/loader.js +2 -1
- package/dist/src/lint/reporters.js +25 -1
- package/dist/src/lint/rule-activation.js +43 -0
- package/dist/src/lint/runner.js +137 -62
- package/dist/src/mcp/adapters/codex-runtime.js +366 -56
- package/dist/src/mcp/claude-install.d.mts +4 -0
- package/dist/src/mcp/claude-install.mjs +41 -0
- package/dist/src/mcp/cli.d.mts +1 -0
- package/dist/src/mcp/cli.mjs +620 -85
- package/dist/src/mcp/config-file.d.mts +28 -0
- package/dist/src/mcp/config-file.mjs +279 -0
- package/dist/src/mcp/config-layers.d.mts +36 -0
- package/dist/src/mcp/config-layers.mjs +348 -0
- package/dist/src/mcp/credentials.d.mts +51 -0
- package/dist/src/mcp/credentials.mjs +484 -0
- package/dist/src/mcp/grok-build-config.d.mts +6 -0
- package/dist/src/mcp/grok-build-config.mjs +17 -27
- package/dist/src/mcp/helpers.mjs +109 -4
- package/dist/src/mcp/muse-native-config.d.mts +13 -0
- package/dist/src/mcp/muse-native-config.mjs +1 -0
- package/dist/src/mcp/omp-config.d.mts +4 -0
- package/dist/src/mcp/omp-config.mjs +50 -29
- package/dist/src/mcp/profiles.js +97 -23
- package/dist/src/mcp/profiles.mjs +99 -27
- package/dist/src/mcp/registry.js +248 -131
- package/dist/src/mcp/registry.mjs +169 -100
- package/dist/src/mcp/server-config.d.mts +3 -0
- package/dist/src/mcp/server-config.mjs +89 -0
- package/dist/src/mcp/server.mjs +127 -82
- package/dist/src/mcp/test-simple.mjs +2 -1
- package/dist/src/mcp/toml-editor.d.mts +4 -0
- package/dist/src/mcp/toml-string.d.mts +1 -0
- package/dist/src/mcp/toml-string.mjs +9 -0
- package/dist/src/mcp/toml-strip-mcp.d.mts +1 -0
- package/dist/src/mcp/toml-strip-mcp.mjs +135 -0
- package/dist/src/mcp/tool-filters.d.mts +46 -0
- package/dist/src/mcp/tool-filters.mjs +357 -0
- package/dist/src/mcp/tools/agentic-sandbox.mjs +3 -1
- package/dist/src/mcp/tools/decision.mjs +22 -3
- package/dist/src/mcp/tools/discovery.mjs +62 -55
- package/dist/src/mcp/tools/orchestration.mjs +50 -2
- package/dist/src/mcp/tools/subsystems.mjs +39 -8
- package/dist/src/mcp/tools/worker-invoke.mjs +2856 -0
- package/dist/src/mcp/tools/worker-shell-control.mjs +289 -0
- package/dist/src/mcp/tools/worker-stdin-runtime.mjs +79 -0
- package/dist/src/memory/project-registry.js +2 -2
- package/dist/src/mission-protocol/codecs.js +647 -1
- package/dist/src/mission-protocol/types.js +110 -0
- package/dist/src/mission-protocol/worker-status.js +2 -0
- package/dist/src/models/config-loader.js +76 -14
- package/dist/src/models/grok-build-models.js +93 -41
- package/dist/src/models/model-capabilities.v1.json +3183 -24
- package/dist/src/models/model-discovery.js +931 -67
- package/dist/src/models/provider-policy.js +719 -11
- package/dist/src/models/qualification-digest.d.mts +2 -0
- package/dist/src/models/qualification-digest.mjs +17 -0
- package/dist/src/models/resolver.js +261 -0
- package/dist/src/models/worker-direct-readiness.js +550 -0
- package/dist/src/models/worker-dispatch-offer.js +169 -0
- package/dist/src/models/worker-health-readiness.js +144 -0
- package/dist/src/models/worker-installation.d.mts +39 -0
- package/dist/src/models/worker-installation.mjs +986 -0
- package/dist/src/models/wrapper-route.js +18 -0
- package/dist/src/ops/registry.js +9 -14
- package/dist/src/plugins/standalone-packager.js +4 -3
- package/dist/src/process/bounded-child-process.d.mts +84 -0
- package/dist/src/process/bounded-child-process.mjs +430 -0
- package/dist/src/process/cli-command.d.mts +16 -0
- package/dist/src/process/cli-command.mjs +75 -0
- package/dist/src/process/signal-child.d.mts +6 -0
- package/dist/src/process/signal-child.mjs +7 -0
- package/dist/src/providers/capability-matrix.js +8 -0
- package/dist/src/providers/capability-matrix.yaml +270 -0
- package/dist/src/providers/deployed-skill-roots.js +20 -0
- package/dist/src/providers/grok-build-acp.js +3 -2
- package/dist/src/providers/grok-build-headless.js +53 -23
- package/dist/src/providers/grok-build-inspect.js +1 -0
- package/dist/src/providers/omp-agent.d.mts +8 -0
- package/dist/src/providers/omp-diagnostics.d.mts +1 -0
- package/dist/src/providers/omp-paths.d.mts +13 -0
- package/dist/src/providers/provider-definitions.js +9 -1
- package/dist/src/providers/provider-definitions.mjs +9 -2
- package/dist/src/providers/skill-ownership.d.mts +9 -0
- package/dist/src/providers/skill-ownership.mjs +88 -0
- package/dist/src/rules/activation.d.mts +21 -0
- package/dist/src/rules/activation.mjs +62 -0
- package/dist/src/rules/inline-budget.d.mts +26 -0
- package/dist/src/rules/inline-budget.mjs +66 -0
- package/dist/src/rules/inventory.js +129 -0
- package/dist/src/rules/pin-state.js +73 -0
- package/dist/src/rules/pins.d.mts +14 -0
- package/dist/src/rules/pins.mjs +112 -0
- package/dist/src/rules/rule-frontmatter.schema.json +197 -0
- package/dist/src/serve/executor-registry.js +16 -24
- package/dist/src/serve/fleet-mission-conductor.js +9 -0
- package/dist/src/serve/mission-conductor.js +47 -12
- package/dist/src/serve/shared-host-scheduler.js +2 -0
- package/dist/src/serve/worker-invocation.js +558 -0
- package/dist/src/serve/worker-stdin-frame.d.mts +10 -0
- package/dist/src/serve/worker-stdin-frame.mjs +107 -0
- package/dist/src/sessions/adapter-registry.js +49 -0
- package/dist/src/sessions/adapters/claude.js +39 -54
- package/dist/src/sessions/adapters/codex.js +82 -67
- package/dist/src/sessions/adapters/copilot.js +4 -4
- package/dist/src/sessions/adapters/cursor.js +40 -57
- package/dist/src/sessions/adapters/deepseek-harness.js +15 -12
- package/dist/src/sessions/adapters/factory.js +31 -27
- package/dist/src/sessions/adapters/generic.js +43 -9
- package/dist/src/sessions/adapters/grok-build.js +11 -11
- package/dist/src/sessions/adapters/grokbot-locator.js +111 -0
- package/dist/src/sessions/adapters/grokbot.js +434 -24
- package/dist/src/sessions/adapters/hermes.js +27 -29
- package/dist/src/sessions/adapters/muse-workspace-scan.js +128 -0
- package/dist/src/sessions/adapters/muse.js +200 -104
- package/dist/src/sessions/adapters/omp.js +28 -14
- package/dist/src/sessions/adapters/openclaw.js +89 -79
- package/dist/src/sessions/adapters/opencode.js +27 -24
- package/dist/src/sessions/adapters/openhuman.js +18 -60
- package/dist/src/sessions/adapters/pi.js +30 -14
- package/dist/src/sessions/adapters/warp.js +3 -3
- package/dist/src/sessions/adapters/windsurf.js +19 -48
- package/dist/src/sessions/batch-contracts.js +25 -5
- package/dist/src/sessions/batch-import.js +72 -51
- package/dist/src/sessions/candidates.js +47 -11
- package/dist/src/sessions/contracts.js +75 -2
- package/dist/src/sessions/coverage-preflight.js +134 -0
- package/dist/src/sessions/discovery.js +3 -0
- package/dist/src/sessions/export-plan.js +4 -3
- package/dist/src/sessions/grok-build-cli.js +67 -5
- package/dist/src/sessions/import-exclusions.js +72 -0
- package/dist/src/sessions/import-lease.js +34 -18
- package/dist/src/sessions/import-limits.js +37 -0
- package/dist/src/sessions/importer.js +84 -46
- package/dist/src/sessions/index.js +2 -0
- package/dist/src/sessions/lifecycle.js +45 -0
- package/dist/src/sessions/policy.js +133 -25
- package/dist/src/sessions/readers.js +106 -53
- package/dist/src/sessions/refresh.js +106 -0
- package/dist/src/sessions/repository.js +199 -63
- package/dist/src/sessions/workspace-discovery.js +315 -88
- package/dist/src/sessions/workspace-matching.js +107 -0
- package/dist/src/skills/adapters/clawhub.js +10 -8
- package/dist/src/skills/adapters/openclaw.js +10 -7
- package/dist/src/skills/importer.js +1 -0
- package/dist/src/smiths/context-pipeline/aiwg-md.js +11 -0
- package/dist/src/smiths/context-pipeline/claude-hook.js +3 -26
- package/dist/src/smiths/context-pipeline/finalization.js +6 -5
- package/dist/src/smiths/context-pipeline/generator.js +21 -4
- package/dist/src/smiths/context-pipeline/parallelism-section.js +195 -14
- package/dist/src/smiths/context-pipeline/workspace-context.js +116 -9
- package/dist/src/smiths/hook-bridge/codex-translator.js +6 -5
- package/dist/src/smiths/mcpsmith/example.js +1 -1
- package/dist/src/smiths/mcpsmith/generator.js +1 -1
- package/dist/src/smiths/toolsmith/runtime-discovery.d.mts +10 -0
- package/dist/src/smiths/toolsmith/runtime-discovery.mjs +85 -31
- package/dist/src/storage/backends/fs.js +18 -76
- package/dist/src/storage/backends/logseq.js +68 -7
- package/dist/src/storage/backends/obsidian.js +1 -0
- package/dist/src/storage/fortemi-qualification-receipt.js +2 -2
- package/dist/src/testing/generators/test-code-generator.js +57 -30
- package/dist/src/tracker/forge-http.js +2 -1
- package/dist/src/uhp/client.js +11 -1
- package/dist/src/uhp/mission.js +5 -0
- package/dist/src/update/checker.d.mts +2 -0
- package/dist/src/update/checker.mjs +5 -5
- package/dist/src/update/notifier.mjs +54 -2
- package/dist/src/update/service.d.mts +22 -0
- package/dist/src/utils/contained-filesystem.d.mts +37 -0
- package/dist/src/utils/contained-filesystem.mjs +683 -0
- package/dist/src/utils/temporary-directory.js +36 -0
- package/dist/src/writing/example-generator.js +1 -1
- package/dist/src/writing/fidelity.js +18 -1
- package/package.json +32 -2
- package/schemas/mission-v1.schema.json +2429 -0
- package/schemas/models/model-catalog.v1.schema.json +301 -0
- package/schemas/models/model-config-compatibility.v1.schema.json +281 -0
- package/schemas/models/model-policy.v1.schema.json +14 -0
- package/schemas/models/provider-model-capabilities.v1.schema.json +1072 -0
- package/tools/_resolve-impl.mjs +39 -2
- package/tools/agents/deploy-agents.mjs +64 -23
- package/tools/agents/providers/base.mjs +153 -166
- package/tools/agents/providers/claude.mjs +8 -24
- package/tools/agents/providers/codex.mjs +18 -11
- package/tools/agents/providers/cursor.mjs +19 -18
- package/tools/agents/providers/grok-build.mjs +3 -1
- package/tools/agents/providers/grokbot.mjs +11 -12
- package/tools/agents/providers/hermes.mjs +62 -49
- package/tools/agents/providers/omp.mjs +5 -2
- package/tools/agents/providers/openclaw-translator.mjs +19 -5
- package/tools/agents/providers/openclaw.mjs +9 -4
- package/tools/agents/providers/pi.mjs +5 -0
- package/tools/agents/providers/provider-prepare-channel.mjs +5 -0
- package/tools/agents/providers/provider-prepare-coordinator.mjs +247 -0
- package/tools/agents/providers/provider-prepare-worker.mjs +84 -0
- package/tools/agents/providers/rule-delivery.mjs +1270 -0
- package/tools/agents/providers/warp.mjs +20 -26
- package/tools/cli/decision-offload-report.mjs +40 -0
- package/tools/cli/workspace-status.mjs +862 -0
- package/tools/plugin/package-plugins.mjs +186 -8
- package/tools/plugin/plugin-links.mjs +114 -0
- package/tools/providers/antigravity-transport.mjs +3 -1
- package/tools/providers/deepseek-harness-transport.mjs +360 -0
- package/tools/providers/omp-transport.mjs +194 -0
- package/tools/ralph-external/lib/claude-adapter.mjs +389 -0
- package/tools/ralph-external/lib/codex-adapter.mjs +432 -0
- package/tools/ralph-external/lib/consecutive-failure-circuit-breaker.mjs +1748 -0
- package/tools/ralph-external/lib/deepseek-harness-adapter.mjs +397 -0
- package/tools/ralph-external/lib/factory-adapter.mjs +503 -0
- package/tools/ralph-external/lib/launcher-recovery-evidence.mjs +55 -0
- package/tools/ralph-external/lib/muse-adapter.mjs +364 -0
- package/tools/ralph-external/lib/omp-adapter.mjs +315 -0
- package/tools/ralph-external/lib/opencode-adapter.mjs +575 -0
- package/tools/ralph-external/lib/openhuman-adapter.mjs +75 -0
- package/tools/ralph-external/lib/pi-adapter.mjs +329 -0
- package/tools/ralph-external/lib/provider-adapter.mjs +748 -0
- package/tools/ralph-external/lib/recovery-probe.mjs +72 -0
- package/tools/ralph-external/lib/session-environment.mjs +28 -0
- package/tools/ralph-external/lib/systemd-client.mjs +49 -0
- package/tools/ralph-external/lib/worker-health.mjs +439 -0
- package/tools/ralph-external/lib/worker-isolation.mjs +717 -0
- package/tools/ralph-external/lib/worker-overflow.mjs +50 -0
- package/tools/ralph-external/process-monitor.mjs +1017 -0
- package/tools/ralph-external/session-launcher.mjs +5057 -0
- package/tools/scripts/resource-preflight.mjs +541 -0
- package/tools/skills/deploy-skills-codex.mjs +2 -1
- package/vscode-extension/schemas/aiwg.config.v1.json +2916 -0
|
@@ -2,7 +2,11 @@ import { existsSync, linkSync, mkdirSync, readFileSync, realpathSync, renameSync
|
|
|
2
2
|
import { randomUUID } from 'node:crypto';
|
|
3
3
|
import { basename, dirname, isAbsolute, join, resolve, } from 'node:path';
|
|
4
4
|
import { pathToFileURL } from 'node:url';
|
|
5
|
-
import { CLAUDE_ADAPTER_VERSION, ClaudeSessionAdapter, CODEX_ADAPTER_VERSION, CodexSessionAdapter, COPILOT_ADAPTER_VERSION, CopilotSessionAdapter, CURSOR_ADAPTER_VERSION, CursorSessionAdapter, FACTORY_ADAPTER_VERSION, FactorySessionAdapter, HERMES_ADAPTER_VERSION, HermesSessionAdapter, OPENCODE_ADAPTER_VERSION, OpenCodeSessionAdapter, OPENCLAW_ADAPTER_VERSION, OpenClawSessionAdapter, OPENHUMAN_ADAPTER_VERSION, OpenHumanSessionAdapter, GROKBOT_ADAPTER_VERSION, GrokbotSessionAdapter, GROK_BUILD_ADAPTER_VERSION, GROK_BUILD_CLI_EXPORT_LOCATOR_CLASS, GrokBuildSessionAdapter, grokBuildList, grokBuildSearch, grokBuildExport, grokHeadlessSessionIdFromFile, MUSE_ADAPTER_VERSION, MuseSessionAdapter, PI_ADAPTER_VERSION, PiSessionAdapter, DEEPSEEK_HARNESS_ADAPTER_VERSION, DeepSeekHarnessSessionAdapter, OmpSessionAdapter, OMP_ADAPTER_VERSION, WARP_ADAPTER_VERSION, WarpSessionAdapter, DEVIN_DESKTOP_ADAPTER_VERSION, DevinDesktopSessionAdapter, CandidateExtractionService, GENERIC_ADAPTER_VERSION, GenericSessionInterchangeAdapter, IncrementalSessionImporter, ImportLeaseContentionError, FilesystemMemoryDestination, FilesystemPromotionDispositionCoordinator, MemoryPromotionGateway, SESSION_CONTRACT_VERSION,
|
|
5
|
+
import { CLAUDE_ADAPTER_VERSION, ClaudeSessionAdapter, CODEX_ADAPTER_VERSION, CodexSessionAdapter, COPILOT_ADAPTER_VERSION, CopilotSessionAdapter, CURSOR_ADAPTER_VERSION, CursorSessionAdapter, FACTORY_ADAPTER_VERSION, FactorySessionAdapter, HERMES_ADAPTER_VERSION, HermesSessionAdapter, OPENCODE_ADAPTER_VERSION, OpenCodeSessionAdapter, OPENCLAW_ADAPTER_VERSION, OpenClawSessionAdapter, OPENHUMAN_ADAPTER_VERSION, OpenHumanSessionAdapter, GROKBOT_ADAPTER_VERSION, GROKBOT_NATIVE_REPLICA_LOCATOR_CLASS, GrokbotSessionAdapter, GROK_BUILD_ADAPTER_VERSION, GROK_BUILD_CLI_EXPORT_LOCATOR_CLASS, GrokBuildSessionAdapter, grokBuildList, grokBuildSearch, grokBuildExport, grokHeadlessSessionIdFromFile, MUSE_ADAPTER_VERSION, MuseSessionAdapter, PI_ADAPTER_VERSION, PiSessionAdapter, DEEPSEEK_HARNESS_ADAPTER_VERSION, DeepSeekHarnessSessionAdapter, OmpSessionAdapter, OMP_ADAPTER_VERSION, WARP_ADAPTER_VERSION, WarpSessionAdapter, DEVIN_DESKTOP_ADAPTER_VERSION, DevinDesktopSessionAdapter, CandidateExtractionService, GENERIC_ADAPTER_VERSION, GenericSessionInterchangeAdapter, IncrementalSessionImporter, ImportLeaseContentionError, FilesystemMemoryDestination, FilesystemPromotionDispositionCoordinator, MemoryPromotionGateway, SESSION_CONTRACT_VERSION, SessionContractError, SessionRepository, SessionSourceSchema, StructuralCandidateExtractor, resolveMemoryConsumerManifest, assertSessionProviderId, acquireImportLease, defaultDiscoveryManifestPath, discoverWorkspaceHistories, createSessionAdapterRegistry, coveragePreflight, expectedSessionProviders, deriveSessionTimeline, importDiscoveryManifest, previewDiscoveryImport, publicDiscoveryManifest, readDiscoveryManifest, redactSourceLocator, sha256, parseTimelineGap, writeDiscoveryManifest, buildSessionExportPlan, reverifySessionExportPlan, buildSessionAiwgFortemiIndexExport, recoverAiwgFortemiIndexFromFullV1Shard, embedAttachmentsInFullV1Shard, recoverEmbeddedAttachments, SESSION_EXPORT_PLAN_SCHEMA_VERSION, } from '../../sessions/index.js';
|
|
6
|
+
import { resolveImportExclusions } from '../../sessions/import-exclusions.js';
|
|
7
|
+
import { resolveImportLimits } from '../../sessions/import-limits.js';
|
|
8
|
+
import { classifyGrokbotBlobName } from '../../sessions/adapters/grokbot-locator.js';
|
|
9
|
+
import { readAiwgConfig } from '../../config/aiwg-config.js';
|
|
6
10
|
const JSON_CONTRACT_VERSION = '1.0.0';
|
|
7
11
|
async function createLineMemoryPromotionDestination(projectRoot, manifestPath) {
|
|
8
12
|
const modulePath = resolve(dirname(manifestPath), 'commands', 'line-memory.mjs');
|
|
@@ -33,10 +37,10 @@ Commands:
|
|
|
33
37
|
grok-export <id> --workspace <path> --out <dir> Export one CLI transcript
|
|
34
38
|
grok-id <file> --format json|streaming-json Read a headless session ID
|
|
35
39
|
import <file> --source-id <id> Import a supported provider JSONL source
|
|
36
|
-
list [--limit N] [--cursor N]
|
|
37
|
-
timeline [--gap 30m]
|
|
38
|
-
show <session-id>
|
|
39
|
-
search <query> --workspace <id>
|
|
40
|
+
list [--workspace <path-or-id>] [--limit N] [--cursor N] List normalized sessions
|
|
41
|
+
timeline [--workspace <path-or-id>] [--gap 30m] Report chronological activity segments
|
|
42
|
+
show <session-id> [--workspace <path-or-id>] Show a session with events and tags
|
|
43
|
+
search <query> [--workspace <path-or-id>] Search authorized normalized content
|
|
40
44
|
extract [session-id] --workspace <id> Extract structural candidates
|
|
41
45
|
export plan --workspace <id> --out <file> <session-id...> Select sessions into a reviewable plan
|
|
42
46
|
export build --plan <file> --out <dir> Build a Fortemi Knowledge Shard from a plan
|
|
@@ -47,7 +51,7 @@ Commands:
|
|
|
47
51
|
promote <id> <version> Preview promotion; use --confirm to write
|
|
48
52
|
tag <session-id> <tag> Add a catalog tag
|
|
49
53
|
relocate <source-id> <file> Update AIWG source-location metadata
|
|
50
|
-
reindex
|
|
54
|
+
reindex --workspace <path-or-id> | --all-workspaces Rebuild catalog indexes
|
|
51
55
|
delete <session-id> Preview deletion; use --confirm to tombstone
|
|
52
56
|
restore <session-id> Restore a reversible catalog tombstone
|
|
53
57
|
purge <session-id> Preview terminal AIWG-copy purge
|
|
@@ -59,20 +63,34 @@ Commands:
|
|
|
59
63
|
Options:
|
|
60
64
|
--json Emit the versioned JSON contract
|
|
61
65
|
--dry-run Preview a mutation without changing state
|
|
62
|
-
--
|
|
66
|
+
--all-workspaces Reindex every workspace in the selected catalog (reindex only)
|
|
67
|
+
--db <path> Select a catalog; relative paths resolve from cwd
|
|
68
|
+
--workspace <path-or-id> Select the workspace within that catalog for reads
|
|
69
|
+
(default: current project, matching cwd, or sole catalog workspace)
|
|
70
|
+
Catalog defaults to <project-or-cwd>/.aiwg/sessions/catalog.sqlite
|
|
71
|
+
Imports for other workspaces stay in the selected catalog;
|
|
72
|
+
use --db to read that catalog from another directory
|
|
73
|
+
--expected-providers <ids> Comma-separated authorized scope, independent of runtime inventory
|
|
63
74
|
--manifest <path> Override the discovery manifest path
|
|
64
75
|
--provider-home <path> Override the provider home root (testing/portable homes)
|
|
65
|
-
--codex-root <path>
|
|
76
|
+
--codex-root <path> Authorize a shared Codex sessions/export root (repeatable)
|
|
66
77
|
--omp-root <path> Explicitly authorize an OMP profile sessions root
|
|
67
78
|
--muse-root <path> Explicitly authorize a Muse Code sessions root
|
|
68
79
|
--dsh-root <path> Explicitly authorize a DeepSeek Harness sessions root
|
|
80
|
+
--grokbot-root <path> Explicitly authorize a Grok Bot sand-client-persistence root
|
|
81
|
+
--grok-bin <path> Absolute Grok Build CLI path for grok-list/grok-search/grok-export
|
|
82
|
+
(default: grok on PATH, then $GROK_HOME/bin/grok)
|
|
69
83
|
--confirm, --yes Confirm a persistent discovered batch import
|
|
70
84
|
--lock-wait-ms <n> Maximum import-lease wait (default 5000)
|
|
85
|
+
--exclude <id-or-glob> Skip a session ID or absolute path glob (repeatable); adds to sessions.import.exclude and AIWG_SESSIONS_IMPORT_EXCLUDE
|
|
86
|
+
--max-record-bytes <n> Import record limit (default 67108864); overrides AIWG_SESSIONS_IMPORT_MAX_RECORD_BYTES and sessions.import.max_record_bytes
|
|
87
|
+
--max-source-bytes <n> Import source limit (default 1073741824, 1 GiB; 0 unlimited); overrides AIWG_SESSIONS_IMPORT_MAX_SOURCE_BYTES and sessions.import.max_source_bytes
|
|
88
|
+
Import limit precedence: CLI flag > env var > workspace config > default.
|
|
71
89
|
--inactivity-threshold <duration> Historical inactivity threshold (default 24h)
|
|
72
90
|
--min-coverage <0..1> Fail list/report commands below a coverage ratio
|
|
73
91
|
--provider <id> Filter list or select an import adapter
|
|
74
92
|
--consumer <id> Select a named memory consumer for promotion
|
|
75
|
-
--
|
|
93
|
+
--tag <tag>, --limit <n>, --cursor <n>
|
|
76
94
|
--page-size <n> Extraction scan page size (default 250, maximum 500)
|
|
77
95
|
--max-documents <n> Explicit extraction safety limit; returns a partial receipt
|
|
78
96
|
--include-bytes Embed registered-output bytes in session export shards
|
|
@@ -87,6 +105,12 @@ Search filters:
|
|
|
87
105
|
Query syntax: FTS5 terms, quoted phrases, prefixes, AND/OR/NOT
|
|
88
106
|
Follow the opaque nextCursor with the same query and filters
|
|
89
107
|
|
|
108
|
+
Show identifiers:
|
|
109
|
+
Internal session_ IDs, exact provider-native IDs, or unique prefixes
|
|
110
|
+
Native IDs search the selected catalog unless --workspace is explicit
|
|
111
|
+
Internal session_ IDs retain the default workspace scope
|
|
112
|
+
Ambiguous IDs list candidates; select --workspace or an internal ID from list
|
|
113
|
+
|
|
90
114
|
Analytics / forensics:
|
|
91
115
|
--session <id>, --date-from <rfc3339>, --date-to <rfc3339>
|
|
92
116
|
--actor <id>, --participant <id>, --tool <name>, --status <status>
|
|
@@ -94,9 +118,9 @@ Analytics / forensics:
|
|
|
94
118
|
--group-by tool|session|provider, --limit <1..5000>
|
|
95
119
|
--authorize-forensics Required for each authorized forensic invocation
|
|
96
120
|
--markdown Render a sanitized forensic timeline table`;
|
|
97
|
-
function printHelp(ctx, exitCode = EXIT.ok) {
|
|
121
|
+
async function printHelp(ctx, exitCode = EXIT.ok) {
|
|
98
122
|
if (ctx.args.includes('--json'))
|
|
99
|
-
emit(envelope('sessions.help', 'ok', { usage: HELP }, null));
|
|
123
|
+
await emit(envelope('sessions.help', 'ok', { usage: HELP }, null));
|
|
100
124
|
else
|
|
101
125
|
console.log(HELP);
|
|
102
126
|
return { exitCode };
|
|
@@ -120,7 +144,7 @@ export const sessionsHandler = {
|
|
|
120
144
|
const normalized = normalizeError(error);
|
|
121
145
|
const output = envelope('sessions', 'error', null, normalized.error);
|
|
122
146
|
if (json)
|
|
123
|
-
emit(output);
|
|
147
|
+
await emit(output);
|
|
124
148
|
else
|
|
125
149
|
console.error(`${normalized.error.code}: ${normalized.error.message}`);
|
|
126
150
|
return { exitCode: normalized.exitCode, message: normalized.error.message };
|
|
@@ -132,7 +156,7 @@ export const sessionsHandler = {
|
|
|
132
156
|
try {
|
|
133
157
|
const result = await executeCommand(ctx, parsed);
|
|
134
158
|
if (json)
|
|
135
|
-
emit(result.envelope);
|
|
159
|
+
await emit(result.envelope);
|
|
136
160
|
else
|
|
137
161
|
printHuman(result.envelope);
|
|
138
162
|
return { exitCode: result.exitCode };
|
|
@@ -141,7 +165,7 @@ export const sessionsHandler = {
|
|
|
141
165
|
const normalized = normalizeError(error);
|
|
142
166
|
const output = envelope(`sessions.${parsed.command}`, 'error', null, normalized.error);
|
|
143
167
|
if (json)
|
|
144
|
-
emit(output);
|
|
168
|
+
await emit(output);
|
|
145
169
|
else
|
|
146
170
|
console.error(`${normalized.error.code}: ${normalized.error.message}`);
|
|
147
171
|
return { exitCode: normalized.exitCode, message: normalized.error.message };
|
|
@@ -151,8 +175,10 @@ export const sessionsHandler = {
|
|
|
151
175
|
async function executeCommand(ctx, args) {
|
|
152
176
|
const command = args.command;
|
|
153
177
|
if (command === 'sources') {
|
|
154
|
-
const
|
|
155
|
-
|
|
178
|
+
const registry = createSessionAdapterRegistry();
|
|
179
|
+
const reports = registry.list().map((adapter) => providerDisposition(adapter.provider));
|
|
180
|
+
const preflight = coveragePreflight({ expectedProviders: requestedProviders(args), registry });
|
|
181
|
+
return ok(command, { providers: reports, count: reports.length, preflight });
|
|
156
182
|
}
|
|
157
183
|
if (command === 'import')
|
|
158
184
|
return importSource(ctx, args);
|
|
@@ -198,7 +224,10 @@ async function executeCommand(ctx, args) {
|
|
|
198
224
|
limit,
|
|
199
225
|
cursor,
|
|
200
226
|
});
|
|
201
|
-
const coverage =
|
|
227
|
+
const coverage = {
|
|
228
|
+
...repository.getCoverage(workspaceId),
|
|
229
|
+
catalogScope: catalogScope(ctx, args, repository, workspaceId),
|
|
230
|
+
};
|
|
202
231
|
const response = {
|
|
203
232
|
items: result.items,
|
|
204
233
|
page: {
|
|
@@ -230,7 +259,10 @@ async function executeCommand(ctx, args) {
|
|
|
230
259
|
const { workspaceId } = readAuthorizationContext(ctx, args, command, repository);
|
|
231
260
|
const gapMs = timelineGap(args.values.get('--gap'));
|
|
232
261
|
const items = deriveSessionTimeline(repository.listTimelineInputs(workspaceId), gapMs);
|
|
233
|
-
const coverage =
|
|
262
|
+
const coverage = {
|
|
263
|
+
...repository.getCoverage(workspaceId),
|
|
264
|
+
catalogScope: catalogScope(ctx, args, repository, workspaceId),
|
|
265
|
+
};
|
|
234
266
|
const response = {
|
|
235
267
|
schemaVersion: '1.0.0',
|
|
236
268
|
workspaceId,
|
|
@@ -257,14 +289,33 @@ async function executeCommand(ctx, args) {
|
|
|
257
289
|
}
|
|
258
290
|
case 'show': {
|
|
259
291
|
const id = requiredPositional(args, 0, 'session-id');
|
|
260
|
-
const
|
|
261
|
-
const
|
|
292
|
+
const explicit = args.values.has('--workspace');
|
|
293
|
+
const catalogMatches = explicit ? undefined : repository.findSessionsByReference(id);
|
|
294
|
+
// Provider-native IDs and their prefixes may themselves start with
|
|
295
|
+
// session_. Exact internal IDs still take precedence.
|
|
296
|
+
const scoped = explicit || catalogMatches?.some((session) => session.sessionId === id)
|
|
297
|
+
|| (id.startsWith('session_')
|
|
298
|
+
&& !catalogMatches?.some((session) => session.nativeSessionId.startsWith(id)));
|
|
299
|
+
const workspaceId = scoped
|
|
300
|
+
? readAuthorizationContext(ctx, args, command, repository).workspaceId
|
|
301
|
+
: projectRootCandidate(ctx.cwd) ?? normalizeWorkspaceId(ctx.cwd, '.');
|
|
302
|
+
const scope = catalogScope(ctx, args, repository, workspaceId);
|
|
303
|
+
// Native IDs identify provider transcripts across this local catalog.
|
|
304
|
+
// Explicit workspace selection and internal IDs retain workspace scope.
|
|
305
|
+
const matches = scoped ? repository.findSessionsByReference(id, workspaceId) : catalogMatches;
|
|
306
|
+
if (matches.length > 1) {
|
|
307
|
+
throw new CliError('SESSION_AMBIGUOUS', `session reference is ambiguous: ${id}; candidates: ${matches.map((session) => `${session.sessionId} (provider=${session.provider}, workspace=${JSON.stringify(session.workspaceId)})`).join(', ')}; select --workspace or use an internal session ID from sessions list`, EXIT.usage, { catalogScope: scope, candidates: matches.map((session) => ({
|
|
308
|
+
sessionId: session.sessionId, provider: session.provider, workspaceId: session.workspaceId,
|
|
309
|
+
})) });
|
|
310
|
+
}
|
|
311
|
+
const session = matches[0];
|
|
262
312
|
if (!session)
|
|
263
|
-
throw new CliError('SESSION_NOT_FOUND', `session not found: ${id}`, EXIT.unavailable);
|
|
313
|
+
throw new CliError('SESSION_NOT_FOUND', `session not found: ${id}${scope.hint ? `; ${scope.hint}` : ''}`, EXIT.unavailable, { catalogScope: scope });
|
|
264
314
|
return ok(command, {
|
|
265
315
|
session,
|
|
266
|
-
tags: repository.listTags(
|
|
267
|
-
events: repository.listEvents(
|
|
316
|
+
tags: repository.listTags(session.sessionId, session.workspaceId),
|
|
317
|
+
events: repository.listEvents(session.sessionId, session.workspaceId),
|
|
318
|
+
catalogScope: catalogScope(ctx, args, repository, session.workspaceId),
|
|
268
319
|
});
|
|
269
320
|
}
|
|
270
321
|
case 'search': {
|
|
@@ -292,6 +343,7 @@ async function executeCommand(ctx, args) {
|
|
|
292
343
|
});
|
|
293
344
|
return ok(command, {
|
|
294
345
|
items: result.items,
|
|
346
|
+
catalogScope: catalogScope(ctx, args, repository, workspaceId),
|
|
295
347
|
page: { limit: boundedInteger(args.values.get('--limit'), 50, 1, 500, '--limit'),
|
|
296
348
|
nextCursor: result.nextCursor },
|
|
297
349
|
});
|
|
@@ -546,11 +598,22 @@ async function executeCommand(ctx, args) {
|
|
|
546
598
|
return ok(command, { sourceId, redactedLocator });
|
|
547
599
|
}
|
|
548
600
|
case 'reindex': {
|
|
549
|
-
const
|
|
601
|
+
const allWorkspaces = args.flags.has('--all-workspaces');
|
|
602
|
+
if (allWorkspaces && args.values.has('--workspace')) {
|
|
603
|
+
throw new CliError('INVALID_ARGUMENT', '--all-workspaces cannot be combined with --workspace', EXIT.usage);
|
|
604
|
+
}
|
|
605
|
+
const workspaceId = allWorkspaces
|
|
606
|
+
? undefined
|
|
607
|
+
: authorizationContext(ctx, args, command).workspaceId;
|
|
608
|
+
const data = {
|
|
609
|
+
operation: 'reindex',
|
|
610
|
+
allWorkspaces,
|
|
611
|
+
workspaceIds: allWorkspaces ? repository.listWorkspaceIds() : [workspaceId],
|
|
612
|
+
};
|
|
550
613
|
if (isDryRun(ctx, args))
|
|
551
|
-
return preview(command,
|
|
614
|
+
return preview(command, data);
|
|
552
615
|
repository.reindex(workspaceId);
|
|
553
|
-
return ok(command,
|
|
616
|
+
return ok(command, data);
|
|
554
617
|
}
|
|
555
618
|
case 'audit': {
|
|
556
619
|
const { workspaceId } = readAuthorizationContext(ctx, args, command, repository);
|
|
@@ -677,6 +740,7 @@ async function executeCommand(ctx, args) {
|
|
|
677
740
|
}
|
|
678
741
|
}
|
|
679
742
|
async function importSource(ctx, args) {
|
|
743
|
+
const limits = await configuredImportLimits(ctx, args);
|
|
680
744
|
const input = resolve(ctx.cwd, requiredPositional(args, 0, 'file'));
|
|
681
745
|
const providerInput = args.values.get('--provider') ?? 'generic';
|
|
682
746
|
const provider = assertSessionProviderId(providerInput);
|
|
@@ -700,6 +764,8 @@ async function importSource(ctx, args) {
|
|
|
700
764
|
const isOpenClaw = provider === 'openclaw';
|
|
701
765
|
const isOpenHuman = provider === 'openhuman';
|
|
702
766
|
const isGrokbot = provider === 'grokbot';
|
|
767
|
+
const isGrokbotNative = isGrokbot
|
|
768
|
+
&& classifyGrokbotBlobName(basename(input))?.kind === 'transcript-replica';
|
|
703
769
|
const isGrokBuild = provider === 'grok-build';
|
|
704
770
|
const isMuse = provider === 'muse';
|
|
705
771
|
const isPi = provider === 'pi';
|
|
@@ -707,37 +773,37 @@ async function importSource(ctx, args) {
|
|
|
707
773
|
const isDsh = provider === 'deepseek-harness';
|
|
708
774
|
const isWarp = provider === 'warp';
|
|
709
775
|
const isDevinDesktop = provider === 'devin-desktop';
|
|
710
|
-
const adapter = isDsh ? new DeepSeekHarnessSessionAdapter() : isOmp ? new OmpSessionAdapter() : isClaude
|
|
711
|
-
? new ClaudeSessionAdapter()
|
|
776
|
+
const adapter = isDsh ? new DeepSeekHarnessSessionAdapter(limits) : isOmp ? new OmpSessionAdapter(limits) : isClaude
|
|
777
|
+
? new ClaudeSessionAdapter(limits)
|
|
712
778
|
: isCodex
|
|
713
|
-
? new CodexSessionAdapter()
|
|
779
|
+
? new CodexSessionAdapter(limits)
|
|
714
780
|
: isCopilot
|
|
715
|
-
? new CopilotSessionAdapter()
|
|
781
|
+
? new CopilotSessionAdapter(limits)
|
|
716
782
|
: isCursor
|
|
717
|
-
? new CursorSessionAdapter()
|
|
783
|
+
? new CursorSessionAdapter(limits)
|
|
718
784
|
: isFactory
|
|
719
|
-
? new FactorySessionAdapter()
|
|
785
|
+
? new FactorySessionAdapter(limits)
|
|
720
786
|
: isHermes
|
|
721
|
-
? new HermesSessionAdapter()
|
|
787
|
+
? new HermesSessionAdapter(limits)
|
|
722
788
|
: isOpenCode
|
|
723
|
-
? new OpenCodeSessionAdapter()
|
|
789
|
+
? new OpenCodeSessionAdapter(limits)
|
|
724
790
|
: isOpenClaw
|
|
725
|
-
? new OpenClawSessionAdapter()
|
|
791
|
+
? new OpenClawSessionAdapter(limits)
|
|
726
792
|
: isOpenHuman
|
|
727
|
-
? new OpenHumanSessionAdapter()
|
|
793
|
+
? new OpenHumanSessionAdapter(limits)
|
|
728
794
|
: isGrokbot
|
|
729
|
-
? new GrokbotSessionAdapter()
|
|
795
|
+
? new GrokbotSessionAdapter(limits)
|
|
730
796
|
: isGrokBuild
|
|
731
|
-
? new GrokBuildSessionAdapter()
|
|
797
|
+
? new GrokBuildSessionAdapter(limits)
|
|
732
798
|
: isMuse
|
|
733
|
-
? new MuseSessionAdapter()
|
|
799
|
+
? new MuseSessionAdapter(limits)
|
|
734
800
|
: isPi
|
|
735
|
-
? new PiSessionAdapter()
|
|
801
|
+
? new PiSessionAdapter(limits)
|
|
736
802
|
: isWarp
|
|
737
|
-
? new WarpSessionAdapter()
|
|
803
|
+
? new WarpSessionAdapter(limits)
|
|
738
804
|
: isDevinDesktop
|
|
739
|
-
? new DevinDesktopSessionAdapter()
|
|
740
|
-
: new GenericSessionInterchangeAdapter();
|
|
805
|
+
? new DevinDesktopSessionAdapter(limits)
|
|
806
|
+
: new GenericSessionInterchangeAdapter(limits);
|
|
741
807
|
const locatorClass = isDsh ? 'deepseek-harness-session-v2-jsonl' : isOmp ? 'omp-session-v3-jsonl' : isClaude
|
|
742
808
|
? claudeLocatorClass(input)
|
|
743
809
|
: isCodex
|
|
@@ -757,7 +823,7 @@ async function importSource(ctx, args) {
|
|
|
757
823
|
: isOpenHuman
|
|
758
824
|
? 'openhuman-enriched-jsonl'
|
|
759
825
|
: isGrokbot
|
|
760
|
-
? 'manual-export'
|
|
826
|
+
? (isGrokbotNative ? GROKBOT_NATIVE_REPLICA_LOCATOR_CLASS : 'manual-export')
|
|
761
827
|
: isGrokBuild
|
|
762
828
|
? GROK_BUILD_CLI_EXPORT_LOCATOR_CLASS
|
|
763
829
|
: isMuse
|
|
@@ -774,6 +840,7 @@ async function importSource(ctx, args) {
|
|
|
774
840
|
authorizedScope: { workspaceId, allowedRoots: [dirname(input)] },
|
|
775
841
|
};
|
|
776
842
|
const probe = await adapter.inspect(selectedSource);
|
|
843
|
+
const workspaceReport = importWorkspaceReport(workspaceId, args.values.has('--workspace'), probe);
|
|
777
844
|
const source = SessionSourceSchema.parse({
|
|
778
845
|
contractVersion: SESSION_CONTRACT_VERSION, sourceId, provider,
|
|
779
846
|
providerProfile: isDsh ? 'native-session-v2-jsonl' : isOmp ? 'native-title-slot-v3' : isClaude
|
|
@@ -795,7 +862,7 @@ async function importSource(ctx, args) {
|
|
|
795
862
|
: isOpenHuman
|
|
796
863
|
? 'schema-1-session-raw-enriched'
|
|
797
864
|
: isGrokbot
|
|
798
|
-
? 'manual-interchange'
|
|
865
|
+
? (isGrokbotNative ? 'grokbot-native-transcript-replica-v1' : 'manual-interchange')
|
|
799
866
|
: isGrokBuild
|
|
800
867
|
? 'documented-cli-markdown-export'
|
|
801
868
|
: isMuse
|
|
@@ -836,10 +903,10 @@ async function importSource(ctx, args) {
|
|
|
836
903
|
? DEVIN_DESKTOP_ADAPTER_VERSION
|
|
837
904
|
: GENERIC_ADAPTER_VERSION,
|
|
838
905
|
sourceSchemaVersion: probe.sourceSchemaVersion,
|
|
839
|
-
disposition: isWarp || isGrokbot || isMuse
|
|
906
|
+
disposition: isWarp || (isGrokbot && !isGrokbotNative) || isMuse
|
|
840
907
|
? 'manual-only'
|
|
841
908
|
: isClaude || isCodex || isCopilot || isCursor || isFactory || isHermes
|
|
842
|
-
|| isOpenCode || isOpenClaw || isOpenHuman || isGrokBuild || isDevinDesktop || isOmp || isDsh || isPi
|
|
909
|
+
|| isOpenCode || isOpenClaw || isOpenHuman || isGrokbotNative || isGrokBuild || isDevinDesktop || isOmp || isDsh || isPi
|
|
843
910
|
? 'implemented' : 'manual-only',
|
|
844
911
|
operationalState: probe.operationalState,
|
|
845
912
|
consistency: probe.consistency, authorizedAt: new Date().toISOString(),
|
|
@@ -877,7 +944,7 @@ async function importSource(ctx, args) {
|
|
|
877
944
|
: { 'native.generic': {} },
|
|
878
945
|
});
|
|
879
946
|
if (isDryRun(ctx, args)) {
|
|
880
|
-
return preview('import', { source, wouldInspect: true, wouldPersist: false });
|
|
947
|
+
return preview('import', { source, ...workspaceReport, wouldInspect: true, wouldPersist: false });
|
|
881
948
|
}
|
|
882
949
|
const lease = await acquireImportLease(databasePath(ctx, args), sha256(['single-source-import', sourceId, workspaceId].join('\0')), {
|
|
883
950
|
waitMs: boundedInteger(args.values.get('--lock-wait-ms'), 5_000, 0, 300_000, '--lock-wait-ms'),
|
|
@@ -885,13 +952,18 @@ async function importSource(ctx, args) {
|
|
|
885
952
|
try {
|
|
886
953
|
const repository = openRepository(ctx, args);
|
|
887
954
|
try {
|
|
955
|
+
const interruptedRuns = repository.interruptRunningBatchImports();
|
|
888
956
|
const receipts = await new IncrementalSessionImporter(repository).import({
|
|
889
|
-
source, selectedSource, adapter, workspaceId, policyVersion: '1.0.0',
|
|
957
|
+
source, selectedSource, adapter, workspaceId, policyVersion: '1.0.0', limits,
|
|
890
958
|
inactivityThresholdMs: inactivityThreshold(args.values.get('--inactivity-threshold')),
|
|
891
959
|
});
|
|
960
|
+
for (const warning of workspaceReport.warnings)
|
|
961
|
+
console.error(`WARNING ${warning}`);
|
|
892
962
|
return ok('import', {
|
|
893
963
|
sourceId,
|
|
964
|
+
...workspaceReport,
|
|
894
965
|
receipts,
|
|
966
|
+
interruptedRuns,
|
|
895
967
|
totals: {
|
|
896
968
|
sessionsInserted: receipts.reduce((sum, item) => sum + item.sessionsInserted, 0),
|
|
897
969
|
eventsInserted: receipts.reduce((sum, item) => sum + item.eventsInserted, 0),
|
|
@@ -906,6 +978,24 @@ async function importSource(ctx, args) {
|
|
|
906
978
|
await lease.release();
|
|
907
979
|
}
|
|
908
980
|
}
|
|
981
|
+
/**
|
|
982
|
+
* Report which catalog workspace an import uses (#2967). A source-declared
|
|
983
|
+
* workspace is provenance only; it never selects the authorization scope.
|
|
984
|
+
*/
|
|
985
|
+
function importWorkspaceReport(workspaceId, fromArgument, probe) {
|
|
986
|
+
const warnings = [];
|
|
987
|
+
const declared = probe.declaredWorkspaceId;
|
|
988
|
+
if (declared !== undefined && declared !== workspaceId) {
|
|
989
|
+
warnings.push(`source declares workspace "${declared}" but sessions are imported into "${workspaceId}"`
|
|
990
|
+
+ `${fromArgument ? '' : ' (no --workspace given)'}; pass --workspace to choose the catalog workspace`);
|
|
991
|
+
}
|
|
992
|
+
return {
|
|
993
|
+
workspaceId,
|
|
994
|
+
workspaceSource: fromArgument ? 'argument' : 'default',
|
|
995
|
+
...(declared === undefined ? {} : { declaredWorkspaceId: declared }),
|
|
996
|
+
warnings,
|
|
997
|
+
};
|
|
998
|
+
}
|
|
909
999
|
/**
|
|
910
1000
|
* `aiwg sessions export {plan,build,verify,unpack}` (#2564). Sub-verb after
|
|
911
1001
|
* `export`, matching the issue's proposed shape:
|
|
@@ -1166,8 +1256,16 @@ async function exportUnpack(ctx, args, command) {
|
|
|
1166
1256
|
}
|
|
1167
1257
|
async function discoverWorkspace(ctx, args) {
|
|
1168
1258
|
const workspace = resolve(ctx.cwd, requiredValue(args, '--workspace'));
|
|
1259
|
+
const config = await readAiwgConfig(workspace);
|
|
1260
|
+
const canonicalWorkspace = realpathSync(workspace);
|
|
1261
|
+
const manifestPath = resolve(ctx.cwd, args.values.get('--manifest') ?? defaultDiscoveryManifestPath(canonicalWorkspace));
|
|
1262
|
+
const exclude = resolveImportExclusions(config?.sessions?.import, args.exclude);
|
|
1263
|
+
const previous = exclude.length > 0 && existsSync(manifestPath) ? await readDiscoveryManifest(manifestPath) : undefined;
|
|
1169
1264
|
const manifest = await discoverWorkspaceHistories({
|
|
1170
1265
|
workspace,
|
|
1266
|
+
knownSources: previous?.workspaceId === canonicalWorkspace ? previous.sources : undefined,
|
|
1267
|
+
exclude,
|
|
1268
|
+
expectedProviders: requestedProviders(args),
|
|
1171
1269
|
providerHome: args.values.has('--provider-home')
|
|
1172
1270
|
? resolve(ctx.cwd, args.values.get('--provider-home'))
|
|
1173
1271
|
: undefined,
|
|
@@ -1177,11 +1275,13 @@ async function discoverWorkspace(ctx, args) {
|
|
|
1177
1275
|
? resolve(ctx.cwd, args.values.get('--muse-root')) : undefined,
|
|
1178
1276
|
dshRoot: args.values.has('--dsh-root')
|
|
1179
1277
|
? resolve(ctx.cwd, args.values.get('--dsh-root')) : undefined,
|
|
1180
|
-
|
|
1181
|
-
? resolve(ctx.cwd, args.values.get('--
|
|
1182
|
-
|
|
1278
|
+
grokbotRoot: args.values.has('--grokbot-root')
|
|
1279
|
+
? resolve(ctx.cwd, args.values.get('--grokbot-root')) : undefined,
|
|
1280
|
+
codexRoots: [
|
|
1281
|
+
...(config?.sessions?.codex_roots ?? []).map((root) => resolve(workspace, root)),
|
|
1282
|
+
...args.codexRoots.map((root) => resolve(ctx.cwd, root)),
|
|
1283
|
+
],
|
|
1183
1284
|
});
|
|
1184
|
-
const manifestPath = resolve(ctx.cwd, args.values.get('--manifest') ?? defaultDiscoveryManifestPath(manifest.workspacePath));
|
|
1185
1285
|
const data = {
|
|
1186
1286
|
manifest: publicDiscoveryManifest(manifest),
|
|
1187
1287
|
manifestPath: redactSourceLocator(manifestPath),
|
|
@@ -1196,11 +1296,18 @@ async function discoverWorkspace(ctx, args) {
|
|
|
1196
1296
|
async function importDiscovered(ctx, args) {
|
|
1197
1297
|
const workspace = resolve(ctx.cwd, requiredValue(args, '--workspace'));
|
|
1198
1298
|
const canonicalWorkspace = realpathSync(workspace);
|
|
1299
|
+
const limits = await configuredImportLimits(ctx, args, canonicalWorkspace);
|
|
1300
|
+
const config = await readAiwgConfig(canonicalWorkspace);
|
|
1301
|
+
const exclude = resolveImportExclusions(config?.sessions?.import, args.exclude);
|
|
1199
1302
|
const manifestPath = resolve(ctx.cwd, args.values.get('--manifest') ?? defaultDiscoveryManifestPath(canonicalWorkspace));
|
|
1200
1303
|
const manifest = await readDiscoveryManifest(manifestPath);
|
|
1201
1304
|
if (manifest.workspaceId !== canonicalWorkspace) {
|
|
1202
1305
|
throw new CliError('MANIFEST_WORKSPACE_MISMATCH', 'discovery manifest does not belong to the explicitly authorized workspace', EXIT.contract);
|
|
1203
1306
|
}
|
|
1307
|
+
const expected = requestedProviders(args);
|
|
1308
|
+
if (expected && JSON.stringify(expected) !== JSON.stringify(manifest.preflight?.expectedProviders)) {
|
|
1309
|
+
throw new SessionContractError('INVALID_ARGUMENT', 'expected provider scope differs from the saved manifest; rediscover with --expected-providers');
|
|
1310
|
+
}
|
|
1204
1311
|
const confirmed = args.flags.has('--confirm') || args.flags.has('--yes');
|
|
1205
1312
|
if (isDryRun(ctx, args) || !confirmed) {
|
|
1206
1313
|
let existing = null;
|
|
@@ -1214,7 +1321,7 @@ async function importDiscovered(ctx, args) {
|
|
|
1214
1321
|
}
|
|
1215
1322
|
return preview('import-discovered', {
|
|
1216
1323
|
manifest: publicDiscoveryManifest(manifest),
|
|
1217
|
-
receipt: previewDiscoveryImport(manifest, existing),
|
|
1324
|
+
receipt: previewDiscoveryImport(manifest, existing, new Date(), exclude),
|
|
1218
1325
|
confirmationRequired: !isDryRun(ctx, args),
|
|
1219
1326
|
wouldPersist: false,
|
|
1220
1327
|
});
|
|
@@ -1225,16 +1332,25 @@ async function importDiscovered(ctx, args) {
|
|
|
1225
1332
|
try {
|
|
1226
1333
|
const repository = openRepository(ctx, args);
|
|
1227
1334
|
try {
|
|
1335
|
+
const interruptedRuns = repository.interruptRunningBatchImports();
|
|
1228
1336
|
const receipt = await importDiscoveryManifest({
|
|
1229
1337
|
manifest,
|
|
1230
1338
|
repository,
|
|
1339
|
+
limits,
|
|
1340
|
+
exclude,
|
|
1231
1341
|
signal: ctx.signal,
|
|
1232
1342
|
inactivityThresholdMs: inactivityThreshold(args.values.get('--inactivity-threshold')),
|
|
1233
1343
|
});
|
|
1344
|
+
receipt.interruptedRuns = interruptedRuns;
|
|
1234
1345
|
return ok('import-discovered', {
|
|
1235
1346
|
manifestId: manifest.manifestId,
|
|
1236
1347
|
receipt,
|
|
1237
1348
|
resumable: receipt.run.status !== 'complete',
|
|
1349
|
+
catalog: {
|
|
1350
|
+
database: databasePath(ctx, args),
|
|
1351
|
+
workspaceId: manifest.workspaceId,
|
|
1352
|
+
hint: `Read these sessions from either directory with aiwg sessions list --workspace ${JSON.stringify(manifest.workspaceId)} --db ${JSON.stringify(databasePath(ctx, args))}`,
|
|
1353
|
+
},
|
|
1238
1354
|
});
|
|
1239
1355
|
}
|
|
1240
1356
|
finally {
|
|
@@ -1414,14 +1530,16 @@ function providerDisposition(provider) {
|
|
|
1414
1530
|
}
|
|
1415
1531
|
if (provider === 'grokbot') {
|
|
1416
1532
|
return {
|
|
1417
|
-
provider, disposition: '
|
|
1418
|
-
supportedOperations: ['inspect', 'stream'],
|
|
1419
|
-
acquisitionModes: ['manual-export'],
|
|
1420
|
-
reasonCode:
|
|
1421
|
-
remediation: '
|
|
1533
|
+
provider, disposition: 'implemented', operationalState: 'available',
|
|
1534
|
+
supportedOperations: ['discover', 'inspect', 'stream'],
|
|
1535
|
+
acquisitionModes: ['manual-export', 'jsonl'],
|
|
1536
|
+
reasonCode: null,
|
|
1537
|
+
remediation: 'Import an explicit AIWG session interchange export, or pass --grokbot-root with an '
|
|
1538
|
+
+ 'explicitly authorized $XDG_CONFIG_HOME/Grok Bot/sand-client-persistence root (Linux only) for '
|
|
1539
|
+
+ 'evidence-gated native discovery.',
|
|
1422
1540
|
evidence: {
|
|
1423
1541
|
adapterVersion: GROKBOT_ADAPTER_VERSION,
|
|
1424
|
-
verifiedAt: '2026-09
|
|
1542
|
+
verifiedAt: '2026-10-09',
|
|
1425
1543
|
documentation: 'docs/providers/grokbot-sessions.md',
|
|
1426
1544
|
},
|
|
1427
1545
|
};
|
|
@@ -1432,7 +1550,7 @@ function providerDisposition(provider) {
|
|
|
1432
1550
|
supportedOperations: ['inspect', 'stream'],
|
|
1433
1551
|
acquisitionModes: ['manual-export'],
|
|
1434
1552
|
reasonCode: 'CLI_EXPORT_REQUIRED',
|
|
1435
|
-
remediation: 'Run `grok sessions list`, then `grok export <session-id> <session-id>.md` and import the explicitly authorized Markdown file.',
|
|
1553
|
+
remediation: 'Run `grok sessions list`, then `grok export <session-id> <session-id>.md` and import the explicitly authorized Markdown file. `aiwg sessions grok-list` finds `grok` on PATH or in $GROK_HOME/bin; pass --grok-bin <absolute path> otherwise.',
|
|
1436
1554
|
evidence: {
|
|
1437
1555
|
adapterVersion: GROK_BUILD_ADAPTER_VERSION,
|
|
1438
1556
|
verifiedAt: '2026-09-21',
|
|
@@ -1550,11 +1668,41 @@ function openRepository(ctx, args) {
|
|
|
1550
1668
|
function databasePath(ctx, args) {
|
|
1551
1669
|
if (args.values.has('--db'))
|
|
1552
1670
|
return resolve(ctx.cwd, args.values.get('--db'));
|
|
1553
|
-
return resolve(projectRootCandidate(ctx.cwd) ?? ctx.cwd, '.aiwg/sessions/catalog.sqlite');
|
|
1671
|
+
return resolve(projectRootCandidate(ctx.cwd) ?? normalizeWorkspaceId(ctx.cwd, '.'), '.aiwg/sessions/catalog.sqlite');
|
|
1672
|
+
}
|
|
1673
|
+
function catalogScope(ctx, args, repository, workspaceId) {
|
|
1674
|
+
const workspaces = repository.listWorkspaceSessionCounts();
|
|
1675
|
+
const otherWorkspaces = workspaces.filter((workspace) => workspace.workspaceId !== workspaceId);
|
|
1676
|
+
const database = databasePath(ctx, args);
|
|
1677
|
+
return {
|
|
1678
|
+
database,
|
|
1679
|
+
workspaceId,
|
|
1680
|
+
total: workspaces.reduce((total, workspace) => total + workspace.count, 0),
|
|
1681
|
+
otherWorkspaces,
|
|
1682
|
+
hint: otherWorkspaces.length
|
|
1683
|
+
? `Other workspaces in this catalog: ${otherWorkspaces.map((workspace) => `${JSON.stringify(workspace.workspaceId)} (${workspace.count} sessions)`).join(', ')}. Select one with --workspace <path-or-id>; from another directory also pass --db ${JSON.stringify(database)}.`
|
|
1684
|
+
: null,
|
|
1685
|
+
};
|
|
1686
|
+
}
|
|
1687
|
+
async function configuredImportLimits(ctx, args, workspace) {
|
|
1688
|
+
const selectedWorkspace = workspace ?? (args.values.has('--workspace')
|
|
1689
|
+
? resolve(ctx.cwd, args.values.get('--workspace')) : ctx.cwd);
|
|
1690
|
+
try {
|
|
1691
|
+
const config = await readAiwgConfig(selectedWorkspace);
|
|
1692
|
+
return resolveImportLimits(config?.sessions?.import, {
|
|
1693
|
+
maxRecordBytes: args.values.get('--max-record-bytes'),
|
|
1694
|
+
maxSourceBytes: args.values.get('--max-source-bytes'),
|
|
1695
|
+
});
|
|
1696
|
+
}
|
|
1697
|
+
catch (error) {
|
|
1698
|
+
throw new CliError('INVALID_ARGUMENT', error instanceof Error ? error.message : String(error), EXIT.usage);
|
|
1699
|
+
}
|
|
1554
1700
|
}
|
|
1555
1701
|
function parseArgs(argv) {
|
|
1556
1702
|
const flags = new Set();
|
|
1557
1703
|
const values = new Map();
|
|
1704
|
+
const codexRoots = [];
|
|
1705
|
+
const exclude = [];
|
|
1558
1706
|
const positionals = [];
|
|
1559
1707
|
const valueFlags = new Set([
|
|
1560
1708
|
'--db', '--provider', '--workspace', '--tag', '--limit', '--cursor', '--source-id',
|
|
@@ -1562,8 +1710,8 @@ function parseArgs(argv) {
|
|
|
1562
1710
|
'--entity', '--sensitivity', '--extraction-state', '--page-size', '--max-documents',
|
|
1563
1711
|
'--state', '--reviewer', '--reason', '--policy-version', '--min-confidence',
|
|
1564
1712
|
'--consumer', '--actor-class', '--reason-code', '--dependent-action', '--basis',
|
|
1565
|
-
'--manifest', '--provider-home', '--codex-root', '--omp-root', '--muse-root', '--dsh-root', '--lock-wait-ms', '--min-coverage', '--gap',
|
|
1566
|
-
'--inactivity-threshold',
|
|
1713
|
+
'--manifest', '--provider-home', '--codex-root', '--omp-root', '--muse-root', '--dsh-root', '--grokbot-root', '--lock-wait-ms', '--min-coverage', '--gap',
|
|
1714
|
+
'--inactivity-threshold', '--expected-providers', '--exclude', '--max-record-bytes', '--max-source-bytes',
|
|
1567
1715
|
'--control-events',
|
|
1568
1716
|
'--session', '--status', '--actor', '--group-by',
|
|
1569
1717
|
'--out', '--plan', '--input', '--shard-name', '--max-attachment-bytes', '--format', '--grok-bin',
|
|
@@ -1577,6 +1725,10 @@ function parseArgs(argv) {
|
|
|
1577
1725
|
throw new CliError('MISSING_OPTION_VALUE', `missing value for ${arg}`, EXIT.usage);
|
|
1578
1726
|
}
|
|
1579
1727
|
values.set(arg, value);
|
|
1728
|
+
if (arg === '--codex-root')
|
|
1729
|
+
codexRoots.push(value);
|
|
1730
|
+
if (arg === '--exclude')
|
|
1731
|
+
exclude.push(value);
|
|
1580
1732
|
index += 1;
|
|
1581
1733
|
}
|
|
1582
1734
|
else if (arg.startsWith('-')) {
|
|
@@ -1589,7 +1741,11 @@ function parseArgs(argv) {
|
|
|
1589
1741
|
positionals.push(arg);
|
|
1590
1742
|
}
|
|
1591
1743
|
}
|
|
1592
|
-
return { command, positionals, flags, values };
|
|
1744
|
+
return { command, positionals, flags, values, codexRoots, exclude };
|
|
1745
|
+
}
|
|
1746
|
+
function requestedProviders(args) {
|
|
1747
|
+
const value = args.values.get('--expected-providers');
|
|
1748
|
+
return value === undefined ? undefined : expectedSessionProviders(value.split(','));
|
|
1593
1749
|
}
|
|
1594
1750
|
function requiredPositional(args, index, name) {
|
|
1595
1751
|
const value = args.positionals[index];
|
|
@@ -1634,6 +1790,16 @@ function readAuthorizationContext(ctx, args, operation, repository) {
|
|
|
1634
1790
|
};
|
|
1635
1791
|
}
|
|
1636
1792
|
const candidates = repository.listWorkspaceIds();
|
|
1793
|
+
const current = normalizeWorkspaceId(ctx.cwd, '.');
|
|
1794
|
+
if (candidates.includes(current) || candidates.length === 0) {
|
|
1795
|
+
return {
|
|
1796
|
+
actorId: 'local-catalog-owner',
|
|
1797
|
+
workspaceId: current,
|
|
1798
|
+
operation,
|
|
1799
|
+
catalogScope: 'workspace',
|
|
1800
|
+
mode: 'local-owner',
|
|
1801
|
+
};
|
|
1802
|
+
}
|
|
1637
1803
|
if (candidates.length === 1) {
|
|
1638
1804
|
return {
|
|
1639
1805
|
actorId: 'local-catalog-owner',
|
|
@@ -1643,15 +1809,9 @@ function readAuthorizationContext(ctx, args, operation, repository) {
|
|
|
1643
1809
|
mode: 'local-owner',
|
|
1644
1810
|
};
|
|
1645
1811
|
}
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
example: `aiwg sessions ${operation} --workspace ${JSON.stringify(candidates[0])}`,
|
|
1650
|
-
});
|
|
1651
|
-
}
|
|
1652
|
-
throw new CliError('WORKSPACE_REQUIRED', 'current workspace cannot be inferred; pass --workspace explicitly', EXIT.usage, {
|
|
1653
|
-
candidates: [],
|
|
1654
|
-
example: `aiwg sessions ${operation} --workspace <path-or-id>`,
|
|
1812
|
+
throw new CliError('WORKSPACE_AMBIGUOUS', 'current workspace cannot be inferred safely; pass --workspace explicitly', EXIT.usage, {
|
|
1813
|
+
candidates,
|
|
1814
|
+
example: `aiwg sessions ${operation} --workspace ${JSON.stringify(candidates[0])}`,
|
|
1655
1815
|
});
|
|
1656
1816
|
}
|
|
1657
1817
|
function projectRootCandidate(start) {
|
|
@@ -1857,8 +2017,13 @@ function preview(command, data) {
|
|
|
1857
2017
|
function envelope(command, status, data, error) {
|
|
1858
2018
|
return { contractVersion: JSON_CONTRACT_VERSION, command, status, data, error };
|
|
1859
2019
|
}
|
|
1860
|
-
function emit(value) {
|
|
2020
|
+
async function emit(value) {
|
|
1861
2021
|
console.log(JSON.stringify(value, null, 2));
|
|
2022
|
+
// The launcher and router may force exit after the handler returns. A write
|
|
2023
|
+
// callback waits for the JSON already queued on stdout, including on pipes.
|
|
2024
|
+
await new Promise((resolve, reject) => {
|
|
2025
|
+
process.stdout.write('', (error) => error ? reject(error) : resolve());
|
|
2026
|
+
});
|
|
1862
2027
|
}
|
|
1863
2028
|
function printHuman(value) {
|
|
1864
2029
|
if (value.status === 'preview')
|
|
@@ -1885,6 +2050,8 @@ function printHuman(value) {
|
|
|
1885
2050
|
].join(' '));
|
|
1886
2051
|
}
|
|
1887
2052
|
console.log(`Coverage: ${data.coverage?.status ?? 'unknown'}`);
|
|
2053
|
+
if (data.coverage?.catalogScope?.hint)
|
|
2054
|
+
console.log(data.coverage.catalogScope.hint);
|
|
1888
2055
|
return;
|
|
1889
2056
|
}
|
|
1890
2057
|
console.log(JSON.stringify(value.data, null, 2));
|
|
@@ -1909,7 +2076,7 @@ function normalizeError(error) {
|
|
|
1909
2076
|
}
|
|
1910
2077
|
if (error instanceof SessionContractError) {
|
|
1911
2078
|
const exitCode = error.code === 'UNSUPPORTED_OPERATION' ? EXIT.unsupported : EXIT.contract;
|
|
1912
|
-
return { error: { code: error.code, message: error.message }, exitCode };
|
|
2079
|
+
return { error: { code: error.code, message: error.message, ...(error.detail ? { details: error.detail } : {}) }, exitCode };
|
|
1913
2080
|
}
|
|
1914
2081
|
if (error instanceof ImportLeaseContentionError) {
|
|
1915
2082
|
return {
|