@a5c-ai/genty-platform 5.1.1-staging.fee05906043b → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/breakpoints.d.ts +1 -1
- package/dist/api/breakpoints.d.ts.map +1 -1
- package/dist/api/breakpoints.js +15 -15
- package/dist/api/effects.d.ts.map +1 -1
- package/dist/api/effects.js +21 -26
- package/dist/api/effectsTypes.d.ts +1 -1
- package/dist/api/effectsTypes.d.ts.map +1 -1
- package/dist/api/eventStream.d.ts.map +1 -1
- package/dist/api/eventStream.js +3 -2
- package/dist/api/runs.d.ts +1 -1
- package/dist/api/runs.d.ts.map +1 -1
- package/dist/api/runs.js +61 -29
- package/dist/api/utils.d.ts +1 -1
- package/dist/api/utils.d.ts.map +1 -1
- package/dist/breakpoints/analytics.d.ts +46 -0
- package/dist/breakpoints/analytics.d.ts.map +1 -0
- package/dist/breakpoints/analytics.js +64 -0
- package/dist/breakpoints/delegation.js +4 -4
- package/dist/breakpoints/postures.d.ts +1 -1
- package/dist/breakpoints/postures.d.ts.map +1 -1
- package/dist/cost/effectCost.d.ts +1 -1
- package/dist/cost/effectCost.d.ts.map +1 -1
- package/dist/cost/journal.d.ts +1 -1
- package/dist/cost/journal.d.ts.map +1 -1
- package/dist/cost/journal.js +11 -6
- package/dist/governance/bridge.d.ts +1 -1
- package/dist/governance/bridge.d.ts.map +1 -1
- package/dist/governance/postureBridge.d.ts +1 -1
- package/dist/governance/postureBridge.d.ts.map +1 -1
- package/dist/governance/privacySettings.d.ts +31 -0
- package/dist/governance/privacySettings.d.ts.map +1 -0
- package/dist/governance/privacySettings.js +104 -0
- package/dist/governance/types.d.ts +6 -2
- package/dist/governance/types.d.ts.map +1 -1
- package/dist/governance/types.js +8 -3
- package/dist/harness/capabilityRouter.d.ts.map +1 -1
- package/dist/harness/capabilityRouter.js +1 -0
- package/dist/harness/extensionToolBridge.d.ts +9 -11
- package/dist/harness/extensionToolBridge.d.ts.map +1 -1
- package/dist/harness/extensionToolBridge.js +26 -1
- package/dist/harness/index.d.ts +1 -0
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js +10 -1
- package/dist/harness/internal/createRun/agent-core-loop.d.ts +3 -2
- package/dist/harness/internal/createRun/agent-core-loop.d.ts.map +1 -1
- package/dist/harness/internal/createRun/index.d.ts.map +1 -1
- package/dist/harness/internal/createRun/index.js +35 -2
- package/dist/harness/internal/createRun/orchestration/constants.d.ts +1 -0
- package/dist/harness/internal/createRun/orchestration/constants.d.ts.map +1 -1
- package/dist/harness/internal/createRun/orchestration/constants.js +6 -1
- package/dist/harness/internal/createRun/orchestration/dispatch.d.ts +1 -1
- package/dist/harness/internal/createRun/orchestration/dispatch.d.ts.map +1 -1
- package/dist/harness/internal/createRun/orchestration/dispatch.js +9 -2
- package/dist/harness/internal/createRun/orchestration/effects.d.ts.map +1 -1
- package/dist/harness/internal/createRun/orchestration/effects.js +75 -31
- package/dist/harness/internal/createRun/orchestration/externalPhase.d.ts.map +1 -1
- package/dist/harness/internal/createRun/orchestration/externalPhase.js +14 -13
- package/dist/harness/internal/createRun/orchestration/externalPhaseHelpers.d.ts.map +1 -1
- package/dist/harness/internal/createRun/orchestration/externalPhaseHelpers.js +1 -0
- package/dist/harness/internal/createRun/orchestration/index.d.ts +21 -1
- package/dist/harness/internal/createRun/orchestration/index.d.ts.map +1 -1
- package/dist/harness/internal/createRun/orchestration/index.js +148 -13
- package/dist/harness/internal/createRun/orchestration/internalPhase.d.ts +19 -0
- package/dist/harness/internal/createRun/orchestration/internalPhase.d.ts.map +1 -1
- package/dist/harness/internal/createRun/orchestration/internalPhase.js +139 -8
- package/dist/harness/internal/createRun/orchestration/internalTools.d.ts +2 -1
- package/dist/harness/internal/createRun/orchestration/internalTools.d.ts.map +1 -1
- package/dist/harness/internal/createRun/orchestration/internalTools.js +14 -13
- package/dist/harness/internal/createRun/output.d.ts +1 -1
- package/dist/harness/internal/createRun/output.d.ts.map +1 -1
- package/dist/harness/internal/createRun/output.js +2 -0
- package/dist/harness/internal/createRun/planProcess/agentOutput.d.ts.map +1 -1
- package/dist/harness/internal/createRun/planProcess/agentOutput.js +58 -10
- package/dist/harness/internal/createRun/planProcess/delegation.d.ts +11 -1
- package/dist/harness/internal/createRun/planProcess/delegation.d.ts.map +1 -1
- package/dist/harness/internal/createRun/planProcess/delegation.js +28 -2
- package/dist/harness/internal/createRun/planProcess/external.d.ts.map +1 -1
- package/dist/harness/internal/createRun/planProcess/external.js +2 -1
- package/dist/harness/internal/createRun/planProcess/phase.d.ts.map +1 -1
- package/dist/harness/internal/createRun/planProcess/phase.js +42 -70
- package/dist/harness/internal/createRun/planProcess/phaseHelpers.d.ts +8 -1
- package/dist/harness/internal/createRun/planProcess/phaseHelpers.d.ts.map +1 -1
- package/dist/harness/internal/createRun/planProcess/phaseHelpers.js +3 -1
- package/dist/harness/internal/createRun/planProcess/prompts.d.ts.map +1 -1
- package/dist/harness/internal/createRun/planProcess/prompts.js +2 -0
- package/dist/harness/internal/createRun/planProcess/runState.d.ts.map +1 -1
- package/dist/harness/internal/createRun/planProcess/runState.js +8 -8
- package/dist/harness/internal/createRun/planProcess/validation.d.ts +8 -2
- package/dist/harness/internal/createRun/planProcess/validation.d.ts.map +1 -1
- package/dist/harness/internal/createRun/planProcess/validation.js +31 -2
- package/dist/harness/internal/createRun/prompts.d.ts +18 -1
- package/dist/harness/internal/createRun/prompts.d.ts.map +1 -1
- package/dist/harness/internal/createRun/prompts.js +39 -0
- package/dist/harness/internal/createRun/resumeState.d.ts.map +1 -1
- package/dist/harness/internal/createRun/resumeState.js +8 -7
- package/dist/harness/internal/createRun/utils.d.ts +16 -5
- package/dist/harness/internal/createRun/utils.d.ts.map +1 -1
- package/dist/harness/internal/createRun/utils.js +22 -3
- package/dist/harness/internal.d.ts.map +1 -1
- package/dist/harness/internal.js +2 -0
- package/dist/harness/invoker.d.ts.map +1 -1
- package/dist/harness/invoker.js +11 -9
- package/dist/harness/lspIntegration.d.ts +48 -0
- package/dist/harness/lspIntegration.d.ts.map +1 -0
- package/dist/harness/lspIntegration.js +45 -0
- package/dist/harness/oauthIntegration.d.ts +55 -0
- package/dist/harness/oauthIntegration.d.ts.map +1 -0
- package/dist/harness/oauthIntegration.js +84 -0
- package/dist/harness/types.d.ts +15 -4
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/harness/worktreeIsolation.d.ts +39 -0
- package/dist/harness/worktreeIsolation.d.ts.map +1 -0
- package/dist/harness/worktreeIsolation.js +85 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/interaction/interactionRouter.d.ts +1 -1
- package/dist/interaction/interactionRouter.d.ts.map +1 -1
- package/dist/mcp/client/auth.d.ts +57 -0
- package/dist/mcp/client/auth.d.ts.map +1 -0
- package/dist/mcp/client/auth.js +99 -0
- package/dist/microagents/discovery.d.ts +34 -0
- package/dist/microagents/discovery.d.ts.map +1 -0
- package/dist/microagents/discovery.js +72 -0
- package/dist/microagents/dispatch.d.ts +36 -0
- package/dist/microagents/dispatch.d.ts.map +1 -0
- package/dist/microagents/dispatch.js +59 -0
- package/dist/microagents/index.d.ts +35 -0
- package/dist/microagents/index.d.ts.map +1 -0
- package/dist/microagents/index.js +44 -0
- package/dist/microagents/subprocess.d.ts +41 -0
- package/dist/microagents/subprocess.d.ts.map +1 -0
- package/dist/microagents/subprocess.js +75 -0
- package/dist/observability/auditExport.d.ts +25 -0
- package/dist/observability/auditExport.d.ts.map +1 -0
- package/dist/observability/auditExport.js +108 -0
- package/dist/observability/health.d.ts +1 -1
- package/dist/observability/health.d.ts.map +1 -1
- package/dist/observability/index.d.ts +2 -0
- package/dist/observability/index.d.ts.map +1 -1
- package/dist/observability/index.js +10 -1
- package/dist/observability/progressSummarizer.d.ts +27 -0
- package/dist/observability/progressSummarizer.d.ts.map +1 -0
- package/dist/observability/progressSummarizer.js +143 -0
- package/dist/observability/runStatus.d.ts.map +1 -1
- package/dist/observability/runStatus.js +6 -5
- package/dist/observability/timeline.d.ts +1 -1
- package/dist/observability/timeline.d.ts.map +1 -1
- package/dist/observability/timeline.js +2 -2
- package/dist/orchestration/defaultOrchestrationProvider.d.ts +30 -0
- package/dist/orchestration/defaultOrchestrationProvider.d.ts.map +1 -0
- package/dist/orchestration/defaultOrchestrationProvider.js +304 -0
- package/dist/orchestration/global.d.ts +27 -0
- package/dist/orchestration/global.d.ts.map +1 -0
- package/dist/orchestration/global.js +51 -0
- package/dist/orchestration/index.d.ts +12 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +17 -0
- package/dist/orchestration/interfaces.d.ts +136 -0
- package/dist/orchestration/interfaces.d.ts.map +1 -0
- package/dist/orchestration/interfaces.js +11 -0
- package/dist/orchestration/registry.d.ts +30 -0
- package/dist/orchestration/registry.d.ts.map +1 -0
- package/dist/orchestration/registry.js +148 -0
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +5 -1
- package/dist/plugins/marketplace.d.ts +64 -0
- package/dist/plugins/marketplace.d.ts.map +1 -0
- package/dist/plugins/marketplace.js +101 -0
- package/dist/runtime/index.d.ts +8 -2
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +8 -27
- package/dist/seams/contract.d.ts +4 -4
- package/dist/seams/contract.d.ts.map +1 -1
- package/dist/seams/contract.js +5 -0
- package/dist/session/crossRunComm.d.ts +40 -0
- package/dist/session/crossRunComm.d.ts.map +1 -0
- package/dist/session/crossRunComm.js +86 -0
- package/dist/session/discovery.d.ts +1 -1
- package/dist/session/discovery.d.ts.map +1 -1
- package/dist/session/discovery.js +19 -3
- package/dist/session/index.d.ts +1 -0
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +4 -1
- package/dist/session/memoryConsolidation.d.ts +31 -0
- package/dist/session/memoryConsolidation.d.ts.map +1 -0
- package/dist/session/memoryConsolidation.js +135 -0
- package/dist/session/sessionSharing.d.ts +55 -0
- package/dist/session/sessionSharing.d.ts.map +1 -0
- package/dist/session/sessionSharing.js +113 -0
- package/dist/session/sessionTemplates.d.ts +57 -0
- package/dist/session/sessionTemplates.d.ts.map +1 -0
- package/dist/session/sessionTemplates.js +93 -0
- package/dist/storage/index.d.ts +2 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +3 -1
- package/dist/storage/runFiles.d.ts +29 -0
- package/dist/storage/runFiles.d.ts.map +1 -0
- package/dist/storage/runFiles.js +85 -0
- package/dist/storage/snapshotState.d.ts +1 -1
- package/dist/storage/types.d.ts +2 -2
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/types.d.ts +81 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +21 -0
- package/dist/utils/atomic.d.ts +16 -0
- package/dist/utils/atomic.d.ts.map +1 -0
- package/dist/utils/atomic.js +75 -0
- package/dist/utils/concurrency.d.ts +27 -0
- package/dist/utils/concurrency.d.ts.map +1 -0
- package/dist/utils/concurrency.js +42 -0
- package/dist/utils/defaults.d.ts +11 -0
- package/dist/utils/defaults.d.ts.map +1 -0
- package/dist/utils/defaults.js +13 -0
- package/dist/utils/errors.d.ts +50 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +76 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/patterns.d.ts +35 -0
- package/dist/utils/patterns.d.ts.map +1 -0
- package/dist/utils/patterns.js +84 -0
- package/package.json +18 -9
- package/dist/harness/piSecureSandbox.d.ts +0 -8
- package/dist/harness/piSecureSandbox.d.ts.map +0 -1
- package/dist/harness/piSecureSandbox.js +0 -366
- package/dist/harness/piSecureSandboxTypes.d.ts +0 -51
- package/dist/harness/piSecureSandboxTypes.d.ts.map +0 -1
- package/dist/harness/piSecureSandboxTypes.js +0 -6
- package/dist/harness/piWrapper/compaction.d.ts +0 -13
- package/dist/harness/piWrapper/compaction.d.ts.map +0 -1
- package/dist/harness/piWrapper/compaction.js +0 -38
- package/dist/harness/piWrapper/instructionPrompts.d.ts +0 -2
- package/dist/harness/piWrapper/instructionPrompts.d.ts.map +0 -1
- package/dist/harness/piWrapper/instructionPrompts.js +0 -97
- package/dist/harness/piWrapper/moduleSupport.d.ts +0 -78
- package/dist/harness/piWrapper/moduleSupport.d.ts.map +0 -1
- package/dist/harness/piWrapper/moduleSupport.js +0 -207
- package/dist/harness/piWrapper.d.ts +0 -82
- package/dist/harness/piWrapper.d.ts.map +0 -1
- package/dist/harness/piWrapper.js +0 -406
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* and never throw.
|
|
7
7
|
*/
|
|
8
8
|
import type { ApiResult } from "./runs";
|
|
9
|
-
import type { AutoApprovalResult, BreakpointConfig, BreakpointRule } from "
|
|
9
|
+
import type { AutoApprovalResult, BreakpointConfig, BreakpointRule } from "../types";
|
|
10
10
|
export interface ListBreakpointsOutput {
|
|
11
11
|
breakpoints: BreakpointSummary[];
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../src/api/breakpoints.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAkBH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EAEf,MAAM,
|
|
1
|
+
{"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../src/api/breakpoints.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAkBH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EAEf,MAAM,UAAU,CAAC;AAIlB,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,iBAAiB,EAAE,CAAC;CAClC;AA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AS,CAAC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,cAAc,EAAE,CAAA;CAAE,CAAC,CAAC,CA2BvE;AAED,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5C,OAAO,CAAC,SAAS,CAAC;IAAE,KAAK,EAAE,cAAc,EAAE,CAAA;CAAE,CAAC,CAAC,CAiBjD;AAED,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,CAoBxC"}
|
package/dist/api/breakpoints.js
CHANGED
|
@@ -48,7 +48,11 @@ exports.apiAddAutoApprovalRule = apiAddAutoApprovalRule;
|
|
|
48
48
|
exports.apiRemoveAutoApprovalRule = apiRemoveAutoApprovalRule;
|
|
49
49
|
exports.apiEvaluateAutoApproval = apiEvaluateAutoApproval;
|
|
50
50
|
const crypto = __importStar(require("node:crypto"));
|
|
51
|
+
// SDK-owned: breakpoint rule management, hook execution, task result
|
|
52
|
+
// serialisation, and run locking are SDK runtime primitives
|
|
51
53
|
const babysitter_sdk_1 = require("@a5c-ai/babysitter-sdk");
|
|
54
|
+
const global_1 = require("../orchestration/global");
|
|
55
|
+
const runFiles_1 = require("../storage/runFiles");
|
|
52
56
|
const utils_1 = require("./utils");
|
|
53
57
|
// ── Internal helpers ───────────────────────────────────────────────────────
|
|
54
58
|
function isBreakpointEffect(info) {
|
|
@@ -63,7 +67,7 @@ async function apiListBreakpoints(input) {
|
|
|
63
67
|
if (!(await (0, utils_1.pathExists)(input.runDir))) {
|
|
64
68
|
return (0, utils_1.fail)("RUN_NOT_FOUND", `Run directory not found: ${input.runDir}`);
|
|
65
69
|
}
|
|
66
|
-
const events = await (0,
|
|
70
|
+
const events = await (0, global_1.loadJournalEvents)(input.runDir);
|
|
67
71
|
const effectMap = (0, utils_1.buildBaseEffectMap)(events);
|
|
68
72
|
const breakpoints = [];
|
|
69
73
|
for (const info of effectMap.values()) {
|
|
@@ -74,7 +78,7 @@ async function apiListBreakpoints(input) {
|
|
|
74
78
|
// Read task definition to extract breakpoint-specific fields
|
|
75
79
|
let taskDef;
|
|
76
80
|
try {
|
|
77
|
-
taskDef = await (0,
|
|
81
|
+
taskDef = await (0, runFiles_1.readTaskDefinition)(input.runDir, info.effectId);
|
|
78
82
|
}
|
|
79
83
|
catch {
|
|
80
84
|
// task.json may not exist
|
|
@@ -109,7 +113,7 @@ async function apiShowBreakpoint(input) {
|
|
|
109
113
|
if (!(await (0, utils_1.pathExists)(input.runDir))) {
|
|
110
114
|
return (0, utils_1.fail)("RUN_NOT_FOUND", `Run directory not found: ${input.runDir}`);
|
|
111
115
|
}
|
|
112
|
-
const events = await (0,
|
|
116
|
+
const events = await (0, global_1.loadJournalEvents)(input.runDir);
|
|
113
117
|
const effectMap = (0, utils_1.buildBaseEffectMap)(events);
|
|
114
118
|
const info = effectMap.get(input.effectId);
|
|
115
119
|
if (!info) {
|
|
@@ -121,7 +125,7 @@ async function apiShowBreakpoint(input) {
|
|
|
121
125
|
// Read task definition
|
|
122
126
|
let taskDef;
|
|
123
127
|
try {
|
|
124
|
-
taskDef = await (0,
|
|
128
|
+
taskDef = await (0, runFiles_1.readTaskDefinition)(input.runDir, input.effectId);
|
|
125
129
|
}
|
|
126
130
|
catch {
|
|
127
131
|
// task.json may not exist
|
|
@@ -130,7 +134,7 @@ async function apiShowBreakpoint(input) {
|
|
|
130
134
|
let resultData = undefined;
|
|
131
135
|
if (info.lifecycle === "resolved") {
|
|
132
136
|
try {
|
|
133
|
-
const storedResult = await (0,
|
|
137
|
+
const storedResult = await (0, runFiles_1.readTaskResult)(input.runDir, input.effectId);
|
|
134
138
|
resultData = storedResult ?? undefined;
|
|
135
139
|
}
|
|
136
140
|
catch {
|
|
@@ -178,7 +182,7 @@ async function apiRespondToBreakpoint(input) {
|
|
|
178
182
|
return (0, utils_1.fail)("RUN_NOT_FOUND", `Run directory not found: ${input.runDir}`);
|
|
179
183
|
}
|
|
180
184
|
return await (0, babysitter_sdk_1.withRunLock)(input.runDir, "api:respondToBreakpoint", async () => {
|
|
181
|
-
const events = await (0,
|
|
185
|
+
const events = await (0, global_1.loadJournalEvents)(input.runDir);
|
|
182
186
|
const effectMap = (0, utils_1.buildBaseEffectMap)(events);
|
|
183
187
|
const info = effectMap.get(input.effectId);
|
|
184
188
|
if (!info) {
|
|
@@ -214,18 +218,14 @@ async function apiRespondToBreakpoint(input) {
|
|
|
214
218
|
result: breakpointResult,
|
|
215
219
|
},
|
|
216
220
|
});
|
|
217
|
-
await (0,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
effectId: input.effectId,
|
|
222
|
-
status: "ok",
|
|
223
|
-
resultRef,
|
|
224
|
-
},
|
|
221
|
+
await (0, global_1.appendJournalEvent)(input.runDir, "EFFECT_RESOLVED", {
|
|
222
|
+
effectId: input.effectId,
|
|
223
|
+
status: "ok",
|
|
224
|
+
resultRef,
|
|
225
225
|
});
|
|
226
226
|
// GAP-SEC-003: Fire on-permission-denied hook when breakpoint is denied
|
|
227
227
|
if (!input.approved) {
|
|
228
|
-
const td = await (0,
|
|
228
|
+
const td = await (0, runFiles_1.readTaskDefinition)(input.runDir, input.effectId).catch(() => undefined);
|
|
229
229
|
const bpId = td?.breakpointId;
|
|
230
230
|
const kind = td?.kind;
|
|
231
231
|
(0, babysitter_sdk_1.callHook)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effects.d.ts","sourceRoot":"","sources":["../../src/api/effects.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"effects.d.ts","sourceRoot":"","sources":["../../src/api/effects.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGxC,OAAO,KAAK,EAC8B,gBAAgB,EAAE,iBAAiB,EAC3E,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EACxE,uBAAuB,EAA2B,wBAAwB,EAC3E,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EAC3E,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EACxE,uBAAuB,EAAE,uBAAuB,EAAE,wBAAwB,GAC3E,MAAM,gBAAgB,CAAC;AAyCxB,wBAAsB,cAAc,CAClC,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAgDvC;AAED,wBAAsB,aAAa,CACjC,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAuDtC;AAED,wBAAsB,eAAe,CACnC,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,CAkDxC;AAED,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC,CAoG9C"}
|
package/dist/api/effects.js
CHANGED
|
@@ -10,7 +10,10 @@ exports.apiListEffects = apiListEffects;
|
|
|
10
10
|
exports.apiShowEffect = apiShowEffect;
|
|
11
11
|
exports.apiCancelEffect = apiCancelEffect;
|
|
12
12
|
exports.apiBatchCommitEffects = apiBatchCommitEffects;
|
|
13
|
+
// SDK-owned: task result serialisation and run locking are SDK runtime primitives
|
|
13
14
|
const babysitter_sdk_1 = require("@a5c-ai/babysitter-sdk");
|
|
15
|
+
const global_1 = require("../orchestration/global");
|
|
16
|
+
const runFiles_1 = require("../storage/runFiles");
|
|
14
17
|
const utils_1 = require("./utils");
|
|
15
18
|
function toEffectStatus(base) {
|
|
16
19
|
if (base.lifecycle === "cancelled")
|
|
@@ -45,7 +48,7 @@ async function apiListEffects(input) {
|
|
|
45
48
|
if (!(await (0, utils_1.pathExists)(input.runDir))) {
|
|
46
49
|
return (0, utils_1.fail)("RUN_NOT_FOUND", `Run directory not found: ${input.runDir}`);
|
|
47
50
|
}
|
|
48
|
-
const events = await (0,
|
|
51
|
+
const events = await (0, global_1.loadJournalEvents)(input.runDir);
|
|
49
52
|
const effectMap = buildEffectInfoMap(events);
|
|
50
53
|
let effects = Array.from(effectMap.values());
|
|
51
54
|
// Apply filters
|
|
@@ -101,7 +104,7 @@ async function apiShowEffect(input) {
|
|
|
101
104
|
if (!(await (0, utils_1.pathExists)(input.runDir))) {
|
|
102
105
|
return (0, utils_1.fail)("RUN_NOT_FOUND", `Run directory not found: ${input.runDir}`);
|
|
103
106
|
}
|
|
104
|
-
const events = await (0,
|
|
107
|
+
const events = await (0, global_1.loadJournalEvents)(input.runDir);
|
|
105
108
|
const effectMap = buildEffectInfoMap(events);
|
|
106
109
|
const info = effectMap.get(input.effectId);
|
|
107
110
|
if (!info) {
|
|
@@ -110,7 +113,7 @@ async function apiShowEffect(input) {
|
|
|
110
113
|
// Read task definition (may be missing if the task dir hasn't been created yet)
|
|
111
114
|
let taskDef = undefined;
|
|
112
115
|
try {
|
|
113
|
-
taskDef = await (0,
|
|
116
|
+
taskDef = await (0, runFiles_1.readTaskDefinition)(input.runDir, input.effectId);
|
|
114
117
|
}
|
|
115
118
|
catch {
|
|
116
119
|
// task.json may not exist yet for freshly-requested effects
|
|
@@ -118,7 +121,7 @@ async function apiShowEffect(input) {
|
|
|
118
121
|
// Read result if resolved
|
|
119
122
|
let resultData = null;
|
|
120
123
|
if (info.status === "resolved_ok" || info.status === "resolved_error") {
|
|
121
|
-
const storedResult = await (0,
|
|
124
|
+
const storedResult = await (0, runFiles_1.readTaskResult)(input.runDir, input.effectId);
|
|
122
125
|
resultData = storedResult ?? null;
|
|
123
126
|
}
|
|
124
127
|
const output = {
|
|
@@ -160,7 +163,7 @@ async function apiCancelEffect(input) {
|
|
|
160
163
|
return (0, utils_1.fail)("RUN_NOT_FOUND", `Run directory not found: ${input.runDir}`);
|
|
161
164
|
}
|
|
162
165
|
return await (0, babysitter_sdk_1.withRunLock)(input.runDir, "api:cancelEffect", async () => {
|
|
163
|
-
const events = await (0,
|
|
166
|
+
const events = await (0, global_1.loadJournalEvents)(input.runDir);
|
|
164
167
|
const effectMap = buildEffectInfoMap(events);
|
|
165
168
|
const info = effectMap.get(input.effectId);
|
|
166
169
|
if (!info) {
|
|
@@ -186,13 +189,9 @@ async function apiCancelEffect(input) {
|
|
|
186
189
|
metadata: { cancelled: true, reason: input.reason },
|
|
187
190
|
},
|
|
188
191
|
});
|
|
189
|
-
await (0,
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
event: {
|
|
193
|
-
effectId: input.effectId,
|
|
194
|
-
reason: input.reason,
|
|
195
|
-
},
|
|
192
|
+
await (0, global_1.appendJournalEvent)(input.runDir, "EFFECT_CANCELLED", {
|
|
193
|
+
effectId: input.effectId,
|
|
194
|
+
reason: input.reason,
|
|
196
195
|
});
|
|
197
196
|
return (0, utils_1.ok)({ resultRef });
|
|
198
197
|
});
|
|
@@ -219,7 +218,7 @@ async function apiBatchCommitEffects(input) {
|
|
|
219
218
|
// Acquire lock once for the entire batch to ensure atomicity
|
|
220
219
|
return await (0, babysitter_sdk_1.withRunLock)(input.runDir, "api:batchCommitEffects", async () => {
|
|
221
220
|
// Load journal once for the entire batch
|
|
222
|
-
let events = await (0,
|
|
221
|
+
let events = await (0, global_1.loadJournalEvents)(input.runDir);
|
|
223
222
|
const results = [];
|
|
224
223
|
for (const entry of input.effects) {
|
|
225
224
|
try {
|
|
@@ -266,21 +265,17 @@ async function apiBatchCommitEffects(input) {
|
|
|
266
265
|
invocationKey,
|
|
267
266
|
payload: resultPayload,
|
|
268
267
|
});
|
|
269
|
-
await (0,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
stderrRef: stderrRef ?? undefined,
|
|
278
|
-
startedAt: resultPayload.startedAt,
|
|
279
|
-
finishedAt: resultPayload.finishedAt,
|
|
280
|
-
},
|
|
268
|
+
await (0, global_1.appendJournalEvent)(input.runDir, "EFFECT_RESOLVED", {
|
|
269
|
+
effectId: entry.effectId,
|
|
270
|
+
status: entry.result.status,
|
|
271
|
+
resultRef,
|
|
272
|
+
stdoutRef: stdoutRef ?? undefined,
|
|
273
|
+
stderrRef: stderrRef ?? undefined,
|
|
274
|
+
startedAt: resultPayload.startedAt,
|
|
275
|
+
finishedAt: resultPayload.finishedAt,
|
|
281
276
|
});
|
|
282
277
|
// Reload journal so subsequent effects in the batch see this resolution
|
|
283
|
-
events = await (0,
|
|
278
|
+
events = await (0, global_1.loadJournalEvents)(input.runDir);
|
|
284
279
|
results.push({
|
|
285
280
|
effectId: entry.effectId,
|
|
286
281
|
ok: true,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Type definitions for the effects API.
|
|
3
3
|
* Extracted from effects.ts for max-lines compliance.
|
|
4
4
|
*/
|
|
5
|
-
import type { JsonRecord } from "
|
|
5
|
+
import type { JsonRecord } from "../types";
|
|
6
6
|
export type EffectStatusFilter = "requested" | "resolved" | "cancelled";
|
|
7
7
|
export type EffectStatusOutput = "requested" | "resolved_ok" | "resolved_error" | "cancelled";
|
|
8
8
|
export interface ListEffectsInput {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effectsTypes.d.ts","sourceRoot":"","sources":["../../src/api/effectsTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"effectsTypes.d.ts","sourceRoot":"","sources":["../../src/api/effectsTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,UAAU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,EAAE,MAAM,CAAA;CAAE;AACxF,MAAM,WAAW,kBAAkB;IAAG,SAAS,EAAE,MAAM,CAAA;CAAE;AAEzD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE;QACN,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC;QACvB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,UAAU,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,uBAAuB;IAAG,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,sBAAsB,EAAE,CAAA;CAAE;AAC9F,MAAM,WAAW,uBAAuB;IAAG,QAAQ,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE;AAC9G,MAAM,WAAW,wBAAwB;IAAG,OAAO,EAAE,uBAAuB,EAAE,CAAA;CAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventStream.d.ts","sourceRoot":"","sources":["../../src/api/eventStream.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"eventStream.d.ts","sourceRoot":"","sources":["../../src/api/eventStream.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIrD,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,wBAAwB;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,CAAC;CACjB;AAaD,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC,CAyC9C;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE;IAAE,cAAc,EAAE,MAAM,CAAA;CAAE,GAChC,SAAS,CAAC,0BAA0B,CAAC,CAoBvC;AAED,wBAAgB,sBAAsB,IAAI,GAAG,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CASxF;AAED,wBAAgB,qBAAqB,IAAI,IAAI,CAK5C"}
|
package/dist/api/eventStream.js
CHANGED
|
@@ -44,7 +44,8 @@ exports.apiUnsubscribeRunEvents = apiUnsubscribeRunEvents;
|
|
|
44
44
|
exports.getActiveSubscriptions = getActiveSubscriptions;
|
|
45
45
|
exports.closeAllSubscriptions = closeAllSubscriptions;
|
|
46
46
|
const crypto = __importStar(require("node:crypto"));
|
|
47
|
-
const
|
|
47
|
+
const path = __importStar(require("node:path"));
|
|
48
|
+
const global_1 = require("../orchestration/global");
|
|
48
49
|
const journalWatcher_1 = require("../storage/journalWatcher");
|
|
49
50
|
const utils_1 = require("./utils");
|
|
50
51
|
const subscriptions = new Map();
|
|
@@ -57,7 +58,7 @@ async function apiSubscribeRunEvents(input) {
|
|
|
57
58
|
if (typeof input.runsDir === "string" && input.runsDir.trim().length === 0) {
|
|
58
59
|
return (0, utils_1.fail)("INVALID_INPUT", "runsDir must be a non-empty string");
|
|
59
60
|
}
|
|
60
|
-
const runDir =
|
|
61
|
+
const runDir = path.join(input.runsDir ?? (0, global_1.getGlobalRegistry)().getOrchestration().resolveRunsDir(), input.runId);
|
|
61
62
|
if (!(await (0, utils_1.pathExists)(runDir))) {
|
|
62
63
|
return (0, utils_1.fail)("RUN_NOT_FOUND", `Run not found: ${input.runId}`);
|
|
63
64
|
}
|
package/dist/api/runs.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Thin typed wrappers over existing runtime functions with validation,
|
|
5
5
|
* error handling, and ApiResult envelopes. These functions never throw.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import type { EffectAction, IterationResult, JsonRecord } from "../types";
|
|
8
8
|
export type ApiResult<T> = {
|
|
9
9
|
ok: true;
|
|
10
10
|
data: T;
|
package/dist/api/runs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/api/runs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/api/runs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAEf,UAAU,EACX,MAAM,UAAU,CAAC;AAIlB,MAAM,MAAM,SAAS,CAAC,CAAC,IACnB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GACrB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAA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;CAAE,GACxB,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CA6BtC;AAED,wBAAsB,eAAe,CACnC,KAAK,EAAE;IACL,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE;QACN,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC;QACvB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,UAAU,CAAC;KACvB,CAAC;CACH,GACA,OAAO,CAAC,SAAS,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAgC3C;AAED,wBAAsB,YAAY,CAChC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACzC,OAAO,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAwBrC;AAED,wBAAsB,YAAY,CAChC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9E,OAAO,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAkCrC"}
|
package/dist/api/runs.js
CHANGED
|
@@ -5,6 +5,39 @@
|
|
|
5
5
|
* Thin typed wrappers over existing runtime functions with validation,
|
|
6
6
|
* error handling, and ApiResult envelopes. These functions never throw.
|
|
7
7
|
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
8
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
42
|
exports.apiCreateRun = apiCreateRun;
|
|
10
43
|
exports.apiIterate = apiIterate;
|
|
@@ -12,7 +45,11 @@ exports.apiCommitEffect = apiCommitEffect;
|
|
|
12
45
|
exports.apiRunStatus = apiRunStatus;
|
|
13
46
|
exports.apiRunEvents = apiRunEvents;
|
|
14
47
|
const fs_1 = require("fs");
|
|
48
|
+
const path = __importStar(require("path"));
|
|
49
|
+
// SDK-owned: orchestration iteration loop is the core SDK runtime engine
|
|
15
50
|
const babysitter_sdk_1 = require("@a5c-ai/babysitter-sdk");
|
|
51
|
+
const global_1 = require("../orchestration/global");
|
|
52
|
+
const runFiles_1 = require("../storage/runFiles");
|
|
16
53
|
function ok(data) {
|
|
17
54
|
return { ok: true, data };
|
|
18
55
|
}
|
|
@@ -57,16 +94,14 @@ async function apiCreateRun(input) {
|
|
|
57
94
|
return fail("INVALID_INPUT", "entrypoint must be a non-empty string");
|
|
58
95
|
}
|
|
59
96
|
const { importPath, exportName } = parseEntrypoint(input.entrypoint);
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
exportName,
|
|
66
|
-
},
|
|
67
|
-
inputs: input.inputs,
|
|
68
|
-
prompt: input.prompt,
|
|
97
|
+
const orch = (0, global_1.getGlobalRegistry)().getOrchestration();
|
|
98
|
+
const result = await orch.createRun({
|
|
99
|
+
processId: input.processId,
|
|
100
|
+
entrypoint: input.entrypoint,
|
|
101
|
+
prompt: input.prompt ?? "",
|
|
69
102
|
harness: input.harness,
|
|
103
|
+
inputs: input.inputs,
|
|
104
|
+
runsDir: input.runsDir ?? orch.resolveRunsDir(),
|
|
70
105
|
});
|
|
71
106
|
return ok({ runId: result.runId, runDir: result.runDir });
|
|
72
107
|
}
|
|
@@ -112,23 +147,20 @@ async function apiCommitEffect(input) {
|
|
|
112
147
|
if (input.result.status === "error" && !input.result.error) {
|
|
113
148
|
return fail("INVALID_INPUT", "error is required when status is 'error'");
|
|
114
149
|
}
|
|
115
|
-
const
|
|
150
|
+
const handle = {
|
|
151
|
+
runId: input.runDir.split(/[\\/]/).pop() ?? "",
|
|
116
152
|
runDir: input.runDir,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
startedAt: input.result.startedAt,
|
|
127
|
-
finishedAt: input.result.finishedAt,
|
|
128
|
-
metadata: input.result.metadata,
|
|
129
|
-
},
|
|
153
|
+
processId: "",
|
|
154
|
+
status: "running",
|
|
155
|
+
};
|
|
156
|
+
await (0, global_1.getGlobalRegistry)().getOrchestration().postEffectResult(handle, input.effectId, {
|
|
157
|
+
status: input.result.status,
|
|
158
|
+
value: input.result.status === "ok" ? input.result.value : undefined,
|
|
159
|
+
error: input.result.status === "error" ? input.result.error : undefined,
|
|
160
|
+
startedAt: input.result.startedAt,
|
|
161
|
+
finishedAt: input.result.finishedAt,
|
|
130
162
|
});
|
|
131
|
-
return ok({ resultRef:
|
|
163
|
+
return ok({ resultRef: `tasks/${input.effectId}/result.json` });
|
|
132
164
|
}
|
|
133
165
|
catch (error) {
|
|
134
166
|
const classified = classifyError(error);
|
|
@@ -137,12 +169,12 @@ async function apiCommitEffect(input) {
|
|
|
137
169
|
}
|
|
138
170
|
async function apiRunStatus(input) {
|
|
139
171
|
try {
|
|
140
|
-
const runDir =
|
|
172
|
+
const runDir = path.join(input.runsDir ?? (0, global_1.getGlobalRegistry)().getOrchestration().resolveRunsDir(), input.runId);
|
|
141
173
|
if (!(await pathExists(runDir))) {
|
|
142
174
|
return fail("RUN_NOT_FOUND", `Run not found: ${input.runId}`);
|
|
143
175
|
}
|
|
144
|
-
const metadata = await (0,
|
|
145
|
-
const events = await (0,
|
|
176
|
+
const metadata = await (0, runFiles_1.readRunMetadata)(runDir);
|
|
177
|
+
const events = await (0, global_1.loadJournalEvents)(runDir);
|
|
146
178
|
const state = deriveRunState(events);
|
|
147
179
|
const pendingEffects = derivePendingEffects(events);
|
|
148
180
|
return ok({
|
|
@@ -162,11 +194,11 @@ async function apiRunEvents(input) {
|
|
|
162
194
|
if (input.limit !== undefined && input.limit < 0) {
|
|
163
195
|
return fail("INVALID_INPUT", "limit must be a non-negative number");
|
|
164
196
|
}
|
|
165
|
-
const runDir =
|
|
197
|
+
const runDir = path.join(input.runsDir ?? (0, global_1.getGlobalRegistry)().getOrchestration().resolveRunsDir(), input.runId);
|
|
166
198
|
if (!(await pathExists(runDir))) {
|
|
167
199
|
return fail("RUN_NOT_FOUND", `Run not found: ${input.runId}`);
|
|
168
200
|
}
|
|
169
|
-
let events = await (0,
|
|
201
|
+
let events = await (0, global_1.loadJournalEvents)(runDir);
|
|
170
202
|
if (input.filterType) {
|
|
171
203
|
events = events.filter((e) => e.type === input.filterType);
|
|
172
204
|
}
|
package/dist/api/utils.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* and journal effect parsing.
|
|
4
4
|
*/
|
|
5
5
|
import type { ApiResult } from "./runs";
|
|
6
|
-
import type { JournalEvent } from "
|
|
6
|
+
import type { JournalEvent } from "../storage/types";
|
|
7
7
|
export declare function ok<T>(data: T): ApiResult<T>;
|
|
8
8
|
export declare function fail<T>(code: string, message: string): ApiResult<T>;
|
|
9
9
|
export declare function pathExists(p: string): Promise<boolean>;
|
package/dist/api/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/api/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/api/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,wBAAgB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAE3C;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAEnE;AAED,wBAAsB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO5D;AAID,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6FAA6F;IAC7F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,SAAS,EAAE,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC;CACnD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAwCtF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Breakpoint Analytics and SLA Tracking (GAP-BRK-003).
|
|
3
|
+
*
|
|
4
|
+
* Tracks breakpoint resolution metrics — response times, timeout rates,
|
|
5
|
+
* and SLA compliance. Pure in-memory analytics, no I/O.
|
|
6
|
+
*/
|
|
7
|
+
export type BreakpointOutcome = 'approved' | 'rejected' | 'timeout';
|
|
8
|
+
export interface BreakpointMetric {
|
|
9
|
+
breakpointId: string;
|
|
10
|
+
requestedAt: number;
|
|
11
|
+
resolvedAt: number;
|
|
12
|
+
durationMs: number;
|
|
13
|
+
outcome: BreakpointOutcome;
|
|
14
|
+
}
|
|
15
|
+
export interface SLAComplianceResult {
|
|
16
|
+
totalBreakpoints: number;
|
|
17
|
+
withinSLA: number;
|
|
18
|
+
complianceRate: number;
|
|
19
|
+
targetMs: number;
|
|
20
|
+
}
|
|
21
|
+
export declare class BreakpointAnalytics {
|
|
22
|
+
private metrics;
|
|
23
|
+
/**
|
|
24
|
+
* Record a breakpoint resolution metric.
|
|
25
|
+
*/
|
|
26
|
+
record(metric: BreakpointMetric): void;
|
|
27
|
+
/**
|
|
28
|
+
* Calculate SLA compliance against a target response time.
|
|
29
|
+
*/
|
|
30
|
+
getSLACompliance(targetMs: number): SLAComplianceResult;
|
|
31
|
+
/**
|
|
32
|
+
* Get the average response time across all recorded breakpoints.
|
|
33
|
+
* Returns 0 if no metrics have been recorded.
|
|
34
|
+
*/
|
|
35
|
+
getAverageResponseTime(): number;
|
|
36
|
+
/**
|
|
37
|
+
* Get the timeout rate (fraction of breakpoints that timed out).
|
|
38
|
+
* Returns 0 if no metrics have been recorded.
|
|
39
|
+
*/
|
|
40
|
+
getTimeoutRate(): number;
|
|
41
|
+
/**
|
|
42
|
+
* Get all recorded metrics.
|
|
43
|
+
*/
|
|
44
|
+
getMetrics(): readonly BreakpointMetric[];
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/breakpoints/analytics.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAClC,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,OAAO,CAA0B;IAEzC;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAItC;;OAEG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB;IAevD;;;OAGG;IACH,sBAAsB,IAAI,MAAM;IAMhC;;;OAGG;IACH,cAAc,IAAI,MAAM;IAMxB;;OAEG;IACH,UAAU,IAAI,SAAS,gBAAgB,EAAE;CAG1C"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Breakpoint Analytics and SLA Tracking (GAP-BRK-003).
|
|
4
|
+
*
|
|
5
|
+
* Tracks breakpoint resolution metrics — response times, timeout rates,
|
|
6
|
+
* and SLA compliance. Pure in-memory analytics, no I/O.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.BreakpointAnalytics = void 0;
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
// BreakpointAnalytics
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
class BreakpointAnalytics {
|
|
14
|
+
metrics = [];
|
|
15
|
+
/**
|
|
16
|
+
* Record a breakpoint resolution metric.
|
|
17
|
+
*/
|
|
18
|
+
record(metric) {
|
|
19
|
+
this.metrics.push(metric);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Calculate SLA compliance against a target response time.
|
|
23
|
+
*/
|
|
24
|
+
getSLACompliance(targetMs) {
|
|
25
|
+
const total = this.metrics.length;
|
|
26
|
+
if (total === 0) {
|
|
27
|
+
return { totalBreakpoints: 0, withinSLA: 0, complianceRate: 1, targetMs };
|
|
28
|
+
}
|
|
29
|
+
const withinSLA = this.metrics.filter((m) => m.durationMs <= targetMs).length;
|
|
30
|
+
return {
|
|
31
|
+
totalBreakpoints: total,
|
|
32
|
+
withinSLA,
|
|
33
|
+
complianceRate: withinSLA / total,
|
|
34
|
+
targetMs,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get the average response time across all recorded breakpoints.
|
|
39
|
+
* Returns 0 if no metrics have been recorded.
|
|
40
|
+
*/
|
|
41
|
+
getAverageResponseTime() {
|
|
42
|
+
if (this.metrics.length === 0)
|
|
43
|
+
return 0;
|
|
44
|
+
const total = this.metrics.reduce((sum, m) => sum + m.durationMs, 0);
|
|
45
|
+
return total / this.metrics.length;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get the timeout rate (fraction of breakpoints that timed out).
|
|
49
|
+
* Returns 0 if no metrics have been recorded.
|
|
50
|
+
*/
|
|
51
|
+
getTimeoutRate() {
|
|
52
|
+
if (this.metrics.length === 0)
|
|
53
|
+
return 0;
|
|
54
|
+
const timeouts = this.metrics.filter((m) => m.outcome === 'timeout').length;
|
|
55
|
+
return timeouts / this.metrics.length;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get all recorded metrics.
|
|
59
|
+
*/
|
|
60
|
+
getMetrics() {
|
|
61
|
+
return this.metrics;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.BreakpointAnalytics = BreakpointAnalytics;
|
|
@@ -52,8 +52,8 @@ exports.delegateBreakpoint = delegateBreakpoint;
|
|
|
52
52
|
const node_fs_1 = require("node:fs");
|
|
53
53
|
const os = __importStar(require("node:os"));
|
|
54
54
|
const path = __importStar(require("node:path"));
|
|
55
|
-
const atomic_1 = require("
|
|
56
|
-
const
|
|
55
|
+
const atomic_1 = require("../utils/atomic");
|
|
56
|
+
const patterns_1 = require("../utils/patterns");
|
|
57
57
|
const delegationTypes_1 = require("./delegationTypes");
|
|
58
58
|
function defaultDelegationRulesPath() {
|
|
59
59
|
return path.join(os.homedir(), ".a5c", "breakpoint-delegations", "rules.json");
|
|
@@ -64,8 +64,8 @@ function defaultDelegationRulesPath() {
|
|
|
64
64
|
function evaluateDelegation(breakpointId, tags, rules) {
|
|
65
65
|
const attributes = { tags, expert: undefined };
|
|
66
66
|
return rules.filter((rule) => {
|
|
67
|
-
const pattern = (0,
|
|
68
|
-
return (0,
|
|
67
|
+
const pattern = (0, patterns_1.parsePattern)(rule.pattern);
|
|
68
|
+
return (0, patterns_1.matchPattern)(pattern, breakpointId, attributes);
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @module breakpoints/postures
|
|
10
10
|
*/
|
|
11
|
-
import type { ActionCategory, ApprovalPosture } from '
|
|
11
|
+
import type { ActionCategory, ApprovalPosture } from '../types';
|
|
12
12
|
/**
|
|
13
13
|
* Default postures per action category.
|
|
14
14
|
* The canonical safety ladder: read (permissive) -> write/network -> execute -> destroy/auth (locked).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postures.d.ts","sourceRoot":"","sources":["../../src/breakpoints/postures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"postures.d.ts","sourceRoot":"","sources":["../../src/breakpoints/postures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,cAAc,EAAE,eAAe,CA2CpE,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,cAAc,EACxB,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GACnC,eAAe,CAIjB;AAkBD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAK/F"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Moved from @a5c-ai/babysitter-sdk.
|
|
4
4
|
* Per-effect cost aggregation (GAP-SUBOBS-003).
|
|
5
5
|
*/
|
|
6
|
-
import type { EffectIndex } from "
|
|
6
|
+
import type { EffectIndex } from "../types";
|
|
7
7
|
export interface EffectCostSummary {
|
|
8
8
|
effectId: string;
|
|
9
9
|
taskId: string;
|