@granular-software/sdk 0.4.25 → 0.4.27
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/agent-evals.d.mts +1 -1
- package/dist/agent-evals.d.ts +1 -1
- package/dist/agent-evals.js +226 -20
- package/dist/agent-evals.js.map +1 -1
- package/dist/agent-evals.mjs +226 -20
- package/dist/agent-evals.mjs.map +1 -1
- package/dist/cli/index.js +240 -20
- package/dist/{client-BeKRGMoT.d.mts → client-CigjaeO8.d.mts} +70 -29
- package/dist/{client-BeKRGMoT.d.ts → client-CigjaeO8.d.ts} +70 -29
- package/dist/index.d.mts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +527 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +527 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import { Doc } from '@automerge/automerge/slim';
|
|
|
9
9
|
* Configuration for the Granular client
|
|
10
10
|
*/
|
|
11
11
|
type AccessTokenProvider = () => Promise<string | null | undefined> | string | null | undefined;
|
|
12
|
-
type EndpointMode =
|
|
12
|
+
type EndpointMode = "auto" | "local" | "production";
|
|
13
13
|
interface GranularOptions {
|
|
14
14
|
/** Your Granular API key (for service/CLI auth; use with GRANULAR_API_KEY) */
|
|
15
15
|
apiKey?: string;
|
|
@@ -131,7 +131,7 @@ interface ConversationSessionInfo {
|
|
|
131
131
|
environmentId: string;
|
|
132
132
|
versionId?: string | null;
|
|
133
133
|
docId: string;
|
|
134
|
-
status:
|
|
134
|
+
status: "active" | "closed" | "expired";
|
|
135
135
|
createdAt: string;
|
|
136
136
|
lastSeenAt: string;
|
|
137
137
|
summary?: string | null;
|
|
@@ -239,7 +239,7 @@ interface AssignmentListResponse {
|
|
|
239
239
|
* pin themselves to one immutable ontology version.
|
|
240
240
|
*/
|
|
241
241
|
interface BuildPolicy {
|
|
242
|
-
mode:
|
|
242
|
+
mode: "tag" | "current" | "pinned";
|
|
243
243
|
buildId?: string;
|
|
244
244
|
versionId?: string;
|
|
245
245
|
tagId?: string;
|
|
@@ -250,7 +250,7 @@ interface VersionTag {
|
|
|
250
250
|
tagId: string;
|
|
251
251
|
sandboxId: string;
|
|
252
252
|
name: string;
|
|
253
|
-
kind:
|
|
253
|
+
kind: "channel" | "release" | "system";
|
|
254
254
|
targetBuildId?: string | null;
|
|
255
255
|
targetVersionId?: string | null;
|
|
256
256
|
description?: string | null;
|
|
@@ -275,7 +275,7 @@ interface EnvironmentData {
|
|
|
275
275
|
tag?: VersionTag | null;
|
|
276
276
|
tracking?: BuildPolicy;
|
|
277
277
|
buildPolicy: BuildPolicy;
|
|
278
|
-
updateState?:
|
|
278
|
+
updateState?: "up_to_date" | "update_available" | "upgrading" | "failed";
|
|
279
279
|
createdAt: number;
|
|
280
280
|
updatedAt: number;
|
|
281
281
|
}
|
|
@@ -324,7 +324,7 @@ interface Manifest {
|
|
|
324
324
|
interface ManifestListResponse {
|
|
325
325
|
items: Manifest[];
|
|
326
326
|
}
|
|
327
|
-
type BuildStatus =
|
|
327
|
+
type BuildStatus = "queued" | "building" | "completed" | "failed" | "canceled";
|
|
328
328
|
/**
|
|
329
329
|
* An immutable ontology version derived from a specific manifest revision.
|
|
330
330
|
*
|
|
@@ -359,8 +359,8 @@ interface BuildListResponse {
|
|
|
359
359
|
}
|
|
360
360
|
interface SemanticVersionDiffEntry {
|
|
361
361
|
operationId: string;
|
|
362
|
-
kind:
|
|
363
|
-
changeType:
|
|
362
|
+
kind: "create" | "update" | "relationship" | "effect" | "eventStream" | "unknown";
|
|
363
|
+
changeType: "added" | "removed" | "changed";
|
|
364
364
|
label: string;
|
|
365
365
|
additive: boolean;
|
|
366
366
|
breaking: boolean;
|
|
@@ -422,7 +422,7 @@ interface ResolvedEffectBehaviors {
|
|
|
422
422
|
reverse?: ResolvedEffectReverse;
|
|
423
423
|
approvalRequired?: ResolvedEffectApprovalRequired;
|
|
424
424
|
}
|
|
425
|
-
type EffectInvocationMode =
|
|
425
|
+
type EffectInvocationMode = "execute" | "dryRun" | "reverse";
|
|
426
426
|
interface EffectInvocationMetadata {
|
|
427
427
|
mode?: EffectInvocationMode;
|
|
428
428
|
reverseHandler?: string;
|
|
@@ -479,9 +479,9 @@ interface ToolSchema {
|
|
|
479
479
|
* ```
|
|
480
480
|
*/
|
|
481
481
|
outputSchema?: Record<string, unknown>;
|
|
482
|
-
stability?:
|
|
482
|
+
stability?: "stable" | "experimental" | "deprecated";
|
|
483
483
|
provenance?: {
|
|
484
|
-
source:
|
|
484
|
+
source: "mcp" | "custom";
|
|
485
485
|
};
|
|
486
486
|
tags?: string[];
|
|
487
487
|
/**
|
|
@@ -588,8 +588,8 @@ interface EffectsChangedEvent extends ToolsChangedEvent {
|
|
|
588
588
|
}
|
|
589
589
|
type EffectHandler = ToolHandler;
|
|
590
590
|
type InstanceEffectHandler = InstanceToolHandler;
|
|
591
|
-
type JobStatus =
|
|
592
|
-
type JobFeedbackSentiment =
|
|
591
|
+
type JobStatus = "queued" | "running" | "awaitingTool" | "awaitingHuman" | "succeeded" | "failed" | "timeout" | "canceled";
|
|
592
|
+
type JobFeedbackSentiment = "good" | "bad";
|
|
593
593
|
interface JobFeedbackToolCall {
|
|
594
594
|
callId?: string;
|
|
595
595
|
toolName?: string;
|
|
@@ -601,7 +601,7 @@ interface JobFeedbackToolCall {
|
|
|
601
601
|
durationMs?: number | null;
|
|
602
602
|
}
|
|
603
603
|
interface JobFeedbackMetadata {
|
|
604
|
-
source:
|
|
604
|
+
source: "sdk";
|
|
605
605
|
status: JobStatus;
|
|
606
606
|
code: string;
|
|
607
607
|
domainRevision?: string;
|
|
@@ -657,7 +657,7 @@ interface Job {
|
|
|
657
657
|
}
|
|
658
658
|
interface Prompt {
|
|
659
659
|
id: string;
|
|
660
|
-
type:
|
|
660
|
+
type: "confirm" | "choice" | "input";
|
|
661
661
|
title: string;
|
|
662
662
|
message: string;
|
|
663
663
|
options?: Array<string | {
|
|
@@ -670,7 +670,42 @@ interface Prompt {
|
|
|
670
670
|
allowEmpty?: boolean;
|
|
671
671
|
metadata?: Record<string, unknown>;
|
|
672
672
|
}
|
|
673
|
-
|
|
673
|
+
interface ConversationMessageShowRefs {
|
|
674
|
+
entryPaths?: string[];
|
|
675
|
+
listNames?: string[];
|
|
676
|
+
variableNames?: string[];
|
|
677
|
+
}
|
|
678
|
+
interface ConversationMessageInput {
|
|
679
|
+
role: "user" | "assistant";
|
|
680
|
+
content?: string;
|
|
681
|
+
show?: ConversationMessageShowRefs;
|
|
682
|
+
jobId?: string;
|
|
683
|
+
promptId?: string;
|
|
684
|
+
timestamp?: number;
|
|
685
|
+
}
|
|
686
|
+
interface ConversationAppendResult {
|
|
687
|
+
ok: boolean;
|
|
688
|
+
messageId: string;
|
|
689
|
+
timestamp: number;
|
|
690
|
+
jobId?: string;
|
|
691
|
+
promptId?: string;
|
|
692
|
+
}
|
|
693
|
+
interface SessionTranscriptEntry {
|
|
694
|
+
id: string;
|
|
695
|
+
role: "user" | "assistant";
|
|
696
|
+
content: string;
|
|
697
|
+
timestamp: number;
|
|
698
|
+
jobId?: string;
|
|
699
|
+
promptId?: string;
|
|
700
|
+
code?: string;
|
|
701
|
+
jobStatus?: string;
|
|
702
|
+
jobResultPreview?: string;
|
|
703
|
+
error?: string;
|
|
704
|
+
show?: ConversationMessageShowRefs;
|
|
705
|
+
historyContent?: string;
|
|
706
|
+
source: "conversation" | "job_code" | "job_result" | "job_prompt" | "job_agent_message";
|
|
707
|
+
}
|
|
708
|
+
type SessionHeapFieldType = "string" | "number" | "boolean" | "null" | "unknown";
|
|
674
709
|
interface SessionHeapFieldValue {
|
|
675
710
|
name: string;
|
|
676
711
|
type: SessionHeapFieldType;
|
|
@@ -698,7 +733,7 @@ interface SessionHeapList {
|
|
|
698
733
|
}
|
|
699
734
|
interface SessionHeapVariable {
|
|
700
735
|
name: string;
|
|
701
|
-
kind:
|
|
736
|
+
kind: "entry" | "list" | "scalar";
|
|
702
737
|
entryPath?: string;
|
|
703
738
|
listName?: string;
|
|
704
739
|
value?: string | number | boolean | null;
|
|
@@ -735,13 +770,13 @@ interface WSClientOptions {
|
|
|
735
770
|
onReconnectError?: (info: WSReconnectErrorInfo) => void;
|
|
736
771
|
}
|
|
737
772
|
interface RPCRequest {
|
|
738
|
-
type:
|
|
773
|
+
type: "rpc";
|
|
739
774
|
method: string;
|
|
740
775
|
params: unknown;
|
|
741
776
|
id: string;
|
|
742
777
|
}
|
|
743
778
|
interface RPCResponse {
|
|
744
|
-
type:
|
|
779
|
+
type: "rpc_result" | "rpc_error";
|
|
745
780
|
id: string;
|
|
746
781
|
result?: unknown;
|
|
747
782
|
error?: {
|
|
@@ -751,12 +786,12 @@ interface RPCResponse {
|
|
|
751
786
|
};
|
|
752
787
|
}
|
|
753
788
|
interface SyncMessage {
|
|
754
|
-
type:
|
|
789
|
+
type: "sync";
|
|
755
790
|
message?: string | number[] | Uint8Array;
|
|
756
791
|
data?: number[];
|
|
757
792
|
}
|
|
758
793
|
interface RPCRequestFromServer {
|
|
759
|
-
type:
|
|
794
|
+
type: "rpc";
|
|
760
795
|
method: string;
|
|
761
796
|
params: unknown;
|
|
762
797
|
id: string;
|
|
@@ -800,7 +835,7 @@ interface RelationshipInfo {
|
|
|
800
835
|
/** The foreign model type */
|
|
801
836
|
foreign_model: ModelRef;
|
|
802
837
|
/** Computed relationship kind: "one_to_one" | "one_to_many" | "many_to_one" | "many_to_many" */
|
|
803
|
-
relationship_kind:
|
|
838
|
+
relationship_kind: "one_to_one" | "one_to_many" | "many_to_one" | "many_to_many";
|
|
804
839
|
}
|
|
805
840
|
/**
|
|
806
841
|
* Options for defining a relationship between two model types
|
|
@@ -899,8 +934,8 @@ interface RecordObjectsOptions {
|
|
|
899
934
|
*/
|
|
900
935
|
onChunkComplete?: (info: RecordObjectsChunkInfo) => void | Promise<void>;
|
|
901
936
|
}
|
|
902
|
-
type RecordImportStatus =
|
|
903
|
-
type RecordImportItemStatus =
|
|
937
|
+
type RecordImportStatus = "queued" | "processing" | "completed" | "failed" | "canceled";
|
|
938
|
+
type RecordImportItemStatus = "queued" | "processing" | "completed" | "failed" | "canceled";
|
|
904
939
|
interface RecordImportStats {
|
|
905
940
|
totalRecords: number;
|
|
906
941
|
queuedRecords: number;
|
|
@@ -965,10 +1000,14 @@ interface ManifestPropertySpec {
|
|
|
965
1000
|
required?: boolean;
|
|
966
1001
|
note?: string | string[];
|
|
967
1002
|
enum?: string[] | ManifestEnumRuleSpec;
|
|
1003
|
+
searchable?: boolean | {
|
|
1004
|
+
enabled?: boolean;
|
|
1005
|
+
phonetic?: boolean;
|
|
1006
|
+
};
|
|
968
1007
|
filterBy?: boolean | string[] | ManifestFilterBySpec;
|
|
969
1008
|
validate?: ManifestValidationRuleSpec[];
|
|
970
1009
|
}
|
|
971
|
-
type ManifestValidationOperator =
|
|
1010
|
+
type ManifestValidationOperator = "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "true" | "false" | "regex" | "contains" | "not_contains" | "starts_with" | "ends_with";
|
|
972
1011
|
interface ManifestEnumRuleSpec {
|
|
973
1012
|
values: string[];
|
|
974
1013
|
message?: string;
|
|
@@ -1057,7 +1096,7 @@ interface ManifestEffectDeclaration {
|
|
|
1057
1096
|
isStatic?: boolean;
|
|
1058
1097
|
inputSchema: ManifestEffectSchema;
|
|
1059
1098
|
outputSchema?: ManifestEffectSchema;
|
|
1060
|
-
stability?:
|
|
1099
|
+
stability?: "stable" | "experimental" | "deprecated";
|
|
1061
1100
|
tags?: string[];
|
|
1062
1101
|
metamodels?: ManifestEffectMetamodelSpec;
|
|
1063
1102
|
}
|
|
@@ -1118,7 +1157,7 @@ interface ManifestImport {
|
|
|
1118
1157
|
}
|
|
1119
1158
|
interface ManifestVolume {
|
|
1120
1159
|
name: string;
|
|
1121
|
-
scope:
|
|
1160
|
+
scope: "sandbox" | "build" | "user";
|
|
1122
1161
|
imports?: ManifestImport[];
|
|
1123
1162
|
operations: ManifestOperation[];
|
|
1124
1163
|
}
|
|
@@ -1161,7 +1200,7 @@ interface StreamEvent {
|
|
|
1161
1200
|
environmentId: string;
|
|
1162
1201
|
sessionId?: string;
|
|
1163
1202
|
subjectId?: string;
|
|
1164
|
-
source:
|
|
1203
|
+
source: "sandbox" | "api";
|
|
1165
1204
|
isAcked: boolean;
|
|
1166
1205
|
createdAt: number;
|
|
1167
1206
|
}
|
|
@@ -1269,6 +1308,7 @@ declare class Session {
|
|
|
1269
1308
|
constructor(client: WSClient, clientId?: string);
|
|
1270
1309
|
private extractDomainRevisionFromDoc;
|
|
1271
1310
|
private buildLegacyEffectContext;
|
|
1311
|
+
private stringifyConversationValue;
|
|
1272
1312
|
get document(): Doc<Record<string, unknown>>;
|
|
1273
1313
|
get sessionId(): string;
|
|
1274
1314
|
get domainRevision(): string | null;
|
|
@@ -1340,6 +1380,7 @@ declare class Session {
|
|
|
1340
1380
|
* Respond to a prompt request from the sandbox
|
|
1341
1381
|
*/
|
|
1342
1382
|
answerPrompt(promptId: string, answer: unknown): Promise<void>;
|
|
1383
|
+
appendConversationMessage(input: ConversationMessageInput): Promise<ConversationAppendResult>;
|
|
1343
1384
|
/**
|
|
1344
1385
|
* Get the current list of available effects.
|
|
1345
1386
|
* Consolidates effect declarations and live availability for the session.
|
|
@@ -2054,4 +2095,4 @@ declare class Granular {
|
|
|
2054
2095
|
private request;
|
|
2055
2096
|
}
|
|
2056
2097
|
|
|
2057
|
-
export { type
|
|
2098
|
+
export { type ResolvedEffectApprovalRequired as $, type AccessTokenProvider as A, type BuildPolicy as B, type ConnectOptions as C, type DomainState as D, type EndpointMode as E, type EnvironmentListResponse as F, Granular as G, type Manifest as H, type InstanceToolHandler as I, type ManifestListResponse as J, type BuildStatus as K, type Build as L, type ManifestEffectMetamodelSpec as M, type Version as N, type BuildListResponse as O, type Prompt as P, type SemanticVersionDiffEntry 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 SemanticVersionDiff as X, type ResolvedEffectPostCondition as Y, type ResolvedEffectDryRun as Z, type ResolvedEffectReverse as _, type EffectHandlerContext as a, type ManifestEventStreamDef as a$, type EffectInvocationMode as a0, type EffectInvocationMetadata as a1, type EffectSchema as a2, type EffectWithHandler as a3, type PublishEffectsResult as a4, type ToolInfo as a5, type EffectInfo as a6, type ToolsChangedEvent as a7, type EffectsChangedEvent as a8, type EffectHandler as a9, type DefineRelationshipOptions as aA, type RecordObjectOptions as aB, type RecordObjectResult as aC, type RecordObjectsChunkInfo as aD, type RecordObjectsOptions as aE, type RecordImportStatus as aF, type RecordImportItemStatus as aG, type RecordImportStats as aH, type RecordImportItem as aI, type RecordImport as aJ, type EnvironmentRecordImportSummary as aK, type ManifestPropertySpec as aL, type ManifestValidationOperator as aM, type ManifestEnumRuleSpec as aN, type ManifestFilterBySpec as aO, type ManifestValidationRuleSpec as aP, type ManifestStateMachineStateSpec as aQ, type ManifestStateMachineTransitionSpec as aR, type ManifestStateMachineSpec as aS, type ManifestPostConditionSpec as aT, type ManifestDryRunSpec as aU, type ManifestReverseSpec as aV, type ManifestApprovalRequiredSpec as aW, type ManifestRelationshipDef as aX, type ManifestEffectSchema as aY, type ManifestEffectDeclaration as aZ, type ManifestEventTypeDef as a_, type InstanceEffectHandler as aa, type JobStatus as ab, type JobFeedbackSentiment as ac, type JobFeedbackToolCall as ad, type JobFeedbackMetadata as ae, type JobFeedbackInput as af, type JobFeedbackRecord as ag, type JobSubmitResult as ah, type Job as ai, type ConversationMessageShowRefs as aj, type ConversationMessageInput as ak, type ConversationAppendResult as al, type SessionHeapFieldType as am, type SessionHeapFieldValue as an, type SessionHeapVariable as ao, type WSDisconnectInfo as ap, type WSReconnectErrorInfo as aq, type WSClientOptions as ar, type RPCRequest as as, type RPCResponse as at, type SyncMessage as au, type RPCRequestFromServer as av, type ToolInvokeParams as aw, type ToolResultParams as ax, type ModelRef as ay, type RelationshipInfo as az, type SessionHeapList as b, type ManifestOperation as b0, type ManifestImport as b1, type ManifestVolume as b2, type ManifestContent as b3, type GraphQLResult as b4, type APIError as b5, type DeleteResponse as b6, type StreamEvent as b7, type StreamSubscription as b8, type StreamStats as b9, type SessionHeapSnapshot as c, type SessionTranscriptEntry as d, Environment as e, Session as f, type ToolSchema as g, type PublishToolsResult as h, type ToolHandler as i, type GranularOptions as j, type GranularAuth as k, type RecordUserOptions as l, type Subject as m, type ConversationSessionInfo as n, type Sandbox as o, type CreateSandboxData as p, type SandboxListResponse as q, type PermissionRules as r, type PermissionProfile as s, type CreatePermissionProfileData as t, type PermissionProfileListResponse as u, type Assignment as v, type AssignmentListResponse as w, type VersionTag as x, type EnvironmentData as y, type CreateEnvironmentData as z };
|
|
@@ -9,7 +9,7 @@ import { Doc } from '@automerge/automerge/slim';
|
|
|
9
9
|
* Configuration for the Granular client
|
|
10
10
|
*/
|
|
11
11
|
type AccessTokenProvider = () => Promise<string | null | undefined> | string | null | undefined;
|
|
12
|
-
type EndpointMode =
|
|
12
|
+
type EndpointMode = "auto" | "local" | "production";
|
|
13
13
|
interface GranularOptions {
|
|
14
14
|
/** Your Granular API key (for service/CLI auth; use with GRANULAR_API_KEY) */
|
|
15
15
|
apiKey?: string;
|
|
@@ -131,7 +131,7 @@ interface ConversationSessionInfo {
|
|
|
131
131
|
environmentId: string;
|
|
132
132
|
versionId?: string | null;
|
|
133
133
|
docId: string;
|
|
134
|
-
status:
|
|
134
|
+
status: "active" | "closed" | "expired";
|
|
135
135
|
createdAt: string;
|
|
136
136
|
lastSeenAt: string;
|
|
137
137
|
summary?: string | null;
|
|
@@ -239,7 +239,7 @@ interface AssignmentListResponse {
|
|
|
239
239
|
* pin themselves to one immutable ontology version.
|
|
240
240
|
*/
|
|
241
241
|
interface BuildPolicy {
|
|
242
|
-
mode:
|
|
242
|
+
mode: "tag" | "current" | "pinned";
|
|
243
243
|
buildId?: string;
|
|
244
244
|
versionId?: string;
|
|
245
245
|
tagId?: string;
|
|
@@ -250,7 +250,7 @@ interface VersionTag {
|
|
|
250
250
|
tagId: string;
|
|
251
251
|
sandboxId: string;
|
|
252
252
|
name: string;
|
|
253
|
-
kind:
|
|
253
|
+
kind: "channel" | "release" | "system";
|
|
254
254
|
targetBuildId?: string | null;
|
|
255
255
|
targetVersionId?: string | null;
|
|
256
256
|
description?: string | null;
|
|
@@ -275,7 +275,7 @@ interface EnvironmentData {
|
|
|
275
275
|
tag?: VersionTag | null;
|
|
276
276
|
tracking?: BuildPolicy;
|
|
277
277
|
buildPolicy: BuildPolicy;
|
|
278
|
-
updateState?:
|
|
278
|
+
updateState?: "up_to_date" | "update_available" | "upgrading" | "failed";
|
|
279
279
|
createdAt: number;
|
|
280
280
|
updatedAt: number;
|
|
281
281
|
}
|
|
@@ -324,7 +324,7 @@ interface Manifest {
|
|
|
324
324
|
interface ManifestListResponse {
|
|
325
325
|
items: Manifest[];
|
|
326
326
|
}
|
|
327
|
-
type BuildStatus =
|
|
327
|
+
type BuildStatus = "queued" | "building" | "completed" | "failed" | "canceled";
|
|
328
328
|
/**
|
|
329
329
|
* An immutable ontology version derived from a specific manifest revision.
|
|
330
330
|
*
|
|
@@ -359,8 +359,8 @@ interface BuildListResponse {
|
|
|
359
359
|
}
|
|
360
360
|
interface SemanticVersionDiffEntry {
|
|
361
361
|
operationId: string;
|
|
362
|
-
kind:
|
|
363
|
-
changeType:
|
|
362
|
+
kind: "create" | "update" | "relationship" | "effect" | "eventStream" | "unknown";
|
|
363
|
+
changeType: "added" | "removed" | "changed";
|
|
364
364
|
label: string;
|
|
365
365
|
additive: boolean;
|
|
366
366
|
breaking: boolean;
|
|
@@ -422,7 +422,7 @@ interface ResolvedEffectBehaviors {
|
|
|
422
422
|
reverse?: ResolvedEffectReverse;
|
|
423
423
|
approvalRequired?: ResolvedEffectApprovalRequired;
|
|
424
424
|
}
|
|
425
|
-
type EffectInvocationMode =
|
|
425
|
+
type EffectInvocationMode = "execute" | "dryRun" | "reverse";
|
|
426
426
|
interface EffectInvocationMetadata {
|
|
427
427
|
mode?: EffectInvocationMode;
|
|
428
428
|
reverseHandler?: string;
|
|
@@ -479,9 +479,9 @@ interface ToolSchema {
|
|
|
479
479
|
* ```
|
|
480
480
|
*/
|
|
481
481
|
outputSchema?: Record<string, unknown>;
|
|
482
|
-
stability?:
|
|
482
|
+
stability?: "stable" | "experimental" | "deprecated";
|
|
483
483
|
provenance?: {
|
|
484
|
-
source:
|
|
484
|
+
source: "mcp" | "custom";
|
|
485
485
|
};
|
|
486
486
|
tags?: string[];
|
|
487
487
|
/**
|
|
@@ -588,8 +588,8 @@ interface EffectsChangedEvent extends ToolsChangedEvent {
|
|
|
588
588
|
}
|
|
589
589
|
type EffectHandler = ToolHandler;
|
|
590
590
|
type InstanceEffectHandler = InstanceToolHandler;
|
|
591
|
-
type JobStatus =
|
|
592
|
-
type JobFeedbackSentiment =
|
|
591
|
+
type JobStatus = "queued" | "running" | "awaitingTool" | "awaitingHuman" | "succeeded" | "failed" | "timeout" | "canceled";
|
|
592
|
+
type JobFeedbackSentiment = "good" | "bad";
|
|
593
593
|
interface JobFeedbackToolCall {
|
|
594
594
|
callId?: string;
|
|
595
595
|
toolName?: string;
|
|
@@ -601,7 +601,7 @@ interface JobFeedbackToolCall {
|
|
|
601
601
|
durationMs?: number | null;
|
|
602
602
|
}
|
|
603
603
|
interface JobFeedbackMetadata {
|
|
604
|
-
source:
|
|
604
|
+
source: "sdk";
|
|
605
605
|
status: JobStatus;
|
|
606
606
|
code: string;
|
|
607
607
|
domainRevision?: string;
|
|
@@ -657,7 +657,7 @@ interface Job {
|
|
|
657
657
|
}
|
|
658
658
|
interface Prompt {
|
|
659
659
|
id: string;
|
|
660
|
-
type:
|
|
660
|
+
type: "confirm" | "choice" | "input";
|
|
661
661
|
title: string;
|
|
662
662
|
message: string;
|
|
663
663
|
options?: Array<string | {
|
|
@@ -670,7 +670,42 @@ interface Prompt {
|
|
|
670
670
|
allowEmpty?: boolean;
|
|
671
671
|
metadata?: Record<string, unknown>;
|
|
672
672
|
}
|
|
673
|
-
|
|
673
|
+
interface ConversationMessageShowRefs {
|
|
674
|
+
entryPaths?: string[];
|
|
675
|
+
listNames?: string[];
|
|
676
|
+
variableNames?: string[];
|
|
677
|
+
}
|
|
678
|
+
interface ConversationMessageInput {
|
|
679
|
+
role: "user" | "assistant";
|
|
680
|
+
content?: string;
|
|
681
|
+
show?: ConversationMessageShowRefs;
|
|
682
|
+
jobId?: string;
|
|
683
|
+
promptId?: string;
|
|
684
|
+
timestamp?: number;
|
|
685
|
+
}
|
|
686
|
+
interface ConversationAppendResult {
|
|
687
|
+
ok: boolean;
|
|
688
|
+
messageId: string;
|
|
689
|
+
timestamp: number;
|
|
690
|
+
jobId?: string;
|
|
691
|
+
promptId?: string;
|
|
692
|
+
}
|
|
693
|
+
interface SessionTranscriptEntry {
|
|
694
|
+
id: string;
|
|
695
|
+
role: "user" | "assistant";
|
|
696
|
+
content: string;
|
|
697
|
+
timestamp: number;
|
|
698
|
+
jobId?: string;
|
|
699
|
+
promptId?: string;
|
|
700
|
+
code?: string;
|
|
701
|
+
jobStatus?: string;
|
|
702
|
+
jobResultPreview?: string;
|
|
703
|
+
error?: string;
|
|
704
|
+
show?: ConversationMessageShowRefs;
|
|
705
|
+
historyContent?: string;
|
|
706
|
+
source: "conversation" | "job_code" | "job_result" | "job_prompt" | "job_agent_message";
|
|
707
|
+
}
|
|
708
|
+
type SessionHeapFieldType = "string" | "number" | "boolean" | "null" | "unknown";
|
|
674
709
|
interface SessionHeapFieldValue {
|
|
675
710
|
name: string;
|
|
676
711
|
type: SessionHeapFieldType;
|
|
@@ -698,7 +733,7 @@ interface SessionHeapList {
|
|
|
698
733
|
}
|
|
699
734
|
interface SessionHeapVariable {
|
|
700
735
|
name: string;
|
|
701
|
-
kind:
|
|
736
|
+
kind: "entry" | "list" | "scalar";
|
|
702
737
|
entryPath?: string;
|
|
703
738
|
listName?: string;
|
|
704
739
|
value?: string | number | boolean | null;
|
|
@@ -735,13 +770,13 @@ interface WSClientOptions {
|
|
|
735
770
|
onReconnectError?: (info: WSReconnectErrorInfo) => void;
|
|
736
771
|
}
|
|
737
772
|
interface RPCRequest {
|
|
738
|
-
type:
|
|
773
|
+
type: "rpc";
|
|
739
774
|
method: string;
|
|
740
775
|
params: unknown;
|
|
741
776
|
id: string;
|
|
742
777
|
}
|
|
743
778
|
interface RPCResponse {
|
|
744
|
-
type:
|
|
779
|
+
type: "rpc_result" | "rpc_error";
|
|
745
780
|
id: string;
|
|
746
781
|
result?: unknown;
|
|
747
782
|
error?: {
|
|
@@ -751,12 +786,12 @@ interface RPCResponse {
|
|
|
751
786
|
};
|
|
752
787
|
}
|
|
753
788
|
interface SyncMessage {
|
|
754
|
-
type:
|
|
789
|
+
type: "sync";
|
|
755
790
|
message?: string | number[] | Uint8Array;
|
|
756
791
|
data?: number[];
|
|
757
792
|
}
|
|
758
793
|
interface RPCRequestFromServer {
|
|
759
|
-
type:
|
|
794
|
+
type: "rpc";
|
|
760
795
|
method: string;
|
|
761
796
|
params: unknown;
|
|
762
797
|
id: string;
|
|
@@ -800,7 +835,7 @@ interface RelationshipInfo {
|
|
|
800
835
|
/** The foreign model type */
|
|
801
836
|
foreign_model: ModelRef;
|
|
802
837
|
/** Computed relationship kind: "one_to_one" | "one_to_many" | "many_to_one" | "many_to_many" */
|
|
803
|
-
relationship_kind:
|
|
838
|
+
relationship_kind: "one_to_one" | "one_to_many" | "many_to_one" | "many_to_many";
|
|
804
839
|
}
|
|
805
840
|
/**
|
|
806
841
|
* Options for defining a relationship between two model types
|
|
@@ -899,8 +934,8 @@ interface RecordObjectsOptions {
|
|
|
899
934
|
*/
|
|
900
935
|
onChunkComplete?: (info: RecordObjectsChunkInfo) => void | Promise<void>;
|
|
901
936
|
}
|
|
902
|
-
type RecordImportStatus =
|
|
903
|
-
type RecordImportItemStatus =
|
|
937
|
+
type RecordImportStatus = "queued" | "processing" | "completed" | "failed" | "canceled";
|
|
938
|
+
type RecordImportItemStatus = "queued" | "processing" | "completed" | "failed" | "canceled";
|
|
904
939
|
interface RecordImportStats {
|
|
905
940
|
totalRecords: number;
|
|
906
941
|
queuedRecords: number;
|
|
@@ -965,10 +1000,14 @@ interface ManifestPropertySpec {
|
|
|
965
1000
|
required?: boolean;
|
|
966
1001
|
note?: string | string[];
|
|
967
1002
|
enum?: string[] | ManifestEnumRuleSpec;
|
|
1003
|
+
searchable?: boolean | {
|
|
1004
|
+
enabled?: boolean;
|
|
1005
|
+
phonetic?: boolean;
|
|
1006
|
+
};
|
|
968
1007
|
filterBy?: boolean | string[] | ManifestFilterBySpec;
|
|
969
1008
|
validate?: ManifestValidationRuleSpec[];
|
|
970
1009
|
}
|
|
971
|
-
type ManifestValidationOperator =
|
|
1010
|
+
type ManifestValidationOperator = "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "true" | "false" | "regex" | "contains" | "not_contains" | "starts_with" | "ends_with";
|
|
972
1011
|
interface ManifestEnumRuleSpec {
|
|
973
1012
|
values: string[];
|
|
974
1013
|
message?: string;
|
|
@@ -1057,7 +1096,7 @@ interface ManifestEffectDeclaration {
|
|
|
1057
1096
|
isStatic?: boolean;
|
|
1058
1097
|
inputSchema: ManifestEffectSchema;
|
|
1059
1098
|
outputSchema?: ManifestEffectSchema;
|
|
1060
|
-
stability?:
|
|
1099
|
+
stability?: "stable" | "experimental" | "deprecated";
|
|
1061
1100
|
tags?: string[];
|
|
1062
1101
|
metamodels?: ManifestEffectMetamodelSpec;
|
|
1063
1102
|
}
|
|
@@ -1118,7 +1157,7 @@ interface ManifestImport {
|
|
|
1118
1157
|
}
|
|
1119
1158
|
interface ManifestVolume {
|
|
1120
1159
|
name: string;
|
|
1121
|
-
scope:
|
|
1160
|
+
scope: "sandbox" | "build" | "user";
|
|
1122
1161
|
imports?: ManifestImport[];
|
|
1123
1162
|
operations: ManifestOperation[];
|
|
1124
1163
|
}
|
|
@@ -1161,7 +1200,7 @@ interface StreamEvent {
|
|
|
1161
1200
|
environmentId: string;
|
|
1162
1201
|
sessionId?: string;
|
|
1163
1202
|
subjectId?: string;
|
|
1164
|
-
source:
|
|
1203
|
+
source: "sandbox" | "api";
|
|
1165
1204
|
isAcked: boolean;
|
|
1166
1205
|
createdAt: number;
|
|
1167
1206
|
}
|
|
@@ -1269,6 +1308,7 @@ declare class Session {
|
|
|
1269
1308
|
constructor(client: WSClient, clientId?: string);
|
|
1270
1309
|
private extractDomainRevisionFromDoc;
|
|
1271
1310
|
private buildLegacyEffectContext;
|
|
1311
|
+
private stringifyConversationValue;
|
|
1272
1312
|
get document(): Doc<Record<string, unknown>>;
|
|
1273
1313
|
get sessionId(): string;
|
|
1274
1314
|
get domainRevision(): string | null;
|
|
@@ -1340,6 +1380,7 @@ declare class Session {
|
|
|
1340
1380
|
* Respond to a prompt request from the sandbox
|
|
1341
1381
|
*/
|
|
1342
1382
|
answerPrompt(promptId: string, answer: unknown): Promise<void>;
|
|
1383
|
+
appendConversationMessage(input: ConversationMessageInput): Promise<ConversationAppendResult>;
|
|
1343
1384
|
/**
|
|
1344
1385
|
* Get the current list of available effects.
|
|
1345
1386
|
* Consolidates effect declarations and live availability for the session.
|
|
@@ -2054,4 +2095,4 @@ declare class Granular {
|
|
|
2054
2095
|
private request;
|
|
2055
2096
|
}
|
|
2056
2097
|
|
|
2057
|
-
export { type
|
|
2098
|
+
export { type ResolvedEffectApprovalRequired as $, type AccessTokenProvider as A, type BuildPolicy as B, type ConnectOptions as C, type DomainState as D, type EndpointMode as E, type EnvironmentListResponse as F, Granular as G, type Manifest as H, type InstanceToolHandler as I, type ManifestListResponse as J, type BuildStatus as K, type Build as L, type ManifestEffectMetamodelSpec as M, type Version as N, type BuildListResponse as O, type Prompt as P, type SemanticVersionDiffEntry 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 SemanticVersionDiff as X, type ResolvedEffectPostCondition as Y, type ResolvedEffectDryRun as Z, type ResolvedEffectReverse as _, type EffectHandlerContext as a, type ManifestEventStreamDef as a$, type EffectInvocationMode as a0, type EffectInvocationMetadata as a1, type EffectSchema as a2, type EffectWithHandler as a3, type PublishEffectsResult as a4, type ToolInfo as a5, type EffectInfo as a6, type ToolsChangedEvent as a7, type EffectsChangedEvent as a8, type EffectHandler as a9, type DefineRelationshipOptions as aA, type RecordObjectOptions as aB, type RecordObjectResult as aC, type RecordObjectsChunkInfo as aD, type RecordObjectsOptions as aE, type RecordImportStatus as aF, type RecordImportItemStatus as aG, type RecordImportStats as aH, type RecordImportItem as aI, type RecordImport as aJ, type EnvironmentRecordImportSummary as aK, type ManifestPropertySpec as aL, type ManifestValidationOperator as aM, type ManifestEnumRuleSpec as aN, type ManifestFilterBySpec as aO, type ManifestValidationRuleSpec as aP, type ManifestStateMachineStateSpec as aQ, type ManifestStateMachineTransitionSpec as aR, type ManifestStateMachineSpec as aS, type ManifestPostConditionSpec as aT, type ManifestDryRunSpec as aU, type ManifestReverseSpec as aV, type ManifestApprovalRequiredSpec as aW, type ManifestRelationshipDef as aX, type ManifestEffectSchema as aY, type ManifestEffectDeclaration as aZ, type ManifestEventTypeDef as a_, type InstanceEffectHandler as aa, type JobStatus as ab, type JobFeedbackSentiment as ac, type JobFeedbackToolCall as ad, type JobFeedbackMetadata as ae, type JobFeedbackInput as af, type JobFeedbackRecord as ag, type JobSubmitResult as ah, type Job as ai, type ConversationMessageShowRefs as aj, type ConversationMessageInput as ak, type ConversationAppendResult as al, type SessionHeapFieldType as am, type SessionHeapFieldValue as an, type SessionHeapVariable as ao, type WSDisconnectInfo as ap, type WSReconnectErrorInfo as aq, type WSClientOptions as ar, type RPCRequest as as, type RPCResponse as at, type SyncMessage as au, type RPCRequestFromServer as av, type ToolInvokeParams as aw, type ToolResultParams as ax, type ModelRef as ay, type RelationshipInfo as az, type SessionHeapList as b, type ManifestOperation as b0, type ManifestImport as b1, type ManifestVolume as b2, type ManifestContent as b3, type GraphQLResult as b4, type APIError as b5, type DeleteResponse as b6, type StreamEvent as b7, type StreamSubscription as b8, type StreamStats as b9, type SessionHeapSnapshot as c, type SessionTranscriptEntry as d, Environment as e, Session as f, type ToolSchema as g, type PublishToolsResult as h, type ToolHandler as i, type GranularOptions as j, type GranularAuth as k, type RecordUserOptions as l, type Subject as m, type ConversationSessionInfo as n, type Sandbox as o, type CreateSandboxData as p, type SandboxListResponse as q, type PermissionRules as r, type PermissionProfile as s, type CreatePermissionProfileData as t, type PermissionProfileListResponse as u, type Assignment as v, type AssignmentListResponse as w, type VersionTag as x, type EnvironmentData as y, type CreateEnvironmentData 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 } 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-CigjaeO8.mjs';
|
|
2
|
+
export { b5 as APIError, A as AccessTokenProvider, v as Assignment, w as AssignmentListResponse, L as Build, O as BuildListResponse, B as BuildPolicy, K as BuildStatus, C as ConnectOptions, al as ConversationAppendResult, ak as ConversationMessageInput, aj as ConversationMessageShowRefs, n as ConversationSessionInfo, z as CreateEnvironmentData, t as CreatePermissionProfileData, p as CreateSandboxData, aA as DefineRelationshipOptions, b6 as DeleteResponse, D as DomainState, a9 as EffectHandler, a6 as EffectInfo, a1 as EffectInvocationMetadata, a0 as EffectInvocationMode, a2 as EffectSchema, a3 as EffectWithHandler, a8 as EffectsChangedEvent, e as Environment, y as EnvironmentData, F as EnvironmentListResponse, aK as EnvironmentRecordImportSummary, G as Granular, k as GranularAuth, j as GranularOptions, b4 as GraphQLResult, aa as InstanceEffectHandler, I as InstanceToolHandler, ai as Job, af as JobFeedbackInput, ae as JobFeedbackMetadata, ag as JobFeedbackRecord, ac as JobFeedbackSentiment, ad as JobFeedbackToolCall, ab as JobStatus, ah as JobSubmitResult, H as Manifest, aW as ManifestApprovalRequiredSpec, b3 as ManifestContent, aU as ManifestDryRunSpec, aZ as ManifestEffectDeclaration, aY as ManifestEffectSchema, aN as ManifestEnumRuleSpec, a$ as ManifestEventStreamDef, a_ as ManifestEventTypeDef, aO as ManifestFilterBySpec, b1 as ManifestImport, J as ManifestListResponse, b0 as ManifestOperation, aT as ManifestPostConditionSpec, aL as ManifestPropertySpec, aX as ManifestRelationshipDef, aV as ManifestReverseSpec, aS as ManifestStateMachineSpec, aQ as ManifestStateMachineStateSpec, aR as ManifestStateMachineTransitionSpec, aM as ManifestValidationOperator, aP as ManifestValidationRuleSpec, b2 as ManifestVolume, ay as ModelRef, s as PermissionProfile, u as PermissionProfileListResponse, r as PermissionRules, a4 as PublishEffectsResult, h as PublishToolsResult, as as RPCRequest, av as RPCRequestFromServer, at as RPCResponse, aJ as RecordImport, aI as RecordImportItem, aG as RecordImportItemStatus, aH as RecordImportStats, aF as RecordImportStatus, aB as RecordObjectOptions, aC as RecordObjectResult, aD as RecordObjectsChunkInfo, aE as RecordObjectsOptions, l as RecordUserOptions, az as RelationshipInfo, $ as ResolvedEffectApprovalRequired, Z as ResolvedEffectDryRun, Y as ResolvedEffectPostCondition, _ as ResolvedEffectReverse, o as Sandbox, q as SandboxListResponse, X as SemanticVersionDiff, Q as SemanticVersionDiffEntry, f as Session, am as SessionHeapFieldType, an as SessionHeapFieldValue, ao as SessionHeapVariable, b7 as StreamEvent, b9 as StreamStats, b8 as StreamSubscription, m as Subject, au as SyncMessage, i as ToolHandler, a5 as ToolInfo, aw as ToolInvokeParams, ax as ToolResultParams, g as ToolSchema, a7 as ToolsChangedEvent, U as User, N as Version, x as VersionTag, V as VersionTracking, W as WSClient, ar as WSClientOptions, ap as WSDisconnectInfo, aq as WSReconnectErrorInfo } from './client-CigjaeO8.mjs';
|
|
3
3
|
export { BuildGranularAgentSystemPromptInput, GeneratedJobCodeIssue, GranularAgentExecutionCheckpoint, GranularAgentHeapSummaryOptions, GranularAgentSessionContext, GranularAgentToolInfo, GranularAgentWorkflowFocus, HarnessContinuationDecision, HarnessControllerBudgets, HarnessProjectionOptions, HarnessPromptLike, HarnessVerifierSnapshot, HarnessVerifierSnapshotInput, buildContinuationInstruction, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getExclusivePromptTarget, hasOpenPrompt, projectHeapSummary, projectLoopSummary, projectWorkflowFocus, projectWorkflowSummary, reviewGeneratedJobCode } from './agent-harness.mjs';
|
|
4
4
|
import '@automerge/automerge';
|
|
5
5
|
import '@automerge/automerge/slim';
|
|
@@ -58,4 +58,9 @@ declare function normalizePromptType(raw: Record<string, unknown> | null | undef
|
|
|
58
58
|
declare function normalizePrompt(rawValue: unknown): Prompt | null;
|
|
59
59
|
declare function resolvePromptAnswer(prompt: Prompt | undefined, answer: unknown): unknown;
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
declare function buildSessionTranscript(input: {
|
|
62
|
+
liveDoc?: Record<string, unknown> | null;
|
|
63
|
+
sessionHeap?: SessionHeapSnapshot;
|
|
64
|
+
}): SessionTranscriptEntry[];
|
|
65
|
+
|
|
66
|
+
export { EffectHandlerContext, EndpointMode, type JobPresentation, ManifestEffectMetamodelSpec, Prompt, ResolvedEffectBehaviors, SessionHeapEntry, SessionHeapList, SessionHeapSnapshot, SessionTranscriptEntry, ToolWithHandler, buildSessionTranscript, extractPromptTokens, invokeRegisteredEffect, isLocalApiUrl, normalizeEffectBehaviors, normalizePrompt, normalizePromptText, normalizePromptType, resolveApiUrl, resolveAuthTokenForApiUrl, resolveJobPresentation, resolvePromptAnswer, scorePromptChoiceMatch };
|