@runcore-sh/runcore 0.1.9 → 0.2.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.
Files changed (214) hide show
  1. package/brain-template/agents/cooldowns.json +1 -0
  2. package/brain-template/agents/locks.json +1 -0
  3. package/brain-template/agents/module.json +15 -0
  4. package/brain-template/agents/workflows/examples/conditional-deploy.json +124 -0
  5. package/brain-template/agents/workflows/examples/parallel-analysis.json +81 -0
  6. package/brain-template/agents/workflows/examples/research-and-write.json +71 -0
  7. package/brain-template/agents/workflows/schema.json +236 -0
  8. package/brain-template/contacts/README.md +22 -0
  9. package/brain-template/contacts/module.json +19 -0
  10. package/brain-template/content/CONTENT.md +36 -0
  11. package/brain-template/content/templates/blog.md +26 -0
  12. package/brain-template/knowledge/README.md +11 -0
  13. package/brain-template/library/README.md +29 -0
  14. package/brain-template/library/module.json +29 -0
  15. package/brain-template/memory/README.md +17 -0
  16. package/brain-template/metrics/module.json +7 -0
  17. package/brain-template/operations/OPERATIONS.md +28 -0
  18. package/brain-template/ops/module.json +8 -0
  19. package/brain-template/registry.md +566 -0
  20. package/brain-template/rest_api-integration.md +522 -0
  21. package/brain-template/scheduling/README.md +23 -0
  22. package/brain-template/scheduling/module.json +16 -0
  23. package/brain-template/settings.json +60 -0
  24. package/brain-template/skills/debugging.yml +152 -0
  25. package/brain-template/skills/file-editing.yml +148 -0
  26. package/brain-template/skills/git-operations.yml +131 -0
  27. package/brain-template/skills/schema.yml +286 -0
  28. package/brain-template/skills/testing.yml +170 -0
  29. package/brain-template/skills/web-scraping.yml +178 -0
  30. package/brain-template/templates/instances.yaml +70 -0
  31. package/brain-template/templates/spawn-policy.yaml +36 -0
  32. package/brain-template/templates/vault.policy.yaml +37 -0
  33. package/brain-template/training/module.json +14 -0
  34. package/dictionary.json +38 -0
  35. package/dist/access/manifest.js +2 -2
  36. package/dist/access/manifest.js.map +1 -1
  37. package/dist/activity/log.d.ts.map +1 -1
  38. package/dist/activity/log.js +2 -1
  39. package/dist/activity/log.js.map +1 -1
  40. package/dist/agents/cooldown.d.ts.map +1 -1
  41. package/dist/agents/cooldown.js +2 -1
  42. package/dist/agents/cooldown.js.map +1 -1
  43. package/dist/agents/governance.js +16 -16
  44. package/dist/agents/governance.js.map +1 -1
  45. package/dist/agents/heartbeat.d.ts.map +1 -1
  46. package/dist/agents/heartbeat.js +3 -2
  47. package/dist/agents/heartbeat.js.map +1 -1
  48. package/dist/agents/locks.js +2 -2
  49. package/dist/agents/locks.js.map +1 -1
  50. package/dist/agents/memory.d.ts.map +1 -1
  51. package/dist/agents/memory.js +2 -1
  52. package/dist/agents/memory.js.map +1 -1
  53. package/dist/agents/reflection.d.ts.map +1 -1
  54. package/dist/agents/reflection.js +25 -24
  55. package/dist/agents/reflection.js.map +1 -1
  56. package/dist/agents/runtime/config.d.ts.map +1 -1
  57. package/dist/agents/runtime/config.js +2 -1
  58. package/dist/agents/runtime/config.js.map +1 -1
  59. package/dist/agents/spawn-policy.js +2 -2
  60. package/dist/agents/spawn-policy.js.map +1 -1
  61. package/dist/agents/spawn.d.ts.map +1 -1
  62. package/dist/agents/spawn.js +54 -53
  63. package/dist/agents/spawn.js.map +1 -1
  64. package/dist/agents/store.d.ts.map +1 -1
  65. package/dist/agents/store.js +20 -20
  66. package/dist/agents/store.js.map +1 -1
  67. package/dist/agents/workflow.d.ts.map +1 -1
  68. package/dist/agents/workflow.js +2 -1
  69. package/dist/agents/workflow.js.map +1 -1
  70. package/dist/auth/identity.d.ts.map +1 -1
  71. package/dist/auth/identity.js +2 -1
  72. package/dist/auth/identity.js.map +1 -1
  73. package/dist/browser/sessions.d.ts.map +1 -1
  74. package/dist/browser/sessions.js +2 -1
  75. package/dist/browser/sessions.js.map +1 -1
  76. package/dist/cli.js +274 -53
  77. package/dist/cli.js.map +1 -1
  78. package/dist/distiller.js +2 -2
  79. package/dist/distiller.js.map +1 -1
  80. package/dist/files/deep-index.d.ts +59 -0
  81. package/dist/files/deep-index.d.ts.map +1 -0
  82. package/dist/files/deep-index.js +337 -0
  83. package/dist/files/deep-index.js.map +1 -0
  84. package/dist/files/import.d.ts +44 -0
  85. package/dist/files/import.d.ts.map +1 -0
  86. package/dist/files/import.js +213 -0
  87. package/dist/files/import.js.map +1 -0
  88. package/dist/files/index-local.d.ts +37 -0
  89. package/dist/files/index-local.d.ts.map +1 -0
  90. package/dist/files/index-local.js +198 -0
  91. package/dist/files/index-local.js.map +1 -0
  92. package/dist/goals/loop.js +31 -31
  93. package/dist/goals/loop.js.map +1 -1
  94. package/dist/goals/notifications.d.ts.map +1 -1
  95. package/dist/goals/notifications.js +2 -1
  96. package/dist/goals/notifications.js.map +1 -1
  97. package/dist/instance.d.ts.map +1 -1
  98. package/dist/instance.js +2 -1
  99. package/dist/instance.js.map +1 -1
  100. package/dist/lib/audit.js +1 -1
  101. package/dist/lib/audit.js.map +1 -1
  102. package/dist/lib/locked.js +2 -2
  103. package/dist/lib/locked.js.map +1 -1
  104. package/dist/lib/paths.d.ts +11 -0
  105. package/dist/lib/paths.d.ts.map +1 -0
  106. package/dist/lib/paths.js +13 -0
  107. package/dist/lib/paths.js.map +1 -0
  108. package/dist/mcp-server.js +1 -1
  109. package/dist/mcp-server.js.map +1 -1
  110. package/dist/memory/visual.d.ts.map +1 -1
  111. package/dist/memory/visual.js +2 -1
  112. package/dist/memory/visual.js.map +1 -1
  113. package/dist/metrics/system.d.ts.map +1 -1
  114. package/dist/metrics/system.js +2 -1
  115. package/dist/metrics/system.js.map +1 -1
  116. package/dist/nerve/push.js +2 -2
  117. package/dist/nerve/push.js.map +1 -1
  118. package/dist/nerve/state.d.ts +1 -1
  119. package/dist/nerve/state.d.ts.map +1 -1
  120. package/dist/nerve/state.js +3 -3
  121. package/dist/nerve/state.js.map +1 -1
  122. package/dist/openloop/scanner.d.ts.map +1 -1
  123. package/dist/openloop/scanner.js +11 -10
  124. package/dist/openloop/scanner.js.map +1 -1
  125. package/dist/openloop/store.d.ts.map +1 -1
  126. package/dist/openloop/store.js +3 -2
  127. package/dist/openloop/store.js.map +1 -1
  128. package/dist/posture/engine.d.ts +41 -0
  129. package/dist/posture/engine.d.ts.map +1 -0
  130. package/dist/posture/engine.js +217 -0
  131. package/dist/posture/engine.js.map +1 -0
  132. package/dist/posture/index.d.ts +11 -0
  133. package/dist/posture/index.d.ts.map +1 -0
  134. package/dist/posture/index.js +10 -0
  135. package/dist/posture/index.js.map +1 -0
  136. package/dist/posture/middleware.d.ts +30 -0
  137. package/dist/posture/middleware.d.ts.map +1 -0
  138. package/dist/posture/middleware.js +92 -0
  139. package/dist/posture/middleware.js.map +1 -0
  140. package/dist/posture/types.d.ts +61 -0
  141. package/dist/posture/types.d.ts.map +1 -0
  142. package/dist/posture/types.js +48 -0
  143. package/dist/posture/types.js.map +1 -0
  144. package/dist/pulse/activation-log.js +1 -2
  145. package/dist/pulse/activation-log.js.map +1 -1
  146. package/dist/pulse/pressure.d.ts.map +1 -1
  147. package/dist/pulse/pressure.js +2 -1
  148. package/dist/pulse/pressure.js.map +1 -1
  149. package/dist/queue/grooming.d.ts.map +1 -1
  150. package/dist/queue/grooming.js +2 -2
  151. package/dist/queue/grooming.js.map +1 -1
  152. package/dist/resend/inbox.d.ts.map +1 -1
  153. package/dist/resend/inbox.js +2 -1
  154. package/dist/resend/inbox.js.map +1 -1
  155. package/dist/search/brain-docs.js +1 -2
  156. package/dist/search/brain-docs.js.map +1 -1
  157. package/dist/server.d.ts +3 -1
  158. package/dist/server.d.ts.map +1 -1
  159. package/dist/server.js +221 -75
  160. package/dist/server.js.map +1 -1
  161. package/dist/services/backup.js +1 -1
  162. package/dist/services/backup.js.map +1 -1
  163. package/dist/services/morningBriefing.d.ts.map +1 -1
  164. package/dist/services/morningBriefing.js +46 -45
  165. package/dist/services/morningBriefing.js.map +1 -1
  166. package/dist/services/traceInsights.js +31 -31
  167. package/dist/services/traceInsights.js.map +1 -1
  168. package/dist/services/training.js +1 -1
  169. package/dist/services/training.js.map +1 -1
  170. package/dist/services/whatsapp.js +1 -1
  171. package/dist/services/whatsapp.js.map +1 -1
  172. package/dist/sessions/store.d.ts.map +1 -1
  173. package/dist/sessions/store.js +2 -1
  174. package/dist/sessions/store.js.map +1 -1
  175. package/dist/settings.d.ts.map +1 -1
  176. package/dist/settings.js +2 -1
  177. package/dist/settings.js.map +1 -1
  178. package/dist/tier/bond.d.ts +51 -0
  179. package/dist/tier/bond.d.ts.map +1 -0
  180. package/dist/tier/bond.js +154 -0
  181. package/dist/tier/bond.js.map +1 -0
  182. package/dist/tier/freeze.d.ts +21 -0
  183. package/dist/tier/freeze.d.ts.map +1 -0
  184. package/dist/tier/freeze.js +73 -0
  185. package/dist/tier/freeze.js.map +1 -0
  186. package/dist/tier/gate.d.ts +11 -0
  187. package/dist/tier/gate.d.ts.map +1 -0
  188. package/dist/tier/gate.js +25 -0
  189. package/dist/tier/gate.js.map +1 -0
  190. package/dist/tier/heartbeat.d.ts +22 -0
  191. package/dist/tier/heartbeat.d.ts.map +1 -0
  192. package/dist/tier/heartbeat.js +128 -0
  193. package/dist/tier/heartbeat.js.map +1 -0
  194. package/dist/tier/token.d.ts +22 -0
  195. package/dist/tier/token.d.ts.map +1 -0
  196. package/dist/tier/token.js +100 -0
  197. package/dist/tier/token.js.map +1 -0
  198. package/dist/tier/types.d.ts +44 -0
  199. package/dist/tier/types.d.ts.map +1 -0
  200. package/dist/tier/types.js +61 -0
  201. package/dist/tier/types.js.map +1 -0
  202. package/dist/vault/personal.d.ts.map +1 -1
  203. package/dist/vault/personal.js +2 -1
  204. package/dist/vault/personal.js.map +1 -1
  205. package/dist/vault/policy.js +2 -2
  206. package/dist/vault/policy.js.map +1 -1
  207. package/dist/vault/store.d.ts.map +1 -1
  208. package/dist/vault/store.js +2 -1
  209. package/dist/vault/store.js.map +1 -1
  210. package/dist/vault/transfer.d.ts.map +1 -1
  211. package/dist/vault/transfer.js +4 -3
  212. package/dist/vault/transfer.js.map +1 -1
  213. package/package.json +5 -2
  214. package/public/pulse.html +592 -0
