@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,52 @@
|
|
|
1
|
+
export declare const AIONIS_MANIFEST_REGISTRY_VALIDATION_RESULT_VERSION: "aionis_manifest_registry_validation_result_v1";
|
|
2
|
+
export declare const AIONIS_MANIFEST_MODULE_VALIDATION_RESULT_VERSION: "aionis_manifest_module_validation_result_v1";
|
|
3
|
+
type ModuleValidationSummary = {
|
|
4
|
+
module: string;
|
|
5
|
+
version: string;
|
|
6
|
+
title: string | null;
|
|
7
|
+
deterministic: boolean | null;
|
|
8
|
+
required_capabilities: string[];
|
|
9
|
+
};
|
|
10
|
+
export type AionisManifestModuleValidationResult = {
|
|
11
|
+
command: "validate-aionis-manifest-module";
|
|
12
|
+
validation_result_version: typeof AIONIS_MANIFEST_MODULE_VALIDATION_RESULT_VERSION;
|
|
13
|
+
valid: true;
|
|
14
|
+
entry_path: string;
|
|
15
|
+
declared_module: string | null;
|
|
16
|
+
module: ModuleValidationSummary;
|
|
17
|
+
};
|
|
18
|
+
export type AionisManifestRegistryValidationResult = {
|
|
19
|
+
command: "validate-aionis-manifest-registry";
|
|
20
|
+
validation_result_version: typeof AIONIS_MANIFEST_REGISTRY_VALIDATION_RESULT_VERSION;
|
|
21
|
+
valid: true;
|
|
22
|
+
registry_path: string;
|
|
23
|
+
registry_version: string;
|
|
24
|
+
runtime_id: "standalone_file_registry_v1" | "standalone_npm_registry_v1";
|
|
25
|
+
module_count: number;
|
|
26
|
+
modules: Array<{
|
|
27
|
+
module: string;
|
|
28
|
+
source: "file";
|
|
29
|
+
entry: string;
|
|
30
|
+
resolved_target: string;
|
|
31
|
+
manifest: ModuleValidationSummary;
|
|
32
|
+
} | {
|
|
33
|
+
module: string;
|
|
34
|
+
source: "package";
|
|
35
|
+
package: string;
|
|
36
|
+
export: string | null;
|
|
37
|
+
specifier: string;
|
|
38
|
+
resolved_target: string;
|
|
39
|
+
manifest: ModuleValidationSummary;
|
|
40
|
+
}>;
|
|
41
|
+
};
|
|
42
|
+
export declare function validateAionisManifestModule(args: {
|
|
43
|
+
entryPath: string;
|
|
44
|
+
declaredModule?: string;
|
|
45
|
+
cwd?: string;
|
|
46
|
+
}): Promise<AionisManifestModuleValidationResult>;
|
|
47
|
+
export declare function validateAionisManifestRegistry(args: {
|
|
48
|
+
registryPath: string;
|
|
49
|
+
}): Promise<AionisManifestRegistryValidationResult>;
|
|
50
|
+
export declare function writeValidationOutput(pathname: string, contents: string): Promise<void>;
|
|
51
|
+
export declare function resolveOutputPath(target: string): string;
|
|
52
|
+
export {};
|
package/dist/validate.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, resolve as resolvePath } from "node:path";
|
|
3
|
+
import { loadModuleDefinitionFromFileEntry, loadModuleDefinitionFromNpmEntry, loadModuleRegistryFile, } from "./registry/loadModuleRegistry.js";
|
|
4
|
+
import { AIONIS_MANIFEST_MODULE_REGISTRY_VERSION, } from "./registry/types.js";
|
|
5
|
+
import { validateExecutionModuleManifest } from "./contracts.js";
|
|
6
|
+
export const AIONIS_MANIFEST_REGISTRY_VALIDATION_RESULT_VERSION = "aionis_manifest_registry_validation_result_v1";
|
|
7
|
+
export const AIONIS_MANIFEST_MODULE_VALIDATION_RESULT_VERSION = "aionis_manifest_module_validation_result_v1";
|
|
8
|
+
function summarizeManifest(manifest) {
|
|
9
|
+
const parsed = validateExecutionModuleManifest(manifest);
|
|
10
|
+
return {
|
|
11
|
+
module: parsed.module,
|
|
12
|
+
version: parsed.version,
|
|
13
|
+
title: parsed.title ?? null,
|
|
14
|
+
deterministic: typeof parsed.deterministic === "boolean" ? parsed.deterministic : null,
|
|
15
|
+
required_capabilities: parsed.required_capabilities ?? [],
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export async function validateAionisManifestModule(args) {
|
|
19
|
+
const registryDir = args.cwd ?? process.cwd();
|
|
20
|
+
const entry = {
|
|
21
|
+
module: args.declaredModule,
|
|
22
|
+
entry: args.entryPath,
|
|
23
|
+
};
|
|
24
|
+
const loaded = await loadModuleDefinitionFromFileEntry({ registryDir, entry });
|
|
25
|
+
if (args.declaredModule && loaded.definition.manifest.module !== args.declaredModule) {
|
|
26
|
+
throw new Error(`Entry '${loaded.resolvedEntryPath}' exports manifest '${loaded.definition.manifest.module}' but declared module was '${args.declaredModule}'.`);
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
command: "validate-aionis-manifest-module",
|
|
30
|
+
validation_result_version: AIONIS_MANIFEST_MODULE_VALIDATION_RESULT_VERSION,
|
|
31
|
+
valid: true,
|
|
32
|
+
entry_path: loaded.resolvedEntryPath,
|
|
33
|
+
declared_module: args.declaredModule ?? null,
|
|
34
|
+
module: summarizeManifest(loaded.definition.manifest),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export async function validateAionisManifestRegistry(args) {
|
|
38
|
+
const registry = await loadModuleRegistryFile(args.registryPath);
|
|
39
|
+
const registryDir = dirname(args.registryPath);
|
|
40
|
+
if (registry.version === AIONIS_MANIFEST_MODULE_REGISTRY_VERSION) {
|
|
41
|
+
const modules = await Promise.all(registry.modules.map(async (entry) => {
|
|
42
|
+
const loaded = await loadModuleDefinitionFromFileEntry({ registryDir, entry });
|
|
43
|
+
return {
|
|
44
|
+
module: entry.module,
|
|
45
|
+
source: "file",
|
|
46
|
+
entry: entry.entry,
|
|
47
|
+
resolved_target: loaded.resolvedEntryPath,
|
|
48
|
+
manifest: summarizeManifest(loaded.definition.manifest),
|
|
49
|
+
};
|
|
50
|
+
}));
|
|
51
|
+
return {
|
|
52
|
+
command: "validate-aionis-manifest-registry",
|
|
53
|
+
validation_result_version: AIONIS_MANIFEST_REGISTRY_VALIDATION_RESULT_VERSION,
|
|
54
|
+
valid: true,
|
|
55
|
+
registry_path: args.registryPath,
|
|
56
|
+
registry_version: registry.version,
|
|
57
|
+
runtime_id: "standalone_file_registry_v1",
|
|
58
|
+
module_count: modules.length,
|
|
59
|
+
modules,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const modules = await Promise.all(registry.modules.map(async (entry) => {
|
|
63
|
+
const loaded = await loadModuleDefinitionFromNpmEntry({ registryDir, entry });
|
|
64
|
+
return {
|
|
65
|
+
module: entry.module,
|
|
66
|
+
source: "package",
|
|
67
|
+
package: entry.package,
|
|
68
|
+
export: entry.export ?? null,
|
|
69
|
+
specifier: loaded.specifier,
|
|
70
|
+
resolved_target: loaded.resolvedEntryPath,
|
|
71
|
+
manifest: summarizeManifest(loaded.definition.manifest),
|
|
72
|
+
};
|
|
73
|
+
}));
|
|
74
|
+
return {
|
|
75
|
+
command: "validate-aionis-manifest-registry",
|
|
76
|
+
validation_result_version: AIONIS_MANIFEST_REGISTRY_VALIDATION_RESULT_VERSION,
|
|
77
|
+
valid: true,
|
|
78
|
+
registry_path: args.registryPath,
|
|
79
|
+
registry_version: registry.version,
|
|
80
|
+
runtime_id: "standalone_npm_registry_v1",
|
|
81
|
+
module_count: modules.length,
|
|
82
|
+
modules,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export async function writeValidationOutput(pathname, contents) {
|
|
86
|
+
await mkdir(dirname(pathname), { recursive: true });
|
|
87
|
+
await writeFile(pathname, contents, "utf8");
|
|
88
|
+
}
|
|
89
|
+
export function resolveOutputPath(target) {
|
|
90
|
+
return resolvePath(process.cwd(), target);
|
|
91
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@manifest {
|
|
2
|
+
id: "primary-doc"
|
|
3
|
+
version: "1.0"
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
@manifest {
|
|
7
|
+
id: "secondary-doc"
|
|
8
|
+
version: "2.0"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@context {
|
|
12
|
+
objective: "Trigger duplicate manifest diagnostic"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@execute {
|
|
16
|
+
module: "demo.duplicate.v1"
|
|
17
|
+
input_ref: "ctx"
|
|
18
|
+
output_ref: "out.duplicate"
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
```text
|
|
2
|
+
@manifest {
|
|
3
|
+
id: "fake-doc"
|
|
4
|
+
version: "1.0"
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@execute {
|
|
8
|
+
module: "fake.module.v1"
|
|
9
|
+
input_ref: "ctx"
|
|
10
|
+
output_ref: "out.fake"
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
@manifest {
|
|
15
|
+
id: "real-doc"
|
|
16
|
+
version: "1.0"
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@context {
|
|
20
|
+
objective: "Use only live directives outside fences"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@execute {
|
|
24
|
+
module: "real.module.v1"
|
|
25
|
+
input_ref: "ctx"
|
|
26
|
+
output_ref: "out.real"
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "aionis_manifest_npm_module_registry_v1",
|
|
3
|
+
"modules": [
|
|
4
|
+
{
|
|
5
|
+
"module": "research.claims.v1",
|
|
6
|
+
"package": "@aionis/manifest-module-research-claims"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"module": "copy.summary.v1",
|
|
10
|
+
"package": "@aionis/manifest-module-copy-summary"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"module": "json.transform.v1",
|
|
14
|
+
"package": "@aionis/manifest-module-json-transform"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plan_version": "execution_plan_v1",
|
|
3
|
+
"doc": {
|
|
4
|
+
"id": "standalone-runner-001",
|
|
5
|
+
"version": "1.0",
|
|
6
|
+
"kind": "workflow"
|
|
7
|
+
},
|
|
8
|
+
"context": {
|
|
9
|
+
"merged": {
|
|
10
|
+
"product": "AionisManifest",
|
|
11
|
+
"objective": "Explain standalone execution"
|
|
12
|
+
},
|
|
13
|
+
"frames": [
|
|
14
|
+
{
|
|
15
|
+
"product": "AionisManifest",
|
|
16
|
+
"objective": "Explain standalone execution"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"executions": [
|
|
21
|
+
{
|
|
22
|
+
"execution_id": "run.claims",
|
|
23
|
+
"module": "research.claims.v1",
|
|
24
|
+
"input_ref": "ctx",
|
|
25
|
+
"output_ref": "run.claims",
|
|
26
|
+
"depends_on": []
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"execution_id": "out.summary",
|
|
30
|
+
"module": "copy.summary.v1",
|
|
31
|
+
"input_ref": "run.claims",
|
|
32
|
+
"output_ref": "out.summary",
|
|
33
|
+
"depends_on": [
|
|
34
|
+
"run.claims"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"graph": null,
|
|
39
|
+
"expected_outputs": [
|
|
40
|
+
"out.summary"
|
|
41
|
+
],
|
|
42
|
+
"required_capabilities": [
|
|
43
|
+
"direct_execution"
|
|
44
|
+
],
|
|
45
|
+
"determinism": {
|
|
46
|
+
"executable": true,
|
|
47
|
+
"replay_mode": "deterministic",
|
|
48
|
+
"requires_resume_support": false
|
|
49
|
+
},
|
|
50
|
+
"diagnostics": []
|
|
51
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@manifest {
|
|
2
|
+
id: "standalone-runner-001"
|
|
3
|
+
version: "1.0"
|
|
4
|
+
kind: "workflow"
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@context {
|
|
8
|
+
product: "AionisManifest"
|
|
9
|
+
objective: "Explain standalone execution"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@execute {
|
|
13
|
+
module: "research.claims.v1"
|
|
14
|
+
input_ref: "ctx"
|
|
15
|
+
output_ref: "run.claims"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@execute {
|
|
19
|
+
module: "copy.summary.v1"
|
|
20
|
+
input_ref: "run.claims"
|
|
21
|
+
output_ref: "out.summary"
|
|
22
|
+
depends_on: ["run.claims"]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@replay {
|
|
26
|
+
executable: true
|
|
27
|
+
mode: "deterministic"
|
|
28
|
+
expected_outputs: ["out.summary"]
|
|
29
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@manifest {
|
|
2
|
+
id: "demo-001"
|
|
3
|
+
version: "1.0"
|
|
4
|
+
kind: "task"
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
# Goal
|
|
8
|
+
Compile a minimal Aionis manifest.
|
|
9
|
+
|
|
10
|
+
@context {
|
|
11
|
+
objective: "Say hello"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@execute {
|
|
15
|
+
module: "demo.hello.v1"
|
|
16
|
+
input_ref: "ctx"
|
|
17
|
+
output_ref: "out.message"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@replay {
|
|
21
|
+
executable: true
|
|
22
|
+
mode: "assisted"
|
|
23
|
+
expected_outputs: ["out.message"]
|
|
24
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@manifest {
|
|
2
|
+
id: "workflow-001"
|
|
3
|
+
version: "1.0"
|
|
4
|
+
kind: "workflow"
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@context {
|
|
8
|
+
product: "EVA"
|
|
9
|
+
audience: ["founders", "operators"]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@execute {
|
|
13
|
+
module: "research.claims.v1"
|
|
14
|
+
input_ref: "ctx"
|
|
15
|
+
output_ref: "run.claims"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@execute {
|
|
19
|
+
module: "copy.hero.v1"
|
|
20
|
+
input_ref: "run.claims"
|
|
21
|
+
output_ref: "out.hero"
|
|
22
|
+
depends_on: ["run.claims"]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@replay {
|
|
26
|
+
executable: true
|
|
27
|
+
mode: "deterministic"
|
|
28
|
+
expected_outputs: ["out.hero"]
|
|
29
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @aionis/manifest-module-copy-summary
|
|
2
|
+
|
|
3
|
+
Official AionisManifest module that joins a list of claims into a single summary string.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i @aionis/manifest-module-copy-summary@0.1.0
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Input
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"claims": ["Aionis", "turns docs into workflows."]
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Output
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"summary": "Aionis turns docs into workflows."
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Exports
|
|
28
|
+
|
|
29
|
+
1. `manifest`
|
|
30
|
+
2. `handler`
|
|
31
|
+
|
|
32
|
+
## Module ID
|
|
33
|
+
|
|
34
|
+
`copy.summary.v1`
|
|
35
|
+
|
|
36
|
+
## Registry Entry
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"module": "copy.summary.v1",
|
|
41
|
+
"package": "@aionis/manifest-module-copy-summary"
|
|
42
|
+
}
|
|
43
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export const manifest = {
|
|
2
|
+
module: "copy.summary.v1",
|
|
3
|
+
version: "1.0.0",
|
|
4
|
+
title: "Copy Summary",
|
|
5
|
+
description: "Join an ordered list of claims into one summary string.",
|
|
6
|
+
deterministic: true,
|
|
7
|
+
required_capabilities: ["direct_execution"],
|
|
8
|
+
input_contract: {
|
|
9
|
+
kind: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
claims: {
|
|
12
|
+
kind: "array",
|
|
13
|
+
items: { kind: "string" }
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
required: ["claims"],
|
|
17
|
+
additional_properties: false
|
|
18
|
+
},
|
|
19
|
+
output_contract: {
|
|
20
|
+
kind: "object",
|
|
21
|
+
properties: {
|
|
22
|
+
summary: { kind: "string" }
|
|
23
|
+
},
|
|
24
|
+
required: ["summary"],
|
|
25
|
+
additional_properties: false
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export async function handler(input) {
|
|
30
|
+
const claims =
|
|
31
|
+
input && typeof input === "object" && Array.isArray(input.claims)
|
|
32
|
+
? input.claims.filter((item) => typeof item === "string")
|
|
33
|
+
: [];
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
kind: "module_result",
|
|
37
|
+
output: {
|
|
38
|
+
summary: claims.join(" ")
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aionis/manifest-module-copy-summary",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Official AionisManifest module for joining claim arrays into a summary string.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.mjs",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./index.mjs"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"index.mjs",
|
|
12
|
+
"README.md",
|
|
13
|
+
"CHANGELOG.md"
|
|
14
|
+
],
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=18.0.0"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"aionis-manifest",
|
|
23
|
+
"module",
|
|
24
|
+
"summary"
|
|
25
|
+
],
|
|
26
|
+
"author": "Aionis Core",
|
|
27
|
+
"license": "Apache-2.0",
|
|
28
|
+
"scripts": {
|
|
29
|
+
"pack:dry-run": "npm pack --dry-run --cache /tmp/aionis-npm-cache"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @aionis/manifest-module-json-transform
|
|
2
|
+
|
|
3
|
+
Official AionisManifest module that deterministically selects a subset of keys from an input object.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i @aionis/manifest-module-json-transform@0.1.0
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Input
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"value": {
|
|
16
|
+
"product": "Aionis",
|
|
17
|
+
"mode": "standalone",
|
|
18
|
+
"ignored": true
|
|
19
|
+
},
|
|
20
|
+
"pick": ["mode", "product"]
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Output
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"result": {
|
|
29
|
+
"mode": "standalone",
|
|
30
|
+
"product": "Aionis"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Exports
|
|
36
|
+
|
|
37
|
+
1. `manifest`
|
|
38
|
+
2. `handler`
|
|
39
|
+
|
|
40
|
+
## Module ID
|
|
41
|
+
|
|
42
|
+
`json.transform.v1`
|
|
43
|
+
|
|
44
|
+
## Registry Entry
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"module": "json.transform.v1",
|
|
49
|
+
"package": "@aionis/manifest-module-json-transform"
|
|
50
|
+
}
|
|
51
|
+
```
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export const manifest = {
|
|
2
|
+
module: "json.transform.v1",
|
|
3
|
+
version: "1.0.0",
|
|
4
|
+
title: "JSON Transform",
|
|
5
|
+
description: "Select a stable subset of object keys from an input record.",
|
|
6
|
+
deterministic: true,
|
|
7
|
+
required_capabilities: ["direct_execution"],
|
|
8
|
+
input_contract: {
|
|
9
|
+
kind: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
value: {
|
|
12
|
+
kind: "object",
|
|
13
|
+
additional_properties: true
|
|
14
|
+
},
|
|
15
|
+
pick: {
|
|
16
|
+
kind: "array",
|
|
17
|
+
items: { kind: "string" }
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
required: ["value", "pick"],
|
|
21
|
+
additional_properties: false
|
|
22
|
+
},
|
|
23
|
+
output_contract: {
|
|
24
|
+
kind: "object",
|
|
25
|
+
properties: {
|
|
26
|
+
result: {
|
|
27
|
+
kind: "object",
|
|
28
|
+
additional_properties: true
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
required: ["result"],
|
|
32
|
+
additional_properties: false
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export async function handler(input) {
|
|
37
|
+
const source = input && typeof input === "object" && input.value && typeof input.value === "object" ? input.value : {};
|
|
38
|
+
const pick = input && typeof input === "object" && Array.isArray(input.pick) ? input.pick : [];
|
|
39
|
+
const result = {};
|
|
40
|
+
|
|
41
|
+
for (const key of pick) {
|
|
42
|
+
if (typeof key === "string" && Object.prototype.hasOwnProperty.call(source, key)) {
|
|
43
|
+
result[key] = source[key];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
kind: "module_result",
|
|
49
|
+
output: {
|
|
50
|
+
result
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aionis/manifest-module-json-transform",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Official AionisManifest module for deterministic object key selection.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.mjs",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./index.mjs"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"index.mjs",
|
|
12
|
+
"README.md",
|
|
13
|
+
"CHANGELOG.md"
|
|
14
|
+
],
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=18.0.0"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"aionis-manifest",
|
|
23
|
+
"module",
|
|
24
|
+
"json"
|
|
25
|
+
],
|
|
26
|
+
"author": "Aionis Core",
|
|
27
|
+
"license": "Apache-2.0",
|
|
28
|
+
"scripts": {
|
|
29
|
+
"pack:dry-run": "npm pack --dry-run --cache /tmp/aionis-npm-cache"
|
|
30
|
+
}
|
|
31
|
+
}
|