@archmax-ai/harness 0.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/LICENSE +21 -0
- package/README.md +219 -0
- package/dist/agent.d.ts +174 -0
- package/dist/agent.js +140 -0
- package/dist/agent.js.map +1 -0
- package/dist/assembly/compose.d.ts +170 -0
- package/dist/assembly/compose.js +391 -0
- package/dist/assembly/compose.js.map +1 -0
- package/dist/assembly/delegation-registry.d.ts +5 -0
- package/dist/assembly/delegation-registry.js +118 -0
- package/dist/assembly/delegation-registry.js.map +1 -0
- package/dist/assembly/index.d.ts +192 -0
- package/dist/assembly/index.js +265 -0
- package/dist/assembly/index.js.map +1 -0
- package/dist/assembly/plain.d.ts +7 -0
- package/dist/assembly/plain.js +41 -0
- package/dist/assembly/plain.js.map +1 -0
- package/dist/authoring-skill/archmax-harness/README.md +76 -0
- package/dist/authoring-skill/archmax-harness/SKILL.md +241 -0
- package/dist/authoring-skill/archmax-harness/references/backend-integration.md +626 -0
- package/dist/authoring-skill/archmax-harness/references/cases.md +41 -0
- package/dist/authoring-skill/archmax-harness/references/diagnostics.md +51 -0
- package/dist/authoring-skill/archmax-harness/references/hook-and-test-scripts.md +1070 -0
- package/dist/authoring-skill/archmax-harness/references/hooks-and-scripts.md +82 -0
- package/dist/authoring-skill/archmax-harness/references/wiring.md +101 -0
- package/dist/authoring-skill/archmax-harness/references/workflow-schema.md +1631 -0
- package/dist/authoring-skill/archmax-harness/references/workflow-yaml.md +241 -0
- package/dist/behaviour/support.d.ts +232 -0
- package/dist/behaviour/support.js +339 -0
- package/dist/behaviour/support.js.map +1 -0
- package/dist/cli/banner.d.ts +11 -0
- package/dist/cli/banner.js +29 -0
- package/dist/cli/banner.js.map +1 -0
- package/dist/cli/bootstrap.d.ts +33 -0
- package/dist/cli/bootstrap.js +153 -0
- package/dist/cli/bootstrap.js.map +1 -0
- package/dist/cli/command.d.ts +39 -0
- package/dist/cli/command.js +97 -0
- package/dist/cli/command.js.map +1 -0
- package/dist/cli/state-flow.d.ts +46 -0
- package/dist/cli/state-flow.js +268 -0
- package/dist/cli/state-flow.js.map +1 -0
- package/dist/cli/style.d.ts +41 -0
- package/dist/cli/style.js +64 -0
- package/dist/cli/style.js.map +1 -0
- package/dist/cli/turn.d.ts +41 -0
- package/dist/cli/turn.js +161 -0
- package/dist/cli/turn.js.map +1 -0
- package/dist/cli.d.ts +10 -0
- package/dist/cli.js +426 -0
- package/dist/cli.js.map +1 -0
- package/dist/core/code-description.d.ts +22 -0
- package/dist/core/code-description.js +38 -0
- package/dist/core/code-description.js.map +1 -0
- package/dist/core/deepagents.d.ts +183 -0
- package/dist/core/deepagents.js +128 -0
- package/dist/core/deepagents.js.map +1 -0
- package/dist/core/events.d.ts +350 -0
- package/dist/core/events.js +205 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/frontmatter.d.ts +15 -0
- package/dist/core/frontmatter.js +32 -0
- package/dist/core/frontmatter.js.map +1 -0
- package/dist/core/listing-redact.d.ts +37 -0
- package/dist/core/listing-redact.js +88 -0
- package/dist/core/listing-redact.js.map +1 -0
- package/dist/core/match.d.ts +26 -0
- package/dist/core/match.js +75 -0
- package/dist/core/match.js.map +1 -0
- package/dist/core/message-readers.d.ts +84 -0
- package/dist/core/message-readers.js +159 -0
- package/dist/core/message-readers.js.map +1 -0
- package/dist/core/messages.d.ts +49 -0
- package/dist/core/messages.js +85 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/mount-prompt.d.ts +28 -0
- package/dist/core/mount-prompt.js +55 -0
- package/dist/core/mount-prompt.js.map +1 -0
- package/dist/core/mount-redact.d.ts +28 -0
- package/dist/core/mount-redact.js +32 -0
- package/dist/core/mount-redact.js.map +1 -0
- package/dist/core/mounts.d.ts +88 -0
- package/dist/core/mounts.js +147 -0
- package/dist/core/mounts.js.map +1 -0
- package/dist/core/path-mapping.d.ts +52 -0
- package/dist/core/path-mapping.js +113 -0
- package/dist/core/path-mapping.js.map +1 -0
- package/dist/core/platform-prompt.generated.d.ts +2 -0
- package/dist/core/platform-prompt.generated.js +4 -0
- package/dist/core/platform-prompt.generated.js.map +1 -0
- package/dist/core/prompt.d.ts +42 -0
- package/dist/core/prompt.js +75 -0
- package/dist/core/prompt.js.map +1 -0
- package/dist/core/session-id.d.ts +38 -0
- package/dist/core/session-id.js +61 -0
- package/dist/core/session-id.js.map +1 -0
- package/dist/core/session-store.d.ts +85 -0
- package/dist/core/session-store.js +149 -0
- package/dist/core/session-store.js.map +1 -0
- package/dist/core/session-zone.d.ts +54 -0
- package/dist/core/session-zone.js +82 -0
- package/dist/core/session-zone.js.map +1 -0
- package/dist/core/skill-prompt.d.ts +31 -0
- package/dist/core/skill-prompt.js +54 -0
- package/dist/core/skill-prompt.js.map +1 -0
- package/dist/core/skill-redact.d.ts +15 -0
- package/dist/core/skill-redact.js +27 -0
- package/dist/core/skill-redact.js.map +1 -0
- package/dist/core/skills.d.ts +172 -0
- package/dist/core/skills.js +214 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/tool-mocks.d.ts +23 -0
- package/dist/core/tool-mocks.js +39 -0
- package/dist/core/tool-mocks.js.map +1 -0
- package/dist/core/tool-telemetry.d.ts +16 -0
- package/dist/core/tool-telemetry.js +40 -0
- package/dist/core/tool-telemetry.js.map +1 -0
- package/dist/core/usage.d.ts +114 -0
- package/dist/core/usage.js +226 -0
- package/dist/core/usage.js.map +1 -0
- package/dist/core/workspace-context.d.ts +136 -0
- package/dist/core/workspace-context.js +178 -0
- package/dist/core/workspace-context.js.map +1 -0
- package/dist/core/workspace-prompt.d.ts +7 -0
- package/dist/core/workspace-prompt.js +102 -0
- package/dist/core/workspace-prompt.js.map +1 -0
- package/dist/core/workspace-router.d.ts +61 -0
- package/dist/core/workspace-router.js +145 -0
- package/dist/core/workspace-router.js.map +1 -0
- package/dist/core/workspace.d.ts +85 -0
- package/dist/core/workspace.js +193 -0
- package/dist/core/workspace.js.map +1 -0
- package/dist/core/zones.d.ts +181 -0
- package/dist/core/zones.js +202 -0
- package/dist/core/zones.js.map +1 -0
- package/dist/env.d.ts +99 -0
- package/dist/env.js +271 -0
- package/dist/env.js.map +1 -0
- package/dist/index.d.ts +265 -0
- package/dist/index.js +197 -0
- package/dist/index.js.map +1 -0
- package/dist/kernel/kernel.d.ts +192 -0
- package/dist/kernel/kernel.js +751 -0
- package/dist/kernel/kernel.js.map +1 -0
- package/dist/lifecycle/hook-shape.d.ts +44 -0
- package/dist/lifecycle/hook-shape.js +66 -0
- package/dist/lifecycle/hook-shape.js.map +1 -0
- package/dist/lifecycle/runner.d.ts +177 -0
- package/dist/lifecycle/runner.js +372 -0
- package/dist/lifecycle/runner.js.map +1 -0
- package/dist/lifecycle/transcript.d.ts +27 -0
- package/dist/lifecycle/transcript.js +43 -0
- package/dist/lifecycle/transcript.js.map +1 -0
- package/dist/machine/allow.d.ts +65 -0
- package/dist/machine/allow.js +107 -0
- package/dist/machine/allow.js.map +1 -0
- package/dist/machine/delegation.d.ts +9 -0
- package/dist/machine/delegation.js +10 -0
- package/dist/machine/delegation.js.map +1 -0
- package/dist/machine/diagnostic.d.ts +14 -0
- package/dist/machine/diagnostic.js +2 -0
- package/dist/machine/diagnostic.js.map +1 -0
- package/dist/machine/lint-spec.d.ts +4 -0
- package/dist/machine/lint-spec.js +266 -0
- package/dist/machine/lint-spec.js.map +1 -0
- package/dist/machine/load-spec.d.ts +90 -0
- package/dist/machine/load-spec.js +120 -0
- package/dist/machine/load-spec.js.map +1 -0
- package/dist/machine/machine.d.ts +273 -0
- package/dist/machine/machine.js +551 -0
- package/dist/machine/machine.js.map +1 -0
- package/dist/machine/mount-grants.d.ts +25 -0
- package/dist/machine/mount-grants.js +24 -0
- package/dist/machine/mount-grants.js.map +1 -0
- package/dist/machine/slug.d.ts +14 -0
- package/dist/machine/slug.js +17 -0
- package/dist/machine/slug.js.map +1 -0
- package/dist/machine/spec-schema.d.ts +662 -0
- package/dist/machine/spec-schema.js +717 -0
- package/dist/machine/spec-schema.js.map +1 -0
- package/dist/machine/tool-names.d.ts +98 -0
- package/dist/machine/tool-names.js +144 -0
- package/dist/machine/tool-names.js.map +1 -0
- package/dist/machine/triggers.d.ts +114 -0
- package/dist/machine/triggers.js +165 -0
- package/dist/machine/triggers.js.map +1 -0
- package/dist/machine/types.d.ts +186 -0
- package/dist/machine/types.js +12 -0
- package/dist/machine/types.js.map +1 -0
- package/dist/machine/validate-spec.d.ts +42 -0
- package/dist/machine/validate-spec.js +29 -0
- package/dist/machine/validate-spec.js.map +1 -0
- package/dist/machine/variables.d.ts +196 -0
- package/dist/machine/variables.js +415 -0
- package/dist/machine/variables.js.map +1 -0
- package/dist/public/cli.d.ts +15 -0
- package/dist/public/cli.js +14 -0
- package/dist/public/cli.js.map +1 -0
- package/dist/public/messages.d.ts +33 -0
- package/dist/public/messages.js +33 -0
- package/dist/public/messages.js.map +1 -0
- package/dist/public/sandbox.d.ts +99 -0
- package/dist/public/sandbox.js +32 -0
- package/dist/public/sandbox.js.map +1 -0
- package/dist/public/spec.d.ts +147 -0
- package/dist/public/spec.js +149 -0
- package/dist/public/spec.js.map +1 -0
- package/dist/public/testing.d.ts +71 -0
- package/dist/public/testing.js +39 -0
- package/dist/public/testing.js.map +1 -0
- package/dist/rubrics/rubrics.d.ts +135 -0
- package/dist/rubrics/rubrics.js +145 -0
- package/dist/rubrics/rubrics.js.map +1 -0
- package/dist/runtime/contract.d.ts +73 -0
- package/dist/runtime/contract.js +96 -0
- package/dist/runtime/contract.js.map +1 -0
- package/dist/sandbox/assets/parts/core.js +22 -0
- package/dist/sandbox/assets/parts/lifecycle-hook.js +47 -0
- package/dist/sandbox/bridge.d.ts +16 -0
- package/dist/sandbox/bridge.js +95 -0
- package/dist/sandbox/bridge.js.map +1 -0
- package/dist/sandbox/executor.d.ts +46 -0
- package/dist/sandbox/executor.js +119 -0
- package/dist/sandbox/executor.js.map +1 -0
- package/dist/sandbox/imports.d.ts +33 -0
- package/dist/sandbox/imports.js +67 -0
- package/dist/sandbox/imports.js.map +1 -0
- package/dist/sandbox/prelude.d.ts +12 -0
- package/dist/sandbox/prelude.js +51 -0
- package/dist/sandbox/prelude.js.map +1 -0
- package/dist/sandbox/ptc-gateway.d.ts +104 -0
- package/dist/sandbox/ptc-gateway.js +167 -0
- package/dist/sandbox/ptc-gateway.js.map +1 -0
- package/dist/sandbox/runtime.d.ts +59 -0
- package/dist/sandbox/runtime.js +51 -0
- package/dist/sandbox/runtime.js.map +1 -0
- package/dist/sandbox/tools.d.ts +34 -0
- package/dist/sandbox/tools.js +147 -0
- package/dist/sandbox/tools.js.map +1 -0
- package/dist/sessions/operations.d.ts +79 -0
- package/dist/sessions/operations.js +121 -0
- package/dist/sessions/operations.js.map +1 -0
- package/dist/sessions/resolve.d.ts +97 -0
- package/dist/sessions/resolve.js +145 -0
- package/dist/sessions/resolve.js.map +1 -0
- package/dist/sessions/resume.d.ts +242 -0
- package/dist/sessions/resume.js +288 -0
- package/dist/sessions/resume.js.map +1 -0
- package/dist/sessions/scope.d.ts +99 -0
- package/dist/sessions/scope.js +145 -0
- package/dist/sessions/scope.js.map +1 -0
- package/dist/sessions/summary.d.ts +65 -0
- package/dist/sessions/summary.js +56 -0
- package/dist/sessions/summary.js.map +1 -0
- package/dist/testing/assertions.d.ts +30 -0
- package/dist/testing/assertions.js +231 -0
- package/dist/testing/assertions.js.map +1 -0
- package/dist/testing/case-document.d.ts +141 -0
- package/dist/testing/case-document.js +51 -0
- package/dist/testing/case-document.js.map +1 -0
- package/dist/testing/case-schema.d.ts +29 -0
- package/dist/testing/case-schema.js +519 -0
- package/dist/testing/case-schema.js.map +1 -0
- package/dist/testing/discovery.d.ts +10 -0
- package/dist/testing/discovery.js +24 -0
- package/dist/testing/discovery.js.map +1 -0
- package/dist/testing/driver.d.ts +78 -0
- package/dist/testing/driver.js +117 -0
- package/dist/testing/driver.js.map +1 -0
- package/dist/testing/grade.d.ts +116 -0
- package/dist/testing/grade.js +261 -0
- package/dist/testing/grade.js.map +1 -0
- package/dist/testing/interpreter.d.ts +55 -0
- package/dist/testing/interpreter.js +103 -0
- package/dist/testing/interpreter.js.map +1 -0
- package/dist/testing/mock-middleware.d.ts +5 -0
- package/dist/testing/mock-middleware.js +33 -0
- package/dist/testing/mock-middleware.js.map +1 -0
- package/dist/testing/runner.d.ts +205 -0
- package/dist/testing/runner.js +266 -0
- package/dist/testing/runner.js.map +1 -0
- package/dist/testing/target.d.ts +27 -0
- package/dist/testing/target.js +21 -0
- package/dist/testing/target.js.map +1 -0
- package/dist/validate/validate.d.ts +41 -0
- package/dist/validate/validate.js +669 -0
- package/dist/validate/validate.js.map +1 -0
- package/dist/workflow/agent-tools.d.ts +10 -0
- package/dist/workflow/agent-tools.js +10 -0
- package/dist/workflow/agent-tools.js.map +1 -0
- package/dist/workflow/checkpointer.d.ts +52 -0
- package/dist/workflow/checkpointer.js +200 -0
- package/dist/workflow/checkpointer.js.map +1 -0
- package/dist/workflow/control-tools.d.ts +174 -0
- package/dist/workflow/control-tools.js +468 -0
- package/dist/workflow/control-tools.js.map +1 -0
- package/dist/workflow/governance.d.ts +104 -0
- package/dist/workflow/governance.js +546 -0
- package/dist/workflow/governance.js.map +1 -0
- package/dist/workflow/middleware.d.ts +85 -0
- package/dist/workflow/middleware.js +283 -0
- package/dist/workflow/middleware.js.map +1 -0
- package/dist/workflow/on-error.d.ts +25 -0
- package/dist/workflow/on-error.js +58 -0
- package/dist/workflow/on-error.js.map +1 -0
- package/dist/workflow/parks.d.ts +46 -0
- package/dist/workflow/parks.js +513 -0
- package/dist/workflow/parks.js.map +1 -0
- package/dist/workflow/paths.d.ts +67 -0
- package/dist/workflow/paths.js +108 -0
- package/dist/workflow/paths.js.map +1 -0
- package/dist/workflow/prompt-cache.d.ts +70 -0
- package/dist/workflow/prompt-cache.js +103 -0
- package/dist/workflow/prompt-cache.js.map +1 -0
- package/dist/workflow/prompt-pruning.d.ts +20 -0
- package/dist/workflow/prompt-pruning.js +83 -0
- package/dist/workflow/prompt-pruning.js.map +1 -0
- package/dist/workflow/render-prompt.d.ts +45 -0
- package/dist/workflow/render-prompt.js +140 -0
- package/dist/workflow/render-prompt.js.map +1 -0
- package/dist/workflow/runtime-config.d.ts +7 -0
- package/dist/workflow/runtime-config.js +9 -0
- package/dist/workflow/runtime-config.js.map +1 -0
- package/dist/workflow/session-artifacts.d.ts +90 -0
- package/dist/workflow/session-artifacts.js +134 -0
- package/dist/workflow/session-artifacts.js.map +1 -0
- package/dist/workflow/session-view.d.ts +31 -0
- package/dist/workflow/session-view.js +94 -0
- package/dist/workflow/session-view.js.map +1 -0
- package/dist/workflow/snapshot.d.ts +14 -0
- package/dist/workflow/snapshot.js +97 -0
- package/dist/workflow/snapshot.js.map +1 -0
- package/dist/workflow/state.d.ts +347 -0
- package/dist/workflow/state.js +322 -0
- package/dist/workflow/state.js.map +1 -0
- package/dist/workflow/sub-workflow.d.ts +174 -0
- package/dist/workflow/sub-workflow.js +392 -0
- package/dist/workflow/sub-workflow.js.map +1 -0
- package/dist/workflow/tool-service.d.ts +48 -0
- package/dist/workflow/tool-service.js +291 -0
- package/dist/workflow/tool-service.js.map +1 -0
- package/dist/workflow/turn-boundary.d.ts +39 -0
- package/dist/workflow/turn-boundary.js +128 -0
- package/dist/workflow/turn-boundary.js.map +1 -0
- package/dist/workflow/turn-runner.d.ts +40 -0
- package/dist/workflow/turn-runner.js +122 -0
- package/dist/workflow/turn-runner.js.map +1 -0
- package/dist/workflow/workflow-tools.d.ts +46 -0
- package/dist/workflow/workflow-tools.js +90 -0
- package/dist/workflow/workflow-tools.js.map +1 -0
- package/package.json +119 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { type WorkflowEventHandler } from "../core/events.js";
|
|
2
|
+
import type { Workspace } from "../core/workspace.js";
|
|
3
|
+
import type { MountPrefixes } from "../core/zones.js";
|
|
4
|
+
import { type GuardResolutionFailure } from "./allow.js";
|
|
5
|
+
import { type VariableStore } from "./variables.js";
|
|
6
|
+
import { type WorkflowSpecPaths } from "./load-spec.js";
|
|
7
|
+
import { type SessionPath, type TriggerBinding } from "./triggers.js";
|
|
8
|
+
import { ALWAYS_ALLOWED_TOOLS, UNGRANTABLE_TOOLS, ESSENTIAL_TOOLS } from "./tool-names.js";
|
|
9
|
+
import { type ForbidEntry, type HarnessSettings, type LifecycleHook, type MachineSpec, type MachineTransition } from "./types.js";
|
|
10
|
+
export { ALWAYS_ALLOWED_TOOLS, ESSENTIAL_TOOLS, UNGRANTABLE_TOOLS };
|
|
11
|
+
/**
|
|
12
|
+
* Read-only context a guard check consults: the run's variables (for `${{…}}`
|
|
13
|
+
* substitution) and a sink for the first unresolvable reference, which the
|
|
14
|
+
* kernel escalates to a terminal run failure rather than a retryable block.
|
|
15
|
+
*/
|
|
16
|
+
export interface GuardContext {
|
|
17
|
+
variables?: VariableStore;
|
|
18
|
+
onUnresolved?: (failure: GuardResolutionFailure) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The compiled workflow: what the runtime consults for transitions, tool
|
|
22
|
+
* surfaces, enabled skills and trigger wiring. A pure view over the parsed
|
|
23
|
+
* `spec` — no workspace, no file access. Declarations are read off `spec`
|
|
24
|
+
* directly (`machine.spec.states[slug].instructions`); the methods here are the
|
|
25
|
+
* derived answers.
|
|
26
|
+
*/
|
|
27
|
+
export declare class WorkflowMachine {
|
|
28
|
+
readonly spec: MachineSpec;
|
|
29
|
+
/**
|
|
30
|
+
* Host-declared tool names treated as essential — always disclosed and
|
|
31
|
+
* permitted in every state, exactly like the built-in {@link ESSENTIAL_TOOLS}.
|
|
32
|
+
*/
|
|
33
|
+
private readonly extraEssential;
|
|
34
|
+
/**
|
|
35
|
+
* The entry state: the `manual` start state, else the first declared start
|
|
36
|
+
* state, else the first declared state — so a machine always has one.
|
|
37
|
+
*/
|
|
38
|
+
readonly entry: string;
|
|
39
|
+
private bindingsCache?;
|
|
40
|
+
private constructor();
|
|
41
|
+
/**
|
|
42
|
+
* Load the machine from its two files, or `null` when nothing loads to a
|
|
43
|
+
* usable machine. Load problems other than a missing file are emitted as
|
|
44
|
+
* `warning` events.
|
|
45
|
+
*/
|
|
46
|
+
static load(workspace: Workspace, paths: WorkflowSpecPaths, onEvent?: WorkflowEventHandler): Promise<WorkflowMachine | null>;
|
|
47
|
+
/** Construct a machine from an already-parsed spec. */
|
|
48
|
+
static fromSpec(spec: MachineSpec, extraEssentialTools?: Iterable<string>): WorkflowMachine;
|
|
49
|
+
/**
|
|
50
|
+
* Stable content hash of the spec, written into a session's first checkpoint
|
|
51
|
+
* and compared on resume.
|
|
52
|
+
*/
|
|
53
|
+
get specHash(): string;
|
|
54
|
+
/** Whether this machine is out of service (see {@link specDisabled}). */
|
|
55
|
+
get disabled(): boolean;
|
|
56
|
+
/** Runtime knobs from `settings`, defaults applied. */
|
|
57
|
+
get harnessSettings(): HarnessSettings;
|
|
58
|
+
/**
|
|
59
|
+
* The model id `state`'s turns run on, or `undefined` when the workflow leaves
|
|
60
|
+
* the choice to the assembly. The one place the chain is derived — the state's
|
|
61
|
+
* `model`, else the root's `settings.model` — so nothing re-implements the
|
|
62
|
+
* precedence. An unknown slug reads as the workflow's own declaration, which is
|
|
63
|
+
* what the runtime wants for a position it cannot resolve.
|
|
64
|
+
*/
|
|
65
|
+
modelFor(state: string): string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Every distinct model id this spec declares, in a stable order (the root's
|
|
68
|
+
* first, then each state's in declaration order). What assembly builds a model
|
|
69
|
+
* for, and what it names when an explicit `model` instance makes them inert.
|
|
70
|
+
*/
|
|
71
|
+
declaredModels(): string[];
|
|
72
|
+
/**
|
|
73
|
+
* The skills the workflow grants in **every** state: the root's
|
|
74
|
+
* `allow_always`, resolved against the registry. A state's `skills.allow`
|
|
75
|
+
* adds to this list, exactly as `tools.allow` adds to `tools.allow_always`.
|
|
76
|
+
* An absent key grants nothing, the same as `allow_always: []`. A declared
|
|
77
|
+
* slug the registry does not provide is dropped (and reported by `validate`).
|
|
78
|
+
*/
|
|
79
|
+
workflowAlwaysSkills(available: readonly string[]): string[];
|
|
80
|
+
/** The slugs `skills.forbid_always` denies in every state of this workflow. */
|
|
81
|
+
workflowForbiddenSkills(): string[];
|
|
82
|
+
/**
|
|
83
|
+
* The slugs denied while `state` is active, from either level. Declaration
|
|
84
|
+
* order, workflow-wide first, so a caller rendering them is byte-stable.
|
|
85
|
+
*/
|
|
86
|
+
forbiddenSkills(state: string): string[];
|
|
87
|
+
/**
|
|
88
|
+
* Which level denies `slug` in `state`, or `undefined` if neither does — so a
|
|
89
|
+
* refusal can say whether a list forbade the bundle or nothing granted it.
|
|
90
|
+
*/
|
|
91
|
+
skillDenial(state: string, slug: string): "workflow" | "state" | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* The skills enabled while `state` is active — the one answer the kernel's
|
|
94
|
+
* skill rule, prompt disclosure, the PTC listing redaction and `validate` all
|
|
95
|
+
* consult.
|
|
96
|
+
*
|
|
97
|
+
* The grant is additive: the state's own `skills.allow` followed by the root's
|
|
98
|
+
* `allow_always`, each in declaration order, deduplicated by slug. The denial
|
|
99
|
+
* beats it: anything `skills.forbid_always` or the state's `skills.forbid`
|
|
100
|
+
* names is removed, so **deny beats allow and no narrower level widens a
|
|
101
|
+
* denial**. Order is declaration order from the frozen spec, so everything
|
|
102
|
+
* rendered from this — the prompt's skills section above all — is byte-stable
|
|
103
|
+
* across the model calls of a turn.
|
|
104
|
+
*/
|
|
105
|
+
enabledSkills(state: string, available: readonly string[]): string[];
|
|
106
|
+
/**
|
|
107
|
+
* The governed mounts the workflow enables in **every** state: the root's
|
|
108
|
+
* `mounts.allow_always`, filtered to the names the host declared governed. A
|
|
109
|
+
* state's `mounts.allow` adds to this list, exactly as `skills.allow` adds to
|
|
110
|
+
* `skills.allow_always`. An absent key grants nothing, the same as
|
|
111
|
+
* `allow_always: []`. A name the table does not govern is dropped (and
|
|
112
|
+
* reported by `validate`) — an ungoverned mount needs no grant.
|
|
113
|
+
*/
|
|
114
|
+
workflowAlwaysMounts(governed: readonly string[]): string[];
|
|
115
|
+
/**
|
|
116
|
+
* The names `mounts.forbid_always` denies in every state of this workflow —
|
|
117
|
+
* governed or not, since a denial subtracts an ungoverned mount's standing
|
|
118
|
+
* visibility too.
|
|
119
|
+
*/
|
|
120
|
+
workflowForbiddenMounts(): string[];
|
|
121
|
+
/**
|
|
122
|
+
* The mount names denied while `state` is active, from either level.
|
|
123
|
+
* Declaration order, workflow-wide first, so a caller rendering them is
|
|
124
|
+
* byte-stable.
|
|
125
|
+
*/
|
|
126
|
+
forbiddenMounts(state: string): string[];
|
|
127
|
+
/**
|
|
128
|
+
* Which level denies `name` in `state`, or `undefined` if neither does — so a
|
|
129
|
+
* refusal can say whether a list forbade the mount or nothing enabled it.
|
|
130
|
+
*/
|
|
131
|
+
mountDenial(state: string, name: string): "workflow" | "state" | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* The **governed** mounts enabled while `state` is active — the one answer the
|
|
134
|
+
* kernel's mount rule, prompt disclosure, the listing redaction and `validate`
|
|
135
|
+
* all consult. Ungoverned mounts are not in it: they are visible in every
|
|
136
|
+
* state without a grant, and `forbiddenMounts` is what takes one away.
|
|
137
|
+
*
|
|
138
|
+
* The grant is additive: the state's own `mounts.allow` followed by the root's
|
|
139
|
+
* `allow_always`, each in declaration order, deduplicated by name. The denial
|
|
140
|
+
* beats it: anything `mounts.forbid_always` or the state's `mounts.forbid`
|
|
141
|
+
* names is removed, so **deny beats allow and no narrower level widens a
|
|
142
|
+
* denial**. Order is declaration order from the frozen spec, so everything
|
|
143
|
+
* rendered from this is byte-stable across the model calls of a turn.
|
|
144
|
+
*/
|
|
145
|
+
enabledMounts(state: string, governed: readonly string[]): string[];
|
|
146
|
+
/**
|
|
147
|
+
* Whether writes to `name` are permitted while `state` is active — the second
|
|
148
|
+
* half of a mount grant, beside which states may see it at all.
|
|
149
|
+
*
|
|
150
|
+
* A mount is writable here only when the host declared it writable **and** no
|
|
151
|
+
* applicable grant narrowed it to `read`. Read-only is a restriction, so it
|
|
152
|
+
* behaves like every other restriction in this schema: whichever level asks
|
|
153
|
+
* for it gets it, and no narrower level widens it back. `read_write` on a
|
|
154
|
+
* mount the host serves read-only is therefore inert (reported by `validate`)
|
|
155
|
+
* — the host's posture is the ceiling, not a default to argue with.
|
|
156
|
+
*
|
|
157
|
+
* An ungoverned mount takes the host's posture in every state: it carries no
|
|
158
|
+
* grant to qualify.
|
|
159
|
+
*/
|
|
160
|
+
mountWritable(state: string, name: string, mounts: MountPrefixes): boolean;
|
|
161
|
+
transitionTargets(from: string): string[];
|
|
162
|
+
getTransition(from: string, to: string): MachineTransition | undefined;
|
|
163
|
+
/** The state a failed turn routes to (`on_error`), if declared and present. */
|
|
164
|
+
onError(state: string): string | undefined;
|
|
165
|
+
/** A state with no declared outgoing transitions is terminal (ends the run). */
|
|
166
|
+
isTerminal(state: string): boolean;
|
|
167
|
+
/** Whether a state is a human decision state (a person picks the edge). */
|
|
168
|
+
isHumanState(state: string): boolean;
|
|
169
|
+
/**
|
|
170
|
+
* States a run can reach: the start states plus everything transitively
|
|
171
|
+
* reachable through transitions and `on_error` routes. A state no start state
|
|
172
|
+
* reaches is dead in the definition, so nothing it declares widens the surface.
|
|
173
|
+
*/
|
|
174
|
+
reachableStates(): Set<string>;
|
|
175
|
+
/** Each state's normalized `before`/`after` hook lists, for states declaring any. */
|
|
176
|
+
lifecycleHooks(): Record<string, LifecycleHook>;
|
|
177
|
+
/**
|
|
178
|
+
* The sibling workflows this machine may delegate to: every
|
|
179
|
+
* `archmax_workflow_<slug>` named in `tools.allow_always` and in the given
|
|
180
|
+
* state's `tools.allow` — or, with no state, in any **reachable** state's.
|
|
181
|
+
* Naming a target in governance *is* declaring the delegation.
|
|
182
|
+
*/
|
|
183
|
+
delegationTargets(state?: string): string[];
|
|
184
|
+
/** Run variables this state must have set before it may be left. */
|
|
185
|
+
requiredVariables(state: string): string[];
|
|
186
|
+
private allowEntries;
|
|
187
|
+
private allowAlwaysEntries;
|
|
188
|
+
/**
|
|
189
|
+
* The effective essential set: the built-ins plus the host's `essentialTools`.
|
|
190
|
+
* Unconditional — no property of a workspace or a spec adds to it, and `task`
|
|
191
|
+
* is in it under no circumstances (see {@link UNGRANTABLE_TOOLS}).
|
|
192
|
+
*/
|
|
193
|
+
private essentialTools;
|
|
194
|
+
/**
|
|
195
|
+
* Every denial entry that applies in `state`: the workflow's `forbid_always`
|
|
196
|
+
* followed by the state's own `forbid`. Order is presentational only — both
|
|
197
|
+
* block, and a denial is evaluated ahead of every grant.
|
|
198
|
+
*/
|
|
199
|
+
forbidEntries(state: string): ForbidEntry[];
|
|
200
|
+
/**
|
|
201
|
+
* The entries that govern `state`, in precedence order — the one derivation
|
|
202
|
+
* enforcement and disclosure both read. A tool is decided by exactly one tier:
|
|
203
|
+
* the state's own entries when they name it (the narrower constraint, even for
|
|
204
|
+
* an essential tool); else the essential grant; else `allow_always`. An
|
|
205
|
+
* `allow_always` entry for a tool the state mentions or that is essential is
|
|
206
|
+
* therefore inert.
|
|
207
|
+
*/
|
|
208
|
+
private effectiveEntries;
|
|
209
|
+
/**
|
|
210
|
+
* Whether a tool call is statically permitted in `state`. Closed by default:
|
|
211
|
+
* the always-allowed controls pass; otherwise some effective entry must name
|
|
212
|
+
* the tool and match its arguments.
|
|
213
|
+
*/
|
|
214
|
+
checkAllowed(state: string, tool: string, args: Record<string, unknown>, ctx?: GuardContext): boolean;
|
|
215
|
+
/**
|
|
216
|
+
* The tool names disclosed to the model while `state` is active: every tool
|
|
217
|
+
* an effective entry names plus the controls (`archmax_advance` omitted for a
|
|
218
|
+
* terminal state, where every call to it would be rejected), minus the tools
|
|
219
|
+
* denied here by name. Name-level only — argument enforcement stays with the
|
|
220
|
+
* kernel at call time.
|
|
221
|
+
*/
|
|
222
|
+
disclosedTools(state: string): Set<string>;
|
|
223
|
+
private renderEntry;
|
|
224
|
+
/**
|
|
225
|
+
* Model-facing description of what `checkAllowed` enforces in a state: the
|
|
226
|
+
* effective entries in precedence order, minus any tool denied here by name,
|
|
227
|
+
* then the always-allowed controls the state discloses. A denial that leaves
|
|
228
|
+
* the tool usable for other arguments (a guarded entry) leaves it listed —
|
|
229
|
+
* the same line disclosure draws — so the model's picture matches enforcement
|
|
230
|
+
* either way.
|
|
231
|
+
*/
|
|
232
|
+
describeAllowed(state: string): string;
|
|
233
|
+
/**
|
|
234
|
+
* Model-facing lines describing the argument constraints that bind in a
|
|
235
|
+
* state, rendered through the same resolver the kernel enforces with so an
|
|
236
|
+
* unresolved reference is shown as unresolved-and-named rather than as a
|
|
237
|
+
* placeholder the model might pass literally. Empty when none bind.
|
|
238
|
+
*/
|
|
239
|
+
describeArgConstraints(state: string, variables?: VariableStore): string[];
|
|
240
|
+
/**
|
|
241
|
+
* Every trigger the spec declares, read from the states that declare them —
|
|
242
|
+
* computed once per machine.
|
|
243
|
+
*/
|
|
244
|
+
triggerBindings(): Map<string, TriggerBinding>;
|
|
245
|
+
/** The declared start states as `{ trigger, state }` pairs, in declaration order. */
|
|
246
|
+
startStates(): {
|
|
247
|
+
trigger: string;
|
|
248
|
+
state: string;
|
|
249
|
+
}[];
|
|
250
|
+
/**
|
|
251
|
+
* The state a trigger enters, or `undefined` for an id no state declares.
|
|
252
|
+
* `manual` is the one entry for every ingress — the CLI, an SDK invocation
|
|
253
|
+
* naming no trigger, a host firing that names it, and a delegation.
|
|
254
|
+
*/
|
|
255
|
+
startStateForTrigger(id: string): string | undefined;
|
|
256
|
+
/** The session path declared for a trigger, if it declares one. */
|
|
257
|
+
sessionPathForTrigger(id: string): SessionPath | undefined;
|
|
258
|
+
/**
|
|
259
|
+
* The host-resolved `message:` declaration for a trigger: the parsed path,
|
|
260
|
+
* `false` for "firings carry no message", or `undefined` when undeclared.
|
|
261
|
+
*/
|
|
262
|
+
messagePathForTrigger(id: string): SessionPath | false | undefined;
|
|
263
|
+
/** The host-resolved `connection:` slug declared for a trigger, if any. */
|
|
264
|
+
connectionForTrigger(id: string): string | undefined;
|
|
265
|
+
/** The run variables a firing of this trigger must supply, if declared. */
|
|
266
|
+
requiresForTrigger(id: string): string[] | undefined;
|
|
267
|
+
/**
|
|
268
|
+
* The run variables a run started through this trigger guarantees are set when
|
|
269
|
+
* it completes, if declared — the only variables that cross a sub-run boundary
|
|
270
|
+
* upward.
|
|
271
|
+
*/
|
|
272
|
+
returnsForTrigger(id: string): string[] | undefined;
|
|
273
|
+
}
|