cccc-sdk 0.1.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.
@@ -0,0 +1,142 @@
1
+ /**
2
+ * Unix Socket Transport Layer for CCCC daemon IPC
3
+ *
4
+ * Protocol:
5
+ * - Uses Unix Domain Socket at $CCCC_HOME/daemon/ccccd.sock
6
+ * - Messages are newline-delimited JSON
7
+ * - Request: {"v": 1, "op": "xxx", "args": {...}}
8
+ * - Response: {"v": 1, "ok": true/false, "result": {...}, "error": {...}}
9
+ */
10
+ import * as net from 'node:net';
11
+ import * as path from 'node:path';
12
+ import * as os from 'node:os';
13
+ import * as fs from 'node:fs';
14
+ import { CCCCError } from './errors.js';
15
+ const DEFAULT_TIMEOUT_MS = 60_000;
16
+ const MAX_RESPONSE_SIZE = 4_000_000; // 4MB
17
+ /**
18
+ * Get default CCCC home directory
19
+ */
20
+ export function getDefaultCcccHome() {
21
+ return process.env['CCCC_HOME'] || path.join(os.homedir(), '.cccc');
22
+ }
23
+ /**
24
+ * Get socket path for CCCC daemon
25
+ */
26
+ export function getSocketPath(ccccHome) {
27
+ const home = ccccHome || getDefaultCcccHome();
28
+ return path.join(home, 'daemon', 'ccccd.sock');
29
+ }
30
+ /**
31
+ * Check if daemon socket exists
32
+ */
33
+ export function socketExists(ccccHome) {
34
+ const sockPath = getSocketPath(ccccHome);
35
+ try {
36
+ fs.accessSync(sockPath, fs.constants.F_OK);
37
+ return true;
38
+ }
39
+ catch {
40
+ return false;
41
+ }
42
+ }
43
+ /**
44
+ * Send a request to the CCCC daemon and receive a response
45
+ */
46
+ export async function callDaemon(request, options = {}) {
47
+ const { ccccHome, timeoutMs = DEFAULT_TIMEOUT_MS } = options;
48
+ const sockPath = getSocketPath(ccccHome);
49
+ // Check socket exists
50
+ if (!socketExists(ccccHome)) {
51
+ throw new CCCCError('SOCKET_NOT_FOUND', `Socket not found at ${sockPath}`);
52
+ }
53
+ return new Promise((resolve, reject) => {
54
+ const socket = net.createConnection(sockPath);
55
+ let buffer = '';
56
+ let resolved = false;
57
+ const cleanup = () => {
58
+ socket.removeAllListeners();
59
+ socket.destroy();
60
+ };
61
+ const handleError = (error) => {
62
+ if (resolved)
63
+ return;
64
+ resolved = true;
65
+ cleanup();
66
+ if (error.code === 'ECONNREFUSED') {
67
+ reject(new CCCCError('DAEMON_NOT_RUNNING', 'Daemon is not running'));
68
+ }
69
+ else if (error.code === 'ENOENT') {
70
+ reject(new CCCCError('SOCKET_NOT_FOUND', `Socket not found at ${sockPath}`));
71
+ }
72
+ else {
73
+ reject(new CCCCError('INTERNAL', error.message));
74
+ }
75
+ };
76
+ // Set timeout
77
+ const timeoutId = setTimeout(() => {
78
+ if (resolved)
79
+ return;
80
+ resolved = true;
81
+ cleanup();
82
+ reject(new CCCCError('TIMEOUT', `Request timed out after ${timeoutMs}ms`));
83
+ }, timeoutMs);
84
+ socket.on('connect', () => {
85
+ // Send request as newline-delimited JSON
86
+ const payload = JSON.stringify(request) + '\n';
87
+ socket.write(payload, 'utf-8');
88
+ });
89
+ socket.on('data', (chunk) => {
90
+ buffer += chunk.toString('utf-8');
91
+ // Check size limit
92
+ if (buffer.length > MAX_RESPONSE_SIZE) {
93
+ if (resolved)
94
+ return;
95
+ resolved = true;
96
+ clearTimeout(timeoutId);
97
+ cleanup();
98
+ reject(new CCCCError('INTERNAL', 'Response too large'));
99
+ return;
100
+ }
101
+ // Check for complete response (newline terminated)
102
+ const newlineIndex = buffer.indexOf('\n');
103
+ if (newlineIndex !== -1) {
104
+ if (resolved)
105
+ return;
106
+ resolved = true;
107
+ clearTimeout(timeoutId);
108
+ cleanup();
109
+ const line = buffer.slice(0, newlineIndex);
110
+ try {
111
+ const response = JSON.parse(line);
112
+ resolve(response);
113
+ }
114
+ catch {
115
+ reject(new CCCCError('INTERNAL', 'Invalid JSON response from daemon'));
116
+ }
117
+ }
118
+ });
119
+ socket.on('error', handleError);
120
+ socket.on('close', () => {
121
+ if (resolved)
122
+ return;
123
+ resolved = true;
124
+ clearTimeout(timeoutId);
125
+ cleanup();
126
+ reject(new CCCCError('DAEMON_NOT_RUNNING', 'Connection closed unexpectedly'));
127
+ });
128
+ });
129
+ }
130
+ /**
131
+ * Ping the daemon to check if it's running
132
+ */
133
+ export async function pingDaemon(options = {}) {
134
+ try {
135
+ const response = await callDaemon({ v: 1, op: 'ping', args: {} }, options);
136
+ return response.ok;
137
+ }
138
+ catch {
139
+ return false;
140
+ }
141
+ }
142
+ //# sourceMappingURL=transport.js.map
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Actor-related types
3
+ */
4
+ export type ActorRole = 'foreman' | 'peer';
5
+ export type ActorSubmit = 'enter' | 'newline' | 'none';
6
+ export type RunnerKind = 'pty' | 'headless';
7
+ export type AgentRuntime = 'amp' | 'auggie' | 'claude' | 'codex' | 'cursor' | 'droid' | 'gemini' | 'kilocode' | 'neovate' | 'opencode' | 'copilot' | 'custom';
8
+ export type GroupState = 'active' | 'idle' | 'paused';
9
+ export interface Actor {
10
+ v: number;
11
+ id: string;
12
+ role?: ActorRole | null;
13
+ title: string;
14
+ command: string[];
15
+ env: Record<string, string>;
16
+ default_scope_key: string;
17
+ submit: ActorSubmit;
18
+ enabled: boolean;
19
+ runner: RunnerKind;
20
+ runtime: AgentRuntime;
21
+ created_at: string;
22
+ updated_at: string;
23
+ }
24
+ export interface HeadlessState {
25
+ v: number;
26
+ group_id: string;
27
+ actor_id: string;
28
+ status: 'idle' | 'working' | 'waiting' | 'stopped';
29
+ current_task_id?: string | null;
30
+ last_message_id?: string | null;
31
+ started_at: string;
32
+ updated_at: string;
33
+ }
34
+ export interface ActorAddOptions {
35
+ actor_id: string;
36
+ runtime?: AgentRuntime;
37
+ runner?: RunnerKind;
38
+ title?: string;
39
+ command?: string[];
40
+ env?: Record<string, string>;
41
+ }
42
+ //# sourceMappingURL=actor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actor.d.ts","sourceRoot":"","sources":["../../types/actor.ts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,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Actor-related types
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=actor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actor.js","sourceRoot":"","sources":["../../types/actor.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Context-related types
3
+ */
4
+ export type MilestoneStatus = 'planned' | 'active' | 'done' | 'archived';
5
+ export type TaskStatus = 'planned' | 'active' | 'done' | 'archived';
6
+ export type StepStatus = 'pending' | 'in_progress' | 'done';
7
+ export interface Milestone {
8
+ id: string;
9
+ name: string;
10
+ description: string;
11
+ status: MilestoneStatus;
12
+ started?: string | null;
13
+ completed?: string | null;
14
+ outcomes?: string | null;
15
+ }
16
+ export interface Step {
17
+ id: string;
18
+ name: string;
19
+ acceptance: string;
20
+ status: StepStatus;
21
+ }
22
+ export interface Task {
23
+ id: string;
24
+ name: string;
25
+ goal: string;
26
+ status: TaskStatus;
27
+ milestone?: string | null;
28
+ assignee?: string | null;
29
+ steps: Step[];
30
+ created_at: string;
31
+ updated_at: string;
32
+ }
33
+ export interface Note {
34
+ id: string;
35
+ content: string;
36
+ }
37
+ export interface ContextReference {
38
+ id: string;
39
+ url: string;
40
+ note: string;
41
+ }
42
+ export interface Presence {
43
+ agent_id: string;
44
+ status: string;
45
+ updated_at: string;
46
+ }
47
+ export interface Context {
48
+ vision: string;
49
+ sketch: string;
50
+ milestones: Milestone[];
51
+ tasks_summary: {
52
+ total: number;
53
+ by_status: Record<TaskStatus, number>;
54
+ };
55
+ active_task?: Task | null;
56
+ notes: Note[];
57
+ references: ContextReference[];
58
+ presence: Presence[];
59
+ }
60
+ export interface ContextSyncOp {
61
+ op: string;
62
+ [key: string]: unknown;
63
+ }
64
+ export interface TaskCreateOptions {
65
+ name: string;
66
+ goal: string;
67
+ steps: Array<{
68
+ name: string;
69
+ acceptance: string;
70
+ }>;
71
+ milestone_id?: string;
72
+ assignee?: string;
73
+ }
74
+ export interface TaskUpdateOptions {
75
+ task_id: string;
76
+ name?: string;
77
+ goal?: string;
78
+ status?: TaskStatus;
79
+ assignee?: string;
80
+ milestone_id?: string;
81
+ step_id?: string;
82
+ step_status?: StepStatus;
83
+ }
84
+ export interface MilestoneCreateOptions {
85
+ name: string;
86
+ description: string;
87
+ status?: MilestoneStatus;
88
+ }
89
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../types/context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AACzE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AACpE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,MAAM,CAAC;AAE5D,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM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AC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,UAAU,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Context-related types
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../types/context.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Event-related types
3
+ */
4
+ export type EventKind = 'group.create' | 'group.update' | 'group.attach' | 'group.detach_scope' | 'group.set_active_scope' | 'group.start' | 'group.stop' | 'actor.add' | 'actor.update' | 'actor.set_role' | 'actor.start' | 'actor.stop' | 'actor.restart' | 'actor.remove' | 'context.sync' | 'chat.message' | 'chat.read' | 'chat.reaction' | 'system.notify' | 'system.notify_ack';
5
+ export interface Event {
6
+ v: number;
7
+ id: string;
8
+ ts: string;
9
+ kind: EventKind | string;
10
+ group_id: string;
11
+ scope_key: string;
12
+ by: string;
13
+ data: Record<string, unknown>;
14
+ }
15
+ //# sourceMappingURL=event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../types/event.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,SAAS,GACjB,cAAc,GACd,cAAc,GACd,cAAc,GACd,oBAAoB,GACpB,wBAAwB,GACxB,aAAa,GACb,YAAY,GACZ,WAAW,GACX,cAAc,GACd,gBAAgB,GAChB,aAAa,GACb,YAAY,GACZ,eAAe,GACf,cAAc,GACd,cAAc,GACd,cAAc,GACd,WAAW,GACX,eAAe,GACf,eAAe,GACf,mBAAmB,CAAC;AAExB,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Event-related types
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.js","sourceRoot":"","sources":["../../types/event.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Group-related types
3
+ */
4
+ import type { Actor, GroupState } from './actor.js';
5
+ export interface Scope {
6
+ scope_key: string;
7
+ url: string;
8
+ label: string;
9
+ git_remote: string;
10
+ }
11
+ export interface GroupInfo {
12
+ v: number;
13
+ group_id: string;
14
+ title: string;
15
+ topic: string;
16
+ created_at: string;
17
+ updated_at: string;
18
+ running: boolean;
19
+ state: GroupState;
20
+ active_scope_key: string;
21
+ scopes: Scope[];
22
+ actors: Actor[];
23
+ }
24
+ export interface GroupCreateOptions {
25
+ title: string;
26
+ topic?: string;
27
+ url?: string;
28
+ }
29
+ export interface GroupUpdatePatch {
30
+ title?: string;
31
+ topic?: string;
32
+ }
33
+ //# sourceMappingURL=group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../types/group.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,WAAW,KAAK;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Group-related types
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.js","sourceRoot":"","sources":["../../types/group.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * CCCC SDK Type Definitions
3
+ */
4
+ export * from './ipc.js';
5
+ export * from './actor.js';
6
+ export * from './group.js';
7
+ export * from './message.js';
8
+ export * from './event.js';
9
+ export * from './context.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * CCCC SDK Type Definitions
3
+ */
4
+ export * from './ipc.js';
5
+ export * from './actor.js';
6
+ export * from './group.js';
7
+ export * from './message.js';
8
+ export * from './event.js';
9
+ export * from './context.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * IPC protocol types for CCCC daemon communication
3
+ */
4
+ export interface DaemonRequest {
5
+ v: number;
6
+ op: string;
7
+ args: Record<string, unknown>;
8
+ }
9
+ export interface DaemonError {
10
+ code: string;
11
+ message: string;
12
+ details: Record<string, unknown>;
13
+ }
14
+ export interface DaemonResponse {
15
+ v: number;
16
+ ok: boolean;
17
+ result: Record<string, unknown>;
18
+ error: DaemonError | null;
19
+ }
20
+ /**
21
+ * Create a daemon request
22
+ */
23
+ export declare function createRequest(op: string, args?: Record<string, unknown>): DaemonRequest;
24
+ //# sourceMappingURL=ipc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ipc.d.ts","sourceRoot":"","sources":["../../types/ipc.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,cAAc;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,aAAa,CAE3F"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * IPC protocol types for CCCC daemon communication
3
+ */
4
+ /**
5
+ * Create a daemon request
6
+ */
7
+ export function createRequest(op, args = {}) {
8
+ return { v: 1, op, args };
9
+ }
10
+ //# sourceMappingURL=ipc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ipc.js","sourceRoot":"","sources":["../../types/ipc.ts"],"names":[],"mappings":"AAAA;;GAEG;AAqBH;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,EAAU,EAAE,OAAgC,EAAE;IAC1E,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Message-related types
3
+ */
4
+ export interface Reference {
5
+ kind: 'file' | 'url' | 'commit' | 'text';
6
+ url: string;
7
+ path: string;
8
+ title: string;
9
+ sha: string;
10
+ bytes: number;
11
+ }
12
+ export interface Attachment {
13
+ kind: 'text' | 'image' | 'file';
14
+ path: string;
15
+ title: string;
16
+ mime_type: string;
17
+ bytes: number;
18
+ sha256: string;
19
+ }
20
+ export interface ChatMessageData {
21
+ text: string;
22
+ format: 'plain' | 'markdown';
23
+ to: string[];
24
+ reply_to?: string | null;
25
+ quote_text?: string | null;
26
+ refs: Record<string, unknown>[];
27
+ attachments: Record<string, unknown>[];
28
+ thread: string;
29
+ client_id?: string | null;
30
+ }
31
+ export interface SendMessageOptions {
32
+ text: string;
33
+ to?: string[];
34
+ format?: 'plain' | 'markdown';
35
+ attachments?: string[];
36
+ }
37
+ export interface ReplyMessageOptions {
38
+ event_id: string;
39
+ text: string;
40
+ to?: string[];
41
+ }
42
+ export interface InboxMessage {
43
+ event_id: string;
44
+ ts: string;
45
+ kind: string;
46
+ by: string;
47
+ data: ChatMessageData;
48
+ }
49
+ export interface InboxListOptions {
50
+ kind_filter?: 'all' | 'chat' | 'notify';
51
+ limit?: number;
52
+ }
53
+ //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../types/message.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MA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AK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Message-related types
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.js","sourceRoot":"","sources":["../../types/message.ts"],"names":[],"mappings":"AAAA;;GAEG"}
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "cccc-sdk",
3
+ "version": "0.1.0",
4
+ "description": "CCCC Client SDK for Node.js - IPC client for CCCC daemon",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "test": "npm run build && node --test dist/tests/*.js",
17
+ "clean": "rm -rf dist",
18
+ "prepublishOnly": "npm run clean && npm run build"
19
+ },
20
+ "keywords": [
21
+ "cccc",
22
+ "agent",
23
+ "sdk",
24
+ "ipc",
25
+ "daemon",
26
+ "ai-agent"
27
+ ],
28
+ "license": "MIT",
29
+ "engines": {
30
+ "node": ">=18.0.0"
31
+ },
32
+ "files": [
33
+ "dist/*.js",
34
+ "dist/*.d.ts",
35
+ "dist/types",
36
+ "README.md"
37
+ ],
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://github.com/aspect-build/cccc.git",
41
+ "directory": "src/sdk/ts"
42
+ },
43
+ "devDependencies": {
44
+ "@types/node": "^20.0.0",
45
+ "typescript": "^5.0.0"
46
+ }
47
+ }