@jterrats/open-orchestra 0.4.0 → 0.4.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/CHANGELOG.md +21 -0
- package/dist/autonomous-phase-lifecycle.d.ts +25 -0
- package/dist/autonomous-phase-lifecycle.js +194 -0
- package/dist/autonomous-phase-lifecycle.js.map +1 -0
- package/dist/autonomous-run-state.d.ts +6 -0
- package/dist/autonomous-run-state.js +91 -0
- package/dist/autonomous-run-state.js.map +1 -0
- package/dist/autonomous-run-store.d.ts +12 -0
- package/dist/autonomous-run-store.js +64 -0
- package/dist/autonomous-run-store.js.map +1 -0
- package/dist/autonomous-workflow-constants.d.ts +6 -0
- package/dist/autonomous-workflow-constants.js +36 -0
- package/dist/autonomous-workflow-constants.js.map +1 -0
- package/dist/autonomous-workflow.d.ts +6 -45
- package/dist/autonomous-workflow.js +4 -394
- package/dist/autonomous-workflow.js.map +1 -1
- package/dist/cli.js +13 -1
- package/dist/cli.js.map +1 -1
- package/dist/command-utils.d.ts +6 -0
- package/dist/command-utils.js +19 -0
- package/dist/command-utils.js.map +1 -0
- package/dist/commands.d.ts +8 -43
- package/dist/commands.js +13 -868
- package/dist/commands.js.map +1 -1
- package/dist/constants.js +9 -0
- package/dist/constants.js.map +1 -1
- package/dist/defaults.d.ts +11 -0
- package/dist/defaults.js +11 -0
- package/dist/defaults.js.map +1 -1
- package/dist/instruction-commands.d.ts +5 -0
- package/dist/instruction-commands.js +98 -0
- package/dist/instruction-commands.js.map +1 -0
- package/dist/metrics-commands.d.ts +3 -0
- package/dist/metrics-commands.js +114 -0
- package/dist/metrics-commands.js.map +1 -0
- package/dist/model-commands.d.ts +13 -0
- package/dist/model-commands.js +199 -0
- package/dist/model-commands.js.map +1 -0
- package/dist/runtime-adapters.d.ts +5 -1
- package/dist/runtime-adapters.js +27 -0
- package/dist/runtime-adapters.js.map +1 -1
- package/dist/runtime-commands.d.ts +9 -0
- package/dist/runtime-commands.js +156 -0
- package/dist/runtime-commands.js.map +1 -0
- package/dist/runtime-execution-adapters.d.ts +2 -0
- package/dist/runtime-execution-adapters.js +163 -0
- package/dist/runtime-execution-adapters.js.map +1 -0
- package/dist/runtime-execution-renderer.d.ts +10 -0
- package/dist/runtime-execution-renderer.js +110 -0
- package/dist/runtime-execution-renderer.js.map +1 -0
- package/dist/runtime-execution.d.ts +27 -0
- package/dist/runtime-execution.js +147 -0
- package/dist/runtime-execution.js.map +1 -0
- package/dist/skills-commands.d.ts +9 -0
- package/dist/skills-commands.js +130 -0
- package/dist/skills-commands.js.map +1 -0
- package/dist/sprint-commands.d.ts +5 -0
- package/dist/sprint-commands.js +120 -0
- package/dist/sprint-commands.js.map +1 -0
- package/dist/telemetry-commands.d.ts +7 -0
- package/dist/telemetry-commands.js +82 -0
- package/dist/telemetry-commands.js.map +1 -0
- package/dist/tool-commands.d.ts +3 -0
- package/dist/tool-commands.js +67 -0
- package/dist/tool-commands.js.map +1 -0
- package/dist/types.d.ts +79 -0
- package/dist/types.js.map +1 -1
- package/docs/runtime-llm-flow.md +46 -0
- package/package.json +1 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { requireArg } from "./args.js";
|
|
2
|
+
import { computeVelocity } from "./benchmark.js";
|
|
3
|
+
import { computeSprintBurndown, renderBurndownAscii } from "./burndown.js";
|
|
4
|
+
import { calibrationReport, closeSprint, startSprint, velocityTrend, } from "./sprint-metrics.js";
|
|
5
|
+
export async function velocityCommand(options, io) {
|
|
6
|
+
const cwd = process.cwd();
|
|
7
|
+
if (typeof options.sprints === "string") {
|
|
8
|
+
const limit = Number(options.sprints);
|
|
9
|
+
if (!Number.isInteger(limit) || limit <= 0) {
|
|
10
|
+
throw new Error("--sprints must be a positive integer");
|
|
11
|
+
}
|
|
12
|
+
const report = await velocityTrend(cwd, limit);
|
|
13
|
+
if (options.json) {
|
|
14
|
+
io.log(JSON.stringify(report, null, 2));
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
io.log(`Sprint Velocity Report`);
|
|
18
|
+
io.log(` Trend: ${report.trend}`);
|
|
19
|
+
for (const sprint of report.sprints) {
|
|
20
|
+
io.log(` ${sprint.sprintId} ${sprint.storiesCompleted} stories ${sprint.pointsCompleted} pts`);
|
|
21
|
+
}
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const report = await computeVelocity(cwd);
|
|
25
|
+
if (options.json) {
|
|
26
|
+
io.log(JSON.stringify(report, null, 2));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
io.log(`Velocity Report`);
|
|
30
|
+
io.log(` Stories completed: ${report.totalStoriesCompleted}`);
|
|
31
|
+
io.log(` Points completed: ${report.totalPointsCompleted}`);
|
|
32
|
+
io.log(` Avg actual days: ${report.avgActualDaysPerStory !== null ? report.avgActualDaysPerStory + "d" : "n/a"}`);
|
|
33
|
+
io.log(` vs Solo estimate: ${report.avgVsSoloPct !== null ? report.avgVsSoloPct + "%" : "n/a"}`);
|
|
34
|
+
io.log(` vs AI estimate: ${report.avgVsAiUnguidedPct !== null ? report.avgVsAiUnguidedPct + "%" : "n/a"}`);
|
|
35
|
+
io.log(` Trend: ${report.trend}`);
|
|
36
|
+
if (report.weeks.length > 0) {
|
|
37
|
+
io.log(`\nWeekly breakdown:`);
|
|
38
|
+
for (const week of report.weeks) {
|
|
39
|
+
io.log(` ${week.week} ${week.storiesCompleted} stories ${week.pointsCompleted} pts`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export async function sprintCommand(subcommand, options, io) {
|
|
44
|
+
const cwd = process.cwd();
|
|
45
|
+
if (subcommand === "start") {
|
|
46
|
+
const id = requireArg(options, "id");
|
|
47
|
+
const taskIds = requireArg(options, "tasks")
|
|
48
|
+
.split(",")
|
|
49
|
+
.map((taskId) => taskId.trim())
|
|
50
|
+
.filter(Boolean);
|
|
51
|
+
const sprint = await startSprint(cwd, id, taskIds);
|
|
52
|
+
if (options.json) {
|
|
53
|
+
io.log(JSON.stringify(sprint, null, 2));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
io.log(`Sprint started: ${sprint.id} (${sprint.taskIds.length} tasks)`);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (subcommand === "close") {
|
|
60
|
+
const id = requireArg(options, "id");
|
|
61
|
+
const sprint = await closeSprint(cwd, id);
|
|
62
|
+
if (options.json) {
|
|
63
|
+
io.log(JSON.stringify(sprint, null, 2));
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
io.log(`Sprint closed: ${sprint.id}`);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
throw new Error(`unknown sprint command: ${subcommand ?? ""}`.trim());
|
|
70
|
+
}
|
|
71
|
+
export async function calibrationCommand(options, io) {
|
|
72
|
+
const report = await calibrationReport(process.cwd());
|
|
73
|
+
const roleFilter = typeof options.role === "string" ? options.role : null;
|
|
74
|
+
const filtered = roleFilter
|
|
75
|
+
? { roles: report.roles.filter((role) => role.role === roleFilter) }
|
|
76
|
+
: report;
|
|
77
|
+
if (options.json) {
|
|
78
|
+
io.log(JSON.stringify(filtered, null, 2));
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
io.log(`Calibration Report`);
|
|
82
|
+
for (const role of filtered.roles) {
|
|
83
|
+
io.log(` ${role.role} stories=${role.stories} declared=${role.avgDeclaredDays}d actual=${role.avgActualDays}d error=${role.avgErrorPct}% bias=${role.bias}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export async function burndownCommand(options, io) {
|
|
87
|
+
const cwd = process.cwd();
|
|
88
|
+
const sprintTaskIds = requireArg(options, "sprint")
|
|
89
|
+
.split(",")
|
|
90
|
+
.map((taskId) => taskId.trim())
|
|
91
|
+
.filter(Boolean);
|
|
92
|
+
if (sprintTaskIds.length === 0) {
|
|
93
|
+
throw new Error(`--sprint requires at least one task id`);
|
|
94
|
+
}
|
|
95
|
+
const series = await computeSprintBurndown(cwd, sprintTaskIds);
|
|
96
|
+
if (options.json) {
|
|
97
|
+
io.log(JSON.stringify(series, null, 2));
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
for (const warning of series.warnings)
|
|
101
|
+
io.log(`⚠ ${warning}`);
|
|
102
|
+
if (series.totalPoints === 0) {
|
|
103
|
+
io.log("No points to chart — record estimates first with: orchestra estimate --task <id> ...");
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
io.log(`Sprint burndown total=${series.totalPoints} pts tasks=${series.sprintTaskIds.length}`);
|
|
107
|
+
io.log("");
|
|
108
|
+
io.log(renderBurndownAscii(series));
|
|
109
|
+
io.log("");
|
|
110
|
+
io.log("Task breakdown:");
|
|
111
|
+
for (const task of series.taskBreakdown) {
|
|
112
|
+
const architectPoints = task.architectPoints !== null ? `arch=${task.architectPoints}` : "arch=—";
|
|
113
|
+
const developerPoints = task.developerPoints !== null ? `dev=${task.developerPoints}` : "dev=—";
|
|
114
|
+
const done = task.completedAt
|
|
115
|
+
? `done ${task.completedAt.slice(0, 10)}`
|
|
116
|
+
: "pending";
|
|
117
|
+
io.log(` ${task.taskId.padEnd(14)} ${architectPoints.padEnd(10)} ${developerPoints.padEnd(10)} resolved=${task.resolvedPoints} ${done}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=sprint-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sprint-commands.js","sourceRoot":"","sources":["../src/sprint-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,qBAAqB,CAAC;AAG7B,MAAM,CAAC,KAAK,UAA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eAAe,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;QAC1E,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW;YAC3B,CAAC,CAAC,QAAQ,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;YACzC,CAAC,CAAC,SAAS,CAAC;QACd,EAAE,CAAC,GAAG,CACJ,KAAK,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,aAAa,IAAI,CAAC,cAAc,KAAK,IAAI,EAAE,CACnI,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CliIo, CliOptions } from "./types.js";
|
|
2
|
+
export declare function telemetryStatusCommand(options: CliOptions, io: CliIo): Promise<void>;
|
|
3
|
+
export declare function telemetryEnableCommand(options: CliOptions, io: CliIo): Promise<void>;
|
|
4
|
+
export declare function telemetryExportCommand(options: CliOptions, io: CliIo): Promise<void>;
|
|
5
|
+
export declare function telemetrySubmitCommand(options: CliOptions, io: CliIo): Promise<void>;
|
|
6
|
+
export declare function telemetryEvalDatasetCommand(options: CliOptions, io: CliIo): Promise<void>;
|
|
7
|
+
export declare function telemetryDisableCommand(options: CliOptions, io: CliIo): Promise<void>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { requireArg } from "./args.js";
|
|
2
|
+
import { stringOption } from "./command-utils.js";
|
|
3
|
+
import { disableTelemetryConsent, enableTelemetryConsent, exportTelemetryDataset, exportTelemetryEvalDataset, getTelemetryConsent, parseTelemetryLevel, requiresSensitiveTelemetryOptIn, submitTelemetryDataset, } from "./telemetry.js";
|
|
4
|
+
export async function telemetryStatusCommand(options, io) {
|
|
5
|
+
const telemetry = await getTelemetryConsent();
|
|
6
|
+
if (options.json) {
|
|
7
|
+
io.log(JSON.stringify(telemetry, null, 2));
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
io.log("Telemetry: " + (telemetry.enabled ? "enabled" : "off"));
|
|
11
|
+
io.log("Level: " + telemetry.level);
|
|
12
|
+
io.log("Policy: " + telemetry.policyVersion);
|
|
13
|
+
}
|
|
14
|
+
export async function telemetryEnableCommand(options, io) {
|
|
15
|
+
const level = parseTelemetryLevel(stringOption(options.level) ?? "metadata");
|
|
16
|
+
if (requiresSensitiveTelemetryOptIn(level) && !options["confirm-sensitive"]) {
|
|
17
|
+
throw new Error("prompt-sample and eval-dataset telemetry require --confirm-sensitive");
|
|
18
|
+
}
|
|
19
|
+
const telemetry = await enableTelemetryConsent({
|
|
20
|
+
level,
|
|
21
|
+
actor: stringOption(options.actor) ?? "user",
|
|
22
|
+
});
|
|
23
|
+
if (options.json) {
|
|
24
|
+
io.log(JSON.stringify(telemetry, null, 2));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
io.log("Telemetry enabled at level " + telemetry.level);
|
|
28
|
+
}
|
|
29
|
+
export async function telemetryExportCommand(options, io) {
|
|
30
|
+
const result = await exportTelemetryDataset({
|
|
31
|
+
dryRun: Boolean(options["dry-run"]),
|
|
32
|
+
});
|
|
33
|
+
if (options.json) {
|
|
34
|
+
io.log(JSON.stringify(result, null, 2));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
io.log((result.dryRun ? "Telemetry export dry run" : "Telemetry exported") +
|
|
38
|
+
": " +
|
|
39
|
+
result.recordCount +
|
|
40
|
+
" record(s)");
|
|
41
|
+
if (result.file) {
|
|
42
|
+
io.log("File: " + result.file);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export async function telemetrySubmitCommand(options, io) {
|
|
46
|
+
const result = await submitTelemetryDataset({
|
|
47
|
+
file: requireArg(options, "file"),
|
|
48
|
+
endpoint: requireArg(options, "endpoint"),
|
|
49
|
+
});
|
|
50
|
+
if (options.json) {
|
|
51
|
+
io.log(JSON.stringify(result, null, 2));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
io.log("Telemetry submission recorded: " + result.fileHash);
|
|
55
|
+
}
|
|
56
|
+
export async function telemetryEvalDatasetCommand(options, io) {
|
|
57
|
+
const result = await exportTelemetryEvalDataset({
|
|
58
|
+
dryRun: Boolean(options["dry-run"]),
|
|
59
|
+
});
|
|
60
|
+
if (options.json) {
|
|
61
|
+
io.log(JSON.stringify(result, null, 2));
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
io.log((result.dryRun ? "Eval dataset dry run" : "Eval dataset exported") +
|
|
65
|
+
": " +
|
|
66
|
+
result.recordCount +
|
|
67
|
+
" record(s)");
|
|
68
|
+
if (result.file) {
|
|
69
|
+
io.log("File: " + result.file);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export async function telemetryDisableCommand(options, io) {
|
|
73
|
+
const telemetry = await disableTelemetryConsent({
|
|
74
|
+
actor: stringOption(options.actor) ?? "user",
|
|
75
|
+
});
|
|
76
|
+
if (options.json) {
|
|
77
|
+
io.log(JSON.stringify(telemetry, null, 2));
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
io.log("Telemetry disabled");
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=telemetry-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-commands.js","sourceRoot":"","sources":["../src/telemetry-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,+BAA+B,EAC/B,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAGxB,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAmB,EACnB,EAAS;IAET,MAAM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;QAC9C,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;KACpC,CAAC,CAAC;IACH,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACxC,OAAO;IACT,CAAC;IACD,EAAE,CAAC,GAAG,CACJ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,uBAAuB,CAAC;QAChE,IAAI;QACJ,MAAM,CAAC,WAAW;QAClB,YAAY,CACf,CAAC;IACF,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,EAAE,CAAC,GAAG,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAAmB,EACnB,EAAS;IAET,MAAM,SAAS,GAAG,MAAM,uBAAuB,CAAC;QAC9C,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,MAAM;KAC7C,CAAC,CAAC;IACH,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3C,OAAO;IACT,CAAC;IACD,EAAE,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { requireArg } from "./args.js";
|
|
2
|
+
import { removeUndefined, stringOption } from "./command-utils.js";
|
|
3
|
+
import { lintMermaidDiagram, recordDiagramLintEvidence, } from "./diagram-validation.js";
|
|
4
|
+
import { evaluateMcpOAuthProxy, } from "./mcp-oauth-proxy.js";
|
|
5
|
+
export async function diagramsLintCommand(options, io) {
|
|
6
|
+
const result = await lintMermaidDiagram({
|
|
7
|
+
filePath: requireArg(options, "file"),
|
|
8
|
+
});
|
|
9
|
+
const evidence = stringOption(options.task)
|
|
10
|
+
? await recordDiagramLintEvidence({
|
|
11
|
+
taskId: stringOption(options.task) ?? "",
|
|
12
|
+
result,
|
|
13
|
+
})
|
|
14
|
+
: undefined;
|
|
15
|
+
const output = removeUndefined({ result, evidence });
|
|
16
|
+
if (options.json) {
|
|
17
|
+
io.log(JSON.stringify(output, null, 2));
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
io.log(result.valid ? "Mermaid diagram valid" : "Mermaid diagram invalid");
|
|
21
|
+
if (result.installHint) {
|
|
22
|
+
io.log(result.installHint);
|
|
23
|
+
}
|
|
24
|
+
if (evidence) {
|
|
25
|
+
io.log("Created " + evidence.artifact);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (!result.valid) {
|
|
29
|
+
throw new Error("diagram lint failed");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export async function mcpOAuthProxyEvaluateCommand(options, io) {
|
|
33
|
+
const evaluation = evaluateMcpOAuthProxy(removeUndefined({
|
|
34
|
+
enabled: Boolean(options.enable),
|
|
35
|
+
mode: parseMcpProxyMode(stringOption(options.mode) ?? "stdio-proxy"),
|
|
36
|
+
serverUrl: requireArg(options, "server-url"),
|
|
37
|
+
tokenStorage: parseMcpSecretStorage(stringOption(options["token-storage"]) ?? "keychain"),
|
|
38
|
+
tokenPath: stringOption(options["token-path"]),
|
|
39
|
+
refreshWindowSeconds: Number(stringOption(options["refresh-window"]) ?? 300),
|
|
40
|
+
approvedBy: options.approve
|
|
41
|
+
? (stringOption(options.approver) ?? "local-user")
|
|
42
|
+
: undefined,
|
|
43
|
+
}));
|
|
44
|
+
if (options.json) {
|
|
45
|
+
io.log(JSON.stringify(evaluation, null, 2));
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
io.log(evaluation.approved
|
|
49
|
+
? "MCP proxy plan approved"
|
|
50
|
+
: "MCP proxy plan has risks");
|
|
51
|
+
for (const risk of evaluation.risks) {
|
|
52
|
+
io.log("RISK: " + risk);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function parseMcpProxyMode(value) {
|
|
56
|
+
if (["stdio-proxy", "direct-http", "tool-native-oauth"].includes(value)) {
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
throw new Error("unknown MCP proxy mode: " + value);
|
|
60
|
+
}
|
|
61
|
+
function parseMcpSecretStorage(value) {
|
|
62
|
+
if (["keychain", "libsecret", "windows-credential", "secure-file"].includes(value)) {
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
throw new Error("unknown MCP secret storage: " + value);
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=tool-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-commands.js","sourceRoot":"","sources":["../src/tool-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,GAGtB,MAAM,sBAAsB,CAAC;AAG9B,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,OAAmB,EACnB,EAAS;IAET,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC;QACtC,QAAQ,EAAE,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC;KACtC,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC;QACzC,CAAC,CAAC,MAAM,yBAAyB,CAAC;YAC9B,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;YACxC,MAAM;SACP,CAAC;QACJ,CAAC,CAAC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
|
|
5
5
|
export type SkillLoadBudget = "small" | "normal" | "large";
|
|
6
6
|
export type SkillRenderTarget = "generic" | "claude" | "cursor" | "codex" | "vscode" | "windsurf";
|
|
7
7
|
export type RuntimeAdapterKind = "llm" | "ide" | "cli";
|
|
8
|
+
export type RuntimeExecutionId = "claude-cli" | "codex-cli" | "cursor-cli" | "vscode-agent" | "windsurf-agent" | "generic-runtime";
|
|
9
|
+
export type RuntimeDelegationMode = "runtime-native" | "brief-only";
|
|
8
10
|
export interface RuntimeAdapter {
|
|
9
11
|
target: SkillRenderTarget;
|
|
10
12
|
label: string;
|
|
@@ -15,6 +17,82 @@ export interface RuntimeAdapter {
|
|
|
15
17
|
supportsImports: boolean;
|
|
16
18
|
guidance: string;
|
|
17
19
|
}
|
|
20
|
+
export interface RuntimeExecutionCapabilities {
|
|
21
|
+
nonInteractive: boolean;
|
|
22
|
+
promptInjection: boolean;
|
|
23
|
+
structuredOutput: boolean;
|
|
24
|
+
fileEdits: boolean;
|
|
25
|
+
testExecution: boolean;
|
|
26
|
+
evidenceReturn: boolean;
|
|
27
|
+
requiresTty: boolean;
|
|
28
|
+
requiresUserApproval: boolean;
|
|
29
|
+
resumeSession: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface RuntimeSubagentCapabilities {
|
|
32
|
+
runtimeNative: boolean;
|
|
33
|
+
parallel: boolean;
|
|
34
|
+
namedRoles: boolean;
|
|
35
|
+
forkedContext: boolean;
|
|
36
|
+
structuredHandoff: boolean;
|
|
37
|
+
fileOwnership: boolean;
|
|
38
|
+
requiresParentApproval: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface RuntimeExecutionAdapter {
|
|
41
|
+
id: RuntimeExecutionId;
|
|
42
|
+
target: SkillRenderTarget;
|
|
43
|
+
label: string;
|
|
44
|
+
kind: RuntimeAdapterKind;
|
|
45
|
+
summary: string;
|
|
46
|
+
execution: RuntimeExecutionCapabilities;
|
|
47
|
+
subagents: RuntimeSubagentCapabilities;
|
|
48
|
+
briefOnlyFallback: boolean;
|
|
49
|
+
directProviderApiAllowed: false;
|
|
50
|
+
guidance: string;
|
|
51
|
+
}
|
|
52
|
+
export interface RuntimeExecutorConfig {
|
|
53
|
+
executor?: RuntimeExecutionId;
|
|
54
|
+
}
|
|
55
|
+
export interface RuntimeDelegationPolicy {
|
|
56
|
+
mode: RuntimeDelegationMode;
|
|
57
|
+
allowDirectProviderApi: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface RuntimeExecutionPolicy {
|
|
60
|
+
defaults?: RuntimeExecutorConfig;
|
|
61
|
+
byRole: Record<string, RuntimeExecutorConfig>;
|
|
62
|
+
byTask: Record<string, RuntimeExecutorConfig>;
|
|
63
|
+
delegation: RuntimeDelegationPolicy;
|
|
64
|
+
}
|
|
65
|
+
export interface RuntimeSelection {
|
|
66
|
+
taskId: string;
|
|
67
|
+
role: string;
|
|
68
|
+
runtime: RuntimeExecutionAdapter;
|
|
69
|
+
source: "explicit" | "task" | "role" | "default" | "fallback";
|
|
70
|
+
directProviderApiAllowed: false;
|
|
71
|
+
}
|
|
72
|
+
export interface RuntimeDelegationAssignment {
|
|
73
|
+
role: string;
|
|
74
|
+
paths: string[];
|
|
75
|
+
allowedCommands: string[];
|
|
76
|
+
expectedArtifacts: string[];
|
|
77
|
+
}
|
|
78
|
+
export interface RuntimeBrief {
|
|
79
|
+
taskId: string;
|
|
80
|
+
runtime: RuntimeExecutionId;
|
|
81
|
+
artifact: string;
|
|
82
|
+
content: string;
|
|
83
|
+
mode: "brief-only";
|
|
84
|
+
directProviderApiAllowed: false;
|
|
85
|
+
}
|
|
86
|
+
export interface RuntimeDelegationPacket {
|
|
87
|
+
taskId: string;
|
|
88
|
+
runtime: RuntimeExecutionId;
|
|
89
|
+
artifact: string;
|
|
90
|
+
content: string;
|
|
91
|
+
mode: RuntimeDelegationMode;
|
|
92
|
+
directProviderApiAllowed: false;
|
|
93
|
+
assignments: RuntimeDelegationAssignment[];
|
|
94
|
+
requiresApproval: boolean;
|
|
95
|
+
}
|
|
18
96
|
export type WorkspaceClassificationKind = "project" | "advisory" | "unsafe" | "unknown";
|
|
19
97
|
export type WorkspaceWritePolicy = "allow" | "confirm_required" | "blocked";
|
|
20
98
|
export interface WorkspaceClassification {
|
|
@@ -408,6 +486,7 @@ export interface WorkflowConfig {
|
|
|
408
486
|
github?: GitHubConfig;
|
|
409
487
|
notifications?: NotificationsConfig;
|
|
410
488
|
providerPolicy?: ProviderPolicyConfig;
|
|
489
|
+
runtimePolicy?: RuntimeExecutionPolicy;
|
|
411
490
|
staticAnalysis: {
|
|
412
491
|
preCommit: {
|
|
413
492
|
required: boolean;
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAogCA,MAAM,CAAC,MAAM,aAAa,GAAkB,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC"}
|
package/docs/runtime-llm-flow.md
CHANGED
|
@@ -116,6 +116,50 @@ optionally `ANTHROPIC_BASE_URL` for an HTTPS-compatible endpoint. It uses
|
|
|
116
116
|
Claude Messages API responses are normalized through text content rather than
|
|
117
117
|
OpenAI-style JSON schema response formatting.
|
|
118
118
|
|
|
119
|
+
## Runtime Execution
|
|
120
|
+
|
|
121
|
+
Runtime execution is separate from model provider routing. `ModelProvider`
|
|
122
|
+
adapters call vendor APIs directly and therefore require provider API keys.
|
|
123
|
+
Runtime execution adapters prepare work for an already-authenticated runtime
|
|
124
|
+
such as Claude CLI, Codex CLI, Cursor, VS Code, or Windsurf.
|
|
125
|
+
|
|
126
|
+
Use runtime execution when the user wants the active CLI/IDE agent to perform
|
|
127
|
+
the work and does not want Orchestra to call OpenAI, Anthropic, or another
|
|
128
|
+
vendor API directly:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
node bin/orchestra.js runtime adapters --json
|
|
132
|
+
node bin/orchestra.js runtime brief --task STORY-001 --runtime claude-cli
|
|
133
|
+
node bin/orchestra.js runtime delegate-plan --task STORY-001 --runtime claude-cli --roles architect,developer,qa
|
|
134
|
+
node bin/orchestra.js runtime handoff --task STORY-001 --runtime claude-cli --artifact .agent-workflow/runs/STORY-001-runtime-claude-cli-delegation.md
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Runtime briefs and delegation packets are written under `.agent-workflow/runs/`
|
|
138
|
+
and record provenance events. They are brief-only control artifacts in this
|
|
139
|
+
release; Orchestra does not launch arbitrary runtime processes or silently fall
|
|
140
|
+
back to vendor APIs.
|
|
141
|
+
|
|
142
|
+
Runtime policy can force executor selection without API keys:
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"runtimePolicy": {
|
|
147
|
+
"defaults": { "executor": "generic-runtime" },
|
|
148
|
+
"byRole": { "developer": { "executor": "codex-cli" } },
|
|
149
|
+
"byTask": { "STORY-001": { "executor": "claude-cli" } },
|
|
150
|
+
"delegation": {
|
|
151
|
+
"mode": "runtime-native",
|
|
152
|
+
"allowDirectProviderApi": false
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
If a runtime does not support native subagents, Orchestra renders a delegation
|
|
159
|
+
packet in `brief-only` mode and requires user approval before any other
|
|
160
|
+
execution strategy. Direct provider API calls remain forbidden by runtime
|
|
161
|
+
execution packets.
|
|
162
|
+
|
|
119
163
|
Provider policy can restrict real adapters with `allowedProviders` and
|
|
120
164
|
`blockedProviders`. Cross-vendor fallback is blocked by default; enable
|
|
121
165
|
`allowVendorFallbackWithoutApproval` only after recording the required approval
|
|
@@ -133,6 +177,8 @@ budget fallback.
|
|
|
133
177
|
an OpenAI adapter for the Responses API, and an Anthropic adapter for the
|
|
134
178
|
Claude Messages API. Additional vendors need explicit implementation and
|
|
135
179
|
approval.
|
|
180
|
+
- Runtime execution adapters render briefs and delegation packets, but they do
|
|
181
|
+
not yet launch external CLI/IDE processes non-interactively.
|
|
136
182
|
- It records delegation decisions, but it does not automatically spawn
|
|
137
183
|
subagents yet.
|
|
138
184
|
- Parallel independent CLI commands are expected to work, but dependent commands
|