@jmanuelcorral/openteam 0.2.2 → 0.9.1
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 +13534 -6124
- 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 +202 -4
- package/dist/commands/dispatch.d.ts.map +1 -1
- package/dist/commands/doctor.d.ts +53 -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 +52 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11334 -5016
- 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 +155 -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 +69 -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/diagnostics.d.ts +30 -0
- package/dist/plugin/diagnostics.d.ts.map +1 -0
- 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 +38 -3
- 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 +37 -5
- 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/diagnostics.d.ts +10 -0
- package/dist/telemetry/diagnostics.d.ts.map +1 -0
- package/dist/telemetry/eventLog.d.ts +44 -26
- package/dist/telemetry/eventLog.d.ts.map +1 -1
- package/dist/telemetry/events.d.ts +121 -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
|
@@ -20,7 +20,7 @@ export type AgentInfo = {
|
|
|
20
20
|
description?: string;
|
|
21
21
|
model?: ModelRef;
|
|
22
22
|
};
|
|
23
|
-
export type AgentModelKind = "local" | "frontier" | "inherited";
|
|
23
|
+
export type AgentModelKind = "local" | "frontier" | "inherited" | "unresolvable";
|
|
24
24
|
/** Agente clasificado por el LLM efectivo que usa. */
|
|
25
25
|
export type AgentClassification = {
|
|
26
26
|
name: string;
|
|
@@ -37,7 +37,7 @@ export type AgentClassification = {
|
|
|
37
37
|
export declare function parseAgentFile(file: AgentFile): AgentInfo;
|
|
38
38
|
/**
|
|
39
39
|
* Conjunto de providerIDs considerados **locales**: los de los runtimes locales
|
|
40
|
-
* configurados (Ollama/LM Studio/Foundry), su `id`, y el `router.localDefault`.
|
|
40
|
+
* configurados (Ollama/LM Studio/Lemonade/Foundry), su `id`, y el `router.localDefault`.
|
|
41
41
|
* Pure.
|
|
42
42
|
*/
|
|
43
43
|
export declare function localProviderIDs(config: OpenTeamConfig): Set<string>;
|
|
@@ -48,6 +48,13 @@ export declare function localProviderIDs(config: OpenTeamConfig): Set<string>;
|
|
|
48
48
|
export declare function classifyAgent(info: AgentInfo, context: {
|
|
49
49
|
localProviders: Set<string>;
|
|
50
50
|
defaultModel?: ModelRef;
|
|
51
|
+
/**
|
|
52
|
+
* Provider ids whose local runtime is `enabled: false` in
|
|
53
|
+
* `.opencode/openteam.json`. A declared model on one of these providers is
|
|
54
|
+
* **not** healthy local: opencode cannot resolve it, so it is classified
|
|
55
|
+
* `unresolvable` instead of `local`. See issue #135.
|
|
56
|
+
*/
|
|
57
|
+
disabledLocalProviders?: Set<string>;
|
|
51
58
|
}): AgentClassification;
|
|
52
59
|
/**
|
|
53
60
|
* Clasifica y ordena todos los agentes (primary primero, luego alfabético).
|
|
@@ -56,10 +63,103 @@ export declare function classifyAgent(info: AgentInfo, context: {
|
|
|
56
63
|
export declare function classifyAgents(files: readonly AgentFile[], context: {
|
|
57
64
|
localProviders: Set<string>;
|
|
58
65
|
defaultModel?: ModelRef;
|
|
66
|
+
disabledLocalProviders?: Set<string>;
|
|
59
67
|
}): AgentClassification[];
|
|
60
68
|
/** Render legible del listado de agentes con su LLM. Pure. */
|
|
61
69
|
export declare function renderAgentList(classifications: readonly AgentClassification[], context: {
|
|
62
70
|
defaultModel?: ModelRef;
|
|
63
71
|
localProviders: Set<string>;
|
|
72
|
+
opencodeConfigError?: string;
|
|
64
73
|
}): string;
|
|
74
|
+
/** Whether the effective model was declared in frontmatter or inherited. */
|
|
75
|
+
export type AgentModelOrigin = "declared" | "inherited" | "none";
|
|
76
|
+
/**
|
|
77
|
+
* Static resolution outcome. `unknown` means the model could not be disproven
|
|
78
|
+
* offline (e.g. a frontier provider resolved by opencode via the models.dev
|
|
79
|
+
* catalog), not that it is broken.
|
|
80
|
+
*/
|
|
81
|
+
export type AgentModelStatus = "resolved" | "unresolvable" | "unknown";
|
|
82
|
+
/** Machine-readable reason a model was classified `unresolvable`. */
|
|
83
|
+
export type AgentModelFailureReason = "provider-not-configured" | "local-runtime-disabled" | "model-not-configured" | "virtual-router-provider";
|
|
84
|
+
/** Live `/models` evidence for a local provider (never changes static status). */
|
|
85
|
+
export type AgentModelLiveStatus = "confirmed" | "not-advertised" | "unreachable" | "not-probed";
|
|
86
|
+
/** Provider entry parsed from `opencode.json.provider.<id>`. */
|
|
87
|
+
export type OpencodeProviderInfo = {
|
|
88
|
+
/** Model ids in `provider.<id>.models`, when that map is declared. */
|
|
89
|
+
models?: Set<string>;
|
|
90
|
+
};
|
|
91
|
+
/** Live model advertisement for one local runtime (from a doctor probe). */
|
|
92
|
+
export type LiveRuntimeModels = {
|
|
93
|
+
reachable: boolean;
|
|
94
|
+
modelIDs: Set<string>;
|
|
95
|
+
};
|
|
96
|
+
/** Inputs required to statically resolve an agent model. Pure. */
|
|
97
|
+
export type AgentModelContext = {
|
|
98
|
+
/** provider id -> parsed `opencode.json` provider entry. */
|
|
99
|
+
opencodeProviders: Map<string, OpencodeProviderInfo>;
|
|
100
|
+
/** local runtime id -> enabled flag, from `.opencode/openteam.json`. */
|
|
101
|
+
localRuntimes: Map<string, {
|
|
102
|
+
enabled: boolean;
|
|
103
|
+
}>;
|
|
104
|
+
/** Default model inherited when an agent omits `model:`. */
|
|
105
|
+
defaultModel?: ModelRef;
|
|
106
|
+
/** Live `/models` per local runtime id (enabled runtimes only). */
|
|
107
|
+
liveModels?: Map<string, LiveRuntimeModels>;
|
|
108
|
+
/** Directory the agent files were read from, for provenance in output. */
|
|
109
|
+
sourceDir: string;
|
|
110
|
+
};
|
|
111
|
+
/** Structured evidence for a single agent model resolution. */
|
|
112
|
+
export type AgentModelResolution = {
|
|
113
|
+
status: AgentModelStatus;
|
|
114
|
+
reason?: AgentModelFailureReason;
|
|
115
|
+
/** provider id belongs to a known local runtime (Ollama/LM Studio/…). */
|
|
116
|
+
isLocalProvider: boolean;
|
|
117
|
+
/** provider id is present in `opencode.json.provider`. */
|
|
118
|
+
providerConfigured: boolean;
|
|
119
|
+
/** a runtime entry for this provider exists in `.opencode/openteam.json`. */
|
|
120
|
+
localRuntimePresent: boolean;
|
|
121
|
+
/** that runtime is `enabled: true`. */
|
|
122
|
+
localRuntimeEnabled: boolean;
|
|
123
|
+
/** model id is in the configured provider model map (`unknown` if no map). */
|
|
124
|
+
modelInProviderMap: boolean | "unknown";
|
|
125
|
+
/** live `/models` evidence, when a snapshot was available. */
|
|
126
|
+
live: AgentModelLiveStatus;
|
|
127
|
+
};
|
|
128
|
+
/** A per-agent diagnostic emitted to `openteam doctor`. */
|
|
129
|
+
export type AgentModelDiagnostic = {
|
|
130
|
+
name: string;
|
|
131
|
+
mode: string;
|
|
132
|
+
/** Repo-relative agent file, e.g. `.opencode/agent/galadriel.md`. */
|
|
133
|
+
sourceFile: string;
|
|
134
|
+
origin: AgentModelOrigin;
|
|
135
|
+
/** Effective model (declared or inherited); absent when neither exists. */
|
|
136
|
+
model?: ModelRef;
|
|
137
|
+
/** Resolution evidence; absent only when there is no model at all. */
|
|
138
|
+
resolution?: AgentModelResolution;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Parses `opencode.json` into a provider -> model-set map. Pure: operates on the
|
|
142
|
+
* already-parsed JSON object, no I/O. A provider without a `models` map yields an
|
|
143
|
+
* entry with `models === undefined` (membership becomes `unknown`, not `false`).
|
|
144
|
+
*/
|
|
145
|
+
export declare function parseOpencodeProviders(opencodeConfig: Record<string, unknown> | undefined): Map<string, OpencodeProviderInfo>;
|
|
146
|
+
/** local runtime id -> enabled flag, from `.opencode/openteam.json`. Pure. */
|
|
147
|
+
export declare function localRuntimeStates(config: OpenTeamConfig): Map<string, {
|
|
148
|
+
enabled: boolean;
|
|
149
|
+
}>;
|
|
150
|
+
/** Provider ids whose configured local runtime is disabled. Pure. */
|
|
151
|
+
export declare function disabledLocalProviderIDs(config: OpenTeamConfig): Set<string>;
|
|
152
|
+
/**
|
|
153
|
+
* Statically resolves a single `provider/model` reference against the opencode
|
|
154
|
+
* provider map and the openteam local-runtime config. Deterministic and offline.
|
|
155
|
+
* Live `/models` evidence, when present, is attached to `live` but never alters
|
|
156
|
+
* `status`. Pure.
|
|
157
|
+
*/
|
|
158
|
+
export declare function resolveAgentModel(model: ModelRef, context: AgentModelContext): AgentModelResolution;
|
|
159
|
+
/**
|
|
160
|
+
* Parses and resolves every agent file, reusing `parseAgentFile` and the model
|
|
161
|
+
* resolver above. Sorted primary-first then alphabetically, matching
|
|
162
|
+
* `classifyAgents`. Pure.
|
|
163
|
+
*/
|
|
164
|
+
export declare function diagnoseAgentModels(files: readonly AgentFile[], context: AgentModelContext): AgentModelDiagnostic[];
|
|
65
165
|
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEjE;;;;;;;;GAQG;AAEH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,MAAM,CAAC;IACnB,MAAM,EAAE,gBAAgB,CAAC;IACzB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,sEAAsE;IACtE,UAAU,CAAC,EAAE,oBAAoB,CAAC;CACnC,CAAC;AAuBF;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAClD,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAkBnC;AAED,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,cAAc,GACrB,GAAG,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAMnC;AAED,qEAAqE;AACrE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,cAAc,GAAG,GAAG,CAAC,MAAM,CAAC,CAQ5E;AAoBD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,QAAQ,EACf,OAAO,EAAE,iBAAiB,GACzB,oBAAoB,CA6DtB;AA8BD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,OAAO,EAAE,iBAAiB,GACzB,oBAAoB,EAAE,CAOxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseline.d.ts","sourceRoot":"","sources":["../../src/commands/baseline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"baseline.d.ts","sourceRoot":"","sources":["../../src/commands/baseline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,kBAAkB,CAAC;AAEjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAmB9C;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAYrD;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CASnE;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,QAAQ,GACZ,cAAc,CAchB;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAcnE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface CacheEntry {
|
|
2
|
+
specDir: string;
|
|
3
|
+
absolutePath: string;
|
|
4
|
+
pinnedVersion: string;
|
|
5
|
+
installedVersion: string;
|
|
6
|
+
mtimeIso: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CachePort {
|
|
9
|
+
resolveCacheRoot(override?: string): string;
|
|
10
|
+
listEntries(cacheRoot: string): Promise<CacheEntry[]>;
|
|
11
|
+
deleteEntry(entryPath: string): Promise<void>;
|
|
12
|
+
isReparsePath(entryPath: string): Promise<boolean>;
|
|
13
|
+
}
|
|
14
|
+
export type ClearCacheOptions = {
|
|
15
|
+
deleteEntries?: boolean;
|
|
16
|
+
cacheRootOverride?: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Orchestrates listing, diagnosis, and optional deletion of openteam plugin
|
|
20
|
+
* cache entries. All I/O goes through the injected `CachePort`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function runClearCache(options: ClearCacheOptions, port: CachePort): Promise<string>;
|
|
23
|
+
//# sourceMappingURL=clearCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearCache.d.ts","sourceRoot":"","sources":["../../src/commands/clearCache.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,gBAAgB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IACtD,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACpD;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAyCF;;;GAGG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,MAAM,CAAC,CAiEjB"}
|
|
@@ -1,26 +1,224 @@
|
|
|
1
|
+
import { type GraphGateResult } from "../config/graphFeatureGate";
|
|
2
|
+
import type { LegacyMigrationReport } from "../config/legacyMigration";
|
|
3
|
+
import type { LegacyLayoutFinding } from "../config/legacyPaths";
|
|
1
4
|
import type { OpenTeamConfig } from "../config/schema";
|
|
2
5
|
import type { LocalRuntimeSnapshot } from "../local/types";
|
|
6
|
+
import type { ActiveIngressCapability, GraphIngress, IngressPolicy } from "../orchestrator/graphIngress";
|
|
7
|
+
import { type Roster } from "../orchestrator/roster";
|
|
8
|
+
import { type WorktreeObservation, type WorktreeReconcileAction } from "../orchestrator/worktreeReconciler";
|
|
3
9
|
import type { CostRecord } from "../telemetry/types";
|
|
4
10
|
import { type AgentFile } from "./agents";
|
|
11
|
+
import type { CachePort } from "./clearCache";
|
|
12
|
+
import { type DoctorDiagnostic } from "./doctor";
|
|
13
|
+
import { type GraphHealthSnapshot } from "./graph";
|
|
14
|
+
import { type PurgeRuntime } from "./purge";
|
|
5
15
|
export type CliDeps = {
|
|
6
|
-
loadConfig: (path: string) => Promise<OpenTeamConfig>;
|
|
7
|
-
saveConfig: (config: OpenTeamConfig, path: string) => Promise<void>;
|
|
16
|
+
loadConfig: (path: string, options?: ConfigPathResolution) => Promise<OpenTeamConfig>;
|
|
17
|
+
saveConfig: (config: OpenTeamConfig, path: string, options?: ConfigPathResolution) => Promise<void>;
|
|
8
18
|
probe: (config: OpenTeamConfig) => Promise<LocalRuntimeSnapshot[]>;
|
|
9
19
|
readTelemetry: (path: string) => Promise<CostRecord[]>;
|
|
10
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Reads plugin-safe diagnostics persisted by the opencode plugin. Optional so
|
|
22
|
+
* older composition roots still run; when absent, doctor omits the section.
|
|
23
|
+
*/
|
|
24
|
+
readDiagnostics?: () => Promise<DoctorDiagnostic[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Reads and deep-merges all candidate opencode config files (later entries in
|
|
27
|
+
* `paths` have lower precedence). Returns `undefined` when none of the paths
|
|
28
|
+
* can be read.
|
|
29
|
+
*/
|
|
30
|
+
readOpencodeConfig: (paths: readonly string[]) => Promise<Record<string, unknown> | undefined>;
|
|
11
31
|
writeOpencodeConfig: (config: Record<string, unknown>, path: string) => Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the first path in `paths` that has a readable opencode config, or
|
|
34
|
+
* `undefined` when none of the paths exist. Used by commands that need to
|
|
35
|
+
* write back to the specific file they read from.
|
|
36
|
+
*/
|
|
37
|
+
resolveOpencodeWriteTarget: (paths: readonly string[]) => Promise<string | undefined>;
|
|
12
38
|
writeOrchestratorAgent: (contents: string, path: string) => Promise<void>;
|
|
13
39
|
listAgentFiles: (dir: string) => Promise<AgentFile[]>;
|
|
40
|
+
readGraphSnapshot: (configPath: string, options?: ConfigPathResolution) => Promise<GraphHealthSnapshot>;
|
|
41
|
+
graphOperator?: GraphOperatorDeps;
|
|
42
|
+
cachePort?: CachePort;
|
|
43
|
+
purge?: PurgeRuntime;
|
|
44
|
+
/**
|
|
45
|
+
* Detects pre-P15b legacy artifacts still present on disk (see
|
|
46
|
+
* `src/config/legacyPaths.ts`). Optional: when provided, `doctor` renders a
|
|
47
|
+
* migration section. Absent in composition roots that do not probe the disk.
|
|
48
|
+
*/
|
|
49
|
+
detectLegacyLayout?: () => Promise<readonly LegacyLayoutFinding[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Executes the P15b legacy-layout migration (`openteam migrate`): physically
|
|
52
|
+
* relocates pre-split artifacts to their current homes and returns a report.
|
|
53
|
+
* Optional so composition roots that do not touch the disk can omit it; the
|
|
54
|
+
* command reports a clear error when it is absent.
|
|
55
|
+
*/
|
|
56
|
+
migrateLegacyLayout?: () => Promise<LegacyMigrationReport>;
|
|
57
|
+
/**
|
|
58
|
+
* Runtime port for `openteam loop` (#152). Optional, following the same
|
|
59
|
+
* composition-root pattern as `purge`/`cachePort`/`graphOperator`: the CLI
|
|
60
|
+
* binary wires the REAL port (filesystem roster/backlog access plus a
|
|
61
|
+
* model-backed ralph driver) in `src/cli.ts`, while unit tests inject a fake.
|
|
62
|
+
* When absent, the command reports a clear "not configured" error instead of
|
|
63
|
+
* silently no-oping — the dead-code failure mode this workstream exists to
|
|
64
|
+
* prevent.
|
|
65
|
+
*/
|
|
66
|
+
loopRuntime?: LoopRuntime;
|
|
14
67
|
configPath: string;
|
|
15
68
|
telemetryPath: string;
|
|
16
|
-
|
|
69
|
+
opencodeConfigPaths: readonly string[];
|
|
17
70
|
orchestratorAgentPath: string;
|
|
18
71
|
agentDir: string;
|
|
19
72
|
version: string;
|
|
20
73
|
};
|
|
74
|
+
export type GraphRecoverExecution = {
|
|
75
|
+
readonly reason: string;
|
|
76
|
+
readonly tail: GraphHealthSnapshot["journal"];
|
|
77
|
+
};
|
|
78
|
+
export type GraphRecoveryPort = {
|
|
79
|
+
recover(config: OpenTeamConfig): Promise<GraphRecoverExecution>;
|
|
80
|
+
};
|
|
81
|
+
export type GraphWorktreePort = {
|
|
82
|
+
listObservations(config: OpenTeamConfig): Promise<readonly WorktreeObservation[]>;
|
|
83
|
+
apply(action: WorktreeReconcileAction, runID: string): Promise<void>;
|
|
84
|
+
};
|
|
85
|
+
export type GraphOperatorDeps = {
|
|
86
|
+
readonly holder: string;
|
|
87
|
+
readonly recovery: GraphRecoveryPort;
|
|
88
|
+
readonly worktrees: GraphWorktreePort;
|
|
89
|
+
readonly capability?: ActiveIngressCapability;
|
|
90
|
+
readonly allowList?: readonly string[];
|
|
91
|
+
evaluateCutoverGate(): Promise<GraphGateResult>;
|
|
92
|
+
createIngress(policy: IngressPolicy, config: OpenTeamConfig): GraphIngress;
|
|
93
|
+
};
|
|
94
|
+
export type ConfigPathResolution = {
|
|
95
|
+
readonly explicit: boolean;
|
|
96
|
+
};
|
|
21
97
|
export type CliResult = {
|
|
22
98
|
exitCode: number;
|
|
23
99
|
stdout: string;
|
|
24
100
|
};
|
|
101
|
+
/** Default iteration cap when neither a flag nor config supplies one (#152). */
|
|
102
|
+
export declare const DEFAULT_LOOP_MAX_ITERATIONS = 20;
|
|
103
|
+
/** Default seconds paused between iterations (#152). */
|
|
104
|
+
export declare const DEFAULT_LOOP_SLEEP_SECONDS = 2;
|
|
105
|
+
/** Default consecutive no-progress iterations tolerated before stopping (#152). */
|
|
106
|
+
export declare const DEFAULT_LOOP_NO_PROGRESS_LIMIT = 2;
|
|
107
|
+
/** Path of the shared Markdown backlog the loop walks. */
|
|
108
|
+
export declare const DEFAULT_LOOP_BACKLOG_PATH = ".opencode/openteam/backlog.md";
|
|
109
|
+
/** One parsed backlog line: an unchecked item is one iteration unit (#152). */
|
|
110
|
+
export type BacklogItem = {
|
|
111
|
+
/** Zero-based index of the source line the item was parsed from. */
|
|
112
|
+
readonly line: number;
|
|
113
|
+
/** The item text, with any `[@Name]` casting prefix stripped off. */
|
|
114
|
+
readonly text: string;
|
|
115
|
+
/** Whether the checkbox is already ticked (`- [x]`). */
|
|
116
|
+
readonly checked: boolean;
|
|
117
|
+
/** Optional `[@Name]` casting prefix (reuses the todo convention). */
|
|
118
|
+
readonly cast?: string;
|
|
119
|
+
};
|
|
120
|
+
/** Parses a Markdown backlog into its checkbox items. Pure. */
|
|
121
|
+
export declare function parseBacklog(text: string): BacklogItem[];
|
|
122
|
+
/** The unchecked backlog items, in source order. Pure. */
|
|
123
|
+
export declare function uncheckedBacklogItems(items: readonly BacklogItem[]): BacklogItem[];
|
|
124
|
+
/** Rewrites the source line of the given item as done (`- [ ]` → `- [x]`). Pure. */
|
|
125
|
+
export declare function markBacklogLineDone(text: string, line: number): string;
|
|
126
|
+
/** A stopping condition, evaluated BEFORE an iteration spends anything (#152). */
|
|
127
|
+
export type LoopStopReason = "empty-backlog" | "max-iterations" | "budget-exhausted" | "red-tests" | "no-progress";
|
|
128
|
+
/** Outcome of evaluating the stopping conditions before an iteration. */
|
|
129
|
+
export type LoopStopDecision = {
|
|
130
|
+
readonly stop: boolean;
|
|
131
|
+
readonly reason?: LoopStopReason;
|
|
132
|
+
};
|
|
133
|
+
/** State the pre-spend stopping conditions are evaluated against. */
|
|
134
|
+
export type LoopStopState = {
|
|
135
|
+
readonly uncheckedCount: number;
|
|
136
|
+
/** Iterations already completed (0-based). */
|
|
137
|
+
readonly iteration: number;
|
|
138
|
+
readonly maxIterations: number;
|
|
139
|
+
readonly budgetUsd?: number;
|
|
140
|
+
readonly spentUsd: number;
|
|
141
|
+
readonly stopOnRedTests: boolean;
|
|
142
|
+
readonly testsRed: boolean;
|
|
143
|
+
readonly noProgressCount: number;
|
|
144
|
+
readonly noProgressLimit: number;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Evaluates the stopping conditions in the documented order (#152): empty
|
|
148
|
+
* backlog, max-iterations, budget, red tests, then no-progress. Pure — the
|
|
149
|
+
* caller consults this BEFORE spending on an iteration.
|
|
150
|
+
*/
|
|
151
|
+
export declare function evaluateLoopStop(state: LoopStopState): LoopStopDecision;
|
|
152
|
+
/** Parsed `openteam loop` flags. */
|
|
153
|
+
export type LoopFlags = {
|
|
154
|
+
readonly maxIterations: number;
|
|
155
|
+
readonly budgetUsd?: number;
|
|
156
|
+
readonly sleepSeconds: number;
|
|
157
|
+
readonly noProgressLimit: number;
|
|
158
|
+
readonly freshContext: boolean;
|
|
159
|
+
readonly stopOnRedTests: boolean;
|
|
160
|
+
readonly dryRun: boolean;
|
|
161
|
+
readonly yes: boolean;
|
|
162
|
+
readonly backlogPath: string;
|
|
163
|
+
};
|
|
164
|
+
/** Result of parsing loop flags: either the flags, or a usage error. */
|
|
165
|
+
export type LoopFlagsParse = {
|
|
166
|
+
readonly ok: true;
|
|
167
|
+
readonly flags: LoopFlags;
|
|
168
|
+
} | {
|
|
169
|
+
readonly ok: false;
|
|
170
|
+
readonly error: string;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Parses the `openteam loop` flags from the raw argv. `--config`/`--telemetry`
|
|
174
|
+
* are consumed elsewhere, so their values are skipped here. Pure.
|
|
175
|
+
*/
|
|
176
|
+
export declare function parseLoopFlags(argv: readonly string[]): LoopFlagsParse;
|
|
177
|
+
/** Agent-file readiness of a guaranteed role, for the plan preview. */
|
|
178
|
+
export type GuaranteedAgentStatus = {
|
|
179
|
+
readonly roleID: string;
|
|
180
|
+
readonly agentName: string;
|
|
181
|
+
readonly exists: boolean;
|
|
182
|
+
};
|
|
183
|
+
/** Input the real ralph driver receives for one loop run. */
|
|
184
|
+
export type LoopRunInput = {
|
|
185
|
+
readonly prompt: string;
|
|
186
|
+
readonly maxIterations: number;
|
|
187
|
+
readonly config: OpenTeamConfig;
|
|
188
|
+
readonly freshContext: boolean;
|
|
189
|
+
};
|
|
190
|
+
/** Outcome the real ralph driver reports. */
|
|
191
|
+
export type LoopRunResult = {
|
|
192
|
+
readonly iterations: number;
|
|
193
|
+
readonly termination: "done" | "cap";
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Runtime seam for `openteam loop`. The CLI binary wires the real, effectful
|
|
197
|
+
* implementation (see `src/cli.ts`); tests inject a deterministic fake.
|
|
198
|
+
*/
|
|
199
|
+
export type LoopRuntime = {
|
|
200
|
+
/** Reads the persisted roster WITHOUT contacting a model. `undefined` = none. */
|
|
201
|
+
loadRoster(): Promise<Roster | undefined>;
|
|
202
|
+
/** Reuses the persisted roster, or generates + persists one (may call a model). */
|
|
203
|
+
loadOrGenerateRoster(): Promise<Roster>;
|
|
204
|
+
/** Whether `.opencode/agent/<agentName>.md` exists in the workspace. */
|
|
205
|
+
agentFileExists(agentName: string): Promise<boolean>;
|
|
206
|
+
/** Reads the backlog Markdown; `undefined` when the file does not exist. */
|
|
207
|
+
readBacklog(path: string): Promise<string | undefined>;
|
|
208
|
+
/** Writes the backlog Markdown back to disk. */
|
|
209
|
+
writeBacklog(path: string, contents: string): Promise<void>;
|
|
210
|
+
/** Runs the bounded ralph loop for real; dispatches the `ralph` role. */
|
|
211
|
+
run(input: LoopRunInput): Promise<LoopRunResult>;
|
|
212
|
+
};
|
|
213
|
+
/** The plan an `openteam loop --dry-run` prints without spending anything. */
|
|
214
|
+
export type LoopPlan = {
|
|
215
|
+
readonly flags: LoopFlags;
|
|
216
|
+
readonly uncheckedCount: number;
|
|
217
|
+
readonly plannedIterations: number;
|
|
218
|
+
readonly roster: Roster | undefined;
|
|
219
|
+
readonly guaranteed: readonly GuaranteedAgentStatus[];
|
|
220
|
+
};
|
|
221
|
+
/** Renders the loop plan for `--dry-run`. Pure. */
|
|
222
|
+
export declare function renderLoopPlan(plan: LoopPlan): string;
|
|
25
223
|
export declare function runCli(argv: readonly string[], deps: CliDeps): Promise<CliResult>;
|
|
26
224
|
//# sourceMappingURL=dispatch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/commands/dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,M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AAK,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAClD,CAAC;AAyBF,8EAA8E;AAC9E,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACvD,CAAC;AAEF,mDAAmD;AACnD,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CA0BrD;AA2HD,wBAAsB,MAAM,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,SAAS,CAAC,CAqQpB"}
|
|
@@ -1,12 +1,65 @@
|
|
|
1
|
+
import type { LegacyLayoutFinding } from "../config/legacyPaths";
|
|
1
2
|
import type { OpenTeamConfig } from "../config/schema";
|
|
2
3
|
import type { LocalRuntimeSnapshot } from "../local/types";
|
|
4
|
+
import { type DiagnosticCode } from "../telemetry/diagnostics";
|
|
3
5
|
import type { GraphViewHealth } from "../telemetry/graphView";
|
|
6
|
+
import type { OtelDoctorView } from "../telemetry/otelConfig";
|
|
7
|
+
import type { AgentModelDiagnostic } from "./agents";
|
|
8
|
+
import type { CacheEntry } from "./clearCache";
|
|
4
9
|
export type DoctorInput = {
|
|
5
10
|
config: OpenTeamConfig;
|
|
6
11
|
snapshots: readonly LocalRuntimeSnapshot[];
|
|
7
12
|
telemetryPath: string;
|
|
8
13
|
telemetryRecords: number;
|
|
14
|
+
/**
|
|
15
|
+
* Redacted OpenTelemetry backend view (W1-S04, #163). When present, doctor
|
|
16
|
+
* renders an `opentelemetry:` line. The raw connection string never enters
|
|
17
|
+
* this structure — it is redacted upstream by `describeOtelBackendForDoctor`
|
|
18
|
+
* — so it cannot leak to a terminal or a log.
|
|
19
|
+
*/
|
|
20
|
+
otelBackend?: OtelDoctorView;
|
|
9
21
|
graphHealth?: GraphViewHealth;
|
|
22
|
+
/** Cache entries to display in the "opencode cache:" section. */
|
|
23
|
+
cacheEntries?: readonly CacheEntry[];
|
|
24
|
+
/** CLI version string used to flag stale cache entries. */
|
|
25
|
+
cliVersion?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Per-agent model resolution diagnostics (issue #135). When present, doctor
|
|
28
|
+
* renders an `agent models` section reporting whether each agent's declared
|
|
29
|
+
* or inherited `model:` resolves. Absent means the section is omitted.
|
|
30
|
+
*/
|
|
31
|
+
agentModels?: readonly AgentModelDiagnostic[];
|
|
32
|
+
/**
|
|
33
|
+
* Candidate opencode config paths that were searched when building
|
|
34
|
+
* `agentModels`. Named in `provider-not-configured` diagnostics so the user
|
|
35
|
+
* can see which files were actually consulted.
|
|
36
|
+
*/
|
|
37
|
+
opencodeConfigPaths?: readonly string[];
|
|
38
|
+
/**
|
|
39
|
+
* Error message from a failed `readOpencodeConfig` call (e.g. malformed
|
|
40
|
+
* JSONC). When set, doctor surfaces it as a ⚠ warning so the user can
|
|
41
|
+
* identify and fix the specific file, rather than seeing a raw crash.
|
|
42
|
+
*/
|
|
43
|
+
opencodeConfigError?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Legacy openteam artifacts (pre-P15b paths) still present on disk. When
|
|
46
|
+
* non-empty, doctor prints a migration section naming each old file and where
|
|
47
|
+
* to move it. openteam keeps reading these old locations meanwhile, so this is
|
|
48
|
+
* guidance, not a failure.
|
|
49
|
+
*/
|
|
50
|
+
legacyLayout?: readonly LegacyLayoutFinding[];
|
|
51
|
+
/**
|
|
52
|
+
* TUI-safe plugin diagnostics persisted by the plugin instead of writing to
|
|
53
|
+
* stdout/stderr. `doctor` renders warning/error entries so users can discover
|
|
54
|
+
* suppressed plugin-context problems without corrupting opencode's TUI.
|
|
55
|
+
*/
|
|
56
|
+
diagnostics?: readonly DoctorDiagnostic[];
|
|
57
|
+
};
|
|
58
|
+
export type DoctorDiagnostic = {
|
|
59
|
+
readonly ts: number;
|
|
60
|
+
readonly sessionID: string;
|
|
61
|
+
readonly level: "debug" | "info" | "warn" | "error";
|
|
62
|
+
readonly code: DiagnosticCode;
|
|
10
63
|
};
|
|
11
64
|
export declare function renderDoctor(input: DoctorInput): string;
|
|
12
65
|
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.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,eAAe,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EACV,oBAAoB,EAGrB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,iEAAiE;IACjE,YAAY,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IACrC,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC9C;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC9C;;;;OAIG;IACH,WAAW,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACpD,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;CAC/B,CAAC;AA4KF,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAqHvD"}
|
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
import type { ModelCapabilityProfile } from "../capabilities/types";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Frontier catalog for `init`: cost ordering, human-readable labels, and
|
|
4
|
+
* per-provider listings. All pure/deterministic (no I/O), isolated from the
|
|
5
|
+
* interactive flow in `setup.ts`.
|
|
6
6
|
*/
|
|
7
7
|
export type FrontierChoice = {
|
|
8
8
|
providerID: string;
|
|
9
9
|
modelID: string;
|
|
10
10
|
};
|
|
11
|
-
/**
|
|
11
|
+
/** Sorts frontier profiles cheapest-capable to most expensive. Pure. */
|
|
12
12
|
export declare function sortFrontierByCost(profiles: readonly ModelCapabilityProfile[]): ModelCapabilityProfile[];
|
|
13
|
-
/** `true`
|
|
13
|
+
/** `true` when the model has neither input nor output cost (free). */
|
|
14
14
|
export declare function isFreeFrontier(profile: ModelCapabilityProfile): boolean;
|
|
15
|
-
/**
|
|
15
|
+
/** Human-readable cost label: "free" or "$in/$out per 1M". Pure. */
|
|
16
16
|
export declare function frontierCostLabel(profile: ModelCapabilityProfile): string;
|
|
17
|
-
/**
|
|
18
|
-
* Modelos frontier ofrecidos por `init`, del más barato-capaz al más caro.
|
|
19
|
-
* Por defecto usa el catálogo curado; `init` le pasa el catálogo real de
|
|
20
|
-
* Models.dev (incluidos los modelos gratuitos). Pure/determinista.
|
|
21
|
-
*/
|
|
22
|
-
export declare function frontierChoices(profiles?: readonly ModelCapabilityProfile[]): FrontierChoice[];
|
|
23
|
-
/** Providers presentes en el catálogo, ordenados alfabéticamente. Pure. */
|
|
17
|
+
/** Providers present in the catalog, sorted alphabetically. Pure. */
|
|
24
18
|
export declare function frontierProviders(profiles: readonly ModelCapabilityProfile[]): string[];
|
|
25
|
-
/**
|
|
19
|
+
/** Frontier profiles for a provider, cheapest to most expensive. Pure. */
|
|
26
20
|
export declare function frontierModelsForProvider(profiles: readonly ModelCapabilityProfile[], providerID: string): ModelCapabilityProfile[];
|
|
27
21
|
//# sourceMappingURL=frontierCatalog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontierCatalog.d.ts","sourceRoot":"","sources":["../../src/commands/frontierCatalog.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"frontierCatalog.d.ts","sourceRoot":"","sources":["../../src/commands/frontierCatalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAGpE;;;;GAIG;AAEH,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAWF,wEAAwE;AACxE,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,SAAS,sBAAsB,EAAE,GAC1C,sBAAsB,EAAE,CAI1B;AAED,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAEvE;AAED,oEAAoE;AACpE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM,CAQzE;AAED,qEAAqE;AACrE,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,SAAS,sBAAsB,EAAE,GAC1C,MAAM,EAAE,CAIV;AAED,0EAA0E;AAC1E,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,SAAS,sBAAsB,EAAE,EAC3C,UAAU,EAAE,MAAM,GACjB,sBAAsB,EAAE,CAI1B"}
|
package/dist/commands/graph.d.ts
CHANGED
|
@@ -2,8 +2,6 @@ import type { ConfigSource } from "../config/resolve";
|
|
|
2
2
|
import type { GraphMode } from "../config/schema";
|
|
3
3
|
import type { GraphJournalHealth } from "../graph/types";
|
|
4
4
|
import type { WorktreeReconcileReport } from "../orchestrator/worktreeReconciler";
|
|
5
|
-
import type { LegacyImportRecordV1 } from "../storage/graph/importLegacy";
|
|
6
|
-
import type { MigrationBackup, MigrationPlan } from "../storage/graph/migration";
|
|
7
5
|
import type { LeaseRecord } from "../storage/graph/workspaceLease";
|
|
8
6
|
/**
|
|
9
7
|
* GE-045 — operator commands for the graph runtime as pure dry-run plans.
|
|
@@ -71,29 +69,4 @@ export declare function planGraphCancel(snapshot: GraphHealthSnapshot, options:
|
|
|
71
69
|
* the operator can see isolation is off without any worktree being touched.
|
|
72
70
|
*/
|
|
73
71
|
export declare function renderWorktreeReconciliation(report: WorktreeReconcileReport): string;
|
|
74
|
-
/** Action a migration command would take. */
|
|
75
|
-
export type MigrationActionKind = "none" | "dry-run" | "backup" | "apply" | "rollback" | "blocked";
|
|
76
|
-
/** Result of planning a migration command. */
|
|
77
|
-
export type MigrationActionPlan = {
|
|
78
|
-
readonly kind: MigrationActionKind;
|
|
79
|
-
readonly reason: string;
|
|
80
|
-
readonly safe: boolean;
|
|
81
|
-
/** Number of records the action would affect. */
|
|
82
|
-
readonly recordCount: number;
|
|
83
|
-
};
|
|
84
|
-
/** Plan a migration dry-run from a settled migration plan. */
|
|
85
|
-
export declare function planMigrationDryRun(plan: MigrationPlan): MigrationActionPlan;
|
|
86
|
-
/** Plan a backup creation from current authority. */
|
|
87
|
-
export declare function planMigrationBackup(authority: readonly LegacyImportRecordV1[]): MigrationActionPlan;
|
|
88
|
-
/** Options for planning a migration apply. */
|
|
89
|
-
export type MigrationApplyOptions = {
|
|
90
|
-
/** Operator explicitly acknowledges applying a migration. */
|
|
91
|
-
readonly acknowledge?: boolean;
|
|
92
|
-
};
|
|
93
|
-
/** Plan a migration apply from a settled migration plan. */
|
|
94
|
-
export declare function planMigrationApply(plan: MigrationPlan, options?: MigrationApplyOptions): MigrationActionPlan;
|
|
95
|
-
/** Plan a rollback from a validated backup. */
|
|
96
|
-
export declare function planMigrationRollback(backup: MigrationBackup, currentAuthority: readonly LegacyImportRecordV1[]): MigrationActionPlan;
|
|
97
|
-
/** Render a migration action plan for the operator. */
|
|
98
|
-
export declare function renderMigrationPlan(plan: MigrationActionPlan): string;
|
|
99
72
|
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/commands/graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,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AC/C,MAAM,MAAM,mBAAmB,GAAG;IAChC,8EAA8E;IAC9E,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACtC,CAAC;AAEF,+CAA+C;AAC/C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAUF,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM,CAoBvE;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,GAAE,mBAAwB,GAChC,eAAe,CAejB;AAED,6EAA6E;AAC7E,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,kBAAkB,GAC1B,eAAe,CAejB;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,uBAAuB,GAC9B,MAAM,CAoBR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../src/commands/local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../src/commands/local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAkC9C,wBAAgB,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAYhE;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAoBtE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAcpE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LegacyMigrationReport } from "../config/legacyMigration";
|
|
2
|
+
/**
|
|
3
|
+
* Renders the `openteam migrate` report. Mirrors the plain-text, greppable style
|
|
4
|
+
* of `doctor`: a header, then the outcome. Only paths and counts are printed —
|
|
5
|
+
* never file contents — because session logs carry routing/cost metadata.
|
|
6
|
+
*
|
|
7
|
+
* Layout (line assembly, ordering) lives here; the human-readable text lives in
|
|
8
|
+
* the pure `src/messages/**` catalog (`migrateMessages`).
|
|
9
|
+
*/
|
|
10
|
+
export declare function renderMigration(report: LegacyMigrationReport): string;
|
|
11
|
+
//# sourceMappingURL=migrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGvE;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAkDrE"}
|