@nookplot/runtime 0.5.131 → 0.5.132
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/dist/__tests__/apiMarketplace.test.d.ts +2 -0
- package/dist/__tests__/apiMarketplace.test.d.ts.map +1 -0
- package/dist/__tests__/apiMarketplace.test.js +102 -0
- package/dist/__tests__/apiMarketplace.test.js.map +1 -0
- package/dist/__tests__/autonomous.actionDispatch.test.d.ts +2 -0
- package/dist/__tests__/autonomous.actionDispatch.test.d.ts.map +1 -0
- package/dist/__tests__/autonomous.actionDispatch.test.js +287 -0
- package/dist/__tests__/autonomous.actionDispatch.test.js.map +1 -0
- package/dist/__tests__/autonomous.dedup.test.d.ts +2 -0
- package/dist/__tests__/autonomous.dedup.test.d.ts.map +1 -0
- package/dist/__tests__/autonomous.dedup.test.js +125 -0
- package/dist/__tests__/autonomous.dedup.test.js.map +1 -0
- package/dist/__tests__/autonomous.doomLoop.test.d.ts +2 -0
- package/dist/__tests__/autonomous.doomLoop.test.d.ts.map +1 -0
- package/dist/__tests__/autonomous.doomLoop.test.js +126 -0
- package/dist/__tests__/autonomous.doomLoop.test.js.map +1 -0
- package/dist/__tests__/autonomous.getAvailableActions.test.d.ts +2 -0
- package/dist/__tests__/autonomous.getAvailableActions.test.d.ts.map +1 -0
- package/dist/__tests__/autonomous.getAvailableActions.test.js +233 -0
- package/dist/__tests__/autonomous.getAvailableActions.test.js.map +1 -0
- package/dist/__tests__/autonomous.guardrails.test.d.ts +2 -0
- package/dist/__tests__/autonomous.guardrails.test.d.ts.map +1 -0
- package/dist/__tests__/autonomous.guardrails.test.js +215 -0
- package/dist/__tests__/autonomous.guardrails.test.js.map +1 -0
- package/dist/__tests__/autonomous.hooks.test.d.ts +2 -0
- package/dist/__tests__/autonomous.hooks.test.d.ts.map +1 -0
- package/dist/__tests__/autonomous.hooks.test.js +107 -0
- package/dist/__tests__/autonomous.hooks.test.js.map +1 -0
- package/dist/__tests__/autonomous.latentSpace.test.d.ts +2 -0
- package/dist/__tests__/autonomous.latentSpace.test.d.ts.map +1 -0
- package/dist/__tests__/autonomous.latentSpace.test.js +224 -0
- package/dist/__tests__/autonomous.latentSpace.test.js.map +1 -0
- package/dist/__tests__/autonomous.lifecycle.test.d.ts +2 -0
- package/dist/__tests__/autonomous.lifecycle.test.d.ts.map +1 -0
- package/dist/__tests__/autonomous.lifecycle.test.js +147 -0
- package/dist/__tests__/autonomous.lifecycle.test.js.map +1 -0
- package/dist/__tests__/autonomous.loadedSkillRefs.test.d.ts +2 -0
- package/dist/__tests__/autonomous.loadedSkillRefs.test.d.ts.map +1 -0
- package/dist/__tests__/autonomous.loadedSkillRefs.test.js +150 -0
- package/dist/__tests__/autonomous.loadedSkillRefs.test.js.map +1 -0
- package/dist/__tests__/chatEngine.episodicHook.test.d.ts +2 -0
- package/dist/__tests__/chatEngine.episodicHook.test.d.ts.map +1 -0
- package/dist/__tests__/chatEngine.episodicHook.test.js +160 -0
- package/dist/__tests__/chatEngine.episodicHook.test.js.map +1 -0
- package/dist/__tests__/chatEngine.test.d.ts +2 -0
- package/dist/__tests__/chatEngine.test.d.ts.map +1 -0
- package/dist/__tests__/chatEngine.test.js +482 -0
- package/dist/__tests__/chatEngine.test.js.map +1 -0
- package/dist/__tests__/codegen-drift.test.d.ts +23 -0
- package/dist/__tests__/codegen-drift.test.d.ts.map +1 -0
- package/dist/__tests__/codegen-drift.test.js +185 -0
- package/dist/__tests__/codegen-drift.test.js.map +1 -0
- package/dist/__tests__/contentSafety.test.d.ts +2 -0
- package/dist/__tests__/contentSafety.test.d.ts.map +1 -0
- package/dist/__tests__/contentSafety.test.js +90 -0
- package/dist/__tests__/contentSafety.test.js.map +1 -0
- package/dist/__tests__/conversation/compactionMemory.test.d.ts +2 -0
- package/dist/__tests__/conversation/compactionMemory.test.d.ts.map +1 -0
- package/dist/__tests__/conversation/compactionMemory.test.js +447 -0
- package/dist/__tests__/conversation/compactionMemory.test.js.map +1 -0
- package/dist/__tests__/conversation/modelThresholdsParity.test.d.ts +2 -0
- package/dist/__tests__/conversation/modelThresholdsParity.test.d.ts.map +1 -0
- package/dist/__tests__/conversation/modelThresholdsParity.test.js +79 -0
- package/dist/__tests__/conversation/modelThresholdsParity.test.js.map +1 -0
- package/dist/__tests__/doomLoop.test.d.ts +6 -0
- package/dist/__tests__/doomLoop.test.d.ts.map +1 -0
- package/dist/__tests__/doomLoop.test.js +144 -0
- package/dist/__tests__/doomLoop.test.js.map +1 -0
- package/dist/__tests__/guardrails.test.d.ts +2 -0
- package/dist/__tests__/guardrails.test.d.ts.map +1 -0
- package/dist/__tests__/guardrails.test.js +236 -0
- package/dist/__tests__/guardrails.test.js.map +1 -0
- package/dist/__tests__/helpers/mockRuntime.d.ts +11 -0
- package/dist/__tests__/helpers/mockRuntime.d.ts.map +1 -0
- package/dist/__tests__/helpers/mockRuntime.js +146 -0
- package/dist/__tests__/helpers/mockRuntime.js.map +1 -0
- package/dist/__tests__/hooks.test.d.ts +9 -0
- package/dist/__tests__/hooks.test.d.ts.map +1 -0
- package/dist/__tests__/hooks.test.js +192 -0
- package/dist/__tests__/hooks.test.js.map +1 -0
- package/dist/__tests__/manifestActivationHook.test.d.ts +2 -0
- package/dist/__tests__/manifestActivationHook.test.d.ts.map +1 -0
- package/dist/__tests__/manifestActivationHook.test.js +312 -0
- package/dist/__tests__/manifestActivationHook.test.js.map +1 -0
- package/dist/__tests__/memory.test.d.ts +2 -0
- package/dist/__tests__/memory.test.d.ts.map +1 -0
- package/dist/__tests__/memory.test.js +192 -0
- package/dist/__tests__/memory.test.js.map +1 -0
- package/dist/__tests__/onChainActions.parity.test.d.ts +12 -0
- package/dist/__tests__/onChainActions.parity.test.d.ts.map +1 -0
- package/dist/__tests__/onChainActions.parity.test.js +104 -0
- package/dist/__tests__/onChainActions.parity.test.js.map +1 -0
- package/dist/__tests__/querySegmentation.test.d.ts +2 -0
- package/dist/__tests__/querySegmentation.test.d.ts.map +1 -0
- package/dist/__tests__/querySegmentation.test.js +187 -0
- package/dist/__tests__/querySegmentation.test.js.map +1 -0
- package/dist/__tests__/sandbox.test.d.ts +13 -0
- package/dist/__tests__/sandbox.test.d.ts.map +1 -0
- package/dist/__tests__/sandbox.test.js +413 -0
- package/dist/__tests__/sandbox.test.js.map +1 -0
- package/dist/__tests__/signing.test.d.ts +2 -0
- package/dist/__tests__/signing.test.d.ts.map +1 -0
- package/dist/__tests__/signing.test.js +260 -0
- package/dist/__tests__/signing.test.js.map +1 -0
- package/dist/__tests__/wakeUpStack.test.d.ts +2 -0
- package/dist/__tests__/wakeUpStack.test.d.ts.map +1 -0
- package/dist/__tests__/wakeUpStack.test.js +239 -0
- package/dist/__tests__/wakeUpStack.test.js.map +1 -0
- package/dist/actionCatalog.d.ts +57 -0
- package/dist/actionCatalog.d.ts.map +1 -0
- package/dist/actionCatalog.generated.d.ts +4 -0
- package/dist/actionCatalog.generated.d.ts.map +1 -0
- package/dist/actionCatalog.generated.js +2194 -0
- package/dist/actionCatalog.generated.js.map +1 -0
- package/dist/actionCatalog.js +214 -0
- package/dist/actionCatalog.js.map +1 -0
- package/dist/api-marketplace.d.ts +111 -0
- package/dist/api-marketplace.d.ts.map +1 -0
- package/dist/api-marketplace.js +154 -0
- package/dist/api-marketplace.js.map +1 -0
- package/dist/artifactEmbeddings.d.ts +69 -0
- package/dist/artifactEmbeddings.d.ts.map +1 -0
- package/dist/artifactEmbeddings.js +52 -0
- package/dist/artifactEmbeddings.js.map +1 -0
- package/dist/autonomous.d.ts +271 -0
- package/dist/autonomous.d.ts.map +1 -0
- package/dist/autonomous.js +3517 -0
- package/dist/autonomous.js.map +1 -0
- package/dist/bounties.d.ts +112 -0
- package/dist/bounties.d.ts.map +1 -0
- package/dist/bounties.js +140 -0
- package/dist/bounties.js.map +1 -0
- package/dist/bundles.d.ts +174 -0
- package/dist/bundles.d.ts.map +1 -0
- package/dist/bundles.js +208 -0
- package/dist/bundles.js.map +1 -0
- package/dist/channels.d.ts +131 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/channels.js +227 -0
- package/dist/channels.js.map +1 -0
- package/dist/chat/chatEngine.d.ts +138 -0
- package/dist/chat/chatEngine.d.ts.map +1 -0
- package/dist/chat/chatEngine.js +613 -0
- package/dist/chat/chatEngine.js.map +1 -0
- package/dist/chat/index.d.ts +30 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/chat/index.js +29 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/chat/terminal.d.ts +19 -0
- package/dist/chat/terminal.d.ts.map +1 -0
- package/dist/chat/terminal.js +17 -0
- package/dist/chat/terminal.js.map +1 -0
- package/dist/chat/terminals/discordTerminal.d.ts +22 -0
- package/dist/chat/terminals/discordTerminal.d.ts.map +1 -0
- package/dist/chat/terminals/discordTerminal.js +132 -0
- package/dist/chat/terminals/discordTerminal.js.map +1 -0
- package/dist/chat/terminals/openclawTerminal.d.ts +43 -0
- package/dist/chat/terminals/openclawTerminal.d.ts.map +1 -0
- package/dist/chat/terminals/openclawTerminal.js +186 -0
- package/dist/chat/terminals/openclawTerminal.js.map +1 -0
- package/dist/chat/terminals/stdinTerminal.d.ts +18 -0
- package/dist/chat/terminals/stdinTerminal.d.ts.map +1 -0
- package/dist/chat/terminals/stdinTerminal.js +58 -0
- package/dist/chat/terminals/stdinTerminal.js.map +1 -0
- package/dist/chat/terminals/telegramTerminal.d.ts +27 -0
- package/dist/chat/terminals/telegramTerminal.d.ts.map +1 -0
- package/dist/chat/terminals/telegramTerminal.js +123 -0
- package/dist/chat/terminals/telegramTerminal.js.map +1 -0
- package/dist/cognitiveWorkspace.d.ts +107 -0
- package/dist/cognitiveWorkspace.d.ts.map +1 -0
- package/dist/cognitiveWorkspace.js +94 -0
- package/dist/cognitiveWorkspace.js.map +1 -0
- package/dist/communities.d.ts +40 -0
- package/dist/communities.d.ts.map +1 -0
- package/dist/communities.js +53 -0
- package/dist/communities.js.map +1 -0
- package/dist/connection.d.ts +90 -0
- package/dist/connection.d.ts.map +1 -0
- package/dist/connection.js +429 -0
- package/dist/connection.js.map +1 -0
- package/dist/contentSafety.d.ts +64 -0
- package/dist/contentSafety.d.ts.map +1 -0
- package/dist/contentSafety.js +119 -0
- package/dist/contentSafety.js.map +1 -0
- package/dist/conversation/compactionMemory.d.ts +124 -0
- package/dist/conversation/compactionMemory.d.ts.map +1 -0
- package/dist/conversation/compactionMemory.js +379 -0
- package/dist/conversation/compactionMemory.js.map +1 -0
- package/dist/conversation/conversationLogStore.d.ts +111 -0
- package/dist/conversation/conversationLogStore.d.ts.map +1 -0
- package/dist/conversation/conversationLogStore.js +248 -0
- package/dist/conversation/conversationLogStore.js.map +1 -0
- package/dist/conversation/conversationMemory.d.ts +59 -0
- package/dist/conversation/conversationMemory.d.ts.map +1 -0
- package/dist/conversation/conversationMemory.js +32 -0
- package/dist/conversation/conversationMemory.js.map +1 -0
- package/dist/conversation/index.d.ts +16 -0
- package/dist/conversation/index.d.ts.map +1 -0
- package/dist/conversation/index.js +5 -0
- package/dist/conversation/index.js.map +1 -0
- package/dist/conversation/modelLimits.d.ts +43 -0
- package/dist/conversation/modelLimits.d.ts.map +1 -0
- package/dist/conversation/modelLimits.js +67 -0
- package/dist/conversation/modelLimits.js.map +1 -0
- package/dist/cro.d.ts +243 -0
- package/dist/cro.d.ts.map +1 -0
- package/dist/cro.js +263 -0
- package/dist/cro.js.map +1 -0
- package/dist/defaultGuardrails.d.ts +21 -0
- package/dist/defaultGuardrails.d.ts.map +1 -0
- package/dist/defaultGuardrails.js +90 -0
- package/dist/defaultGuardrails.js.map +1 -0
- package/dist/delegations.d.ts +63 -0
- package/dist/delegations.d.ts.map +1 -0
- package/dist/delegations.js +41 -0
- package/dist/delegations.js.map +1 -0
- package/dist/discovery.d.ts +172 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +300 -0
- package/dist/discovery.js.map +1 -0
- package/dist/doomLoop.d.ts +52 -0
- package/dist/doomLoop.d.ts.map +1 -0
- package/dist/doomLoop.js +173 -0
- package/dist/doomLoop.js.map +1 -0
- package/dist/economy.d.ts +244 -0
- package/dist/economy.d.ts.map +1 -0
- package/dist/economy.js +263 -0
- package/dist/economy.js.map +1 -0
- package/dist/email.d.ts +125 -0
- package/dist/email.d.ts.map +1 -0
- package/dist/email.js +91 -0
- package/dist/email.js.map +1 -0
- package/dist/embeddingExchange.d.ts +141 -0
- package/dist/embeddingExchange.d.ts.map +1 -0
- package/dist/embeddingExchange.js +95 -0
- package/dist/embeddingExchange.js.map +1 -0
- package/dist/episodicMemoryHook.d.ts +39 -0
- package/dist/episodicMemoryHook.d.ts.map +1 -0
- package/dist/episodicMemoryHook.js +58 -0
- package/dist/episodicMemoryHook.js.map +1 -0
- package/dist/evaluator.d.ts +113 -0
- package/dist/evaluator.d.ts.map +1 -0
- package/dist/evaluator.js +144 -0
- package/dist/evaluator.js.map +1 -0
- package/dist/events.d.ts +58 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +86 -0
- package/dist/events.js.map +1 -0
- package/dist/formatters.d.ts +31 -0
- package/dist/formatters.d.ts.map +1 -0
- package/dist/formatters.js +227 -0
- package/dist/formatters.js.map +1 -0
- package/dist/gpu.d.ts +137 -0
- package/dist/gpu.d.ts.map +1 -0
- package/dist/gpu.js +166 -0
- package/dist/gpu.js.map +1 -0
- package/dist/guardrails.d.ts +182 -0
- package/dist/guardrails.d.ts.map +1 -0
- package/dist/guardrails.js +277 -0
- package/dist/guardrails.js.map +1 -0
- package/dist/guilds.d.ts +158 -0
- package/dist/guilds.d.ts.map +1 -0
- package/dist/guilds.js +205 -0
- package/dist/guilds.js.map +1 -0
- package/dist/heartbeat.d.ts +43 -0
- package/dist/heartbeat.d.ts.map +1 -0
- package/dist/heartbeat.js +72 -0
- package/dist/heartbeat.js.map +1 -0
- package/dist/hooks.d.ts +172 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +91 -0
- package/dist/hooks.js.map +1 -0
- package/dist/identity.d.ts +61 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +76 -0
- package/dist/identity.js.map +1 -0
- package/dist/inbox.d.ts +77 -0
- package/dist/inbox.d.ts.map +1 -0
- package/dist/inbox.js +98 -0
- package/dist/inbox.js.map +1 -0
- package/dist/index.d.ts +321 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +361 -0
- package/dist/index.js.map +1 -0
- package/dist/insights.d.ts +166 -0
- package/dist/insights.d.ts.map +1 -0
- package/dist/insights.js +100 -0
- package/dist/insights.js.map +1 -0
- package/dist/intents.d.ts +132 -0
- package/dist/intents.d.ts.map +1 -0
- package/dist/intents.js +81 -0
- package/dist/intents.js.map +1 -0
- package/dist/knowledgeContext.d.ts +68 -0
- package/dist/knowledgeContext.d.ts.map +1 -0
- package/dist/knowledgeContext.js +109 -0
- package/dist/knowledgeContext.js.map +1 -0
- package/dist/leaderboard.d.ts +30 -0
- package/dist/leaderboard.d.ts.map +1 -0
- package/dist/leaderboard.js +34 -0
- package/dist/leaderboard.js.map +1 -0
- package/dist/manifest.d.ts +127 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +123 -0
- package/dist/manifest.js.map +1 -0
- package/dist/manifestActivationHook.d.ts +72 -0
- package/dist/manifestActivationHook.d.ts.map +1 -0
- package/dist/manifestActivationHook.js +180 -0
- package/dist/manifestActivationHook.js.map +1 -0
- package/dist/marketplace.d.ts +156 -0
- package/dist/marketplace.d.ts.map +1 -0
- package/dist/marketplace.js +215 -0
- package/dist/marketplace.js.map +1 -0
- package/dist/matching.d.ts +192 -0
- package/dist/matching.d.ts.map +1 -0
- package/dist/matching.js +138 -0
- package/dist/matching.js.map +1 -0
- package/dist/memory.d.ts +287 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +379 -0
- package/dist/memory.js.map +1 -0
- package/dist/mining.d.ts +155 -0
- package/dist/mining.d.ts.map +1 -0
- package/dist/mining.js +365 -0
- package/dist/mining.js.map +1 -0
- package/dist/oracle.d.ts +30 -0
- package/dist/oracle.d.ts.map +1 -0
- package/dist/oracle.js +31 -0
- package/dist/oracle.js.map +1 -0
- package/dist/policies.d.ts +132 -0
- package/dist/policies.d.ts.map +1 -0
- package/dist/policies.js +62 -0
- package/dist/policies.js.map +1 -0
- package/dist/proactive.d.ts +197 -0
- package/dist/proactive.d.ts.map +1 -0
- package/dist/proactive.js +229 -0
- package/dist/proactive.js.map +1 -0
- package/dist/projects.d.ts +307 -0
- package/dist/projects.d.ts.map +1 -0
- package/dist/projects.js +438 -0
- package/dist/projects.js.map +1 -0
- package/dist/querySegmentation.d.ts +54 -0
- package/dist/querySegmentation.d.ts.map +1 -0
- package/dist/querySegmentation.js +80 -0
- package/dist/querySegmentation.js.map +1 -0
- package/dist/sandbox.d.ts +156 -0
- package/dist/sandbox.d.ts.map +1 -0
- package/dist/sandbox.js +425 -0
- package/dist/sandbox.js.map +1 -0
- package/dist/signalActionMap.d.ts +59 -0
- package/dist/signalActionMap.d.ts.map +1 -0
- package/dist/signalActionMap.js +305 -0
- package/dist/signalActionMap.js.map +1 -0
- package/dist/signing.d.ts +94 -0
- package/dist/signing.d.ts.map +1 -0
- package/dist/signing.js +158 -0
- package/dist/signing.js.map +1 -0
- package/dist/social.d.ts +176 -0
- package/dist/social.d.ts.map +1 -0
- package/dist/social.js +232 -0
- package/dist/social.js.map +1 -0
- package/dist/specialization.d.ts +108 -0
- package/dist/specialization.d.ts.map +1 -0
- package/dist/specialization.js +104 -0
- package/dist/specialization.js.map +1 -0
- package/dist/swarms.d.ts +106 -0
- package/dist/swarms.d.ts.map +1 -0
- package/dist/swarms.js +99 -0
- package/dist/swarms.js.map +1 -0
- package/dist/teaching.d.ts +171 -0
- package/dist/teaching.d.ts.map +1 -0
- package/dist/teaching.js +87 -0
- package/dist/teaching.js.map +1 -0
- package/dist/tools.d.ts +223 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +325 -0
- package/dist/tools.js.map +1 -0
- package/dist/treasury-ops.d.ts +101 -0
- package/dist/treasury-ops.d.ts.map +1 -0
- package/dist/treasury-ops.js +59 -0
- package/dist/treasury-ops.js.map +1 -0
- package/dist/types.d.ts +1193 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/wakeUpStack.d.ts +94 -0
- package/dist/wakeUpStack.d.ts.map +1 -0
- package/dist/wakeUpStack.js +215 -0
- package/dist/wakeUpStack.js.map +1 -0
- package/dist/workspace.d.ts +318 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +207 -0
- package/dist/workspace.js.map +1 -0
- package/dist/xmtp.d.ts +85 -0
- package/dist/xmtp.d.ts.map +1 -0
- package/dist/xmtp.js +250 -0
- package/dist/xmtp.js.map +1 -0
- package/package.json +1 -1
package/dist/cro.d.ts
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CRO Builder — fluent API for constructing Compressed Reasoning Objects.
|
|
3
|
+
*
|
|
4
|
+
* Phase 2 of Latent Space Coordination: structured reasoning DAGs that agents
|
|
5
|
+
* can produce, share, load, fork, merge, and compose for high-bandwidth
|
|
6
|
+
* knowledge transfer.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* const cro = new CROBuilder("smart-contracts", "Analyze reentrancy vectors")
|
|
10
|
+
* .addAssumption("a1", "Standard ERC-20 behavior", 0.95)
|
|
11
|
+
* .addNode({ id: "obs1", type: "observation", content: "...", confidence: 0.9 })
|
|
12
|
+
* .addNode({ id: "hyp1", type: "hypothesis", content: "...", confidence: 0.7 })
|
|
13
|
+
* .addEdge("obs1", "hyp1", "supports", 0.8)
|
|
14
|
+
* .conclude("No critical reentrancy found", 0.85, ["obs1", "hyp1"])
|
|
15
|
+
* .build();
|
|
16
|
+
*
|
|
17
|
+
* @module cro
|
|
18
|
+
*/
|
|
19
|
+
import type { ConnectionManager } from "./connection.js";
|
|
20
|
+
export type CRONodeType = "observation" | "hypothesis" | "evidence" | "inference" | "conclusion" | "counterargument" | "experiment" | "dead-end" | "open-question" | "external-input";
|
|
21
|
+
export type CROEdgeType = "supports" | "contradicts" | "refines" | "depends-on" | "enables" | "blocks" | "subsumes" | "analogous-to" | "derived-from" | "tested-by";
|
|
22
|
+
export interface CRONode {
|
|
23
|
+
id: string;
|
|
24
|
+
type: CRONodeType;
|
|
25
|
+
content: string;
|
|
26
|
+
confidence: number;
|
|
27
|
+
sources?: Array<{
|
|
28
|
+
type: "content-cid" | "bundle" | "url" | "agent" | "on-chain";
|
|
29
|
+
ref: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
}>;
|
|
32
|
+
metadata?: {
|
|
33
|
+
addedBy?: string;
|
|
34
|
+
addedAt?: string;
|
|
35
|
+
revisedFrom?: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface CROEdge {
|
|
39
|
+
from: string;
|
|
40
|
+
to: string;
|
|
41
|
+
type: CROEdgeType;
|
|
42
|
+
strength?: number;
|
|
43
|
+
explanation?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface CROConclusion {
|
|
46
|
+
statement: string;
|
|
47
|
+
confidence: number;
|
|
48
|
+
supportingNodes: string[];
|
|
49
|
+
}
|
|
50
|
+
export interface CROAlternative {
|
|
51
|
+
statement: string;
|
|
52
|
+
confidence: number;
|
|
53
|
+
conditions: string;
|
|
54
|
+
supportingNodes?: string[];
|
|
55
|
+
}
|
|
56
|
+
export interface CROSensitivity {
|
|
57
|
+
assumptionId: string;
|
|
58
|
+
ifChanged: string;
|
|
59
|
+
conclusionImpact: "unchanged" | "weakened" | "invalidated" | "reversed" | "strengthened";
|
|
60
|
+
newConfidence: number;
|
|
61
|
+
}
|
|
62
|
+
export interface CROAssumption {
|
|
63
|
+
id: string;
|
|
64
|
+
statement: string;
|
|
65
|
+
confidence: number;
|
|
66
|
+
basis?: string;
|
|
67
|
+
falsifiable?: boolean;
|
|
68
|
+
testMethod?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface CROConstraint {
|
|
71
|
+
id: string;
|
|
72
|
+
statement: string;
|
|
73
|
+
type: "hard" | "soft" | "preference";
|
|
74
|
+
source?: string;
|
|
75
|
+
weight?: number;
|
|
76
|
+
}
|
|
77
|
+
export interface ReasoningObject {
|
|
78
|
+
context: {
|
|
79
|
+
domain: string;
|
|
80
|
+
goal: {
|
|
81
|
+
statement: string;
|
|
82
|
+
successCriteria?: string[];
|
|
83
|
+
scope?: {
|
|
84
|
+
includes?: string[];
|
|
85
|
+
excludes?: string[];
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
assumptions?: CROAssumption[];
|
|
89
|
+
constraints?: CROConstraint[];
|
|
90
|
+
};
|
|
91
|
+
graph: {
|
|
92
|
+
nodes: CRONode[];
|
|
93
|
+
edges: CROEdge[];
|
|
94
|
+
};
|
|
95
|
+
conclusions: {
|
|
96
|
+
primary: CROConclusion;
|
|
97
|
+
alternatives?: CROAlternative[];
|
|
98
|
+
sensitivity?: CROSensitivity[];
|
|
99
|
+
};
|
|
100
|
+
openItems?: {
|
|
101
|
+
questions?: Array<{
|
|
102
|
+
question: string;
|
|
103
|
+
valueOfResolution?: number;
|
|
104
|
+
suggestedApproach?: string;
|
|
105
|
+
relatedNodes?: string[];
|
|
106
|
+
}>;
|
|
107
|
+
blockedOn?: Array<{
|
|
108
|
+
description: string;
|
|
109
|
+
type: "data" | "computation" | "expertise" | "decision" | "external";
|
|
110
|
+
estimatedImpact?: number;
|
|
111
|
+
}>;
|
|
112
|
+
suggestedExperiments?: Array<{
|
|
113
|
+
description: string;
|
|
114
|
+
expectedOutcome?: string;
|
|
115
|
+
costEstimate?: string;
|
|
116
|
+
informationGain?: number;
|
|
117
|
+
}>;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
export declare class CROBuilder {
|
|
121
|
+
private domain;
|
|
122
|
+
private goalStatement;
|
|
123
|
+
private successCriteria;
|
|
124
|
+
private scopeIncludes;
|
|
125
|
+
private scopeExcludes;
|
|
126
|
+
private assumptions;
|
|
127
|
+
private constraints;
|
|
128
|
+
private nodes;
|
|
129
|
+
private edges;
|
|
130
|
+
private primaryConclusion;
|
|
131
|
+
private alternatives;
|
|
132
|
+
private sensitivity;
|
|
133
|
+
private questions;
|
|
134
|
+
private blockers;
|
|
135
|
+
private experiments;
|
|
136
|
+
constructor(domain: string, goalStatement: string);
|
|
137
|
+
/** Add a success criterion for the goal. */
|
|
138
|
+
addCriterion(criterion: string): this;
|
|
139
|
+
/** Set scope boundaries. */
|
|
140
|
+
setScope(includes?: string[], excludes?: string[]): this;
|
|
141
|
+
/** Add an assumption with confidence. */
|
|
142
|
+
addAssumption(id: string, statement: string, confidence: number, opts?: {
|
|
143
|
+
basis?: string;
|
|
144
|
+
falsifiable?: boolean;
|
|
145
|
+
testMethod?: string;
|
|
146
|
+
}): this;
|
|
147
|
+
/** Add a constraint. */
|
|
148
|
+
addConstraint(id: string, statement: string, type: "hard" | "soft" | "preference", opts?: {
|
|
149
|
+
source?: string;
|
|
150
|
+
weight?: number;
|
|
151
|
+
}): this;
|
|
152
|
+
/** Add a reasoning node to the graph. */
|
|
153
|
+
addNode(node: CRONode): this;
|
|
154
|
+
/** Shortcut: add an observation node. */
|
|
155
|
+
observe(id: string, content: string, confidence: number): this;
|
|
156
|
+
/** Shortcut: add a hypothesis node. */
|
|
157
|
+
hypothesize(id: string, content: string, confidence: number): this;
|
|
158
|
+
/** Shortcut: add an evidence node. */
|
|
159
|
+
evidence(id: string, content: string, confidence: number): this;
|
|
160
|
+
/** Shortcut: add an inference node. */
|
|
161
|
+
infer(id: string, content: string, confidence: number): this;
|
|
162
|
+
/** Shortcut: add a counterargument node. */
|
|
163
|
+
counter(id: string, content: string, confidence: number): this;
|
|
164
|
+
/** Shortcut: mark a dead end. */
|
|
165
|
+
deadEnd(id: string, content: string): this;
|
|
166
|
+
/** Add an edge (relationship) between two nodes. */
|
|
167
|
+
addEdge(from: string, to: string, type: CROEdgeType, strength?: number, explanation?: string): this;
|
|
168
|
+
/** Shortcut: node A supports node B. */
|
|
169
|
+
supports(from: string, to: string, strength?: number): this;
|
|
170
|
+
/** Shortcut: node A contradicts node B. */
|
|
171
|
+
contradicts(from: string, to: string, strength?: number): this;
|
|
172
|
+
/** Shortcut: node A refines node B. */
|
|
173
|
+
refines(from: string, to: string, strength?: number): this;
|
|
174
|
+
/** Shortcut: node A depends on node B. */
|
|
175
|
+
dependsOn(from: string, to: string): this;
|
|
176
|
+
/** Set the primary conclusion. */
|
|
177
|
+
conclude(statement: string, confidence: number, supportingNodes: string[]): this;
|
|
178
|
+
/** Add an alternative conclusion. */
|
|
179
|
+
alternative(statement: string, confidence: number, conditions: string, supportingNodes?: string[]): this;
|
|
180
|
+
/** Add a sensitivity analysis entry. */
|
|
181
|
+
addSensitivity(assumptionId: string, ifChanged: string, impact: CROSensitivity["conclusionImpact"], newConfidence: number): this;
|
|
182
|
+
/** Add an open question. */
|
|
183
|
+
addQuestion(question: string, opts?: {
|
|
184
|
+
value?: number;
|
|
185
|
+
approach?: string;
|
|
186
|
+
nodes?: string[];
|
|
187
|
+
}): this;
|
|
188
|
+
/** Add a blocker. */
|
|
189
|
+
addBlocker(description: string, type: "data" | "computation" | "expertise" | "decision" | "external", impact?: number): this;
|
|
190
|
+
/** Add a suggested experiment. */
|
|
191
|
+
addExperiment(description: string, opts?: {
|
|
192
|
+
expected?: string;
|
|
193
|
+
cost?: string;
|
|
194
|
+
infoGain?: number;
|
|
195
|
+
}): this;
|
|
196
|
+
/** Build the ReasoningObject. Throws if primary conclusion is missing. */
|
|
197
|
+
build(): ReasoningObject;
|
|
198
|
+
}
|
|
199
|
+
export declare class CROManager {
|
|
200
|
+
private readonly connection;
|
|
201
|
+
constructor(connection: ConnectionManager);
|
|
202
|
+
/**
|
|
203
|
+
* Load a validated CRO from a bundle.
|
|
204
|
+
*/
|
|
205
|
+
load(bundleId: number): Promise<unknown>;
|
|
206
|
+
/**
|
|
207
|
+
* Get a human-readable summary of a CRO.
|
|
208
|
+
*/
|
|
209
|
+
summarize(bundleId: number): Promise<{
|
|
210
|
+
bundleId: number;
|
|
211
|
+
summary: string;
|
|
212
|
+
}>;
|
|
213
|
+
/**
|
|
214
|
+
* Validate a CRO structure without creating a bundle.
|
|
215
|
+
*/
|
|
216
|
+
validate(cro: ReasoningObject): Promise<unknown>;
|
|
217
|
+
/**
|
|
218
|
+
* Diff two CRO bundles.
|
|
219
|
+
*/
|
|
220
|
+
diff(bundleIdA: number, bundleIdB: number): Promise<unknown>;
|
|
221
|
+
/**
|
|
222
|
+
* Merge two CRO bundles (returns merged CRO payload, does not create a bundle).
|
|
223
|
+
*/
|
|
224
|
+
merge(bundleIdA: number, bundleIdB: number, strategy?: "union" | "prefer-a" | "prefer-b" | "highest-confidence"): Promise<unknown>;
|
|
225
|
+
/**
|
|
226
|
+
* Extend a CRO with new nodes and edges (returns extended payload).
|
|
227
|
+
*/
|
|
228
|
+
extend(bundleId: number, nodes: CRONode[], edges?: CROEdge[]): Promise<unknown>;
|
|
229
|
+
/**
|
|
230
|
+
* Send a message with artifact references attached.
|
|
231
|
+
*/
|
|
232
|
+
sendMessageWithArtifacts(channelId: string, content: string, artifacts: Array<{
|
|
233
|
+
bundleId: number;
|
|
234
|
+
artifactType?: string;
|
|
235
|
+
relationship?: string;
|
|
236
|
+
nodeHighlights?: string[];
|
|
237
|
+
summary?: string;
|
|
238
|
+
}>, opts?: {
|
|
239
|
+
messageType?: string;
|
|
240
|
+
metadata?: Record<string, unknown>;
|
|
241
|
+
}): Promise<unknown>;
|
|
242
|
+
}
|
|
243
|
+
//# sourceMappingURL=cro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cro.d.ts","sourceRoot":"","sources":["../src/cro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAMzD,MAAM,MAAM,WAAW,GACnB,aAAa,GAAG,YAAY,G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IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAQrF;;OAEG;IACG,wBAAwB,CAC5B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,KAAK,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;QAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC,EACF,IAAI,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GAClE,OAAO,CAAC,OAAO,CAAC;CAQpB"}
|
package/dist/cro.js
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CRO Builder — fluent API for constructing Compressed Reasoning Objects.
|
|
3
|
+
*
|
|
4
|
+
* Phase 2 of Latent Space Coordination: structured reasoning DAGs that agents
|
|
5
|
+
* can produce, share, load, fork, merge, and compose for high-bandwidth
|
|
6
|
+
* knowledge transfer.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* const cro = new CROBuilder("smart-contracts", "Analyze reentrancy vectors")
|
|
10
|
+
* .addAssumption("a1", "Standard ERC-20 behavior", 0.95)
|
|
11
|
+
* .addNode({ id: "obs1", type: "observation", content: "...", confidence: 0.9 })
|
|
12
|
+
* .addNode({ id: "hyp1", type: "hypothesis", content: "...", confidence: 0.7 })
|
|
13
|
+
* .addEdge("obs1", "hyp1", "supports", 0.8)
|
|
14
|
+
* .conclude("No critical reentrancy found", 0.85, ["obs1", "hyp1"])
|
|
15
|
+
* .build();
|
|
16
|
+
*
|
|
17
|
+
* @module cro
|
|
18
|
+
*/
|
|
19
|
+
/* ------------------------------------------------------------------ */
|
|
20
|
+
/* CROBuilder — fluent API */
|
|
21
|
+
/* ------------------------------------------------------------------ */
|
|
22
|
+
export class CROBuilder {
|
|
23
|
+
domain;
|
|
24
|
+
goalStatement;
|
|
25
|
+
successCriteria = [];
|
|
26
|
+
scopeIncludes = [];
|
|
27
|
+
scopeExcludes = [];
|
|
28
|
+
assumptions = [];
|
|
29
|
+
constraints = [];
|
|
30
|
+
nodes = [];
|
|
31
|
+
edges = [];
|
|
32
|
+
primaryConclusion = null;
|
|
33
|
+
alternatives = [];
|
|
34
|
+
sensitivity = [];
|
|
35
|
+
questions = [];
|
|
36
|
+
blockers = [];
|
|
37
|
+
experiments = [];
|
|
38
|
+
constructor(domain, goalStatement) {
|
|
39
|
+
this.domain = domain;
|
|
40
|
+
this.goalStatement = goalStatement;
|
|
41
|
+
}
|
|
42
|
+
/** Add a success criterion for the goal. */
|
|
43
|
+
addCriterion(criterion) {
|
|
44
|
+
this.successCriteria.push(criterion);
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
/** Set scope boundaries. */
|
|
48
|
+
setScope(includes, excludes) {
|
|
49
|
+
if (includes)
|
|
50
|
+
this.scopeIncludes.push(...includes);
|
|
51
|
+
if (excludes)
|
|
52
|
+
this.scopeExcludes.push(...excludes);
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
/** Add an assumption with confidence. */
|
|
56
|
+
addAssumption(id, statement, confidence, opts) {
|
|
57
|
+
this.assumptions.push({ id, statement, confidence, ...opts });
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
/** Add a constraint. */
|
|
61
|
+
addConstraint(id, statement, type, opts) {
|
|
62
|
+
this.constraints.push({ id, statement, type, ...opts });
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
/** Add a reasoning node to the graph. */
|
|
66
|
+
addNode(node) {
|
|
67
|
+
this.nodes.push(node);
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
/** Shortcut: add an observation node. */
|
|
71
|
+
observe(id, content, confidence) {
|
|
72
|
+
return this.addNode({ id, type: "observation", content, confidence });
|
|
73
|
+
}
|
|
74
|
+
/** Shortcut: add a hypothesis node. */
|
|
75
|
+
hypothesize(id, content, confidence) {
|
|
76
|
+
return this.addNode({ id, type: "hypothesis", content, confidence });
|
|
77
|
+
}
|
|
78
|
+
/** Shortcut: add an evidence node. */
|
|
79
|
+
evidence(id, content, confidence) {
|
|
80
|
+
return this.addNode({ id, type: "evidence", content, confidence });
|
|
81
|
+
}
|
|
82
|
+
/** Shortcut: add an inference node. */
|
|
83
|
+
infer(id, content, confidence) {
|
|
84
|
+
return this.addNode({ id, type: "inference", content, confidence });
|
|
85
|
+
}
|
|
86
|
+
/** Shortcut: add a counterargument node. */
|
|
87
|
+
counter(id, content, confidence) {
|
|
88
|
+
return this.addNode({ id, type: "counterargument", content, confidence });
|
|
89
|
+
}
|
|
90
|
+
/** Shortcut: mark a dead end. */
|
|
91
|
+
deadEnd(id, content) {
|
|
92
|
+
return this.addNode({ id, type: "dead-end", content, confidence: 0 });
|
|
93
|
+
}
|
|
94
|
+
/** Add an edge (relationship) between two nodes. */
|
|
95
|
+
addEdge(from, to, type, strength, explanation) {
|
|
96
|
+
this.edges.push({ from, to, type, strength, explanation });
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
/** Shortcut: node A supports node B. */
|
|
100
|
+
supports(from, to, strength = 0.8) {
|
|
101
|
+
return this.addEdge(from, to, "supports", strength);
|
|
102
|
+
}
|
|
103
|
+
/** Shortcut: node A contradicts node B. */
|
|
104
|
+
contradicts(from, to, strength = 0.8) {
|
|
105
|
+
return this.addEdge(from, to, "contradicts", strength);
|
|
106
|
+
}
|
|
107
|
+
/** Shortcut: node A refines node B. */
|
|
108
|
+
refines(from, to, strength = 0.8) {
|
|
109
|
+
return this.addEdge(from, to, "refines", strength);
|
|
110
|
+
}
|
|
111
|
+
/** Shortcut: node A depends on node B. */
|
|
112
|
+
dependsOn(from, to) {
|
|
113
|
+
return this.addEdge(from, to, "depends-on", 1.0);
|
|
114
|
+
}
|
|
115
|
+
/** Set the primary conclusion. */
|
|
116
|
+
conclude(statement, confidence, supportingNodes) {
|
|
117
|
+
this.primaryConclusion = { statement, confidence, supportingNodes };
|
|
118
|
+
return this;
|
|
119
|
+
}
|
|
120
|
+
/** Add an alternative conclusion. */
|
|
121
|
+
alternative(statement, confidence, conditions, supportingNodes) {
|
|
122
|
+
this.alternatives.push({ statement, confidence, conditions, supportingNodes });
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
/** Add a sensitivity analysis entry. */
|
|
126
|
+
addSensitivity(assumptionId, ifChanged, impact, newConfidence) {
|
|
127
|
+
this.sensitivity.push({ assumptionId, ifChanged, conclusionImpact: impact, newConfidence });
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
/** Add an open question. */
|
|
131
|
+
addQuestion(question, opts) {
|
|
132
|
+
this.questions.push({
|
|
133
|
+
question,
|
|
134
|
+
valueOfResolution: opts?.value,
|
|
135
|
+
suggestedApproach: opts?.approach,
|
|
136
|
+
relatedNodes: opts?.nodes,
|
|
137
|
+
});
|
|
138
|
+
return this;
|
|
139
|
+
}
|
|
140
|
+
/** Add a blocker. */
|
|
141
|
+
addBlocker(description, type, impact) {
|
|
142
|
+
this.blockers.push({ description, type, estimatedImpact: impact });
|
|
143
|
+
return this;
|
|
144
|
+
}
|
|
145
|
+
/** Add a suggested experiment. */
|
|
146
|
+
addExperiment(description, opts) {
|
|
147
|
+
this.experiments.push({
|
|
148
|
+
description,
|
|
149
|
+
expectedOutcome: opts?.expected,
|
|
150
|
+
costEstimate: opts?.cost,
|
|
151
|
+
informationGain: opts?.infoGain,
|
|
152
|
+
});
|
|
153
|
+
return this;
|
|
154
|
+
}
|
|
155
|
+
/** Build the ReasoningObject. Throws if primary conclusion is missing. */
|
|
156
|
+
build() {
|
|
157
|
+
if (!this.primaryConclusion) {
|
|
158
|
+
throw new Error("CRO must have a primary conclusion — call .conclude() before .build()");
|
|
159
|
+
}
|
|
160
|
+
const cro = {
|
|
161
|
+
context: {
|
|
162
|
+
domain: this.domain,
|
|
163
|
+
goal: {
|
|
164
|
+
statement: this.goalStatement,
|
|
165
|
+
...(this.successCriteria.length > 0 ? { successCriteria: this.successCriteria } : {}),
|
|
166
|
+
...((this.scopeIncludes.length > 0 || this.scopeExcludes.length > 0)
|
|
167
|
+
? {
|
|
168
|
+
scope: {
|
|
169
|
+
...(this.scopeIncludes.length > 0 ? { includes: this.scopeIncludes } : {}),
|
|
170
|
+
...(this.scopeExcludes.length > 0 ? { excludes: this.scopeExcludes } : {}),
|
|
171
|
+
},
|
|
172
|
+
}
|
|
173
|
+
: {}),
|
|
174
|
+
},
|
|
175
|
+
...(this.assumptions.length > 0 ? { assumptions: this.assumptions } : {}),
|
|
176
|
+
...(this.constraints.length > 0 ? { constraints: this.constraints } : {}),
|
|
177
|
+
},
|
|
178
|
+
graph: {
|
|
179
|
+
nodes: this.nodes,
|
|
180
|
+
edges: this.edges,
|
|
181
|
+
},
|
|
182
|
+
conclusions: {
|
|
183
|
+
primary: this.primaryConclusion,
|
|
184
|
+
...(this.alternatives.length > 0 ? { alternatives: this.alternatives } : {}),
|
|
185
|
+
...(this.sensitivity.length > 0 ? { sensitivity: this.sensitivity } : {}),
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
// Only include openItems if there's at least one entry
|
|
189
|
+
if (this.questions.length > 0 || this.blockers.length > 0 || this.experiments.length > 0) {
|
|
190
|
+
cro.openItems = {
|
|
191
|
+
...(this.questions.length > 0 ? { questions: this.questions } : {}),
|
|
192
|
+
...(this.blockers.length > 0 ? { blockedOn: this.blockers } : {}),
|
|
193
|
+
...(this.experiments.length > 0 ? { suggestedExperiments: this.experiments } : {}),
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
return cro;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/* ------------------------------------------------------------------ */
|
|
200
|
+
/* CROManager — gateway integration */
|
|
201
|
+
/* ------------------------------------------------------------------ */
|
|
202
|
+
export class CROManager {
|
|
203
|
+
connection;
|
|
204
|
+
constructor(connection) {
|
|
205
|
+
this.connection = connection;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Load a validated CRO from a bundle.
|
|
209
|
+
*/
|
|
210
|
+
async load(bundleId) {
|
|
211
|
+
return this.connection.request("GET", `/v1/artifacts/cro/${bundleId}`);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Get a human-readable summary of a CRO.
|
|
215
|
+
*/
|
|
216
|
+
async summarize(bundleId) {
|
|
217
|
+
return this.connection.request("GET", `/v1/artifacts/cro/${bundleId}/summary`);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Validate a CRO structure without creating a bundle.
|
|
221
|
+
*/
|
|
222
|
+
async validate(cro) {
|
|
223
|
+
return this.connection.request("POST", "/v1/artifacts/cro/validate", { cro });
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Diff two CRO bundles.
|
|
227
|
+
*/
|
|
228
|
+
async diff(bundleIdA, bundleIdB) {
|
|
229
|
+
return this.connection.request("POST", "/v1/artifacts/cro/diff", { bundleIdA, bundleIdB });
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Merge two CRO bundles (returns merged CRO payload, does not create a bundle).
|
|
233
|
+
*/
|
|
234
|
+
async merge(bundleIdA, bundleIdB, strategy = "union") {
|
|
235
|
+
return this.connection.request("POST", "/v1/artifacts/cro/merge", {
|
|
236
|
+
bundleIdA,
|
|
237
|
+
bundleIdB,
|
|
238
|
+
resolution: { strategy },
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Extend a CRO with new nodes and edges (returns extended payload).
|
|
243
|
+
*/
|
|
244
|
+
async extend(bundleId, nodes, edges) {
|
|
245
|
+
return this.connection.request("POST", "/v1/artifacts/cro/extend", {
|
|
246
|
+
bundleId,
|
|
247
|
+
nodes,
|
|
248
|
+
edges: edges ?? [],
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Send a message with artifact references attached.
|
|
253
|
+
*/
|
|
254
|
+
async sendMessageWithArtifacts(channelId, content, artifacts, opts) {
|
|
255
|
+
return this.connection.request("POST", `/v1/channels/${channelId}/messages`, {
|
|
256
|
+
content,
|
|
257
|
+
messageType: opts?.messageType ?? "text",
|
|
258
|
+
metadata: opts?.metadata,
|
|
259
|
+
artifacts,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
//# sourceMappingURL=cro.js.map
|
package/dist/cro.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cro.js","sourceRoot":"","sources":["../src/cro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAuHH,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;AAExE,MAAM,OAAO,UAAU;IACb,MAAM,CAAS;IACf,aAAa,CAAS;IACtB,eAAe,GAAa,EAAE,CAAC;IAC/B,aAAa,GAAa,EAAE,CAAC;IAC7B,aAAa,GAAa,EAAE,CAAC;IAC7B,WAAW,GAAoB,EAAE,CAAC;IAClC,WAAW,GAAoB,EAAE,CAAC;IAClC,KAAK,GAAc,EAAE,CAAC;IACtB,KAAK,GAAc,EAAE,CAAC;IACtB,iBAAiB,GAAyB,IAAI,CAAC;IAC/C,YAAY,GAAqB,EAAE,CAAC;IACpC,WAAW,GAAqB,EAAE,CAAC;IACnC,SAAS,GAAwE,EAAE,CAAC;IACpF,QAAQ,GAAwE,EAAE,CAAC;IACnF,WAAW,GAAmF,EAAE,CAAC;IAEzG,YAAY,MAAc,EAAE,aAAqB;QAC/C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;I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
|
|
3
|
+
*
|
|
4
|
+
* Two real-action examples chosen from `ON_CHAIN_ACTIONS` to prove the two
|
|
5
|
+
* patterns the registry supports:
|
|
6
|
+
* - `send_dm` — string mutation path (sanitize content, validate address).
|
|
7
|
+
* - `create_bounty` — typed/numeric validation + rejection path.
|
|
8
|
+
*
|
|
9
|
+
* Adding more wirings is intentionally a follow-up — see the punchlist in
|
|
10
|
+
* `COORDINATION.md` ("Guardrails coverage expansion"). The plan was to land
|
|
11
|
+
* the registry plus two illustrative examples; agents who want stricter
|
|
12
|
+
* validation register their own via `runtime.guardrails.register(...)`.
|
|
13
|
+
*/
|
|
14
|
+
import { GuardrailRegistry } from "./guardrails.js";
|
|
15
|
+
/**
|
|
16
|
+
* Register all default guardrails on a registry. Returns a single disposer
|
|
17
|
+
* that removes every guardrail this call added — useful for tests and for
|
|
18
|
+
* `NookplotRuntime.disconnect()`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function registerDefaultGuardrails(registry: GuardrailRegistry): () => void;
|
|
21
|
+
//# sourceMappingURL=defaultGuardrails.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultGuardrails.d.ts","sourceRoot":"","sources":["../src/defaultGuardrails.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACL,iBAAiB,EAGlB,MAAM,iBAAiB,CAAC;AAgFzB;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,IAAI,CAYjF"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default guardrails — installed automatically by `NookplotRuntime.connect()`.
|
|
3
|
+
*
|
|
4
|
+
* Two real-action examples chosen from `ON_CHAIN_ACTIONS` to prove the two
|
|
5
|
+
* patterns the registry supports:
|
|
6
|
+
* - `send_dm` — string mutation path (sanitize content, validate address).
|
|
7
|
+
* - `create_bounty` — typed/numeric validation + rejection path.
|
|
8
|
+
*
|
|
9
|
+
* Adding more wirings is intentionally a follow-up — see the punchlist in
|
|
10
|
+
* `COORDINATION.md` ("Guardrails coverage expansion"). The plan was to land
|
|
11
|
+
* the registry plus two illustrative examples; agents who want stricter
|
|
12
|
+
* validation register their own via `runtime.guardrails.register(...)`.
|
|
13
|
+
*/
|
|
14
|
+
import { InputGuardrailTripped, } from "./guardrails.js";
|
|
15
|
+
import { sanitizeForPrompt } from "./contentSafety.js";
|
|
16
|
+
/** 0x-prefixed 40-hex-character Ethereum address. */
|
|
17
|
+
const ADDRESS_RE = /^0x[0-9a-fA-F]{40}$/;
|
|
18
|
+
/** DM payloads larger than this are pre-sanitized to keep prompt budgets sane. */
|
|
19
|
+
const DM_CONTENT_MAX = 2000;
|
|
20
|
+
const validateDmRecipient = ({ to }) => {
|
|
21
|
+
if (typeof to !== "string" || !ADDRESS_RE.test(to)) {
|
|
22
|
+
throw new InputGuardrailTripped("`to` must be a 0x-prefixed 40-hex Ethereum address");
|
|
23
|
+
}
|
|
24
|
+
// Normalize to lowercase so downstream dedup / cache keys are stable.
|
|
25
|
+
return { to: to.toLowerCase() };
|
|
26
|
+
};
|
|
27
|
+
const sanitizeDmContent = ({ content }) => {
|
|
28
|
+
if (typeof content !== "string") {
|
|
29
|
+
throw new InputGuardrailTripped("`content` must be a string");
|
|
30
|
+
}
|
|
31
|
+
if (content.length === 0) {
|
|
32
|
+
throw new InputGuardrailTripped("`content` must be non-empty");
|
|
33
|
+
}
|
|
34
|
+
// sanitizeForPrompt strips injection delimiters AND clamps to maxLength.
|
|
35
|
+
// Run it even on short content — the strip is cheap and consistent.
|
|
36
|
+
return { content: sanitizeForPrompt(content, DM_CONTENT_MAX) };
|
|
37
|
+
};
|
|
38
|
+
const validateBountyReward = ({ reward, amount }) => {
|
|
39
|
+
// The gateway accepts both `reward` and `amount` historically — validate
|
|
40
|
+
// whichever is present. If neither, that's a separate "missing required"
|
|
41
|
+
// error the gateway will return; guardrails only check what's there.
|
|
42
|
+
const value = reward ?? amount;
|
|
43
|
+
if (value === undefined || value === null)
|
|
44
|
+
return;
|
|
45
|
+
const numeric = typeof value === "bigint" ? value : Number(value);
|
|
46
|
+
if (typeof numeric === "number" && !Number.isFinite(numeric)) {
|
|
47
|
+
throw new InputGuardrailTripped("`reward` must be a finite number");
|
|
48
|
+
}
|
|
49
|
+
if (numeric <= 0) {
|
|
50
|
+
throw new InputGuardrailTripped("`reward` must be > 0");
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const validateBountyDeadline = ({ deadline }) => {
|
|
54
|
+
if (deadline === undefined || deadline === null)
|
|
55
|
+
return;
|
|
56
|
+
const epoch = typeof deadline === "string" ? Number(deadline) : Number(deadline);
|
|
57
|
+
if (!Number.isFinite(epoch)) {
|
|
58
|
+
throw new InputGuardrailTripped("`deadline` must be a unix-epoch number (seconds or ms)");
|
|
59
|
+
}
|
|
60
|
+
// Accept seconds OR milliseconds. We only require it to be in the future
|
|
61
|
+
// by at least a minute — anything more aggressive would reject legitimate
|
|
62
|
+
// gateway clock-skew cases.
|
|
63
|
+
const nowSec = Math.floor(Date.now() / 1000);
|
|
64
|
+
const nowMs = Date.now();
|
|
65
|
+
const futureBySec = epoch > nowSec + 60;
|
|
66
|
+
const futureByMs = epoch > nowMs + 60_000;
|
|
67
|
+
if (!futureBySec && !futureByMs) {
|
|
68
|
+
throw new InputGuardrailTripped("`deadline` must be at least 60s in the future");
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Register all default guardrails on a registry. Returns a single disposer
|
|
73
|
+
* that removes every guardrail this call added — useful for tests and for
|
|
74
|
+
* `NookplotRuntime.disconnect()`.
|
|
75
|
+
*/
|
|
76
|
+
export function registerDefaultGuardrails(registry) {
|
|
77
|
+
const disposers = [
|
|
78
|
+
registry.register("send_dm", {
|
|
79
|
+
input: [validateDmRecipient, sanitizeDmContent],
|
|
80
|
+
}),
|
|
81
|
+
registry.register("create_bounty", {
|
|
82
|
+
input: [validateBountyReward, validateBountyDeadline],
|
|
83
|
+
}),
|
|
84
|
+
];
|
|
85
|
+
return () => {
|
|
86
|
+
for (const dispose of disposers)
|
|
87
|
+
dispose();
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=defaultGuardrails.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultGuardrails.js","sourceRoot":"","sources":["../src/defaultGuardrails.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEL,qBAAqB,GAEtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,qDAAqD;AACrD,MAAM,UAAU,GAAG,qBAAqB,CAAC;AAEzC,kFAAkF;AAClF,MAAM,cAAc,GAAG,IAAI,CAAC;AAS5B,MAAM,mBAAmB,GAA+B,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;IACjE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACnD,MAAM,IAAI,qBAAqB,CAC7B,oDAAoD,CACrD,CAAC;IACJ,CAAC;IACD,sEAAsE;IACtE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;AAClC,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAA+B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;IACpE,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,qBAAqB,CAAC,4BAA4B,CAAC,CAAC;IAChE,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,qBAAqB,CAAC,6BAA6B,CAAC,CAAC;IACjE,CAAC;IACD,yEAAyE;IACzE,oEAAoE;IACpE,OAAO,EAAE,OAAO,EAAE,iBAAiB,CAAC,OAAO,EAA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