@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
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { type OpenTeamConfig } from "../config/schema";
|
|
2
|
+
import type { CliResult } from "./dispatch";
|
|
3
|
+
/**
|
|
4
|
+
* Ordered purge categories. `purge` walks them in this order, asking one
|
|
5
|
+
* question per non-empty category. The order is deliberate: openteam's own
|
|
6
|
+
* config first (so the "am I still installed?" wiring goes early), then the
|
|
7
|
+
* user-authored roster, then the data categories, then the git worktrees last
|
|
8
|
+
* (the only category that must be torn down through git).
|
|
9
|
+
*/
|
|
10
|
+
declare const PURGE_CATEGORY_IDS: readonly ["config", "roster", "decisions", "memory", "graph", "worktrees"];
|
|
11
|
+
export type PurgeCategoryId = (typeof PURGE_CATEGORY_IDS)[number];
|
|
12
|
+
/** CLI flag stem (`--<flag>` / `--no-<flag>`) that pre-answers each category. */
|
|
13
|
+
export declare const PURGE_CATEGORY_FLAG: Record<PurgeCategoryId, string>;
|
|
14
|
+
/** A single thing a category can remove. */
|
|
15
|
+
export type PurgeItem = {
|
|
16
|
+
readonly kind: "file";
|
|
17
|
+
readonly path: string;
|
|
18
|
+
} | {
|
|
19
|
+
readonly kind: "dir";
|
|
20
|
+
readonly path: string;
|
|
21
|
+
} | {
|
|
22
|
+
readonly kind: "agent";
|
|
23
|
+
readonly path: string;
|
|
24
|
+
readonly name: string;
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: "opencode-config";
|
|
27
|
+
readonly path: string;
|
|
28
|
+
} | {
|
|
29
|
+
readonly kind: "gitignore";
|
|
30
|
+
readonly path: string;
|
|
31
|
+
} | {
|
|
32
|
+
readonly kind: "worktree";
|
|
33
|
+
readonly path: string;
|
|
34
|
+
readonly runID: string;
|
|
35
|
+
readonly locked: boolean;
|
|
36
|
+
};
|
|
37
|
+
/** Outcome of asking git to remove a single worktree without `--force`. */
|
|
38
|
+
export type PurgeWorktreeOutcome = {
|
|
39
|
+
readonly status: "removed";
|
|
40
|
+
} | {
|
|
41
|
+
readonly status: "refused";
|
|
42
|
+
readonly detail: string;
|
|
43
|
+
} | {
|
|
44
|
+
readonly status: "failed";
|
|
45
|
+
readonly detail: string;
|
|
46
|
+
};
|
|
47
|
+
/** A discovered openteam worktree in the graph namespace. */
|
|
48
|
+
export type PurgeWorktree = {
|
|
49
|
+
readonly path: string;
|
|
50
|
+
readonly runID: string;
|
|
51
|
+
readonly locked: boolean;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* All I/O the purge orchestrator needs, behind an injected port so the logic is
|
|
55
|
+
* testable without a real filesystem or git. Paths are repo-relative POSIX
|
|
56
|
+
* paths; the adapter roots them at the repository root.
|
|
57
|
+
*/
|
|
58
|
+
export interface PurgePort {
|
|
59
|
+
/** Absolute repository root, for the containment guard. */
|
|
60
|
+
repoRoot(): string;
|
|
61
|
+
fileExists(relPath: string): Promise<boolean>;
|
|
62
|
+
dirExists(relPath: string): Promise<boolean>;
|
|
63
|
+
/** True when the path is a symlink / reparse point (never followed). */
|
|
64
|
+
isReparsePath(relPath: string): Promise<boolean>;
|
|
65
|
+
readFile(relPath: string): Promise<string | undefined>;
|
|
66
|
+
writeFile(relPath: string, contents: string): Promise<void>;
|
|
67
|
+
deleteFile(relPath: string): Promise<void>;
|
|
68
|
+
deleteDir(relPath: string): Promise<void>;
|
|
69
|
+
/** User-authored agent markdown files under the agent directory. */
|
|
70
|
+
listAgents(): Promise<readonly {
|
|
71
|
+
name: string;
|
|
72
|
+
path: string;
|
|
73
|
+
}[]>;
|
|
74
|
+
/** openteam git worktrees enumerated through git. `[]` if none / no repo. */
|
|
75
|
+
listWorktrees(): Promise<readonly PurgeWorktree[]>;
|
|
76
|
+
/** Remove one worktree through git **without** `--force`. */
|
|
77
|
+
removeWorktree(worktreePath: string): Promise<PurgeWorktreeOutcome>;
|
|
78
|
+
/** `git worktree prune`, clearing dangling administrative entries. */
|
|
79
|
+
pruneWorktrees(): Promise<void>;
|
|
80
|
+
}
|
|
81
|
+
/** Prompt shape reused from `setup` (`confirm`) plus clack's `isCancel`. */
|
|
82
|
+
export type PurgeConfirm = (opts: {
|
|
83
|
+
message: string;
|
|
84
|
+
initial?: boolean;
|
|
85
|
+
}) => Promise<boolean | symbol>;
|
|
86
|
+
/** Everything a composition root wires so `purge` can run. */
|
|
87
|
+
export type PurgeRuntime = {
|
|
88
|
+
readonly port: PurgePort;
|
|
89
|
+
readonly confirm: PurgeConfirm;
|
|
90
|
+
readonly isCancel: (value: unknown) => boolean;
|
|
91
|
+
readonly isInteractive: () => boolean;
|
|
92
|
+
/** Effective sessions directory (composition-root specific). */
|
|
93
|
+
readonly sessionsDir: string;
|
|
94
|
+
};
|
|
95
|
+
/** Effective (configured) paths the CLI hands the orchestrator. */
|
|
96
|
+
export type PurgePathContext = {
|
|
97
|
+
readonly configPath: string;
|
|
98
|
+
readonly orchestratorAgentPath: string;
|
|
99
|
+
/** All candidate opencode config paths (both may carry a plugin entry). */
|
|
100
|
+
readonly opencodeConfigPaths: readonly string[];
|
|
101
|
+
readonly gitignorePath: string;
|
|
102
|
+
readonly telemetryPath: string;
|
|
103
|
+
readonly decisionsPath: string;
|
|
104
|
+
readonly sessionsDir: string;
|
|
105
|
+
};
|
|
106
|
+
export type PurgeOptions = {
|
|
107
|
+
/** `--delete`: start the interactive walk. Default false = dry run. */
|
|
108
|
+
readonly delete: boolean;
|
|
109
|
+
/** `--yes`: accept every category without prompting. */
|
|
110
|
+
readonly yes: boolean;
|
|
111
|
+
/** Per-category pre-answers from `--<flag>` / `--no-<flag>`. */
|
|
112
|
+
readonly answers: Partial<Record<PurgeCategoryId, boolean>>;
|
|
113
|
+
};
|
|
114
|
+
export type PurgeInput = {
|
|
115
|
+
readonly options: PurgeOptions;
|
|
116
|
+
readonly config: OpenTeamConfig;
|
|
117
|
+
readonly runtime: PurgeRuntime;
|
|
118
|
+
readonly paths: PurgePathContext;
|
|
119
|
+
/** Emitted when the config file existed but could not be parsed or validated. */
|
|
120
|
+
readonly configWarning?: string;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Orchestrates `openteam purge`. With no flags it is a dry run that lists every
|
|
124
|
+
* category and removes nothing. `--delete` (or `--yes`) starts the interactive
|
|
125
|
+
* per-category walk; `--yes` accepts every category, per-category flags
|
|
126
|
+
* pre-answer individual ones. A non-TTY stdin without `--yes` and with an
|
|
127
|
+
* unanswered non-empty category fails loudly rather than hanging. Cancelling a
|
|
128
|
+
* prompt aborts with nothing further removed. All I/O goes through the port.
|
|
129
|
+
*/
|
|
130
|
+
export declare function runPurge(input: PurgeInput): Promise<CliResult>;
|
|
131
|
+
export {};
|
|
132
|
+
//# sourceMappingURL=purge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purge.d.ts","sourceRoot":"","sources":["../../src/commands/purge.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,cAAc,EAEpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAO5C;;;;;;GAMG;AACH,QAAA,MAAM,kBAAkB,YACtB,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,OAAO,EACP,WAAW,CACH,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAO/D,CAAC;AA0BF,4CAA4C;AAC5C,MAAM,MAAM,SAAS,GACjB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC/C;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IA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CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;CAC7C,CAAC;AAWF,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,UAAU,EAAE,GAC7B,UAAU,CA0CZ;AAMD,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAuBvD"}
|
package/dist/commands/setup.d.ts
CHANGED
|
@@ -5,8 +5,55 @@ import type { CliResult } from "./dispatch";
|
|
|
5
5
|
import { type FrontierChoice as FrontierChoiceType } from "./frontierCatalog";
|
|
6
6
|
/** Nombre del paquete npm del plugin, declarado en el opencode.json generado. */
|
|
7
7
|
export declare const OPENTEAM_PLUGIN_SPEC = "@jmanuelcorral/openteam";
|
|
8
|
-
/** Ruta del
|
|
9
|
-
export declare const
|
|
8
|
+
/** Ruta del ignore local de opencode, relativa al cwd. */
|
|
9
|
+
export declare const OPENCODE_GITIGNORE_PATH = ".opencode/.gitignore";
|
|
10
|
+
/**
|
|
11
|
+
* Machine-local openteam state paths (P15b). Every entry lives under the single
|
|
12
|
+
* git-ignored directory `.opencode/openteam-local/`, so the derived
|
|
13
|
+
* `.gitignore` rule collapses to one line covering the whole directory. The
|
|
14
|
+
* **portable** memory records (`.opencode/openteam/memory/records.jsonl`) are
|
|
15
|
+
* deliberately absent: they are committed team-state, not ignored output.
|
|
16
|
+
*/
|
|
17
|
+
export declare const GENERATED_OPENTEAM_STATE_PATHS: readonly [".opencode/openteam-local/telemetry.jsonl", ".opencode/openteam-local/sessions", ".opencode/openteam-local/graph/runs", ".opencode/openteam-local/graph/worktrees", ".opencode/openteam-local/index.sqlite", ".opencode/openteam-local/memory/index.sqlite"];
|
|
18
|
+
/** One standard subagent file `setup` writes into `.opencode/agent/`. */
|
|
19
|
+
export type RoleAgentFile = {
|
|
20
|
+
readonly agentName: string;
|
|
21
|
+
readonly path: string;
|
|
22
|
+
readonly contents: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Standard subagent files `setup` writes so guaranteed-role dispatch resolves on
|
|
26
|
+
* a fresh install (#153, Defect B). Before this, every `TEAM_ROLES.opencodeAgent`
|
|
27
|
+
* target (`architect, integration, local-runtime, routing-cost, scribe, ralph,
|
|
28
|
+
* guardian, tester, reviewer`) had ZERO write site: `setup` wrote only the
|
|
29
|
+
* primary `openteam.md`, so the fail-closed guard `assertAgentFileForRole`
|
|
30
|
+
* (`src/orchestrator/roster.ts`) could never pass for a guaranteed role.
|
|
31
|
+
*
|
|
32
|
+
* The list is derived from `TEAM_ROLES` so it cannot drift from the roleID →
|
|
33
|
+
* agent contract. Deduplicated by `opencodeAgent` and sorted for a stable write
|
|
34
|
+
* order.
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildRoleAgentFiles(): RoleAgentFile[];
|
|
37
|
+
export declare const OPENCODE_GITIGNORE_GENERATED_STATE_RULES: readonly [string];
|
|
38
|
+
/**
|
|
39
|
+
* Pre-P15b generated ignore rule. Before the portable/local split, all openteam
|
|
40
|
+
* runtime state lived under `.opencode/openteam/`, so setup wrote a single
|
|
41
|
+
* blanket `openteam/` rule. That rule also (wrongly) ignored the portable memory
|
|
42
|
+
* records. On upgrade we strip it so `.opencode/openteam/` becomes tracked again,
|
|
43
|
+
* and `openteam purge` still recognizes it so a later uninstall removes the stale
|
|
44
|
+
* line.
|
|
45
|
+
*/
|
|
46
|
+
export declare const LEGACY_OPENCODE_GITIGNORE_STATE_RULES: readonly ["openteam/"];
|
|
47
|
+
/**
|
|
48
|
+
* Pre-P15b machine-local output that lived *under* the (now portable)
|
|
49
|
+
* `.opencode/openteam/` directory: session logs, the graph journal/worktrees and
|
|
50
|
+
* the derived SQLite indexes. Once the blanket `openteam/` rule is stripped, the
|
|
51
|
+
* portable directory is tracked, so an upgrading install must keep these specific
|
|
52
|
+
* legacy paths ignored to avoid committing stale runtime output. The portable
|
|
53
|
+
* memory records (`openteam/memory/records.jsonl`) are deliberately absent.
|
|
54
|
+
*/
|
|
55
|
+
export declare const LEGACY_LOCAL_OPENCODE_GITIGNORE_RULES: readonly ["openteam/sessions/", "openteam/graph/", "openteam/index.sqlite", "openteam/memory/index.sqlite"];
|
|
56
|
+
export declare function buildOpencodeGitignore(existing?: string): string;
|
|
10
57
|
export type KnownRuntime = {
|
|
11
58
|
id: LocalRuntimeId;
|
|
12
59
|
label: string;
|
|
@@ -59,7 +106,7 @@ export type OpencodeConfig = {
|
|
|
59
106
|
small_model?: string;
|
|
60
107
|
permission?: Record<string, string>;
|
|
61
108
|
};
|
|
62
|
-
export {
|
|
109
|
+
export { frontierCostLabel, frontierModelsForProvider, frontierProviders, isFreeFrontier, } from "./frontierCatalog";
|
|
63
110
|
/**
|
|
64
111
|
* Construye y valida el OpenTeamConfig a partir de las respuestas del init.
|
|
65
112
|
* Pure: no I/O.
|
|
@@ -130,7 +177,14 @@ export type SetupDeps = {
|
|
|
130
177
|
prompt: Prompter;
|
|
131
178
|
/** Rutas relativas a la raíz del proyecto (el storage ya está rooteado en el cwd). */
|
|
132
179
|
writeFile: (path: string, contents: string) => Promise<void>;
|
|
180
|
+
readFile: (path: string) => Promise<string | undefined>;
|
|
133
181
|
fileExists: (path: string) => Promise<boolean>;
|
|
182
|
+
/**
|
|
183
|
+
* Returns the first path in `paths` that already has a readable opencode
|
|
184
|
+
* config file, or `undefined` when none exist. Used by setup to write back
|
|
185
|
+
* to the user's existing file rather than always creating root `opencode.json`.
|
|
186
|
+
*/
|
|
187
|
+
resolveOpencodeWriteTarget: (paths: readonly string[]) => Promise<string | undefined>;
|
|
134
188
|
};
|
|
135
189
|
/** Opción explícita "sin runtime local" en el multiselect de runtimes. */
|
|
136
190
|
export declare const RUNTIME_NONE = "__none__";
|
|
@@ -140,8 +194,11 @@ export declare const RUNTIME_LOCATION_LOCAL = "__local__";
|
|
|
140
194
|
export declare const RUNTIME_LOCATION_REMOTE = "__remote__";
|
|
141
195
|
/**
|
|
142
196
|
* Normaliza una URL de runtime remoto: añade esquema http:// si falta y asume
|
|
143
|
-
* el endpoint OpenAI-compatible
|
|
197
|
+
* el path del endpoint OpenAI-compatible cuando no se indica ruta. El sufijo se
|
|
198
|
+
* deriva del pathname de `defaultBaseURL` cuando se proporciona (p.ej.
|
|
199
|
+
* `/api/v1` para Lemonade Server); cae a `/v1` si no se aporta contexto de
|
|
200
|
+
* runtime. Pure.
|
|
144
201
|
*/
|
|
145
|
-
export declare function normalizeRemoteBaseURL(raw: string): string;
|
|
202
|
+
export declare function normalizeRemoteBaseURL(raw: string, defaultBaseURL?: string): string;
|
|
146
203
|
export declare function runSetup(deps: SetupDeps): Promise<CliResult>;
|
|
147
204
|
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAMpE,OAAO,EAML,KAAK,cAAc,EAEnB,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAUrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EACL,KAAK,cAAc,IAAI,kBAAkB,EAK1C,MAAM,mBAAmB,CAAC;AAE3B,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,4BAA4B,CAAC;AAE9D,0DAA0D;AAC1D,eAAO,MAAM,uBAAuB,yBAAyB,CAAC;AAE9D;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,wQAOjC,CAAC;AAuCX,yEAAyE;AACzE,MAAM,MAAM,aAAa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E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const ROOT_PATH = "<root>";
|
|
2
|
+
export declare const KNOWN_CONFIG_KEYS_BY_PATH: ReadonlyMap<string, readonly string[]>;
|
|
3
|
+
type FormatZodBoundaryErrorOptions = {
|
|
4
|
+
readonly knownKeysByPath?: ReadonlyMap<string, readonly string[]>;
|
|
5
|
+
readonly unrecognizedKeyLabel?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function formatZodBoundaryError(error: unknown, options?: FormatZodBoundaryErrorOptions): string;
|
|
8
|
+
export declare function formatConfigError(error: unknown): string;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/config/errors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,WAAW,CAAC;AAIlC,eAAO,MAAM,yBAAyB,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CA0GzE,CAAC;AAgIL,KAAK,6BAA6B,GAAG;IACnC,QAAQ,CAAC,eAAe,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;IAClE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACxC,CAAC;AAEF,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,6BAAkC,GAC1C,MAAM,CA0BR;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAKxD"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* P15b legacy-layout migration executor.
|
|
3
|
+
*
|
|
4
|
+
* `openteam migrate` physically relocates pre-split artifacts from their legacy
|
|
5
|
+
* paths to the current P15b homes: portable team-state under
|
|
6
|
+
* `.opencode/openteam/` (git-tracked) and machine-local runtime output under
|
|
7
|
+
* `.opencode/openteam-local/` (git-ignored). The relocation plan is pure (see
|
|
8
|
+
* {@link planLegacyMigration} in `./legacyPaths`); this module turns each planned
|
|
9
|
+
* move into filesystem operations through an injected {@link LegacyMigrationPort}
|
|
10
|
+
* so the orchestration stays deterministic and testable with an in-memory fake.
|
|
11
|
+
*
|
|
12
|
+
* Guarantees:
|
|
13
|
+
* - **No data loss.** A file is only removed from its legacy location once it is
|
|
14
|
+
* byte-identical at the destination (either just moved there, or already
|
|
15
|
+
* present with matching content). A destination that exists with *different*
|
|
16
|
+
* content is reported as a conflict and the legacy copy is left untouched.
|
|
17
|
+
* - **Idempotent.** Re-running is a no-op: legacy files already moved are gone,
|
|
18
|
+
* so nothing matches; a partially-moved tree finishes where it left off.
|
|
19
|
+
* - **Byte-preserving.** Moves are `rename`-based, so binary artifacts (the
|
|
20
|
+
* SQLite indexes) survive intact — never round-tripped through a text codec.
|
|
21
|
+
*
|
|
22
|
+
* This module performs no direct I/O, clock, or environment access: every effect
|
|
23
|
+
* flows through the injected port.
|
|
24
|
+
*/
|
|
25
|
+
import type { LegacyMigrationMove } from "./legacyPaths";
|
|
26
|
+
/**
|
|
27
|
+
* Filesystem boundary the migration executor drives. All paths are repo-relative
|
|
28
|
+
* POSIX paths. The real adapter lives in `src/cli/migrateAdapter.ts`; tests inject
|
|
29
|
+
* an in-memory fake. Byte-preserving `moveFile` (rename) is what keeps binary
|
|
30
|
+
* indexes intact.
|
|
31
|
+
*/
|
|
32
|
+
export interface LegacyMigrationPort {
|
|
33
|
+
/** `true` if the path exists as a file or directory. */
|
|
34
|
+
exists(relPath: string): Promise<boolean>;
|
|
35
|
+
/** `true` only if the path exists and is a directory. */
|
|
36
|
+
isDirectory(relPath: string): Promise<boolean>;
|
|
37
|
+
/** Immediate child names of a directory, sorted; `[]` if absent. */
|
|
38
|
+
list(relPath: string): Promise<readonly string[]>;
|
|
39
|
+
/** `true` when both paths exist as files with identical bytes. */
|
|
40
|
+
sameContent(a: string, b: string): Promise<boolean>;
|
|
41
|
+
/**
|
|
42
|
+
* Move a single file `from` → `to`, preserving bytes and creating parent
|
|
43
|
+
* directories. The executor only calls this when `to` does not already exist.
|
|
44
|
+
*/
|
|
45
|
+
moveFile(from: string, to: string): Promise<void>;
|
|
46
|
+
/** Remove a single file; idempotent when absent. */
|
|
47
|
+
deleteFile(relPath: string): Promise<void>;
|
|
48
|
+
/** Remove a directory only if it is empty; a no-op otherwise. */
|
|
49
|
+
removeEmptyDir(relPath: string): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
/** What happened to a single legacy file during migration. */
|
|
52
|
+
export type MigratedFileAction = "moved" | "deduped" | "conflict";
|
|
53
|
+
/** Per-file outcome, ordered by the path that was processed. */
|
|
54
|
+
export type MigratedFile = {
|
|
55
|
+
readonly from: string;
|
|
56
|
+
readonly to: string;
|
|
57
|
+
readonly action: MigratedFileAction;
|
|
58
|
+
};
|
|
59
|
+
/** A legacy git worktree that the migration deliberately did not relocate. */
|
|
60
|
+
export type ManualWorktree = {
|
|
61
|
+
readonly label: string;
|
|
62
|
+
readonly from: string;
|
|
63
|
+
readonly to: string;
|
|
64
|
+
};
|
|
65
|
+
/** Aggregate result of a migration run. */
|
|
66
|
+
export type LegacyMigrationReport = {
|
|
67
|
+
readonly files: readonly MigratedFile[];
|
|
68
|
+
/** Legacy worktrees found that require a manual `git worktree move`. */
|
|
69
|
+
readonly manualWorktrees: readonly ManualWorktree[];
|
|
70
|
+
readonly moved: number;
|
|
71
|
+
readonly deduped: number;
|
|
72
|
+
readonly conflicts: number;
|
|
73
|
+
/** `true` when nothing needed migrating (a clean, already-split repo). */
|
|
74
|
+
readonly clean: boolean;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Executes a relocation plan against the injected port and returns a structured
|
|
78
|
+
* report. Worktree moves are not performed (they would corrupt git's worktree
|
|
79
|
+
* registration); they are surfaced as {@link ManualWorktree} entries instead.
|
|
80
|
+
*/
|
|
81
|
+
export declare function migrateLegacyLayout(moves: readonly LegacyMigrationMove[], port: LegacyMigrationPort): Promise<LegacyMigrationReport>;
|
|
82
|
+
//# sourceMappingURL=legacyMigration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacyMigration.d.ts","sourceRoot":"","sources":["../../src/config/legacyMigration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,wDAAwD;IACxD,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C,yDAAyD;IACzD,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/C,oEAAoE;IACpE,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IAClD,kEAAkE;IAClE,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACpD;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,oDAAoD;IACpD,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,iEAAiE;IACjE,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAED,8DAA8D;AAC9D,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,CAAC;AAElE,gEAAgE;AAChE,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;CACrC,CAAC;AAEF,8EAA8E;AAC9E,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,2CAA2C;AAC3C,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IACxC,wEAAwE;IACxE,QAAQ,CAAC,eAAe,EAAE,SAAS,cAAc,EAAE,CAAC;IACpD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB,CAAC;AAwCF;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,qBAAqB,CAAC,CA8BhC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* P15b legacy path migration surface.
|
|
3
|
+
*
|
|
4
|
+
* Decision P15 option (b) split openteam's on-disk artifacts into two top-level
|
|
5
|
+
* directories: portable team-state under `.opencode/openteam/` (git-tracked) and
|
|
6
|
+
* machine-local runtime output under `.opencode/openteam-local/` (git-ignored).
|
|
7
|
+
* Earlier versions scattered these files under different paths.
|
|
8
|
+
*
|
|
9
|
+
* This module is the single source of truth for the old → new mapping. It is
|
|
10
|
+
* **pure**: no I/O, clock, or environment access. Callers inject an existence
|
|
11
|
+
* predicate (a set of paths that exist on disk) so the resolution stays
|
|
12
|
+
* deterministic and testable. Composition roots build that set from the storage
|
|
13
|
+
* boundary; `openteam doctor` uses {@link detectLegacyLayout} to tell the user
|
|
14
|
+
* which legacy files still need migrating.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* How a legacy artifact is physically relocated by `openteam migrate`:
|
|
18
|
+
* - `"move"`: a byte-preserving filesystem move (rename), safe for text and
|
|
19
|
+
* binary files alike (session JSONL, graph journals, SQLite indexes).
|
|
20
|
+
* - `"git-worktree"`: a registered git worktree whose `.git` pointer would be
|
|
21
|
+
* corrupted by a plain file move. The migration never copies these; it
|
|
22
|
+
* reports them so the operator can run `git worktree move` deliberately.
|
|
23
|
+
*/
|
|
24
|
+
export type LegacyRelocation = "move" | "git-worktree";
|
|
25
|
+
/** One old → new relocation for a single openteam artifact. */
|
|
26
|
+
export type LegacyPathEntry = {
|
|
27
|
+
/** Short human label used in `doctor` output (e.g. "decisions"). */
|
|
28
|
+
readonly label: string;
|
|
29
|
+
/** Current canonical default path (post-P15b). */
|
|
30
|
+
readonly current: string;
|
|
31
|
+
/** Pre-P15b default path an upgrading install may still hold data at. */
|
|
32
|
+
readonly legacy: string;
|
|
33
|
+
/** `true` for git-tracked portable team-state, `false` for machine-local output. */
|
|
34
|
+
readonly portable: boolean;
|
|
35
|
+
/** Physical relocation strategy used by `openteam migrate`. */
|
|
36
|
+
readonly relocation: LegacyRelocation;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Every artifact whose default path changed in P15b. Memory records
|
|
40
|
+
* (`.opencode/openteam/memory/records.jsonl`) are intentionally absent: they did
|
|
41
|
+
* not move, so there is no legacy location to fall back to.
|
|
42
|
+
*/
|
|
43
|
+
export declare const LEGACY_PATH_ENTRIES: readonly LegacyPathEntry[];
|
|
44
|
+
/**
|
|
45
|
+
* Union of every current and legacy path, deduplicated. Composition roots probe
|
|
46
|
+
* these for existence to build the set passed to {@link resolveReadPath} and
|
|
47
|
+
* {@link detectLegacyLayout}.
|
|
48
|
+
*/
|
|
49
|
+
export declare const LEGACY_LAYOUT_PROBE_PATHS: readonly string[];
|
|
50
|
+
/**
|
|
51
|
+
* Resolves the path to **read** an artifact from. Prefers the current path;
|
|
52
|
+
* falls back to the legacy path only when the current one is absent and the
|
|
53
|
+
* legacy one exists. Writes always target the current path — this helper is for
|
|
54
|
+
* reads. Pure: existence is supplied as a set.
|
|
55
|
+
*/
|
|
56
|
+
export declare function resolveReadPath(current: string, legacy: string, exists: ReadonlySet<string>): string;
|
|
57
|
+
/**
|
|
58
|
+
* Convenience wrapper for composition roots: given a current default path,
|
|
59
|
+
* resolves the effective **read** path by consulting the P15b mapping. Paths
|
|
60
|
+
* that never moved (absent from {@link LEGACY_PATH_ENTRIES}) are returned as-is.
|
|
61
|
+
*/
|
|
62
|
+
export declare function resolveReadPathForCurrent(current: string, exists: ReadonlySet<string>): string;
|
|
63
|
+
/** A legacy artifact still present on disk that the user should migrate. */
|
|
64
|
+
export type LegacyLayoutFinding = {
|
|
65
|
+
readonly label: string;
|
|
66
|
+
readonly legacy: string;
|
|
67
|
+
readonly current: string;
|
|
68
|
+
readonly portable: boolean;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Returns the legacy artifacts that still exist on disk (and whose current path
|
|
72
|
+
* differs). `doctor` renders these so an upgrading user is told exactly which
|
|
73
|
+
* files to move and where. Pure: existence is supplied as a set.
|
|
74
|
+
*/
|
|
75
|
+
export declare function detectLegacyLayout(exists: ReadonlySet<string>): readonly LegacyLayoutFinding[];
|
|
76
|
+
/** A single planned relocation of one legacy artifact to its current home. */
|
|
77
|
+
export type LegacyMigrationMove = {
|
|
78
|
+
readonly label: string;
|
|
79
|
+
/** Source (pre-P15b) path. */
|
|
80
|
+
readonly from: string;
|
|
81
|
+
/** Destination (current) path. */
|
|
82
|
+
readonly to: string;
|
|
83
|
+
readonly portable: boolean;
|
|
84
|
+
readonly relocation: LegacyRelocation;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Plans the physical relocations `openteam migrate` should perform: every legacy
|
|
88
|
+
* artifact that still exists on disk and whose path actually changed. Pure:
|
|
89
|
+
* existence is supplied as a set, so the plan is deterministic and testable.
|
|
90
|
+
* The executor ({@link migrateLegacyLayout}) turns each move into byte-preserving
|
|
91
|
+
* filesystem operations.
|
|
92
|
+
*/
|
|
93
|
+
export declare function planLegacyMigration(exists: ReadonlySet<string>): readonly LegacyMigrationMove[];
|
|
94
|
+
/**
|
|
95
|
+
* The machine-local artifacts whose *legacy* location physically sits **inside**
|
|
96
|
+
* the now-portable `.opencode/openteam/` directory. These are the only artifacts
|
|
97
|
+
* that, once the transitional per-path ignore rules are removed, become
|
|
98
|
+
* untracked-but-committable under a "tracked in full" directory — the precise
|
|
99
|
+
* exposure the split was meant to eliminate. The composition root relocates
|
|
100
|
+
* exactly these, silently and idempotently, on every CLI startup, so the window
|
|
101
|
+
* shrinks to a single invocation. Worktrees are excluded: they need
|
|
102
|
+
* `git worktree move`, never a file copy.
|
|
103
|
+
*/
|
|
104
|
+
export declare function planStartupHygieneMigration(exists: ReadonlySet<string>): readonly LegacyMigrationMove[];
|
|
105
|
+
//# sourceMappingURL=legacyPaths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacyPaths.d.ts","sourceRoot":"","sources":["../../src/config/legacyPaths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAaH;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,cAAc,CAAC;AAEvD,+DAA+D;AAC/D,MAAM,MAAM,eAAe,GAAG;IAC5B,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,UAAU,EAAE,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ACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,GAC1B,SAAS,mBAAmB,EAAE,CAOhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,UAAU,CAAC;AAErE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,CAE/D;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,SAA4B,EAChC,OAAO,GAAE,eAAwD,GAChE,OAAO,CAAC,cAAc,CAAC,CAazB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opencode project configuration resolution.
|
|
3
|
+
*
|
|
4
|
+
* Opencode reads project config from two candidate paths (verified 2026-08-28
|
|
5
|
+
* with opencode 1.18.18). Both are fully supported; configs are merged, not
|
|
6
|
+
* replaced. This module provides the shared resolver so every openteam command
|
|
7
|
+
* uses the same precedence order and merge semantics.
|
|
8
|
+
*
|
|
9
|
+
* Empirical verification: two scratch repos — one with config only in
|
|
10
|
+
* `.opencode/opencode.json`, one with config only in root `opencode.json` —
|
|
11
|
+
* both produced the provider when queried with `opencode models --pure`. The
|
|
12
|
+
* docs state "Configuration files are merged together, not replaced. Later
|
|
13
|
+
* configs override earlier ones only for conflicting keys."
|
|
14
|
+
*
|
|
15
|
+
* ## JSONC support
|
|
16
|
+
*
|
|
17
|
+
* Opencode itself accepts `//` line comments and `/* … *\/` block comments in
|
|
18
|
+
* its config files (verified empirically 2026-08-28: a commented opencode.json
|
|
19
|
+
* still produced the declared provider in `opencode models --pure`). Openteam
|
|
20
|
+
* must be equally tolerant. Use `stripJsoncComments` before calling
|
|
21
|
+
* `JSON.parse`; `purge` imports it from here rather than keeping its own copy.
|
|
22
|
+
*
|
|
23
|
+
* ## Traversal decision — deliberately no upward traversal
|
|
24
|
+
*
|
|
25
|
+
* Opencode itself traverses upward from the current directory to the nearest
|
|
26
|
+
* Git root when looking for config. Openteam deliberately does **not** traverse
|
|
27
|
+
* upward. It reads only the two cwd-relative paths listed in
|
|
28
|
+
* `OPENCODE_CONFIG_CANDIDATES`.
|
|
29
|
+
*
|
|
30
|
+
* Reasoning: openteam commands (setup, doctor, agents, purge) are designed to
|
|
31
|
+
* be run from the project root — the same directory where opencode is launched.
|
|
32
|
+
* Implementing upward traversal would require detecting the git root (I/O), add
|
|
33
|
+
* non-trivial code to every composition root, and could silently pick up a
|
|
34
|
+
* parent-project config when the user is in a subdirectory. The risk of silent
|
|
35
|
+
* misconfiguration outweighs the convenience gain. Users who run openteam in a
|
|
36
|
+
* subdirectory will see "provider not configured" and should cd to the project
|
|
37
|
+
* root, just as they would if they ran opencode from a subdirectory without its
|
|
38
|
+
* traversal.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* Strips JSONC line (`//`) and block (`/* … *\/`) comments from `src` while
|
|
42
|
+
* leaving all string literals verbatim. Returns plain JSON suitable for
|
|
43
|
+
* `JSON.parse`. Zero-dependency in-repo implementation — no `jsonc-parser` or
|
|
44
|
+
* similar package is needed.
|
|
45
|
+
*
|
|
46
|
+
* Authoritative copy: imported by `purge.ts` and by both `readOpencodeConfig`
|
|
47
|
+
* composition roots. Do not duplicate.
|
|
48
|
+
*/
|
|
49
|
+
export declare function stripJsoncComments(src: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Precedence-ordered candidate paths that opencode reads for project config.
|
|
52
|
+
* Index 0 is the higher-priority override; index 1 is the base. Mirrors the
|
|
53
|
+
* verified behaviour: `.opencode/opencode.json` overrides root `opencode.json`
|
|
54
|
+
* on conflicting keys.
|
|
55
|
+
*/
|
|
56
|
+
export declare const OPENCODE_CONFIG_CANDIDATES: readonly [".opencode/opencode.json", "opencode.json"];
|
|
57
|
+
/**
|
|
58
|
+
* Deep-merges `override` into `base`. Nested records are merged recursively;
|
|
59
|
+
* scalars and arrays from `override` replace those in `base`. Mirrors opencode's
|
|
60
|
+
* own "merge, not replace" semantics for multiple config files.
|
|
61
|
+
*/
|
|
62
|
+
export declare function mergeOpencodeConfigs(base: Record<string, unknown>, override: Record<string, unknown>): Record<string, unknown>;
|
|
63
|
+
//# sourceMappingURL=opencode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../src/config/opencode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAgDtD;AAMD;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,YACrC,yBAAyB,EACzB,eAAe,CACP,CAAC;AAEX;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWzB"}
|
package/dist/config/persist.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { StorageProvider } from "../storage/provider";
|
|
2
2
|
import { type OpenTeamConfig } from "./schema";
|
|
3
3
|
export declare const DEFAULT_CONFIG_PATH = ".opencode/openteam.json";
|
|
4
|
+
/**
|
|
5
|
+
* Machine-local overlay path (CFG-S01, decision P16). The whole
|
|
6
|
+
* `.opencode/openteam-local/` directory is git-ignored, so this file never
|
|
7
|
+
* leaves the developer's machine. It is deep-merged OVER the tracked base at
|
|
8
|
+
* load time and wins, letting a developer override committed values (chiefly a
|
|
9
|
+
* LAN `local.runtimes[].baseURL`) without pushing them to the team.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_LOCAL_OVERLAY_PATH = ".opencode/openteam-local/config.local.json";
|
|
4
12
|
/**
|
|
5
13
|
* Validate and serialize a config to canonical JSON (2-space indent, trailing newline).
|
|
6
14
|
* Pure: no filesystem access.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persist.d.ts","sourceRoot":"","sources":["../../src/config/persist.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,UAAU,CAAC;AAErE,eAAO,MAAM,mBAAmB,4BAA4B,CAAC;AAE7D;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAGtE;AAED,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,cAAc,EACtB,IAAI,SAAsB,EAC1B,OAAO,GAAE,eAAwD,GAChE,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
|
1
|
+
{"version":3,"file":"persist.d.ts","sourceRoot":"","sources":["../../src/config/persist.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,UAAU,CAAC;AAErE,eAAO,MAAM,mBAAmB,4BAA4B,CAAC;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,+CACO,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAGtE;AAED,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,cAAc,EACtB,IAAI,SAAsB,EAC1B,OAAO,GAAE,eAAwD,GAChE,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
package/dist/config/resolve.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import type { GraphMode, OpenTeamConfig } from "./schema";
|
|
|
20
20
|
* Puro: sin I/O, reloj ni estado global.
|
|
21
21
|
*/
|
|
22
22
|
/** Origen de la config resuelta (para trazabilidad/observabilidad). */
|
|
23
|
-
export type ConfigSource = "file" | "
|
|
23
|
+
export type ConfigSource = "file" | "options" | "default";
|
|
24
24
|
/** Resolución efectiva de la config de Graph. */
|
|
25
25
|
export type ResolvedGraphConfig = {
|
|
26
26
|
/** Modo declarado en la config (default `off`). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1D;;;;;;;;;;;;;;;;;;GAkBG;AAEH,uEAAuE;AACvE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1D;;;;;;;;;;;;;;;;;;GAkBG;AAEH,uEAAuE;AACvE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAE1D,iDAAiD;AACjD,MAAM,MAAM,mBAAmB,GAAG;IAChC,mDAAmD;IACnD,QAAQ,CAAC,cAAc,EAAE,SAAS,CAAC;IACnC,kEAAkE;IAClE,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC;IAClC,0CAA0C;IAC1C,QAAQ,CAAC,eAAe,EAAE,OA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