@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,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The no-workflow composition: a plain, skills-driven Deep Agent over the same
|
|
3
|
+
* workspace, with no machine, no control tools and no per-state gating.
|
|
4
|
+
*/
|
|
5
|
+
import { createDeepAgent } from "deepagents";
|
|
6
|
+
import { asCompiledAgentGraph } from "../core/deepagents.js";
|
|
7
|
+
import { TOOL_MOCK_MIDDLEWARE_NAME } from "../core/tool-mocks.js";
|
|
8
|
+
import { frameworkPassthrough, rubricParams, todoMiddleware } from "./compose.js";
|
|
9
|
+
/**
|
|
10
|
+
* A skill source as upstream's middleware wants it: a leading-slash,
|
|
11
|
+
* trailing-slash POSIX path. The assembly's own sources are workspace-relative
|
|
12
|
+
* (`skills/`); only the plain composition hands them to upstream, so the
|
|
13
|
+
* conversion lives at that one boundary.
|
|
14
|
+
*/
|
|
15
|
+
function asSkillSource(source) {
|
|
16
|
+
return `/${source.replace(/^\/+/, "").replace(/\/+$/, "")}/`;
|
|
17
|
+
}
|
|
18
|
+
/** Compose the plain agent: its graph, and whether the host's tool-mock middleware is among its middleware. */
|
|
19
|
+
export function composePlain(ctx, systemPrompt) {
|
|
20
|
+
// The host's middleware rides after the runtime's own, as on the governed path.
|
|
21
|
+
const middleware = [todoMiddleware(), ...(ctx.params.middleware ?? [])];
|
|
22
|
+
const deepAgent = createDeepAgent({
|
|
23
|
+
model: ctx.model,
|
|
24
|
+
backend: ctx.backend,
|
|
25
|
+
// No machine, so there are no states to vary disclosure by: upstream's
|
|
26
|
+
// skills middleware discloses every skill of the declared sources, which is
|
|
27
|
+
// exactly right here and exactly wrong under a workflow.
|
|
28
|
+
skills: ctx.skillSources.map(asSkillSource),
|
|
29
|
+
tools: ctx.params.tools ?? [],
|
|
30
|
+
...rubricParams(ctx),
|
|
31
|
+
middleware,
|
|
32
|
+
systemPrompt: { prefix: systemPrompt, base: null },
|
|
33
|
+
checkpointer: ctx.checkpointer,
|
|
34
|
+
...frameworkPassthrough(ctx.params),
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
graph: asCompiledAgentGraph(deepAgent.graph),
|
|
38
|
+
toolMocks: middleware.some((m) => m.name === TOOL_MOCK_MIDDLEWARE_NAME),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=plain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plain.js","sourceRoot":"","sources":["../../src/assembly/plain.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAA2B,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,cAAc,EAAwB,MAAM,cAAc,CAAC;AAExG;;;;;GAKG;AACH,SAAS,aAAa,CAAC,MAAc;IACnC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC;AAC/D,CAAC;AAED,+GAA+G;AAC/G,MAAM,UAAU,YAAY,CAC1B,GAAoB,EACpB,YAAoB;IAEpB,gFAAgF;IAChF,MAAM,UAAU,GAAG,CAAC,cAAc,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,eAAe,CAAC;QAChC,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,uEAAuE;QACvE,4EAA4E;QAC5E,yDAAyD;QACzD,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC;QAC3C,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE;QAC7B,GAAG,YAAY,CAAC,GAAG,CAAC;QACpB,UAAU;QACV,YAAY,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE;QAClD,YAAY,EAAE,GAAG,CAAC,YAAY;QAC9B,GAAG,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC;KACpC,CAAC,CAAC;IACH,OAAO;QACL,KAAK,EAAE,oBAAoB,CAAC,SAAS,CAAC,KAAK,CAAC;QAC5C,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,yBAAyB,CAAC;KACxE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# @archmax-ai/harness skill
|
|
2
|
+
|
|
3
|
+
An [Agent Skill](https://skills.sh) that teaches a coding agent (Claude Code,
|
|
4
|
+
Cursor, Codex, …) how to **build with** the
|
|
5
|
+
[`@archmax-ai/harness`](https://www.npmjs.com/package/@archmax-ai/harness) runtime:
|
|
6
|
+
|
|
7
|
+
1. **Author a workflow** — a `workflow.yaml` state machine plus its skills,
|
|
8
|
+
grading rubrics, scripts, lifecycle hooks, tool governance, and cases.
|
|
9
|
+
2. **Wire the runtime into a backend** — assemble an agent with
|
|
10
|
+
`createAgent`, run a workflow, resume human-in-the-loop states, and
|
|
11
|
+
stream lifecycle events / run artifacts so a frontend can visualize run state.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
**From the installed `@archmax-ai/harness` package (primary for runtime consumers)** —
|
|
16
|
+
the skill ships inside the npm package, so it always matches the installed SDK
|
|
17
|
+
version instead of a synced copy:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { BUNDLED_AUTHORING_SKILL_DIR } from "@archmax-ai/harness";
|
|
21
|
+
// <BUNDLED_AUTHORING_SKILL_DIR>/archmax-harness/SKILL.md (+ references/) — the constant
|
|
22
|
+
// is the dist/authoring-skill directory holding archmax-harness/. Point an install CLI at
|
|
23
|
+
// the skill itself:
|
|
24
|
+
// npx skills add ./node_modules/@archmax-ai/harness/dist/authoring-skill/archmax-harness
|
|
25
|
+
// (`BUNDLED_SKILLS_DIR` is a deprecated alias with the same value, kept one
|
|
26
|
+
// release.)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Via the skills CLI from a checkout (coding-agent / development use)**:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx skills add <owner>/<repo> # once this repo is public, from its root
|
|
33
|
+
# or point at the subfolder directly:
|
|
34
|
+
npx skills add ./skills/archmax-harness
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Replace `<owner>/<repo>` with this repository's GitHub slug. Skills appear on
|
|
38
|
+
skills.sh automatically via install telemetry — there is no separate submission
|
|
39
|
+
step.
|
|
40
|
+
|
|
41
|
+
## What's inside
|
|
42
|
+
|
|
43
|
+
| File | Purpose |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| `SKILL.md` | The entry point, loaded when the skill triggers: procedure, workspace layout, CLI, and a table saying which short reference to load for which task |
|
|
46
|
+
| `references/workflow-yaml.md` | Short: every `workflow.yaml` key as an annotated skeleton, machine rules, governance |
|
|
47
|
+
| `references/hooks-and-scripts.md` | Short: the hook-script and `archmax_run` contracts |
|
|
48
|
+
| `references/cases.md` | Short: the case grammar (keys, actions, assertions, mocking rule) |
|
|
49
|
+
| `references/diagnostics.md` | Short: every `validate` diagnostic → its fix; removed keys |
|
|
50
|
+
| `references/wiring.md` | Short: `createAgent`, human states, events, artifacts |
|
|
51
|
+
| `references/workflow-schema.md` | Exhaustive `workflow.yaml` field reference + annotated example |
|
|
52
|
+
| `references/hook-and-test-scripts.md` | Full lifecycle hook-script + cases contracts with worked code examples |
|
|
53
|
+
| `references/backend-integration.md` | Full `createAgent` / events / run-artifact integration reference |
|
|
54
|
+
|
|
55
|
+
The skill is **self-contained** — no external docs are required to use it. It
|
|
56
|
+
targets **runtime contract version `"2"`**.
|
|
57
|
+
|
|
58
|
+
## Naming note
|
|
59
|
+
|
|
60
|
+
This **authoring skill** is distinct from a workspace's **skill bundles** —
|
|
61
|
+
`skills/<slug>/` directories holding a `SKILL.md`, the capability's `assets/`
|
|
62
|
+
and its `archmax_run` `scripts/`, enabled per workflow and per state by slug.
|
|
63
|
+
They share the Agent Skills file format and nothing else: this skill is a
|
|
64
|
+
playbook for *building* such workspaces and wiring the runtime, which is why
|
|
65
|
+
it ships under `dist/authoring-skill/` rather than beside any workspace's
|
|
66
|
+
`skills/`.
|
|
67
|
+
|
|
68
|
+
## Safety
|
|
69
|
+
|
|
70
|
+
Instruction-only: this skill bundles **no executable scripts**. It directs the
|
|
71
|
+
agent to run the runtime's own `archmax validate` / `archmax test` CLI commands to
|
|
72
|
+
verify authored workflows.
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT (same as the `@archmax-ai/harness` package).
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: archmax-harness
|
|
3
|
+
description: >-
|
|
4
|
+
Build with the @archmax-ai/harness runtime for LangChain Deep Agents. Use this
|
|
5
|
+
whenever you are designing, editing or fixing a workflow state machine (a
|
|
6
|
+
workflow.yaml with states, transitions, lifecycle hooks, tool and skill
|
|
7
|
+
governance, grading rubrics, scripts, cases, or skill bundles), OR wiring the
|
|
8
|
+
@archmax-ai/harness npm package into a backend service — assembling an agent with
|
|
9
|
+
createAgent, running a workflow, resuming human-in-the-loop states, or
|
|
10
|
+
streaming lifecycle events / session artifacts so a frontend can visualize a
|
|
11
|
+
run. Trigger this skill for phrases like "design a workflow", "author a
|
|
12
|
+
workflow.yaml", "add a state/transition/hook", "archmax validate fails", "run
|
|
13
|
+
an agent workflow from my worker", or "integrate @archmax-ai/harness" even when the
|
|
14
|
+
runtime is not named explicitly.
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Building with @archmax-ai/harness
|
|
18
|
+
|
|
19
|
+
The archmax harness is a thin, governed runtime over
|
|
20
|
+
[LangChain Deep Agents](https://docs.langchain.com/oss/javascript/deepagents/overview):
|
|
21
|
+
one Deep Agent per workflow, moved by a declarative state machine
|
|
22
|
+
(`workflow.yaml`). It holds no use-case logic — a **workspace** supplies it.
|
|
23
|
+
Runtime contract: `runtime: { engine: archmax-harness, version: "2" }` in every spec.
|
|
24
|
+
|
|
25
|
+
**Read by task, not by curiosity.** This file holds the procedure, the
|
|
26
|
+
workspace layout and the commands. Load exactly the short reference your next
|
|
27
|
+
file needs, once, and nothing else:
|
|
28
|
+
|
|
29
|
+
| You are about to… | Load |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| write or edit `workflow.yaml` | [`references/workflow-yaml.md`](references/workflow-yaml.md) — every key, machine rules, governance |
|
|
32
|
+
| write a script — a skill's `scripts/*.js` (`archmax_run`) or a `hooks/*.js` gate | [`references/hooks-and-scripts.md`](references/hooks-and-scripts.md); sequence the skill case with the *Script playbook* below |
|
|
33
|
+
| write or fix a case (`tests/*.test.yaml`) | [`references/cases.md`](references/cases.md) |
|
|
34
|
+
| fix what `archmax validate` / `archmax test` reported | [`references/diagnostics.md`](references/diagnostics.md) |
|
|
35
|
+
| embed the package in a service | [`references/wiring.md`](references/wiring.md) |
|
|
36
|
+
|
|
37
|
+
The long references — `workflow-schema.md`, `hook-and-test-scripts.md`,
|
|
38
|
+
`backend-integration.md` — are exhaustive; open a **section** of one only when
|
|
39
|
+
the short reference says so or a field's exact semantics are in doubt. Do
|
|
40
|
+
**not** read the SDK source, do not `ls`/`glob` a workspace to discover its
|
|
41
|
+
layout (it is fixed, below), and do not re-read a file already in context.
|
|
42
|
+
Naming note: this authoring skill is not a workspace's `skills/<slug>/` bundle;
|
|
43
|
+
they share a file format and nothing else.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Authoring
|
|
48
|
+
|
|
49
|
+
### Procedure
|
|
50
|
+
|
|
51
|
+
**Build a workflow.** Design the whole file set first, write each file once,
|
|
52
|
+
then verify. Do not write a file, validate, and discover the next file.
|
|
53
|
+
|
|
54
|
+
1. **Sketch the graph**: states (kebab-case slugs), the start state carrying
|
|
55
|
+
`triggers: { manual: }` (plus any host trigger ids that enter there),
|
|
56
|
+
terminal states (no `transitions`), the edges between them — and for each
|
|
57
|
+
edge, the *condition* under which it is taken. That condition is the edge's
|
|
58
|
+
required `description`, and it is the only thing the agent will know about
|
|
59
|
+
where the edge leads.
|
|
60
|
+
2. **Decide the file set** from the sketch: `workflow.yaml` always; one
|
|
61
|
+
`hooks/<check>.js` per *deterministic* gate; one inline `rubric:` per
|
|
62
|
+
*judgment* gate (tone, completeness); cases — one happy path per branch,
|
|
63
|
+
one per hook veto path, one `decide:` per human state; a
|
|
64
|
+
`skills/<capability>/` bundle only for data, an `archmax_run` script, or
|
|
65
|
+
guidance two or more states share identically; `AGENTS.md` only for a
|
|
66
|
+
workspace-wide persona.
|
|
67
|
+
3. **Write `workflow.yaml`** from the skeleton in [`references/workflow-yaml.md`](references/workflow-yaml.md). Each state's behaviour
|
|
68
|
+
goes inline in its `instructions`; run-wide rules once in the top-level
|
|
69
|
+
`instructions`; nothing about the machine itself (the platform prompt and
|
|
70
|
+
the disclosed edges already say it, and prose is billed on every call), and
|
|
71
|
+
nothing about the date: every model call opens with the current date and time
|
|
72
|
+
in UTC (rounded down to ten minutes, with the host's zone named), so date
|
|
73
|
+
arithmetic ("due in 30 days") needs no authored `today`.
|
|
74
|
+
Never describe another state in a state's `instructions` or in an edge's
|
|
75
|
+
`description`: the agent is shown the active state's edges and nothing else
|
|
76
|
+
of the graph, so a routing condition parked in the *target's* `summary` or
|
|
77
|
+
`instructions` is invisible to the state that has to route on it. Name
|
|
78
|
+
a model (`settings.model`, or `model:` on one state) only where the work
|
|
79
|
+
differs in kind — a small model on mechanical states, the default on
|
|
80
|
+
drafting, judgement and heavy-routing ones.
|
|
81
|
+
4. **Write hooks, rubrics, cases** — description first (a hook's JSDoc, a
|
|
82
|
+
case's `title` + `description`), then the body, and never leave the two
|
|
83
|
+
disagreeing. Before writing a case, settle what to mock ([`references/cases.md`](references/cases.md)).
|
|
84
|
+
5. **Verify**: `archmax validate <slug>` → fix every error (and every warning
|
|
85
|
+
you can) → `archmax test <slug>`. Never call a workflow done without a clean
|
|
86
|
+
`validate`.
|
|
87
|
+
|
|
88
|
+
**Fix a workflow.** Diagnose from the tool, not by reading everything.
|
|
89
|
+
|
|
90
|
+
1. Run `archmax validate <slug>` (offline, instant). Every diagnostic names
|
|
91
|
+
the file, the field path and the fix; map it with the
|
|
92
|
+
[`references/diagnostics.md`](references/diagnostics.md).
|
|
93
|
+
2. Read **only** the files the diagnostics name. Edit once. Re-validate.
|
|
94
|
+
3. When clean, `archmax test <slug> [filter]`. Read the failing case's verdict
|
|
95
|
+
line: a **structural** miss (`reachedState`, `parked`, `succeeded`,
|
|
96
|
+
`trail`) is a routing or governance defect — fix the routing state's
|
|
97
|
+
`instructions`, the transition `description`s, or the `tools`/`skills`
|
|
98
|
+
grants; a **content** miss (`reply`, `calledTool`, `grade`) is an
|
|
99
|
+
`instructions` defect in the state that answered; a veto reason quoted in
|
|
100
|
+
the reply is the hook or rubric speaking — fix what it names. Change the
|
|
101
|
+
case only when it asserts something the spec never promised.
|
|
102
|
+
4. A `grade` miss is the one non-deterministic assertion: re-run that case
|
|
103
|
+
once before calling it a regression. Re-run with `--verbose` for raw
|
|
104
|
+
events only when the verdict line is not enough.
|
|
105
|
+
|
|
106
|
+
Budget: one validate, one edit pass, one validate, one test. If you are on
|
|
107
|
+
your fourth read of a file, you are guessing — reread the relevant reference
|
|
108
|
+
instead.
|
|
109
|
+
|
|
110
|
+
**Shapes come from tools, not from research.** Before naming any field of a
|
|
111
|
+
tool's result or a trigger's payload — in `instructions`, a `${{…}}` guard, a
|
|
112
|
+
hook — ask the host: a platform embedding this runtime typically exposes
|
|
113
|
+
describe-style tools (a tool's input and output schema, a trigger's payload
|
|
114
|
+
schema and sample) and a way to sample or invoke once with a narrow input. Call
|
|
115
|
+
those first; fall back to a recorded session's variables (`archmax sessions <id>`)
|
|
116
|
+
only when no such tool exists. Reading more files never reveals what a live
|
|
117
|
+
system returns.
|
|
118
|
+
|
|
119
|
+
### Script playbook (a skill's `scripts/<x>.js`)
|
|
120
|
+
|
|
121
|
+
Deterministic work the model triggers with `archmax_run`. In order:
|
|
122
|
+
|
|
123
|
+
1. **Shapes first.** Trigger payload and tool I/O from the host's describe/sample
|
|
124
|
+
tools; the variables a run actually carries from `archmax sessions <id>`.
|
|
125
|
+
Guessing a field name here costs a whole run (above).
|
|
126
|
+
2. **Write it.** `skills/<cap>/scripts/<x>.js`: JSDoc, then the body. Input is the
|
|
127
|
+
global `args` — `args.<param>` from the model plus `args.variables`, a read-only
|
|
128
|
+
snapshot — and the **last expression** is the result. Contract:
|
|
129
|
+
[`references/hooks-and-scripts.md`](references/hooks-and-scripts.md).
|
|
130
|
+
3. **Land the result in a variable.** Return structured data, and name the variable
|
|
131
|
+
in the calling state's `requires:`. A script may not call
|
|
132
|
+
`archmax_set_variables`, so `requires` is what makes the model record the return;
|
|
133
|
+
unrecorded, the result lives in one tool message and is gone.
|
|
134
|
+
4. **Announce it in the skill.** The `SKILL.md` `description` says *when* to run it;
|
|
135
|
+
the body says the script's path, its arguments, and the variable its result
|
|
136
|
+
lands in. A script nothing points at is never reached.
|
|
137
|
+
5. **Grant it.** The calling state allows `{ tool: archmax_run, paths:
|
|
138
|
+
["skills/<cap>/scripts/**"] }` plus every tool the script itself calls. Then
|
|
139
|
+
`archmax validate`.
|
|
140
|
+
|
|
141
|
+
### Reference a variable, never retype it
|
|
142
|
+
|
|
143
|
+
`${{name}}` / `${{a.b.-1.c}}` resolves against the run's variables in a
|
|
144
|
+
`tools.allow` glob **and inside any text argument the model writes** — mid-string,
|
|
145
|
+
repeatable, matched literally. The transcript keeps the reference and only the tool
|
|
146
|
+
sees the value, so a stored value costs its tokens once instead of on every later
|
|
147
|
+
model call. Step 3 is what puts a value there to reference.
|
|
148
|
+
|
|
149
|
+
A state that must emit something already stored is told to interpolate it:
|
|
150
|
+
|
|
151
|
+
```yaml
|
|
152
|
+
instructions: >-
|
|
153
|
+
Send the reply with gmail__send. Quote the customer's message by writing
|
|
154
|
+
${{inbound.text}} in the body rather than retyping it.
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Exact — a retyped copy truncates and drifts, a reference cannot — and it agrees by
|
|
158
|
+
construction with a guard on the same variable. Not available in scripts, which
|
|
159
|
+
read `args.variables`. To write the characters literally: `$${{name}}`.
|
|
160
|
+
|
|
161
|
+
### Workspace layout (complete — nothing else exists)
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
<workspace root>/
|
|
165
|
+
AGENTS.md # optional persona; prompt layer 1
|
|
166
|
+
workflows/<slug>/ # AUTHORING PLANE — runtime reads it, the agent CANNOT
|
|
167
|
+
workflow.yaml # the machine (required, canonical)
|
|
168
|
+
WORKFLOW.md # optional plain-markdown addendum, NO frontmatter
|
|
169
|
+
hooks/<check>.js # lifecycle hook scripts, run by the runtime
|
|
170
|
+
tests/<case>.test.yaml # one case per file; fixtures beside them (`from:`)
|
|
171
|
+
skills/<capability>/ # AGENT PLANE — mounted read-only, enabled per state by slug
|
|
172
|
+
SKILL.md # frontmatter (name = directory slug, description) + body
|
|
173
|
+
scripts/<script>.js # archmax_run sources, run by the agent
|
|
174
|
+
assets/<file> # read-only inputs
|
|
175
|
+
references/<topic>.md # optional deeper material
|
|
176
|
+
.env # ARCHMAX_* model config (never mounted)
|
|
177
|
+
sessions/<sessionId>/ # the run; the agent's workspace ROOT (never authored)
|
|
178
|
+
scratchpad/ # agent-visible `scratchpad/…`: the session's always-writable
|
|
179
|
+
# area (a host-wired writable mount is another place to write)
|
|
180
|
+
large_tool_results/ conversation_history/ # runtime offload, agent reads only
|
|
181
|
+
checkpoints/ artifacts/ # runtime-internal
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Rules that follow:
|
|
185
|
+
|
|
186
|
+
- **The agent cannot read `workflows/**`** — its spec, hooks, rubrics and
|
|
187
|
+
cases have no route in its workspace. Never point `instructions`,
|
|
188
|
+
`evidence` or a case `workspace:` at one (`validate` errors). Text the agent
|
|
189
|
+
needs goes in a skill bundle.
|
|
190
|
+
- **Placement**: a hook is the guard, a runtime script is the tool; they
|
|
191
|
+
never share a file or a directory.
|
|
192
|
+
|
|
193
|
+
| Script | Runs on | Lives at | Wired as |
|
|
194
|
+
| --- | --- | --- | --- |
|
|
195
|
+
| Hook | runtime authority, at `before`/`after` | `workflows/<slug>/hooks/<x>.js` | `before: { script: hooks/<x>.js }` (workflow-relative, confined to `hooks/`) |
|
|
196
|
+
| Runtime script | the model's authority, via `archmax_run` | `skills/<cap>/scripts/<x>.js` | enabling the skill; narrow with `{ tool: archmax_run, paths: ["skills/<cap>/scripts/**"] }` |
|
|
197
|
+
|
|
198
|
+
`archmax_run` is confined to skill bundles by a non-overridable rule
|
|
199
|
+
(`script.skill-only`): a script in `scratchpad/` or `hooks/` is unrunnable.
|
|
200
|
+
- **Paths have no leading slash** (`skills/order-data/assets/orders.json`,
|
|
201
|
+
`scratchpad/refund.json`); never author a `run/` prefix. `scratchpad/` is
|
|
202
|
+
writable in every state regardless of `tools.allow`, so an allow entry
|
|
203
|
+
inside it narrows nothing (warning); to govern *where* a result lands, name
|
|
204
|
+
a non-reserved run path (`reports/*.json`) and allow it.
|
|
205
|
+
- **Guidance has three homes, one per rule**: every workflow → `AGENTS.md`;
|
|
206
|
+
the whole run → top-level `instructions` (`|-` literal block, since `>-`
|
|
207
|
+
folds paragraphs together); one state's turn → that state's `instructions`
|
|
208
|
+
(`>-` is fine). Pasting a paragraph into a second state means hoist it.
|
|
209
|
+
Never one `skills/<state>/` per state.
|
|
210
|
+
- **Every `.js` you author opens with a JSDoc block**: title line, blank
|
|
211
|
+
line, then what it reads, the sequence of checks, and the condition for each
|
|
212
|
+
verdict (hook) or what it computes and returns (script). Admin UIs show this
|
|
213
|
+
instead of the code. No `@specification` tag, no sidecar key.
|
|
214
|
+
|
|
215
|
+
### Verify (CLI)
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
archmax validate [workflow] [--json] # offline; run after every structural edit
|
|
219
|
+
archmax test [workflow] [filter] [--json] # cases; filter = case-id substring
|
|
220
|
+
archmax run <workflow> "<prompt>" [--session <id>] [--trigger <id>] [--variables '<json>']
|
|
221
|
+
archmax sessions [session] [--json] # list, or one session's variables (value + locked)
|
|
222
|
+
archmax decide <session> --to <state> [--comment "…"] # resume a human state
|
|
223
|
+
archmax reply <session> "<message>" # message a parked run; it stays parked
|
|
224
|
+
archmax deliver <session> --trigger <id> [--variables '<json>'] # resume an archmax_wait
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
`<workflow>` may be omitted when the workspace has one. Global `--root <dir>`
|
|
228
|
+
(cwd default; `.env` loads from it), `--verbose` for raw events. Results on
|
|
229
|
+
stdout, narration on stderr. Exit 0 done/parked, 1 failure, 2 usage. Dev from
|
|
230
|
+
the SDK checkout: `npm run dev -- <command…>`.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Done when
|
|
238
|
+
|
|
239
|
+
- Authoring: `archmax validate` clean, `archmax test` passing, every `.js`
|
|
240
|
+
opens with its JSDoc, every case has `title` + `description`.
|
|
241
|
+
- Wiring: the snippet compiles against the installed package's exports.
|