@inflexa-ai/harness 0.11.0 → 0.13.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/agents/conversation-agent.d.ts +9 -15
- package/dist/agents/conversation-agent.js +9 -15
- package/dist/agents/sandbox/index.js +0 -3
- package/dist/agents/sandbox/shared.d.ts +2 -2
- package/dist/agents/sandbox/shared.js +1 -1
- package/dist/config/resource-limits.d.ts +0 -7
- package/dist/config/resource-limits.js +0 -1
- package/dist/execution/dbos-run-launcher.js +1 -26
- package/dist/execution/run-authorizer.d.ts +1 -1
- package/dist/execution/run-authorizer.js +1 -1
- package/dist/execution/run-launcher.d.ts +2 -18
- package/dist/execution/run-launcher.js +2 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -6
- package/dist/loop/run-agent.js +1 -0
- package/dist/memory/reconstruct-cards.d.ts +1 -1
- package/dist/memory/reconstruct-cards.js +7 -5
- package/dist/memory/thread-history.js +39 -1
- package/dist/prompts/conversation.d.ts +1 -1
- package/dist/prompts/conversation.js +27 -10
- package/dist/prompts/planner.d.ts +3 -0
- package/dist/prompts/planner.js +1 -1
- package/dist/prompts/sandbox-standards.d.ts +4 -4
- package/dist/prompts/sandbox-standards.js +5 -5
- package/dist/runtime/assemble.d.ts +5 -10
- package/dist/runtime/assemble.js +0 -4
- package/dist/runtime/boot.d.ts +2 -2
- package/dist/runtime/boot.js +1 -1
- package/dist/runtime/dbos.d.ts +4 -5
- package/dist/runtime/dbos.js +6 -7
- package/dist/sandbox/mount-plan.d.ts +1 -1
- package/dist/sandbox/sandbox-error.d.ts +1 -1
- package/dist/sandbox/sandbox-error.js +1 -1
- package/dist/sandbox/types.d.ts +1 -1
- package/dist/schemas/validate-plan.d.ts +1 -1
- package/dist/state/index.d.ts +4 -4
- package/dist/state/index.js +2 -2
- package/dist/state/plans.js +1 -1
- package/dist/state/runs.d.ts +10 -0
- package/dist/state/runs.js +47 -0
- package/dist/tools/__fixtures__/tool-context.js +1 -0
- package/dist/tools/ad-hoc-router.d.ts +31 -0
- package/dist/tools/ad-hoc-router.js +132 -0
- package/dist/tools/analysis-invocation.d.ts +4 -0
- package/dist/tools/analysis-invocation.js +17 -0
- package/dist/tools/bio/search-geo-datasets.js +2 -1
- package/dist/tools/define-tool.d.ts +6 -2
- package/dist/tools/define-tool.js +1 -1
- package/dist/tools/execute-analysis.d.ts +43 -0
- package/dist/tools/execute-analysis.js +252 -0
- package/dist/tools/iterate-report.js +7 -6
- package/dist/tools/research/generate-plan.js +1 -1
- package/dist/tools/workspace/list-files.js +4 -3
- package/dist/workflows/execute-analysis.d.ts +5 -5
- package/dist/workflows/execute-analysis.js +3 -5
- package/package.json +1 -1
- package/dist/agents/sandbox/ephemeral-executor.d.ts +0 -9
- package/dist/agents/sandbox/ephemeral-executor.js +0 -20
- package/dist/execution/ephemeral-runner.d.ts +0 -98
- package/dist/execution/ephemeral-runner.js +0 -189
- package/dist/prompts/sandbox/ephemeral-executor.d.ts +0 -1
- package/dist/prompts/sandbox/ephemeral-executor.js +0 -66
- package/dist/tools/execute-plan.d.ts +0 -64
- package/dist/tools/execute-plan.js +0 -211
- package/dist/tools/run-ephemeral.d.ts +0 -33
- package/dist/tools/run-ephemeral.js +0 -65
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* run_ephemeral — ad-hoc data exploration in a read-only sandbox.
|
|
3
|
-
*
|
|
4
|
-
* Authorizes the run at the async edge via the RunAuthorizer seam, then starts
|
|
5
|
-
* the ephemeral workflow through the RunLauncher seam and awaits its result
|
|
6
|
-
* inline within the chat turn. Chat disconnect cancels the run; the
|
|
7
|
-
* authorization is revoked on every terminal path. The workflow is never
|
|
8
|
-
* recovered — a turn-scoped exploration outliving its turn has no value.
|
|
9
|
-
*
|
|
10
|
-
* Available to: conversation-agent.
|
|
11
|
-
*/
|
|
12
|
-
import type { RunAuthorizer } from "../execution/run-authorizer.js";
|
|
13
|
-
import type { RunLauncher } from "../execution/run-launcher.js";
|
|
14
|
-
import { type EphemeralResult, type EphemeralWorkflowInput } from "../execution/ephemeral-runner.js";
|
|
15
|
-
export interface RunEphemeralToolDeps {
|
|
16
|
-
/** Registered ephemeral workflow callable. */
|
|
17
|
-
readonly workflow: (input: EphemeralWorkflowInput) => Promise<EphemeralResult>;
|
|
18
|
-
/** Authorizes the run at the async edge and revokes on the terminal path. */
|
|
19
|
-
readonly runAuthorizer: RunAuthorizer;
|
|
20
|
-
/** Starts the durable run — the durability engine stays behind this seam. */
|
|
21
|
-
readonly runLauncher: RunLauncher;
|
|
22
|
-
}
|
|
23
|
-
export interface RunEphemeralToolOutput {
|
|
24
|
-
readonly text: string;
|
|
25
|
-
readonly durationMs: number;
|
|
26
|
-
}
|
|
27
|
-
/** Build the `run_ephemeral` tool bound to the registered workflow + mint deps. */
|
|
28
|
-
export declare function createRunEphemeralTool(deps: RunEphemeralToolDeps): import("./define-tool.js").Tool<{
|
|
29
|
-
prompt: string;
|
|
30
|
-
}, {
|
|
31
|
-
text: string;
|
|
32
|
-
durationMs: number;
|
|
33
|
-
}>;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* run_ephemeral — ad-hoc data exploration in a read-only sandbox.
|
|
3
|
-
*
|
|
4
|
-
* Authorizes the run at the async edge via the RunAuthorizer seam, then starts
|
|
5
|
-
* the ephemeral workflow through the RunLauncher seam and awaits its result
|
|
6
|
-
* inline within the chat turn. Chat disconnect cancels the run; the
|
|
7
|
-
* authorization is revoked on every terminal path. The workflow is never
|
|
8
|
-
* recovered — a turn-scoped exploration outliving its turn has no value.
|
|
9
|
-
*
|
|
10
|
-
* Available to: conversation-agent.
|
|
11
|
-
*/
|
|
12
|
-
import { ok } from "neverthrow";
|
|
13
|
-
import { z } from "zod";
|
|
14
|
-
import { EPHEMERAL_WORKFLOW_PREFIX } from "../execution/ephemeral-runner.js";
|
|
15
|
-
import { generateExecutionId } from "../sandbox/execution-id.js";
|
|
16
|
-
import { defineTool } from "./define-tool.js";
|
|
17
|
-
const inputSchema = z.object({
|
|
18
|
-
prompt: z
|
|
19
|
-
.string()
|
|
20
|
-
.min(1)
|
|
21
|
-
.describe("What to compute. Be specific: which files to read, what analysis to " + "run, what output format to return (table, statistics, base64 plot)."),
|
|
22
|
-
});
|
|
23
|
-
/** Build the `run_ephemeral` tool bound to the registered workflow + mint deps. */
|
|
24
|
-
export function createRunEphemeralTool(deps) {
|
|
25
|
-
return defineTool({
|
|
26
|
-
id: "run_ephemeral",
|
|
27
|
-
description: "Run a quick computation on the analysis data in a read-only sandbox. " +
|
|
28
|
-
"Use for ad-hoc data exploration: inspect a CSV, compute statistics, " +
|
|
29
|
-
"generate plot data, preview transformations. The sandbox cannot " +
|
|
30
|
-
"create or save files — results are returned inline. For persistent " +
|
|
31
|
-
"analyses that produce artifacts, use generate_plan + executePlan instead.",
|
|
32
|
-
inputSchema,
|
|
33
|
-
execute: async (input, ctx) => {
|
|
34
|
-
const { session } = ctx;
|
|
35
|
-
if (session.scope.kind !== "analysis") {
|
|
36
|
-
throw new Error("run_ephemeral requires an analysis-scoped session — got " + session.scope.kind);
|
|
37
|
-
}
|
|
38
|
-
if (!session.auth) {
|
|
39
|
-
throw new Error("run_ephemeral: session is missing its auth capability");
|
|
40
|
-
}
|
|
41
|
-
const authorization = await deps.runAuthorizer.authorize({
|
|
42
|
-
auth: session.auth,
|
|
43
|
-
scope: session.scope,
|
|
44
|
-
provenance: session.provenance,
|
|
45
|
-
frame: { runId: "ephemeral", stepId: "ephemeral" },
|
|
46
|
-
});
|
|
47
|
-
const { runSession } = authorization;
|
|
48
|
-
const execId = generateExecutionId("ephemeral-executor");
|
|
49
|
-
const workflowId = `${EPHEMERAL_WORKFLOW_PREFIX}${execId}`;
|
|
50
|
-
try {
|
|
51
|
-
const outcome = await deps.runLauncher.launchAndAwait(deps.workflow, { workflowId }, { runSession, prompt: input.prompt }, { signal: ctx.signal });
|
|
52
|
-
if (outcome.status === "cancelled") {
|
|
53
|
-
return ok({ text: "(ephemeral exploration cancelled)", durationMs: 0 });
|
|
54
|
-
}
|
|
55
|
-
return ok({
|
|
56
|
-
text: outcome.result.text,
|
|
57
|
-
durationMs: outcome.result.durationMs,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
finally {
|
|
61
|
-
await deps.runAuthorizer.revoke(authorization, "ephemeral-completed").catch(() => { });
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
}
|