@archmax-ai/harness 0.9.0 → 1.0.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/README.md +58 -14
- package/dist/agent.d.ts +4 -6
- package/dist/agent.js +4 -6
- package/dist/agent.js.map +1 -1
- package/dist/assembly/compose.d.ts +5 -24
- package/dist/assembly/compose.js +28 -42
- package/dist/assembly/compose.js.map +1 -1
- package/dist/assembly/delegation-registry.js +3 -14
- package/dist/assembly/delegation-registry.js.map +1 -1
- package/dist/assembly/index.d.ts +8 -15
- package/dist/assembly/index.js +21 -28
- package/dist/assembly/index.js.map +1 -1
- package/dist/assembly/plain.js +1 -2
- package/dist/assembly/plain.js.map +1 -1
- package/dist/authoring-skill/archmax-harness/README.md +5 -5
- package/dist/authoring-skill/archmax-harness/SKILL.md +72 -30
- package/dist/authoring-skill/archmax-harness/references/backend-integration.md +33 -24
- package/dist/authoring-skill/archmax-harness/references/cases.md +41 -8
- package/dist/authoring-skill/archmax-harness/references/{hook-and-test-scripts.md → code-state-and-test-scripts.md} +599 -339
- package/dist/authoring-skill/archmax-harness/references/code-states-and-scripts.md +115 -0
- package/dist/authoring-skill/archmax-harness/references/diagnostics.md +40 -7
- package/dist/authoring-skill/archmax-harness/references/wiring.md +19 -10
- package/dist/authoring-skill/archmax-harness/references/workflow-schema.md +404 -293
- package/dist/authoring-skill/archmax-harness/references/workflow-yaml.md +151 -62
- package/dist/cli/state-flow.d.ts +1 -1
- package/dist/cli/state-flow.js +18 -28
- package/dist/cli/state-flow.js.map +1 -1
- package/dist/cli/turn.d.ts +1 -1
- package/dist/cli/turn.js +1 -1
- package/dist/core/code-description.d.ts +3 -3
- package/dist/core/code-description.js +3 -3
- package/dist/core/deepagents.d.ts +5 -12
- package/dist/core/deepagents.js +4 -17
- package/dist/core/deepagents.js.map +1 -1
- package/dist/core/events.d.ts +23 -42
- package/dist/core/events.js +21 -24
- package/dist/core/events.js.map +1 -1
- package/dist/core/message-readers.d.ts +4 -5
- package/dist/core/message-readers.js +3 -8
- package/dist/core/message-readers.js.map +1 -1
- package/dist/core/messages.d.ts +0 -22
- package/dist/core/messages.js +1 -32
- package/dist/core/messages.js.map +1 -1
- package/dist/core/mounts.js +3 -3
- package/dist/core/platform-prompt.generated.js +1 -1
- package/dist/core/platform-prompt.generated.js.map +1 -1
- package/dist/core/session-zone.d.ts +1 -1
- package/dist/core/session-zone.js +1 -1
- package/dist/core/workspace-context.d.ts +1 -1
- package/dist/core/workspace.d.ts +1 -1
- package/dist/core/workspace.js +1 -1
- package/dist/core/zones.d.ts +4 -4
- package/dist/core/zones.js +5 -5
- package/dist/core/zones.js.map +1 -1
- package/dist/env.d.ts +9 -9
- package/dist/index.d.ts +3 -7
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/kernel/kernel.d.ts +31 -61
- package/dist/kernel/kernel.js +54 -112
- package/dist/kernel/kernel.js.map +1 -1
- package/dist/machine/lint-spec.js +53 -12
- package/dist/machine/lint-spec.js.map +1 -1
- package/dist/machine/machine.d.ts +36 -18
- package/dist/machine/machine.js +62 -51
- package/dist/machine/machine.js.map +1 -1
- package/dist/machine/spec-schema.d.ts +32 -180
- package/dist/machine/spec-schema.js +52 -113
- package/dist/machine/spec-schema.js.map +1 -1
- package/dist/machine/tool-names.d.ts +34 -16
- package/dist/machine/tool-names.js +41 -16
- package/dist/machine/tool-names.js.map +1 -1
- package/dist/machine/types.d.ts +14 -46
- package/dist/machine/types.js +0 -2
- package/dist/machine/types.js.map +1 -1
- package/dist/machine/validate-spec.d.ts +1 -1
- package/dist/public/sandbox.d.ts +59 -95
- package/dist/public/sandbox.js +22 -23
- package/dist/public/sandbox.js.map +1 -1
- package/dist/public/spec.d.ts +13 -20
- package/dist/public/spec.js +12 -20
- package/dist/public/spec.js.map +1 -1
- package/dist/runtime/contract.d.ts +11 -12
- package/dist/runtime/contract.js +16 -16
- package/dist/runtime/contract.js.map +1 -1
- package/dist/sandbox/assets/parts/code-state.js +17 -0
- package/dist/sandbox/executor.d.ts +25 -7
- package/dist/sandbox/executor.js +56 -57
- package/dist/sandbox/executor.js.map +1 -1
- package/dist/sandbox/imports.d.ts +10 -10
- package/dist/sandbox/imports.js +11 -11
- package/dist/sandbox/imports.js.map +1 -1
- package/dist/sandbox/prelude.d.ts +5 -6
- package/dist/sandbox/prelude.js +38 -35
- package/dist/sandbox/prelude.js.map +1 -1
- package/dist/sandbox/ptc-gateway.d.ts +19 -18
- package/dist/sandbox/ptc-gateway.js +26 -22
- package/dist/sandbox/ptc-gateway.js.map +1 -1
- package/dist/sessions/resume.d.ts +2 -2
- package/dist/sessions/resume.js +1 -1
- package/dist/sessions/resume.js.map +1 -1
- package/dist/sessions/scope.d.ts +0 -10
- package/dist/sessions/scope.js +0 -17
- package/dist/sessions/scope.js.map +1 -1
- package/dist/sessions/summary.d.ts +1 -1
- package/dist/testing/assertions.js +9 -4
- package/dist/testing/assertions.js.map +1 -1
- package/dist/testing/driver.js +3 -0
- package/dist/testing/driver.js.map +1 -1
- package/dist/testing/interpreter.d.ts +2 -2
- package/dist/testing/runner.d.ts +2 -2
- package/dist/validate/validate.d.ts +1 -1
- package/dist/validate/validate.js +39 -70
- package/dist/validate/validate.js.map +1 -1
- package/dist/workflow/automated-controls.d.ts +63 -0
- package/dist/workflow/automated-controls.js +158 -0
- package/dist/workflow/automated-controls.js.map +1 -0
- package/dist/workflow/automated.d.ts +112 -0
- package/dist/workflow/automated.js +163 -0
- package/dist/workflow/automated.js.map +1 -0
- package/dist/workflow/code-state.d.ts +46 -0
- package/dist/workflow/code-state.js +26 -0
- package/dist/workflow/code-state.js.map +1 -0
- package/dist/workflow/control-tools.d.ts +54 -23
- package/dist/workflow/control-tools.js +99 -79
- package/dist/workflow/control-tools.js.map +1 -1
- package/dist/workflow/file-values.d.ts +4 -4
- package/dist/workflow/file-values.js +1 -1
- package/dist/workflow/file-values.js.map +1 -1
- package/dist/workflow/governance.d.ts +11 -22
- package/dist/workflow/governance.js +47 -104
- package/dist/workflow/governance.js.map +1 -1
- package/dist/workflow/grader-state.d.ts +55 -0
- package/dist/workflow/grader-state.js +182 -0
- package/dist/workflow/grader-state.js.map +1 -0
- package/dist/workflow/history.d.ts +11 -0
- package/dist/{lifecycle/transcript.js → workflow/history.js} +24 -8
- package/dist/workflow/history.js.map +1 -0
- package/dist/workflow/middleware.d.ts +14 -17
- package/dist/workflow/middleware.js +109 -95
- package/dist/workflow/middleware.js.map +1 -1
- package/dist/workflow/move-events.d.ts +21 -0
- package/dist/workflow/move-events.js +20 -0
- package/dist/workflow/move-events.js.map +1 -0
- package/dist/workflow/on-error.js +0 -2
- package/dist/workflow/on-error.js.map +1 -1
- package/dist/workflow/parks.d.ts +9 -2
- package/dist/workflow/parks.js +16 -10
- package/dist/workflow/parks.js.map +1 -1
- package/dist/workflow/paths.d.ts +9 -9
- package/dist/workflow/paths.js +19 -19
- package/dist/workflow/paths.js.map +1 -1
- package/dist/workflow/render-prompt.d.ts +7 -5
- package/dist/workflow/render-prompt.js +22 -37
- package/dist/workflow/render-prompt.js.map +1 -1
- package/dist/workflow/signature-checks.d.ts +2 -2
- package/dist/workflow/snapshot.js +5 -29
- package/dist/workflow/snapshot.js.map +1 -1
- package/dist/workflow/state.d.ts +14 -42
- package/dist/workflow/state.js +20 -33
- package/dist/workflow/state.js.map +1 -1
- package/dist/workflow/sub-workflow.d.ts +3 -3
- package/dist/workflow/sub-workflow.js +3 -7
- package/dist/workflow/sub-workflow.js.map +1 -1
- package/dist/workflow/tool-service.d.ts +1 -9
- package/dist/workflow/tool-service.js +21 -24
- package/dist/workflow/tool-service.js.map +1 -1
- package/dist/workflow/turn-boundary.d.ts +2 -2
- package/dist/workflow/turn-boundary.js +10 -15
- package/dist/workflow/turn-boundary.js.map +1 -1
- package/dist/workflow/turn-runner.js +5 -6
- package/dist/workflow/turn-runner.js.map +1 -1
- package/package.json +2 -2
- package/skills/archmax-harness/README.md +5 -5
- package/skills/archmax-harness/SKILL.md +72 -30
- package/skills/archmax-harness/references/backend-integration.md +33 -24
- package/skills/archmax-harness/references/cases.md +41 -8
- package/skills/archmax-harness/references/{hook-and-test-scripts.md → code-state-and-test-scripts.md} +599 -339
- package/skills/archmax-harness/references/code-states-and-scripts.md +115 -0
- package/skills/archmax-harness/references/diagnostics.md +40 -7
- package/skills/archmax-harness/references/wiring.md +19 -10
- package/skills/archmax-harness/references/workflow-schema.md +404 -293
- package/skills/archmax-harness/references/workflow-yaml.md +151 -62
- package/dist/authoring-skill/archmax-harness/references/hooks-and-scripts.md +0 -89
- package/dist/lifecycle/hook-shape.d.ts +0 -44
- package/dist/lifecycle/hook-shape.js +0 -66
- package/dist/lifecycle/hook-shape.js.map +0 -1
- package/dist/lifecycle/runner.d.ts +0 -197
- package/dist/lifecycle/runner.js +0 -419
- package/dist/lifecycle/runner.js.map +0 -1
- package/dist/lifecycle/tool-calls.d.ts +0 -9
- package/dist/lifecycle/tool-calls.js +0 -57
- package/dist/lifecycle/tool-calls.js.map +0 -1
- package/dist/lifecycle/transcript.d.ts +0 -31
- package/dist/lifecycle/transcript.js.map +0 -1
- package/dist/rubrics/rubrics.d.ts +0 -135
- package/dist/rubrics/rubrics.js +0 -145
- package/dist/rubrics/rubrics.js.map +0 -1
- package/dist/sandbox/assets/parts/core.js +0 -22
- package/dist/sandbox/assets/parts/lifecycle-hook.js +0 -47
- package/dist/sandbox/bridge.d.ts +0 -16
- package/dist/sandbox/bridge.js +0 -95
- package/dist/sandbox/bridge.js.map +0 -1
- package/dist/workflow/visits.d.ts +0 -21
- package/dist/workflow/visits.js +0 -45
- package/dist/workflow/visits.js.map +0 -1
- package/skills/archmax-harness/references/hooks-and-scripts.md +0 -89
package/dist/machine/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* (`MachineState`) rather than as `z.infer<typeof machineStateSchema>`.
|
|
7
7
|
*/
|
|
8
8
|
import type { z } from "zod";
|
|
9
|
-
import type { allowEntrySchema,
|
|
9
|
+
import type { allowEntrySchema, forbidEntrySchema, machinePromptCacheSettingsSchema, machineSettingsSchema, machineSpecSchema, machineStateSchema, machineTransitionSchema, stateTypeSchema, runtimeMetadataSchema, skillsBlockSchema, mountsBlockSchema, mountAccessSchema, mountGrantEntrySchema, signatureEntryObjectSchema, specMetadataSchema, stateBudgetSchema, toolsBlockSchema, transitionTypeSchema, triggerDeclarationSchema, workflowTestsConfigSchema, workflowSkillsConfigSchema, workflowMountsConfigSchema, workflowToolsConfigSchema } from "./spec-schema.js";
|
|
10
10
|
/**
|
|
11
11
|
* Semantic classification of an outgoing edge, primarily for **human states**: a
|
|
12
12
|
* UI can render `approve`/`reject`/`refine` as distinct decision buttons, and
|
|
@@ -25,31 +25,14 @@ export type TransitionType = z.infer<typeof transitionTypeSchema>;
|
|
|
25
25
|
*/
|
|
26
26
|
export type MachineTransition = z.infer<typeof machineTransitionSchema>;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* `
|
|
32
|
-
*
|
|
33
|
-
* `
|
|
34
|
-
*/
|
|
35
|
-
export type Hook = z.infer<typeof hookSchema>;
|
|
36
|
-
/** A `before`/`after` field: one hook or an ordered list run in sequence. */
|
|
37
|
-
export type HookSpec = z.infer<typeof hookSpecSchema>;
|
|
38
|
-
/**
|
|
39
|
-
* Per-state execution budget. `maxTurns` bounds the model iterations of the
|
|
40
|
-
* turn's agent loop; `timeoutMs` aborts the turn when exceeded; `maxParks` bounds
|
|
41
|
-
* how many times the state may park itself with `archmax_wait`. Any exhaustion
|
|
42
|
-
* is a turn failure subject to `on_error`.
|
|
28
|
+
* Per-state execution budget. `maxTurns` bounds the model calls of the state's
|
|
29
|
+
* visit — the session's agent in an agent state, the grader's own in a grader
|
|
30
|
+
* state; `timeoutMs` aborts a model call (an agent state) or the whole grader
|
|
31
|
+
* run (a grader state) when exceeded; `maxParks` bounds how many times an agent
|
|
32
|
+
* state may park itself with `archmax_wait`. Any exhaustion is a state failure
|
|
33
|
+
* subject to `on_error`. A code state takes no budget: it makes no model call.
|
|
43
34
|
*/
|
|
44
35
|
export type StateBudget = z.infer<typeof stateBudgetSchema>;
|
|
45
|
-
/**
|
|
46
|
-
* Workflow-wide execution budget. `maxModelCalls` bounds the model calls of one
|
|
47
|
-
* turn (an invocation: a message, a decision, a reply or a delivery) across every
|
|
48
|
-
* state; exhausting it is a failure of the current state, subject to `on_error`.
|
|
49
|
-
*/
|
|
50
|
-
export type WorkflowBudget = z.infer<typeof workflowBudgetSchema>;
|
|
51
|
-
/** The turn budget a workflow runs under when it declares none. */
|
|
52
|
-
export declare const DEFAULT_MAX_MODEL_CALLS = 50;
|
|
53
36
|
/** One entry of a `tools.allow` list: a bare tool name, or a constrained shape. */
|
|
54
37
|
export type AllowEntry = z.infer<typeof allowEntrySchema>;
|
|
55
38
|
/**
|
|
@@ -96,7 +79,10 @@ export type MountsBlock = z.infer<typeof mountsBlockSchema>;
|
|
|
96
79
|
/**
|
|
97
80
|
* The kind of a state: `agent` (default) runs a Deep Agent turn that picks a
|
|
98
81
|
* transition with `archmax_advance`; `human` parks the session and a person picks
|
|
99
|
-
* the outgoing edge
|
|
82
|
+
* the outgoing edge; `grader` runs an isolated grader subagent and `code` runs
|
|
83
|
+
* the state's `script` in the sandbox — the two **automated** types, which the
|
|
84
|
+
* runtime runs on entry with no model call of the session's agent and which
|
|
85
|
+
* leave by `archmax_advance` or end the session by `archmax_raise`.
|
|
100
86
|
*/
|
|
101
87
|
export type StateType = z.infer<typeof stateTypeSchema>;
|
|
102
88
|
/**
|
|
@@ -158,24 +144,12 @@ export type TriggerDeclaration = z.infer<typeof triggerDeclarationSchema>;
|
|
|
158
144
|
* both spellings through `normalizeSignature`, never by hand.
|
|
159
145
|
*/
|
|
160
146
|
export type SignatureEntryDeclaration = z.infer<typeof signatureEntryObjectSchema>;
|
|
161
|
-
/** Workspace-declared expectations the runtime cannot verify from the spec alone. */
|
|
162
|
-
export type SpecExtensions = z.infer<typeof specExtensionsSchema>;
|
|
163
147
|
/**
|
|
164
|
-
* Host data, accepted at
|
|
165
|
-
* state)
|
|
166
|
-
*
|
|
167
|
-
* hashed.
|
|
148
|
+
* Host data, accepted at two positions: the spec root (an authoring UI's canvas
|
|
149
|
+
* state) and a state (a node's position). Preserved across a load, never read by
|
|
150
|
+
* the runtime, and dropped before the spec is hashed.
|
|
168
151
|
*/
|
|
169
152
|
export type SpecMetadata = z.infer<typeof specMetadataSchema>;
|
|
170
|
-
/**
|
|
171
|
-
* One grading rubric: the standard a state's exit is measured against, declared
|
|
172
|
-
* in the same document as the state whose hook names it. `instructions` carries
|
|
173
|
-
* the criteria and the verdict to return; `max_iterations` bounds the
|
|
174
|
-
* grade-and-retry loop (a hook's own sidecar wins over it); `model` names the id
|
|
175
|
-
* the grader runs on. A rubric is authoring-plane content: the agent it grades
|
|
176
|
-
* can neither read it nor dispatch it.
|
|
177
|
-
*/
|
|
178
|
-
export type RubricDeclaration = z.infer<typeof rubricDeclarationSchema>;
|
|
179
153
|
/** The whole of `workflow.yaml`. */
|
|
180
154
|
export type MachineSpec = z.infer<typeof machineSpecSchema>;
|
|
181
155
|
/** Runtime knobs derived from `settings`, consumed by the harness. */
|
|
@@ -190,12 +164,6 @@ export interface HarnessSettings {
|
|
|
190
164
|
ttl?: string;
|
|
191
165
|
};
|
|
192
166
|
}
|
|
193
|
-
export interface LifecycleHook {
|
|
194
|
-
/** Normalized ordered `before` hooks (single spec wrapped in a list). */
|
|
195
|
-
before?: Hook[];
|
|
196
|
-
/** Normalized ordered `after` hooks (single spec wrapped in a list). */
|
|
197
|
-
after?: Hook[];
|
|
198
|
-
}
|
|
199
167
|
/**
|
|
200
168
|
* Whether a spec declares itself out of service — the single interpretation
|
|
201
169
|
* point for {@link MachineSpec.disabled}; a function because some callers hold a
|
package/dist/machine/types.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** The turn budget a workflow runs under when it declares none. */
|
|
2
|
-
export const DEFAULT_MAX_MODEL_CALLS = 50;
|
|
3
1
|
/**
|
|
4
2
|
* Whether a spec declares itself out of service — the single interpretation
|
|
5
3
|
* point for {@link MachineSpec.disabled}; a function because some callers hold a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/machine/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/machine/types.ts"],"names":[],"mappings":"AAoNA;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,IAAoC;IAC/D,MAAM,QAAQ,GAAI,IAAkD,EAAE,QAAQ,CAAC;IAC/E,OAAO,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,KAAK,CAAC;AAC3E,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Pure — no workspace, no backend, no machine — so an editor can show the same
|
|
7
7
|
* findings inline that `archmax validate` prints, and the loader reports exactly
|
|
8
|
-
* these. What needs more than the document (
|
|
8
|
+
* these. What needs more than the document (code-state scripts on disk, sibling
|
|
9
9
|
* workflows, the skill registry, kernel probes) is `validate/validate.ts`.
|
|
10
10
|
*/
|
|
11
11
|
import type { Diagnostic } from "./diagnostic.js";
|
package/dist/public/sandbox.d.ts
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@archmax-ai/harness/sandbox` — the typed authoring surface for
|
|
3
|
-
* scripts. Inside the QuickJS sandbox these
|
|
4
|
-
* and the import line is stripped before
|
|
5
|
-
* IDE completion for the
|
|
2
|
+
* `@archmax-ai/harness/sandbox` — the typed authoring surface for a code state's
|
|
3
|
+
* script (`workflows/<slug>/scripts/<file>.js`). Inside the QuickJS sandbox these
|
|
4
|
+
* names are provided by the prelude and the import line is stripped before
|
|
5
|
+
* evaluation; importing from here buys IDE completion for the state's input,
|
|
6
|
+
* nothing at runtime.
|
|
6
7
|
*
|
|
7
8
|
* ```js
|
|
8
|
-
* import {
|
|
9
|
-
* /**
|
|
10
|
-
* export default async
|
|
11
|
-
* const refund = JSON.parse(await tools.
|
|
12
|
-
* if (refund.decision
|
|
13
|
-
*
|
|
14
|
-
*
|
|
9
|
+
* import { defineCodeState } from "@archmax-ai/harness/sandbox";
|
|
10
|
+
* /** Sends a refund the policy forbids back to the agent. *\/
|
|
11
|
+
* export default defineCodeState(async ({ variables, tools }) => {
|
|
12
|
+
* const refund = JSON.parse(await tools.read_file({ file_path: "scratchpad/refund.json" }));
|
|
13
|
+
* if (refund.decision === "denied") {
|
|
14
|
+
* await tools.archmax_advance({ to: "refund-review", reason: "the denial matches the policy" });
|
|
15
|
+
* } else {
|
|
16
|
+
* await tools.archmax_advance({ to: "refund-request", reason: `order ${refund.orderId} is not eligible` });
|
|
17
|
+
* }
|
|
18
|
+
* });
|
|
15
19
|
* ```
|
|
16
20
|
*
|
|
17
|
-
*
|
|
21
|
+
* A code state moves the session itself: `tools.archmax_advance({ to, reason })`
|
|
22
|
+
* along one of its transitions, or `tools.archmax_raise({ code, reason })` to end
|
|
23
|
+
* the session as failed. Nothing the script returns is read. A non-terminal code
|
|
24
|
+
* state that finishes without either call fails, as does one that throws. It
|
|
25
|
+
* reads the session it checks with `tools.archmax_get_history()`.
|
|
18
26
|
*/
|
|
19
|
-
/** What a hook answers with. */
|
|
20
|
-
export interface HookVerdict {
|
|
21
|
-
verdict: "ok" | "correct" | "veto";
|
|
22
|
-
reason: string;
|
|
23
|
-
}
|
|
24
27
|
/** One transcript message, as plain data. `role` is `user`, `assistant`, `tool`, `system`, or `runtime`. */
|
|
25
|
-
export interface
|
|
28
|
+
export interface HistoryMessage {
|
|
26
29
|
role: string;
|
|
27
|
-
/** The message's text;
|
|
30
|
+
/** The message's text; on a tool result, the result. */
|
|
28
31
|
text: string;
|
|
32
|
+
/** Assistant messages: the tool calls the message made. */
|
|
29
33
|
toolCalls?: {
|
|
30
34
|
id?: string;
|
|
31
35
|
name: string;
|
|
@@ -33,99 +37,59 @@ export interface HookMessage {
|
|
|
33
37
|
}[];
|
|
34
38
|
/** Tool results: the tool that answered. */
|
|
35
39
|
tool?: string;
|
|
36
|
-
/** Tool results: the id of the call answered
|
|
40
|
+
/** Tool results: the id of the call answered. */
|
|
37
41
|
id?: string;
|
|
38
|
-
/** Runtime notes: which kind of note (an arrival, a decision, an error route). */
|
|
42
|
+
/** Runtime notes: which kind of note (an arrival, a decision, an error route, an automated state's move). */
|
|
39
43
|
note?: string;
|
|
40
44
|
}
|
|
41
|
-
/** One tool call of the session, as `toolCalls` returns it. */
|
|
42
|
-
export interface ToolCallRecord {
|
|
43
|
-
id?: string;
|
|
44
|
-
name: string;
|
|
45
|
-
args: unknown;
|
|
46
|
-
/** The tool's result, parsed when it is JSON text; absent while `pending`. */
|
|
47
|
-
result?: unknown;
|
|
48
|
-
/** `rejected` is a call governance refused; `pending` has no result yet. */
|
|
49
|
-
status: "completed" | "pending" | "failed" | "rejected";
|
|
50
|
-
/** The state and visit (numbered from 1) of the message that made the call. */
|
|
51
|
-
state: string;
|
|
52
|
-
visit: number;
|
|
53
|
-
}
|
|
54
|
-
/** What `toolCalls` narrows by; every given key must match, and an unknown key is refused. */
|
|
55
|
-
export interface ToolCallFilter {
|
|
56
|
-
name?: string;
|
|
57
|
-
state?: string;
|
|
58
|
-
/** A visit's number, or `"current"`: the visit the hook sees. */
|
|
59
|
-
visit?: number | "current";
|
|
60
|
-
status?: ToolCallRecord["status"];
|
|
61
|
-
/** Only the last `last` matches. */
|
|
62
|
-
last?: number;
|
|
63
|
-
}
|
|
64
|
-
/** The machine context a lifecycle hook receives (also the global `args`). */
|
|
65
|
-
export interface HookArgs {
|
|
66
|
-
state: string;
|
|
67
|
-
phase: "before" | "after";
|
|
68
|
-
/** Which trigger started the run — its id. A run's input is in `variables`. */
|
|
69
|
-
trigger?: string;
|
|
70
|
-
/** The session's variables as a plain `name → value` map. Read-only: assigning changes nothing. */
|
|
71
|
-
variables: Record<string, unknown>;
|
|
72
|
-
/**
|
|
73
|
-
* The transcript of the current visit, newest last: everything since the
|
|
74
|
-
* session entered the state it is in (on an advance, the state being left).
|
|
75
|
-
*/
|
|
76
|
-
messages: HookMessage[];
|
|
77
|
-
/** The session's tool calls with their results, across every visit, oldest first. */
|
|
78
|
-
toolCalls(filter?: ToolCallFilter): Promise<ToolCallRecord[]>;
|
|
79
|
-
/** `after` hooks on an advance: the transition being attempted and the agent's reason. */
|
|
80
|
-
from?: string;
|
|
81
|
-
to?: string;
|
|
82
|
-
reason?: string;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* The privileged tool-call bridge (`tools.*`): the agent's tools as async
|
|
86
|
-
* functions keyed by camelCase name (`tools.readFile({ file_path })`). A hook
|
|
87
|
-
* runs on runtime authority, so the state's allow list does not bind it; the
|
|
88
|
-
* safety rules, the workflow `policy`, and consumer rules do. A refused call
|
|
89
|
-
* rejects with the governance reason.
|
|
90
|
-
*/
|
|
91
|
-
export type SandboxTools = Record<string, (input?: unknown) => Promise<unknown>>;
|
|
92
45
|
/**
|
|
93
46
|
* One committed traversal step of a session's audit trail: the state entered,
|
|
94
47
|
* the kind of edge that committed it, the recorded rationale when one was given
|
|
95
48
|
* (on `trigger` steps, the trigger id), and — on `sub-workflow` steps — the
|
|
96
49
|
* child workflow and whether it completed. Each turn begins with a `trigger`
|
|
97
|
-
* step; the order read back is the order committed.
|
|
50
|
+
* step; the order read back is the order committed. A move by the session's
|
|
51
|
+
* agent is `agent`, by a grader state `grader`, by a code state `code`.
|
|
98
52
|
*/
|
|
99
53
|
export interface TrailStep {
|
|
100
54
|
to: string;
|
|
101
|
-
kind: "trigger" | "agent" | "human" | "sub-workflow" | "reset" | "on_error";
|
|
55
|
+
kind: "trigger" | "agent" | "human" | "grader" | "code" | "sub-workflow" | "reset" | "on_error";
|
|
102
56
|
reason?: string;
|
|
103
57
|
workflow?: string;
|
|
104
58
|
status?: "ok" | "error";
|
|
105
59
|
/** Epoch milliseconds at commit. */
|
|
106
60
|
ts: number;
|
|
107
61
|
}
|
|
108
|
-
/**
|
|
109
|
-
export interface
|
|
110
|
-
|
|
62
|
+
/** What a code state's script is run with (also the global `args`). */
|
|
63
|
+
export interface CodeStateArgs {
|
|
64
|
+
/** The code state's own slug. */
|
|
65
|
+
state: string;
|
|
66
|
+
/** Which trigger started the turn — its id. A session's input is in `variables`. */
|
|
67
|
+
trigger?: string;
|
|
68
|
+
/** The session's variables as a plain `name → value` map. Read-only: assigning changes nothing — write with `tools.archmax_set_variables`. */
|
|
69
|
+
variables: Record<string, unknown>;
|
|
111
70
|
}
|
|
112
71
|
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* so any other object — a misspelled `verdict`, a retired shape like
|
|
117
|
-
* `{ ok: false, reason }` — is a verdict the author got wrong and fails closed
|
|
118
|
-
* with its keys named, rather than being read as `ok` and silently permitting
|
|
119
|
-
* what the hook meant to block. Non-object values (`true`, a number, a bare
|
|
120
|
-
* body's incidental completion value) stay `ok`.
|
|
121
|
-
*
|
|
122
|
-
* These rules are the whole verdict vocabulary, and every hook kind is read
|
|
123
|
-
* through them — a custom kind registered via `hookExecutors` included.
|
|
72
|
+
* What `tools.archmax_get_history()` answers, as JSON: the session's whole
|
|
73
|
+
* transcript and its whole trail, oldest first — the same history a grader reads.
|
|
74
|
+
* `const { messages, trail } = JSON.parse(await tools.archmax_get_history())`.
|
|
124
75
|
*/
|
|
125
|
-
export
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
76
|
+
export interface SessionHistory {
|
|
77
|
+
messages: HistoryMessage[];
|
|
78
|
+
trail: TrailStep[];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The code state's tools (`tools.*`): exactly its state's surface — its grants,
|
|
82
|
+
* the workflow-wide grant, and its controls (`archmax_advance`, `archmax_raise`,
|
|
83
|
+
* `archmax_get_variables`, `archmax_set_variables`, `archmax_get_history`) — as async functions, by
|
|
84
|
+
* their own name (`tools.read_file`) or camelCase (`tools.readFile`). A tool the
|
|
85
|
+
* state does not offer is `undefined`. Every call is governed against the code
|
|
86
|
+
* state as a model's would be; a refused call rejects with the governance reason.
|
|
87
|
+
*/
|
|
88
|
+
export type SandboxTools = Record<string, (input?: unknown) => Promise<unknown>>;
|
|
89
|
+
/** The single object a code state's default export is called with. */
|
|
90
|
+
export interface CodeStateInput extends CodeStateArgs {
|
|
91
|
+
tools: SandboxTools;
|
|
92
|
+
}
|
|
93
|
+
export type CodeStateFn = (input: CodeStateInput) => unknown | Promise<unknown>;
|
|
94
|
+
/** Alias for `export default`: `export default defineCodeState(async (input) => …)`. Identity at runtime. */
|
|
95
|
+
export declare function defineCodeState(fn: CodeStateFn): CodeStateFn;
|
package/dist/public/sandbox.js
CHANGED
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@archmax-ai/harness/sandbox` — the typed authoring surface for
|
|
3
|
-
* scripts. Inside the QuickJS sandbox these
|
|
4
|
-
* and the import line is stripped before
|
|
5
|
-
* IDE completion for the
|
|
2
|
+
* `@archmax-ai/harness/sandbox` — the typed authoring surface for a code state's
|
|
3
|
+
* script (`workflows/<slug>/scripts/<file>.js`). Inside the QuickJS sandbox these
|
|
4
|
+
* names are provided by the prelude and the import line is stripped before
|
|
5
|
+
* evaluation; importing from here buys IDE completion for the state's input,
|
|
6
|
+
* nothing at runtime.
|
|
6
7
|
*
|
|
7
8
|
* ```js
|
|
8
|
-
* import {
|
|
9
|
-
* /**
|
|
10
|
-
* export default async
|
|
11
|
-
* const refund = JSON.parse(await tools.
|
|
12
|
-
* if (refund.decision
|
|
13
|
-
*
|
|
14
|
-
*
|
|
9
|
+
* import { defineCodeState } from "@archmax-ai/harness/sandbox";
|
|
10
|
+
* /** Sends a refund the policy forbids back to the agent. *\/
|
|
11
|
+
* export default defineCodeState(async ({ variables, tools }) => {
|
|
12
|
+
* const refund = JSON.parse(await tools.read_file({ file_path: "scratchpad/refund.json" }));
|
|
13
|
+
* if (refund.decision === "denied") {
|
|
14
|
+
* await tools.archmax_advance({ to: "refund-review", reason: "the denial matches the policy" });
|
|
15
|
+
* } else {
|
|
16
|
+
* await tools.archmax_advance({ to: "refund-request", reason: `order ${refund.orderId} is not eligible` });
|
|
17
|
+
* }
|
|
18
|
+
* });
|
|
15
19
|
* ```
|
|
16
20
|
*
|
|
17
|
-
*
|
|
21
|
+
* A code state moves the session itself: `tools.archmax_advance({ to, reason })`
|
|
22
|
+
* along one of its transitions, or `tools.archmax_raise({ code, reason })` to end
|
|
23
|
+
* the session as failed. Nothing the script returns is read. A non-terminal code
|
|
24
|
+
* state that finishes without either call fails, as does one that throws. It
|
|
25
|
+
* reads the session it checks with `tools.archmax_get_history()`.
|
|
18
26
|
*/
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
export function veto(reason) {
|
|
23
|
-
return { verdict: "veto", reason };
|
|
24
|
-
}
|
|
25
|
-
export function correct(reason) {
|
|
26
|
-
return { verdict: "correct", reason };
|
|
27
|
-
}
|
|
28
|
-
/** Alias for `export default`: `export default defineHook(async (input) => …)`. Identity at runtime. */
|
|
29
|
-
export function defineHook(fn) {
|
|
27
|
+
/** Alias for `export default`: `export default defineCodeState(async (input) => …)`. Identity at runtime. */
|
|
28
|
+
export function defineCodeState(fn) {
|
|
30
29
|
return fn;
|
|
31
30
|
}
|
|
32
31
|
//# sourceMappingURL=sandbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../src/public/sandbox.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../src/public/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAwEH,6GAA6G;AAC7G,MAAM,UAAU,eAAe,CAAC,EAAe;IAC7C,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
package/dist/public/spec.d.ts
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
*
|
|
13
13
|
* What is **not** here, because it cannot be pure: loading a spec from a
|
|
14
14
|
* backend (`loadMachineSpec`), compiling one (`WorkflowMachine`), the full
|
|
15
|
-
* validator (`validateWorkflow`, which also probes the kernel and reads
|
|
16
|
-
* scripts), resolving a trigger against a machine, and every store and mount.
|
|
15
|
+
* validator (`validateWorkflow`, which also probes the kernel and reads
|
|
16
|
+
* code-state scripts), resolving a trigger against a machine, and every store and mount.
|
|
17
17
|
* Those stay on the package root.
|
|
18
18
|
*
|
|
19
19
|
* Several names here are also on the root. That is deliberate: this subpath
|
|
@@ -30,10 +30,12 @@ triggerDeclarationSchema,
|
|
|
30
30
|
/** A state's `triggers:` mapping — trigger id to declaration (or `null`). */
|
|
31
31
|
stateTriggersSchema,
|
|
32
32
|
/** One transition. */
|
|
33
|
-
machineTransitionSchema, transitionTypeSchema, stateTypeSchema, stateBudgetSchema,
|
|
33
|
+
machineTransitionSchema, transitionTypeSchema, stateTypeSchema, stateBudgetSchema, allowEntrySchema, forbidEntrySchema,
|
|
34
34
|
/** The `*` entry a `forbid` list uses to refuse every tool. */
|
|
35
|
-
FORBID_ANY_TOOL, toolsBlockSchema, skillsBlockSchema, mountAccessSchema, mountGrantEntrySchema, mountsBlockSchema, workflowMountsConfigSchema,
|
|
36
|
-
/**
|
|
35
|
+
FORBID_ANY_TOOL, toolsBlockSchema, skillsBlockSchema, mountAccessSchema, mountGrantEntrySchema, mountsBlockSchema, workflowMountsConfigSchema,
|
|
36
|
+
/** A code state's `script:` — a workflow-relative path confined to `scripts/`. */
|
|
37
|
+
codeScriptPathSchema, workflowToolsConfigSchema, workflowSkillsConfigSchema, machineSettingsSchema, machinePromptCacheSettingsSchema, workflowTestsConfigSchema, runtimeMetadataSchema,
|
|
38
|
+
/** The loose slot for host metadata at the root and on a state. */
|
|
37
39
|
specMetadataSchema,
|
|
38
40
|
/** One `requires`/`returns` entry: a bare name, or `{ name, type?, description? }`. */
|
|
39
41
|
signatureEntrySchema,
|
|
@@ -42,7 +44,7 @@ parseMachineSpec,
|
|
|
42
44
|
/** The document-level rules alone, over a spec the shape has accepted. */
|
|
43
45
|
refineSpec, } from "../machine/spec-schema.js";
|
|
44
46
|
export type { SpecSchemaIssue } from "../machine/spec-schema.js";
|
|
45
|
-
export type { MachineSpec, MachineState, MachineTransition, TransitionType,
|
|
47
|
+
export type { MachineSpec, MachineState, MachineTransition, TransitionType, StateBudget, AllowEntry, ForbidEntry, ToolsBlock, SkillsBlock, MountAccess, MountGrantEntry, MountsBlock, WorkflowMountsConfig, StateType, WorkflowToolsConfig, WorkflowSkillsConfig, MachineSettings, MachinePromptCacheSettings, WorkflowTestsConfig, RuntimeMetadata, TriggerDeclaration, SpecMetadata, SignatureEntryDeclaration, } from "../machine/types.js";
|
|
46
48
|
/** Whether a spec declares itself out of service (`disabled: true`). */
|
|
47
49
|
export { specDisabled } from "../machine/types.js";
|
|
48
50
|
export {
|
|
@@ -61,15 +63,6 @@ export {
|
|
|
61
63
|
mountNameOf,
|
|
62
64
|
/** The mount a glob can only ever match inside, or `null` when it is broader. */
|
|
63
65
|
mountNameOfPattern, } from "../core/zones.js";
|
|
64
|
-
export {
|
|
65
|
-
/** A `before:`/`after:` declaration as a flat list of hooks. */
|
|
66
|
-
normalizeHooks,
|
|
67
|
-
/** A hook's kind (`script`, `subagent`, a custom one). */
|
|
68
|
-
hookKind,
|
|
69
|
-
/** A hook's value: the script path, the rubric name. */
|
|
70
|
-
hookValue,
|
|
71
|
-
/** The keys that ride beside a hook's kind (`max_iterations`) rather than naming one. */
|
|
72
|
-
HOOK_SIDECAR_KEYS, } from "../lifecycle/hook-shape.js";
|
|
73
66
|
export { SLUG_PATTERN, isSlug } from "../machine/slug.js";
|
|
74
67
|
export { MANUAL_TRIGGER, DEFAULT_TRIGGER_ID,
|
|
75
68
|
/** Parse a dotted session path (`triggers.-1.conversationId`). */
|
|
@@ -162,15 +155,15 @@ dispatchIdOf,
|
|
|
162
155
|
/** The top-level session an id belongs to: the part before the first `~`. */
|
|
163
156
|
rootSessionIdOf, } from "../sessions/scope.js";
|
|
164
157
|
export { DEFAULT_WORKFLOW,
|
|
165
|
-
/** Where a
|
|
166
|
-
|
|
158
|
+
/** Where a code state's script lives, relative to its workflow directory. */
|
|
159
|
+
SCRIPTS_DIR,
|
|
167
160
|
/** Where a workspace may override the bundled platform prompt (`.platform/system/GRAPH_STATE.md`). */
|
|
168
161
|
PLATFORM_PROMPT_PATH,
|
|
169
|
-
/** The authored paths of one workflow (`workflow.yaml`, `WORKFLOW.md`, `tests/`, `
|
|
162
|
+
/** The authored paths of one workflow (`workflow.yaml`, `WORKFLOW.md`, `tests/`, `scripts/`). */
|
|
170
163
|
workflowPaths,
|
|
171
164
|
/** The runtime-internal layout of one session's folder. */
|
|
172
165
|
sessionPaths,
|
|
173
|
-
/** Resolve a
|
|
174
|
-
|
|
166
|
+
/** Resolve a code state's declared `script:` to an authoring-backend path, or refuse it with a reason. */
|
|
167
|
+
resolveCodeScript, } from "../workflow/paths.js";
|
|
175
168
|
export { parseCodeDescription } from "../core/code-description.js";
|
|
176
169
|
export type { CodeDescription } from "../core/code-description.js";
|
package/dist/public/spec.js
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
*
|
|
13
13
|
* What is **not** here, because it cannot be pure: loading a spec from a
|
|
14
14
|
* backend (`loadMachineSpec`), compiling one (`WorkflowMachine`), the full
|
|
15
|
-
* validator (`validateWorkflow`, which also probes the kernel and reads
|
|
16
|
-
* scripts), resolving a trigger against a machine, and every store and mount.
|
|
15
|
+
* validator (`validateWorkflow`, which also probes the kernel and reads
|
|
16
|
+
* code-state scripts), resolving a trigger against a machine, and every store and mount.
|
|
17
17
|
* Those stay on the package root.
|
|
18
18
|
*
|
|
19
19
|
* Several names here are also on the root. That is deliberate: this subpath
|
|
@@ -31,10 +31,12 @@ triggerDeclarationSchema,
|
|
|
31
31
|
/** A state's `triggers:` mapping — trigger id to declaration (or `null`). */
|
|
32
32
|
stateTriggersSchema,
|
|
33
33
|
/** One transition. */
|
|
34
|
-
machineTransitionSchema, transitionTypeSchema, stateTypeSchema, stateBudgetSchema,
|
|
34
|
+
machineTransitionSchema, transitionTypeSchema, stateTypeSchema, stateBudgetSchema, allowEntrySchema, forbidEntrySchema,
|
|
35
35
|
/** The `*` entry a `forbid` list uses to refuse every tool. */
|
|
36
|
-
FORBID_ANY_TOOL, toolsBlockSchema, skillsBlockSchema, mountAccessSchema, mountGrantEntrySchema, mountsBlockSchema, workflowMountsConfigSchema,
|
|
37
|
-
/**
|
|
36
|
+
FORBID_ANY_TOOL, toolsBlockSchema, skillsBlockSchema, mountAccessSchema, mountGrantEntrySchema, mountsBlockSchema, workflowMountsConfigSchema,
|
|
37
|
+
/** A code state's `script:` — a workflow-relative path confined to `scripts/`. */
|
|
38
|
+
codeScriptPathSchema, workflowToolsConfigSchema, workflowSkillsConfigSchema, machineSettingsSchema, machinePromptCacheSettingsSchema, workflowTestsConfigSchema, runtimeMetadataSchema,
|
|
39
|
+
/** The loose slot for host metadata at the root and on a state. */
|
|
38
40
|
specMetadataSchema,
|
|
39
41
|
/** One `requires`/`returns` entry: a bare name, or `{ name, type?, description? }`. */
|
|
40
42
|
signatureEntrySchema,
|
|
@@ -59,16 +61,6 @@ export {
|
|
|
59
61
|
mountNameOf,
|
|
60
62
|
/** The mount a glob can only ever match inside, or `null` when it is broader. */
|
|
61
63
|
mountNameOfPattern, } from "../core/zones.js";
|
|
62
|
-
// --- Hooks ------------------------------------------------------------------------
|
|
63
|
-
export {
|
|
64
|
-
/** A `before:`/`after:` declaration as a flat list of hooks. */
|
|
65
|
-
normalizeHooks,
|
|
66
|
-
/** A hook's kind (`script`, `subagent`, a custom one). */
|
|
67
|
-
hookKind,
|
|
68
|
-
/** A hook's value: the script path, the rubric name. */
|
|
69
|
-
hookValue,
|
|
70
|
-
/** The keys that ride beside a hook's kind (`max_iterations`) rather than naming one. */
|
|
71
|
-
HOOK_SIDECAR_KEYS, } from "../lifecycle/hook-shape.js";
|
|
72
64
|
// --- Slugs, triggers, variables --------------------------------------------------
|
|
73
65
|
export { SLUG_PATTERN, isSlug } from "../machine/slug.js";
|
|
74
66
|
export { MANUAL_TRIGGER, DEFAULT_TRIGGER_ID,
|
|
@@ -161,16 +153,16 @@ dispatchIdOf,
|
|
|
161
153
|
rootSessionIdOf, } from "../sessions/scope.js";
|
|
162
154
|
// --- Paths -------------------------------------------------------------------------------
|
|
163
155
|
export { DEFAULT_WORKFLOW,
|
|
164
|
-
/** Where a
|
|
165
|
-
|
|
156
|
+
/** Where a code state's script lives, relative to its workflow directory. */
|
|
157
|
+
SCRIPTS_DIR,
|
|
166
158
|
/** Where a workspace may override the bundled platform prompt (`.platform/system/GRAPH_STATE.md`). */
|
|
167
159
|
PLATFORM_PROMPT_PATH,
|
|
168
|
-
/** The authored paths of one workflow (`workflow.yaml`, `WORKFLOW.md`, `tests/`, `
|
|
160
|
+
/** The authored paths of one workflow (`workflow.yaml`, `WORKFLOW.md`, `tests/`, `scripts/`). */
|
|
169
161
|
workflowPaths,
|
|
170
162
|
/** The runtime-internal layout of one session's folder. */
|
|
171
163
|
sessionPaths,
|
|
172
|
-
/** Resolve a
|
|
173
|
-
|
|
164
|
+
/** Resolve a code state's declared `script:` to an authoring-backend path, or refuse it with a reason. */
|
|
165
|
+
resolveCodeScript, } from "../workflow/paths.js";
|
|
174
166
|
// --- Scripts -------------------------------------------------------------------------------
|
|
175
167
|
export { parseCodeDescription } from "../core/code-description.js";
|
|
176
168
|
//# sourceMappingURL=spec.js.map
|
package/dist/public/spec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../src/public/spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,gFAAgF;AAEhF,OAAO;AACL,0HAA0H;AAC1H,iBAAiB;AACjB,iBAAiB;AACjB,kBAAkB;AAClB,0FAA0F;AAC1F,wBAAwB;AACxB,6EAA6E;AAC7E,mBAAmB;AACnB,sBAAsB;AACtB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../src/public/spec.ts"],"names":[],"mappings":"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"}
|
|
@@ -26,27 +26,26 @@ export interface ResolvedRuntimeContract extends RuntimeContract {
|
|
|
26
26
|
/** Offline test-case format implied by this runtime version. */
|
|
27
27
|
testFormat: string;
|
|
28
28
|
}
|
|
29
|
+
/** Default contract version applied when metadata is omitted. */
|
|
30
|
+
export declare const DEFAULT_RUNTIME_VERSION = "3";
|
|
29
31
|
/** The sandbox script contract applied when nothing resolves a runtime version. */
|
|
30
32
|
export declare const DEFAULT_SANDBOX_VERSION: number;
|
|
31
33
|
/**
|
|
32
|
-
* The execution contexts the runtime assembles a prelude for
|
|
33
|
-
*
|
|
34
|
-
*
|
|
34
|
+
* The execution contexts the runtime assembles a prelude for: `ptc` for the
|
|
35
|
+
* agent's own code (`archmax_eval`, `archmax_run`), `code` for a code state's
|
|
36
|
+
* script. A context is always named, never iterated.
|
|
35
37
|
*/
|
|
36
|
-
export type SandboxContext = "
|
|
38
|
+
export type SandboxContext = "ptc" | "code";
|
|
37
39
|
/** The runtime engine this package implements. */
|
|
38
40
|
export declare const RUNTIME_ENGINE = "archmax-harness";
|
|
39
|
-
/** Default contract version applied when metadata is omitted. */
|
|
40
|
-
export declare const DEFAULT_RUNTIME_VERSION = "1";
|
|
41
41
|
/** The contract resolved for workspaces that omit `runtime` metadata. */
|
|
42
42
|
export declare const DEFAULT_RUNTIME_CONTRACT: RuntimeContract;
|
|
43
43
|
/**
|
|
44
|
-
* The explicit set of runtime contracts the installed runtime supports.
|
|
45
|
-
*
|
|
46
|
-
* `WORKFLOW.md` layout, declarative `tests:` block, typed sandbox imports,
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* support checking, validation, and docs. Version 1 remains supported.
|
|
44
|
+
* The explicit set of runtime contracts the installed runtime supports. Version
|
|
45
|
+
* 3 identifies the current authoring contract (two-file `workflow.yaml` /
|
|
46
|
+
* `WORKFLOW.md` layout, declarative `tests:` block, typed sandbox imports, the
|
|
47
|
+
* four state types). Load behavior is layout-driven, not version-driven — the
|
|
48
|
+
* version is declarative metadata for support checking, validation, and docs.
|
|
50
49
|
*/
|
|
51
50
|
export declare const SUPPORTED_RUNTIME_CONTRACTS: readonly RuntimeContract[];
|
|
52
51
|
/** Render a contract as `engine@version` for messages and artifacts. */
|