@granular-software/sdk 0.4.31 → 0.4.33
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 +21 -0
- package/dist/agent-evals.d.mts +1 -1
- package/dist/agent-evals.d.ts +1 -1
- package/dist/agent-evals.js +812 -313
- package/dist/agent-evals.js.map +1 -1
- package/dist/agent-evals.mjs +812 -313
- package/dist/agent-evals.mjs.map +1 -1
- package/dist/cli/index.js +813 -59
- package/dist/{client-CTH1hfwe.d.mts → client-DTvI5MUG.d.mts} +112 -19
- package/dist/{client-CTH1hfwe.d.ts → client-DTvI5MUG.d.ts} +112 -19
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7864 -7665
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7864 -7665
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -86,15 +86,16 @@ interface Subject {
|
|
|
86
86
|
updatedAt: number;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
|
-
* Options for opening
|
|
89
|
+
* Options for opening an ontology environment for one delegated subject.
|
|
90
90
|
*
|
|
91
|
-
* This does
|
|
92
|
-
*
|
|
91
|
+
* This does not open a live runtime session. Use
|
|
92
|
+
* `environment.sessions.create()` or `granular.createSession({ environmentId })`
|
|
93
|
+
* when you need a conversation/session with jobs, prompts, heap, and effects.
|
|
93
94
|
*/
|
|
94
95
|
interface OpenEnvironmentOptions {
|
|
95
|
-
/** The ontology name or ID to open */
|
|
96
|
+
/** The ontology name or ID to open. */
|
|
96
97
|
ontology: string;
|
|
97
|
-
/** Version channel to follow, typically `dev` or `prod
|
|
98
|
+
/** Version channel to follow, typically `dev` or `prod`. */
|
|
98
99
|
tag?: string;
|
|
99
100
|
/**
|
|
100
101
|
* External user identifier from your app.
|
|
@@ -108,9 +109,9 @@ interface OpenEnvironmentOptions {
|
|
|
108
109
|
* Exactly one of `userId`, `granularId`, or `user` should be provided.
|
|
109
110
|
*/
|
|
110
111
|
granularId?: string;
|
|
111
|
-
/** Optional display name used when upserting the user */
|
|
112
|
+
/** Optional display name used when upserting the user. */
|
|
112
113
|
name?: string;
|
|
113
|
-
/** Optional email used when upserting the user */
|
|
114
|
+
/** Optional email used when upserting the user. */
|
|
114
115
|
email?: string;
|
|
115
116
|
/**
|
|
116
117
|
* Permission profile names or IDs to ensure before opening the environment.
|
|
@@ -124,14 +125,14 @@ interface OpenEnvironmentOptions {
|
|
|
124
125
|
* the newest tag target instead of reusing the outdated one.
|
|
125
126
|
*/
|
|
126
127
|
createFreshIfOutdated?: boolean;
|
|
127
|
-
/** Backwards-compatible user object returned from recordUser() */
|
|
128
|
+
/** Backwards-compatible user object returned from `recordUser()`. */
|
|
128
129
|
user?: User;
|
|
129
130
|
}
|
|
130
131
|
/**
|
|
131
132
|
* Deprecated compatibility alias for the legacy `connect()` entry point.
|
|
132
133
|
*
|
|
133
|
-
* `connect()` now resolves an environment handle and no longer opens a
|
|
134
|
-
*
|
|
134
|
+
* `connect()` now resolves an environment handle and no longer opens a runtime
|
|
135
|
+
* session automatically. Prefer `openEnvironment()` for new code.
|
|
135
136
|
*/
|
|
136
137
|
interface ConnectOptions extends OpenEnvironmentOptions {
|
|
137
138
|
/** @deprecated Legacy explicit environment slot name. Prefer `tag`. */
|
|
@@ -671,7 +672,7 @@ interface JobFeedbackRecord {
|
|
|
671
672
|
updatedAt: number;
|
|
672
673
|
}
|
|
673
674
|
/**
|
|
674
|
-
* Persisted feedback
|
|
675
|
+
* Persisted feedback row listed at the environment level.
|
|
675
676
|
*/
|
|
676
677
|
interface EnvironmentFeedbackRecord {
|
|
677
678
|
feedbackId: string;
|
|
@@ -701,7 +702,7 @@ interface Job {
|
|
|
701
702
|
/** Attach user feedback to this job and persist it with job/session metadata */
|
|
702
703
|
leaveFeedback(input: JobFeedbackInput): Promise<JobFeedbackRecord>;
|
|
703
704
|
/** Subscribe to job events */
|
|
704
|
-
on(event: string, handler: (data: unknown) => void): void;
|
|
705
|
+
on(event: string, handler: (data: unknown) => void): () => void;
|
|
705
706
|
}
|
|
706
707
|
interface Prompt {
|
|
707
708
|
id: string;
|
|
@@ -738,6 +739,52 @@ interface ConversationAppendResult {
|
|
|
738
739
|
jobId?: string;
|
|
739
740
|
promptId?: string;
|
|
740
741
|
}
|
|
742
|
+
interface SessionConversationMessage {
|
|
743
|
+
id: string;
|
|
744
|
+
role: "user" | "assistant";
|
|
745
|
+
content?: string;
|
|
746
|
+
show?: ConversationMessageShowRefs;
|
|
747
|
+
jobId?: string;
|
|
748
|
+
promptId?: string;
|
|
749
|
+
ts: number;
|
|
750
|
+
[key: string]: unknown;
|
|
751
|
+
}
|
|
752
|
+
interface SessionTimelineEvent {
|
|
753
|
+
id?: string;
|
|
754
|
+
eventId?: string;
|
|
755
|
+
kind?: string;
|
|
756
|
+
type?: string;
|
|
757
|
+
status?: string | null;
|
|
758
|
+
message?: string;
|
|
759
|
+
summary?: string;
|
|
760
|
+
title?: string;
|
|
761
|
+
ts?: number;
|
|
762
|
+
timestamp?: number;
|
|
763
|
+
at?: number;
|
|
764
|
+
createdAt?: number;
|
|
765
|
+
[key: string]: unknown;
|
|
766
|
+
}
|
|
767
|
+
interface SessionJobRecord {
|
|
768
|
+
jobId: string;
|
|
769
|
+
status: string;
|
|
770
|
+
code?: string;
|
|
771
|
+
createdAt?: number;
|
|
772
|
+
startedAt?: number;
|
|
773
|
+
completedAt?: number;
|
|
774
|
+
durationMs?: number | null;
|
|
775
|
+
progressPercent?: number | null;
|
|
776
|
+
progressMessage?: string | null;
|
|
777
|
+
stdout?: string[];
|
|
778
|
+
stderr?: string[];
|
|
779
|
+
result?: unknown;
|
|
780
|
+
error?: string | null;
|
|
781
|
+
toolCalls?: JobFeedbackToolCall[];
|
|
782
|
+
prompts?: Record<string, unknown>;
|
|
783
|
+
actionSummary?: string[];
|
|
784
|
+
actionTrace?: Array<Record<string, unknown>>;
|
|
785
|
+
agentMessages?: Array<Record<string, unknown>>;
|
|
786
|
+
[key: string]: unknown;
|
|
787
|
+
}
|
|
741
788
|
interface SessionTranscriptEntry {
|
|
742
789
|
id: string;
|
|
743
790
|
role: "user" | "assistant";
|
|
@@ -794,6 +841,23 @@ interface SessionHeapSnapshot {
|
|
|
794
841
|
variablesByName: Record<string, SessionHeapVariable>;
|
|
795
842
|
updatedAt: number;
|
|
796
843
|
}
|
|
844
|
+
interface SessionDocumentResult {
|
|
845
|
+
sessionState: Record<string, unknown> | null;
|
|
846
|
+
document: Record<string, unknown> | null;
|
|
847
|
+
savedAt: number;
|
|
848
|
+
}
|
|
849
|
+
interface SessionCollectionListOptions {
|
|
850
|
+
limit?: number;
|
|
851
|
+
cursor?: string | null;
|
|
852
|
+
}
|
|
853
|
+
interface SessionJobListOptions extends SessionCollectionListOptions {
|
|
854
|
+
status?: string | null;
|
|
855
|
+
}
|
|
856
|
+
interface SessionCollectionListResult<T = unknown> {
|
|
857
|
+
items: T[];
|
|
858
|
+
nextCursor: string | null;
|
|
859
|
+
totalCount: number;
|
|
860
|
+
}
|
|
797
861
|
interface WSDisconnectInfo {
|
|
798
862
|
code?: number;
|
|
799
863
|
reason?: string;
|
|
@@ -1048,10 +1112,6 @@ interface ManifestPropertySpec {
|
|
|
1048
1112
|
required?: boolean;
|
|
1049
1113
|
note?: string | string[];
|
|
1050
1114
|
enum?: string[] | ManifestEnumRuleSpec;
|
|
1051
|
-
searchable?: boolean | {
|
|
1052
|
-
enabled?: boolean;
|
|
1053
|
-
phonetic?: boolean;
|
|
1054
|
-
};
|
|
1055
1115
|
filterBy?: boolean | string[] | ManifestFilterBySpec;
|
|
1056
1116
|
validate?: ManifestValidationRuleSpec[];
|
|
1057
1117
|
}
|
|
@@ -1480,7 +1540,7 @@ declare class Session {
|
|
|
1480
1540
|
/**
|
|
1481
1541
|
* Subscribe to session events
|
|
1482
1542
|
*/
|
|
1483
|
-
on(event: string, handler: (data: unknown) => void): void;
|
|
1543
|
+
on(event: string, handler: (data: unknown) => void): () => void;
|
|
1484
1544
|
/**
|
|
1485
1545
|
* Unsubscribe from session events
|
|
1486
1546
|
*/
|
|
@@ -1886,6 +1946,7 @@ declare class EnvironmentSession extends Session {
|
|
|
1886
1946
|
get ontologyId(): string;
|
|
1887
1947
|
get subjectId(): string;
|
|
1888
1948
|
get envName(): string;
|
|
1949
|
+
get tag(): string | null;
|
|
1889
1950
|
get versionId(): string;
|
|
1890
1951
|
get granularId(): string;
|
|
1891
1952
|
get permissionProfileId(): string;
|
|
@@ -1906,9 +1967,41 @@ declare class EnvironmentSession extends Session {
|
|
|
1906
1967
|
list: () => Promise<EnvironmentFeedbackRecord[]>;
|
|
1907
1968
|
};
|
|
1908
1969
|
/**
|
|
1909
|
-
* Return a plain JS
|
|
1970
|
+
* Return a plain JS copy of the synced session heap.
|
|
1910
1971
|
*/
|
|
1911
1972
|
getHeap(): SessionHeapSnapshot;
|
|
1973
|
+
private sessionDataRequest;
|
|
1974
|
+
private collectAllSessionItems;
|
|
1975
|
+
/**
|
|
1976
|
+
* Fetch the live session document from the runtime DO.
|
|
1977
|
+
*
|
|
1978
|
+
* For history and saved artifacts, prefer the collection APIs on
|
|
1979
|
+
* `messages`, `timeline`, `jobs`, and `heap`.
|
|
1980
|
+
*/
|
|
1981
|
+
getDocument(): Promise<SessionDocumentResult>;
|
|
1982
|
+
get messages(): {
|
|
1983
|
+
list: (options?: SessionCollectionListOptions) => Promise<SessionCollectionListResult<SessionConversationMessage>>;
|
|
1984
|
+
};
|
|
1985
|
+
get timeline(): {
|
|
1986
|
+
list: (options?: SessionCollectionListOptions) => Promise<SessionCollectionListResult<SessionTimelineEvent>>;
|
|
1987
|
+
};
|
|
1988
|
+
get jobs(): {
|
|
1989
|
+
list: (options?: SessionJobListOptions) => Promise<SessionCollectionListResult<SessionJobRecord>>;
|
|
1990
|
+
get: (jobId: string) => Promise<SessionJobRecord>;
|
|
1991
|
+
};
|
|
1992
|
+
get heap(): {
|
|
1993
|
+
entries: {
|
|
1994
|
+
list: (options?: SessionCollectionListOptions) => Promise<SessionCollectionListResult<SessionHeapEntry>>;
|
|
1995
|
+
get: (path: string) => Promise<SessionHeapEntry>;
|
|
1996
|
+
};
|
|
1997
|
+
lists: {
|
|
1998
|
+
list: (options?: SessionCollectionListOptions) => Promise<SessionCollectionListResult<SessionHeapList>>;
|
|
1999
|
+
get: (name: string) => Promise<SessionHeapList>;
|
|
2000
|
+
};
|
|
2001
|
+
};
|
|
2002
|
+
get transcript(): {
|
|
2003
|
+
list: (options?: SessionCollectionListOptions) => Promise<SessionCollectionListResult<SessionTranscriptEntry>>;
|
|
2004
|
+
};
|
|
1912
2005
|
graphql<T = any>(query: string, variables?: Record<string, any>): Promise<GraphQLResult<T>>;
|
|
1913
2006
|
defineRelationship(options: DefineRelationshipOptions): Promise<RelationshipInfo>;
|
|
1914
2007
|
getRelationships(modelPath: string): Promise<RelationshipInfo[]>;
|
|
@@ -2233,4 +2326,4 @@ declare class Granular {
|
|
|
2233
2326
|
private request;
|
|
2234
2327
|
}
|
|
2235
2328
|
|
|
2236
|
-
export { type SemanticVersionDiff as $, type AccessTokenProvider as A, type BuildPolicy as B, type ConnectOptions as C, type DomainState as D, type EndpointMode as E, type VersionTag as F, Granular as G, type EnvironmentData as H, type InstanceToolHandler as I, type CreateEnvironmentData as J, type EnvironmentListResponse as K, type Manifest as L, type ManifestEffectMetamodelSpec as M, type ManifestListResponse as N, OntologyHandle as O, type Prompt as P, type BuildStatus as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type User as U, type VersionTracking as V, WSClient as W, type Build as X, type Version as Y, type BuildListResponse as Z, type SemanticVersionDiffEntry as _, type EffectHandlerContext as a, type
|
|
2329
|
+
export { type SemanticVersionDiff as $, type AccessTokenProvider as A, type BuildPolicy as B, type ConnectOptions as C, type DomainState as D, type EndpointMode as E, type VersionTag as F, Granular as G, type EnvironmentData as H, type InstanceToolHandler as I, type CreateEnvironmentData as J, type EnvironmentListResponse as K, type Manifest as L, type ManifestEffectMetamodelSpec as M, type ManifestListResponse as N, OntologyHandle as O, type Prompt as P, type BuildStatus as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type User as U, type VersionTracking as V, WSClient as W, type Build as X, type Version as Y, type BuildListResponse as Z, type SemanticVersionDiffEntry as _, type EffectHandlerContext as a, type ManifestValidationRuleSpec as a$, type ResolvedEffectPostCondition as a0, type ResolvedEffectDryRun as a1, type ResolvedEffectReverse as a2, type ResolvedEffectApprovalRequired as a3, type EffectInvocationMode as a4, type EffectInvocationMetadata as a5, type EffectSchema as a6, type EffectWithHandler as a7, type PublishEffectsResult as a8, type ToolInfo as a9, type SessionCollectionListResult as aA, type WSDisconnectInfo as aB, type WSReconnectErrorInfo as aC, type WSClientOptions as aD, type RPCRequest as aE, type RPCResponse as aF, type SyncMessage as aG, type RPCRequestFromServer as aH, type ToolInvokeParams as aI, type ToolResultParams as aJ, type ModelRef as aK, type RelationshipInfo as aL, type DefineRelationshipOptions as aM, type RecordObjectOptions as aN, type RecordObjectResult as aO, type RecordObjectsChunkInfo as aP, type RecordObjectsOptions as aQ, type RecordImportStatus as aR, type RecordImportItemStatus as aS, type RecordImportStats as aT, type RecordImportItem as aU, type RecordImport as aV, type EnvironmentRecordImportSummary as aW, type ManifestPropertySpec as aX, type ManifestValidationOperator as aY, type ManifestEnumRuleSpec as aZ, type ManifestFilterBySpec as a_, type EffectInfo as aa, type ToolsChangedEvent as ab, type EffectsChangedEvent as ac, type EffectHandler as ad, type InstanceEffectHandler as ae, type JobStatus as af, type JobFeedbackSentiment as ag, type JobFeedbackToolCall as ah, type JobFeedbackMetadata as ai, type JobFeedbackInput as aj, type JobFeedbackRecord as ak, type EnvironmentFeedbackRecord as al, type JobSubmitResult as am, type Job as an, type ConversationMessageShowRefs as ao, type ConversationMessageInput as ap, type ConversationAppendResult as aq, type SessionConversationMessage as ar, type SessionTimelineEvent as as, type SessionJobRecord as at, type SessionHeapFieldType as au, type SessionHeapFieldValue as av, type SessionHeapVariable as aw, type SessionDocumentResult as ax, type SessionCollectionListOptions as ay, type SessionJobListOptions as az, type SessionHeapList as b, type ManifestStateMachineStateSpec as b0, type ManifestStateMachineTransitionSpec as b1, type ManifestStateMachineSpec as b2, type ManifestPostConditionSpec as b3, type ManifestDryRunSpec as b4, type ManifestReverseSpec as b5, type ManifestApprovalRequiredSpec as b6, type ManifestRelationshipDef as b7, type ManifestEffectSchema as b8, type ManifestEffectDeclaration as b9, type ManifestEventTypeDef as ba, type ManifestEventStreamDef as bb, type ManifestOperation as bc, type ManifestImport as bd, type ManifestVolume as be, type ManifestContent as bf, type GraphQLResult as bg, type APIError as bh, type DeleteResponse as bi, type StreamEvent as bj, type StreamSubscription as bk, type StreamStats as bl, type SessionHeapSnapshot as c, type SessionTranscriptEntry as d, Environment as e, EnvironmentSession as f, Session as g, type ToolSchema as h, type PublishToolsResult as i, type ToolHandler as j, type GranularOptions as k, type GranularAuth as l, type RecordUserOptions as m, type Subject as n, type OpenEnvironmentOptions as o, type CreateSessionOptions as p, type ConversationSessionInfo as q, type Sandbox as r, type CreateSandboxData as s, type SandboxListResponse as t, type PermissionRules as u, type PermissionProfile as v, type CreatePermissionProfileData as w, type PermissionProfileListResponse as x, type Assignment as y, type AssignmentListResponse as z };
|
|
@@ -86,15 +86,16 @@ interface Subject {
|
|
|
86
86
|
updatedAt: number;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
|
-
* Options for opening
|
|
89
|
+
* Options for opening an ontology environment for one delegated subject.
|
|
90
90
|
*
|
|
91
|
-
* This does
|
|
92
|
-
*
|
|
91
|
+
* This does not open a live runtime session. Use
|
|
92
|
+
* `environment.sessions.create()` or `granular.createSession({ environmentId })`
|
|
93
|
+
* when you need a conversation/session with jobs, prompts, heap, and effects.
|
|
93
94
|
*/
|
|
94
95
|
interface OpenEnvironmentOptions {
|
|
95
|
-
/** The ontology name or ID to open */
|
|
96
|
+
/** The ontology name or ID to open. */
|
|
96
97
|
ontology: string;
|
|
97
|
-
/** Version channel to follow, typically `dev` or `prod
|
|
98
|
+
/** Version channel to follow, typically `dev` or `prod`. */
|
|
98
99
|
tag?: string;
|
|
99
100
|
/**
|
|
100
101
|
* External user identifier from your app.
|
|
@@ -108,9 +109,9 @@ interface OpenEnvironmentOptions {
|
|
|
108
109
|
* Exactly one of `userId`, `granularId`, or `user` should be provided.
|
|
109
110
|
*/
|
|
110
111
|
granularId?: string;
|
|
111
|
-
/** Optional display name used when upserting the user */
|
|
112
|
+
/** Optional display name used when upserting the user. */
|
|
112
113
|
name?: string;
|
|
113
|
-
/** Optional email used when upserting the user */
|
|
114
|
+
/** Optional email used when upserting the user. */
|
|
114
115
|
email?: string;
|
|
115
116
|
/**
|
|
116
117
|
* Permission profile names or IDs to ensure before opening the environment.
|
|
@@ -124,14 +125,14 @@ interface OpenEnvironmentOptions {
|
|
|
124
125
|
* the newest tag target instead of reusing the outdated one.
|
|
125
126
|
*/
|
|
126
127
|
createFreshIfOutdated?: boolean;
|
|
127
|
-
/** Backwards-compatible user object returned from recordUser() */
|
|
128
|
+
/** Backwards-compatible user object returned from `recordUser()`. */
|
|
128
129
|
user?: User;
|
|
129
130
|
}
|
|
130
131
|
/**
|
|
131
132
|
* Deprecated compatibility alias for the legacy `connect()` entry point.
|
|
132
133
|
*
|
|
133
|
-
* `connect()` now resolves an environment handle and no longer opens a
|
|
134
|
-
*
|
|
134
|
+
* `connect()` now resolves an environment handle and no longer opens a runtime
|
|
135
|
+
* session automatically. Prefer `openEnvironment()` for new code.
|
|
135
136
|
*/
|
|
136
137
|
interface ConnectOptions extends OpenEnvironmentOptions {
|
|
137
138
|
/** @deprecated Legacy explicit environment slot name. Prefer `tag`. */
|
|
@@ -671,7 +672,7 @@ interface JobFeedbackRecord {
|
|
|
671
672
|
updatedAt: number;
|
|
672
673
|
}
|
|
673
674
|
/**
|
|
674
|
-
* Persisted feedback
|
|
675
|
+
* Persisted feedback row listed at the environment level.
|
|
675
676
|
*/
|
|
676
677
|
interface EnvironmentFeedbackRecord {
|
|
677
678
|
feedbackId: string;
|
|
@@ -701,7 +702,7 @@ interface Job {
|
|
|
701
702
|
/** Attach user feedback to this job and persist it with job/session metadata */
|
|
702
703
|
leaveFeedback(input: JobFeedbackInput): Promise<JobFeedbackRecord>;
|
|
703
704
|
/** Subscribe to job events */
|
|
704
|
-
on(event: string, handler: (data: unknown) => void): void;
|
|
705
|
+
on(event: string, handler: (data: unknown) => void): () => void;
|
|
705
706
|
}
|
|
706
707
|
interface Prompt {
|
|
707
708
|
id: string;
|
|
@@ -738,6 +739,52 @@ interface ConversationAppendResult {
|
|
|
738
739
|
jobId?: string;
|
|
739
740
|
promptId?: string;
|
|
740
741
|
}
|
|
742
|
+
interface SessionConversationMessage {
|
|
743
|
+
id: string;
|
|
744
|
+
role: "user" | "assistant";
|
|
745
|
+
content?: string;
|
|
746
|
+
show?: ConversationMessageShowRefs;
|
|
747
|
+
jobId?: string;
|
|
748
|
+
promptId?: string;
|
|
749
|
+
ts: number;
|
|
750
|
+
[key: string]: unknown;
|
|
751
|
+
}
|
|
752
|
+
interface SessionTimelineEvent {
|
|
753
|
+
id?: string;
|
|
754
|
+
eventId?: string;
|
|
755
|
+
kind?: string;
|
|
756
|
+
type?: string;
|
|
757
|
+
status?: string | null;
|
|
758
|
+
message?: string;
|
|
759
|
+
summary?: string;
|
|
760
|
+
title?: string;
|
|
761
|
+
ts?: number;
|
|
762
|
+
timestamp?: number;
|
|
763
|
+
at?: number;
|
|
764
|
+
createdAt?: number;
|
|
765
|
+
[key: string]: unknown;
|
|
766
|
+
}
|
|
767
|
+
interface SessionJobRecord {
|
|
768
|
+
jobId: string;
|
|
769
|
+
status: string;
|
|
770
|
+
code?: string;
|
|
771
|
+
createdAt?: number;
|
|
772
|
+
startedAt?: number;
|
|
773
|
+
completedAt?: number;
|
|
774
|
+
durationMs?: number | null;
|
|
775
|
+
progressPercent?: number | null;
|
|
776
|
+
progressMessage?: string | null;
|
|
777
|
+
stdout?: string[];
|
|
778
|
+
stderr?: string[];
|
|
779
|
+
result?: unknown;
|
|
780
|
+
error?: string | null;
|
|
781
|
+
toolCalls?: JobFeedbackToolCall[];
|
|
782
|
+
prompts?: Record<string, unknown>;
|
|
783
|
+
actionSummary?: string[];
|
|
784
|
+
actionTrace?: Array<Record<string, unknown>>;
|
|
785
|
+
agentMessages?: Array<Record<string, unknown>>;
|
|
786
|
+
[key: string]: unknown;
|
|
787
|
+
}
|
|
741
788
|
interface SessionTranscriptEntry {
|
|
742
789
|
id: string;
|
|
743
790
|
role: "user" | "assistant";
|
|
@@ -794,6 +841,23 @@ interface SessionHeapSnapshot {
|
|
|
794
841
|
variablesByName: Record<string, SessionHeapVariable>;
|
|
795
842
|
updatedAt: number;
|
|
796
843
|
}
|
|
844
|
+
interface SessionDocumentResult {
|
|
845
|
+
sessionState: Record<string, unknown> | null;
|
|
846
|
+
document: Record<string, unknown> | null;
|
|
847
|
+
savedAt: number;
|
|
848
|
+
}
|
|
849
|
+
interface SessionCollectionListOptions {
|
|
850
|
+
limit?: number;
|
|
851
|
+
cursor?: string | null;
|
|
852
|
+
}
|
|
853
|
+
interface SessionJobListOptions extends SessionCollectionListOptions {
|
|
854
|
+
status?: string | null;
|
|
855
|
+
}
|
|
856
|
+
interface SessionCollectionListResult<T = unknown> {
|
|
857
|
+
items: T[];
|
|
858
|
+
nextCursor: string | null;
|
|
859
|
+
totalCount: number;
|
|
860
|
+
}
|
|
797
861
|
interface WSDisconnectInfo {
|
|
798
862
|
code?: number;
|
|
799
863
|
reason?: string;
|
|
@@ -1048,10 +1112,6 @@ interface ManifestPropertySpec {
|
|
|
1048
1112
|
required?: boolean;
|
|
1049
1113
|
note?: string | string[];
|
|
1050
1114
|
enum?: string[] | ManifestEnumRuleSpec;
|
|
1051
|
-
searchable?: boolean | {
|
|
1052
|
-
enabled?: boolean;
|
|
1053
|
-
phonetic?: boolean;
|
|
1054
|
-
};
|
|
1055
1115
|
filterBy?: boolean | string[] | ManifestFilterBySpec;
|
|
1056
1116
|
validate?: ManifestValidationRuleSpec[];
|
|
1057
1117
|
}
|
|
@@ -1480,7 +1540,7 @@ declare class Session {
|
|
|
1480
1540
|
/**
|
|
1481
1541
|
* Subscribe to session events
|
|
1482
1542
|
*/
|
|
1483
|
-
on(event: string, handler: (data: unknown) => void): void;
|
|
1543
|
+
on(event: string, handler: (data: unknown) => void): () => void;
|
|
1484
1544
|
/**
|
|
1485
1545
|
* Unsubscribe from session events
|
|
1486
1546
|
*/
|
|
@@ -1886,6 +1946,7 @@ declare class EnvironmentSession extends Session {
|
|
|
1886
1946
|
get ontologyId(): string;
|
|
1887
1947
|
get subjectId(): string;
|
|
1888
1948
|
get envName(): string;
|
|
1949
|
+
get tag(): string | null;
|
|
1889
1950
|
get versionId(): string;
|
|
1890
1951
|
get granularId(): string;
|
|
1891
1952
|
get permissionProfileId(): string;
|
|
@@ -1906,9 +1967,41 @@ declare class EnvironmentSession extends Session {
|
|
|
1906
1967
|
list: () => Promise<EnvironmentFeedbackRecord[]>;
|
|
1907
1968
|
};
|
|
1908
1969
|
/**
|
|
1909
|
-
* Return a plain JS
|
|
1970
|
+
* Return a plain JS copy of the synced session heap.
|
|
1910
1971
|
*/
|
|
1911
1972
|
getHeap(): SessionHeapSnapshot;
|
|
1973
|
+
private sessionDataRequest;
|
|
1974
|
+
private collectAllSessionItems;
|
|
1975
|
+
/**
|
|
1976
|
+
* Fetch the live session document from the runtime DO.
|
|
1977
|
+
*
|
|
1978
|
+
* For history and saved artifacts, prefer the collection APIs on
|
|
1979
|
+
* `messages`, `timeline`, `jobs`, and `heap`.
|
|
1980
|
+
*/
|
|
1981
|
+
getDocument(): Promise<SessionDocumentResult>;
|
|
1982
|
+
get messages(): {
|
|
1983
|
+
list: (options?: SessionCollectionListOptions) => Promise<SessionCollectionListResult<SessionConversationMessage>>;
|
|
1984
|
+
};
|
|
1985
|
+
get timeline(): {
|
|
1986
|
+
list: (options?: SessionCollectionListOptions) => Promise<SessionCollectionListResult<SessionTimelineEvent>>;
|
|
1987
|
+
};
|
|
1988
|
+
get jobs(): {
|
|
1989
|
+
list: (options?: SessionJobListOptions) => Promise<SessionCollectionListResult<SessionJobRecord>>;
|
|
1990
|
+
get: (jobId: string) => Promise<SessionJobRecord>;
|
|
1991
|
+
};
|
|
1992
|
+
get heap(): {
|
|
1993
|
+
entries: {
|
|
1994
|
+
list: (options?: SessionCollectionListOptions) => Promise<SessionCollectionListResult<SessionHeapEntry>>;
|
|
1995
|
+
get: (path: string) => Promise<SessionHeapEntry>;
|
|
1996
|
+
};
|
|
1997
|
+
lists: {
|
|
1998
|
+
list: (options?: SessionCollectionListOptions) => Promise<SessionCollectionListResult<SessionHeapList>>;
|
|
1999
|
+
get: (name: string) => Promise<SessionHeapList>;
|
|
2000
|
+
};
|
|
2001
|
+
};
|
|
2002
|
+
get transcript(): {
|
|
2003
|
+
list: (options?: SessionCollectionListOptions) => Promise<SessionCollectionListResult<SessionTranscriptEntry>>;
|
|
2004
|
+
};
|
|
1912
2005
|
graphql<T = any>(query: string, variables?: Record<string, any>): Promise<GraphQLResult<T>>;
|
|
1913
2006
|
defineRelationship(options: DefineRelationshipOptions): Promise<RelationshipInfo>;
|
|
1914
2007
|
getRelationships(modelPath: string): Promise<RelationshipInfo[]>;
|
|
@@ -2233,4 +2326,4 @@ declare class Granular {
|
|
|
2233
2326
|
private request;
|
|
2234
2327
|
}
|
|
2235
2328
|
|
|
2236
|
-
export { type SemanticVersionDiff as $, type AccessTokenProvider as A, type BuildPolicy as B, type ConnectOptions as C, type DomainState as D, type EndpointMode as E, type VersionTag as F, Granular as G, type EnvironmentData as H, type InstanceToolHandler as I, type CreateEnvironmentData as J, type EnvironmentListResponse as K, type Manifest as L, type ManifestEffectMetamodelSpec as M, type ManifestListResponse as N, OntologyHandle as O, type Prompt as P, type BuildStatus as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type User as U, type VersionTracking as V, WSClient as W, type Build as X, type Version as Y, type BuildListResponse as Z, type SemanticVersionDiffEntry as _, type EffectHandlerContext as a, type
|
|
2329
|
+
export { type SemanticVersionDiff as $, type AccessTokenProvider as A, type BuildPolicy as B, type ConnectOptions as C, type DomainState as D, type EndpointMode as E, type VersionTag as F, Granular as G, type EnvironmentData as H, type InstanceToolHandler as I, type CreateEnvironmentData as J, type EnvironmentListResponse as K, type Manifest as L, type ManifestEffectMetamodelSpec as M, type ManifestListResponse as N, OntologyHandle as O, type Prompt as P, type BuildStatus as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type User as U, type VersionTracking as V, WSClient as W, type Build as X, type Version as Y, type BuildListResponse as Z, type SemanticVersionDiffEntry as _, type EffectHandlerContext as a, type ManifestValidationRuleSpec as a$, type ResolvedEffectPostCondition as a0, type ResolvedEffectDryRun as a1, type ResolvedEffectReverse as a2, type ResolvedEffectApprovalRequired as a3, type EffectInvocationMode as a4, type EffectInvocationMetadata as a5, type EffectSchema as a6, type EffectWithHandler as a7, type PublishEffectsResult as a8, type ToolInfo as a9, type SessionCollectionListResult as aA, type WSDisconnectInfo as aB, type WSReconnectErrorInfo as aC, type WSClientOptions as aD, type RPCRequest as aE, type RPCResponse as aF, type SyncMessage as aG, type RPCRequestFromServer as aH, type ToolInvokeParams as aI, type ToolResultParams as aJ, type ModelRef as aK, type RelationshipInfo as aL, type DefineRelationshipOptions as aM, type RecordObjectOptions as aN, type RecordObjectResult as aO, type RecordObjectsChunkInfo as aP, type RecordObjectsOptions as aQ, type RecordImportStatus as aR, type RecordImportItemStatus as aS, type RecordImportStats as aT, type RecordImportItem as aU, type RecordImport as aV, type EnvironmentRecordImportSummary as aW, type ManifestPropertySpec as aX, type ManifestValidationOperator as aY, type ManifestEnumRuleSpec as aZ, type ManifestFilterBySpec as a_, type EffectInfo as aa, type ToolsChangedEvent as ab, type EffectsChangedEvent as ac, type EffectHandler as ad, type InstanceEffectHandler as ae, type JobStatus as af, type JobFeedbackSentiment as ag, type JobFeedbackToolCall as ah, type JobFeedbackMetadata as ai, type JobFeedbackInput as aj, type JobFeedbackRecord as ak, type EnvironmentFeedbackRecord as al, type JobSubmitResult as am, type Job as an, type ConversationMessageShowRefs as ao, type ConversationMessageInput as ap, type ConversationAppendResult as aq, type SessionConversationMessage as ar, type SessionTimelineEvent as as, type SessionJobRecord as at, type SessionHeapFieldType as au, type SessionHeapFieldValue as av, type SessionHeapVariable as aw, type SessionDocumentResult as ax, type SessionCollectionListOptions as ay, type SessionJobListOptions as az, type SessionHeapList as b, type ManifestStateMachineStateSpec as b0, type ManifestStateMachineTransitionSpec as b1, type ManifestStateMachineSpec as b2, type ManifestPostConditionSpec as b3, type ManifestDryRunSpec as b4, type ManifestReverseSpec as b5, type ManifestApprovalRequiredSpec as b6, type ManifestRelationshipDef as b7, type ManifestEffectSchema as b8, type ManifestEffectDeclaration as b9, type ManifestEventTypeDef as ba, type ManifestEventStreamDef as bb, type ManifestOperation as bc, type ManifestImport as bd, type ManifestVolume as be, type ManifestContent as bf, type GraphQLResult as bg, type APIError as bh, type DeleteResponse as bi, type StreamEvent as bj, type StreamSubscription as bk, type StreamStats as bl, type SessionHeapSnapshot as c, type SessionTranscriptEntry as d, Environment as e, EnvironmentSession as f, Session as g, type ToolSchema as h, type PublishToolsResult as i, type ToolHandler as j, type GranularOptions as k, type GranularAuth as l, type RecordUserOptions as m, type Subject as n, type OpenEnvironmentOptions as o, type CreateSessionOptions as p, type ConversationSessionInfo as q, type Sandbox as r, type CreateSandboxData as s, type SandboxListResponse as t, type PermissionRules as u, type PermissionProfile as v, type CreatePermissionProfileData as w, type PermissionProfileListResponse as x, type Assignment as y, type AssignmentListResponse as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as SessionHeapSnapshot, P as Prompt, d as SessionTranscriptEntry } from './client-
|
|
2
|
-
export {
|
|
1
|
+
import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as SessionHeapSnapshot, P as Prompt, d as SessionTranscriptEntry } from './client-DTvI5MUG.mjs';
|
|
2
|
+
export { bh as APIError, A as AccessTokenProvider, y as Assignment, z as AssignmentListResponse, X as Build, Z as BuildListResponse, B as BuildPolicy, Q as BuildStatus, C as ConnectOptions, aq as ConversationAppendResult, ap as ConversationMessageInput, ao as ConversationMessageShowRefs, q as ConversationSessionInfo, J as CreateEnvironmentData, w as CreatePermissionProfileData, s as CreateSandboxData, p as CreateSessionOptions, aM as DefineRelationshipOptions, bi as DeleteResponse, D as DomainState, ad as EffectHandler, aa as EffectInfo, a5 as EffectInvocationMetadata, a4 as EffectInvocationMode, a6 as EffectSchema, a7 as EffectWithHandler, ac as EffectsChangedEvent, e as Environment, H as EnvironmentData, al as EnvironmentFeedbackRecord, K as EnvironmentListResponse, aW as EnvironmentRecordImportSummary, f as EnvironmentSession, G as Granular, l as GranularAuth, k as GranularOptions, bg as GraphQLResult, ae as InstanceEffectHandler, I as InstanceToolHandler, an as Job, aj as JobFeedbackInput, ai as JobFeedbackMetadata, ak as JobFeedbackRecord, ag as JobFeedbackSentiment, ah as JobFeedbackToolCall, af as JobStatus, am as JobSubmitResult, L as Manifest, b6 as ManifestApprovalRequiredSpec, bf as ManifestContent, b4 as ManifestDryRunSpec, b9 as ManifestEffectDeclaration, b8 as ManifestEffectSchema, aZ as ManifestEnumRuleSpec, bb as ManifestEventStreamDef, ba as ManifestEventTypeDef, a_ as ManifestFilterBySpec, bd as ManifestImport, N as ManifestListResponse, bc as ManifestOperation, b3 as ManifestPostConditionSpec, aX as ManifestPropertySpec, b7 as ManifestRelationshipDef, b5 as ManifestReverseSpec, b2 as ManifestStateMachineSpec, b0 as ManifestStateMachineStateSpec, b1 as ManifestStateMachineTransitionSpec, aY as ManifestValidationOperator, a$ as ManifestValidationRuleSpec, be as ManifestVolume, aK as ModelRef, O as OntologyHandle, o as OpenEnvironmentOptions, v as PermissionProfile, x as PermissionProfileListResponse, u as PermissionRules, a8 as PublishEffectsResult, i as PublishToolsResult, aE as RPCRequest, aH as RPCRequestFromServer, aF as RPCResponse, aV as RecordImport, aU as RecordImportItem, aS as RecordImportItemStatus, aT as RecordImportStats, aR as RecordImportStatus, aN as RecordObjectOptions, aO as RecordObjectResult, aP as RecordObjectsChunkInfo, aQ as RecordObjectsOptions, m as RecordUserOptions, aL as RelationshipInfo, a3 as ResolvedEffectApprovalRequired, a1 as ResolvedEffectDryRun, a0 as ResolvedEffectPostCondition, a2 as ResolvedEffectReverse, r as Sandbox, t as SandboxListResponse, $ as SemanticVersionDiff, _ as SemanticVersionDiffEntry, g as Session, ay as SessionCollectionListOptions, aA as SessionCollectionListResult, ar as SessionConversationMessage, ax as SessionDocumentResult, au as SessionHeapFieldType, av as SessionHeapFieldValue, aw as SessionHeapVariable, az as SessionJobListOptions, at as SessionJobRecord, as as SessionTimelineEvent, bj as StreamEvent, bl as StreamStats, bk as StreamSubscription, n as Subject, aG as SyncMessage, j as ToolHandler, a9 as ToolInfo, aI as ToolInvokeParams, aJ as ToolResultParams, h as ToolSchema, ab as ToolsChangedEvent, U as User, Y as Version, F as VersionTag, V as VersionTracking, W as WSClient, aD as WSClientOptions, aB as WSDisconnectInfo, aC as WSReconnectErrorInfo } from './client-DTvI5MUG.mjs';
|
|
3
3
|
export { BuildGranularAgentSystemPromptInput, GeneratedJobCodeIssue, GranularAgentExecutionCheckpoint, GranularAgentHeapSummaryOptions, GranularAgentReferentFocus, GranularAgentSessionContext, GranularAgentToolInfo, GranularAgentWorkflowFocus, HarnessContinuationDecision, HarnessControllerBudgets, HarnessProjectionOptions, HarnessPromptLike, HarnessVerifierSnapshot, HarnessVerifierSnapshotInput, buildContinuationInstruction, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentReferentBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getExclusivePromptTarget, hasOpenPrompt, projectConversationReferentFocus, projectConversationReferentSummary, projectHeapSummary, projectLoopSummary, projectWorkflowFocus, projectWorkflowSummary, reviewGeneratedJobCode } from './agent-harness.mjs';
|
|
4
4
|
import '@automerge/automerge';
|
|
5
5
|
import '@automerge/automerge/slim';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as SessionHeapSnapshot, P as Prompt, d as SessionTranscriptEntry } from './client-
|
|
2
|
-
export {
|
|
1
|
+
import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as SessionHeapSnapshot, P as Prompt, d as SessionTranscriptEntry } from './client-DTvI5MUG.js';
|
|
2
|
+
export { bh as APIError, A as AccessTokenProvider, y as Assignment, z as AssignmentListResponse, X as Build, Z as BuildListResponse, B as BuildPolicy, Q as BuildStatus, C as ConnectOptions, aq as ConversationAppendResult, ap as ConversationMessageInput, ao as ConversationMessageShowRefs, q as ConversationSessionInfo, J as CreateEnvironmentData, w as CreatePermissionProfileData, s as CreateSandboxData, p as CreateSessionOptions, aM as DefineRelationshipOptions, bi as DeleteResponse, D as DomainState, ad as EffectHandler, aa as EffectInfo, a5 as EffectInvocationMetadata, a4 as EffectInvocationMode, a6 as EffectSchema, a7 as EffectWithHandler, ac as EffectsChangedEvent, e as Environment, H as EnvironmentData, al as EnvironmentFeedbackRecord, K as EnvironmentListResponse, aW as EnvironmentRecordImportSummary, f as EnvironmentSession, G as Granular, l as GranularAuth, k as GranularOptions, bg as GraphQLResult, ae as InstanceEffectHandler, I as InstanceToolHandler, an as Job, aj as JobFeedbackInput, ai as JobFeedbackMetadata, ak as JobFeedbackRecord, ag as JobFeedbackSentiment, ah as JobFeedbackToolCall, af as JobStatus, am as JobSubmitResult, L as Manifest, b6 as ManifestApprovalRequiredSpec, bf as ManifestContent, b4 as ManifestDryRunSpec, b9 as ManifestEffectDeclaration, b8 as ManifestEffectSchema, aZ as ManifestEnumRuleSpec, bb as ManifestEventStreamDef, ba as ManifestEventTypeDef, a_ as ManifestFilterBySpec, bd as ManifestImport, N as ManifestListResponse, bc as ManifestOperation, b3 as ManifestPostConditionSpec, aX as ManifestPropertySpec, b7 as ManifestRelationshipDef, b5 as ManifestReverseSpec, b2 as ManifestStateMachineSpec, b0 as ManifestStateMachineStateSpec, b1 as ManifestStateMachineTransitionSpec, aY as ManifestValidationOperator, a$ as ManifestValidationRuleSpec, be as ManifestVolume, aK as ModelRef, O as OntologyHandle, o as OpenEnvironmentOptions, v as PermissionProfile, x as PermissionProfileListResponse, u as PermissionRules, a8 as PublishEffectsResult, i as PublishToolsResult, aE as RPCRequest, aH as RPCRequestFromServer, aF as RPCResponse, aV as RecordImport, aU as RecordImportItem, aS as RecordImportItemStatus, aT as RecordImportStats, aR as RecordImportStatus, aN as RecordObjectOptions, aO as RecordObjectResult, aP as RecordObjectsChunkInfo, aQ as RecordObjectsOptions, m as RecordUserOptions, aL as RelationshipInfo, a3 as ResolvedEffectApprovalRequired, a1 as ResolvedEffectDryRun, a0 as ResolvedEffectPostCondition, a2 as ResolvedEffectReverse, r as Sandbox, t as SandboxListResponse, $ as SemanticVersionDiff, _ as SemanticVersionDiffEntry, g as Session, ay as SessionCollectionListOptions, aA as SessionCollectionListResult, ar as SessionConversationMessage, ax as SessionDocumentResult, au as SessionHeapFieldType, av as SessionHeapFieldValue, aw as SessionHeapVariable, az as SessionJobListOptions, at as SessionJobRecord, as as SessionTimelineEvent, bj as StreamEvent, bl as StreamStats, bk as StreamSubscription, n as Subject, aG as SyncMessage, j as ToolHandler, a9 as ToolInfo, aI as ToolInvokeParams, aJ as ToolResultParams, h as ToolSchema, ab as ToolsChangedEvent, U as User, Y as Version, F as VersionTag, V as VersionTracking, W as WSClient, aD as WSClientOptions, aB as WSDisconnectInfo, aC as WSReconnectErrorInfo } from './client-DTvI5MUG.js';
|
|
3
3
|
export { BuildGranularAgentSystemPromptInput, GeneratedJobCodeIssue, GranularAgentExecutionCheckpoint, GranularAgentHeapSummaryOptions, GranularAgentReferentFocus, GranularAgentSessionContext, GranularAgentToolInfo, GranularAgentWorkflowFocus, HarnessContinuationDecision, HarnessControllerBudgets, HarnessProjectionOptions, HarnessPromptLike, HarnessVerifierSnapshot, HarnessVerifierSnapshotInput, buildContinuationInstruction, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentReferentBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getExclusivePromptTarget, hasOpenPrompt, projectConversationReferentFocus, projectConversationReferentSummary, projectHeapSummary, projectLoopSummary, projectWorkflowFocus, projectWorkflowSummary, reviewGeneratedJobCode } from './agent-harness.js';
|
|
4
4
|
import '@automerge/automerge';
|
|
5
5
|
import '@automerge/automerge/slim';
|