@jmanuelcorral/openteam 0.2.1 → 0.9.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/.opencode/command/openteam.md +2 -1
- package/.opencode/openteam.example.json +27 -8
- package/AGENTS.md +5 -2
- package/README.es.md +155 -59
- package/README.md +418 -62
- package/dist/capabilities/types.d.ts +3 -3
- package/dist/capabilities/types.d.ts.map +1 -1
- package/dist/classifier/localClassifier.d.ts +0 -2
- package/dist/classifier/localClassifier.d.ts.map +1 -1
- package/dist/cli/consoleServe.d.ts +30 -1
- package/dist/cli/consoleServe.d.ts.map +1 -1
- package/dist/cli/graphOperator.d.ts +22 -0
- package/dist/cli/graphOperator.d.ts.map +1 -0
- package/dist/cli/graphStatusSnapshot.d.ts +16 -0
- package/dist/cli/graphStatusSnapshot.d.ts.map +1 -0
- package/dist/cli/graphViewProvider.d.ts +30 -0
- package/dist/cli/graphViewProvider.d.ts.map +1 -0
- package/dist/cli/migrateAdapter.d.ts +12 -0
- package/dist/cli/migrateAdapter.d.ts.map +1 -0
- package/dist/cli/purgeAdapter.d.ts +10 -0
- package/dist/cli/purgeAdapter.d.ts.map +1 -0
- package/dist/cli/setupAdapters.d.ts.map +1 -1
- package/dist/cli.js +13480 -5176
- package/dist/commands/agents.d.ts +102 -2
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/baseline.d.ts.map +1 -1
- package/dist/commands/clearCache.d.ts +23 -0
- package/dist/commands/clearCache.d.ts.map +1 -0
- package/dist/commands/dispatch.d.ts +197 -4
- package/dist/commands/dispatch.d.ts.map +1 -1
- package/dist/commands/doctor.d.ts +40 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/frontierCatalog.d.ts +8 -14
- package/dist/commands/frontierCatalog.d.ts.map +1 -1
- package/dist/commands/graph.d.ts +0 -27
- package/dist/commands/graph.d.ts.map +1 -1
- package/dist/commands/local.d.ts.map +1 -1
- package/dist/commands/migrate.d.ts +11 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/purge.d.ts +132 -0
- package/dist/commands/purge.d.ts.map +1 -0
- package/dist/commands/report.d.ts +1 -0
- package/dist/commands/report.d.ts.map +1 -1
- package/dist/commands/setup.d.ts +62 -5
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/config/errors.d.ts +10 -0
- package/dist/config/errors.d.ts.map +1 -0
- package/dist/config/legacyMigration.d.ts +82 -0
- package/dist/config/legacyMigration.d.ts.map +1 -0
- package/dist/config/legacyPaths.d.ts +105 -0
- package/dist/config/legacyPaths.d.ts.map +1 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/opencode.d.ts +63 -0
- package/dist/config/opencode.d.ts.map +1 -0
- package/dist/config/persist.d.ts +8 -0
- package/dist/config/persist.d.ts.map +1 -1
- package/dist/config/resolve.d.ts +1 -1
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/runtime.d.ts +62 -0
- package/dist/config/runtime.d.ts.map +1 -0
- package/dist/config/schema.d.ts +145 -77
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/console/assets.d.ts +2 -2
- package/dist/console/assets.d.ts.map +1 -1
- package/dist/console/configView.d.ts +74 -0
- package/dist/console/configView.d.ts.map +1 -0
- package/dist/console/opencodeClient.d.ts +8 -6
- package/dist/console/opencodeClient.d.ts.map +1 -1
- package/dist/console/protocol.d.ts +30 -6
- package/dist/console/protocol.d.ts.map +1 -1
- package/dist/console/render.d.ts +30 -1
- package/dist/console/render.d.ts.map +1 -1
- package/dist/console/types.d.ts +1 -1
- package/dist/console/types.d.ts.map +1 -1
- package/dist/context/redaction.d.ts +27 -19
- package/dist/context/redaction.d.ts.map +1 -1
- package/dist/context/schema.d.ts +26 -26
- package/dist/context/schema.d.ts.map +1 -1
- package/dist/context/types.d.ts +3 -3
- package/dist/contract/opencode.d.ts +39 -23
- package/dist/contract/opencode.d.ts.map +1 -1
- package/dist/graph/certificate.d.ts +37 -16
- package/dist/graph/certificate.d.ts.map +1 -1
- package/dist/graph/langgraph/adapter.d.ts +56 -0
- package/dist/graph/langgraph/adapter.d.ts.map +1 -0
- package/dist/graph/langgraph/certification.d.ts +64 -0
- package/dist/graph/langgraph/certification.d.ts.map +1 -0
- package/dist/graph/langgraph/checkpointReplay.d.ts +49 -0
- package/dist/graph/langgraph/checkpointReplay.d.ts.map +1 -0
- package/dist/graph/langgraph/checkpointer.d.ts +49 -0
- package/dist/graph/langgraph/checkpointer.d.ts.map +1 -0
- package/dist/graph/langgraph/engine.d.ts +34 -0
- package/dist/graph/langgraph/engine.d.ts.map +1 -0
- package/dist/graph/langgraph/graphModel.d.ts +37 -0
- package/dist/graph/langgraph/graphModel.d.ts.map +1 -0
- package/dist/graph/langgraph/reducer.d.ts +18 -0
- package/dist/graph/langgraph/reducer.d.ts.map +1 -0
- package/dist/graph/langgraph/retirement.d.ts +59 -0
- package/dist/graph/langgraph/retirement.d.ts.map +1 -0
- package/dist/graph/langgraph/types.d.ts +65 -0
- package/dist/graph/langgraph/types.d.ts.map +1 -0
- package/dist/graph/privacyPolicy.d.ts +7 -0
- package/dist/graph/privacyPolicy.d.ts.map +1 -1
- package/dist/graph/soakLedger.d.ts.map +1 -1
- package/dist/graph/types.d.ts +0 -2
- package/dist/graph/types.d.ts.map +1 -1
- package/dist/index.d.ts +48 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11596 -4180
- package/dist/local/cacheAdapter.d.ts +7 -0
- package/dist/local/cacheAdapter.d.ts.map +1 -0
- package/dist/local/concurrency.d.ts +52 -0
- package/dist/local/concurrency.d.ts.map +1 -0
- package/dist/local/embeddings.d.ts +10 -10
- package/dist/local/embeddings.d.ts.map +1 -1
- package/dist/local/extractClient.d.ts +13 -10
- package/dist/local/extractClient.d.ts.map +1 -1
- package/dist/local/lemonade.d.ts +4 -0
- package/dist/local/lemonade.d.ts.map +1 -0
- package/dist/local/registry.d.ts +16 -0
- package/dist/local/registry.d.ts.map +1 -1
- package/dist/local/types.d.ts +1 -1
- package/dist/local/types.d.ts.map +1 -1
- package/dist/mcp/semanticRecall.d.ts +18 -1
- package/dist/mcp/semanticRecall.d.ts.map +1 -1
- package/dist/mcp/server.d.ts +41 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/memory/embedText.d.ts +4 -0
- package/dist/memory/embedText.d.ts.map +1 -0
- package/dist/memory/extract.d.ts +33 -18
- package/dist/memory/extract.d.ts.map +1 -1
- package/dist/memory/fold.d.ts +3 -2
- package/dist/memory/fold.d.ts.map +1 -1
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/inject.d.ts.map +1 -1
- package/dist/memory/log.d.ts +15 -4
- package/dist/memory/log.d.ts.map +1 -1
- package/dist/memory/merge.d.ts +18 -1
- package/dist/memory/merge.d.ts.map +1 -1
- package/dist/memory/traverse.d.ts +80 -0
- package/dist/memory/traverse.d.ts.map +1 -0
- package/dist/memory/types.d.ts +53 -7
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/messages/commands.d.ts +84 -0
- package/dist/messages/commands.d.ts.map +1 -0
- package/dist/messages/index.d.ts +46 -0
- package/dist/messages/index.d.ts.map +1 -0
- package/dist/opencodeArtifacts/index.d.ts +33 -0
- package/dist/opencodeArtifacts/index.d.ts.map +1 -0
- package/dist/opencodeArtifacts/orchestratorAgent.d.ts +29 -0
- package/dist/opencodeArtifacts/orchestratorAgent.d.ts.map +1 -0
- package/dist/opencodeArtifacts/slashCommand.d.ts +31 -0
- package/dist/opencodeArtifacts/slashCommand.d.ts.map +1 -0
- package/dist/orchestrator/coordinator.d.ts +188 -2
- package/dist/orchestrator/coordinator.d.ts.map +1 -1
- package/dist/orchestrator/graphCancellation.d.ts +40 -37
- package/dist/orchestrator/graphCancellation.d.ts.map +1 -1
- package/dist/orchestrator/graphEffects.d.ts +24 -24
- package/dist/orchestrator/graphEffects.d.ts.map +1 -1
- package/dist/orchestrator/graphFacade.d.ts +16 -16
- package/dist/orchestrator/graphFacade.d.ts.map +1 -1
- package/dist/orchestrator/graphIngress.d.ts +49 -45
- package/dist/orchestrator/graphIngress.d.ts.map +1 -1
- package/dist/orchestrator/graphReview.d.ts +24 -23
- package/dist/orchestrator/graphReview.d.ts.map +1 -1
- package/dist/orchestrator/graphRuntime.d.ts +27 -26
- package/dist/orchestrator/graphRuntime.d.ts.map +1 -1
- package/dist/orchestrator/graphShadow.d.ts +70 -69
- package/dist/orchestrator/graphShadow.d.ts.map +1 -1
- package/dist/orchestrator/opencodeSessionAdapter.d.ts +25 -25
- package/dist/orchestrator/opencodeSessionAdapter.d.ts.map +1 -1
- package/dist/orchestrator/permissions.d.ts.map +1 -1
- package/dist/orchestrator/ralphLoop.d.ts +57 -0
- package/dist/orchestrator/ralphLoop.d.ts.map +1 -0
- package/dist/orchestrator/roles.d.ts +50 -8
- package/dist/orchestrator/roles.d.ts.map +1 -1
- package/dist/orchestrator/roster.d.ts +103 -0
- package/dist/orchestrator/roster.d.ts.map +1 -0
- package/dist/orchestrator/rosterPersistence.d.ts +22 -0
- package/dist/orchestrator/rosterPersistence.d.ts.map +1 -0
- package/dist/orchestrator/runtimeSelection.d.ts +46 -0
- package/dist/orchestrator/runtimeSelection.d.ts.map +1 -0
- package/dist/orchestrator/sddCompiler.d.ts +34 -34
- package/dist/orchestrator/sddCompiler.d.ts.map +1 -1
- package/dist/orchestrator/sessionReconciler.d.ts +31 -29
- package/dist/orchestrator/sessionReconciler.d.ts.map +1 -1
- package/dist/orchestrator/shadowComparator.d.ts +23 -23
- package/dist/orchestrator/shadowComparator.d.ts.map +1 -1
- package/dist/orchestrator/subsessions.d.ts.map +1 -1
- package/dist/orchestrator/worktreeAdapter.d.ts +12 -12
- package/dist/orchestrator/worktreeAdapter.d.ts.map +1 -1
- package/dist/orchestrator/worktreeDispatch.d.ts +34 -34
- package/dist/orchestrator/worktreeDispatch.d.ts.map +1 -1
- package/dist/orchestrator/worktreeReconciler.d.ts +37 -36
- package/dist/orchestrator/worktreeReconciler.d.ts.map +1 -1
- package/dist/plugin/availability.d.ts.map +1 -1
- package/dist/plugin/capture.d.ts +12 -12
- package/dist/plugin/capture.d.ts.map +1 -1
- package/dist/plugin/commandTool.d.ts +1 -1
- package/dist/plugin/commandTool.d.ts.map +1 -1
- package/dist/plugin/graphShadowIngress.d.ts +50 -48
- package/dist/plugin/graphShadowIngress.d.ts.map +1 -1
- package/dist/plugin/graphTool.d.ts +25 -23
- package/dist/plugin/graphTool.d.ts.map +1 -1
- package/dist/plugin/hooks.d.ts +10 -10
- package/dist/plugin/hooks.d.ts.map +1 -1
- package/dist/plugin/legacyRunProducer.d.ts +22 -22
- package/dist/plugin/legacyRunProducer.d.ts.map +1 -1
- package/dist/plugin/memoryInject.d.ts +6 -6
- package/dist/plugin/memoryInject.d.ts.map +1 -1
- package/dist/plugin/memoryTool.d.ts +36 -0
- package/dist/plugin/memoryTool.d.ts.map +1 -0
- package/dist/plugin/orchestrateTool.d.ts +230 -0
- package/dist/plugin/orchestrateTool.d.ts.map +1 -0
- package/dist/plugin/reportRunSchema.d.ts +8 -8
- package/dist/plugin/reportRunSchema.d.ts.map +1 -1
- package/dist/plugin/sessionTracker.d.ts +15 -15
- package/dist/plugin/sessionTracker.d.ts.map +1 -1
- package/dist/plugin/shadowPipeline.d.ts +2 -1
- package/dist/plugin/shadowPipeline.d.ts.map +1 -1
- package/dist/plugin/soakObserver.d.ts +18 -11
- package/dist/plugin/soakObserver.d.ts.map +1 -1
- package/dist/plugin/toolcalls.d.ts +3 -3
- package/dist/router/chooseModel.d.ts.map +1 -1
- package/dist/router/frontierBaseline.d.ts +3 -3
- package/dist/router/modelSelection.d.ts +12 -4
- package/dist/router/modelSelection.d.ts.map +1 -1
- package/dist/router/types.d.ts +6 -1
- package/dist/router/types.d.ts.map +1 -1
- package/dist/storage/graph/snapshot.d.ts.map +1 -1
- package/dist/storage/graph/soakRecorder.d.ts +14 -1
- package/dist/storage/graph/soakRecorder.d.ts.map +1 -1
- package/dist/storage/graph/workspaceLease.d.ts +1 -1
- package/dist/storage/graph/workspaceLease.d.ts.map +1 -1
- package/dist/storage/graph/worktreeRegistry.d.ts +1 -1
- package/dist/storage/graph/worktreeRegistry.d.ts.map +1 -1
- package/dist/storage/httpStorageProvider.d.ts +2 -2
- package/dist/storage/index/bunSqlite.d.ts +1 -0
- package/dist/storage/index/bunSqlite.d.ts.map +1 -1
- package/dist/storage/index/memoryConsolidate.d.ts +2 -0
- package/dist/storage/index/memoryConsolidate.d.ts.map +1 -1
- package/dist/storage/index/memoryEmbeddings.d.ts +51 -0
- package/dist/storage/index/memoryEmbeddings.d.ts.map +1 -0
- package/dist/storage/index/memoryIndex.d.ts +36 -4
- package/dist/storage/index/memoryIndex.d.ts.map +1 -1
- package/dist/storage/index/memoryRecall.d.ts +1 -1
- package/dist/storage/index/memoryRecall.d.ts.map +1 -1
- package/dist/storage/index/memoryRuntime.d.ts +2 -0
- package/dist/storage/index/memoryRuntime.d.ts.map +1 -1
- package/dist/storage/index/sqliteIndex.d.ts +18 -1
- package/dist/storage/index/sqliteIndex.d.ts.map +1 -1
- package/dist/storage/path.d.ts.map +1 -1
- package/dist/telemetry/aggregate.d.ts +12 -12
- package/dist/telemetry/aggregate.d.ts.map +1 -1
- package/dist/telemetry/cost.d.ts.map +1 -1
- package/dist/telemetry/decisions.d.ts +11 -11
- package/dist/telemetry/decisions.d.ts.map +1 -1
- package/dist/telemetry/eventLog.d.ts +41 -25
- package/dist/telemetry/eventLog.d.ts.map +1 -1
- package/dist/telemetry/events.d.ts +79 -34
- package/dist/telemetry/events.d.ts.map +1 -1
- package/dist/telemetry/fanout.d.ts +18 -0
- package/dist/telemetry/fanout.d.ts.map +1 -0
- package/dist/telemetry/graphProjection.d.ts +12 -12
- package/dist/telemetry/graphProjection.d.ts.map +1 -1
- package/dist/telemetry/graphRuntimeHealth.d.ts +26 -26
- package/dist/telemetry/graphRuntimeHealth.d.ts.map +1 -1
- package/dist/telemetry/graphView.d.ts +20 -20
- package/dist/telemetry/graphView.d.ts.map +1 -1
- package/dist/telemetry/otel.d.ts +86 -0
- package/dist/telemetry/otel.d.ts.map +1 -0
- package/dist/telemetry/otelConfig.d.ts +128 -0
- package/dist/telemetry/otelConfig.d.ts.map +1 -0
- package/dist/telemetry/otelExporter.d.ts +7 -0
- package/dist/telemetry/otelExporter.d.ts.map +1 -0
- package/dist/telemetry/read.d.ts +18 -4
- package/dist/telemetry/read.d.ts.map +1 -1
- package/dist/telemetry/types.d.ts +3 -2
- package/dist/telemetry/types.d.ts.map +1 -1
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/web/configApi.d.ts +154 -0
- package/dist/web/configApi.d.ts.map +1 -0
- package/dist/web/configRoute.d.ts +57 -0
- package/dist/web/configRoute.d.ts.map +1 -0
- package/dist/web/console.d.ts +8 -0
- package/dist/web/console.d.ts.map +1 -1
- package/dist/web/paths.d.ts +4 -3
- package/dist/web/paths.d.ts.map +1 -1
- package/dist/web/server.d.ts +30 -1
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/start.d.ts +15 -0
- package/dist/web/start.d.ts.map +1 -1
- package/dist/web/storageRoute.d.ts +2 -2
- package/package.json +13 -7
- package/dist/cli/tunnel.d.ts +0 -89
- package/dist/cli/tunnel.d.ts.map +0 -1
- package/dist/commands/orchestratorAgent.d.ts +0 -30
- package/dist/commands/orchestratorAgent.d.ts.map +0 -1
- package/dist/commands/slashCommand.d.ts +0 -39
- package/dist/commands/slashCommand.d.ts.map +0 -1
- package/dist/orchestrator/ledger.d.ts +0 -28
- package/dist/orchestrator/ledger.d.ts.map +0 -1
- package/dist/storage/graph/importLegacy.d.ts +0 -62
- package/dist/storage/graph/importLegacy.d.ts.map +0 -1
- package/dist/storage/graph/migrateLegacyBriefs.d.ts +0 -32
- package/dist/storage/graph/migrateLegacyBriefs.d.ts.map +0 -1
- package/dist/storage/graph/migration.d.ts +0 -91
- package/dist/storage/graph/migration.d.ts.map +0 -1
- package/dist/storage/graph/projections.d.ts +0 -31
- package/dist/storage/graph/projections.d.ts.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import type { WorktreeBinding } from "../storage/graph/worktreeRegistry";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Dispatch seam to the run's worktree (GE-073, D-W3).
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `PluginInput.directory`/`worktree` (GE-005).
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
5
|
+
* Decides, for a Graph runtime effect, the `directory` used to create the
|
|
6
|
+
* child sub-session (`query.directory`) and verifies the correlation of the
|
|
7
|
+
* `PluginInput.directory`/`worktree` contract (GE-005). It is pure and
|
|
8
|
+
* deterministic logic: no I/O, SDK, clock, or global state; the worktree
|
|
9
|
+
* health probe and the registry lookup (GE-072) are done by the caller, which
|
|
10
|
+
* provides their results as data.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* (`graph.worktrees.enabled` = `false`,
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
12
|
+
* UX-neutrality invariant: with isolation **disabled**
|
|
13
|
+
* (`graph.worktrees.enabled` = `false`, the default), the resolved directory is
|
|
14
|
+
* exactly the current workspace, so dispatch is identical to today's behavior.
|
|
15
|
+
* With isolation enabled, a healthy worktree bound to the run is required, and
|
|
16
|
+
* it fails closed (`WorktreeDispatchError`) if the binding is missing, the
|
|
17
|
+
* directory disappeared (`missing`), or it is dirty (`unclean`). No live path
|
|
18
|
+
* calls this seam yet; the executor integration will consume it.
|
|
19
19
|
*/
|
|
20
|
-
/**
|
|
20
|
+
/** Observed health of a run's worktree (result of the caller's probe). */
|
|
21
21
|
export type WorktreeHealth = "ready" | "missing" | "unclean";
|
|
22
|
-
/**
|
|
22
|
+
/** Dispatch state with respect to the run's per-worktree isolation. */
|
|
23
23
|
export type WorktreeDispatchState = {
|
|
24
24
|
readonly kind: "disabled";
|
|
25
25
|
} | {
|
|
@@ -34,33 +34,33 @@ export type WorktreeDispatchState = {
|
|
|
34
34
|
readonly kind: "ready";
|
|
35
35
|
readonly worktreePath: string;
|
|
36
36
|
};
|
|
37
|
-
/**
|
|
37
|
+
/** Closed taxonomy of failures when binding dispatch to a worktree. */
|
|
38
38
|
export type WorktreeDispatchErrorCode = "unbound" | "missing" | "unclean" | "mismatch";
|
|
39
|
-
/**
|
|
39
|
+
/** Typed error for a dispatch that cannot be bound to a healthy worktree. */
|
|
40
40
|
export declare class WorktreeDispatchError extends Error {
|
|
41
41
|
readonly code: WorktreeDispatchErrorCode;
|
|
42
42
|
readonly detail: string;
|
|
43
43
|
constructor(code: WorktreeDispatchErrorCode, detail: string);
|
|
44
44
|
}
|
|
45
|
-
/**
|
|
45
|
+
/** Effective dispatch directory for an effect. */
|
|
46
46
|
export type DispatchDirectory = {
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
49
|
-
* (
|
|
48
|
+
* Directory to pass as `query.directory`. `undefined` = workspace root
|
|
49
|
+
* (current behavior when isolation is disabled).
|
|
50
50
|
*/
|
|
51
51
|
readonly directory: string | undefined;
|
|
52
|
-
/**
|
|
52
|
+
/** Correlated worktree; `undefined` except with active isolation. */
|
|
53
53
|
readonly worktree: string | undefined;
|
|
54
54
|
};
|
|
55
|
-
/**
|
|
55
|
+
/** Observed correlation of a sub-session's `PluginInput` contract. */
|
|
56
56
|
export type ObservedWorktreeCorrelation = {
|
|
57
57
|
readonly directory: string;
|
|
58
58
|
readonly worktree: string;
|
|
59
59
|
};
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
61
|
+
* Combines the isolation flag, the registry binding (GE-072), and observed
|
|
62
|
+
* worktree health into a dispatch state. Fails closed by default: absent or
|
|
63
|
+
* unknown health is treated as `missing`.
|
|
64
64
|
*/
|
|
65
65
|
export declare function worktreeDispatchState(input: {
|
|
66
66
|
readonly enabled: boolean;
|
|
@@ -68,17 +68,17 @@ export declare function worktreeDispatchState(input: {
|
|
|
68
68
|
readonly health: WorktreeHealth | undefined;
|
|
69
69
|
}): WorktreeDispatchState;
|
|
70
70
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
71
|
+
* Resolves the effective dispatch directory. With isolation disabled, returns
|
|
72
|
+
* the `workspaceDirectory` unchanged (identical to the current behavior); with
|
|
73
|
+
* a healthy worktree, returns its path as `directory` and `worktree`; in any
|
|
74
|
+
* other state, fails closed with `WorktreeDispatchError`.
|
|
75
75
|
*/
|
|
76
76
|
export declare function resolveDispatchDirectory(state: WorktreeDispatchState, workspaceDirectory: string | undefined): DispatchDirectory;
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
79
|
-
* `directory`/`worktree`
|
|
80
|
-
* worktree
|
|
81
|
-
*
|
|
78
|
+
* Verifies the correlation of the `PluginInput` contract (GE-005): the
|
|
79
|
+
* sub-session's observed `directory`/`worktree` must match the run's leased
|
|
80
|
+
* worktree. Throws `WorktreeDispatchError("mismatch")` if either differs;
|
|
81
|
+
* platform-normalized path comparison.
|
|
82
82
|
*/
|
|
83
83
|
export declare function assertWorktreeCorrelation(observed: ObservedWorktreeCorrelation, leasedWorktree: string): void;
|
|
84
84
|
//# sourceMappingURL=worktreeDispatch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktreeDispatch.d.ts","sourceRoot":"","sources":["../../src/orchestrator/worktreeDispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;;;;;;;;;;;;;;;GAiBG;AAEH,
|
|
1
|
+
{"version":3,"file":"worktreeDispatch.d.ts","sourceRoot":"","sources":["../../src/orchestrator/worktreeDispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;;;;;;;;;;;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,qBAAqB,CAAC,KAAK,EAAE;IAC3C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC;CAC7C,GAAG,qBAAqB,CAgBxB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,qBAAqB,EAC5B,kBAAkB,EAAE,MAAM,GAAG,SAAS,GACrC,iBAAiB,CAanB;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,2BAA2B,EACrC,cAAc,EAAE,MAAM,GACrB,IAAI,CAaN"}
|
|
@@ -1,61 +1,62 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Orphaned worktree reconciler after a crash (GE-074, D-W4).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* `src/commands/graph.ts`):
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* wiring
|
|
4
|
+
* It follows the same dry-run contract as the operator commands (GE-045,
|
|
5
|
+
* `src/commands/graph.ts`): it is **pure and deterministic logic** that
|
|
6
|
+
* receives an already-observed snapshot (worktrees listed by the GE-071
|
|
7
|
+
* adapter, which runs remain active according to the GE-025 run registry, and
|
|
8
|
+
* the merge-back state probed by the caller) and decides, without executing
|
|
9
|
+
* anything, which action is safe for each worktree. Actual execution
|
|
10
|
+
* (`prune`/merge-back) lives in the wiring layer and only runs when the plan
|
|
11
|
+
* authorizes it.
|
|
11
12
|
*
|
|
12
|
-
*
|
|
13
|
-
* - **
|
|
14
|
-
* - **
|
|
15
|
-
* - **
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* - **
|
|
13
|
+
* Reconciliation policy:
|
|
14
|
+
* - **Active run** → `retain`: never touch a worktree whose run is still alive.
|
|
15
|
+
* - **Clean orphan with no commits** → `prune`: safe and reported removal.
|
|
16
|
+
* - **Clean orphan with commits** → `merge-back`: explicit and idempotent;
|
|
17
|
+
* never silently discards the run branch. A second pass, when the branch is
|
|
18
|
+
* already integrated (`alreadyMerged`), plans `prune` instead of merging
|
|
19
|
+
* again.
|
|
20
|
+
* - **Dirty or ambiguous** → `block`: stop for an operator decision.
|
|
20
21
|
*
|
|
21
|
-
*
|
|
22
|
-
* (
|
|
23
|
-
*
|
|
22
|
+
* UX-neutrality invariant (D-W4): with `graph.worktrees.enabled` = `false`
|
|
23
|
+
* (the default), the reconciler is a **no-op** — it returns an empty report,
|
|
24
|
+
* and plans, creates, or prunes no worktree. No live path calls it yet.
|
|
24
25
|
*/
|
|
25
|
-
/**
|
|
26
|
+
/** Observed merge-back state of a worktree (the caller's git probe). */
|
|
26
27
|
export type WorktreeMergeState = "clean-empty" | "clean-ahead" | "dirty";
|
|
27
|
-
/**
|
|
28
|
+
/** Observed snapshot of a worktree candidate for reconciliation. */
|
|
28
29
|
export type WorktreeObservation = {
|
|
29
30
|
readonly runID: string;
|
|
30
31
|
readonly path: string;
|
|
31
|
-
/**
|
|
32
|
+
/** The run is still active according to the run registry (valid lease). */
|
|
32
33
|
readonly runActive: boolean;
|
|
33
|
-
/**
|
|
34
|
+
/** Observed merge-back state. */
|
|
34
35
|
readonly mergeState: WorktreeMergeState;
|
|
35
36
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
37
|
+
* Only relevant with `mergeState: "clean-ahead"`: the run branch is already
|
|
38
|
+
* integrated into the base, so reconciliation is idempotent and can prune
|
|
39
|
+
* instead of merging again.
|
|
39
40
|
*/
|
|
40
41
|
readonly alreadyMerged?: boolean;
|
|
41
42
|
};
|
|
42
|
-
/**
|
|
43
|
+
/** Planned action for a worktree, decided without executing it. */
|
|
43
44
|
export type WorktreeReconcileAction = "retain" | "prune" | "merge-back" | "block";
|
|
44
|
-
/**
|
|
45
|
+
/** Reconciliation plan for a specific worktree. */
|
|
45
46
|
export type WorktreeReconcilePlan = {
|
|
46
47
|
readonly runID: string;
|
|
47
48
|
readonly path: string;
|
|
48
49
|
readonly action: WorktreeReconcileAction;
|
|
49
|
-
/**
|
|
50
|
+
/** Stable, machine-readable reason for the decision. */
|
|
50
51
|
readonly reason: string;
|
|
51
|
-
/** `true`
|
|
52
|
+
/** `true` when the action preserves invariants without an operator override. */
|
|
52
53
|
readonly safe: boolean;
|
|
53
54
|
};
|
|
54
|
-
/**
|
|
55
|
+
/** Aggregate reconciliation report. */
|
|
55
56
|
export type WorktreeReconcileReport = {
|
|
56
|
-
/**
|
|
57
|
+
/** State of the isolation flag at reconciliation time. */
|
|
57
58
|
readonly enabled: boolean;
|
|
58
|
-
/** Plan
|
|
59
|
+
/** Plan per worktree, in observed order. */
|
|
59
60
|
readonly plans: readonly WorktreeReconcilePlan[];
|
|
60
61
|
readonly retained: number;
|
|
61
62
|
readonly pruned: number;
|
|
@@ -63,9 +64,9 @@ export type WorktreeReconcileReport = {
|
|
|
63
64
|
readonly blocked: number;
|
|
64
65
|
};
|
|
65
66
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
67
|
+
* Plans reconciliation for a set of observed worktrees. With isolation
|
|
68
|
+
* disabled, returns an empty report (no-op). Pure: does not execute git or
|
|
69
|
+
* touch I/O.
|
|
69
70
|
*/
|
|
70
71
|
export declare function planWorktreeReconciliation(input: {
|
|
71
72
|
readonly enabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktreeReconciler.d.ts","sourceRoot":"","sources":["../../src/orchestrator/worktreeReconciler.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"worktreeReconciler.d.ts","sourceRoot":"","sources":["../../src/orchestrator/worktreeReconciler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,wEAAwE;AACxE,MAAM,MAAM,kBAAkB,GAAG,a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,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACpD,GAAG,uBAAuB,CAwB1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"availability.d.ts","sourceRoot":"","sources":["../../src/plugin/availability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,iBAAiB,CAAC;AAEtE,MAAM,MAAM,oBAAoB,GAAG,MAAM,cAAc,EAAE,CAAC;AAE1D,KAAK,aAAa,GAAG;IACnB,KAAK,CACH,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,GAC5C,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,IAAI,cAAc,EAAE,CAAC;IACxB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,aAAa,CAAC;IACxB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3C,CAAC;
|
|
1
|
+
{"version":3,"file":"availability.d.ts","sourceRoot":"","sources":["../../src/plugin/availability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,iBAAiB,CAAC;AAEtE,MAAM,MAAM,oBAAoB,GAAG,MAAM,cAAc,EAAE,CAAC;AAE1D,KAAK,aAAa,GAAG;IACnB,KAAK,CACH,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,GAC5C,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,IAAI,cAAc,EAAE,CAAC;IACxB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,aAAa,CAAC;IACxB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3C,CAAC;AAiFF,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,oBAAoB,EAAE,EACjC,MAAM,EAAE,cAAc,GACrB,cAAc,EAAE,CAkClB;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,wBAAwB,GAChC,iBAAiB,CAyBnB"}
|
package/dist/plugin/capture.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ActivityEvent, type MessageEvent, type SessionEndpointEvent } from "../telemetry/events";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* **Pure** mapping of opencode events to redacted `OpenTeamEvent`s. No I/O,
|
|
4
|
+
* network, clock (`now` is injected), randomness, or env vars.
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
6
|
+
/** Minimal structural shape of an opencode `AssistantMessage`. */
|
|
7
7
|
export type AssistantInfoLike = {
|
|
8
8
|
role?: string;
|
|
9
9
|
sessionID?: string;
|
|
@@ -27,15 +27,15 @@ export type AssistantInfoLike = {
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
31
|
-
* (
|
|
32
|
-
*
|
|
30
|
+
* Builds a `message` event from a **completed** assistant message
|
|
31
|
+
* (real cost and tokens). Returns `undefined` if the message is not from the assistant,
|
|
32
|
+
* has not finished, or is missing session/model.
|
|
33
33
|
*/
|
|
34
34
|
export declare function messageEventFrom(info: AssistantInfoLike, now: () => number): MessageEvent | undefined;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* Builds a `session-endpoint` event to announce the opencode server for a
|
|
37
|
+
* session. `url` is normalized to only the **origin** (`protocol//host:port`): never
|
|
38
|
+
* paths, query strings, or credentials. Returns `undefined` if `url` is not parseable.
|
|
39
39
|
*/
|
|
40
40
|
export declare function sessionEndpointEventFrom(sessionID: string, url: string | URL, now: () => number, meta?: {
|
|
41
41
|
directory?: string;
|
|
@@ -48,9 +48,9 @@ type OpencodeEventLike = {
|
|
|
48
48
|
};
|
|
49
49
|
export declare function sessionIDFromEvent(event: OpencodeEventLike): string | undefined;
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* `undefined`
|
|
51
|
+
* Builds a redacted `activity` event (only the event type, never
|
|
52
|
+
* content) from a session lifecycle event. Returns
|
|
53
|
+
* `undefined` outside the allow-list or if `sessionID` is missing.
|
|
54
54
|
*/
|
|
55
55
|
export declare function activityEventFrom(event: OpencodeEventLike, now: () => number): ActivityEvent | undefined;
|
|
56
56
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/plugin/capture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AAE7B;;;GAGG;AAEH,
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/plugin/capture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AAE7B;;;GAGG;AAEH,kEAAkE;AAClE,MAAM,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G,SAAS,CAgBpB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,iBAAiB,EACxB,GAAG,EAAE,MAAM,MAAM,GAChB,aAAa,GAAG,SAAS,CAiB3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
import { type CliDeps } from "../commands/dispatch";
|
|
3
|
-
export type CommandAction = "show" | "set" | "auto" | "doctor" | "report" | "agents" | "console";
|
|
3
|
+
export type CommandAction = "show" | "set" | "auto" | "doctor" | "report" | "agents" | "console" | "clear-cache";
|
|
4
4
|
/**
|
|
5
5
|
* Map a tool action (+ optional model) to the argv understood by {@link runCli}.
|
|
6
6
|
* Pure so it can be unit-tested without the opencode runtime.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandTool.d.ts","sourceRoot":"","sources":["../../src/plugin/commandTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,sBAAsB,CAAC;AAE5D,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,KAAK,GACL,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"commandTool.d.ts","sourceRoot":"","sources":["../../src/plugin/commandTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,sBAAsB,CAAC;AAE5D,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,KAAK,GACL,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,aAAa,CAAC;AAElB;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAqB3E;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CA2B/D"}
|
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { GraphMode } from "../config/schema";
|
|
3
3
|
/**
|
|
4
|
-
* **
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* **Production shadow ingestion** (GE-042): observes **one** real legacy
|
|
5
|
+
* execution and projects it to a **reference-only** `LegacyExecutionTraceV1`,
|
|
6
|
+
* without duplicating work.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
8
|
+
* The trace is the input that the effect-free mirror (GE-043) compiles for the
|
|
9
|
+
* parity comparator (GE-044) to compare. That is why it carries exactly the
|
|
10
|
+
* dimensions the comparator normalizes —terminal state, node order, roles,
|
|
11
|
+
* models, number of fixes, and outcome— and **no raw content**: no brief, no
|
|
12
|
+
* prompt, no tool arguments, no model output. Only ids, roles, model/session
|
|
13
|
+
* references, error classes, and counters.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
* - **
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* - **
|
|
20
|
-
* (
|
|
21
|
-
*
|
|
22
|
-
* - **Gate dormant:**
|
|
23
|
-
* `killSwitch`;
|
|
24
|
-
*
|
|
25
|
-
*
|
|
15
|
+
* Structural guarantees of the boundary:
|
|
16
|
+
* - **No effects or LLM:** this module only maps an observation that has
|
|
17
|
+
* already been produced; it never dispatches a tool, executes an effect, or
|
|
18
|
+
* calls the model, so it cannot duplicate the legacy execution it observes.
|
|
19
|
+
* - **No synthetic trace:** an observation that did not truly execute
|
|
20
|
+
* (resumed or `skipped`) or has no nodes is **explicitly ineligible**; the
|
|
21
|
+
* builder never fabricates a run.
|
|
22
|
+
* - **Gate dormant:** observes only with `graph.mode` in `shadow`/`active` and
|
|
23
|
+
* without `killSwitch`; with `off` (or an absent section) or kill-switch,
|
|
24
|
+
* ineligible.
|
|
25
|
+
* - **Reference-only:** a final guard rejects any raw field and the boundary
|
|
26
|
+
* parser also rejects unknown keys.
|
|
26
27
|
*
|
|
27
|
-
*
|
|
28
|
+
* **Pure and deterministic** module: no I/O, network, clock, random, or env vars.
|
|
28
29
|
*/
|
|
29
|
-
/**
|
|
30
|
+
/** Version of the legacy execution trace. */
|
|
30
31
|
export declare const LEGACY_EXECUTION_TRACE_VERSION: 1;
|
|
31
|
-
/**
|
|
32
|
+
/** Normalized terminal status of the observed legacy execution. */
|
|
32
33
|
export declare const LegacyExecutionStatusSchema: z.ZodEnum<{
|
|
33
34
|
cancelled: "cancelled";
|
|
34
35
|
completed: "completed";
|
|
35
36
|
failed: "failed";
|
|
36
37
|
}>;
|
|
37
38
|
export type LegacyExecutionStatus = z.infer<typeof LegacyExecutionStatusSchema>;
|
|
38
|
-
/**
|
|
39
|
+
/** Normalized outcome of the observed legacy execution review. */
|
|
39
40
|
export declare const LegacyReviewOutcomeSchema: z.ZodEnum<{
|
|
40
41
|
approved: "approved";
|
|
41
42
|
inconclusive: "inconclusive";
|
|
@@ -43,10 +44,10 @@ export declare const LegacyReviewOutcomeSchema: z.ZodEnum<{
|
|
|
43
44
|
}>;
|
|
44
45
|
export type LegacyReviewOutcome = z.infer<typeof LegacyReviewOutcomeSchema>;
|
|
45
46
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
47
|
+
* Trace node: only references and bounded tags. `model` is the normalized
|
|
48
|
+
* model reference (e.g. `provider/model`); `sessionRef` is the opencode
|
|
49
|
+
* subsession id, never its content; `errorClass` is the bounded failure
|
|
50
|
+
* taxonomy shared by the graph runtime.
|
|
50
51
|
*/
|
|
51
52
|
export declare const LegacyTraceNodeV1Schema: z.ZodObject<{
|
|
52
53
|
id: z.ZodString;
|
|
@@ -66,9 +67,9 @@ export declare const LegacyTraceNodeV1Schema: z.ZodObject<{
|
|
|
66
67
|
}, z.core.$strict>;
|
|
67
68
|
export type LegacyTraceNodeV1 = z.infer<typeof LegacyTraceNodeV1Schema>;
|
|
68
69
|
/**
|
|
69
|
-
*
|
|
70
|
-
* `nodes`
|
|
71
|
-
*
|
|
70
|
+
* Versioned and reference-only trace of a single productive legacy execution.
|
|
71
|
+
* `nodes` preserves the dispatch **order** (implementer, reviewer, fixes...),
|
|
72
|
+
* which is one of the parity dimensions.
|
|
72
73
|
*/
|
|
73
74
|
export declare const LegacyExecutionTraceV1Schema: z.ZodObject<{
|
|
74
75
|
version: z.ZodLiteral<1>;
|
|
@@ -103,27 +104,27 @@ export declare const LegacyExecutionTraceV1Schema: z.ZodObject<{
|
|
|
103
104
|
parentSessionRef: z.ZodOptional<z.ZodString>;
|
|
104
105
|
}, z.core.$strict>;
|
|
105
106
|
export type LegacyExecutionTraceV1 = z.infer<typeof LegacyExecutionTraceV1Schema>;
|
|
106
|
-
/**
|
|
107
|
+
/** Eligibility gate: observed subset of the `graph` config. */
|
|
107
108
|
export type ShadowIngressGate = {
|
|
108
109
|
readonly mode: GraphMode;
|
|
109
110
|
readonly killSwitch: boolean;
|
|
110
111
|
};
|
|
111
|
-
/**
|
|
112
|
+
/** **Explicit** reason why an observation does not produce a trace. */
|
|
112
113
|
export type ShadowIngressIneligibleReason = "graph-disabled" | "kill-switch" | "not-executed" | "no-observation";
|
|
113
|
-
/**
|
|
114
|
+
/** Observed node from the real legacy execution (bounded input port). */
|
|
114
115
|
export type ObservedLegacyNode = {
|
|
115
116
|
readonly id: string;
|
|
116
117
|
readonly role: LegacyTraceNodeV1["role"];
|
|
117
118
|
readonly model: string;
|
|
118
|
-
/**
|
|
119
|
+
/** Terminal success of the node; derives the outcome when the node is reviewer. */
|
|
119
120
|
readonly ok: boolean;
|
|
120
121
|
readonly sessionRef?: string;
|
|
121
122
|
readonly errorClass?: LegacyTraceNodeV1["errorClass"];
|
|
122
123
|
};
|
|
123
124
|
/**
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
125
|
+
* Observation of **one** real legacy execution, correlated by the orchestrator
|
|
126
|
+
* from the event/tool hooks. `executed: false` marks a resumption or a
|
|
127
|
+
* `skipped` (no real execution): explicitly ineligible.
|
|
127
128
|
*/
|
|
128
129
|
export type ObservedLegacyRun = {
|
|
129
130
|
readonly runID: string;
|
|
@@ -133,7 +134,7 @@ export type ObservedLegacyRun = {
|
|
|
133
134
|
readonly nodes: readonly ObservedLegacyNode[];
|
|
134
135
|
readonly parentSessionRef?: string;
|
|
135
136
|
};
|
|
136
|
-
/**
|
|
137
|
+
/** Ingestion result: eligible trace or explicit ineligibility. */
|
|
137
138
|
export type ShadowIngressResult = {
|
|
138
139
|
readonly eligible: true;
|
|
139
140
|
readonly trace: LegacyExecutionTraceV1;
|
|
@@ -141,25 +142,26 @@ export type ShadowIngressResult = {
|
|
|
141
142
|
readonly eligible: false;
|
|
142
143
|
readonly reason: ShadowIngressIneligibleReason;
|
|
143
144
|
};
|
|
144
|
-
/**
|
|
145
|
+
/** The gate is open when the shadow observation is eligible. */
|
|
145
146
|
export declare function shadowIngressGateOpen(gate: ShadowIngressGate | undefined): boolean;
|
|
146
147
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
148
|
+
* Ingests the observation of a real legacy execution and returns a
|
|
149
|
+
* reference-only `LegacyExecutionTraceV1`, or the explicit ineligibility. Does
|
|
150
|
+
* not execute effects, does not call the model, and does not fabricate traces:
|
|
151
|
+
* it only projects what was observed when the gate is open and the execution was
|
|
152
|
+
* real.
|
|
151
153
|
*/
|
|
152
154
|
export declare function ingestLegacyExecution(observation: ObservedLegacyRun, gate: ShadowIngressGate | undefined): ShadowIngressResult;
|
|
153
|
-
/**
|
|
155
|
+
/** Typed validation error for the legacy trace at the boundary. */
|
|
154
156
|
export declare class LegacyTraceError extends Error {
|
|
155
157
|
readonly code: "invalid-legacy-trace";
|
|
156
158
|
readonly issues: string[];
|
|
157
159
|
constructor(error: z.ZodError);
|
|
158
160
|
}
|
|
159
161
|
/**
|
|
160
|
-
*
|
|
161
|
-
* `LegacyTraceError`
|
|
162
|
-
*
|
|
162
|
+
* Validates and parses a legacy trace at the boundary (consumed by GE-043).
|
|
163
|
+
* Throws `LegacyTraceError` if the shape is invalid or carries unknown keys,
|
|
164
|
+
* including raw content fields.
|
|
163
165
|
*/
|
|
164
166
|
export declare function parseLegacyExecutionTrace(input: unknown): LegacyExecutionTraceV1;
|
|
165
167
|
//# sourceMappingURL=graphShadowIngress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphShadowIngress.d.ts","sourceRoot":"","sources":["../../src/plugin/graphShadowIngress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAQlD
|
|
1
|
+
{"version":3,"file":"graphShadowIngress.d.ts","sourceRoot":"","sources":["../../src/plugin/graphShadowIngress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAQlD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,6CAA6C;AAC7C,eAAO,MAAM,8BAA8B,EAAG,CAAU,CAAC;AAEzD,mEAAmE;AACnE,eAAO,MAAM,2BAA2B;;;;EAItC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,kEAAkE;AAClE,eAAO,MAAM,yBAAyB;;;;EAIpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;GAKG;AACH,eAAO,MAAM,uB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