@granular-software/sdk 0.2.0 → 0.2.1
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/adapters/anthropic.d.mts +1 -1
- package/dist/adapters/anthropic.d.ts +1 -1
- package/dist/adapters/langchain.d.mts +1 -1
- package/dist/adapters/langchain.d.ts +1 -1
- package/dist/adapters/mastra.d.mts +1 -1
- package/dist/adapters/mastra.d.ts +1 -1
- package/dist/adapters/openai.d.mts +1 -1
- package/dist/adapters/openai.d.ts +1 -1
- package/dist/cli/index.js +238 -12
- package/dist/index.d.mts +149 -4
- package/dist/index.d.ts +149 -4
- package/dist/index.js +441 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +441 -31
- package/dist/index.mjs.map +1 -1
- package/dist/{types-D46q5WTh.d.mts → types-DiMEb3SE.d.mts} +41 -1
- package/dist/{types-D46q5WTh.d.ts → types-DiMEb3SE.d.ts} +41 -1
- package/package.json +2 -3
|
@@ -10,6 +10,8 @@ interface GranularOptions {
|
|
|
10
10
|
apiKey: string;
|
|
11
11
|
/** Optional API URL (for on-prem or testing) */
|
|
12
12
|
apiUrl?: string;
|
|
13
|
+
/** Optional WebSocket constructor (for Node.js environments) */
|
|
14
|
+
WebSocketCtor?: any;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* A user/subject object returned from recordUser()
|
|
@@ -60,6 +62,9 @@ interface ConnectOptions {
|
|
|
60
62
|
sandbox: string;
|
|
61
63
|
/** The user to connect as (from recordUser()) */
|
|
62
64
|
user: User;
|
|
65
|
+
/** Optional stable client ID. Defaults to `client_${Date.now()}`. Use a fixed
|
|
66
|
+
* value for long-lived effect hosts so tool catalogs don't accumulate. */
|
|
67
|
+
clientId?: string;
|
|
63
68
|
}
|
|
64
69
|
/**
|
|
65
70
|
* A sandbox container
|
|
@@ -330,6 +335,40 @@ interface DomainState {
|
|
|
330
335
|
}>;
|
|
331
336
|
[key: string]: unknown;
|
|
332
337
|
}
|
|
338
|
+
/**
|
|
339
|
+
* Information about a published tool
|
|
340
|
+
*/
|
|
341
|
+
interface ToolInfo {
|
|
342
|
+
/** Unique name of the tool */
|
|
343
|
+
name: string;
|
|
344
|
+
/** Description of what the tool does */
|
|
345
|
+
description?: string;
|
|
346
|
+
/** JSON Schema for tool input */
|
|
347
|
+
inputSchema?: Record<string, unknown>;
|
|
348
|
+
/** JSON Schema for tool output */
|
|
349
|
+
outputSchema?: Record<string, unknown>;
|
|
350
|
+
/** Client ID that published this tool (absent for domain-only entries) */
|
|
351
|
+
clientId?: string;
|
|
352
|
+
/** Whether the tool is ready for use (has a registered handler) */
|
|
353
|
+
ready: boolean;
|
|
354
|
+
/** Timestamp when the tool was published */
|
|
355
|
+
publishedAt?: number;
|
|
356
|
+
/** Class this tool belongs to (instance/static method) */
|
|
357
|
+
className?: string;
|
|
358
|
+
/** Whether this is a static method */
|
|
359
|
+
static?: boolean;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Event data when the list of available tools changes
|
|
363
|
+
*/
|
|
364
|
+
interface ToolsChangedEvent {
|
|
365
|
+
/** The current list of all available tools */
|
|
366
|
+
tools: ToolInfo[];
|
|
367
|
+
/** Names of tools that were added or updated */
|
|
368
|
+
added: string[];
|
|
369
|
+
/** Names of tools that were removed */
|
|
370
|
+
removed: string[];
|
|
371
|
+
}
|
|
333
372
|
type JobStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'timeout' | 'canceled';
|
|
334
373
|
/**
|
|
335
374
|
* Result from submitting a job
|
|
@@ -362,6 +401,7 @@ interface WSClientOptions {
|
|
|
362
401
|
url: string;
|
|
363
402
|
sessionId: string;
|
|
364
403
|
token: string;
|
|
404
|
+
WebSocketCtor?: any;
|
|
365
405
|
}
|
|
366
406
|
interface RPCRequest {
|
|
367
407
|
type: 'rpc';
|
|
@@ -592,4 +632,4 @@ interface DeleteResponse {
|
|
|
592
632
|
deleted: boolean;
|
|
593
633
|
}
|
|
594
634
|
|
|
595
|
-
export type {
|
|
635
|
+
export type { ManifestImport as $, AssignmentListResponse as A, BuildPolicy as B, ConnectOptions as C, DomainState as D, EnvironmentData as E, JobStatus as F, GranularOptions as G, JobSubmitResult as H, InstanceToolHandler as I, Job as J, Prompt as K, RPCRequest as L, ModelRef as M, RPCResponse as N, SyncMessage as O, PublishToolsResult as P, RPCRequestFromServer as Q, RecordUserOptions as R, SandboxListResponse as S, ToolWithHandler as T, User as U, ToolInvokeParams as V, WSClientOptions as W, ToolResultParams as X, ManifestPropertySpec as Y, ManifestRelationshipDef as Z, ManifestOperation as _, ToolHandler as a, ManifestVolume as a0, APIError as a1, ToolInfo as b, ToolsChangedEvent as c, GraphQLResult as d, DefineRelationshipOptions as e, RelationshipInfo as f, ManifestContent as g, RecordObjectOptions as h, RecordObjectResult as i, Sandbox as j, CreateSandboxData as k, DeleteResponse as l, PermissionProfile as m, CreatePermissionProfileData as n, CreateEnvironmentData as o, Subject as p, ToolSchema as q, PermissionRules as r, PermissionProfileListResponse as s, Assignment as t, EnvironmentListResponse as u, Manifest as v, ManifestListResponse as w, BuildStatus as x, Build as y, BuildListResponse as z };
|
|
@@ -10,6 +10,8 @@ interface GranularOptions {
|
|
|
10
10
|
apiKey: string;
|
|
11
11
|
/** Optional API URL (for on-prem or testing) */
|
|
12
12
|
apiUrl?: string;
|
|
13
|
+
/** Optional WebSocket constructor (for Node.js environments) */
|
|
14
|
+
WebSocketCtor?: any;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* A user/subject object returned from recordUser()
|
|
@@ -60,6 +62,9 @@ interface ConnectOptions {
|
|
|
60
62
|
sandbox: string;
|
|
61
63
|
/** The user to connect as (from recordUser()) */
|
|
62
64
|
user: User;
|
|
65
|
+
/** Optional stable client ID. Defaults to `client_${Date.now()}`. Use a fixed
|
|
66
|
+
* value for long-lived effect hosts so tool catalogs don't accumulate. */
|
|
67
|
+
clientId?: string;
|
|
63
68
|
}
|
|
64
69
|
/**
|
|
65
70
|
* A sandbox container
|
|
@@ -330,6 +335,40 @@ interface DomainState {
|
|
|
330
335
|
}>;
|
|
331
336
|
[key: string]: unknown;
|
|
332
337
|
}
|
|
338
|
+
/**
|
|
339
|
+
* Information about a published tool
|
|
340
|
+
*/
|
|
341
|
+
interface ToolInfo {
|
|
342
|
+
/** Unique name of the tool */
|
|
343
|
+
name: string;
|
|
344
|
+
/** Description of what the tool does */
|
|
345
|
+
description?: string;
|
|
346
|
+
/** JSON Schema for tool input */
|
|
347
|
+
inputSchema?: Record<string, unknown>;
|
|
348
|
+
/** JSON Schema for tool output */
|
|
349
|
+
outputSchema?: Record<string, unknown>;
|
|
350
|
+
/** Client ID that published this tool (absent for domain-only entries) */
|
|
351
|
+
clientId?: string;
|
|
352
|
+
/** Whether the tool is ready for use (has a registered handler) */
|
|
353
|
+
ready: boolean;
|
|
354
|
+
/** Timestamp when the tool was published */
|
|
355
|
+
publishedAt?: number;
|
|
356
|
+
/** Class this tool belongs to (instance/static method) */
|
|
357
|
+
className?: string;
|
|
358
|
+
/** Whether this is a static method */
|
|
359
|
+
static?: boolean;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Event data when the list of available tools changes
|
|
363
|
+
*/
|
|
364
|
+
interface ToolsChangedEvent {
|
|
365
|
+
/** The current list of all available tools */
|
|
366
|
+
tools: ToolInfo[];
|
|
367
|
+
/** Names of tools that were added or updated */
|
|
368
|
+
added: string[];
|
|
369
|
+
/** Names of tools that were removed */
|
|
370
|
+
removed: string[];
|
|
371
|
+
}
|
|
333
372
|
type JobStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'timeout' | 'canceled';
|
|
334
373
|
/**
|
|
335
374
|
* Result from submitting a job
|
|
@@ -362,6 +401,7 @@ interface WSClientOptions {
|
|
|
362
401
|
url: string;
|
|
363
402
|
sessionId: string;
|
|
364
403
|
token: string;
|
|
404
|
+
WebSocketCtor?: any;
|
|
365
405
|
}
|
|
366
406
|
interface RPCRequest {
|
|
367
407
|
type: 'rpc';
|
|
@@ -592,4 +632,4 @@ interface DeleteResponse {
|
|
|
592
632
|
deleted: boolean;
|
|
593
633
|
}
|
|
594
634
|
|
|
595
|
-
export type {
|
|
635
|
+
export type { ManifestImport as $, AssignmentListResponse as A, BuildPolicy as B, ConnectOptions as C, DomainState as D, EnvironmentData as E, JobStatus as F, GranularOptions as G, JobSubmitResult as H, InstanceToolHandler as I, Job as J, Prompt as K, RPCRequest as L, ModelRef as M, RPCResponse as N, SyncMessage as O, PublishToolsResult as P, RPCRequestFromServer as Q, RecordUserOptions as R, SandboxListResponse as S, ToolWithHandler as T, User as U, ToolInvokeParams as V, WSClientOptions as W, ToolResultParams as X, ManifestPropertySpec as Y, ManifestRelationshipDef as Z, ManifestOperation as _, ToolHandler as a, ManifestVolume as a0, APIError as a1, ToolInfo as b, ToolsChangedEvent as c, GraphQLResult as d, DefineRelationshipOptions as e, RelationshipInfo as f, ManifestContent as g, RecordObjectOptions as h, RecordObjectResult as i, Sandbox as j, CreateSandboxData as k, DeleteResponse as l, PermissionProfile as m, CreatePermissionProfileData as n, CreateEnvironmentData as o, Subject as p, ToolSchema as q, PermissionRules as r, PermissionProfileListResponse as s, Assignment as t, EnvironmentListResponse as u, Manifest as v, ManifestListResponse as w, BuildStatus as x, Build as y, BuildListResponse as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@granular-software/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "TypeScript SDK and CLI for Granular - define, build, and deploy AI sandboxes",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -70,13 +70,12 @@
|
|
|
70
70
|
"url": "https://github.com/granular-dev/granular-sdk"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@automerge/automerge": "^
|
|
73
|
+
"@automerge/automerge": "^3.2.1",
|
|
74
74
|
"chalk": "^5.4.1",
|
|
75
75
|
"chokidar": "^4.0.3",
|
|
76
76
|
"commander": "^13.1.0",
|
|
77
77
|
"dotenv": "^16.4.7",
|
|
78
78
|
"ora": "^8.2.0",
|
|
79
|
-
"ws": "^8.18.2",
|
|
80
79
|
"zod-to-json-schema": "^3.25.1"
|
|
81
80
|
},
|
|
82
81
|
"devDependencies": {
|