Reference

Reference

CLI — @taskclan/create-hivemind-app

npm create @taskclan/hivemind-app@latest <dir> [-- --template <name>] [-- --yes]
  • <dir> — target directory (prompted if omitted in a TTY).
  • --template / -tnode-starter | react-chat | next-ai-chat | agent-worker.
  • --yes / -y — non-interactive; use defaults.

@taskclan/platform

import { createPlatformClient } from '@taskclan/platform';
 
const client = createPlatformClient({ baseUrl, product, getToken });
MethodDoes
dispatchIntent(type, input, opts?)Dispatch a Hive intent; resolves to the final result.
trackEvent(event) / trackEvents(events)Emit platform events (the spine + learning loop).
checkEntitlement(product, feature) / hasAccess(product, feature)Server-truth entitlement checks.
getIdentity() / hasRole(role)Unified identity + platform role.
listAgents() / listSkills() / listWorkflows()Discover the registries.

@taskclan/hivemind

import { createHivemindClient } from '@taskclan/hivemind';
 
const hivemind = createHivemindClient({ baseUrl, product, getToken });
MethodDoes
runAgent(name, input)Run a named agent from the registry.
rememberFamilyMemory(...) / recallMemories(...)Shared memory read/write.
recallInsights({ product })Cross-product insights for your product.
recommendDefaults(product)Insight-driven defaults — call BEFORE acting.

Built on @taskclan/platform; everything that client exposes is available too.

@taskclan/hivemind-react

import { HivemindProvider, HivemindChat, AgentCard, UsageBadge, useChat } from '@taskclan/hivemind-react';
 
<HivemindProvider config={{ baseUrl, product, getToken }}>
  <HivemindChat intent="assistant.chat" placeholder="Ask anything…" />
</HivemindProvider>
ExportWhat it is
<HivemindProvider config>Context: holds the platform client.
<HivemindChat intent>A chat UI that dispatches intent and renders the reply.
useChat({ intent })The headless hook behind <HivemindChat> (messages + send).
<AgentCard agent>Renders an agent from listAgents().
<UsageBadge>Shows model usage/cost for the current product.

The intent endpoint (no SDK)

POST /api/hive/v1/intent
Authorization: Bearer <token>
Content-Type: application/json

{ "intent": { "type": "marketplace.list", "input": {} },
  "actor": { "ref": { "id": "<user-id>", "product": "my-app" } } }

Responds with Server-Sent Events; the terminal intent-final event carries the result.