@@ -0,0 +1 @@
1
+ []
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "agents",
3
+ "description": "Agent runtime: spawned Claude Code agent tasks, execution logs, runtime state.",
4
+ "keywords": ["agent", "agents", "agent task", "agent status", "spawned"],
5
+ "files": [
6
+ { "path": "tasks/", "role": "data" },
7
+ { "path": "runtime/", "role": "data" },
8
+ { "path": "logs/", "role": "log" }
9
+ ],
10
+ "endpoints": [
11
+ { "path": "/api/agents/tasks", "method": "GET" },
12
+ { "path": "/api/runtime/status", "method": "GET" }
13
+ ],
14
+ "promptOrder": 55
15
+ }
@@ -0,0 +1,124 @@
1
+ {
2
+ "name": "conditional-deploy",
3
+ "version": "1.0.0",
4
+ "description": "Run tests, then branch based on results: deploy on success, diagnose on failure. Demonstrates conditional branching with stepStatus conditions, allOf/not combinators, and fallback recovery.",
5
+ "tags": ["deploy", "testing", "conditional"],
6
+ "inputs": {
7
+ "target": {
8
+ "type": "string",
9
+ "description": "Deployment target: 'staging' or 'production'.",
10
+ "required": true
11
+ },
12
+ "skipLint": {
13
+ "type": "boolean",
14
+ "description": "Skip the lint step.",
15
+ "default": false
16
+ }
17
+ },
18
+ "outputs": {
19
+ "result": {
20
+ "fromStep": "deploy",
21
+ "value": "output"
22
+ },
23
+ "diagnosis": {
24
+ "fromStep": "diagnose",
25
+ "value": "output"
26
+ }
27
+ },
28
+ "mode": "sequential",
29
+ "onFailure": {
30
+ "action": "continue"
31
+ },
32
+ "steps": [
33
+ {
34
+ "key": "lint",
35
+ "label": "Lint codebase",
36
+ "prompt": "Run linting checks on the codebase. Report any issues found with file paths and line numbers. Output PASS if clean, or FAIL with details.",
37
+ "condition": {
38
+ "not": {
39
+ "inputEquals": {
40
+ "input": "skipLint",
41
+ "value": true
42
+ }
43
+ }
44
+ },
45
+ "tags": ["quality"],
46
+ "timeoutMs": 120000
47
+ },
48
+ {
49
+ "key": "test",
50
+ "label": "Run test suite",
51
+ "prompt": "Run the full test suite. Report pass/fail counts and any failing test details. Summarize overall result as PASS or FAIL.",
52
+ "tags": ["testing"],
53
+ "retries": 1,
54
+ "timeoutMs": 300000
55
+ },
56
+ {
57
+ "key": "deploy",
58
+ "label": "Deploy to target",
59
+ "prompt": "Deploy the application to {{input.target}}. Verify the deployment was successful and report the deployed version and URL.",
60
+ "dependsOn": ["test"],
61
+ "condition": {
62
+ "allOf": [
63
+ {
64
+ "stepStatus": {
65
+ "step": "test",
66
+ "equals": "completed"
67
+ }
68
+ },
69
+ {
70
+ "anyOf": [
71
+ {
72
+ "stepStatus": {
73
+ "step": "lint",
74
+ "equals": "completed"
75
+ }
76
+ },
77
+ {
78
+ "stepStatus": {
79
+ "step": "lint",
80
+ "equals": "skipped"
81
+ }
82
+ }
83
+ ]
84
+ }
85
+ ]
86
+ },
87
+ "tags": ["deploy"],
88
+ "timeoutMs": 600000,
89
+ "onFailure": {
90
+ "action": "fallback",
91
+ "fallbackStep": "rollback"
92
+ }
93
+ },
94
+ {
95
+ "key": "diagnose",
96
+ "label": "Diagnose test failures",
97
+ "prompt": "The test suite failed. Analyze the test output and identify root causes:\n\nTest output:\n{{steps.test.error}}\n\nProvide a prioritized list of issues and suggested fixes.",
98
+ "dependsOn": ["test"],
99
+ "condition": {
100
+ "stepStatus": {
101
+ "step": "test",
102
+ "equals": "failed"
103
+ }
104
+ },
105
+ "tags": ["debugging"],
106
+ "timeoutMs": 180000
107
+ },
108
+ {
109
+ "key": "rollback",
110
+ "label": "Rollback deployment",
111
+ "prompt": "The deployment to {{input.target}} failed. Initiate a rollback to the previous stable version. Report the rollback status and any manual steps needed.",
112
+ "tags": ["deploy", "recovery"],
113
+ "timeoutMs": 300000
114
+ },
115
+ {
116
+ "key": "notify",
117
+ "label": "Send status notification",
118
+ "prompt": "Summarize the pipeline results:\n- Lint: {{steps.lint.status}}\n- Tests: {{steps.test.status}}\n- Deploy: {{steps.deploy.status}}\n- Diagnosis: {{steps.diagnose.status}}\n- Rollback: {{steps.rollback.status}}\n\nTarget: {{input.target}}\n\nCompose a concise status notification suitable for a team channel.",
119
+ "dependsOn": ["test"],
120
+ "tags": ["notification"],
121
+ "timeoutMs": 60000
122
+ }
123
+ ]
124
+ }
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "parallel-analysis",
3
+ "version": "1.0.0",
4
+ "description": "Analyze a codebase change from multiple angles in parallel (security, performance, architecture), then synthesize findings. Demonstrates parallel fan-out with dependency fan-in, conditional steps, and input-based gating.",
5
+ "tags": ["code-review", "analysis", "parallel"],
6
+ "inputs": {
7
+ "changeset": {
8
+ "type": "string",
9
+ "description": "Description of the code change or PR to analyze.",
10
+ "required": true
11
+ },
12
+ "includeSecurity": {
13
+ "type": "boolean",
14
+ "description": "Whether to run the security analysis pass.",
15
+ "default": true
16
+ },
17
+ "includePerformance": {
18
+ "type": "boolean",
19
+ "description": "Whether to run the performance analysis pass.",
20
+ "default": true
21
+ }
22
+ },
23
+ "outputs": {
24
+ "synthesis": {
25
+ "fromStep": "synthesize",
26
+ "value": "output"
27
+ }
28
+ },
29
+ "mode": "dependency",
30
+ "maxConcurrent": 3,
31
+ "onFailure": {
32
+ "action": "continue"
33
+ },
34
+ "steps": [
35
+ {
36
+ "key": "security",
37
+ "label": "Security analysis",
38
+ "prompt": "Perform a security review of the following code change:\n\n{{input.changeset}}\n\nCheck for: injection vulnerabilities, authentication/authorization gaps, data exposure risks, dependency vulnerabilities, and OWASP Top 10 issues. Output a structured report with severity ratings.",
39
+ "condition": {
40
+ "inputEquals": {
41
+ "input": "includeSecurity",
42
+ "value": true
43
+ }
44
+ },
45
+ "tags": ["security"],
46
+ "priority": 10,
47
+ "timeoutMs": 240000
48
+ },
49
+ {
50
+ "key": "performance",
51
+ "label": "Performance analysis",
52
+ "prompt": "Analyze the performance implications of the following code change:\n\n{{input.changeset}}\n\nEvaluate: time complexity changes, memory usage, I/O patterns, potential bottlenecks, and scalability concerns. Suggest optimizations where applicable.",
53
+ "condition": {
54
+ "inputEquals": {
55
+ "input": "includePerformance",
56
+ "value": true
57
+ }
58
+ },
59
+ "tags": ["performance"],
60
+ "priority": 20,
61
+ "timeoutMs": 240000
62
+ },
63
+ {
64
+ "key": "architecture",
65
+ "label": "Architecture review",
66
+ "prompt": "Review the architectural impact of the following code change:\n\n{{input.changeset}}\n\nAssess: adherence to existing patterns, coupling/cohesion changes, abstraction appropriateness, testability impact, and alignment with project conventions.",
67
+ "tags": ["architecture"],
68
+ "priority": 30,
69
+ "timeoutMs": 240000
70
+ },
71
+ {
72
+ "key": "synthesize",
73
+ "label": "Synthesize findings",
74
+ "prompt": "Synthesize the following analysis reports into a unified code review summary:\n\nSecurity Analysis:\n{{steps.security.output}}\n\nPerformance Analysis:\n{{steps.performance.output}}\n\nArchitecture Review:\n{{steps.architecture.output}}\n\nProduce a prioritized list of findings, an overall risk assessment, and actionable recommendations. Note which analyses were skipped (empty sections above).",
75
+ "dependsOn": ["security", "performance", "architecture"],
76
+ "tags": ["synthesis"],
77
+ "priority": 0,
78
+ "timeoutMs": 180000
79
+ }
80
+ ]
81
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "research-and-write",
3
+ "version": "1.0.0",
4
+ "description": "Research a topic, draft content based on findings, then review for quality. Demonstrates sequential dependency chains, template interpolation, and error recovery with fallback.",
5
+ "tags": ["content", "research", "writing"],
6
+ "inputs": {
7
+ "topic": {
8
+ "type": "string",
9
+ "description": "The topic to research and write about.",
10
+ "required": true
11
+ },
12
+ "format": {
13
+ "type": "string",
14
+ "description": "Output format: 'blog', 'memo', or 'summary'.",
15
+ "default": "blog"
16
+ }
17
+ },
18
+ "outputs": {
19
+ "draft": {
20
+ "fromStep": "write",
21
+ "value": "output"
22
+ },
23
+ "review": {
24
+ "fromStep": "review",
25
+ "value": "output"
26
+ }
27
+ },
28
+ "mode": "dependency",
29
+ "maxConcurrent": 2,
30
+ "onFailure": {
31
+ "action": "continue"
32
+ },
33
+ "steps": [
34
+ {
35
+ "key": "research",
36
+ "label": "Research topic",
37
+ "prompt": "Research the following topic thoroughly: {{input.topic}}\n\nGather key facts, recent developments, and relevant context. Output a structured research brief with sections: Overview, Key Points, Sources, and Open Questions.",
38
+ "tags": ["research"],
39
+ "retries": 1,
40
+ "timeoutMs": 300000,
41
+ "onFailure": {
42
+ "action": "fallback",
43
+ "fallbackStep": "research-lite"
44
+ }
45
+ },
46
+ {
47
+ "key": "research-lite",
48
+ "label": "Lightweight research fallback",
49
+ "prompt": "Provide a brief overview of: {{input.topic}}\n\nFocus on the most essential facts and context. Keep it concise — this is a fallback for when deep research fails.",
50
+ "tags": ["research", "fallback"],
51
+ "timeoutMs": 120000
52
+ },
53
+ {
54
+ "key": "write",
55
+ "label": "Draft content",
56
+ "prompt": "Using the following research:\n\n{{steps.research.output}}\n\nWrite a {{input.format}} about \"{{input.topic}}\". Follow the appropriate style and structure for the format. Make it engaging and well-organized.",
57
+ "dependsOn": ["research"],
58
+ "tags": ["writing"],
59
+ "retries": 1,
60
+ "timeoutMs": 300000
61
+ },
62
+ {
63
+ "key": "review",
64
+ "label": "Review and polish",
65
+ "prompt": "Review the following draft for accuracy, clarity, tone, and structure:\n\n{{steps.write.output}}\n\nProvide specific feedback and a revised version. Check facts against the research brief:\n\n{{steps.research.output}}",
66
+ "dependsOn": ["write"],
67
+ "tags": ["review", "editing"],
68
+ "timeoutMs": 180000
69
+ }
70
+ ]
71
+ }
@@ -0,0 +1,236 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://dash-brain.local/schemas/workflow.json",
4
+ "title": "Core Workflow Definition",
5
+ "description": "Defines a multi-step agent workflow with dependencies, conditional logic, and error recovery.",
6
+ "type": "object",
7
+ "required": ["name", "version", "steps"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "name": {
11
+ "type": "string",
12
+ "description": "Human-readable workflow name.",
13
+ "minLength": 1,
14
+ "maxLength": 120
15
+ },
16
+ "version": {
17
+ "type": "string",
18
+ "description": "Semantic version of this workflow definition.",
19
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
20
+ },
21
+ "description": {
22
+ "type": "string",
23
+ "description": "What this workflow does and when to use it."
24
+ },
25
+ "tags": {
26
+ "type": "array",
27
+ "items": { "type": "string" },
28
+ "description": "Tags for discovery and skill matching."
29
+ },
30
+ "inputs": {
31
+ "type": "object",
32
+ "description": "Workflow-level input parameters. Keys are parameter names.",
33
+ "additionalProperties": {
34
+ "$ref": "#/$defs/parameterDef"
35
+ }
36
+ },
37
+ "outputs": {
38
+ "type": "object",
39
+ "description": "Workflow-level outputs mapped from step results.",
40
+ "additionalProperties": {
41
+ "type": "object",
42
+ "required": ["fromStep", "value"],
43
+ "additionalProperties": false,
44
+ "properties": {
45
+ "fromStep": {
46
+ "type": "string",
47
+ "description": "Step key to source the value from."
48
+ },
49
+ "value": {
50
+ "type": "string",
51
+ "description": "Expression referencing the step output (e.g. 'output', 'status')."
52
+ }
53
+ }
54
+ }
55
+ },
56
+ "mode": {
57
+ "type": "string",
58
+ "enum": ["sequential", "parallel", "dependency"],
59
+ "default": "dependency",
60
+ "description": "Default execution mode. 'dependency' respects dependsOn edges; 'sequential' runs steps in definition order; 'parallel' runs all at once."
61
+ },
62
+ "maxConcurrent": {
63
+ "type": "integer",
64
+ "minimum": 1,
65
+ "default": 5,
66
+ "description": "Max concurrent agents when mode is 'parallel' or 'dependency'."
67
+ },
68
+ "timeoutMs": {
69
+ "type": "integer",
70
+ "minimum": 1000,
71
+ "description": "Wall-clock timeout for the entire workflow."
72
+ },
73
+ "onFailure": {
74
+ "$ref": "#/$defs/failurePolicy",
75
+ "description": "Default failure policy applied to steps that don't define their own."
76
+ },
77
+ "steps": {
78
+ "type": "array",
79
+ "minItems": 1,
80
+ "items": { "$ref": "#/$defs/step" },
81
+ "description": "Ordered list of workflow steps."
82
+ }
83
+ },
84
+ "$defs": {
85
+ "parameterDef": {
86
+ "type": "object",
87
+ "required": ["type"],
88
+ "additionalProperties": false,
89
+ "properties": {
90
+ "type": {
91
+ "type": "string",
92
+ "enum": ["string", "number", "boolean"],
93
+ "description": "Parameter data type."
94
+ },
95
+ "description": {
96
+ "type": "string"
97
+ },
98
+ "required": {
99
+ "type": "boolean",
100
+ "default": false
101
+ },
102
+ "default": {
103
+ "description": "Default value if not provided at runtime."
104
+ }
105
+ }
106
+ },
107
+ "step": {
108
+ "type": "object",
109
+ "required": ["key", "label", "prompt"],
110
+ "additionalProperties": false,
111
+ "properties": {
112
+ "key": {
113
+ "type": "string",
114
+ "pattern": "^[a-z][a-z0-9_-]*$",
115
+ "description": "Unique identifier within the workflow. Lowercase, alphanumeric with hyphens/underscores."
116
+ },
117
+ "label": {
118
+ "type": "string",
119
+ "description": "Human-readable step name."
120
+ },
121
+ "prompt": {
122
+ "type": "string",
123
+ "description": "Agent prompt. Supports {{input.paramName}} and {{steps.prevKey.output}} template interpolation."
124
+ },
125
+ "dependsOn": {
126
+ "type": "array",
127
+ "items": { "type": "string" },
128
+ "description": "Step keys that must complete before this step runs."
129
+ },
130
+ "condition": {
131
+ "$ref": "#/$defs/condition",
132
+ "description": "Conditional gate — step only runs if this evaluates to true."
133
+ },
134
+ "inputs": {
135
+ "type": "object",
136
+ "description": "Input mappings from workflow inputs or prior step outputs.",
137
+ "additionalProperties": {
138
+ "type": "string"
139
+ }
140
+ },
141
+ "priority": {
142
+ "type": "integer",
143
+ "minimum": 0,
144
+ "maximum": 100,
145
+ "default": 50,
146
+ "description": "Priority (0 = highest). Used for scheduling order."
147
+ },
148
+ "timeoutMs": {
149
+ "type": "integer",
150
+ "minimum": 1000,
151
+ "description": "Per-step timeout override."
152
+ },
153
+ "retries": {
154
+ "type": "integer",
155
+ "minimum": 0,
156
+ "maximum": 5,
157
+ "default": 0,
158
+ "description": "Number of retry attempts on failure."
159
+ },
160
+ "onFailure": {
161
+ "$ref": "#/$defs/failurePolicy",
162
+ "description": "Step-level failure policy, overrides workflow default."
163
+ },
164
+ "tags": {
165
+ "type": "array",
166
+ "items": { "type": "string" }
167
+ },
168
+ "cwd": {
169
+ "type": "string",
170
+ "description": "Working directory override for this step's agent."
171
+ }
172
+ }
173
+ },
174
+ "condition": {
175
+ "type": "object",
176
+ "description": "Conditional expression. Exactly one of the operator fields must be set.",
177
+ "additionalProperties": false,
178
+ "properties": {
179
+ "stepStatus": {
180
+ "type": "object",
181
+ "required": ["step", "equals"],
182
+ "additionalProperties": false,
183
+ "properties": {
184
+ "step": { "type": "string", "description": "Step key to check." },
185
+ "equals": {
186
+ "type": "string",
187
+ "enum": ["completed", "failed", "skipped"],
188
+ "description": "Required status."
189
+ }
190
+ },
191
+ "description": "True if the referenced step finished with the given status."
192
+ },
193
+ "inputEquals": {
194
+ "type": "object",
195
+ "required": ["input", "value"],
196
+ "additionalProperties": false,
197
+ "properties": {
198
+ "input": { "type": "string", "description": "Workflow input parameter name." },
199
+ "value": { "description": "Expected value." }
200
+ },
201
+ "description": "True if a workflow input matches the given value."
202
+ },
203
+ "allOf": {
204
+ "type": "array",
205
+ "items": { "$ref": "#/$defs/condition" },
206
+ "description": "All sub-conditions must be true (logical AND)."
207
+ },
208
+ "anyOf": {
209
+ "type": "array",
210
+ "items": { "$ref": "#/$defs/condition" },
211
+ "description": "At least one sub-condition must be true (logical OR)."
212
+ },
213
+ "not": {
214
+ "$ref": "#/$defs/condition",
215
+ "description": "Negation of a sub-condition."
216
+ }
217
+ }
218
+ },
219
+ "failurePolicy": {
220
+ "type": "object",
221
+ "required": ["action"],
222
+ "additionalProperties": false,
223
+ "properties": {
224
+ "action": {
225
+ "type": "string",
226
+ "enum": ["stop", "continue", "fallback"],
227
+ "description": "'stop' aborts the workflow. 'continue' skips the failed step and proceeds. 'fallback' runs the fallbackStep."
228
+ },
229
+ "fallbackStep": {
230
+ "type": "string",
231
+ "description": "Step key to run as a fallback (required when action is 'fallback')."
232
+ }
233
+ }
234
+ }
235
+ }
236
+ }
@@ -0,0 +1,22 @@
1
+ # Contacts module
2
+
3
+ Relationship graph of everyone and everything Core interacts with. Nodes are entities (humans, AI systems, organizations, services). Edges are relationships between them. Encrypted at rest because this is sensitive data.
4
+
5
+ ## Files (append-only, encrypted)
6
+
7
+ - **entities.jsonl** — Entity records. Fields: `id` (ent_ + 8 hex), `type` (human | ai | organization | service), `name`, `aliases`, `channels` (array of {type, value}), `meta` (freeform type-specific data), `notes`, `tags`, `status` (active | archived).
8
+ - **edges.jsonl** — Relationship edges. Fields: `id` (edg_ + 8 hex), `from`/`to` (entity IDs), `type` (works_at | owns | introduced_by | collaborates_with | uses | built_by | reports_to), `label` (optional qualifier), `since` (ISO date or YYYY-MM), `notes`, `status` (active | archived).
9
+
10
+ ## Privacy rules
11
+
12
+ - **Encrypt at rest.** All contact data is encrypted. Never store plaintext contact information.
13
+ - **Only record explicit knowledge.** Contact entries come from things Core was told about or directly interacted with — never scraped or inferred without basis.
14
+ - **This is Core's relational memory, not surveillance.** The graph represents Core's understanding of its world, not a dossier.
15
+ - **Archive, don't delete.** To remove an entity or edge, set `"status": "archived"` — never rewrite the file.
16
+
17
+ ## Rules
18
+
19
+ - **Append only.** Add one new line per entry. Never overwrite or rewrite the file.
20
+ - To update an entity or edge, append a new line with the same `id` and updated fields. Last occurrence wins.
21
+ - Use `getRelationships(entityId)` to find all edges where an entity is `from` or `to`.
22
+ - Use `getGraph(entityId, depth)` for BFS traversal to explore relationship neighborhoods.
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "contacts",
3
+ "description": "Entity relationship graph. People, AI systems, organizations, and services Core interacts with — plus the edges between them.",
4
+ "keywords": ["contact", "contacts", "who", "person", "company", "organization", "relationship", "knows", "introduced", "entity", "people"],
5
+ "files": [
6
+ { "path": "entities.jsonl", "role": "data", "description": "Append-only entity records (encrypted at rest)" },
7
+ { "path": "edges.jsonl", "role": "data", "description": "Append-only relationship edges (encrypted at rest)" }
8
+ ],
9
+ "endpoints": [
10
+ { "path": "/api/contacts/entities", "method": "GET", "description": "List entities with ?type= filter" },
11
+ { "path": "/api/contacts/entities", "method": "POST", "description": "Create entity" },
12
+ { "path": "/api/contacts/entities/:id", "method": "PATCH", "description": "Update entity" },
13
+ { "path": "/api/contacts/entities/:id/relationships", "method": "GET", "description": "Entity's edges" },
14
+ { "path": "/api/contacts/edges", "method": "POST", "description": "Create edge" },
15
+ { "path": "/api/contacts/graph/:id", "method": "GET", "description": "Subgraph from entity (depth param)" }
16
+ ],
17
+ "prompt": "## Contacts (entity graph)\nYou maintain a relationship graph of everyone and everything you interact with. Entities are people, AI systems, organizations, or services. Edges describe how they relate (works_at, owns, collaborates_with, uses, etc.). All contact data is encrypted at rest. When {name} asks about contacts, relationships, or \"who\" questions, query entities.jsonl and edges.jsonl. This is your relational memory — not surveillance. Only record things you were explicitly told about or directly interacted with.",
18
+ "promptOrder": 40
19
+ }
@@ -0,0 +1,36 @@
1
+ # CONTENT.md — Content module instructions
2
+
3
+ Load this when the task is content: blog, post, thread, draft, edit, or research.
4
+
5
+ ## File inventory
6
+
7
+ - `brain/identity/tone-of-voice.md` — Voice profile and checkpoints. Load for any writing.
8
+ - `brain/identity/brand.md` — Positioning and guardrails. Load for any writing.
9
+ - `brain/content/templates/` — Blog, thread, research templates. Load the one that matches the content type.
10
+ - `brain/knowledge/research/` — Existing topic research. Check before drafting.
11
+
12
+ ## Content pipeline (stages)
13
+
14
+ 1. **Idea** — Capture to ideas log; score alignment, insight, audience need, timeliness, effort.
15
+ 2. **Research** — Output to `brain/knowledge/research/[topic].md` (structured: summary, landscape, evidence, sources).
16
+ 3. **Outline** — Per template (sections, word counts).
17
+ 4. **Draft** — Follow template + voice. Run anti-patterns check.
18
+ 5. **Edit** — Structure → voice → evidence → read-aloud.
19
+ 6. **Publish / Promote** — Log to posts; create thread or adaptation per template.
20
+
21
+ ## Quality gates
22
+
23
+ - Every draft: banned-words scan, sentence rhythm, one em-dash per paragraph rule.
24
+ - Evidence: claims sourced?
25
+ - Final: would the user actually post this?
26
+
27
+ ## Instructions for the agent
28
+
29
+ <instructions>
30
+
31
+ - When writing, always load tone-of-voice and brand. Do not skip voice checkpoints.
32
+ - Use the template for the requested content type (blog, thread, research). Do not make up structure.
33
+ - Research output goes to `brain/knowledge/research/[topic].md` in the structured format (Executive Summary, Landscape, Evidence Bank, Sources).
34
+ - Single source of truth: reference files by path; do not duplicate long content into the prompt.
35
+
36
+ </instructions>
@@ -0,0 +1,26 @@
1
+ # Blog template (long-form)
2
+
3
+ Structure for a long-form blog post. Use with voice and anti-patterns from identity.
4
+
5
+ ## Sections (word count targets)
6
+
7
+ 1. **Hook** — Grab attention; lead with insight or question. (~100–150)
8
+ 2. **Core concept** — What we’re talking about and why it matters. (~200–300)
9
+ 3. **Framework** — How to think about it (model, steps, or lens). (~300–400)
10
+ 4. **Practical application** — How to do it / use it. (~400–600)
11
+ 5. **Failure modes** — What to avoid. (~200–300)
12
+ 6. **Getting started** — Concrete first steps. (~150–200)
13
+ 7. **Closing** — Takeaway or CTA. (~100–150)
14
+
15
+ **Total:** 2,000–3,500 words.
16
+
17
+ ## Attribution
18
+
19
+ Every published piece must include a byline footer. Load `brain/identity/brand.md` for the canonical entity name and URL. Do not hard-code — always pull from brand.md so updates propagate.
20
+
21
+ ## Editing passes
22
+
23
+ 1. Structure — Does the hook grab? Does each section earn its place?
24
+ 2. Voice — Banned words scan, sentence rhythm, em-dash limit.
25
+ 3. Evidence — Claims sourced? Numbers and examples where needed?
26
+ 4. Read-aloud — Would the user actually post this?
@@ -0,0 +1,11 @@
1
+ # Knowledge module
2
+
3
+ Research outputs, bookmarks, and notes. Input for content and decisions.
4
+
5
+ ## Layout
6
+
7
+ - **research/** — Topic research in structured markdown (one file per topic). Created by the content research workflow.
8
+ - **bookmarks/** — Optional. Links and notes for later use.
9
+ - **notes/** — Free-form notes the agent can read when relevant.
10
+
11
+ Load only the file(s) needed for the current task. Do not load the entire directory.