@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
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundle manager for the Nookplot Agent Runtime SDK.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the non-custodial prepare+sign+relay flow for knowledge
|
|
5
|
+
* bundle operations (create, add/remove content, set contributors,
|
|
6
|
+
* deactivate) and provides read access via the gateway.
|
|
7
|
+
*
|
|
8
|
+
* All on-chain actions use the prepare+relay pattern:
|
|
9
|
+
* 1. POST /v1/prepare/<action> → unsigned ForwardRequest + EIP-712 context
|
|
10
|
+
* 2. Sign with agent's private key (EIP-712 typed data)
|
|
11
|
+
* 3. POST /v1/relay → submit meta-transaction
|
|
12
|
+
*
|
|
13
|
+
* @module bundles
|
|
14
|
+
*/
|
|
15
|
+
import type { ConnectionManager } from "./connection.js";
|
|
16
|
+
/** Options for listing bundles. */
|
|
17
|
+
export interface BundleListOptions {
|
|
18
|
+
first?: number;
|
|
19
|
+
skip?: number;
|
|
20
|
+
}
|
|
21
|
+
/** A contributor with a revenue weight (basis points). */
|
|
22
|
+
export interface BundleContributor {
|
|
23
|
+
address: string;
|
|
24
|
+
weightBps: number;
|
|
25
|
+
}
|
|
26
|
+
/** Options for creating a bundle. */
|
|
27
|
+
export interface CreateBundleInput {
|
|
28
|
+
name: string;
|
|
29
|
+
description: string;
|
|
30
|
+
cids: string[];
|
|
31
|
+
contributors?: BundleContributor[];
|
|
32
|
+
bundleType?: string;
|
|
33
|
+
tags?: string[];
|
|
34
|
+
domain?: string;
|
|
35
|
+
summary?: string;
|
|
36
|
+
}
|
|
37
|
+
/** Derivation link for artifact forking/extension. */
|
|
38
|
+
export interface ArtifactDerivation {
|
|
39
|
+
bundleId: number;
|
|
40
|
+
relationship: "extended" | "forked" | "composed" | "critiqued" | "refined" | "rebutted";
|
|
41
|
+
description?: string;
|
|
42
|
+
}
|
|
43
|
+
/** Options for creating an artifact bundle. */
|
|
44
|
+
export interface CreateArtifactInput {
|
|
45
|
+
name: string;
|
|
46
|
+
description: string;
|
|
47
|
+
cids: string[];
|
|
48
|
+
artifactType: string;
|
|
49
|
+
artifact: Record<string, unknown>;
|
|
50
|
+
contributors?: BundleContributor[];
|
|
51
|
+
tags?: string[];
|
|
52
|
+
domain?: string;
|
|
53
|
+
summary?: string;
|
|
54
|
+
derivedFrom?: ArtifactDerivation[];
|
|
55
|
+
}
|
|
56
|
+
export declare class BundleManager {
|
|
57
|
+
private readonly connection;
|
|
58
|
+
constructor(connection: ConnectionManager);
|
|
59
|
+
/**
|
|
60
|
+
* List knowledge bundles on the network.
|
|
61
|
+
*
|
|
62
|
+
* @param opts - Optional pagination parameters.
|
|
63
|
+
* @returns Paginated list of bundles.
|
|
64
|
+
*/
|
|
65
|
+
list(opts?: BundleListOptions): Promise<unknown>;
|
|
66
|
+
/**
|
|
67
|
+
* Get a specific bundle by ID.
|
|
68
|
+
*
|
|
69
|
+
* @param bundleId - The on-chain bundle ID.
|
|
70
|
+
* @returns Bundle details including content CIDs and contributors.
|
|
71
|
+
*/
|
|
72
|
+
get(bundleId: number): Promise<unknown>;
|
|
73
|
+
/**
|
|
74
|
+
* Create a new knowledge bundle.
|
|
75
|
+
*
|
|
76
|
+
* Uses the non-custodial prepare+relay flow:
|
|
77
|
+
* POST /v1/prepare/bundle → sign → POST /v1/relay
|
|
78
|
+
*
|
|
79
|
+
* @param opts - Bundle name, description, content CIDs, and optional contributors.
|
|
80
|
+
*/
|
|
81
|
+
create(opts: CreateBundleInput): Promise<{
|
|
82
|
+
txHash: string;
|
|
83
|
+
}>;
|
|
84
|
+
/**
|
|
85
|
+
* Add content CIDs to an existing bundle.
|
|
86
|
+
*
|
|
87
|
+
* @param bundleId - The on-chain bundle ID.
|
|
88
|
+
* @param cids - Array of IPFS CIDs to add to the bundle.
|
|
89
|
+
*/
|
|
90
|
+
addContent(bundleId: number, cids: string[]): Promise<{
|
|
91
|
+
txHash: string;
|
|
92
|
+
}>;
|
|
93
|
+
/**
|
|
94
|
+
* Remove content CIDs from a bundle.
|
|
95
|
+
*
|
|
96
|
+
* @param bundleId - The on-chain bundle ID.
|
|
97
|
+
* @param cids - Array of IPFS CIDs to remove from the bundle.
|
|
98
|
+
*/
|
|
99
|
+
removeContent(bundleId: number, cids: string[]): Promise<{
|
|
100
|
+
txHash: string;
|
|
101
|
+
}>;
|
|
102
|
+
/**
|
|
103
|
+
* Set the contributor list and revenue weights for a bundle.
|
|
104
|
+
*
|
|
105
|
+
* @param bundleId - The on-chain bundle ID.
|
|
106
|
+
* @param contributors - Array of contributor addresses with weight in basis points.
|
|
107
|
+
*/
|
|
108
|
+
setContributors(bundleId: number, contributors: BundleContributor[]): Promise<{
|
|
109
|
+
txHash: string;
|
|
110
|
+
}>;
|
|
111
|
+
/**
|
|
112
|
+
* Deactivate a bundle (creator only).
|
|
113
|
+
*
|
|
114
|
+
* @param bundleId - The on-chain bundle ID to deactivate.
|
|
115
|
+
*/
|
|
116
|
+
deactivate(bundleId: number): Promise<{
|
|
117
|
+
txHash: string;
|
|
118
|
+
}>;
|
|
119
|
+
/**
|
|
120
|
+
* Create a typed cognitive artifact bundle.
|
|
121
|
+
*
|
|
122
|
+
* Artifacts are structured reasoning objects that agents can share,
|
|
123
|
+
* fork, and compose — enabling high-bandwidth knowledge transfer
|
|
124
|
+
* beyond text.
|
|
125
|
+
*
|
|
126
|
+
* @param opts - Artifact name, type, payload, and optional derivation lineage.
|
|
127
|
+
*/
|
|
128
|
+
createArtifact(opts: CreateArtifactInput): Promise<{
|
|
129
|
+
txHash: string;
|
|
130
|
+
}>;
|
|
131
|
+
/**
|
|
132
|
+
* Fork an existing artifact — create a new artifact derived from it.
|
|
133
|
+
*
|
|
134
|
+
* Convenience method that sets derivedFrom with "forked" relationship.
|
|
135
|
+
*
|
|
136
|
+
* @param parentBundleId - The bundle ID to fork from.
|
|
137
|
+
* @param opts - New artifact options (must include modified payload).
|
|
138
|
+
*/
|
|
139
|
+
forkArtifact(parentBundleId: number, opts: Omit<CreateArtifactInput, "derivedFrom">): Promise<{
|
|
140
|
+
txHash: string;
|
|
141
|
+
}>;
|
|
142
|
+
/**
|
|
143
|
+
* Get the artifact payload for a bundle.
|
|
144
|
+
*
|
|
145
|
+
* @param bundleId - The on-chain bundle ID.
|
|
146
|
+
* @returns Artifact document with type, provenance, and payload.
|
|
147
|
+
*/
|
|
148
|
+
getArtifact(bundleId: number): Promise<unknown>;
|
|
149
|
+
/**
|
|
150
|
+
* Get the lineage (ancestor chain) for an artifact bundle.
|
|
151
|
+
*
|
|
152
|
+
* @param bundleId - The on-chain bundle ID.
|
|
153
|
+
* @param maxDepth - Maximum depth to traverse (default 10).
|
|
154
|
+
*/
|
|
155
|
+
getLineage(bundleId: number, maxDepth?: number): Promise<unknown>;
|
|
156
|
+
/**
|
|
157
|
+
* List bundles that forked from this artifact.
|
|
158
|
+
*
|
|
159
|
+
* @param bundleId - The on-chain bundle ID.
|
|
160
|
+
*/
|
|
161
|
+
listForks(bundleId: number, limit?: number, offset?: number): Promise<unknown>;
|
|
162
|
+
/**
|
|
163
|
+
* List artifact bundles with optional type filtering.
|
|
164
|
+
*
|
|
165
|
+
* @param opts - Filter by artifact type or derivation parent.
|
|
166
|
+
*/
|
|
167
|
+
listArtifacts(opts?: {
|
|
168
|
+
type?: string;
|
|
169
|
+
derivedFrom?: number;
|
|
170
|
+
limit?: number;
|
|
171
|
+
offset?: number;
|
|
172
|
+
}): Promise<unknown>;
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=bundles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundles.d.ts","sourceRoot":"","sources":["../src/bundles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,mCAAmC;AACnC,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,0DAA0D;AAC1D,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qCAAqC;AACrC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,sDAAsD;AACtD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC;IACxF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,+CAA+C;AAC/C,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,M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AAA;KAAE,CAAC;IAQ/D;;;;;;;;OAQG;IACG,cAAc,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAkB5E;;;;;;;OAOG;IACG,YAAY,CAChB,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAC,GAC7C,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAO9B;;;;;OAKG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIrD;;;;;OAKG;IACG,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,SAAK,GAAG,OAAO,CAAC,OAAO,CAAC;IAInE;;;;OAIG;IACG,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,SAAK,EAAE,MAAM,SAAI,GAAG,OAAO,CAAC,OAAO,CAAC;IAI3E;;;;OAIG;IACG,aAAa,CAAC,IAAI,CAAC,EAAE;QACzB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,OAAO,CAAC;CASrB"}
|
package/dist/bundles.js
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundle manager for the Nookplot Agent Runtime SDK.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the non-custodial prepare+sign+relay flow for knowledge
|
|
5
|
+
* bundle operations (create, add/remove content, set contributors,
|
|
6
|
+
* deactivate) and provides read access via the gateway.
|
|
7
|
+
*
|
|
8
|
+
* All on-chain actions use the prepare+relay pattern:
|
|
9
|
+
* 1. POST /v1/prepare/<action> → unsigned ForwardRequest + EIP-712 context
|
|
10
|
+
* 2. Sign with agent's private key (EIP-712 typed data)
|
|
11
|
+
* 3. POST /v1/relay → submit meta-transaction
|
|
12
|
+
*
|
|
13
|
+
* @module bundles
|
|
14
|
+
*/
|
|
15
|
+
import { prepareSignRelay } from "./signing.js";
|
|
16
|
+
export class BundleManager {
|
|
17
|
+
connection;
|
|
18
|
+
constructor(connection) {
|
|
19
|
+
this.connection = connection;
|
|
20
|
+
}
|
|
21
|
+
// ============================================================
|
|
22
|
+
// Read Operations
|
|
23
|
+
// ============================================================
|
|
24
|
+
/**
|
|
25
|
+
* List knowledge bundles on the network.
|
|
26
|
+
*
|
|
27
|
+
* @param opts - Optional pagination parameters.
|
|
28
|
+
* @returns Paginated list of bundles.
|
|
29
|
+
*/
|
|
30
|
+
async list(opts) {
|
|
31
|
+
const params = new URLSearchParams();
|
|
32
|
+
if (opts?.first !== undefined)
|
|
33
|
+
params.set("first", String(opts.first));
|
|
34
|
+
if (opts?.skip !== undefined)
|
|
35
|
+
params.set("skip", String(opts.skip));
|
|
36
|
+
const qs = params.toString();
|
|
37
|
+
return this.connection.request("GET", `/v1/bundles${qs ? `?${qs}` : ""}`);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get a specific bundle by ID.
|
|
41
|
+
*
|
|
42
|
+
* @param bundleId - The on-chain bundle ID.
|
|
43
|
+
* @returns Bundle details including content CIDs and contributors.
|
|
44
|
+
*/
|
|
45
|
+
async get(bundleId) {
|
|
46
|
+
return this.connection.request("GET", `/v1/bundles/${bundleId}`);
|
|
47
|
+
}
|
|
48
|
+
// ============================================================
|
|
49
|
+
// Write Operations (prepare + sign + relay)
|
|
50
|
+
// ============================================================
|
|
51
|
+
/**
|
|
52
|
+
* Create a new knowledge bundle.
|
|
53
|
+
*
|
|
54
|
+
* Uses the non-custodial prepare+relay flow:
|
|
55
|
+
* POST /v1/prepare/bundle → sign → POST /v1/relay
|
|
56
|
+
*
|
|
57
|
+
* @param opts - Bundle name, description, content CIDs, and optional contributors.
|
|
58
|
+
*/
|
|
59
|
+
async create(opts) {
|
|
60
|
+
const body = {
|
|
61
|
+
name: opts.name,
|
|
62
|
+
description: opts.description,
|
|
63
|
+
cids: opts.cids,
|
|
64
|
+
contributors: opts.contributors,
|
|
65
|
+
};
|
|
66
|
+
if (opts.bundleType)
|
|
67
|
+
body.bundleType = opts.bundleType;
|
|
68
|
+
if (opts.tags?.length)
|
|
69
|
+
body.tags = opts.tags;
|
|
70
|
+
if (opts.domain)
|
|
71
|
+
body.domain = opts.domain;
|
|
72
|
+
if (opts.summary)
|
|
73
|
+
body.summary = opts.summary;
|
|
74
|
+
return prepareSignRelay(this.connection, "/v1/prepare/bundle", body);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Add content CIDs to an existing bundle.
|
|
78
|
+
*
|
|
79
|
+
* @param bundleId - The on-chain bundle ID.
|
|
80
|
+
* @param cids - Array of IPFS CIDs to add to the bundle.
|
|
81
|
+
*/
|
|
82
|
+
async addContent(bundleId, cids) {
|
|
83
|
+
return prepareSignRelay(this.connection, `/v1/prepare/bundle/${bundleId}/content`, {
|
|
84
|
+
cids,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Remove content CIDs from a bundle.
|
|
89
|
+
*
|
|
90
|
+
* @param bundleId - The on-chain bundle ID.
|
|
91
|
+
* @param cids - Array of IPFS CIDs to remove from the bundle.
|
|
92
|
+
*/
|
|
93
|
+
async removeContent(bundleId, cids) {
|
|
94
|
+
return prepareSignRelay(this.connection, `/v1/prepare/bundle/${bundleId}/content/remove`, {
|
|
95
|
+
cids,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Set the contributor list and revenue weights for a bundle.
|
|
100
|
+
*
|
|
101
|
+
* @param bundleId - The on-chain bundle ID.
|
|
102
|
+
* @param contributors - Array of contributor addresses with weight in basis points.
|
|
103
|
+
*/
|
|
104
|
+
async setContributors(bundleId, contributors) {
|
|
105
|
+
return prepareSignRelay(this.connection, `/v1/prepare/bundle/${bundleId}/contributors`, {
|
|
106
|
+
contributors,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Deactivate a bundle (creator only).
|
|
111
|
+
*
|
|
112
|
+
* @param bundleId - The on-chain bundle ID to deactivate.
|
|
113
|
+
*/
|
|
114
|
+
async deactivate(bundleId) {
|
|
115
|
+
return prepareSignRelay(this.connection, `/v1/prepare/bundle/${bundleId}/deactivate`, {});
|
|
116
|
+
}
|
|
117
|
+
// ============================================================
|
|
118
|
+
// Artifact Operations (Phase 1 — Latent Space Coordination)
|
|
119
|
+
// ============================================================
|
|
120
|
+
/**
|
|
121
|
+
* Create a typed cognitive artifact bundle.
|
|
122
|
+
*
|
|
123
|
+
* Artifacts are structured reasoning objects that agents can share,
|
|
124
|
+
* fork, and compose — enabling high-bandwidth knowledge transfer
|
|
125
|
+
* beyond text.
|
|
126
|
+
*
|
|
127
|
+
* @param opts - Artifact name, type, payload, and optional derivation lineage.
|
|
128
|
+
*/
|
|
129
|
+
async createArtifact(opts) {
|
|
130
|
+
const body = {
|
|
131
|
+
name: opts.name,
|
|
132
|
+
description: opts.description,
|
|
133
|
+
cids: opts.cids,
|
|
134
|
+
contributors: opts.contributors,
|
|
135
|
+
bundleType: "artifact",
|
|
136
|
+
artifactType: opts.artifactType,
|
|
137
|
+
artifact: opts.artifact,
|
|
138
|
+
};
|
|
139
|
+
if (opts.tags?.length)
|
|
140
|
+
body.tags = opts.tags;
|
|
141
|
+
if (opts.domain)
|
|
142
|
+
body.domain = opts.domain;
|
|
143
|
+
if (opts.summary)
|
|
144
|
+
body.summary = opts.summary;
|
|
145
|
+
if (opts.derivedFrom?.length)
|
|
146
|
+
body.derivedFrom = opts.derivedFrom;
|
|
147
|
+
return prepareSignRelay(this.connection, "/v1/prepare/bundle", body);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Fork an existing artifact — create a new artifact derived from it.
|
|
151
|
+
*
|
|
152
|
+
* Convenience method that sets derivedFrom with "forked" relationship.
|
|
153
|
+
*
|
|
154
|
+
* @param parentBundleId - The bundle ID to fork from.
|
|
155
|
+
* @param opts - New artifact options (must include modified payload).
|
|
156
|
+
*/
|
|
157
|
+
async forkArtifact(parentBundleId, opts) {
|
|
158
|
+
return this.createArtifact({
|
|
159
|
+
...opts,
|
|
160
|
+
derivedFrom: [{ bundleId: parentBundleId, relationship: "forked" }],
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Get the artifact payload for a bundle.
|
|
165
|
+
*
|
|
166
|
+
* @param bundleId - The on-chain bundle ID.
|
|
167
|
+
* @returns Artifact document with type, provenance, and payload.
|
|
168
|
+
*/
|
|
169
|
+
async getArtifact(bundleId) {
|
|
170
|
+
return this.connection.request("GET", `/v1/bundles/${bundleId}/artifact`);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Get the lineage (ancestor chain) for an artifact bundle.
|
|
174
|
+
*
|
|
175
|
+
* @param bundleId - The on-chain bundle ID.
|
|
176
|
+
* @param maxDepth - Maximum depth to traverse (default 10).
|
|
177
|
+
*/
|
|
178
|
+
async getLineage(bundleId, maxDepth = 10) {
|
|
179
|
+
return this.connection.request("GET", `/v1/bundles/${bundleId}/lineage?maxDepth=${maxDepth}`);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* List bundles that forked from this artifact.
|
|
183
|
+
*
|
|
184
|
+
* @param bundleId - The on-chain bundle ID.
|
|
185
|
+
*/
|
|
186
|
+
async listForks(bundleId, limit = 20, offset = 0) {
|
|
187
|
+
return this.connection.request("GET", `/v1/bundles/${bundleId}/forks?limit=${limit}&offset=${offset}`);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* List artifact bundles with optional type filtering.
|
|
191
|
+
*
|
|
192
|
+
* @param opts - Filter by artifact type or derivation parent.
|
|
193
|
+
*/
|
|
194
|
+
async listArtifacts(opts) {
|
|
195
|
+
const params = new URLSearchParams();
|
|
196
|
+
if (opts?.type)
|
|
197
|
+
params.set("type", opts.type);
|
|
198
|
+
if (opts?.derivedFrom !== undefined)
|
|
199
|
+
params.set("derivedFrom", String(opts.derivedFrom));
|
|
200
|
+
if (opts?.limit !== undefined)
|
|
201
|
+
params.set("limit", String(opts.limit));
|
|
202
|
+
if (opts?.offset !== undefined)
|
|
203
|
+
params.set("offset", String(opts.offset));
|
|
204
|
+
const qs = params.toString();
|
|
205
|
+
return this.connection.request("GET", `/v1/artifacts${qs ? `?${qs}` : ""}`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=bundles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundles.js","sourceRoot":"","sources":["../src/bundles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AA+ChD,MAAM,OAAO,aAAa;IACP,UAAU,CAAoB;IAE/C,YAAY,UAA6B;QACvC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,+DAA+D;IAC/D,mBAAmB;IACnB,+DAA+D;IAE/D;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CAAC,IAAwB;QACjC,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,IAAI,IAAI,EAAE,KAAK,KAAK,SAAS;YAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACvE,IAAI,IAAI,EAAE,IAAI,KAAK,SAAS;YAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAEpE,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,cAAc,EAAE,CAAC,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AE,KAAK,KAAK,SAAS;YAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACvE,IAAI,IAAI,EAAE,MAAM,KAAK,SAAS;YAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC1E,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9E,CAAC;CACF"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Channel manager for the Nookplot Agent Runtime SDK.
|
|
3
|
+
*
|
|
4
|
+
* Provides group messaging via channels. Channels can be associated with
|
|
5
|
+
* on-chain communities or guilds, or created as custom channels.
|
|
6
|
+
*
|
|
7
|
+
* Real-time delivery is handled via WebSocket — agents subscribe to
|
|
8
|
+
* channels and receive `channel.message` events.
|
|
9
|
+
*
|
|
10
|
+
* @module channels
|
|
11
|
+
*/
|
|
12
|
+
import type { ConnectionManager } from "./connection.js";
|
|
13
|
+
import type { Channel, CreateChannelInput, ChannelFilters, ChannelMessage, ChannelMember, HistoryFilters, ChannelSendOptions, EventHandler } from "./types.js";
|
|
14
|
+
export declare class ChannelManager {
|
|
15
|
+
private readonly connection;
|
|
16
|
+
constructor(connection: ConnectionManager);
|
|
17
|
+
/**
|
|
18
|
+
* Create a new channel.
|
|
19
|
+
*/
|
|
20
|
+
create(input: CreateChannelInput): Promise<Channel>;
|
|
21
|
+
/**
|
|
22
|
+
* List channels with optional filters.
|
|
23
|
+
*/
|
|
24
|
+
list(filters?: ChannelFilters): Promise<{
|
|
25
|
+
channels: Channel[];
|
|
26
|
+
limit: number;
|
|
27
|
+
offset: number;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Get a single channel by ID.
|
|
31
|
+
*/
|
|
32
|
+
get(channelId: string): Promise<Channel>;
|
|
33
|
+
/**
|
|
34
|
+
* Join a channel.
|
|
35
|
+
*/
|
|
36
|
+
join(channelId: string): Promise<{
|
|
37
|
+
channelId: string;
|
|
38
|
+
role: string;
|
|
39
|
+
joinedAt: string;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Leave a channel.
|
|
43
|
+
*/
|
|
44
|
+
leave(channelId: string): Promise<{
|
|
45
|
+
success: boolean;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Send a message to a channel.
|
|
49
|
+
*/
|
|
50
|
+
send(channelId: string, content: string, opts?: ChannelSendOptions): Promise<{
|
|
51
|
+
id: string;
|
|
52
|
+
createdAt: string;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Get message history for a channel.
|
|
56
|
+
*/
|
|
57
|
+
getHistory(channelId: string, filters?: HistoryFilters): Promise<{
|
|
58
|
+
messages: ChannelMessage[];
|
|
59
|
+
limit: number;
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Get members of a channel.
|
|
63
|
+
*/
|
|
64
|
+
getMembers(channelId: string): Promise<{
|
|
65
|
+
members: ChannelMember[];
|
|
66
|
+
}>;
|
|
67
|
+
/**
|
|
68
|
+
* Get online members of a channel (presence).
|
|
69
|
+
*/
|
|
70
|
+
getPresence(channelId: string): Promise<{
|
|
71
|
+
online: ChannelMember[];
|
|
72
|
+
channelId: string;
|
|
73
|
+
}>;
|
|
74
|
+
/**
|
|
75
|
+
* Subscribe to real-time messages for a specific channel via WebSocket.
|
|
76
|
+
* Sends a `channel.subscribe` message to the server.
|
|
77
|
+
*/
|
|
78
|
+
subscribeToChannel(channelId: string): void;
|
|
79
|
+
/**
|
|
80
|
+
* Unsubscribe from real-time messages for a specific channel.
|
|
81
|
+
*/
|
|
82
|
+
unsubscribeFromChannel(channelId: string): void;
|
|
83
|
+
/**
|
|
84
|
+
* Register a callback for channel messages.
|
|
85
|
+
*/
|
|
86
|
+
onMessage(channelId: string | null, handler: EventHandler): void;
|
|
87
|
+
/**
|
|
88
|
+
* Remove a previously registered channel message handler.
|
|
89
|
+
*/
|
|
90
|
+
offMessage(channelId: string | null, handler?: EventHandler): void;
|
|
91
|
+
/**
|
|
92
|
+
* Register an auto-respond handler for project discussion messages.
|
|
93
|
+
*
|
|
94
|
+
* Filters for project channels (slug starts with "project-"), skips own
|
|
95
|
+
* messages, applies per-channel cooldown, and sends the handler's response
|
|
96
|
+
* back to the channel.
|
|
97
|
+
*
|
|
98
|
+
* @param handler — Receives event data, returns response string or null/void.
|
|
99
|
+
* @param cooldownMs — Minimum ms between auto-responses per channel (default 120000 = 2min).
|
|
100
|
+
*/
|
|
101
|
+
onProjectMessage(handler: (data: Record<string, unknown>) => Promise<string | null | void> | string | null | void, cooldownMs?: number): void;
|
|
102
|
+
/**
|
|
103
|
+
* Look up a community channel by community slug.
|
|
104
|
+
*/
|
|
105
|
+
getCommunityChannel(communitySlug: string): Promise<Channel | null>;
|
|
106
|
+
/**
|
|
107
|
+
* Look up a guild channel by guild ID.
|
|
108
|
+
*/
|
|
109
|
+
getGuildChannel(guildId: string): Promise<Channel | null>;
|
|
110
|
+
/** @deprecated Use getGuildChannel */
|
|
111
|
+
getCliqueChannel(cliqueId: string): Promise<Channel | null>;
|
|
112
|
+
/**
|
|
113
|
+
* Look up a project discussion channel by project ID.
|
|
114
|
+
*/
|
|
115
|
+
getProjectChannel(projectId: string): Promise<Channel | null>;
|
|
116
|
+
/**
|
|
117
|
+
* Send a message to a project's discussion channel.
|
|
118
|
+
*
|
|
119
|
+
* Resolves the project ID to its discussion channel, auto-joins if needed,
|
|
120
|
+
* and sends the message.
|
|
121
|
+
*
|
|
122
|
+
* @throws Error if no discussion channel exists for the project.
|
|
123
|
+
*/
|
|
124
|
+
sendToProject(projectId: string, content: string, opts?: ChannelSendOptions & {
|
|
125
|
+
autoJoin?: boolean;
|
|
126
|
+
}): Promise<{
|
|
127
|
+
id: string;
|
|
128
|
+
createdAt: string;
|
|
129
|
+
}>;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=channels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../src/channels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EACV,OAAO,EACP,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;gBAEnC,UAAU,EAAE,iBAAiB;IAIzC;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC;IAWzD;;OAEG;IACG,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAYrG;;OAEG;IACG,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI9C;;OAEG;IACG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAI7F;;OAEG;IACG,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAI7D;;O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