@inflexa-ai/harness 0.44.0 → 0.45.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/app/approve-plan.d.ts +48 -0
- package/dist/app/approve-plan.js +84 -0
- package/dist/app/data-profile-view.d.ts +1 -1
- package/dist/app/run-activity.js +4 -6
- package/dist/contracts/chat-events.d.ts +2 -0
- package/dist/contracts/chat-frame.d.ts +7 -0
- package/dist/contracts/chat-frame.js +18 -4
- package/dist/contracts/chat-parts.d.ts +73 -2
- package/dist/contracts/chat-parts.js +3 -1
- package/dist/contracts/index.d.ts +3 -1
- package/dist/contracts/index.js +1 -0
- package/dist/contracts/part-registry.js +3 -0
- package/dist/contracts/schemas/chat-events.d.ts +13 -0
- package/dist/contracts/schemas/chat-events.js +1 -0
- package/dist/contracts/schemas/chat-parts.d.ts +200 -15
- package/dist/contracts/schemas/chat-parts.js +63 -12
- package/dist/contracts/schemas/index.d.ts +1 -1
- package/dist/contracts/schemas/index.js +1 -1
- package/dist/contracts/subagent-activity.d.ts +12 -0
- package/dist/contracts/subagent-activity.js +76 -0
- package/dist/execution/artifact-metadata.js +1 -3
- package/dist/execution/run-canceler.js +1 -1
- package/dist/execution/run-event-parts.d.ts +6 -5
- package/dist/execution/run-event-parts.js +6 -5
- package/dist/execution/run-event-stream.d.ts +18 -6
- package/dist/execution/run-event-stream.js +67 -17
- package/dist/execution/run-synthesis.d.ts +21 -0
- package/dist/execution/run-synthesis.js +77 -3
- package/dist/index.d.ts +22 -8
- package/dist/index.js +16 -2
- package/dist/lib/hooks.d.ts +1 -1
- package/dist/lib/metrics.d.ts +2 -2
- package/dist/loop/run-agent.js +1 -0
- package/dist/loop/types.d.ts +2 -0
- package/dist/memory/card-builders.d.ts +11 -0
- package/dist/memory/card-builders.js +35 -21
- package/dist/memory/conversation-display-recorder.d.ts +2 -0
- package/dist/memory/conversation-display-recorder.js +10 -1
- package/dist/memory/conversation-display-storage.d.ts +9 -2
- package/dist/memory/conversation-display-storage.js +18 -3
- package/dist/memory/thread-history.d.ts +8 -1
- package/dist/memory/thread-history.js +13 -3
- package/dist/memory/thread-store.d.ts +13 -0
- package/dist/memory/thread-store.js +15 -1
- package/dist/prompts/conversation.d.ts +1 -1
- package/dist/prompts/conversation.js +3 -1
- package/dist/provenance/seam.d.ts +16 -5
- package/dist/providers/ai-sdk.js +6 -4
- package/dist/report-model/pin-snapshot.d.ts +1 -1
- package/dist/report-model/pin-snapshot.js +2 -50
- package/dist/runtime/assemble.d.ts +8 -1
- package/dist/runtime/assemble.js +11 -0
- package/dist/runtime/boot.d.ts +3 -0
- package/dist/runtime/boot.js +10 -1
- package/dist/sandbox/sandbox-step-translate.d.ts +23 -0
- package/dist/sandbox/sandbox-step-translate.js +24 -0
- package/dist/schemas/artifact-manifest.d.ts +1 -1
- package/dist/schemas/artifact-manifest.js +11 -9
- package/dist/schemas/plan-schemas.d.ts +18 -18
- package/dist/schemas/run-synthesis.d.ts +2 -2
- package/dist/state/analyses-metrics.d.ts +79 -7
- package/dist/state/analyses-metrics.js +141 -6
- package/dist/state/artifacts.d.ts +50 -3
- package/dist/state/artifacts.js +67 -7
- package/dist/state/data-profile.d.ts +4 -2
- package/dist/state/data-profile.js +7 -5
- package/dist/state/index.d.ts +9 -8
- package/dist/state/index.js +5 -5
- package/dist/state/migrations/20261012120000_index_the_runs_by_start.d.ts +8 -0
- package/dist/state/migrations/20261012120000_index_the_runs_by_start.js +12 -0
- package/dist/state/migrations/20261013120000_index_the_ended_runs_and_the_recent_threads.d.ts +8 -0
- package/dist/state/migrations/20261013120000_index_the_ended_runs_and_the_recent_threads.js +13 -0
- package/dist/state/migrations/20261013180000_narrow_the_active_run_index.d.ts +8 -0
- package/dist/state/migrations/20261013180000_narrow_the_active_run_index.js +13 -0
- package/dist/state/migrations/20261014120000_index_the_plans_by_parent_and_the_runs_by_plan.d.ts +8 -0
- package/dist/state/migrations/20261014120000_index_the_plans_by_parent_and_the_runs_by_plan.js +13 -0
- package/dist/state/migrations/index.js +8 -0
- package/dist/state/plans.d.ts +21 -0
- package/dist/state/plans.js +25 -0
- package/dist/state/runs.d.ts +36 -5
- package/dist/state/runs.js +65 -19
- package/dist/state/schema.d.ts +2 -0
- package/dist/tasks/data-profile-activity.d.ts +7 -1
- package/dist/tasks/data-profile-activity.js +18 -9
- package/dist/tasks/data-profile.d.ts +15 -1
- package/dist/tasks/data-profile.js +16 -11
- package/dist/tools/approval/gateway.js +28 -5
- package/dist/tools/display/show-user.d.ts +1 -1
- package/dist/tools/execute-analysis.d.ts +51 -0
- package/dist/tools/execute-analysis.js +241 -109
- package/dist/tools/research/inspect-data-profile.d.ts +1 -1
- package/dist/tools/research/inspect-run.d.ts +1 -1
- package/dist/tools/research/inspect-run.js +7 -7
- package/dist/workflows/execute-analysis.d.ts +4 -3
- package/dist/workflows/execute-analysis.js +35 -22
- package/dist/workflows/plan/graph.d.ts +16 -0
- package/dist/workflows/plan/graph.js +36 -0
- package/dist/workflows/sandbox-step.js +14 -12
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The graph of a stored plan: each step with its agent, its dependencies, and its
|
|
3
|
+
* level. The levels and the agent fallback are those of `data-dag-state`, so a
|
|
4
|
+
* host draws the same graph before, during, and after a run.
|
|
5
|
+
*/
|
|
6
|
+
import type { PlanGraphStep } from "../../contracts/chat-parts.js";
|
|
7
|
+
/**
|
|
8
|
+
* Give the graph of a stored plan document, in the order of the plan. An empty
|
|
9
|
+
* step list gives an empty graph. A document that fails the stored plan schema, or
|
|
10
|
+
* whose steps have a duplicate id, a missing dependency, or a cycle, gives `null`
|
|
11
|
+
* (a plan that no run can execute has no levels).
|
|
12
|
+
*
|
|
13
|
+
* The throw of `validatePlanDag` is caught here, at the boundary: the function is a
|
|
14
|
+
* read for a caller that has no use for the typed error.
|
|
15
|
+
*/
|
|
16
|
+
export declare function planGraphOf(plan: unknown): PlanGraphStep[] | null;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The graph of a stored plan: each step with its agent, its dependencies, and its
|
|
3
|
+
* level. The levels and the agent fallback are those of `data-dag-state`, so a
|
|
4
|
+
* host draws the same graph before, during, and after a run.
|
|
5
|
+
*/
|
|
6
|
+
import { AnalysisPlanSchema } from "../../schemas/workflow-state.js";
|
|
7
|
+
import { computeTopologicalLevels, validatePlanDag } from "../execute-analysis-scheduler.js";
|
|
8
|
+
/**
|
|
9
|
+
* Give the graph of a stored plan document, in the order of the plan. An empty
|
|
10
|
+
* step list gives an empty graph. A document that fails the stored plan schema, or
|
|
11
|
+
* whose steps have a duplicate id, a missing dependency, or a cycle, gives `null`
|
|
12
|
+
* (a plan that no run can execute has no levels).
|
|
13
|
+
*
|
|
14
|
+
* The throw of `validatePlanDag` is caught here, at the boundary: the function is a
|
|
15
|
+
* read for a caller that has no use for the typed error.
|
|
16
|
+
*/
|
|
17
|
+
export function planGraphOf(plan) {
|
|
18
|
+
const parsed = AnalysisPlanSchema.safeParse(plan);
|
|
19
|
+
if (!parsed.success)
|
|
20
|
+
return null;
|
|
21
|
+
const steps = parsed.data.steps;
|
|
22
|
+
try {
|
|
23
|
+
validatePlanDag(steps);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
const levels = computeTopologicalLevels(steps);
|
|
29
|
+
return steps.map((step) => ({
|
|
30
|
+
id: step.id,
|
|
31
|
+
name: step.name,
|
|
32
|
+
agent: step.agent ?? "unknown",
|
|
33
|
+
dependsOn: [...step.depends_on],
|
|
34
|
+
level: levels.get(step.id) ?? 0,
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
@@ -38,7 +38,7 @@ import { durableStep } from "../loop/run-step.js";
|
|
|
38
38
|
import { maskExcept } from "../loop/tool-mask.js";
|
|
39
39
|
import { READ_TOOL_OUTPUT_TOOL_ID } from "../loop/tool-output.js";
|
|
40
40
|
import { lastExecOutcome } from "../sandbox/exec-outcome.js";
|
|
41
|
-
import { activityForTool, applyTreeDelta, isChatDataPart, sandboxTreeDelta, stepPartId } from "../sandbox/sandbox-step-translate.js";
|
|
41
|
+
import { activityEmission, activityForTool, applyTreeDelta, isChatDataPart, sandboxTreeDelta, stepPartId } from "../sandbox/sandbox-step-translate.js";
|
|
42
42
|
import { createDetailResolver } from "../tools/detail-resolver.js";
|
|
43
43
|
import { forSubAgent } from "../auth/types.js";
|
|
44
44
|
import { walkStepArtifacts } from "../execution/post-step.js";
|
|
@@ -266,17 +266,19 @@ export async function runSandboxStepBody(input, deps) {
|
|
|
266
266
|
logger.warn("emitToParentStream failed (non-fatal)", logger.errorFields(err));
|
|
267
267
|
}
|
|
268
268
|
};
|
|
269
|
-
// Schema-conformant step-activity emitter
|
|
270
|
-
// so the run-stream fold collapses every phase transition latest-wins.
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
activity,
|
|
279
|
-
|
|
269
|
+
// Schema-conformant step-activity emitter. `data-step-activity` has a stable id per (runId, stepId),
|
|
270
|
+
// so the run-stream fold collapses every phase transition latest-wins. Each emission also leaves one
|
|
271
|
+
// `data-activity-entry` that the fold keeps, thus a late subscriber gets each line with its time. The
|
|
272
|
+
// two parts share one checkpointed clock read. `activitySeq` advances before the clock read and the
|
|
273
|
+
// writes, and each write fails alone through `safeEmit`.
|
|
274
|
+
let activitySeq = 0;
|
|
275
|
+
const emitActivity = async (phase, activity) => {
|
|
276
|
+
const seq = activitySeq++;
|
|
277
|
+
const at = new Date(await DBOS.now()).toISOString();
|
|
278
|
+
const parts = activityEmission(input, seq, phase, activity, at);
|
|
279
|
+
await safeEmit(parts.activity);
|
|
280
|
+
await safeEmit(parts.entry);
|
|
281
|
+
};
|
|
280
282
|
// Single exit for the two terminal failure paths (agent loop, lineage
|
|
281
283
|
// attestation). Tears the sandbox down, logs the internal detail for
|
|
282
284
|
// operators, then persists + emits only a generic phrase and re-raises a
|
package/package.json
CHANGED