@jmanuelcorral/openteam 0.2.2 → 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 +21 -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/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 +13394 -6121
- 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 +196 -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 +142 -79
- 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 +19 -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 +46 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11083 -5009
- 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 +152 -1
- 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 +35 -2
- package/dist/plugin/orchestrateTool.d.ts.map +1 -1
- 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 +44 -36
- 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/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/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
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type RecallDeps } from "./recall";
|
|
2
|
+
import { type Embedding, type MemoryRecord, type RecallQuery, type RecallResult } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Pure, deterministic multi-hop traversal over the relation-edge graph (W5-S02).
|
|
5
|
+
* The graph nodes are entity identifiers (an edge's `from`/`to`) and the arcs are
|
|
6
|
+
* the typed relation edges introduced in W5-S01. This module has no I/O, clock,
|
|
7
|
+
* randomness, or env access: the reference instant `asOf` (epoch ms) and the
|
|
8
|
+
* owner scope are always injected, exactly like `recall`/`temporal`.
|
|
9
|
+
*
|
|
10
|
+
* Traversal is:
|
|
11
|
+
* - owner-scoped: only edges visible to `ownerKey` (plus the shared sentinel when
|
|
12
|
+
* `includeShared`) are walked, so a traversal can never cross `ownerKey`.
|
|
13
|
+
* - bitemporal: an edge is only walked if it is active at `asOf` (reusing
|
|
14
|
+
* `isActiveAt`), so invalidated or superseded edges drop out of the graph.
|
|
15
|
+
* - depth-bounded and cycle-safe: BFS by depth up to `maxDepth`, each node
|
|
16
|
+
* visited once.
|
|
17
|
+
*
|
|
18
|
+
* It WRAPS vector recall (`recallGraph`): the seed is a node reached by the
|
|
19
|
+
* existing similarity pipeline; recall behaviour is left byte-identical for
|
|
20
|
+
* callers that do not ask for traversal.
|
|
21
|
+
*/
|
|
22
|
+
/** A node reached by traversal, tagged with its hop distance from the seed. */
|
|
23
|
+
export type TraversalNode = {
|
|
24
|
+
id: string;
|
|
25
|
+
depth: number;
|
|
26
|
+
};
|
|
27
|
+
/** An edge walked during traversal; `depth` is the hop distance of `to`. */
|
|
28
|
+
export type TraversalEdge = {
|
|
29
|
+
from: string;
|
|
30
|
+
to: string;
|
|
31
|
+
predicate: string;
|
|
32
|
+
depth: number;
|
|
33
|
+
};
|
|
34
|
+
/** The reachable sub-graph from a seed node. */
|
|
35
|
+
export type TraversalResult = {
|
|
36
|
+
seed: string;
|
|
37
|
+
nodes: TraversalNode[];
|
|
38
|
+
edges: TraversalEdge[];
|
|
39
|
+
};
|
|
40
|
+
/** Owner-scoped, bitemporal, depth-bounded traversal request. */
|
|
41
|
+
export type TraversalQuery = {
|
|
42
|
+
/** Entity identifier to start from (matched against edge `from`). */
|
|
43
|
+
seed: string;
|
|
44
|
+
ownerKey: string;
|
|
45
|
+
/** Reference instant (epoch ms) for bitemporal activity. */
|
|
46
|
+
asOf: number;
|
|
47
|
+
/** Maximum hop distance; `0` returns only the seed. */
|
|
48
|
+
maxDepth: number;
|
|
49
|
+
/** Include the shared sentinel owner. Defaults to `true`, like recall. */
|
|
50
|
+
includeShared?: boolean;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Walks the relation-edge graph from `query.seed` up to `query.maxDepth` hops,
|
|
54
|
+
* returning the reachable nodes (including the seed at depth 0) and the edges
|
|
55
|
+
* used to reach them. Only owner-scoped, bitemporally active edges participate.
|
|
56
|
+
*/
|
|
57
|
+
export declare function traverseRelations(records: readonly MemoryRecord[], query: TraversalQuery): TraversalResult;
|
|
58
|
+
/** Extra knobs for the graph-aware wrapper around vector recall. */
|
|
59
|
+
export type GraphRecallOptions = {
|
|
60
|
+
maxDepth: number;
|
|
61
|
+
includeShared?: boolean;
|
|
62
|
+
};
|
|
63
|
+
/** A traversal anchored on one recalled seed record. */
|
|
64
|
+
export type GraphSeedTraversal = {
|
|
65
|
+
seedRecordId: string;
|
|
66
|
+
traversal: TraversalResult;
|
|
67
|
+
};
|
|
68
|
+
/** Vector recall plus the sub-graph reachable from each graph-bearing seed. */
|
|
69
|
+
export type GraphRecallResult = {
|
|
70
|
+
recall: RecallResult[];
|
|
71
|
+
traversals: GraphSeedTraversal[];
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Wraps `recall`: runs the unchanged vector pipeline to pick seeds, then walks
|
|
75
|
+
* the relation graph from each seed that names a node (entities and relations).
|
|
76
|
+
* The `recall` field is exactly what `recall(...)` returns today, so existing
|
|
77
|
+
* non-graph callers are unaffected; `traversals` is the additive layer.
|
|
78
|
+
*/
|
|
79
|
+
export declare function recallGraph(records: readonly MemoryRecord[], queryEmbedding: Embedding, query: RecallQuery, options: GraphRecallOptions, deps: RecallDeps): GraphRecallResult;
|
|
80
|
+
//# sourceMappingURL=traverse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../src/memory/traverse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAU,MAAM,UAAU,CAAC;AAEnD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,EAGlB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;GAkBG;AAEH,+EAA+E;AAC/E,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,4EAA4E;AAC5E,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,gDAAgD;AAChD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB,CAAC;AAEF,iEAAiE;AACjE,MAAM,MAAM,cAAc,GAAG;IAC3B,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAcF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,KAAK,EAAE,cAAc,GACpB,eAAe,CAmDjB;AAWD,oEAAoE;AACpE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,wDAAwD;AACxD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,eAAe,CAAC;CAC5B,CAAC;AAEF,+EAA+E;AAC/E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,UAAU,EAAE,kBAAkB,EAAE,CAAC;CAClC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,cAAc,EAAE,SAAS,EACzB,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,UAAU,GACf,iBAAiB,CAsBnB"}
|
package/dist/memory/types.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare const FactSchema: z.ZodObject<{
|
|
|
45
45
|
predicate: z.ZodString;
|
|
46
46
|
object: z.ZodString;
|
|
47
47
|
category: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
48
|
-
}, z.core.$
|
|
48
|
+
}, z.core.$strict>;
|
|
49
49
|
/** Preferencia del usuario/proyecto en una categoría. */
|
|
50
50
|
export declare const PreferenceSchema: z.ZodObject<{
|
|
51
51
|
id: z.ZodString;
|
|
@@ -63,7 +63,7 @@ export declare const PreferenceSchema: z.ZodObject<{
|
|
|
63
63
|
context: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
64
64
|
lastAccessedAt: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
65
65
|
accessCount: z.ZodDefault<z.ZodNumber>;
|
|
66
|
-
}, z.core.$
|
|
66
|
+
}, z.core.$strict>;
|
|
67
67
|
/** Entidad canónica (persona/objeto/lugar/evento/organización). */
|
|
68
68
|
export declare const EntitySchema: z.ZodObject<{
|
|
69
69
|
id: z.ZodString;
|
|
@@ -79,7 +79,37 @@ export declare const EntitySchema: z.ZodObject<{
|
|
|
79
79
|
canonicalName: z.ZodString;
|
|
80
80
|
type: z.ZodString;
|
|
81
81
|
aliases: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
82
|
-
}, z.core.$
|
|
82
|
+
}, z.core.$strict>;
|
|
83
|
+
/**
|
|
84
|
+
* First-class typed relation edge between two entity endpoints (W5). A relation
|
|
85
|
+
* is the edge analogue of a `fact`: `from`/`to`/`predicate` are structural
|
|
86
|
+
* identifiers (entity canonicalNames + a typed label) that survive ADR-5
|
|
87
|
+
* redaction exactly like a fact's `subject`/`predicate`, while the optional
|
|
88
|
+
* free-text `annotation` is the only value redacted when `storeContent=false`.
|
|
89
|
+
* No raw prompt text is ever stored — the transcript only becomes `sourceHash`.
|
|
90
|
+
*
|
|
91
|
+
* decision/component are entity `type` values (see `EntitySchema.type`), not new
|
|
92
|
+
* memory kinds, so the graph is a set of entities connected by these edges. The
|
|
93
|
+
* relation inherits the full bitemporal + provenance base, so an edge can be
|
|
94
|
+
* invalidated (consolidation tombstone) or superseded (a newer edge in the same
|
|
95
|
+
* `{from, predicate, owner}` slot) just like a fact.
|
|
96
|
+
*/
|
|
97
|
+
export declare const RelationSchema: z.ZodObject<{
|
|
98
|
+
id: z.ZodString;
|
|
99
|
+
ownerKey: z.ZodString;
|
|
100
|
+
confidence: z.ZodNumber;
|
|
101
|
+
validFrom: z.ZodNumber;
|
|
102
|
+
validUntil: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
103
|
+
createdAt: z.ZodNumber;
|
|
104
|
+
invalidatedAt: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
105
|
+
sourceHash: z.ZodString;
|
|
106
|
+
supersededBy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
107
|
+
kind: z.ZodLiteral<"relation">;
|
|
108
|
+
from: z.ZodString;
|
|
109
|
+
to: z.ZodString;
|
|
110
|
+
predicate: z.ZodString;
|
|
111
|
+
annotation: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
112
|
+
}, z.core.$strict>;
|
|
83
113
|
export declare const MemoryRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
84
114
|
id: z.ZodString;
|
|
85
115
|
ownerKey: z.ZodString;
|
|
@@ -95,7 +125,7 @@ export declare const MemoryRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
95
125
|
predicate: z.ZodString;
|
|
96
126
|
object: z.ZodString;
|
|
97
127
|
category: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
98
|
-
}, z.core.$
|
|
128
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
99
129
|
id: z.ZodString;
|
|
100
130
|
ownerKey: z.ZodString;
|
|
101
131
|
confidence: z.ZodNumber;
|
|
@@ -111,7 +141,7 @@ export declare const MemoryRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
111
141
|
context: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
112
142
|
lastAccessedAt: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
113
143
|
accessCount: z.ZodDefault<z.ZodNumber>;
|
|
114
|
-
}, z.core.$
|
|
144
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
115
145
|
id: z.ZodString;
|
|
116
146
|
ownerKey: z.ZodString;
|
|
117
147
|
confidence: z.ZodNumber;
|
|
@@ -125,7 +155,22 @@ export declare const MemoryRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
125
155
|
canonicalName: z.ZodString;
|
|
126
156
|
type: z.ZodString;
|
|
127
157
|
aliases: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
128
|
-
}, z.core.$
|
|
158
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
159
|
+
id: z.ZodString;
|
|
160
|
+
ownerKey: z.ZodString;
|
|
161
|
+
confidence: z.ZodNumber;
|
|
162
|
+
validFrom: z.ZodNumber;
|
|
163
|
+
validUntil: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
164
|
+
createdAt: z.ZodNumber;
|
|
165
|
+
invalidatedAt: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
166
|
+
sourceHash: z.ZodString;
|
|
167
|
+
supersededBy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
168
|
+
kind: z.ZodLiteral<"relation">;
|
|
169
|
+
from: z.ZodString;
|
|
170
|
+
to: z.ZodString;
|
|
171
|
+
predicate: z.ZodString;
|
|
172
|
+
annotation: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
173
|
+
}, z.core.$strict>], "kind">;
|
|
129
174
|
/** Consulta de recall (dueño-scoped, temporal y semántica). */
|
|
130
175
|
export declare const RecallQuerySchema: z.ZodObject<{
|
|
131
176
|
ownerKey: z.ZodString;
|
|
@@ -138,11 +183,12 @@ export declare const RecallQuerySchema: z.ZodObject<{
|
|
|
138
183
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
139
184
|
minSimilarity: z.ZodDefault<z.ZodNumber>;
|
|
140
185
|
includeShared: z.ZodDefault<z.ZodBoolean>;
|
|
141
|
-
}, z.core.$
|
|
186
|
+
}, z.core.$strict>;
|
|
142
187
|
export type MemoryKind = z.infer<typeof MemoryKindSchema>;
|
|
143
188
|
export type Fact = z.infer<typeof FactSchema>;
|
|
144
189
|
export type Preference = z.infer<typeof PreferenceSchema>;
|
|
145
190
|
export type Entity = z.infer<typeof EntitySchema>;
|
|
191
|
+
export type Relation = z.infer<typeof RelationSchema>;
|
|
146
192
|
export type MemoryRecord = z.infer<typeof MemoryRecordSchema>;
|
|
147
193
|
export type RecallQuery = z.infer<typeof RecallQuerySchema>;
|
|
148
194
|
/** Vector de embedding (dimensiones configurables). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/memory/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB,EAAG,CAAU,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAG,GAAY,CAAC;AAE7C,eAAO,MAAM,cAAc,aAAoB,CAAC;AAEhD,eAAO,MAAM,gBAAgB;;;;EAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/memory/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB,EAAG,CAAU,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAG,GAAY,CAAC;AAE7C,eAAO,MAAM,cAAc,aAAoB,CAAC;AAEhD,eAAO,MAAM,gBAAgB;;;;EAA2C,CAAC;AAmBzE,6EAA6E;AAC7E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;kBAMrB,CAAC;AAEH,yDAAyD;AACzD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;kBAO3B,CAAC;AAEH,mEAAmE;AACnE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;kBAKvB,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;kBAMzB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAK7B,CAAC;AAEH,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB;;;;;;;;;;;kBAUnB,CAAC;AAEZ,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAClD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,uDAAuD;AACvD,MAAM,MAAM,SAAS,GAAG,SAAS,MAAM,EAAE,CAAC;AAE1C,yDAAyD;AACzD,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,kEAAkE;AAClE,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG;IAC3C,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User-facing message catalog for the `openteam` CLI command surface.
|
|
3
|
+
*
|
|
4
|
+
* Part of the `src/messages/**` boundary (see `./index.ts` for the full design
|
|
5
|
+
* decision). This file holds the English strings rendered by individual
|
|
6
|
+
* `src/commands/*` handlers, grouped one exported object per command, so a
|
|
7
|
+
* future translation edits one place instead of grepping call sites.
|
|
8
|
+
*
|
|
9
|
+
* Pure: data plus deterministic string builders only. No I/O, filesystem,
|
|
10
|
+
* network, clock, randomness, env vars, or logging. Static text is a typed
|
|
11
|
+
* constant; parameterised text is a small pure function returning `string`.
|
|
12
|
+
* Layout concerns (column widths, `padEnd` alignment) stay in the command
|
|
13
|
+
* handlers — only the human-readable text lives here.
|
|
14
|
+
*/
|
|
15
|
+
/** Messages for `openteam clear-cache`. */
|
|
16
|
+
export declare const clearCacheMessages: {
|
|
17
|
+
readonly header: "openteam clear-cache — frozen plugin cache entries:";
|
|
18
|
+
readonly columns: {
|
|
19
|
+
readonly specDir: "spec dir";
|
|
20
|
+
readonly pinned: "spec-pinned";
|
|
21
|
+
readonly installed: "installed";
|
|
22
|
+
readonly mtime: "mtime";
|
|
23
|
+
};
|
|
24
|
+
readonly reparseSkipSuffix: " [SKIP — reparse point]";
|
|
25
|
+
readonly deletedLabel: "deleted.";
|
|
26
|
+
readonly lockedLabel: (message: string) => string;
|
|
27
|
+
readonly pathOutsideWarning: (specDir: string, absolutePath: string) => string;
|
|
28
|
+
readonly processed: (count: number) => string;
|
|
29
|
+
readonly found: (count: number) => string;
|
|
30
|
+
};
|
|
31
|
+
/** Messages for `openteam baseline`. */
|
|
32
|
+
export declare const baselineMessages: {
|
|
33
|
+
readonly effectiveAuto: "cheapest-capable (auto)";
|
|
34
|
+
readonly pinnedSuffix: (ref: string) => string;
|
|
35
|
+
readonly summary: (params: {
|
|
36
|
+
mode: string;
|
|
37
|
+
pinned: string;
|
|
38
|
+
hardDefault: string;
|
|
39
|
+
effective: string;
|
|
40
|
+
}) => string[];
|
|
41
|
+
readonly invalidModel: (input: string) => string;
|
|
42
|
+
readonly pinnedTo: (ref: string) => string;
|
|
43
|
+
readonly autoMode: "Baseline set to auto mode (cheapest-capable).";
|
|
44
|
+
};
|
|
45
|
+
/** Messages for `openteam local`. */
|
|
46
|
+
export declare const localMessages: {
|
|
47
|
+
readonly noRuntimes: "none";
|
|
48
|
+
readonly modeFrontierOnly: "frontier-only (frontierOnly)";
|
|
49
|
+
readonly modeLocalFirst: "local-first";
|
|
50
|
+
readonly summary: (params: {
|
|
51
|
+
mode: string;
|
|
52
|
+
frontierOnly: boolean;
|
|
53
|
+
privacy: string;
|
|
54
|
+
runtimes: string;
|
|
55
|
+
}) => string[];
|
|
56
|
+
readonly frontierOnlyNoChange: "No change: already in frontier-only mode.";
|
|
57
|
+
readonly privacyAdjustedNote: " Privacy adjusted to 'consentBeforeFrontier' (forceLocalOnSensitive requires a local runtime).";
|
|
58
|
+
readonly frontierOnlyEnabled: "Frontier-only mode enabled (frontierOnly=true).";
|
|
59
|
+
readonly localFirstNoChange: "No change: local-first routing is already active.";
|
|
60
|
+
readonly localFirstReEnabled: "Local-first routing re-enabled (frontierOnly=false). Make sure a local runtime is reachable.";
|
|
61
|
+
};
|
|
62
|
+
/** Messages for the frontier catalog rendered during `init`. */
|
|
63
|
+
export declare const frontierCatalogMessages: {
|
|
64
|
+
readonly free: "free";
|
|
65
|
+
readonly costPerMillion: (inputUSD: number, outputUSD: number) => string;
|
|
66
|
+
};
|
|
67
|
+
/** Messages for `openteam migrate`. */
|
|
68
|
+
export declare const migrateMessages: {
|
|
69
|
+
readonly header: "openteam migrate:";
|
|
70
|
+
readonly nothingToMigrate: " nothing to migrate — the P15b layout is already in place.";
|
|
71
|
+
readonly counts: (params: {
|
|
72
|
+
moved: number;
|
|
73
|
+
deduped: number;
|
|
74
|
+
conflicts: number;
|
|
75
|
+
}) => string[];
|
|
76
|
+
readonly relocatedHeader: " relocated:";
|
|
77
|
+
readonly relocatedEntry: (from: string, to: string, deduped: boolean) => string;
|
|
78
|
+
readonly conflictsHeader: " ⚠ left in place (destination exists with different content — no data lost):";
|
|
79
|
+
readonly conflictEntry: (from: string, to: string) => string;
|
|
80
|
+
readonly manualWorktreesHeader: " ⚠ legacy git worktree(s) need a manual move (run `git worktree move`):";
|
|
81
|
+
readonly manualWorktreeEntry: (label: string, from: string, to: string) => string;
|
|
82
|
+
readonly success: " ✓ machine-local runtime output relocated under .opencode/openteam-local/.";
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/messages/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,2CAA2C;AAC3C,eAAO,MAAM,kBAAkB;aAC7B,MAAM,EAAE,qDAAqD;aAC7D,OAAO;iBACL,OAAO,EAAE,UAAU;iBACnB,MAAM,EAAE,aAAa;iBACrB,SAAS,EAAE,WAAW;iBACtB,KAAK,EAAE,OAAO;;aAEhB,iBAAiB,EAAE,0BAA0B;aAC7C,YAAY,EAAE,UAAU;aACxB,WAAW,YAAY,MAAM,KAAG,MAAM;aACtC,kBAAkB,YAAY,MAAM,gBAAgB,MAAM,KAAG,MAAM;aAEnE,SAAS,UAAU,MAAM,KAAG,MAAM;aAClC,KAAK,UAAU,MAAM,KAAG,MAAM;CAEtB,CAAC;AAEX,wCAAwC;AACxC,eAAO,MAAM,gBAAgB;aAC3B,aAAa,EAAE,yBAAyB;aACxC,YAAY,QAAQ,MAAM,KAAG,MAAM;aACnC,OAAO,WAAW;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;KACnB,KAAG,MAAM,EAAE;aAOZ,YAAY,UAAU,MAAM,KAAG,MAAM;aAErC,QAAQ,QAAQ,MAAM,KAAG,MAAM;aAC/B,QAAQ,EAAE,+CAA+C;CACjD,CAAC;AAEX,qCAAqC;AACrC,eAAO,MAAM,aAAa;aACxB,UAAU,EAAE,MAAM;aAClB,gBAAgB,EAAE,8BAA8B;aAChD,cAAc,EAAE,aAAa;aAC7B,OAAO,WAAW;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,OAAO,CAAC;QACtB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;KAClB,KAAG,MAAM,EAAE;aAOZ,oBAAoB,EAAE,2CAA2C;aACjE,mBAAmB,EACjB,gGAAgG;aAClG,mBAAmB,EAAE,iDAAiD;aACtE,kBAAkB,EAAE,mDAAmD;aACvE,mBAAmB,EACjB,8FAA8F;CACxF,CAAC;AAEX,gEAAgE;AAChE,eAAO,MAAM,uBAAuB;aAClC,IAAI,EAAE,MAAM;aACZ,cAAc,aAAa,MAAM,aAAa,MAAM,KAAG,MAAM;CAErD,CAAC;AAEX,uCAAuC;AACvC,eAAO,MAAM,eAAe;aAC1B,MAAM,EAAE,mBAAmB;aAC3B,gBAAgB,EACd,6DAA6D;aAC/D,MAAM,WAAW;QACf,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,KAAG,MAAM,EAAE;aAKZ,eAAe,EAAE,cAAc;aAC/B,cAAc,SAAS,MAAM,MAAM,MAAM,WAAW,OAAO,KAAG,MAAM;aAEpE,eAAe,EACb,+EAA+E;aACjF,aAAa,SAAS,MAAM,MAAM,MAAM,KAAG,MAAM;aACjD,qBAAqB,EACnB,0EAA0E;aAC5E,mBAAmB,UAAU,MAAM,QAAQ,MAAM,MAAM,MAAM,KAAG,MAAM;aAEtE,OAAO,EACL,6EAA6E;CACvE,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `src/messages/**` — the openteam user-facing message catalog.
|
|
3
|
+
*
|
|
4
|
+
* ## What this boundary is
|
|
5
|
+
* A **pure**, **single-locale (English)** catalog of every string a user reads:
|
|
6
|
+
* CLI stdout/stderr text, section headings, warnings, hints, wizard prompts and
|
|
7
|
+
* labels, and human-readable error text. Static text is an exported typed
|
|
8
|
+
* constant; parameterised text is a small exported pure function returning
|
|
9
|
+
* `string`. It is data + pure string functions only.
|
|
10
|
+
*
|
|
11
|
+
* ## Purity contract
|
|
12
|
+
* Like `src/router/**`, this boundary has **no I/O, filesystem, network, clock,
|
|
13
|
+
* randomness, env vars, or logging**. Handlers keep their layout logic (column
|
|
14
|
+
* widths, `padEnd` alignment, `\n` joins); the catalog owns only the text. This
|
|
15
|
+
* keeps the catalog deterministic and trivially testable, and lets the coverage
|
|
16
|
+
* gate hold it to 100% the same way it holds `src/router/**`.
|
|
17
|
+
*
|
|
18
|
+
* ## Why a catalog (the design decision)
|
|
19
|
+
* Centralising user-facing text is what makes the *next* translation cheap: one
|
|
20
|
+
* place to swap, instead of grepping ~1000 literals across the tree. Extraction
|
|
21
|
+
* is deliberately **opportunistic and incremental** (see issue #145), never a
|
|
22
|
+
* big-bang sweep — a mechanical 100+ file diff hides accidental code changes and
|
|
23
|
+
* cannot be reviewed. Files are migrated a safe slice at a time, preserving
|
|
24
|
+
* byte-identical output.
|
|
25
|
+
*
|
|
26
|
+
* ## Single-locale on purpose — no i18n runtime
|
|
27
|
+
* There is **exactly one locale (English) today**. The shape (typed constants +
|
|
28
|
+
* pure functions behind a stable export surface) means a second locale *could*
|
|
29
|
+
* be added later by swapping the catalog implementation without touching call
|
|
30
|
+
* sites. But we deliberately **do not** build an i18n runtime, locale loader,
|
|
31
|
+
* `Intl` plumbing, or any non-English resources now: that would be unused,
|
|
32
|
+
* speculative complexity. Add the machinery only when a real second locale
|
|
33
|
+
* lands.
|
|
34
|
+
*
|
|
35
|
+
* ## What counts as a "message"
|
|
36
|
+
* In the catalog: CLI stdout/stderr text, section headings, warnings, hints,
|
|
37
|
+
* human-readable error text, wizard prompts and labels.
|
|
38
|
+
*
|
|
39
|
+
* Deliberately **not** in the catalog (left where they are): object keys, ids,
|
|
40
|
+
* enum/discriminant values, file paths, URLs, protocol/JSON field names, SQL,
|
|
41
|
+
* CSS/HTML attribute names, provider/model identifiers, and anything only ever
|
|
42
|
+
* compared programmatically. Over-extraction buries real text in noise and is as
|
|
43
|
+
* harmful as under-extraction, so the boundary is kept strict.
|
|
44
|
+
*/
|
|
45
|
+
export * from "./commands";
|
|
46
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `src/opencodeArtifacts/**` — generated `.opencode/**` artifact content.
|
|
3
|
+
*
|
|
4
|
+
* This boundary holds the builders and path constants for the files that
|
|
5
|
+
* `openteam setup` writes into a project's `.opencode/**` tree:
|
|
6
|
+
* - `orchestratorAgent.ts` → `.opencode/agent/openteam.md` (the orchestrator
|
|
7
|
+
* agent's system-prompt / instructions Markdown), and
|
|
8
|
+
* - `slashCommand.ts` → `.opencode/command/*.md` (slash-command definitions).
|
|
9
|
+
*
|
|
10
|
+
* ## Why this is its own boundary (read before moving anything here)
|
|
11
|
+
* The string literals in these modules are **model-/opencode-facing prose** — an
|
|
12
|
+
* LLM system prompt and opencode command definitions — NOT user-facing CLI
|
|
13
|
+
* output. They are therefore deliberately:
|
|
14
|
+
*
|
|
15
|
+
* 1. **NOT part of the `src/messages/**` user-message catalog.** Extracting this
|
|
16
|
+
* prose into the catalog and translating it as if it were UI text would
|
|
17
|
+
* corrupt the convention: an LLM system prompt is content, not a translatable
|
|
18
|
+
* interface string.
|
|
19
|
+
* 2. **Outside the `messages-catalog-ratchet` gate's scope BY CONSTRUCTION.** That
|
|
20
|
+
* gate scopes `src/commands/**` + `src/console/**`. These templates once lived
|
|
21
|
+
* under `src/commands/` and were kept green only by a per-file `ARTIFACT`
|
|
22
|
+
* allowlist — an unguarded laundering channel that would have let a real
|
|
23
|
+
* CLI-message file be silenced just by listing it. Moving them into their own
|
|
24
|
+
* boundary removes them from the gated scope structurally, so the gate is now
|
|
25
|
+
* a clean two-list ratchet (MIGRATED + LEGACY) with no allowlist to append to.
|
|
26
|
+
*
|
|
27
|
+
* These files are not CLI commands. They only ever emit `.opencode/**` file
|
|
28
|
+
* content and produce no CLI stdout/stderr of their own. New generated-artifact
|
|
29
|
+
* builders belong here; a file that prints to the user does not.
|
|
30
|
+
*/
|
|
31
|
+
export { buildOrchestratorAgent, OPENTEAM_ROSTER_PATH, ORCHESTRATOR_AGENT_PATH, } from "./orchestratorAgent";
|
|
32
|
+
export { buildOpenteamCommand, buildOpenteamCommands, OPENTEAM_COMMAND_DIR, type SlashCommandFile, } from "./slashCommand";
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/opencodeArtifacts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FrontierChoice } from "../commands/setup";
|
|
2
|
+
/**
|
|
3
|
+
* Relative path (from cwd) to the primary agent that `openteam setup` generates. The
|
|
4
|
+
* filename (`openteam`) is the agent name in opencode.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ORCHESTRATOR_AGENT_PATH = ".opencode/agent/openteam.md";
|
|
7
|
+
/**
|
|
8
|
+
* Path to the casting registry (universe + name→role→model table). Lives
|
|
9
|
+
* **outside** `.opencode/agent/` intentionally: opencode loads as an agent every
|
|
10
|
+
* `.md` in that folder, so a stray roster markdown file inside would appear as a
|
|
11
|
+
* phantom agent in the Tab-switcher. It is portable team-state (P15b), so it lives
|
|
12
|
+
* in the git-tracked `.opencode/openteam/` directory alongside the decisions log.
|
|
13
|
+
*/
|
|
14
|
+
export declare const OPENTEAM_ROSTER_PATH = ".opencode/openteam/roster.md";
|
|
15
|
+
/**
|
|
16
|
+
* Builds the Markdown for the `openteam` primary agent (multi-agent orchestrator):
|
|
17
|
+
* an orchestrator that appears in the Tab-switcher, chooses a thematic universe,
|
|
18
|
+
* casts the team, and creates subagents on demand (including the standard roles
|
|
19
|
+
* scribe, ralph and guardian). Pure: no I/O.
|
|
20
|
+
*
|
|
21
|
+
* `frontier` sets the orchestrator's `model` (baseline cheapest-capable), a
|
|
22
|
+
* real and resolvable `provider/model`; the openteam plugin continues routing per
|
|
23
|
+
* message, so subagents it creates can inherit the default and be
|
|
24
|
+
* routed local-first.
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildOrchestratorAgent(frontier: FrontierChoice, options?: {
|
|
27
|
+
yolo?: boolean;
|
|
28
|
+
}): string;
|
|
29
|
+
//# sourceMappingURL=orchestratorAgent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestratorAgent.d.ts","sourceRoot":"","sources":["../../src/opencodeArtifacts/orchestratorAgent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,iCAAiC,CAAC;AAInE;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,cAAc,EACxB,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,MAAM,CAiOR"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Directory (relative to cwd) where opencode discovers the project's slash commands.
|
|
3
|
+
* opencode scans `{command,commands}/**\/*.md` (singular and plural) in
|
|
4
|
+
* each `.opencode/` in the tree and in `~/.config/opencode/`; the filename
|
|
5
|
+
* is the command name (verified in the opencode v1.17.8 source:
|
|
6
|
+
* `packages/opencode/src/config/command.ts`).
|
|
7
|
+
*/
|
|
8
|
+
export declare const OPENTEAM_COMMAND_DIR = ".opencode/command";
|
|
9
|
+
export type SlashCommandFile = {
|
|
10
|
+
/** Command name (file `<name>.md`), invocable as `/<name>`. */
|
|
11
|
+
name: string;
|
|
12
|
+
path: string;
|
|
13
|
+
/** Markdown content (frontmatter + template). */
|
|
14
|
+
contents: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Builds the Markdown for the `/openteam` slash command (catch-all). Teaches the
|
|
18
|
+
* agent to map user arguments to a single `openteam` tool call. Must stay
|
|
19
|
+
* aligned with the actions of `commandArgv` in `src/plugin/commandTool.ts`.
|
|
20
|
+
* Pure/deterministic: no I/O.
|
|
21
|
+
*/
|
|
22
|
+
export declare function buildOpenteamCommand(): string;
|
|
23
|
+
/**
|
|
24
|
+
* All slash commands that `openteam setup` writes to
|
|
25
|
+
* `.opencode/command/`. In addition to the catch-all `/openteam`, generates a flat
|
|
26
|
+
* command per action (`/openteam-doctor`, `/openteam-agents`, …) so that all
|
|
27
|
+
* appear and autocomplete in opencode's command palette when typing `/openteam`.
|
|
28
|
+
* Pure/deterministic: no I/O.
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildOpenteamCommands(): SlashCommandFile[];
|
|
31
|
+
//# sourceMappingURL=slashCommand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slashCommand.d.ts","sourceRoot":"","sources":["../../src/opencodeArtifacts/slashCommand.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AAExD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAkBF;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAoB7C;AAqBD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,IAAI,gBAAgB,EAAE,CAmD1D"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import type { BudgetState } from "../capabilities/budget";
|
|
2
3
|
import type { ModelCapabilityProfile } from "../capabilities/types";
|
|
3
4
|
import type { OpenTeamConfig } from "../config/schema";
|
|
5
|
+
import type { RuntimeConcurrencyLimiter } from "../local/concurrency";
|
|
6
|
+
import type { LocalRuntimeId } from "../local/types";
|
|
4
7
|
import type { AvailableModel, RoutingDecision, TaskSignals } from "../router/types";
|
|
5
8
|
import { type EventSink } from "../telemetry/eventLog";
|
|
6
9
|
import { type MeetingEvent, type RouteEvent } from "../telemetry/events";
|
|
7
10
|
import type { CostRecord } from "../telemetry/types";
|
|
11
|
+
import { type AgentRoleProfile } from "./roles";
|
|
8
12
|
import { type OpencodeSessionClient, type SubsessionResult } from "./subsessions";
|
|
9
13
|
export type RoleTaskInput = {
|
|
10
14
|
roleID: string;
|
|
@@ -18,6 +22,14 @@ export type RoleTaskInput = {
|
|
|
18
22
|
title?: string;
|
|
19
23
|
systemPrompt?: string;
|
|
20
24
|
directory?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Dispatch alias override for the roleID/agentName split (#172, W3-S02). When a
|
|
27
|
+
* roster themes a role (e.g. roleID `scribe` → agentName `gandalf`), routing
|
|
28
|
+
* still keys on `roleID` but opencode must dispatch to the themed `agentName`.
|
|
29
|
+
* When set, it wins over the role profile's `opencodeAgent`; when absent, the
|
|
30
|
+
* profile's `opencodeAgent` is used exactly as before.
|
|
31
|
+
*/
|
|
32
|
+
agentOverride?: string;
|
|
21
33
|
/** Correlación opcional con una tarea del loop SDD/backlog (Fase D). */
|
|
22
34
|
taskID?: string;
|
|
23
35
|
/** Role IDs this task depends on. Dependents only run after dependencies succeed. */
|
|
@@ -29,6 +41,58 @@ export type CoordinatorDeps = {
|
|
|
29
41
|
now: () => number;
|
|
30
42
|
newDecisionID: () => string;
|
|
31
43
|
timeoutMs?: number;
|
|
44
|
+
/** Optional warn sink; defaults to `console.warn`. Injectable for tests. */
|
|
45
|
+
warn?: (message?: unknown) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Caller-owned Set for once-per-roleID dedup of `warnUnknownRole`. Production
|
|
48
|
+
* callers pass a long-lived Set (one per plugin instance) so the warning is
|
|
49
|
+
* emitted at most once per session. Test callers pass `new Set()` per case
|
|
50
|
+
* for full isolation. When absent, every call to `warnUnknownRole` emits.
|
|
51
|
+
*/
|
|
52
|
+
warnedRoles?: Set<string>;
|
|
53
|
+
/**
|
|
54
|
+
* Reachability probe for local runtimes (#143). A REQUIRED injected I/O port —
|
|
55
|
+
* probing lives in `src/local/**`; the coordinator receives only the boolean
|
|
56
|
+
* result, so this module stays I/O-free. Consulted ONLY for roles that carry
|
|
57
|
+
* `requiresLocalRuntime === true`; returns true when at least one local runtime
|
|
58
|
+
* is reachable, treating a configured-but-unreachable runtime as absent.
|
|
59
|
+
*
|
|
60
|
+
* Deliberately required, with NO fallback. A prohibition must never fail open:
|
|
61
|
+
* an enabled-but-unreachable runtime (e.g. a stopped daemon) is the very case
|
|
62
|
+
* #143 exists to catch, and an `enabled`-flag fallback would pass the gate for
|
|
63
|
+
* it. Making the port mandatory also turns a missing composition-root wiring
|
|
64
|
+
* into a compile error, so the gate cannot be silently bypassed by dropping the
|
|
65
|
+
* injection.
|
|
66
|
+
*/
|
|
67
|
+
localRuntimeReachable: () => boolean | Promise<boolean>;
|
|
68
|
+
/**
|
|
69
|
+
* Optional per-runtime reachability probe (#144). Returns the set of local
|
|
70
|
+
* runtime ids currently reachable, so the dispatcher can fail over across the
|
|
71
|
+
* ordered list a role declares (`localRuntimes`): an unreachable runtime is
|
|
72
|
+
* absent from the set and is skipped in favour of the next listed one.
|
|
73
|
+
*
|
|
74
|
+
* Injected I/O port, like `localRuntimeReachable` — probing lives in
|
|
75
|
+
* `src/local/**`. Optional so existing callers (and the many test construction
|
|
76
|
+
* sites) need no change and keep the pre-#144 boolean-only behaviour; when it
|
|
77
|
+
* is absent the coordinator falls back to `localRuntimeReachable` and roles
|
|
78
|
+
* without a list are unaffected. When present alongside a role that declares a
|
|
79
|
+
* list, it is the single probe consulted for the batch, and `any reachable` is
|
|
80
|
+
* derived from it — the two ports are never both probed for one batch.
|
|
81
|
+
*/
|
|
82
|
+
reachableRuntimeIds?: () => ReadonlySet<LocalRuntimeId> | Promise<ReadonlySet<LocalRuntimeId>>;
|
|
83
|
+
/**
|
|
84
|
+
* Optional per-runtime concurrency limiter (#144). Caps concurrent generations
|
|
85
|
+
* per runtime to its configured slot count and QUEUES excess work rather than
|
|
86
|
+
* dropping it or spilling it to another runtime. Optional so existing callers
|
|
87
|
+
* need no change; when absent, no cap is enforced (pre-#144 behaviour).
|
|
88
|
+
*
|
|
89
|
+
* The coordinator takes a slot with the synchronous `tryAcquire` on the happy
|
|
90
|
+
* path — adding no `await` before dispatch, so concurrent telemetry emission
|
|
91
|
+
* order within a wave is unperturbed — and only awaits `acquire` when the
|
|
92
|
+
* runtime is saturated. A task holds its slot for the whole subsession and is
|
|
93
|
+
* released in a `finally`, so it stays pinned to its runtime for its duration.
|
|
94
|
+
*/
|
|
95
|
+
runtimeLimiter?: RuntimeConcurrencyLimiter;
|
|
32
96
|
};
|
|
33
97
|
export type CorrelatedCostRecord = CostRecord & {
|
|
34
98
|
decisionID: string;
|
|
@@ -44,6 +108,51 @@ export type RoleTaskResult = {
|
|
|
44
108
|
subsession: SubsessionResult;
|
|
45
109
|
record: CorrelatedCostRecord;
|
|
46
110
|
};
|
|
111
|
+
/**
|
|
112
|
+
* Emits an observable warning the first time an unknown roleID is encountered
|
|
113
|
+
* within a given `warnedRoles` Set. Callers own the Set and its lifetime:
|
|
114
|
+
* production callers pass a long-lived Set (no repeat logs); test callers pass
|
|
115
|
+
* a fresh `new Set()` per case (full isolation). When `warnedRoles` is not
|
|
116
|
+
* provided the warning is emitted unconditionally on every call.
|
|
117
|
+
*
|
|
118
|
+
* Follows the `warn*` convention used throughout the codebase
|
|
119
|
+
* (see `warnInertPrivacySetting`, `warnCostRecordRejections`).
|
|
120
|
+
*/
|
|
121
|
+
export declare function warnUnknownRole(roleID: string, warn?: (message?: unknown) => void, warnedRoles?: Set<string>): void;
|
|
122
|
+
/**
|
|
123
|
+
* Actionable, English pre-dispatch failure for a role that requires a local
|
|
124
|
+
* runtime when none is reachable (#143). Names the role, states the hard
|
|
125
|
+
* requirement, lists the three supported local runtimes a user typically forgot
|
|
126
|
+
* to start, and points at `openteam doctor`. Deliberately not a generic provider
|
|
127
|
+
* error: a forgotten daemon is the overwhelmingly likely cause.
|
|
128
|
+
*/
|
|
129
|
+
export declare function mandatoryLocalRuntimeMessage(roleID: string): string;
|
|
130
|
+
/**
|
|
131
|
+
* Enforces the mandatory-local requirement (#143) BEFORE any model dispatch.
|
|
132
|
+
* For a role with `requiresLocalRuntime === true`, refuses the request when no
|
|
133
|
+
* local runtime is reachable — it never falls through to frontier. This does not
|
|
134
|
+
* overturn the 2026-08-26 fallback ruling: that ruling preserves explicit
|
|
135
|
+
* prohibitions, and this is one such prohibition, carried per role.
|
|
136
|
+
*
|
|
137
|
+
* Reachability is resolved ONCE per batch by `resolveLocalRuntimeReachable` and
|
|
138
|
+
* passed in as data, so this check is synchronous and adds no `await` inside a
|
|
139
|
+
* concurrent wave (telemetry emission order is unperturbed). There is
|
|
140
|
+
* deliberately no fallback: a prohibition must fail closed, so anything other
|
|
141
|
+
* than an explicit `true` refuses the request.
|
|
142
|
+
*/
|
|
143
|
+
export declare function assertLocalRuntimeForRole(role: AgentRoleProfile, roleID: string, reachable: boolean | undefined): void;
|
|
144
|
+
/**
|
|
145
|
+
* Reachability resolved once for a batch (#143/#144). `any` is whether at least
|
|
146
|
+
* one local runtime is reachable (the #143 boolean signal); `set`, when present,
|
|
147
|
+
* is the per-runtime reachability used to fail over across a role's ordered list
|
|
148
|
+
* and to select which runtime a task pins to. `set` is `undefined` when the
|
|
149
|
+
* per-runtime port is not wired or the batch has no role that declares a list —
|
|
150
|
+
* in which case only the boolean path is used, preserving pre-#144 behaviour.
|
|
151
|
+
*/
|
|
152
|
+
export type BatchReachability = {
|
|
153
|
+
readonly any: boolean | undefined;
|
|
154
|
+
readonly set: ReadonlySet<LocalRuntimeId> | undefined;
|
|
155
|
+
};
|
|
47
156
|
/**
|
|
48
157
|
* Classifies a raw failure reason into a bounded, non-free-form code for
|
|
49
158
|
* persisted telemetry. The raw `failureReason` from `errorReason()` in
|
|
@@ -59,8 +168,50 @@ export type RoleTaskResult = {
|
|
|
59
168
|
*
|
|
60
169
|
* Pure: no I/O, clock, random, or env.
|
|
61
170
|
*/
|
|
62
|
-
|
|
171
|
+
/**
|
|
172
|
+
* Classifies a raw failure reason into a bounded, non-free-form code for
|
|
173
|
+
* persisted telemetry AND the console failure viewer (P11c, see #195). The raw
|
|
174
|
+
* `failureReason` from `errorReason()` in `subsessions.ts` can contain SDK error
|
|
175
|
+
* messages that echo request content (provider content-filter rejections,
|
|
176
|
+
* validation errors quoting the payload). Persisting or rendering those verbatim
|
|
177
|
+
* violates the project's telemetry policy: "auditable JSONL with a hashed prompt
|
|
178
|
+
* by default; do not store sensitive prompts."
|
|
179
|
+
*
|
|
180
|
+
* The classified code preserves the debugging signal that actually gets
|
|
181
|
+
* aggregated (timeout vs. auth vs. rate-limit vs. rejection vs. missing session)
|
|
182
|
+
* while carrying no payload. The raw string remains available in-memory via
|
|
183
|
+
* `CorrelatedCostRecord.failureReason` for the tool response.
|
|
184
|
+
*
|
|
185
|
+
* Pure: no I/O, clock, random, or env.
|
|
186
|
+
*/
|
|
187
|
+
export declare const TelemetryFailureClassSchema: z.ZodEnum<{
|
|
188
|
+
"create-no-id": "create-no-id";
|
|
189
|
+
"create-rejected": "create-rejected";
|
|
190
|
+
"prompt-auth": "prompt-auth";
|
|
191
|
+
"prompt-connection": "prompt-connection";
|
|
192
|
+
"prompt-content-filter": "prompt-content-filter";
|
|
193
|
+
"prompt-context-length": "prompt-context-length";
|
|
194
|
+
"prompt-rate-limited": "prompt-rate-limited";
|
|
195
|
+
"prompt-rejected": "prompt-rejected";
|
|
196
|
+
"prompt-server": "prompt-server";
|
|
197
|
+
"prompt-timeout": "prompt-timeout";
|
|
198
|
+
"prompt-validation": "prompt-validation";
|
|
199
|
+
unknown: "unknown";
|
|
200
|
+
}>;
|
|
201
|
+
export type TelemetryFailureClass = z.infer<typeof TelemetryFailureClassSchema>;
|
|
63
202
|
export declare function classifyFailureForTelemetry(failureReason: string, failureStage: string | undefined): TelemetryFailureClass;
|
|
203
|
+
/**
|
|
204
|
+
* Console-facing classifier for an opencode `session.error` frame (P11c, see
|
|
205
|
+
* #195). The console failure viewer currently renders `error.message` verbatim;
|
|
206
|
+
* this maps the frame to a bounded {@link TelemetryFailureClass} so the viewer can
|
|
207
|
+
* render a class instead of a free-form provider string. Total and content-free:
|
|
208
|
+
* a frame with no recognised cause — or no message at all — maps to `unknown`, and
|
|
209
|
+
* the raw message is never returned.
|
|
210
|
+
*/
|
|
211
|
+
export declare function classifyOpencodeSessionError(error: {
|
|
212
|
+
readonly name?: string | undefined;
|
|
213
|
+
readonly message?: string | undefined;
|
|
214
|
+
} | undefined): TelemetryFailureClass;
|
|
64
215
|
/**
|
|
65
216
|
* Mapea un `CorrelatedCostRecord` a un `route` event preservando la correlación
|
|
66
217
|
* (decisionID/agent/success/batchID/failureStage) que el sink de
|