@granular-software/sdk 0.3.4 → 0.4.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/README.md +20 -0
- 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 +80 -6
- package/dist/index.d.mts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +215 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +215 -5
- package/dist/index.mjs.map +1 -1
- package/dist/{types-D5B8WlF4.d.mts → types-BOPsFZYi.d.mts} +8 -1
- package/dist/{types-D5B8WlF4.d.ts → types-BOPsFZYi.d.ts} +8 -1
- package/package.json +1 -1
|
@@ -5,13 +5,19 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Configuration for the Granular client
|
|
7
7
|
*/
|
|
8
|
+
type AccessTokenProvider = () => Promise<string | null | undefined> | string | null | undefined;
|
|
9
|
+
type EndpointMode = 'auto' | 'local' | 'production';
|
|
8
10
|
interface GranularOptions {
|
|
9
11
|
/** Your Granular API key (for service/CLI auth; use with GRANULAR_API_KEY) */
|
|
10
12
|
apiKey?: string;
|
|
11
13
|
/** Application/session JWT (for user-context auth; use from simulator or getAccessToken) */
|
|
12
14
|
token?: string;
|
|
15
|
+
/** Optional provider used to refresh JWT before WebSocket (re)connect attempts */
|
|
16
|
+
tokenProvider?: AccessTokenProvider;
|
|
13
17
|
/** Optional API URL (for on-prem or testing) */
|
|
14
18
|
apiUrl?: string;
|
|
19
|
+
/** Optional endpoint mode when apiUrl is not explicitly provided */
|
|
20
|
+
endpointMode?: EndpointMode;
|
|
15
21
|
/** Optional WebSocket constructor (for Node.js environments) */
|
|
16
22
|
WebSocketCtor?: any;
|
|
17
23
|
/**
|
|
@@ -429,6 +435,7 @@ interface WSClientOptions {
|
|
|
429
435
|
url: string;
|
|
430
436
|
sessionId: string;
|
|
431
437
|
token: string;
|
|
438
|
+
tokenProvider?: AccessTokenProvider;
|
|
432
439
|
WebSocketCtor?: any;
|
|
433
440
|
onUnexpectedClose?: (info: WSDisconnectInfo) => void;
|
|
434
441
|
onReconnectError?: (info: WSReconnectErrorInfo) => void;
|
|
@@ -662,4 +669,4 @@ interface DeleteResponse {
|
|
|
662
669
|
deleted: boolean;
|
|
663
670
|
}
|
|
664
671
|
|
|
665
|
-
export type {
|
|
672
|
+
export type { ToolInvokeParams as $, AssignmentListResponse as A, BuildPolicy as B, ConnectOptions as C, DomainState as D, EnvironmentData as E, BuildStatus as F, GranularOptions as G, Build as H, InstanceToolHandler as I, Job as J, BuildListResponse as K, JobStatus as L, ModelRef as M, JobSubmitResult as N, Prompt as O, PublishToolsResult as P, WSDisconnectInfo as Q, RecordUserOptions as R, SandboxListResponse as S, ToolWithHandler as T, User as U, WSReconnectErrorInfo as V, WSClientOptions as W, RPCRequest as X, RPCResponse as Y, SyncMessage as Z, RPCRequestFromServer as _, ToolHandler as a, ToolResultParams as a0, ManifestPropertySpec as a1, ManifestRelationshipDef as a2, ManifestOperation as a3, ManifestImport as a4, ManifestVolume as a5, APIError as a6, 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, AccessTokenProvider as r, EndpointMode as s, GranularAuth as t, PermissionRules as u, PermissionProfileListResponse as v, Assignment as w, EnvironmentListResponse as x, Manifest as y, ManifestListResponse as z };
|
|
@@ -5,13 +5,19 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Configuration for the Granular client
|
|
7
7
|
*/
|
|
8
|
+
type AccessTokenProvider = () => Promise<string | null | undefined> | string | null | undefined;
|
|
9
|
+
type EndpointMode = 'auto' | 'local' | 'production';
|
|
8
10
|
interface GranularOptions {
|
|
9
11
|
/** Your Granular API key (for service/CLI auth; use with GRANULAR_API_KEY) */
|
|
10
12
|
apiKey?: string;
|
|
11
13
|
/** Application/session JWT (for user-context auth; use from simulator or getAccessToken) */
|
|
12
14
|
token?: string;
|
|
15
|
+
/** Optional provider used to refresh JWT before WebSocket (re)connect attempts */
|
|
16
|
+
tokenProvider?: AccessTokenProvider;
|
|
13
17
|
/** Optional API URL (for on-prem or testing) */
|
|
14
18
|
apiUrl?: string;
|
|
19
|
+
/** Optional endpoint mode when apiUrl is not explicitly provided */
|
|
20
|
+
endpointMode?: EndpointMode;
|
|
15
21
|
/** Optional WebSocket constructor (for Node.js environments) */
|
|
16
22
|
WebSocketCtor?: any;
|
|
17
23
|
/**
|
|
@@ -429,6 +435,7 @@ interface WSClientOptions {
|
|
|
429
435
|
url: string;
|
|
430
436
|
sessionId: string;
|
|
431
437
|
token: string;
|
|
438
|
+
tokenProvider?: AccessTokenProvider;
|
|
432
439
|
WebSocketCtor?: any;
|
|
433
440
|
onUnexpectedClose?: (info: WSDisconnectInfo) => void;
|
|
434
441
|
onReconnectError?: (info: WSReconnectErrorInfo) => void;
|
|
@@ -662,4 +669,4 @@ interface DeleteResponse {
|
|
|
662
669
|
deleted: boolean;
|
|
663
670
|
}
|
|
664
671
|
|
|
665
|
-
export type {
|
|
672
|
+
export type { ToolInvokeParams as $, AssignmentListResponse as A, BuildPolicy as B, ConnectOptions as C, DomainState as D, EnvironmentData as E, BuildStatus as F, GranularOptions as G, Build as H, InstanceToolHandler as I, Job as J, BuildListResponse as K, JobStatus as L, ModelRef as M, JobSubmitResult as N, Prompt as O, PublishToolsResult as P, WSDisconnectInfo as Q, RecordUserOptions as R, SandboxListResponse as S, ToolWithHandler as T, User as U, WSReconnectErrorInfo as V, WSClientOptions as W, RPCRequest as X, RPCResponse as Y, SyncMessage as Z, RPCRequestFromServer as _, ToolHandler as a, ToolResultParams as a0, ManifestPropertySpec as a1, ManifestRelationshipDef as a2, ManifestOperation as a3, ManifestImport as a4, ManifestVolume as a5, APIError as a6, 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, AccessTokenProvider as r, EndpointMode as s, GranularAuth as t, PermissionRules as u, PermissionProfileListResponse as v, Assignment as w, EnvironmentListResponse as x, Manifest as y, ManifestListResponse as z };
|