@taskclan/sdk 1.0.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/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) Taskclan. All rights reserved.
2
+
3
+ This software and its source code are proprietary and confidential. No license,
4
+ express or implied, is granted to use, copy, modify, distribute, or sublicense
5
+ this software except as explicitly authorized in writing by Taskclan. It is
6
+ intended for use only within Taskclan products and by parties Taskclan has
7
+ authorized.
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # @taskclan/sdk
2
+
3
+ The typed client for the **Taskclan Taskclan** — the L3 agentic layer. Built on
4
+ [`@taskclan/platform`](../hive-sdk-ts), it adds the agent / skill / memory surface
5
+ so any product can:
6
+
7
+ - **`runAgent`** — run a named agent's capability (dispatch one of its Hive intents)
8
+ - **`runSkill`** — run a named skill's capability
9
+ - **`remember` / `recall` / `listMemories` / `forget`** — read & write shared memory
10
+ - **`listAgents` / `getAgent` / `listSkills` / `listWorkflows`** — discover the registry
11
+
12
+ It reuses the platform client's transport, so everything goes through Hive's one
13
+ endpoint (`POST /api/hive/v1/intent`). You also get `client.platform` for events,
14
+ entitlements, identity, and roles.
15
+
16
+ ## Install
17
+
18
+ Published privately to **GitHub Packages** under the `taskclan` org. Point the
19
+ `@taskclan` scope at GitHub's registry (one line covers both `@taskclan/platform`
20
+ and `@taskclan/sdk`) and authenticate with a `read:packages` token:
21
+
22
+ ```ini
23
+ # .npmrc (in the consuming repo)
24
+ @taskclan:registry=https://npm.pkg.github.com
25
+ //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
26
+ ```
27
+
28
+ ```bash
29
+ npm install @taskclan/sdk
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ```ts
35
+ import { createTaskclanClient } from '@taskclan/sdk';
36
+
37
+ const hive = createTaskclanClient({
38
+ baseUrl: 'https://engine.taskclan.com',
39
+ product: 'nani',
40
+ getToken: () => supabase.auth.getSession().then((s) => s.data.session?.access_token ?? null),
41
+ });
42
+
43
+ // Discover an agent's intents, then run one
44
+ const { agents } = await hive.listAgents();
45
+ const creator = agents.find((a) => a.id === 'gamenova-creator');
46
+ if (creator) {
47
+ const result = await hive.runAgent(creator.id, creator.intents[0], { /* input */ });
48
+ }
49
+
50
+ // Shared memory (household-scoped family vault)
51
+ await hive.remember({ householdId, type: 'allergy', key: 'peanuts', value: 'severe' });
52
+ const { memories } = await hive.listMemories({ householdId, type: 'allergy' });
53
+
54
+ // Escape hatch + the full platform client
55
+ await hive.platform.trackEvent('nani.household_created');
56
+ ```
57
+
58
+ Pass `{ validate: true }` to `runAgent` / `runSkill` to first check (against the
59
+ public registry) that the intent really belongs to that agent/skill.
60
+
61
+ ## Publishing
62
+
63
+ Bump `version` in `package.json`, then push a tag:
64
+
65
+ ```bash
66
+ git tag taskclan-sdk-v1.0.0 && git push origin taskclan-sdk-v1.0.0
67
+ ```
68
+
69
+ The **Publish @taskclan/sdk** GitHub Action builds and publishes to GitHub
70
+ Packages using the built-in `GITHUB_TOKEN` — no secret to configure.
@@ -0,0 +1,66 @@
1
+ /**
2
+ * createTaskclanClient — the typed client for the Taskclan Taskclan (L3).
3
+ *
4
+ * It wraps a @taskclan/platform client (the shared Hive transport) and layers
5
+ * the agentic surface on top: run named agents and skills, read/write shared
6
+ * memory, and discover the registries. `client.platform` exposes the underlying
7
+ * platform client for events, entitlements, identity, and roles.
8
+ */
9
+ import { type PlatformClient } from '@taskclan/platform';
10
+ import type { TaskclanClientConfig, DispatchOptions, AgentsRegistry, SkillsRegistry, WorkflowsRegistry, HiveAgent, FamilyMemory, RememberInput, RecallInput, ListMemoriesInput, RecallInsightsInput, TaskclanInsight } from './types';
11
+ /** Per-run options (everything `dispatchIntent` takes, plus an opt-in check). */
12
+ export interface RunOptions extends DispatchOptions {
13
+ /** Verify the intent is one the agent/skill actually exposes (one extra registry call). */
14
+ validate?: boolean;
15
+ }
16
+ export interface TaskclanClient {
17
+ /** Run a named agent's capability — dispatch `intent` (one of the agent's intents) through Hive. */
18
+ runAgent<T = unknown>(agentId: string, intent: string, input?: unknown, opts?: RunOptions): Promise<T>;
19
+ /** Run a named skill's capability — dispatch `intent` (one the skill exercises) through Hive. */
20
+ runSkill<T = unknown>(skillId: string, intent: string, input?: unknown, opts?: RunOptions): Promise<T>;
21
+ /** Discovery — the named agents (public registry). */
22
+ listAgents(): Promise<AgentsRegistry>;
23
+ /** A single agent by id from the registry (null if unknown). */
24
+ getAgent(agentId: string): Promise<HiveAgent | null>;
25
+ /** Discovery — the named skills/capabilities. */
26
+ listSkills(): Promise<SkillsRegistry>;
27
+ /** Discovery — the cross-product workflows. */
28
+ listWorkflows(): Promise<WorkflowsRegistry>;
29
+ /** Store or update a shared (family) memory. */
30
+ remember(input: RememberInput): Promise<{
31
+ memory: FamilyMemory;
32
+ }>;
33
+ /** Read a memory by id, or look it up by type (+ optional key). */
34
+ recall<T = {
35
+ memory: FamilyMemory | null;
36
+ }>(input: RecallInput): Promise<T>;
37
+ /** List memories, optionally filtered by child and/or type. */
38
+ listMemories<T = {
39
+ memories: FamilyMemory[];
40
+ }>(input: ListMemoriesInput): Promise<T>;
41
+ /** Delete a memory by id. */
42
+ forget<T = unknown>(input: {
43
+ householdId: string;
44
+ id: string;
45
+ }): Promise<T>;
46
+ /** Ask the Taskclan what it has LEARNED that applies to you (cross-product insights). */
47
+ recallInsights<T = {
48
+ product: string;
49
+ count: number;
50
+ insights: TaskclanInsight[];
51
+ }>(input?: RecallInsightsInput): Promise<T>;
52
+ /** Get insight-driven behavioral defaults to apply before acting (agent improvement). */
53
+ recommendDefaults<T = {
54
+ product: string;
55
+ defaults: Record<string, string>;
56
+ basedOn: unknown[];
57
+ }>(input?: {
58
+ product?: string;
59
+ }): Promise<T>;
60
+ /** Escape hatch — dispatch any Hive intent directly. */
61
+ dispatchIntent: PlatformClient['dispatchIntent'];
62
+ /** The underlying platform client (events, entitlements, identity, roles). */
63
+ platform: PlatformClient;
64
+ }
65
+ export declare function createTaskclanClient(config: TaskclanClientConfig): TaskclanClient;
66
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE/E,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,iFAAiF;AACjF,MAAM,WAAW,UAAW,SAAQ,eAAe;IACjD,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,oGAAoG;IACpG,QAAQ,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvG,iGAAiG;IACjG,QAAQ,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvG,sDAAsD;IACtD,UAAU,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;IACtC,gEAAgE;IAChE,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IACrD,iDAAiD;IACjD,UAAU,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;IACtC,+CAA+C;IAC/C,aAAa,IAAI,OAAO,CAAC,iBAAiB,CAAC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BAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc,CAqHjF"}
package/dist/client.js ADDED
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ /**
3
+ * createTaskclanClient — the typed client for the Taskclan Taskclan (L3).
4
+ *
5
+ * It wraps a @taskclan/platform client (the shared Hive transport) and layers
6
+ * the agentic surface on top: run named agents and skills, read/write shared
7
+ * memory, and discover the registries. `client.platform` exposes the underlying
8
+ * platform client for events, entitlements, identity, and roles.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.createTaskclanClient = createTaskclanClient;
12
+ const platform_1 = require("@taskclan/platform");
13
+ function createTaskclanClient(config) {
14
+ const platform = (0, platform_1.createPlatformClient)(config);
15
+ async function assertExposes(kind, id, intent) {
16
+ if (kind === 'agent') {
17
+ const reg = await platform.listAgents();
18
+ const a = reg.agents.find((x) => x.id === id);
19
+ if (!a)
20
+ throw new Error(`[taskclan] unknown agent "${id}"`);
21
+ if (!a.intents.includes(intent))
22
+ throw new Error(`[taskclan] agent "${id}" does not expose intent "${intent}"`);
23
+ }
24
+ else {
25
+ const reg = await platform.listSkills();
26
+ const s = reg.skills.find((x) => x.id === id);
27
+ if (!s)
28
+ throw new Error(`[taskclan] unknown skill "${id}"`);
29
+ if (!s.intents.includes(intent))
30
+ throw new Error(`[taskclan] skill "${id}" does not exercise intent "${intent}"`);
31
+ }
32
+ }
33
+ async function runAgent(agentId, intent, input = {}, opts = {}) {
34
+ if (opts.validate)
35
+ await assertExposes('agent', agentId, intent);
36
+ return platform.dispatchIntent(intent, input, {
37
+ ...opts,
38
+ context: { ...(opts.context ?? {}), agent: agentId },
39
+ });
40
+ }
41
+ async function runSkill(skillId, intent, input = {}, opts = {}) {
42
+ if (opts.validate)
43
+ await assertExposes('skill', skillId, intent);
44
+ return platform.dispatchIntent(intent, input, {
45
+ ...opts,
46
+ context: { ...(opts.context ?? {}), skill: skillId },
47
+ });
48
+ }
49
+ async function getAgent(agentId) {
50
+ const reg = await platform.listAgents();
51
+ return reg.agents.find((a) => a.id === agentId) ?? null;
52
+ }
53
+ function remember(input) {
54
+ return platform.dispatchIntent('memory.write', {
55
+ child_id: input.childId ?? null,
56
+ memory_type: input.type,
57
+ memory_key: input.key,
58
+ memory_value: input.value,
59
+ ...(input.source ? { source: input.source } : {}),
60
+ }, { householdId: input.householdId });
61
+ }
62
+ function recall(input) {
63
+ const body = input.id
64
+ ? { id: input.id }
65
+ : { child_id: input.childId ?? null, memory_type: input.type, ...(input.key ? { memory_key: input.key } : {}) };
66
+ return platform.dispatchIntent('memory.read', body, { householdId: input.householdId });
67
+ }
68
+ function listMemories(input) {
69
+ return platform.dispatchIntent('memory.list', {
70
+ ...(input.childId !== undefined ? { child_id: input.childId } : {}),
71
+ ...(input.type ? { memory_type: input.type } : {}),
72
+ }, { householdId: input.householdId });
73
+ }
74
+ function forget(input) {
75
+ return platform.dispatchIntent('memory.delete', { id: input.id }, { householdId: input.householdId });
76
+ }
77
+ /**
78
+ * recallInsights — ask the Taskclan what it has LEARNED that applies to you.
79
+ * Returns active, cross-product insights (with recommended_action) that other
80
+ * products may have taught. Aggregate knowledge only; never raw user data.
81
+ */
82
+ function recallInsights(input = {}) {
83
+ return platform.dispatchIntent('hivemind.insights.query', {
84
+ ...(input.product ? { product: input.product } : {}),
85
+ ...(input.insightType ? { insight_type: input.insightType } : {}),
86
+ ...(input.minConfidence != null ? { min_confidence: input.minConfidence } : {}),
87
+ ...(input.limit != null ? { limit: input.limit } : {}),
88
+ });
89
+ }
90
+ /**
91
+ * recommendDefaults — distilled behavioral defaults from active insights (incl.
92
+ * ones OTHER products taught). Call before acting, then apply the returned
93
+ * defaults — e.g. GameNova gets `asset.poly_mode:'low'` because Forge3D learned it.
94
+ */
95
+ function recommendDefaults(input = {}) {
96
+ return platform.dispatchIntent('hivemind.recommend_defaults', input.product ? { product: input.product } : {});
97
+ }
98
+ return {
99
+ runAgent,
100
+ runSkill,
101
+ listAgents: platform.listAgents,
102
+ getAgent,
103
+ listSkills: platform.listSkills,
104
+ listWorkflows: platform.listWorkflows,
105
+ remember,
106
+ recall,
107
+ listMemories,
108
+ forget,
109
+ recallInsights,
110
+ recommendDefaults,
111
+ dispatchIntent: platform.dispatchIntent,
112
+ platform,
113
+ };
114
+ }
115
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAwDH,oDAqHC;AA3KD,iDAA+E;AAsD/E,SAAgB,oBAAoB,CAAC,MAA4B;IAC/D,MAAM,QAAQ,GAAG,IAAA,+BAAoB,EAAC,MAAM,CAAC,CAAC;IAE9C,KAAK,UAAU,aAAa,CAAC,IAAuB,EAAE,EAAU,EAAE,MAAc;QAC9E,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;YACrB,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;YACxC,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;YAC9C,IAAI,CAAC,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;YAC5D,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,EAAE,6BAA6B,MAAM,GAAG,CAAC,CAAC;QAClH,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;YACxC,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;YAC9C,IAAI,CAAC,CAAC;gBAAE,MAAM,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,CAAC;IACpH,CAAC;IAED,OAAO;QACL,QAAQ;QACR,QAAQ;QACR,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,QAAQ;QACR,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,aAAa,EAAE,QAAQ,CAAC,aAAa;QACrC,QAAQ;QACR,MAAM;QACN,YAAY;QACZ,MAAM;QACN,cAAc;QACd,iBAAiB;QACjB,cAAc,EAAE,QAAQ,CAAC,cAAc;QACvC,QAAQ;KACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ export { createTaskclanClient } from './client';
2
+ export type { TaskclanClient, RunOptions } from './client';
3
+ export { PlatformError } from '@taskclan/platform';
4
+ export type { TaskclanClientConfig, DispatchOptions, MemoryType, MemorySource, FamilyMemory, RememberInput, RecallInput, ListMemoriesInput, HiveAgent, HiveSkill, HiveWorkflow, HiveWorkflowStep, AgentsRegistry, SkillsRegistry, WorkflowsRegistry, } from './types';
5
+ /** @deprecated Renamed to `createTaskclanClient`. */
6
+ export { createTaskclanClient as createHivemindClient } from './client';
7
+ /** @deprecated Renamed to `TaskclanClient`. */
8
+ export type { TaskclanClient as HivemindClient } from './client';
9
+ /** @deprecated Renamed to `TaskclanClientConfig`. */
10
+ export type { TaskclanClientConfig as HivemindClientConfig } from './types';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,SAAS,EACT,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAGjB,qDAAqD;AACrD,OAAO,EAAE,oBAAoB,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACxE,+CAA+C;AAC/C,YAAY,EAAE,cAAc,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AACjE,qDAAqD;AACrD,YAAY,EAAE,oBAAoB,IAAI,oBAAoB,EAAE,MAAM,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createHivemindClient = exports.PlatformError = exports.createTaskclanClient = void 0;
4
+ var client_1 = require("./client");
5
+ Object.defineProperty(exports, "createTaskclanClient", { enumerable: true, get: function () { return client_1.createTaskclanClient; } });
6
+ // Re-export the platform error class so consumers can `instanceof PlatformError`
7
+ // without also importing @taskclan/platform directly.
8
+ var platform_1 = require("@taskclan/platform");
9
+ Object.defineProperty(exports, "PlatformError", { enumerable: true, get: function () { return platform_1.PlatformError; } });
10
+ // --- Deprecated aliases (pre-1.0 "Hivemind" names) — remove in a future major. ---
11
+ /** @deprecated Renamed to `createTaskclanClient`. */
12
+ var client_2 = require("./client");
13
+ Object.defineProperty(exports, "createHivemindClient", { enumerable: true, get: function () { return client_2.createTaskclanClient; } });
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAAgD;AAAvC,8GAAA,oBAAoB,OAAA;AAE7B,iFAAiF;AACjF,sDAAsD;AACtD,+CAAmD;AAA1C,yGAAA,aAAa,OAAA;AAmBtB,oFAAoF;AACpF,qDAAqD;AACrD,mCAAwE;AAA/D,8GAAA,oBAAoB,OAAwB"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Shared types for the @taskclan/sdk client.
3
+ *
4
+ * Taskclan (L3) sits on top of @taskclan/platform (L2): the config and the
5
+ * discovery types are the platform's, re-exported here so consumers import
6
+ * everything from one place. The memory types model the family-memory vault
7
+ * the `memory.*` intents read and write today.
8
+ */
9
+ import type { PlatformClientConfig } from '@taskclan/platform';
10
+ /** Same config you pass to the platform client (baseUrl, product, getToken, …). */
11
+ export type TaskclanClientConfig = PlatformClientConfig;
12
+ export type { DispatchOptions, HiveAgent, HiveSkill, HiveWorkflow, HiveWorkflowStep, AgentsRegistry, SkillsRegistry, WorkflowsRegistry, } from '@taskclan/platform';
13
+ export type MemoryType = 'allergy' | 'medication' | 'clothing_size' | 'shoe_size' | 'favourite_food' | 'disliked_food' | 'doctor' | 'school' | 'teacher' | 'activity' | 'emergency_contact' | 'insurance' | 'pickup_authorization' | 'custom';
14
+ export type MemorySource = 'manual' | 'voice' | 'school_email' | 'system';
15
+ /** A stored memory row (the shape `memory.*` intents return). */
16
+ export interface FamilyMemory {
17
+ id: string;
18
+ household_id: string;
19
+ child_id: string | null;
20
+ memory_type: MemoryType;
21
+ memory_key: string;
22
+ memory_value: string;
23
+ source: MemorySource;
24
+ created_at: string;
25
+ updated_at: string;
26
+ }
27
+ export interface RememberInput {
28
+ /** Household the memory belongs to (memory.* are household-scoped). */
29
+ householdId: string;
30
+ type: MemoryType;
31
+ key: string;
32
+ value: string;
33
+ /** Null/omit for household-level facts; a child's uuid for child-specific ones. */
34
+ childId?: string | null;
35
+ source?: MemorySource;
36
+ }
37
+ export interface RecallInput {
38
+ householdId: string;
39
+ /** Read one memory directly by id … */
40
+ id?: string;
41
+ /** … or look it up by type (+ optional key). */
42
+ type?: MemoryType;
43
+ key?: string;
44
+ childId?: string | null;
45
+ }
46
+ export interface ListMemoriesInput {
47
+ householdId: string;
48
+ type?: MemoryType;
49
+ childId?: string | null;
50
+ }
51
+ /** Input for recallInsights() — ask the Taskclan what it has learned for you. */
52
+ export interface RecallInsightsInput {
53
+ /** Defaults to the client's product. Returns insights that apply to it. */
54
+ product?: string;
55
+ insightType?: string;
56
+ minConfidence?: number;
57
+ limit?: number;
58
+ }
59
+ /** A learned, cross-product pattern. Aggregate only — never raw user data. */
60
+ export interface TaskclanInsight {
61
+ id: string;
62
+ source_product: string;
63
+ insight_type: string;
64
+ title: string;
65
+ description: string | null;
66
+ confidence: number;
67
+ evidence: Record<string, unknown>;
68
+ recommended_action: Record<string, unknown>;
69
+ applies_to: string[];
70
+ status: string;
71
+ sample_size: number;
72
+ computed_at: string;
73
+ }
74
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,mFAAmF;AACnF,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAExD,YAAY,EACV,eAAe,EACf,SAAS,EACT,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAI5B,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,YAAY,GACZ,eAAe,GACf,WAAW,GACX,gBAAgB,GAChB,eAAe,GACf,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,mBAAmB,GACnB,WAAW,GACX,sBAAsB,GACtB,QAAQ,CAAC;AAEb,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,GAAG,cAAc,GAAG,QAAQ,CAAC;AAE1E,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,UAAU,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,MAAM,CA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E,OAAO,CAAC,CAAC;IAC5C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB"}
package/dist/types.js ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * Shared types for the @taskclan/sdk client.
4
+ *
5
+ * Taskclan (L3) sits on top of @taskclan/platform (L2): the config and the
6
+ * discovery types are the platform's, re-exported here so consumers import
7
+ * everything from one place. The memory types model the family-memory vault
8
+ * the `memory.*` intents read and write today.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG"}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@taskclan/sdk",
3
+ "version": "1.0.0",
4
+ "description": "Typed client for the Taskclan Taskclan (L3 agentic layer) — run named agents and skills, read/write shared memory, recall cross-product insights + insight-driven defaults (the learning loop), and discover the agent/skill/workflow registries. Built on @taskclan/platform.",
5
+ "license": "UNLICENSED",
6
+ "author": "Taskclan",
7
+ "private": false,
8
+ "publishConfig": { "access": "public" },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/taskclan/taskclan-monorepo.git",
12
+ "directory": "packages/taskclan-sdk"
13
+ },
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "default": "./dist/index.js"
20
+ }
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "README.md",
25
+ "LICENSE"
26
+ ],
27
+ "sideEffects": false,
28
+ "scripts": {
29
+ "build": "tsc -p tsconfig.json",
30
+ "clean": "rm -rf dist",
31
+ "prepublishOnly": "npm run clean && npm run build"
32
+ },
33
+ "keywords": [
34
+ "taskclan",
35
+ "taskclan",
36
+ "agents",
37
+ "memory",
38
+ "skills"
39
+ ],
40
+ "engines": {
41
+ "node": ">=18"
42
+ },
43
+ "dependencies": {
44
+ "@taskclan/platform": "^0.2.0"
45
+ },
46
+ "devDependencies": {
47
+ "typescript": "^5.5.4"
48
+ }
49
+ }