@clude/sdk 3.0.3 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli/index.js +2284 -157
- package/dist/mcp/server.js +515 -27
- package/dist/sdk/index.js +517 -29
- package/package.json +8 -10
- package/supabase-schema.sql +107 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clude/sdk",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"mcpName": "io.github.sebbsssss/clude",
|
|
5
5
|
"description": "Persistent memory SDK for AI agents — Stanford Generative Agents architecture on Supabase + pgvector",
|
|
6
6
|
"main": "dist/sdk/index.js",
|
|
@@ -25,13 +25,6 @@
|
|
|
25
25
|
"README.md",
|
|
26
26
|
"LICENSE"
|
|
27
27
|
],
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build:publish": "node scripts/build-publish.mjs",
|
|
30
|
-
"prepublishOnly": "pnpm --filter @clude/shared build && pnpm --filter @clude/brain build && node scripts/build-publish.mjs",
|
|
31
|
-
"typecheck": "tsc --noEmit",
|
|
32
|
-
"dashboard": "cd apps/dashboard && pnpm run dev",
|
|
33
|
-
"dashboard:build": "cd apps/dashboard && pnpm run build"
|
|
34
|
-
},
|
|
35
28
|
"keywords": [
|
|
36
29
|
"ai-agent",
|
|
37
30
|
"memory",
|
|
@@ -70,7 +63,6 @@
|
|
|
70
63
|
"engines": {
|
|
71
64
|
"node": ">=18.0.0"
|
|
72
65
|
},
|
|
73
|
-
"packageManager": "pnpm@10.18.1",
|
|
74
66
|
"dependencies": {
|
|
75
67
|
"@ai-sdk/anthropic": "^3.0.64",
|
|
76
68
|
"@ai-sdk/google": "^3.0.55",
|
|
@@ -111,5 +103,11 @@
|
|
|
111
103
|
},
|
|
112
104
|
"optionalDependencies": {
|
|
113
105
|
"utf-8-validate": "^5.0.10"
|
|
106
|
+
},
|
|
107
|
+
"scripts": {
|
|
108
|
+
"build:publish": "node scripts/build-publish.mjs",
|
|
109
|
+
"typecheck": "tsc --noEmit",
|
|
110
|
+
"dashboard": "cd apps/dashboard && pnpm run dev",
|
|
111
|
+
"dashboard:build": "cd apps/dashboard && pnpm run build"
|
|
114
112
|
}
|
|
115
|
-
}
|
|
113
|
+
}
|
package/supabase-schema.sql
CHANGED
|
@@ -529,3 +529,110 @@ CREATE TABLE IF NOT EXISTS chat_usage (
|
|
|
529
529
|
);
|
|
530
530
|
|
|
531
531
|
CREATE INDEX IF NOT EXISTS idx_chat_usage_wallet ON chat_usage(wallet_address, created_at DESC);
|
|
532
|
+
|
|
533
|
+
-- ─────────── Wiki pack installations (PR #138) ───────────
|
|
534
|
+
-- Tracks which wiki packs (Workspace, Compliance, Sales, future third-party
|
|
535
|
+
-- packs) each wallet has installed. Drives the topic rail in /wiki and the
|
|
536
|
+
-- auto-categorisation rules applied to incoming memories.
|
|
537
|
+
|
|
538
|
+
CREATE TABLE IF NOT EXISTS wiki_pack_installations (
|
|
539
|
+
id BIGSERIAL PRIMARY KEY,
|
|
540
|
+
owner_wallet TEXT NOT NULL,
|
|
541
|
+
pack_id TEXT NOT NULL,
|
|
542
|
+
installed_at TIMESTAMPTZ DEFAULT NOW(),
|
|
543
|
+
UNIQUE (owner_wallet, pack_id)
|
|
544
|
+
);
|
|
545
|
+
|
|
546
|
+
CREATE INDEX IF NOT EXISTS idx_wiki_pack_installations_owner
|
|
547
|
+
ON wiki_pack_installations(owner_wallet);
|
|
548
|
+
|
|
549
|
+
-- ─────────── PMP tokenisation (migration 019) ───────────
|
|
550
|
+
-- Tokenisation columns on memories so each memory can carry a content hash
|
|
551
|
+
-- + compressed-NFT address on Solana. Content-bundle Pack registry and
|
|
552
|
+
-- Merkle-tree-aware join table for selective disclosure.
|
|
553
|
+
-- See packages/database/migrations/019_pmp_tokenisation.sql for full notes.
|
|
554
|
+
|
|
555
|
+
ALTER TABLE memories
|
|
556
|
+
ADD COLUMN IF NOT EXISTS content_hash TEXT,
|
|
557
|
+
ADD COLUMN IF NOT EXISTS cnft_address TEXT,
|
|
558
|
+
ADD COLUMN IF NOT EXISTS cnft_tree TEXT,
|
|
559
|
+
ADD COLUMN IF NOT EXISTS cnft_leaf_index BIGINT,
|
|
560
|
+
ADD COLUMN IF NOT EXISTS cnft_tx_sig TEXT,
|
|
561
|
+
ADD COLUMN IF NOT EXISTS tokenization_status TEXT
|
|
562
|
+
CHECK (tokenization_status IN ('pending', 'minted', 'skipped', 'failed')),
|
|
563
|
+
ADD COLUMN IF NOT EXISTS tokenized_at TIMESTAMPTZ;
|
|
564
|
+
|
|
565
|
+
CREATE INDEX IF NOT EXISTS idx_memories_content_hash
|
|
566
|
+
ON memories(content_hash) WHERE content_hash IS NOT NULL;
|
|
567
|
+
CREATE INDEX IF NOT EXISTS idx_memories_cnft_address
|
|
568
|
+
ON memories(cnft_address) WHERE cnft_address IS NOT NULL;
|
|
569
|
+
CREATE INDEX IF NOT EXISTS idx_memories_tok_status
|
|
570
|
+
ON memories(tokenization_status)
|
|
571
|
+
WHERE tokenization_status IN ('pending', 'failed');
|
|
572
|
+
|
|
573
|
+
CREATE TABLE IF NOT EXISTS cnft_trees (
|
|
574
|
+
tree_address TEXT PRIMARY KEY,
|
|
575
|
+
capacity INTEGER NOT NULL,
|
|
576
|
+
current_leaves INTEGER NOT NULL DEFAULT 0,
|
|
577
|
+
is_active BOOLEAN DEFAULT TRUE,
|
|
578
|
+
created_at TIMESTAMPTZ DEFAULT NOW()
|
|
579
|
+
);
|
|
580
|
+
|
|
581
|
+
CREATE INDEX IF NOT EXISTS idx_cnft_trees_active
|
|
582
|
+
ON cnft_trees(is_active) WHERE is_active = TRUE;
|
|
583
|
+
|
|
584
|
+
CREATE TABLE IF NOT EXISTS memory_packs (
|
|
585
|
+
pack_id TEXT PRIMARY KEY,
|
|
586
|
+
manifest_id TEXT,
|
|
587
|
+
author_wallet TEXT NOT NULL,
|
|
588
|
+
name TEXT NOT NULL,
|
|
589
|
+
description TEXT,
|
|
590
|
+
version TEXT NOT NULL,
|
|
591
|
+
memory_count INTEGER NOT NULL,
|
|
592
|
+
created_at TIMESTAMPTZ DEFAULT NOW(),
|
|
593
|
+
published_at TIMESTAMPTZ,
|
|
594
|
+
merkle_root TEXT,
|
|
595
|
+
pack_token_address TEXT,
|
|
596
|
+
pack_token_tx_sig TEXT,
|
|
597
|
+
pack_schema_version SMALLINT DEFAULT 1,
|
|
598
|
+
gate_uri TEXT,
|
|
599
|
+
tokenized_at TIMESTAMPTZ
|
|
600
|
+
);
|
|
601
|
+
|
|
602
|
+
CREATE INDEX IF NOT EXISTS idx_memory_packs_author
|
|
603
|
+
ON memory_packs(author_wallet);
|
|
604
|
+
CREATE INDEX IF NOT EXISTS idx_memory_packs_published
|
|
605
|
+
ON memory_packs(published_at) WHERE published_at IS NOT NULL;
|
|
606
|
+
CREATE INDEX IF NOT EXISTS idx_memory_packs_token
|
|
607
|
+
ON memory_packs(pack_token_address) WHERE pack_token_address IS NOT NULL;
|
|
608
|
+
|
|
609
|
+
CREATE TABLE IF NOT EXISTS memory_pack_contents (
|
|
610
|
+
pack_id TEXT NOT NULL REFERENCES memory_packs(pack_id) ON DELETE CASCADE,
|
|
611
|
+
memory_id BIGINT NOT NULL REFERENCES memories(id) ON DELETE RESTRICT,
|
|
612
|
+
leaf_index INTEGER NOT NULL,
|
|
613
|
+
content_hash TEXT NOT NULL,
|
|
614
|
+
PRIMARY KEY (pack_id, memory_id),
|
|
615
|
+
UNIQUE (pack_id, leaf_index)
|
|
616
|
+
);
|
|
617
|
+
|
|
618
|
+
CREATE INDEX IF NOT EXISTS idx_memory_pack_contents_memory
|
|
619
|
+
ON memory_pack_contents(memory_id);
|
|
620
|
+
|
|
621
|
+
-- ─────────── PMP batch tokenisation (migration 020) ───────────
|
|
622
|
+
-- The backfill commits memories in batches: one Merkle root on-chain for
|
|
623
|
+
-- many memories. This table records each batch so a memory's inclusion
|
|
624
|
+
-- proof can be regenerated (memories.cnft_tree holds the batch merkle_root).
|
|
625
|
+
|
|
626
|
+
CREATE TABLE IF NOT EXISTS memory_batches (
|
|
627
|
+
batch_id TEXT PRIMARY KEY,
|
|
628
|
+
merkle_root TEXT NOT NULL,
|
|
629
|
+
memory_count INTEGER NOT NULL,
|
|
630
|
+
leaves JSONB NOT NULL,
|
|
631
|
+
commitment_asset TEXT,
|
|
632
|
+
commitment_tx_sig TEXT,
|
|
633
|
+
chain TEXT NOT NULL DEFAULT 'solana',
|
|
634
|
+
created_at TIMESTAMPTZ DEFAULT NOW()
|
|
635
|
+
);
|
|
636
|
+
|
|
637
|
+
CREATE INDEX IF NOT EXISTS idx_memory_batches_root
|
|
638
|
+
ON memory_batches(merkle_root);
|