@x12i/memorix-skills 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/agents/BLOCKS.md +21 -0
- package/agents/README.md +13 -0
- package/agents/evidence-summary/README.md +5 -0
- package/agents/evidence-summary/fixtures/evidence-summary.json +23 -0
- package/agents/evidence-summary/models.json +30 -0
- package/agents/evidence-summary/process.json +96 -0
- package/agents/evidence-summary/processing/check.example-outputs/index.json +21 -0
- package/agents/evidence-summary/processing/check.example-outputs/output.json +9 -0
- package/agents/evidence-summary/processing/check.example-outputs/result.json +3 -0
- package/agents/evidence-summary/processing/draft.example-outputs/index.json +21 -0
- package/agents/evidence-summary/processing/draft.example-outputs/output.json +12 -0
- package/agents/evidence-summary/processing/draft.example-outputs/result.json +3 -0
- package/agents/evidence-summary/processing/incomplete.example-outputs/index.json +21 -0
- package/agents/evidence-summary/processing/incomplete.example-outputs/output.json +11 -0
- package/agents/evidence-summary/processing/incomplete.example-outputs/result.json +3 -0
- package/agents/evidence-summary/processing/publish.example-outputs/index.json +21 -0
- package/agents/evidence-summary/processing/publish.example-outputs/output.json +12 -0
- package/agents/evidence-summary/schemas/summary.json +9 -0
- package/agents/foundation/README.md +20 -0
- package/agents/foundation/auditing/entity-overview.audit.md +32 -0
- package/agents/foundation/auditing/list-overview.audit.md +32 -0
- package/agents/foundation/blocks/overview-sections.md +13 -0
- package/agents/foundation/processing/entity-overview.md +25 -0
- package/agents/foundation/processing/list-overview.md +27 -0
- package/agents/record-brief/README.md +7 -0
- package/agents/record-brief/edges/summary-when-long.mjs +10 -0
- package/agents/record-brief/fixtures/record-brief.json +22 -0
- package/agents/record-brief/models.json +16 -0
- package/agents/record-brief/process.json +143 -0
- package/agents/record-brief/processing/count-briefs.example-outputs/index.json +21 -0
- package/agents/record-brief/processing/count-briefs.example-outputs/output.json +9 -0
- package/agents/record-brief/processing/index-terms.example-outputs/index.json +21 -0
- package/agents/record-brief/processing/index-terms.example-outputs/output.json +12 -0
- package/agents/record-brief/processing/normalize-note.example-outputs/index.json +21 -0
- package/agents/record-brief/processing/normalize-note.example-outputs/output.json +11 -0
- package/agents/record-brief/processing/summarize-note.example-outputs/index.json +21 -0
- package/agents/record-brief/processing/summarize-note.example-outputs/output.json +11 -0
- package/agents/record-brief/prompts/summarize.md +1 -0
- package/agents/record-brief/steps/count-briefs.mjs +6 -0
- package/agents/record-brief/steps/index-terms.mjs +6 -0
- package/agents/record-brief/steps/normalize-note.mjs +16 -0
- package/agents/record-brief/steps/summarize-note.mjs +38 -0
- package/agents/system/README.md +37 -0
- package/agents/tryout/README.md +7 -0
- package/agents/tryout/fixtures/tryout.json +28 -0
- package/agents/tryout/process.json +88 -0
- package/agents/tryout/processing/echo-stamp.example-outputs/index.json +16 -0
- package/agents/tryout/processing/echo-stamp.example-outputs/output.json +10 -0
- package/agents/tryout/processing/name-label.example-outputs/index.json +16 -0
- package/agents/tryout/processing/name-label.example-outputs/output.json +9 -0
- package/agents/tryout/processing/stamp-note.example-outputs/index.json +16 -0
- package/agents/tryout/processing/stamp-note.example-outputs/output.json +10 -0
- package/agents/tryout/steps/echo-stamp.mjs +11 -0
- package/agents/tryout/steps/name-label.mjs +8 -0
- package/agents/tryout/steps/stamp-note.mjs +11 -0
- package/dist/blocks.d.ts +20 -0
- package/dist/blocks.d.ts.map +1 -0
- package/dist/blocks.js +80 -0
- package/dist/blocks.js.map +1 -0
- package/dist/create-memorix-skills.d.ts.map +1 -1
- package/dist/create-memorix-skills.js +8 -5
- package/dist/create-memorix-skills.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +4 -4
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +27 -14
- package/dist/internal.js.map +1 -1
- package/dist/shared-packs.d.ts +15 -0
- package/dist/shared-packs.d.ts.map +1 -0
- package/dist/shared-packs.js +63 -0
- package/dist/shared-packs.js.map +1 -0
- package/dist/skills.d.ts +12 -3
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +39 -30
- package/dist/skills.js.map +1 -1
- package/package.json +3 -3
- /package/{internal → agents/system/internal}/audit-prompt.md +0 -0
- /package/{internal → agents/system/internal}/audit-result.md +0 -0
- /package/{internal → agents/system/internal}/fix-attempt.md +0 -0
- /package/{internal → agents/system/internal}/improve-prompt.md +0 -0
- /package/{internal → agents/system/internal}/investigate-audit.md +0 -0
- /package/{internal → agents/system/internal}/investigate-context.md +0 -0
- /package/{internal → agents/system/internal}/investigate-contract.md +0 -0
- /package/{internal → agents/system/internal}/investigate-execution.md +0 -0
- /package/{internal → agents/system/internal}/investigate-inputs.md +0 -0
- /package/{internal → agents/system/internal}/investigate-instructions.md +0 -0
- /package/{internal → agents/system/internal}/investigate-provenance.md +0 -0
- /package/{internal → agents/system/internal}/investigate-response.md +0 -0
- /package/{internal → agents/system/internal}/investigate-synthesis.md +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "memorix.process/v2",
|
|
3
|
+
"id": "record-brief",
|
|
4
|
+
"title": "Record brief",
|
|
5
|
+
"description": "Normalize a note, index its terms, and optionally summarize it. The count is one run-level checkpoint.",
|
|
6
|
+
"initiation": [
|
|
7
|
+
{ "objectType": "note", "contentType": "note", "events": ["created", "updated"] }
|
|
8
|
+
],
|
|
9
|
+
"entryNodes": ["normalize-note", "index-terms"],
|
|
10
|
+
"nodes": [
|
|
11
|
+
{
|
|
12
|
+
"id": "normalize-note",
|
|
13
|
+
"label": "Normalize a note",
|
|
14
|
+
"kind": "module",
|
|
15
|
+
"module": "./steps/normalize-note.mjs",
|
|
16
|
+
"scope": "subject",
|
|
17
|
+
"activation": "always",
|
|
18
|
+
"objectType": "note",
|
|
19
|
+
"queryContentType": "note",
|
|
20
|
+
"reads": {
|
|
21
|
+
"required": [{ "contentType": "note", "requiredFields": ["body"] }],
|
|
22
|
+
"optional": [{ "contentType": "attachment" }]
|
|
23
|
+
},
|
|
24
|
+
"output": {
|
|
25
|
+
"contentType": "brief",
|
|
26
|
+
"discriminator": "normalized",
|
|
27
|
+
"persistence": "derived",
|
|
28
|
+
"contract": {
|
|
29
|
+
"version": "normalize-1",
|
|
30
|
+
"properties": [
|
|
31
|
+
{ "name": "title", "path": "data.title", "type": "string", "required": true },
|
|
32
|
+
{ "name": "body", "path": "data.body", "type": "string", "required": true }
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "index-terms",
|
|
39
|
+
"label": "Index note terms",
|
|
40
|
+
"kind": "module",
|
|
41
|
+
"module": "./steps/index-terms.mjs",
|
|
42
|
+
"scope": "subject",
|
|
43
|
+
"activation": "always",
|
|
44
|
+
"objectType": "note",
|
|
45
|
+
"queryContentType": "note",
|
|
46
|
+
"reads": {
|
|
47
|
+
"required": [{ "contentType": "note", "requiredFields": ["body"] }],
|
|
48
|
+
"optional": []
|
|
49
|
+
},
|
|
50
|
+
"output": {
|
|
51
|
+
"contentType": "brief",
|
|
52
|
+
"discriminator": "terms",
|
|
53
|
+
"persistence": "derived",
|
|
54
|
+
"contract": {
|
|
55
|
+
"version": "terms-1",
|
|
56
|
+
"properties": [{ "name": "terms", "path": "data.terms", "type": "list", "required": true }]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "summarize-note",
|
|
62
|
+
"label": "Summarize a note",
|
|
63
|
+
"kind": "module",
|
|
64
|
+
"module": "./steps/summarize-note.mjs",
|
|
65
|
+
"scope": "subject",
|
|
66
|
+
"activation": "operator",
|
|
67
|
+
"objectType": "note",
|
|
68
|
+
"reads": {
|
|
69
|
+
"required": [
|
|
70
|
+
{
|
|
71
|
+
"contentType": "brief",
|
|
72
|
+
"discriminator": "normalized",
|
|
73
|
+
"from": "normalize-note",
|
|
74
|
+
"requiredFields": ["title", "body"]
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"optional": []
|
|
78
|
+
},
|
|
79
|
+
"ai": {
|
|
80
|
+
"prompt": "summarize.md",
|
|
81
|
+
"maxCalls": 2,
|
|
82
|
+
"profile": "summary",
|
|
83
|
+
"reasoningEffort": "low"
|
|
84
|
+
},
|
|
85
|
+
"output": {
|
|
86
|
+
"contentType": "brief",
|
|
87
|
+
"discriminator": "summary",
|
|
88
|
+
"persistence": "derived",
|
|
89
|
+
"contract": {
|
|
90
|
+
"version": "summary-1",
|
|
91
|
+
"text": "A summary and a tone, each grounded in the note body.",
|
|
92
|
+
"properties": [
|
|
93
|
+
{ "name": "summary", "path": "data.summary", "type": "string", "required": true },
|
|
94
|
+
{ "name": "tone", "path": "data.tone", "type": "string", "required": true }
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "count-briefs",
|
|
101
|
+
"label": "Count normalized notes",
|
|
102
|
+
"kind": "module",
|
|
103
|
+
"module": "./steps/count-briefs.mjs",
|
|
104
|
+
"scope": "run",
|
|
105
|
+
"activation": "always",
|
|
106
|
+
"checkpoint": true,
|
|
107
|
+
"gate": true,
|
|
108
|
+
"readers": ["briefs"],
|
|
109
|
+
"output": {
|
|
110
|
+
"contentType": "brief-count",
|
|
111
|
+
"objectType": "collection",
|
|
112
|
+
"recordId": "collection",
|
|
113
|
+
"persistence": "derived",
|
|
114
|
+
"contract": {
|
|
115
|
+
"version": "count-1",
|
|
116
|
+
"properties": [{ "name": "count", "path": "data.count", "type": "integer", "required": true }]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"edges": [
|
|
122
|
+
{ "id": "normalize-summarize", "from": "normalize-note", "to": "summarize-note", "on": "succeeded" },
|
|
123
|
+
{
|
|
124
|
+
"id": "summary-when-long",
|
|
125
|
+
"module": "./edges/summary-when-long.mjs",
|
|
126
|
+
"from": "normalize-note",
|
|
127
|
+
"to": "summarize-note",
|
|
128
|
+
"readers": ["notes"]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": "brief-ready",
|
|
132
|
+
"kind": "join",
|
|
133
|
+
"mode": "all",
|
|
134
|
+
"from": ["normalize-note", "index-terms"],
|
|
135
|
+
"to": "count-briefs"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"phases": [
|
|
139
|
+
{ "id": "prepare", "label": "Prepare", "steps": ["normalize-note", "index-terms"] },
|
|
140
|
+
{ "id": "summarize", "label": "Summarize", "steps": ["summarize-note"] },
|
|
141
|
+
{ "id": "publish", "label": "Publish", "steps": ["count-briefs"] }
|
|
142
|
+
]
|
|
143
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"packId": "record-brief",
|
|
3
|
+
"skill": "count-briefs",
|
|
4
|
+
"subjects": [
|
|
5
|
+
{
|
|
6
|
+
"id": "collection",
|
|
7
|
+
"objectType": "collection",
|
|
8
|
+
"contentType": "brief-count",
|
|
9
|
+
"recordId": "collection",
|
|
10
|
+
"documents": [
|
|
11
|
+
{
|
|
12
|
+
"objectType": "collection",
|
|
13
|
+
"contentType": "brief-count",
|
|
14
|
+
"recordId": "collection",
|
|
15
|
+
"file": "output.json"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"absent": []
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"packId": "record-brief",
|
|
3
|
+
"skill": "index-terms",
|
|
4
|
+
"subjects": [
|
|
5
|
+
{
|
|
6
|
+
"id": "note",
|
|
7
|
+
"objectType": "note",
|
|
8
|
+
"contentType": "brief",
|
|
9
|
+
"recordId": "fx-note",
|
|
10
|
+
"documents": [
|
|
11
|
+
{
|
|
12
|
+
"objectType": "note",
|
|
13
|
+
"contentType": "brief",
|
|
14
|
+
"recordId": "fx-note",
|
|
15
|
+
"file": "output.json"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"absent": []
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"packId": "record-brief",
|
|
3
|
+
"skill": "normalize-note",
|
|
4
|
+
"subjects": [
|
|
5
|
+
{
|
|
6
|
+
"id": "note",
|
|
7
|
+
"objectType": "note",
|
|
8
|
+
"contentType": "brief",
|
|
9
|
+
"recordId": "fx-note",
|
|
10
|
+
"documents": [
|
|
11
|
+
{
|
|
12
|
+
"objectType": "note",
|
|
13
|
+
"contentType": "brief",
|
|
14
|
+
"recordId": "fx-note",
|
|
15
|
+
"file": "output.json"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"absent": []
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"packId": "record-brief",
|
|
3
|
+
"skill": "summarize-note",
|
|
4
|
+
"subjects": [
|
|
5
|
+
{
|
|
6
|
+
"id": "note",
|
|
7
|
+
"objectType": "note",
|
|
8
|
+
"contentType": "brief",
|
|
9
|
+
"recordId": "fx-note",
|
|
10
|
+
"documents": [
|
|
11
|
+
{
|
|
12
|
+
"objectType": "note",
|
|
13
|
+
"contentType": "brief",
|
|
14
|
+
"recordId": "fx-note",
|
|
15
|
+
"file": "output.json"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"absent": []
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Write a short summary of the note and name its tone. Use only the note body.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Behavior only. The process contract is process.json. */
|
|
2
|
+
export async function run(ctx) {
|
|
3
|
+
const rows = await ctx.readers.briefs({ objectType: "note", contentType: "brief" });
|
|
4
|
+
const count = rows.filter((row) => row.data?.kind === "normalized").length;
|
|
5
|
+
return { outcome: "emit", data: { count, coverage: "aggregate" } };
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Behavior only. The process contract is process.json. */
|
|
2
|
+
export async function run(ctx) {
|
|
3
|
+
const body = String(ctx.inputs.note?.data?.body ?? "");
|
|
4
|
+
const terms = [...new Set(body.toLowerCase().split(/[^a-z0-9]+/).filter((word) => word.length > 3))].sort();
|
|
5
|
+
return { outcome: "emit", data: { kind: "terms", terms, coverage: terms.length ? "indexed" : "none" } };
|
|
6
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Behavior only. The process contract is process.json. */
|
|
2
|
+
export async function run(ctx) {
|
|
3
|
+
const note = ctx.inputs.note?.data ?? {};
|
|
4
|
+
const body = String(note.body ?? "").trim();
|
|
5
|
+
const title = String(note.title ?? body.slice(0, 48)).trim();
|
|
6
|
+
const attachment = ctx.inputs["attachment:optional"];
|
|
7
|
+
return {
|
|
8
|
+
outcome: "emit",
|
|
9
|
+
data: {
|
|
10
|
+
kind: "normalized",
|
|
11
|
+
title,
|
|
12
|
+
body,
|
|
13
|
+
coverage: attachment?.status === "ok" ? "with-attachment" : "note-only",
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** Behavior only. The process contract is process.json. */
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const prompt = readFileSync(join(dirname(fileURLToPath(import.meta.url)), "../prompts/summarize.md"), "utf8");
|
|
7
|
+
|
|
8
|
+
export async function run(ctx) {
|
|
9
|
+
const evidence = {
|
|
10
|
+
title: ctx.inputs.brief?.data?.title,
|
|
11
|
+
body: ctx.inputs.brief?.data?.body,
|
|
12
|
+
};
|
|
13
|
+
const summary = await ctx.ai.complete({
|
|
14
|
+
promptId: "summarize",
|
|
15
|
+
prompt,
|
|
16
|
+
evidence,
|
|
17
|
+
contract: { properties: [{ name: "summary", required: true }] },
|
|
18
|
+
profile: ctx.step.ai?.profile,
|
|
19
|
+
reasoningEffort: ctx.step.ai?.reasoningEffort,
|
|
20
|
+
});
|
|
21
|
+
const tone = await ctx.ai.complete({
|
|
22
|
+
promptId: "summarize-tone",
|
|
23
|
+
prompt,
|
|
24
|
+
evidence,
|
|
25
|
+
contract: { properties: [{ name: "tone", required: true }] },
|
|
26
|
+
profile: ctx.step.ai?.profile,
|
|
27
|
+
reasoningEffort: ctx.step.ai?.reasoningEffort,
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
outcome: "emit",
|
|
31
|
+
data: {
|
|
32
|
+
kind: "summary",
|
|
33
|
+
summary: summary.data?.summary,
|
|
34
|
+
tone: tone.data?.tone,
|
|
35
|
+
coverage: "model",
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# System
|
|
2
|
+
|
|
3
|
+
The platform's own agent. It holds the helper actions the host runs for every pack: audit a prompt, audit a result, improve a prompt, investigate a failed result, and prepare a fix. Those actions are not steps in Neo Networks, Record Brief, or Evidence Summary.
|
|
4
|
+
|
|
5
|
+
A domain pack does not keep a copy. A file under a domain `internal/` folder is ignored. This folder ships inside `@x12i/memorix-skills`. A `system` folder placed beside a running pack replaces a file here that has the same key. The other actions stay the ones in this folder.
|
|
6
|
+
|
|
7
|
+
This folder is not a process you start. It has no `process.json`, so a save does not run it and it is not a job target.
|
|
8
|
+
|
|
9
|
+
## Actions
|
|
10
|
+
|
|
11
|
+
Files in `internal/` are helper calls. `loadSkill` does not return them. `runInternal` renders the file and calls the dispatcher. The answer is not written as a business record.
|
|
12
|
+
|
|
13
|
+
| Key | Input |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `audit-prompt` | `prompt` |
|
|
16
|
+
| `audit-result` | `prompt`, `result` |
|
|
17
|
+
| `improve-prompt` | `prompt` |
|
|
18
|
+
| `investigate-response` | `packet` |
|
|
19
|
+
| `investigate-instructions` | `packet` |
|
|
20
|
+
| `investigate-execution` | `packet` |
|
|
21
|
+
| `investigate-inputs` | `packet` |
|
|
22
|
+
| `investigate-context` | `packet` |
|
|
23
|
+
| `investigate-audit` | `packet` |
|
|
24
|
+
| `investigate-contract` | `packet` |
|
|
25
|
+
| `investigate-provenance` | `packet` |
|
|
26
|
+
| `investigate-synthesis` | `packet` |
|
|
27
|
+
| `fix-attempt` | `packet` |
|
|
28
|
+
|
|
29
|
+
## What any pack can use
|
|
30
|
+
|
|
31
|
+
A step or a skill run looks in the domain pack first, then `foundation`, then this pack.
|
|
32
|
+
|
|
33
|
+
- A processing, auditing, or code skill is loaded by its key. A code skill is `code/{key}.mjs` exporting `run`.
|
|
34
|
+
- A block is `blocks/{name}.md`, inserted with `{{block:name.md}}`.
|
|
35
|
+
- An internal action is a file in this pack. The domain pack cannot replace it. A sibling `system` folder can replace one key.
|
|
36
|
+
|
|
37
|
+
A published package stores a snapshot of this folder and of `foundation` under `shared/`. That snapshot is what the published run uses. The next publish picks up a later edit.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Tryout
|
|
2
|
+
|
|
3
|
+
A three-step pack for tests and examples. It is not the network sequence.
|
|
4
|
+
|
|
5
|
+
`stamp-note` reads the note inventory. That note's `data.labelId` points at the label. `name-label` reads the label. `echo-stamp` reads the stamp `stamp-note` wrote.
|
|
6
|
+
|
|
7
|
+
The seed is `fixtures/tryout.json`. Replay writes each sample in phase order and does not call a model.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"packId": "tryout",
|
|
3
|
+
"processId": "tryout",
|
|
4
|
+
"subjects": [
|
|
5
|
+
{ "recordId": "fx-note", "objectType": "note" },
|
|
6
|
+
{ "recordId": "fx-label", "objectType": "label" }
|
|
7
|
+
],
|
|
8
|
+
"documents": [
|
|
9
|
+
{
|
|
10
|
+
"objectType": "note",
|
|
11
|
+
"contentType": "inventory",
|
|
12
|
+
"recordId": "fx-note",
|
|
13
|
+
"data": {
|
|
14
|
+
"title": "Door",
|
|
15
|
+
"labelId": "fx-label"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"objectType": "label",
|
|
20
|
+
"contentType": "inventory",
|
|
21
|
+
"recordId": "fx-label",
|
|
22
|
+
"data": { "name": "Lobby" }
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"relations": [
|
|
26
|
+
{ "from": "fx-note", "field": "data.labelId", "to": "fx-label" }
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "memorix.process/v2",
|
|
3
|
+
"id": "tryout",
|
|
4
|
+
"title": "Tryout",
|
|
5
|
+
"description": "Two reads and one follow-up. A note points at a label. Use this pack to try a closed process without the network sequence.",
|
|
6
|
+
"initiation": [
|
|
7
|
+
{ "objectType": "note", "contentType": "inventory", "events": ["created", "updated"] },
|
|
8
|
+
{ "objectType": "label", "contentType": "inventory", "events": ["created", "updated"] }
|
|
9
|
+
],
|
|
10
|
+
"entryNodes": ["stamp-note", "name-label"],
|
|
11
|
+
"nodes": [
|
|
12
|
+
{
|
|
13
|
+
"id": "stamp-note",
|
|
14
|
+
"label": "Stamp the note",
|
|
15
|
+
"kind": "module",
|
|
16
|
+
"module": "./steps/stamp-note.mjs",
|
|
17
|
+
"scope": "subject",
|
|
18
|
+
"activation": "always",
|
|
19
|
+
"objectType": "note",
|
|
20
|
+
"queryContentType": "inventory",
|
|
21
|
+
"reads": {
|
|
22
|
+
"required": [{ "contentType": "inventory" }],
|
|
23
|
+
"optional": []
|
|
24
|
+
},
|
|
25
|
+
"output": {
|
|
26
|
+
"contentType": "stamp",
|
|
27
|
+
"persistence": "derived",
|
|
28
|
+
"contract": {
|
|
29
|
+
"properties": [
|
|
30
|
+
{ "name": "title", "path": "data.title", "type": "string", "required": true },
|
|
31
|
+
{ "name": "labelId", "path": "data.labelId", "type": "string", "required": true }
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "name-label",
|
|
38
|
+
"label": "Name the label",
|
|
39
|
+
"kind": "module",
|
|
40
|
+
"module": "./steps/name-label.mjs",
|
|
41
|
+
"scope": "subject",
|
|
42
|
+
"activation": "always",
|
|
43
|
+
"objectType": "label",
|
|
44
|
+
"queryContentType": "inventory",
|
|
45
|
+
"reads": {
|
|
46
|
+
"required": [{ "contentType": "inventory" }],
|
|
47
|
+
"optional": []
|
|
48
|
+
},
|
|
49
|
+
"output": {
|
|
50
|
+
"contentType": "name",
|
|
51
|
+
"persistence": "derived",
|
|
52
|
+
"contract": {
|
|
53
|
+
"properties": [
|
|
54
|
+
{ "name": "name", "path": "data.name", "type": "string", "required": true }
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "echo-stamp",
|
|
61
|
+
"label": "Echo the stamp",
|
|
62
|
+
"kind": "module",
|
|
63
|
+
"module": "./steps/echo-stamp.mjs",
|
|
64
|
+
"scope": "subject",
|
|
65
|
+
"activation": "always",
|
|
66
|
+
"objectType": "note",
|
|
67
|
+
"queryContentType": "stamp",
|
|
68
|
+
"reads": {
|
|
69
|
+
"required": [{ "contentType": "stamp", "from": "stamp-note" }],
|
|
70
|
+
"optional": []
|
|
71
|
+
},
|
|
72
|
+
"output": {
|
|
73
|
+
"contentType": "echo",
|
|
74
|
+
"persistence": "derived",
|
|
75
|
+
"contract": {
|
|
76
|
+
"properties": [
|
|
77
|
+
{ "name": "title", "path": "data.title", "type": "string", "required": true },
|
|
78
|
+
{ "name": "labelId", "path": "data.labelId", "type": "string", "required": true }
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"phases": [
|
|
85
|
+
{ "id": "read", "label": "Read", "steps": ["stamp-note", "name-label"] },
|
|
86
|
+
{ "id": "close", "label": "Close", "steps": ["echo-stamp"] }
|
|
87
|
+
]
|
|
88
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"packId": "tryout",
|
|
3
|
+
"skill": "echo-stamp",
|
|
4
|
+
"subjects": [
|
|
5
|
+
{
|
|
6
|
+
"id": "note",
|
|
7
|
+
"objectType": "note",
|
|
8
|
+
"contentType": "echo",
|
|
9
|
+
"recordId": "fx-note",
|
|
10
|
+
"documents": [
|
|
11
|
+
{ "objectType": "note", "contentType": "echo", "recordId": "fx-note", "file": "output.json" }
|
|
12
|
+
],
|
|
13
|
+
"absent": []
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"packId": "tryout",
|
|
3
|
+
"skill": "name-label",
|
|
4
|
+
"subjects": [
|
|
5
|
+
{
|
|
6
|
+
"id": "label",
|
|
7
|
+
"objectType": "label",
|
|
8
|
+
"contentType": "name",
|
|
9
|
+
"recordId": "fx-label",
|
|
10
|
+
"documents": [
|
|
11
|
+
{ "objectType": "label", "contentType": "name", "recordId": "fx-label", "file": "output.json" }
|
|
12
|
+
],
|
|
13
|
+
"absent": []
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"packId": "tryout",
|
|
3
|
+
"skill": "stamp-note",
|
|
4
|
+
"subjects": [
|
|
5
|
+
{
|
|
6
|
+
"id": "note",
|
|
7
|
+
"objectType": "note",
|
|
8
|
+
"contentType": "stamp",
|
|
9
|
+
"recordId": "fx-note",
|
|
10
|
+
"documents": [
|
|
11
|
+
{ "objectType": "note", "contentType": "stamp", "recordId": "fx-note", "file": "output.json" }
|
|
12
|
+
],
|
|
13
|
+
"absent": []
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Repeat the stamp the earlier step wrote. */
|
|
2
|
+
export async function run(ctx) {
|
|
3
|
+
const stamp = ctx.inputs.stamp?.data ?? {};
|
|
4
|
+
return {
|
|
5
|
+
outcome: "emit",
|
|
6
|
+
data: {
|
|
7
|
+
title: String(stamp.title ?? "").trim(),
|
|
8
|
+
labelId: String(stamp.labelId ?? "").trim(),
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Copy the note title and the label it points at. */
|
|
2
|
+
export async function run(ctx) {
|
|
3
|
+
const note = ctx.inputs.inventory?.data ?? {};
|
|
4
|
+
return {
|
|
5
|
+
outcome: "emit",
|
|
6
|
+
data: {
|
|
7
|
+
title: String(note.title ?? "").trim(),
|
|
8
|
+
labelId: String(note.labelId ?? "").trim(),
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
}
|
package/dist/blocks.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare class BlockNotFoundError extends Error {
|
|
2
|
+
readonly code = "BLOCK_NOT_FOUND";
|
|
3
|
+
readonly block: string;
|
|
4
|
+
constructor(block: string, skillsDir: string);
|
|
5
|
+
}
|
|
6
|
+
export declare class BlockCycleError extends Error {
|
|
7
|
+
readonly code = "BLOCK_CYCLE";
|
|
8
|
+
readonly block: string;
|
|
9
|
+
constructor(block: string);
|
|
10
|
+
}
|
|
11
|
+
export declare class InvalidBlockNameError extends Error {
|
|
12
|
+
readonly code = "INVALID_BLOCK_NAME";
|
|
13
|
+
readonly block: string;
|
|
14
|
+
constructor(block: string);
|
|
15
|
+
}
|
|
16
|
+
export declare function assertBlockName(block: string): void;
|
|
17
|
+
export declare function resolveBlock(block: string, skillsDir: string, agentsRoot?: string): string | undefined;
|
|
18
|
+
/** Replace block tokens with file text. Does not call Rendrix. */
|
|
19
|
+
export declare function expandBlocks(template: string, skillsDir: string, agentsRoot?: string): string;
|
|
20
|
+
//# sourceMappingURL=blocks.d.ts.map
|