@granular-software/sdk 0.4.14 → 0.4.16
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/cli/index.js +5643 -4
- package/dist/index.d.mts +62 -1
- package/dist/index.d.ts +62 -1
- package/dist/index.js +5827 -79
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5823 -75
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -122,6 +122,24 @@ interface ConnectOptions {
|
|
|
122
122
|
id: string;
|
|
123
123
|
}>;
|
|
124
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Control-plane session row: one real-time conversation thread with the agent for an environment.
|
|
127
|
+
*/
|
|
128
|
+
interface ConversationSessionInfo {
|
|
129
|
+
sessionId: string;
|
|
130
|
+
tenantId?: string;
|
|
131
|
+
environmentId: string;
|
|
132
|
+
versionId?: string | null;
|
|
133
|
+
docId: string;
|
|
134
|
+
status: 'active' | 'closed' | 'expired';
|
|
135
|
+
createdAt: string;
|
|
136
|
+
lastSeenAt: string;
|
|
137
|
+
summary?: string | null;
|
|
138
|
+
summaryUpdatedAt?: string | null;
|
|
139
|
+
subjectId?: string | null;
|
|
140
|
+
jobCount?: number;
|
|
141
|
+
toolCallCount?: number;
|
|
142
|
+
}
|
|
125
143
|
/**
|
|
126
144
|
* A sandbox container
|
|
127
145
|
*/
|
|
@@ -1742,6 +1760,49 @@ declare class Granular {
|
|
|
1742
1760
|
* ```
|
|
1743
1761
|
*/
|
|
1744
1762
|
connect(options: ConnectOptions): Promise<Environment>;
|
|
1763
|
+
/**
|
|
1764
|
+
* List active (open) sessions for an environment — each session is one agent conversation thread.
|
|
1765
|
+
*/
|
|
1766
|
+
listOpenSessions(filters: {
|
|
1767
|
+
environmentId: string;
|
|
1768
|
+
}): Promise<ConversationSessionInfo[]>;
|
|
1769
|
+
/**
|
|
1770
|
+
* List closed sessions for an environment (conversations that have disconnected).
|
|
1771
|
+
*/
|
|
1772
|
+
listClosedSessions(filters: {
|
|
1773
|
+
environmentId: string;
|
|
1774
|
+
}): Promise<ConversationSessionInfo[]>;
|
|
1775
|
+
private listSessionsForEnvironment;
|
|
1776
|
+
private normalizeConversationSession;
|
|
1777
|
+
private static coerceIsoDate;
|
|
1778
|
+
/**
|
|
1779
|
+
* Create a new session (conversation) for an existing environment and connect to it.
|
|
1780
|
+
* The runtime graph is shared across all sessions for the same environment.
|
|
1781
|
+
*/
|
|
1782
|
+
createSession(options: {
|
|
1783
|
+
environmentId: string;
|
|
1784
|
+
clientId?: string;
|
|
1785
|
+
initialHeap?: ConnectOptions['initialHeap'];
|
|
1786
|
+
}): Promise<Environment>;
|
|
1787
|
+
/**
|
|
1788
|
+
* Connect to an existing open session (same conversation thread) using a freshly minted WebSocket token.
|
|
1789
|
+
*/
|
|
1790
|
+
connectSession(options: {
|
|
1791
|
+
sessionId: string;
|
|
1792
|
+
clientId?: string;
|
|
1793
|
+
}): Promise<Environment>;
|
|
1794
|
+
/**
|
|
1795
|
+
* Mark a session closed in the control plane. If `environment` is the connected handle for that
|
|
1796
|
+
* `sessionId`, disconnects the WebSocket so the runtime tears down cleanly.
|
|
1797
|
+
*/
|
|
1798
|
+
closeSession(sessionId: string, environment?: Environment | null): Promise<void>;
|
|
1799
|
+
/**
|
|
1800
|
+
* Re-open a closed session in the index and connect to its existing runtime document.
|
|
1801
|
+
*/
|
|
1802
|
+
reopenSession(sessionId: string, options?: {
|
|
1803
|
+
clientId?: string;
|
|
1804
|
+
}): Promise<Environment>;
|
|
1805
|
+
private bindWebSocketEnvironment;
|
|
1745
1806
|
private activateEnvironment;
|
|
1746
1807
|
private getSandboxEffectMap;
|
|
1747
1808
|
private serializeEffect;
|
|
@@ -1859,4 +1920,4 @@ type EffectRuntimeRequest = {
|
|
|
1859
1920
|
declare function normalizeEffectBehaviors(value?: ManifestEffectMetamodelSpec | ResolvedEffectBehaviors | null): ResolvedEffectBehaviors;
|
|
1860
1921
|
declare function invokeRegisteredEffect(effectMap: Map<string, ToolWithHandler>, request: EffectRuntimeRequest): Promise<unknown>;
|
|
1861
1922
|
|
|
1862
|
-
export { type APIError, type AccessTokenProvider, type Assignment, type AssignmentListResponse, type Build, type BuildListResponse, type BuildPolicy, type BuildStatus, type ConnectOptions, type CreateEnvironmentData, type CreatePermissionProfileData, type CreateSandboxData, type DefineRelationshipOptions, type DeleteResponse, type DomainState, type EffectHandler, type EffectHandlerContext, type EffectInfo, type EffectInvocationMetadata, type EffectInvocationMode, type EffectSchema, type EffectWithHandler, type EffectsChangedEvent, type EndpointMode, Environment, type EnvironmentData, type EnvironmentListResponse, type EnvironmentRecordImportSummary, Granular, type GranularAuth, type GranularOptions, type GraphQLResult, type InstanceEffectHandler, type InstanceToolHandler, type Job, type JobFeedbackInput, type JobFeedbackMetadata, type JobFeedbackRecord, type JobFeedbackSentiment, type JobFeedbackToolCall, type JobStatus, type JobSubmitResult, type Manifest, type ManifestApprovalRequiredSpec, type ManifestContent, type ManifestDryRunSpec, type ManifestEffectDeclaration, type ManifestEffectMetamodelSpec, type ManifestEffectSchema, type ManifestEnumRuleSpec, type ManifestFilterBySpec, type ManifestImport, type ManifestListResponse, type ManifestOperation, type ManifestPostConditionSpec, type ManifestPropertySpec, type ManifestRelationshipDef, type ManifestReverseSpec, type ManifestStateMachineSpec, type ManifestStateMachineStateSpec, type ManifestStateMachineTransitionSpec, type ManifestValidationOperator, type ManifestValidationRuleSpec, type ManifestVolume, type ModelRef, type PermissionProfile, type PermissionProfileListResponse, type PermissionRules, type Prompt, type PublishEffectsResult, type PublishToolsResult, type RPCRequest, type RPCRequestFromServer, type RPCResponse, type RecordImport, type RecordImportItem, type RecordImportItemStatus, type RecordImportStats, type RecordImportStatus, type RecordObjectOptions, type RecordObjectResult, type RecordUserOptions, type RelationshipInfo, type ResolvedEffectApprovalRequired, type ResolvedEffectBehaviors, type ResolvedEffectDryRun, type ResolvedEffectPostCondition, type ResolvedEffectReverse, type Sandbox, type SandboxListResponse, type SemanticVersionDiff, type SemanticVersionDiffEntry, Session, type SessionHeapEntry, type SessionHeapFieldType, type SessionHeapFieldValue, type SessionHeapList, type SessionHeapSnapshot, type SessionHeapVariable, type Subject, type SyncMessage, type ToolHandler, type ToolInfo, type ToolInvokeParams, type ToolResultParams, type ToolSchema, type ToolWithHandler, type ToolsChangedEvent, type User, type Version, type VersionTag, type VersionTracking, WSClient, type WSClientOptions, type WSDisconnectInfo, type WSReconnectErrorInfo, invokeRegisteredEffect, normalizeEffectBehaviors };
|
|
1923
|
+
export { type APIError, type AccessTokenProvider, type Assignment, type AssignmentListResponse, type Build, type BuildListResponse, type BuildPolicy, type BuildStatus, type ConnectOptions, type ConversationSessionInfo, type CreateEnvironmentData, type CreatePermissionProfileData, type CreateSandboxData, type DefineRelationshipOptions, type DeleteResponse, type DomainState, type EffectHandler, type EffectHandlerContext, type EffectInfo, type EffectInvocationMetadata, type EffectInvocationMode, type EffectSchema, type EffectWithHandler, type EffectsChangedEvent, type EndpointMode, Environment, type EnvironmentData, type EnvironmentListResponse, type EnvironmentRecordImportSummary, Granular, type GranularAuth, type GranularOptions, type GraphQLResult, type InstanceEffectHandler, type InstanceToolHandler, type Job, type JobFeedbackInput, type JobFeedbackMetadata, type JobFeedbackRecord, type JobFeedbackSentiment, type JobFeedbackToolCall, type JobStatus, type JobSubmitResult, type Manifest, type ManifestApprovalRequiredSpec, type ManifestContent, type ManifestDryRunSpec, type ManifestEffectDeclaration, type ManifestEffectMetamodelSpec, type ManifestEffectSchema, type ManifestEnumRuleSpec, type ManifestFilterBySpec, type ManifestImport, type ManifestListResponse, type ManifestOperation, type ManifestPostConditionSpec, type ManifestPropertySpec, type ManifestRelationshipDef, type ManifestReverseSpec, type ManifestStateMachineSpec, type ManifestStateMachineStateSpec, type ManifestStateMachineTransitionSpec, type ManifestValidationOperator, type ManifestValidationRuleSpec, type ManifestVolume, type ModelRef, type PermissionProfile, type PermissionProfileListResponse, type PermissionRules, type Prompt, type PublishEffectsResult, type PublishToolsResult, type RPCRequest, type RPCRequestFromServer, type RPCResponse, type RecordImport, type RecordImportItem, type RecordImportItemStatus, type RecordImportStats, type RecordImportStatus, type RecordObjectOptions, type RecordObjectResult, type RecordUserOptions, type RelationshipInfo, type ResolvedEffectApprovalRequired, type ResolvedEffectBehaviors, type ResolvedEffectDryRun, type ResolvedEffectPostCondition, type ResolvedEffectReverse, type Sandbox, type SandboxListResponse, type SemanticVersionDiff, type SemanticVersionDiffEntry, Session, type SessionHeapEntry, type SessionHeapFieldType, type SessionHeapFieldValue, type SessionHeapList, type SessionHeapSnapshot, type SessionHeapVariable, type Subject, type SyncMessage, type ToolHandler, type ToolInfo, type ToolInvokeParams, type ToolResultParams, type ToolSchema, type ToolWithHandler, type ToolsChangedEvent, type User, type Version, type VersionTag, type VersionTracking, WSClient, type WSClientOptions, type WSDisconnectInfo, type WSReconnectErrorInfo, invokeRegisteredEffect, normalizeEffectBehaviors };
|
package/dist/index.d.ts
CHANGED
|
@@ -122,6 +122,24 @@ interface ConnectOptions {
|
|
|
122
122
|
id: string;
|
|
123
123
|
}>;
|
|
124
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Control-plane session row: one real-time conversation thread with the agent for an environment.
|
|
127
|
+
*/
|
|
128
|
+
interface ConversationSessionInfo {
|
|
129
|
+
sessionId: string;
|
|
130
|
+
tenantId?: string;
|
|
131
|
+
environmentId: string;
|
|
132
|
+
versionId?: string | null;
|
|
133
|
+
docId: string;
|
|
134
|
+
status: 'active' | 'closed' | 'expired';
|
|
135
|
+
createdAt: string;
|
|
136
|
+
lastSeenAt: string;
|
|
137
|
+
summary?: string | null;
|
|
138
|
+
summaryUpdatedAt?: string | null;
|
|
139
|
+
subjectId?: string | null;
|
|
140
|
+
jobCount?: number;
|
|
141
|
+
toolCallCount?: number;
|
|
142
|
+
}
|
|
125
143
|
/**
|
|
126
144
|
* A sandbox container
|
|
127
145
|
*/
|
|
@@ -1742,6 +1760,49 @@ declare class Granular {
|
|
|
1742
1760
|
* ```
|
|
1743
1761
|
*/
|
|
1744
1762
|
connect(options: ConnectOptions): Promise<Environment>;
|
|
1763
|
+
/**
|
|
1764
|
+
* List active (open) sessions for an environment — each session is one agent conversation thread.
|
|
1765
|
+
*/
|
|
1766
|
+
listOpenSessions(filters: {
|
|
1767
|
+
environmentId: string;
|
|
1768
|
+
}): Promise<ConversationSessionInfo[]>;
|
|
1769
|
+
/**
|
|
1770
|
+
* List closed sessions for an environment (conversations that have disconnected).
|
|
1771
|
+
*/
|
|
1772
|
+
listClosedSessions(filters: {
|
|
1773
|
+
environmentId: string;
|
|
1774
|
+
}): Promise<ConversationSessionInfo[]>;
|
|
1775
|
+
private listSessionsForEnvironment;
|
|
1776
|
+
private normalizeConversationSession;
|
|
1777
|
+
private static coerceIsoDate;
|
|
1778
|
+
/**
|
|
1779
|
+
* Create a new session (conversation) for an existing environment and connect to it.
|
|
1780
|
+
* The runtime graph is shared across all sessions for the same environment.
|
|
1781
|
+
*/
|
|
1782
|
+
createSession(options: {
|
|
1783
|
+
environmentId: string;
|
|
1784
|
+
clientId?: string;
|
|
1785
|
+
initialHeap?: ConnectOptions['initialHeap'];
|
|
1786
|
+
}): Promise<Environment>;
|
|
1787
|
+
/**
|
|
1788
|
+
* Connect to an existing open session (same conversation thread) using a freshly minted WebSocket token.
|
|
1789
|
+
*/
|
|
1790
|
+
connectSession(options: {
|
|
1791
|
+
sessionId: string;
|
|
1792
|
+
clientId?: string;
|
|
1793
|
+
}): Promise<Environment>;
|
|
1794
|
+
/**
|
|
1795
|
+
* Mark a session closed in the control plane. If `environment` is the connected handle for that
|
|
1796
|
+
* `sessionId`, disconnects the WebSocket so the runtime tears down cleanly.
|
|
1797
|
+
*/
|
|
1798
|
+
closeSession(sessionId: string, environment?: Environment | null): Promise<void>;
|
|
1799
|
+
/**
|
|
1800
|
+
* Re-open a closed session in the index and connect to its existing runtime document.
|
|
1801
|
+
*/
|
|
1802
|
+
reopenSession(sessionId: string, options?: {
|
|
1803
|
+
clientId?: string;
|
|
1804
|
+
}): Promise<Environment>;
|
|
1805
|
+
private bindWebSocketEnvironment;
|
|
1745
1806
|
private activateEnvironment;
|
|
1746
1807
|
private getSandboxEffectMap;
|
|
1747
1808
|
private serializeEffect;
|
|
@@ -1859,4 +1920,4 @@ type EffectRuntimeRequest = {
|
|
|
1859
1920
|
declare function normalizeEffectBehaviors(value?: ManifestEffectMetamodelSpec | ResolvedEffectBehaviors | null): ResolvedEffectBehaviors;
|
|
1860
1921
|
declare function invokeRegisteredEffect(effectMap: Map<string, ToolWithHandler>, request: EffectRuntimeRequest): Promise<unknown>;
|
|
1861
1922
|
|
|
1862
|
-
export { type APIError, type AccessTokenProvider, type Assignment, type AssignmentListResponse, type Build, type BuildListResponse, type BuildPolicy, type BuildStatus, type ConnectOptions, type CreateEnvironmentData, type CreatePermissionProfileData, type CreateSandboxData, type DefineRelationshipOptions, type DeleteResponse, type DomainState, type EffectHandler, type EffectHandlerContext, type EffectInfo, type EffectInvocationMetadata, type EffectInvocationMode, type EffectSchema, type EffectWithHandler, type EffectsChangedEvent, type EndpointMode, Environment, type EnvironmentData, type EnvironmentListResponse, type EnvironmentRecordImportSummary, Granular, type GranularAuth, type GranularOptions, type GraphQLResult, type InstanceEffectHandler, type InstanceToolHandler, type Job, type JobFeedbackInput, type JobFeedbackMetadata, type JobFeedbackRecord, type JobFeedbackSentiment, type JobFeedbackToolCall, type JobStatus, type JobSubmitResult, type Manifest, type ManifestApprovalRequiredSpec, type ManifestContent, type ManifestDryRunSpec, type ManifestEffectDeclaration, type ManifestEffectMetamodelSpec, type ManifestEffectSchema, type ManifestEnumRuleSpec, type ManifestFilterBySpec, type ManifestImport, type ManifestListResponse, type ManifestOperation, type ManifestPostConditionSpec, type ManifestPropertySpec, type ManifestRelationshipDef, type ManifestReverseSpec, type ManifestStateMachineSpec, type ManifestStateMachineStateSpec, type ManifestStateMachineTransitionSpec, type ManifestValidationOperator, type ManifestValidationRuleSpec, type ManifestVolume, type ModelRef, type PermissionProfile, type PermissionProfileListResponse, type PermissionRules, type Prompt, type PublishEffectsResult, type PublishToolsResult, type RPCRequest, type RPCRequestFromServer, type RPCResponse, type RecordImport, type RecordImportItem, type RecordImportItemStatus, type RecordImportStats, type RecordImportStatus, type RecordObjectOptions, type RecordObjectResult, type RecordUserOptions, type RelationshipInfo, type ResolvedEffectApprovalRequired, type ResolvedEffectBehaviors, type ResolvedEffectDryRun, type ResolvedEffectPostCondition, type ResolvedEffectReverse, type Sandbox, type SandboxListResponse, type SemanticVersionDiff, type SemanticVersionDiffEntry, Session, type SessionHeapEntry, type SessionHeapFieldType, type SessionHeapFieldValue, type SessionHeapList, type SessionHeapSnapshot, type SessionHeapVariable, type Subject, type SyncMessage, type ToolHandler, type ToolInfo, type ToolInvokeParams, type ToolResultParams, type ToolSchema, type ToolWithHandler, type ToolsChangedEvent, type User, type Version, type VersionTag, type VersionTracking, WSClient, type WSClientOptions, type WSDisconnectInfo, type WSReconnectErrorInfo, invokeRegisteredEffect, normalizeEffectBehaviors };
|
|
1923
|
+
export { type APIError, type AccessTokenProvider, type Assignment, type AssignmentListResponse, type Build, type BuildListResponse, type BuildPolicy, type BuildStatus, type ConnectOptions, type ConversationSessionInfo, type CreateEnvironmentData, type CreatePermissionProfileData, type CreateSandboxData, type DefineRelationshipOptions, type DeleteResponse, type DomainState, type EffectHandler, type EffectHandlerContext, type EffectInfo, type EffectInvocationMetadata, type EffectInvocationMode, type EffectSchema, type EffectWithHandler, type EffectsChangedEvent, type EndpointMode, Environment, type EnvironmentData, type EnvironmentListResponse, type EnvironmentRecordImportSummary, Granular, type GranularAuth, type GranularOptions, type GraphQLResult, type InstanceEffectHandler, type InstanceToolHandler, type Job, type JobFeedbackInput, type JobFeedbackMetadata, type JobFeedbackRecord, type JobFeedbackSentiment, type JobFeedbackToolCall, type JobStatus, type JobSubmitResult, type Manifest, type ManifestApprovalRequiredSpec, type ManifestContent, type ManifestDryRunSpec, type ManifestEffectDeclaration, type ManifestEffectMetamodelSpec, type ManifestEffectSchema, type ManifestEnumRuleSpec, type ManifestFilterBySpec, type ManifestImport, type ManifestListResponse, type ManifestOperation, type ManifestPostConditionSpec, type ManifestPropertySpec, type ManifestRelationshipDef, type ManifestReverseSpec, type ManifestStateMachineSpec, type ManifestStateMachineStateSpec, type ManifestStateMachineTransitionSpec, type ManifestValidationOperator, type ManifestValidationRuleSpec, type ManifestVolume, type ModelRef, type PermissionProfile, type PermissionProfileListResponse, type PermissionRules, type Prompt, type PublishEffectsResult, type PublishToolsResult, type RPCRequest, type RPCRequestFromServer, type RPCResponse, type RecordImport, type RecordImportItem, type RecordImportItemStatus, type RecordImportStats, type RecordImportStatus, type RecordObjectOptions, type RecordObjectResult, type RecordUserOptions, type RelationshipInfo, type ResolvedEffectApprovalRequired, type ResolvedEffectBehaviors, type ResolvedEffectDryRun, type ResolvedEffectPostCondition, type ResolvedEffectReverse, type Sandbox, type SandboxListResponse, type SemanticVersionDiff, type SemanticVersionDiffEntry, Session, type SessionHeapEntry, type SessionHeapFieldType, type SessionHeapFieldValue, type SessionHeapList, type SessionHeapSnapshot, type SessionHeapVariable, type Subject, type SyncMessage, type ToolHandler, type ToolInfo, type ToolInvokeParams, type ToolResultParams, type ToolSchema, type ToolWithHandler, type ToolsChangedEvent, type User, type Version, type VersionTag, type VersionTracking, WSClient, type WSClientOptions, type WSDisconnectInfo, type WSReconnectErrorInfo, invokeRegisteredEffect, normalizeEffectBehaviors };
|