@inflexa-ai/harness 0.12.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.
Files changed (64) hide show
  1. package/dist/agents/conversation-agent.d.ts +9 -15
  2. package/dist/agents/conversation-agent.js +9 -15
  3. package/dist/agents/sandbox/index.js +0 -3
  4. package/dist/agents/sandbox/shared.d.ts +2 -2
  5. package/dist/agents/sandbox/shared.js +1 -1
  6. package/dist/config/resource-limits.d.ts +0 -7
  7. package/dist/config/resource-limits.js +0 -1
  8. package/dist/execution/dbos-run-launcher.js +1 -26
  9. package/dist/execution/run-authorizer.d.ts +1 -1
  10. package/dist/execution/run-authorizer.js +1 -1
  11. package/dist/execution/run-launcher.d.ts +2 -18
  12. package/dist/execution/run-launcher.js +2 -4
  13. package/dist/index.d.ts +3 -3
  14. package/dist/index.js +4 -6
  15. package/dist/loop/run-agent.js +1 -0
  16. package/dist/memory/reconstruct-cards.d.ts +1 -1
  17. package/dist/memory/reconstruct-cards.js +7 -5
  18. package/dist/memory/thread-history.js +39 -1
  19. package/dist/prompts/conversation.d.ts +1 -1
  20. package/dist/prompts/conversation.js +27 -10
  21. package/dist/prompts/planner.d.ts +3 -0
  22. package/dist/prompts/planner.js +1 -1
  23. package/dist/prompts/sandbox-standards.d.ts +4 -4
  24. package/dist/prompts/sandbox-standards.js +5 -5
  25. package/dist/runtime/assemble.d.ts +5 -10
  26. package/dist/runtime/assemble.js +0 -4
  27. package/dist/runtime/boot.d.ts +2 -2
  28. package/dist/runtime/boot.js +1 -1
  29. package/dist/runtime/dbos.d.ts +4 -5
  30. package/dist/runtime/dbos.js +6 -7
  31. package/dist/sandbox/mount-plan.d.ts +1 -1
  32. package/dist/sandbox/sandbox-error.d.ts +1 -1
  33. package/dist/sandbox/sandbox-error.js +1 -1
  34. package/dist/sandbox/types.d.ts +1 -1
  35. package/dist/schemas/validate-plan.d.ts +1 -1
  36. package/dist/state/index.d.ts +4 -4
  37. package/dist/state/index.js +2 -2
  38. package/dist/state/plans.js +1 -1
  39. package/dist/state/runs.d.ts +10 -0
  40. package/dist/state/runs.js +47 -0
  41. package/dist/tools/__fixtures__/tool-context.js +1 -0
  42. package/dist/tools/ad-hoc-router.d.ts +31 -0
  43. package/dist/tools/ad-hoc-router.js +132 -0
  44. package/dist/tools/analysis-invocation.d.ts +4 -0
  45. package/dist/tools/analysis-invocation.js +17 -0
  46. package/dist/tools/define-tool.d.ts +6 -2
  47. package/dist/tools/define-tool.js +1 -1
  48. package/dist/tools/execute-analysis.d.ts +43 -0
  49. package/dist/tools/execute-analysis.js +252 -0
  50. package/dist/tools/iterate-report.js +7 -6
  51. package/dist/tools/research/generate-plan.js +1 -1
  52. package/dist/workflows/execute-analysis.d.ts +5 -5
  53. package/dist/workflows/execute-analysis.js +3 -5
  54. package/package.json +1 -1
  55. package/dist/agents/sandbox/ephemeral-executor.d.ts +0 -9
  56. package/dist/agents/sandbox/ephemeral-executor.js +0 -20
  57. package/dist/execution/ephemeral-runner.d.ts +0 -98
  58. package/dist/execution/ephemeral-runner.js +0 -189
  59. package/dist/prompts/sandbox/ephemeral-executor.d.ts +0 -1
  60. package/dist/prompts/sandbox/ephemeral-executor.js +0 -66
  61. package/dist/tools/execute-plan.d.ts +0 -64
  62. package/dist/tools/execute-plan.js +0 -211
  63. package/dist/tools/run-ephemeral.d.ts +0 -33
  64. package/dist/tools/run-ephemeral.js +0 -65
@@ -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
- }