@aionis/manifest 0.1.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/CHANGELOG.md +26 -0
- package/LICENSE +178 -0
- package/README.md +170 -0
- package/dist/ast/types.d.ts +34 -0
- package/dist/ast/types.js +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +122 -0
- package/dist/compile.d.ts +14 -0
- package/dist/compile.js +219 -0
- package/dist/contracts.d.ts +12610 -0
- package/dist/contracts.js +401 -0
- package/dist/diagnostics/types.d.ts +17 -0
- package/dist/diagnostics/types.js +1 -0
- package/dist/execute/localRuntime.d.ts +5 -0
- package/dist/execute/localRuntime.js +165 -0
- package/dist/execute/moduleRuntime.d.ts +25 -0
- package/dist/execute/moduleRuntime.js +352 -0
- package/dist/execute/types.d.ts +113 -0
- package/dist/execute/types.js +1 -0
- package/dist/execute-cli.d.ts +2 -0
- package/dist/execute-cli.js +112 -0
- package/dist/execute.d.ts +6 -0
- package/dist/execute.js +46 -0
- package/dist/graph/buildExecutionGraph.d.ts +8 -0
- package/dist/graph/buildExecutionGraph.js +69 -0
- package/dist/graph/types.d.ts +24 -0
- package/dist/graph/types.js +1 -0
- package/dist/handoff-store-cli.d.ts +2 -0
- package/dist/handoff-store-cli.js +139 -0
- package/dist/handoff-store.d.ts +103 -0
- package/dist/handoff-store.js +78 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +21 -0
- package/dist/ir/types.d.ts +92 -0
- package/dist/ir/types.js +1 -0
- package/dist/parser/parseAst.d.ts +3 -0
- package/dist/parser/parseAst.js +207 -0
- package/dist/parser/payload.d.ts +6 -0
- package/dist/parser/payload.js +211 -0
- package/dist/plan/buildExecutionPlan.d.ts +9 -0
- package/dist/plan/buildExecutionPlan.js +98 -0
- package/dist/plan/types.d.ts +44 -0
- package/dist/plan/types.js +1 -0
- package/dist/publish-cli.d.ts +2 -0
- package/dist/publish-cli.js +249 -0
- package/dist/publish.d.ts +148 -0
- package/dist/publish.js +190 -0
- package/dist/recover-cli.d.ts +2 -0
- package/dist/recover-cli.js +258 -0
- package/dist/recover.d.ts +489 -0
- package/dist/recover.js +290 -0
- package/dist/refs/resolveRefs.d.ts +13 -0
- package/dist/refs/resolveRefs.js +104 -0
- package/dist/registry/loadModuleRegistry.d.ts +28 -0
- package/dist/registry/loadModuleRegistry.js +97 -0
- package/dist/registry/types.d.ts +20 -0
- package/dist/registry/types.js +2 -0
- package/dist/resume-cli.d.ts +2 -0
- package/dist/resume-cli.js +379 -0
- package/dist/resume.d.ts +2076 -0
- package/dist/resume.js +452 -0
- package/dist/run-cli.d.ts +2 -0
- package/dist/run-cli.js +119 -0
- package/dist/run.d.ts +9 -0
- package/dist/run.js +43 -0
- package/dist/runtime-handoff-cli.d.ts +2 -0
- package/dist/runtime-handoff-cli.js +179 -0
- package/dist/runtime-handoff.d.ts +914 -0
- package/dist/runtime-handoff.js +383 -0
- package/dist/scanner/scanSource.d.ts +9 -0
- package/dist/scanner/scanSource.js +43 -0
- package/dist/schema/validateIrSchemas.d.ts +3 -0
- package/dist/schema/validateIrSchemas.js +64 -0
- package/dist/validate-module-cli.d.ts +2 -0
- package/dist/validate-module-cli.js +93 -0
- package/dist/validate-registry-cli.d.ts +2 -0
- package/dist/validate-registry-cli.js +82 -0
- package/dist/validate.d.ts +52 -0
- package/dist/validate.js +91 -0
- package/fixtures/duplicate-doc.aionis.md +19 -0
- package/fixtures/fenced-example.aionis.md +27 -0
- package/fixtures/malformed-payload.aionis.md +9 -0
- package/fixtures/npm-installed-module-registry.json +17 -0
- package/fixtures/standalone-module-registry.json +13 -0
- package/fixtures/standalone-runner-plan.json +51 -0
- package/fixtures/standalone-runner.aionis.md +29 -0
- package/fixtures/unresolved-ref.aionis.md +14 -0
- package/fixtures/valid-minimal.aionis.md +24 -0
- package/fixtures/valid-workflow.aionis.md +29 -0
- package/official-modules/copy-summary/CHANGELOG.md +6 -0
- package/official-modules/copy-summary/README.md +43 -0
- package/official-modules/copy-summary/index.mjs +41 -0
- package/official-modules/copy-summary/package.json +31 -0
- package/official-modules/json-transform/CHANGELOG.md +6 -0
- package/official-modules/json-transform/README.md +51 -0
- package/official-modules/json-transform/index.mjs +53 -0
- package/official-modules/json-transform/package.json +31 -0
- package/official-modules/research-claims/CHANGELOG.md +6 -0
- package/official-modules/research-claims/README.md +47 -0
- package/official-modules/research-claims/index.mjs +44 -0
- package/official-modules/research-claims/package.json +31 -0
- package/package.json +74 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export function buildExecutionGraph(ir) {
|
|
2
|
+
if (!ir.doc) {
|
|
3
|
+
return { value: null, diagnostics: [] };
|
|
4
|
+
}
|
|
5
|
+
const diagnostics = [];
|
|
6
|
+
const nodes = [];
|
|
7
|
+
const edges = [];
|
|
8
|
+
const nodeByOutputRef = new Map();
|
|
9
|
+
const nodeById = new Map();
|
|
10
|
+
ir.executions.forEach((execution, index) => {
|
|
11
|
+
const id = `exec_${index + 1}`;
|
|
12
|
+
const node = {
|
|
13
|
+
id,
|
|
14
|
+
type: "execute_node",
|
|
15
|
+
label: execution.module ?? execution.tool ?? execution.agent ?? `execute_${index + 1}`,
|
|
16
|
+
module: execution.module,
|
|
17
|
+
input_ref: execution.input_ref,
|
|
18
|
+
output_ref: execution.output_ref,
|
|
19
|
+
payload: execution.data,
|
|
20
|
+
loc: execution.loc,
|
|
21
|
+
};
|
|
22
|
+
nodes.push(node);
|
|
23
|
+
nodeById.set(id, id);
|
|
24
|
+
if (execution.output_ref) {
|
|
25
|
+
nodeByOutputRef.set(execution.output_ref, id);
|
|
26
|
+
}
|
|
27
|
+
if (execution.input_ref) {
|
|
28
|
+
const upstream = nodeByOutputRef.get(execution.input_ref);
|
|
29
|
+
if (upstream) {
|
|
30
|
+
edges.push({
|
|
31
|
+
from: upstream,
|
|
32
|
+
to: id,
|
|
33
|
+
type: "data_dependency",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
for (const dependency of execution.depends_on ?? []) {
|
|
38
|
+
const upstream = nodeByOutputRef.get(dependency) ?? nodeById.get(dependency);
|
|
39
|
+
if (upstream) {
|
|
40
|
+
edges.push({
|
|
41
|
+
from: upstream,
|
|
42
|
+
to: id,
|
|
43
|
+
type: "sequence_dependency",
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
diagnostics.push({
|
|
48
|
+
severity: "warning",
|
|
49
|
+
code: "UNKNOWN_DEPENDENCY",
|
|
50
|
+
message: `Dependency '${dependency}' does not match a previous node or output ref.`,
|
|
51
|
+
loc: execution.loc ?? ir.doc?.loc ?? {
|
|
52
|
+
start: { line: 1, column: 1, offset: 0 },
|
|
53
|
+
end: { line: 1, column: 1, offset: 0 },
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return {
|
|
60
|
+
value: {
|
|
61
|
+
graph_id: `graph:${ir.doc.id}`,
|
|
62
|
+
doc_id: ir.doc.id,
|
|
63
|
+
nodes,
|
|
64
|
+
edges,
|
|
65
|
+
diagnostics,
|
|
66
|
+
},
|
|
67
|
+
diagnostics,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Diagnostic, SourceRange } from "../diagnostics/types.js";
|
|
2
|
+
import type { AionisObject } from "../ir/types.js";
|
|
3
|
+
export interface ExecutionGraph {
|
|
4
|
+
graph_id: string;
|
|
5
|
+
doc_id: string;
|
|
6
|
+
nodes: ExecutionNode[];
|
|
7
|
+
edges: ExecutionEdge[];
|
|
8
|
+
diagnostics?: Diagnostic[];
|
|
9
|
+
}
|
|
10
|
+
export interface ExecutionNode {
|
|
11
|
+
id: string;
|
|
12
|
+
type: "context_node" | "execute_node" | "decision_node" | "evidence_node" | "output_node" | "memory_write_node" | "replay_node";
|
|
13
|
+
label?: string;
|
|
14
|
+
module?: string;
|
|
15
|
+
input_ref?: string;
|
|
16
|
+
output_ref?: string;
|
|
17
|
+
payload?: AionisObject;
|
|
18
|
+
loc?: SourceRange;
|
|
19
|
+
}
|
|
20
|
+
export interface ExecutionEdge {
|
|
21
|
+
from: string;
|
|
22
|
+
to: string;
|
|
23
|
+
type: "data_dependency" | "sequence_dependency" | "evidence_attachment" | "memory_writeback" | "replay_anchor";
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, resolve } from "node:path";
|
|
4
|
+
import process from "node:process";
|
|
5
|
+
import { buildHandoffStoreRequestFromRuntimeHandoff } from "./handoff-store.js";
|
|
6
|
+
class CliUsageError extends Error {
|
|
7
|
+
}
|
|
8
|
+
function printHelp() {
|
|
9
|
+
process.stdout.write([
|
|
10
|
+
"build-aionis-manifest-handoff-store-request",
|
|
11
|
+
"",
|
|
12
|
+
"Usage:",
|
|
13
|
+
" build-aionis-manifest-handoff-store-request <runtime-handoff.json> [--scope <scope>] [--tenant-id <tenant>]",
|
|
14
|
+
" [--actor <actor>] [--memory-lane private|shared] [--title <title>]",
|
|
15
|
+
" [--tag <tag>] [--out <path>] [--compact]",
|
|
16
|
+
"",
|
|
17
|
+
].join("\n"));
|
|
18
|
+
}
|
|
19
|
+
function parseArgs(argv) {
|
|
20
|
+
let inputPath = null;
|
|
21
|
+
const flags = {
|
|
22
|
+
out: null,
|
|
23
|
+
compact: false,
|
|
24
|
+
help: false,
|
|
25
|
+
scope: null,
|
|
26
|
+
tenantId: null,
|
|
27
|
+
actor: null,
|
|
28
|
+
memoryLane: null,
|
|
29
|
+
title: null,
|
|
30
|
+
tags: [],
|
|
31
|
+
};
|
|
32
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
33
|
+
const token = argv[i];
|
|
34
|
+
if (token === "--help" || token === "-h") {
|
|
35
|
+
flags.help = true;
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (token === "--compact") {
|
|
39
|
+
flags.compact = true;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (token === "--tag") {
|
|
43
|
+
const value = argv[i + 1];
|
|
44
|
+
if (!value)
|
|
45
|
+
throw new CliUsageError("Missing value for --tag.");
|
|
46
|
+
flags.tags.push(value);
|
|
47
|
+
i += 1;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (token === "--out" ||
|
|
51
|
+
token === "--scope" ||
|
|
52
|
+
token === "--tenant-id" ||
|
|
53
|
+
token === "--actor" ||
|
|
54
|
+
token === "--memory-lane" ||
|
|
55
|
+
token === "--title") {
|
|
56
|
+
const value = argv[i + 1];
|
|
57
|
+
if (!value)
|
|
58
|
+
throw new CliUsageError(`Missing value for ${token}.`);
|
|
59
|
+
switch (token) {
|
|
60
|
+
case "--out":
|
|
61
|
+
flags.out = value;
|
|
62
|
+
break;
|
|
63
|
+
case "--scope":
|
|
64
|
+
flags.scope = value;
|
|
65
|
+
break;
|
|
66
|
+
case "--tenant-id":
|
|
67
|
+
flags.tenantId = value;
|
|
68
|
+
break;
|
|
69
|
+
case "--actor":
|
|
70
|
+
flags.actor = value;
|
|
71
|
+
break;
|
|
72
|
+
case "--memory-lane":
|
|
73
|
+
if (value !== "private" && value !== "shared") {
|
|
74
|
+
throw new CliUsageError(`Unsupported memory lane '${value}'.`);
|
|
75
|
+
}
|
|
76
|
+
flags.memoryLane = value;
|
|
77
|
+
break;
|
|
78
|
+
case "--title":
|
|
79
|
+
flags.title = value;
|
|
80
|
+
break;
|
|
81
|
+
default:
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
i += 1;
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
if (token.startsWith("--")) {
|
|
88
|
+
throw new CliUsageError(`Unknown flag '${token}'.`);
|
|
89
|
+
}
|
|
90
|
+
if (inputPath) {
|
|
91
|
+
throw new CliUsageError("Only one input file may be provided.");
|
|
92
|
+
}
|
|
93
|
+
inputPath = token;
|
|
94
|
+
}
|
|
95
|
+
return { inputPath, flags };
|
|
96
|
+
}
|
|
97
|
+
async function writeOutput(pathname, contents) {
|
|
98
|
+
await mkdir(dirname(pathname), { recursive: true });
|
|
99
|
+
await writeFile(pathname, contents, "utf8");
|
|
100
|
+
}
|
|
101
|
+
async function main() {
|
|
102
|
+
const { inputPath, flags } = parseArgs(process.argv.slice(2));
|
|
103
|
+
if (flags.help) {
|
|
104
|
+
printHelp();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (!inputPath) {
|
|
108
|
+
throw new CliUsageError("An input file path is required.");
|
|
109
|
+
}
|
|
110
|
+
const resolvedInput = resolve(process.cwd(), inputPath);
|
|
111
|
+
const handoff = JSON.parse(await readFile(resolvedInput, "utf8"));
|
|
112
|
+
const request = buildHandoffStoreRequestFromRuntimeHandoff({
|
|
113
|
+
handoff,
|
|
114
|
+
scope: flags.scope ?? undefined,
|
|
115
|
+
tenantId: flags.tenantId ?? undefined,
|
|
116
|
+
actor: flags.actor ?? undefined,
|
|
117
|
+
memoryLane: flags.memoryLane ?? undefined,
|
|
118
|
+
title: flags.title ?? undefined,
|
|
119
|
+
tags: flags.tags,
|
|
120
|
+
});
|
|
121
|
+
const rendered = flags.compact ? JSON.stringify(request) : `${JSON.stringify(request, null, 2)}\n`;
|
|
122
|
+
if (flags.out) {
|
|
123
|
+
await writeOutput(resolve(process.cwd(), flags.out), rendered);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
process.stdout.write(rendered);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
main().catch((error) => {
|
|
130
|
+
if (error instanceof CliUsageError) {
|
|
131
|
+
process.stderr.write(`${error.message}\n`);
|
|
132
|
+
printHelp();
|
|
133
|
+
process.exitCode = 2;
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
137
|
+
process.stderr.write(`${message}\n`);
|
|
138
|
+
process.exitCode = 1;
|
|
139
|
+
});
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const AIONIS_MANIFEST_HANDOFF_STORE_REQUEST_VERSION: "aionis_manifest_handoff_store_request_v1";
|
|
3
|
+
export declare const AionisManifestHandoffStoreRequestSchema: z.ZodObject<{
|
|
4
|
+
request_version: z.ZodLiteral<"aionis_manifest_handoff_store_request_v1">;
|
|
5
|
+
tenant_id: z.ZodOptional<z.ZodString>;
|
|
6
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
7
|
+
actor: z.ZodOptional<z.ZodString>;
|
|
8
|
+
memory_lane: z.ZodDefault<z.ZodEnum<["private", "shared"]>>;
|
|
9
|
+
anchor: z.ZodString;
|
|
10
|
+
file_path: z.ZodOptional<z.ZodString>;
|
|
11
|
+
repo_root: z.ZodOptional<z.ZodString>;
|
|
12
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
13
|
+
handoff_kind: z.ZodLiteral<"task_handoff">;
|
|
14
|
+
title: z.ZodOptional<z.ZodString>;
|
|
15
|
+
summary: z.ZodString;
|
|
16
|
+
handoff_text: z.ZodString;
|
|
17
|
+
risk: z.ZodOptional<z.ZodString>;
|
|
18
|
+
acceptance_checks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
19
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
20
|
+
target_files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
21
|
+
next_action: z.ZodOptional<z.ZodString>;
|
|
22
|
+
must_change: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
23
|
+
must_remove: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
24
|
+
must_keep: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
25
|
+
execution_result_summary: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
26
|
+
execution_artifacts: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
27
|
+
execution_evidence: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
28
|
+
execution_state_v1: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
29
|
+
execution_packet_v1: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
30
|
+
control_profile_v1: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
31
|
+
execution_transitions_v1: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
summary: string;
|
|
34
|
+
anchor: string;
|
|
35
|
+
handoff_kind: "task_handoff";
|
|
36
|
+
handoff_text: string;
|
|
37
|
+
execution_state_v1: Record<string, unknown>;
|
|
38
|
+
execution_packet_v1: Record<string, unknown>;
|
|
39
|
+
request_version: "aionis_manifest_handoff_store_request_v1";
|
|
40
|
+
memory_lane: "private" | "shared";
|
|
41
|
+
symbol?: string | undefined;
|
|
42
|
+
title?: string | undefined;
|
|
43
|
+
tags?: string[] | undefined;
|
|
44
|
+
acceptance_checks?: string[] | undefined;
|
|
45
|
+
file_path?: string | undefined;
|
|
46
|
+
repo_root?: string | undefined;
|
|
47
|
+
scope?: string | undefined;
|
|
48
|
+
target_files?: string[] | undefined;
|
|
49
|
+
next_action?: string | undefined;
|
|
50
|
+
execution_result_summary?: Record<string, unknown> | undefined;
|
|
51
|
+
execution_artifacts?: Record<string, unknown>[] | undefined;
|
|
52
|
+
execution_evidence?: Record<string, unknown>[] | undefined;
|
|
53
|
+
tenant_id?: string | undefined;
|
|
54
|
+
actor?: string | undefined;
|
|
55
|
+
risk?: string | undefined;
|
|
56
|
+
must_change?: string[] | undefined;
|
|
57
|
+
must_remove?: string[] | undefined;
|
|
58
|
+
must_keep?: string[] | undefined;
|
|
59
|
+
control_profile_v1?: Record<string, unknown> | undefined;
|
|
60
|
+
execution_transitions_v1?: Record<string, unknown>[] | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
summary: string;
|
|
63
|
+
anchor: string;
|
|
64
|
+
handoff_kind: "task_handoff";
|
|
65
|
+
handoff_text: string;
|
|
66
|
+
execution_state_v1: Record<string, unknown>;
|
|
67
|
+
execution_packet_v1: Record<string, unknown>;
|
|
68
|
+
request_version: "aionis_manifest_handoff_store_request_v1";
|
|
69
|
+
symbol?: string | undefined;
|
|
70
|
+
title?: string | undefined;
|
|
71
|
+
tags?: string[] | undefined;
|
|
72
|
+
acceptance_checks?: string[] | undefined;
|
|
73
|
+
file_path?: string | undefined;
|
|
74
|
+
repo_root?: string | undefined;
|
|
75
|
+
scope?: string | undefined;
|
|
76
|
+
target_files?: string[] | undefined;
|
|
77
|
+
next_action?: string | undefined;
|
|
78
|
+
execution_result_summary?: Record<string, unknown> | undefined;
|
|
79
|
+
execution_artifacts?: Record<string, unknown>[] | undefined;
|
|
80
|
+
execution_evidence?: Record<string, unknown>[] | undefined;
|
|
81
|
+
tenant_id?: string | undefined;
|
|
82
|
+
actor?: string | undefined;
|
|
83
|
+
memory_lane?: "private" | "shared" | undefined;
|
|
84
|
+
risk?: string | undefined;
|
|
85
|
+
must_change?: string[] | undefined;
|
|
86
|
+
must_remove?: string[] | undefined;
|
|
87
|
+
must_keep?: string[] | undefined;
|
|
88
|
+
control_profile_v1?: Record<string, unknown> | undefined;
|
|
89
|
+
execution_transitions_v1?: Record<string, unknown>[] | undefined;
|
|
90
|
+
}>;
|
|
91
|
+
export type AionisManifestHandoffStoreRequest = z.infer<typeof AionisManifestHandoffStoreRequestSchema>;
|
|
92
|
+
type BuildHandoffStoreRequestOptions = {
|
|
93
|
+
tenantId?: string;
|
|
94
|
+
scope?: string;
|
|
95
|
+
actor?: string;
|
|
96
|
+
memoryLane?: "private" | "shared";
|
|
97
|
+
title?: string;
|
|
98
|
+
tags?: string[];
|
|
99
|
+
};
|
|
100
|
+
export declare function buildHandoffStoreRequestFromRuntimeHandoff(args: {
|
|
101
|
+
handoff: unknown;
|
|
102
|
+
} & BuildHandoffStoreRequestOptions): AionisManifestHandoffStoreRequest;
|
|
103
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AionisManifestRuntimeHandoffSchema, } from "./runtime-handoff.js";
|
|
3
|
+
export const AIONIS_MANIFEST_HANDOFF_STORE_REQUEST_VERSION = "aionis_manifest_handoff_store_request_v1";
|
|
4
|
+
export const AionisManifestHandoffStoreRequestSchema = z.object({
|
|
5
|
+
request_version: z.literal(AIONIS_MANIFEST_HANDOFF_STORE_REQUEST_VERSION),
|
|
6
|
+
tenant_id: z.string().min(1).optional(),
|
|
7
|
+
scope: z.string().min(1).optional(),
|
|
8
|
+
actor: z.string().min(1).optional(),
|
|
9
|
+
memory_lane: z.enum(["private", "shared"]).default("shared"),
|
|
10
|
+
anchor: z.string().min(1),
|
|
11
|
+
file_path: z.string().min(1).optional(),
|
|
12
|
+
repo_root: z.string().min(1).optional(),
|
|
13
|
+
symbol: z.string().min(1).optional(),
|
|
14
|
+
handoff_kind: z.literal("task_handoff"),
|
|
15
|
+
title: z.string().min(1).optional(),
|
|
16
|
+
summary: z.string().min(1),
|
|
17
|
+
handoff_text: z.string().min(1),
|
|
18
|
+
risk: z.string().min(1).optional(),
|
|
19
|
+
acceptance_checks: z.array(z.string().min(1)).optional(),
|
|
20
|
+
tags: z.array(z.string().min(1)).optional(),
|
|
21
|
+
target_files: z.array(z.string().min(1)).optional(),
|
|
22
|
+
next_action: z.string().min(1).optional(),
|
|
23
|
+
must_change: z.array(z.string().min(1)).optional(),
|
|
24
|
+
must_remove: z.array(z.string().min(1)).optional(),
|
|
25
|
+
must_keep: z.array(z.string().min(1)).optional(),
|
|
26
|
+
execution_result_summary: z.record(z.unknown()).optional(),
|
|
27
|
+
execution_artifacts: z.array(z.record(z.unknown())).optional(),
|
|
28
|
+
execution_evidence: z.array(z.record(z.unknown())).optional(),
|
|
29
|
+
execution_state_v1: z.record(z.unknown()),
|
|
30
|
+
execution_packet_v1: z.record(z.unknown()),
|
|
31
|
+
control_profile_v1: z.record(z.unknown()).optional(),
|
|
32
|
+
execution_transitions_v1: z.array(z.record(z.unknown())).optional(),
|
|
33
|
+
});
|
|
34
|
+
export function buildHandoffStoreRequestFromRuntimeHandoff(args) {
|
|
35
|
+
const handoff = AionisManifestRuntimeHandoffSchema.parse(args.handoff);
|
|
36
|
+
return buildHandoffStoreRequestFromParsedRuntimeHandoff(handoff, args);
|
|
37
|
+
}
|
|
38
|
+
function buildHandoffStoreRequestFromParsedRuntimeHandoff(handoff, options) {
|
|
39
|
+
const tags = [
|
|
40
|
+
"aionis-manifest",
|
|
41
|
+
"runtime-handoff",
|
|
42
|
+
`doc:${handoff.source_doc_id}`,
|
|
43
|
+
...(options.tags ?? []),
|
|
44
|
+
];
|
|
45
|
+
const risk = handoff.execution_state_v1.unresolved_blockers.length > 0
|
|
46
|
+
? handoff.execution_state_v1.unresolved_blockers.join(" | ")
|
|
47
|
+
: undefined;
|
|
48
|
+
return AionisManifestHandoffStoreRequestSchema.parse({
|
|
49
|
+
request_version: AIONIS_MANIFEST_HANDOFF_STORE_REQUEST_VERSION,
|
|
50
|
+
tenant_id: options.tenantId,
|
|
51
|
+
scope: options.scope ?? handoff.scope,
|
|
52
|
+
actor: options.actor,
|
|
53
|
+
memory_lane: options.memoryLane ?? "shared",
|
|
54
|
+
anchor: handoff.execution_ready_handoff.anchor,
|
|
55
|
+
file_path: handoff.execution_state_v1.resume_anchor?.file_path ?? undefined,
|
|
56
|
+
repo_root: handoff.execution_state_v1.resume_anchor?.repo_root ?? undefined,
|
|
57
|
+
symbol: handoff.execution_state_v1.resume_anchor?.symbol ?? undefined,
|
|
58
|
+
handoff_kind: "task_handoff",
|
|
59
|
+
title: options.title ?? `AionisManifest ${handoff.source_doc_id}`,
|
|
60
|
+
summary: handoff.execution_ready_handoff.summary ?? handoff.task_brief,
|
|
61
|
+
handoff_text: handoff.execution_ready_handoff.handoff_text,
|
|
62
|
+
risk,
|
|
63
|
+
acceptance_checks: handoff.execution_ready_handoff.acceptance_checks,
|
|
64
|
+
tags,
|
|
65
|
+
target_files: handoff.execution_ready_handoff.target_files,
|
|
66
|
+
next_action: handoff.execution_ready_handoff.next_action ?? undefined,
|
|
67
|
+
must_change: handoff.execution_packet_v1.hard_constraints,
|
|
68
|
+
must_remove: handoff.execution_state_v1.rejected_paths,
|
|
69
|
+
must_keep: handoff.execution_state_v1.rollback_notes,
|
|
70
|
+
execution_result_summary: handoff.execution_result_summary ?? undefined,
|
|
71
|
+
execution_artifacts: handoff.execution_artifacts,
|
|
72
|
+
execution_evidence: handoff.execution_evidence,
|
|
73
|
+
execution_state_v1: handoff.execution_state_v1,
|
|
74
|
+
execution_packet_v1: handoff.execution_packet_v1,
|
|
75
|
+
control_profile_v1: undefined,
|
|
76
|
+
execution_transitions_v1: undefined,
|
|
77
|
+
});
|
|
78
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from "./ast/types.js";
|
|
2
|
+
export * from "./compile.js";
|
|
3
|
+
export * from "./contracts.js";
|
|
4
|
+
export * from "./diagnostics/types.js";
|
|
5
|
+
export * from "./execute.js";
|
|
6
|
+
export * from "./execute/localRuntime.js";
|
|
7
|
+
export * from "./execute/moduleRuntime.js";
|
|
8
|
+
export * from "./registry/loadModuleRegistry.js";
|
|
9
|
+
export * from "./registry/types.js";
|
|
10
|
+
export type { AionisManifestRunInputKind, AionisManifestRunRequest, ExecuteAionisManifestOptions, ExecutionArtifactRecord, ExecutionModuleContext, ExecutionModuleDefinition, ExecutionModuleHandler, ExecutionModuleManifest, ExecutionModuleOutcome, ExecutionModuleRegistry, ExecutionModuleValueContract, ExecutionModuleValueContractKind, ExecutionEvidenceRecord, ExecutionNodeResult, ExecutionResultV1, ExecutionRuntime, ExecutionRuntimeCapabilities, ExecutionRuntimeCapability, } from "./execute/types.js";
|
|
11
|
+
export * from "./graph/types.js";
|
|
12
|
+
export * from "./handoff-store.js";
|
|
13
|
+
export * from "./ir/types.js";
|
|
14
|
+
export * from "./plan/buildExecutionPlan.js";
|
|
15
|
+
export * from "./plan/types.js";
|
|
16
|
+
export * from "./publish.js";
|
|
17
|
+
export * from "./recover.js";
|
|
18
|
+
export * from "./refs/resolveRefs.js";
|
|
19
|
+
export * from "./run.js";
|
|
20
|
+
export * from "./resume.js";
|
|
21
|
+
export * from "./runtime-handoff.js";
|
|
22
|
+
export * from "./validate.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from "./ast/types.js";
|
|
2
|
+
export * from "./compile.js";
|
|
3
|
+
export * from "./contracts.js";
|
|
4
|
+
export * from "./diagnostics/types.js";
|
|
5
|
+
export * from "./execute.js";
|
|
6
|
+
export * from "./execute/localRuntime.js";
|
|
7
|
+
export * from "./execute/moduleRuntime.js";
|
|
8
|
+
export * from "./registry/loadModuleRegistry.js";
|
|
9
|
+
export * from "./registry/types.js";
|
|
10
|
+
export * from "./graph/types.js";
|
|
11
|
+
export * from "./handoff-store.js";
|
|
12
|
+
export * from "./ir/types.js";
|
|
13
|
+
export * from "./plan/buildExecutionPlan.js";
|
|
14
|
+
export * from "./plan/types.js";
|
|
15
|
+
export * from "./publish.js";
|
|
16
|
+
export * from "./recover.js";
|
|
17
|
+
export * from "./refs/resolveRefs.js";
|
|
18
|
+
export * from "./run.js";
|
|
19
|
+
export * from "./resume.js";
|
|
20
|
+
export * from "./runtime-handoff.js";
|
|
21
|
+
export * from "./validate.js";
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { Diagnostic, SourceRange } from "../diagnostics/types.js";
|
|
2
|
+
export type AionisPrimitive = string | number | boolean | null;
|
|
3
|
+
export type AionisValue = AionisPrimitive | AionisObject | AionisValue[];
|
|
4
|
+
export interface AionisObject {
|
|
5
|
+
[key: string]: AionisValue;
|
|
6
|
+
}
|
|
7
|
+
export interface DocMetaIR {
|
|
8
|
+
id: string;
|
|
9
|
+
version: string;
|
|
10
|
+
kind?: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
status?: string;
|
|
13
|
+
tags?: string[];
|
|
14
|
+
data: AionisObject;
|
|
15
|
+
loc?: SourceRange;
|
|
16
|
+
}
|
|
17
|
+
export interface ContextIR {
|
|
18
|
+
objective?: string;
|
|
19
|
+
audience?: string[];
|
|
20
|
+
constraints?: string[];
|
|
21
|
+
data: AionisObject;
|
|
22
|
+
loc?: SourceRange;
|
|
23
|
+
}
|
|
24
|
+
export interface PlanIR {
|
|
25
|
+
steps?: string[];
|
|
26
|
+
success_criteria?: string[];
|
|
27
|
+
checkpoints?: string[];
|
|
28
|
+
fallbacks?: string[];
|
|
29
|
+
data: AionisObject;
|
|
30
|
+
loc?: SourceRange;
|
|
31
|
+
}
|
|
32
|
+
export interface ExecuteIR {
|
|
33
|
+
module?: string;
|
|
34
|
+
tool?: string;
|
|
35
|
+
agent?: string;
|
|
36
|
+
input?: AionisObject;
|
|
37
|
+
input_ref?: string;
|
|
38
|
+
output_ref?: string;
|
|
39
|
+
deterministic?: boolean;
|
|
40
|
+
depends_on?: string[];
|
|
41
|
+
data: AionisObject;
|
|
42
|
+
loc?: SourceRange;
|
|
43
|
+
}
|
|
44
|
+
export interface DecisionIR {
|
|
45
|
+
decision?: string;
|
|
46
|
+
rationale?: string;
|
|
47
|
+
confidence?: number;
|
|
48
|
+
data: AionisObject;
|
|
49
|
+
loc?: SourceRange;
|
|
50
|
+
}
|
|
51
|
+
export interface EvidenceIR {
|
|
52
|
+
sources?: AionisValue[];
|
|
53
|
+
confidence?: number;
|
|
54
|
+
claims_supported?: string[];
|
|
55
|
+
data: AionisObject;
|
|
56
|
+
loc?: SourceRange;
|
|
57
|
+
}
|
|
58
|
+
export interface ReplayIR {
|
|
59
|
+
executable?: boolean;
|
|
60
|
+
mode?: "deterministic" | "assisted" | "advisory";
|
|
61
|
+
workflow_id?: string;
|
|
62
|
+
expected_outputs?: string[];
|
|
63
|
+
data: AionisObject;
|
|
64
|
+
loc?: SourceRange;
|
|
65
|
+
}
|
|
66
|
+
export interface MemoryIR {
|
|
67
|
+
topics?: string[];
|
|
68
|
+
entities?: string[];
|
|
69
|
+
writeback?: boolean;
|
|
70
|
+
summary_layer?: string;
|
|
71
|
+
data: AionisObject;
|
|
72
|
+
loc?: SourceRange;
|
|
73
|
+
}
|
|
74
|
+
export interface StateIR {
|
|
75
|
+
phase?: string;
|
|
76
|
+
run_id?: string;
|
|
77
|
+
owner?: string;
|
|
78
|
+
data: AionisObject;
|
|
79
|
+
loc?: SourceRange;
|
|
80
|
+
}
|
|
81
|
+
export interface AionisManifestIR {
|
|
82
|
+
doc: DocMetaIR | null;
|
|
83
|
+
context: ContextIR[];
|
|
84
|
+
plans: PlanIR[];
|
|
85
|
+
executions: ExecuteIR[];
|
|
86
|
+
decisions: DecisionIR[];
|
|
87
|
+
evidence: EvidenceIR[];
|
|
88
|
+
replay: ReplayIR[];
|
|
89
|
+
memory: MemoryIR[];
|
|
90
|
+
state: StateIR[];
|
|
91
|
+
diagnostics: Diagnostic[];
|
|
92
|
+
}
|
package/dist/ir/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|