@granular-software/sdk 0.4.75 → 0.4.77
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 +58 -9
- package/dist/agent-evals.js.map +1 -1
- package/dist/agent-evals.mjs +58 -9
- package/dist/agent-evals.mjs.map +1 -1
- package/dist/cli/index.js +59 -10
- package/dist/{client-CljnHfK3.d.mts → client-BZtpnc8M.d.mts} +7 -1
- package/dist/{client-Dbam34Zn.d.ts → client-C7bj1UeD.d.ts} +7 -1
- package/dist/index.d.mts +16 -3
- package/dist/index.d.ts +16 -3
- package/dist/index.js +59 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +59 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -7793,6 +7793,34 @@ function resolveConfig(options) {
|
|
|
7793
7793
|
};
|
|
7794
7794
|
}
|
|
7795
7795
|
|
|
7796
|
+
// src/api-error.ts
|
|
7797
|
+
var GranularApiError = class extends Error {
|
|
7798
|
+
constructor(message, status, path7, details = {}) {
|
|
7799
|
+
super(message);
|
|
7800
|
+
this.status = status;
|
|
7801
|
+
this.path = path7;
|
|
7802
|
+
this.name = "GranularApiError";
|
|
7803
|
+
this.idempotencyKey = details.idempotencyKey;
|
|
7804
|
+
let body = details.body;
|
|
7805
|
+
if (typeof body === "string") {
|
|
7806
|
+
try {
|
|
7807
|
+
body = JSON.parse(body);
|
|
7808
|
+
} catch {
|
|
7809
|
+
}
|
|
7810
|
+
}
|
|
7811
|
+
this.body = body;
|
|
7812
|
+
const payload = body && typeof body === "object" ? body : void 0;
|
|
7813
|
+
const firstError = Array.isArray(payload?.errors) ? payload.errors[0] : void 0;
|
|
7814
|
+
const extensions = firstError && typeof firstError === "object" ? firstError.extensions : void 0;
|
|
7815
|
+
this.code = [payload?.code, extensions?.code, firstError?.code].find(
|
|
7816
|
+
(value) => typeof value === "string" && value.length > 0
|
|
7817
|
+
) ?? `HTTP_${status}`;
|
|
7818
|
+
}
|
|
7819
|
+
code;
|
|
7820
|
+
body;
|
|
7821
|
+
idempotencyKey;
|
|
7822
|
+
};
|
|
7823
|
+
|
|
7796
7824
|
// src/cli/api-client.ts
|
|
7797
7825
|
var DEFAULT_BUILD_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
7798
7826
|
var ApiClient = class {
|
|
@@ -17017,7 +17045,7 @@ ${effectMetamodelTable}
|
|
|
17017
17045
|
| \`granular.ontology(sandboxId).effects.unregister(name)\` / \`.clear()\` / \`.disconnect()\` | Stop effect handlers for a sandbox. |
|
|
17018
17046
|
| \`granular.sandboxes\` | \`.list()\`, \`.get\`, \`.create\`, \`.update\`, \`.delete\` |
|
|
17019
17047
|
| \`granular.permissionProfiles\` | Permission profiles per sandbox. |
|
|
17020
|
-
| \`granular.environments\` | List/create/
|
|
17048
|
+
| \`granular.environments\` | List/create/retire environments (advanced control-plane API; deletion retains durable data/history). |
|
|
17021
17049
|
| \`granular.subjects\` | Subjects / assignments (see typings). |
|
|
17022
17050
|
|
|
17023
17051
|
### \`Environment\` (sessionless environment handle)
|
|
@@ -23132,8 +23160,11 @@ import { ${tools[0]?.name || "example"} } from "@granular/actions/backend";
|
|
|
23132
23160
|
this.emit("prompt:answered", { ...prompt3, status: "answered" });
|
|
23133
23161
|
return;
|
|
23134
23162
|
}
|
|
23163
|
+
const previous = this.promptCache.get(prompt3.id);
|
|
23135
23164
|
this.promptCache.set(prompt3.id, prompt3);
|
|
23136
|
-
|
|
23165
|
+
if (!previous || promptSnapshotFingerprint(previous) !== promptSnapshotFingerprint(prompt3)) {
|
|
23166
|
+
this.emit("prompt", prompt3);
|
|
23167
|
+
}
|
|
23137
23168
|
};
|
|
23138
23169
|
this.client.on("prompt", emitPrompt);
|
|
23139
23170
|
this.client.on("prompt.request", emitPrompt);
|
|
@@ -25967,8 +25998,12 @@ var Environment = class _Environment {
|
|
|
25967
25998
|
}
|
|
25968
25999
|
});
|
|
25969
26000
|
if (!response.ok) {
|
|
25970
|
-
|
|
25971
|
-
|
|
26001
|
+
const errorText = await response.text();
|
|
26002
|
+
throw new GranularApiError(
|
|
26003
|
+
`Control Plane API Error (${response.status}): ${errorText}`,
|
|
26004
|
+
response.status,
|
|
26005
|
+
path7,
|
|
26006
|
+
{ body: errorText }
|
|
25972
26007
|
);
|
|
25973
26008
|
}
|
|
25974
26009
|
return response.json();
|
|
@@ -26025,12 +26060,12 @@ var Environment = class _Environment {
|
|
|
26025
26060
|
* );
|
|
26026
26061
|
* ```
|
|
26027
26062
|
*/
|
|
26028
|
-
async graphql(query, variables) {
|
|
26063
|
+
async graphql(query, variables, options) {
|
|
26029
26064
|
const authToken = await this.resolveAuthToken();
|
|
26030
26065
|
if (this._beforeMutationSend && isGraphQLMutationDocument(query)) {
|
|
26031
26066
|
this._beforeMutationSend?.();
|
|
26032
26067
|
}
|
|
26033
|
-
const idempotencyKey = this._graphqlIdempotencyKey?.(query, variables)
|
|
26068
|
+
const idempotencyKey = options?.idempotencyKey || this._graphqlIdempotencyKey?.(query, variables) || `gr1:${Date.now()}:${crypto.randomUUID()}`;
|
|
26034
26069
|
const response = await fetch(this._apiEndpoint, {
|
|
26035
26070
|
method: "POST",
|
|
26036
26071
|
headers: {
|
|
@@ -26041,12 +26076,18 @@ var Environment = class _Environment {
|
|
|
26041
26076
|
body: JSON.stringify({
|
|
26042
26077
|
environmentId: this.environmentId,
|
|
26043
26078
|
query,
|
|
26044
|
-
variables
|
|
26079
|
+
variables,
|
|
26080
|
+
...options?.readPreference ? { readPreference: options.readPreference } : {}
|
|
26045
26081
|
})
|
|
26046
26082
|
});
|
|
26047
26083
|
if (!response.ok) {
|
|
26048
26084
|
const errorText = await response.text();
|
|
26049
|
-
throw new
|
|
26085
|
+
throw new GranularApiError(
|
|
26086
|
+
`GraphQL API Error (${response.status}): ${errorText}`,
|
|
26087
|
+
response.status,
|
|
26088
|
+
this._apiEndpoint,
|
|
26089
|
+
{ body: errorText, idempotencyKey }
|
|
26090
|
+
);
|
|
26050
26091
|
}
|
|
26051
26092
|
return response.json();
|
|
26052
26093
|
}
|
|
@@ -28198,7 +28239,7 @@ var Granular = class _Granular {
|
|
|
28198
28239
|
const outdatedMatches = this.sortEnvironmentsByRecency(
|
|
28199
28240
|
userEnvironments.filter((environment2) => environment2.tagId === tag2.tagId)
|
|
28200
28241
|
);
|
|
28201
|
-
if (outdatedMatches.length > 0 && options.createFreshIfOutdated !== true) {
|
|
28242
|
+
if (!resetKey && outdatedMatches.length > 0 && options.createFreshIfOutdated !== true) {
|
|
28202
28243
|
requireMatchingEnvironmentProfile(outdatedMatches[0]);
|
|
28203
28244
|
const environment2 = requireMatchingEnvironmentProfile(
|
|
28204
28245
|
await activate(outdatedMatches[0])
|
|
@@ -29362,6 +29403,9 @@ var Granular = class _Granular {
|
|
|
29362
29403
|
)
|
|
29363
29404
|
);
|
|
29364
29405
|
},
|
|
29406
|
+
/** Retire a settled environment and release its named slot. Ordinary
|
|
29407
|
+
* access is revoked; durable graph data and history are retained.
|
|
29408
|
+
* Mounted or unsettled environments reject with HTTP409. */
|
|
29365
29409
|
delete: async (environmentId) => {
|
|
29366
29410
|
return this.request(
|
|
29367
29411
|
`/control/environments/${environmentId}`,
|
|
@@ -29576,7 +29620,12 @@ var Granular = class _Granular {
|
|
|
29576
29620
|
await sleep(LOCAL_CONTROL_REQUEST_RETRY_DELAY_MS * attempt);
|
|
29577
29621
|
continue;
|
|
29578
29622
|
}
|
|
29579
|
-
throw new
|
|
29623
|
+
throw new GranularApiError(
|
|
29624
|
+
`Granular API Error (${response.status}): ${errorText}`,
|
|
29625
|
+
response.status,
|
|
29626
|
+
path7,
|
|
29627
|
+
{ body: errorText }
|
|
29628
|
+
);
|
|
29580
29629
|
}
|
|
29581
29630
|
throw new Error(`Granular API Error: exhausted retries for ${url}`);
|
|
29582
29631
|
}
|
|
@@ -3716,7 +3716,10 @@ declare class Environment {
|
|
|
3716
3716
|
* );
|
|
3717
3717
|
* ```
|
|
3718
3718
|
*/
|
|
3719
|
-
graphql<T = any>(query: string, variables?: Record<string, any
|
|
3719
|
+
graphql<T = any>(query: string, variables?: Record<string, any>, options?: {
|
|
3720
|
+
idempotencyKey?: string;
|
|
3721
|
+
readPreference?: 'prefer-current-v1';
|
|
3722
|
+
}): Promise<GraphQLResult<T>>;
|
|
3720
3723
|
searchRecords(query: string, options?: RecordSearchOptions): Promise<RecordSearchResult[]>;
|
|
3721
3724
|
/**
|
|
3722
3725
|
* Define a relationship between two model types.
|
|
@@ -4484,6 +4487,9 @@ declare class Granular {
|
|
|
4484
4487
|
list: (sandboxId: string) => Promise<EnvironmentData[]>;
|
|
4485
4488
|
get: (environmentId: string) => Promise<EnvironmentData>;
|
|
4486
4489
|
create: (sandboxId: string, data: CreateEnvironmentData) => Promise<EnvironmentData>;
|
|
4490
|
+
/** Retire a settled environment and release its named slot. Ordinary
|
|
4491
|
+
* access is revoked; durable graph data and history are retained.
|
|
4492
|
+
* Mounted or unsettled environments reject with HTTP409. */
|
|
4487
4493
|
delete: (environmentId: string) => Promise<DeleteResponse>;
|
|
4488
4494
|
};
|
|
4489
4495
|
/**
|
|
@@ -3716,7 +3716,10 @@ declare class Environment {
|
|
|
3716
3716
|
* );
|
|
3717
3717
|
* ```
|
|
3718
3718
|
*/
|
|
3719
|
-
graphql<T = any>(query: string, variables?: Record<string, any
|
|
3719
|
+
graphql<T = any>(query: string, variables?: Record<string, any>, options?: {
|
|
3720
|
+
idempotencyKey?: string;
|
|
3721
|
+
readPreference?: 'prefer-current-v1';
|
|
3722
|
+
}): Promise<GraphQLResult<T>>;
|
|
3720
3723
|
searchRecords(query: string, options?: RecordSearchOptions): Promise<RecordSearchResult[]>;
|
|
3721
3724
|
/**
|
|
3722
3725
|
* Define a relationship between two model types.
|
|
@@ -4484,6 +4487,9 @@ declare class Granular {
|
|
|
4484
4487
|
list: (sandboxId: string) => Promise<EnvironmentData[]>;
|
|
4485
4488
|
get: (environmentId: string) => Promise<EnvironmentData>;
|
|
4486
4489
|
create: (sandboxId: string, data: CreateEnvironmentData) => Promise<EnvironmentData>;
|
|
4490
|
+
/** Retire a settled environment and release its named slot. Ordinary
|
|
4491
|
+
* access is revoked; durable graph data and history are retained.
|
|
4492
|
+
* Mounted or unsettled environments reject with HTTP409. */
|
|
4487
4493
|
delete: (environmentId: string) => Promise<DeleteResponse>;
|
|
4488
4494
|
};
|
|
4489
4495
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
import { E as EnvironmentData, a as EnvironmentRecordImportSummary, b as EndpointMode, c as EffectCommitRequest, C as CommitReceipt, T as ToolWithHandler, P as ProjectionResult, d as ProjectionMapper, e as CommitTransitionOutcomeDeclaration, f as CommitDeclaration, g as EffectHandlerContext, F as FeedPublishTransport, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, h as RecordObjectOptions, i as ManifestContent, j as CommitTransitionInvocation, S as SessionHeapEntry, k as SessionHeapList, l as FeedItem, m as SessionHeapSnapshot, n as Prompt, o as SessionTranscriptEntry, A as ArtifactWorkflowNode, p as ArtifactWorkflowNodeStatus, q as ArtifactWorkflow, r as SessionArtifactRecord } from './client-
|
|
2
|
-
export { aP as APIError, aQ as AccessTokenProvider, a7 as ActionSuggestionFeedItem, aZ as AdoptEnvironmentOptions, bO as AgentCommitStatus, cs as ArtifactApprovalDecisionInput, ct as ArtifactApprovalDecisionResult, cu as ArtifactApprovalTask, cv as ArtifactApprovalTaskListOptions, cw as ArtifactApprovalTaskStatus, a3 as ArtifactFeedItem, bu as ArtifactOptionsHandler, cx as ArtifactWorkflowAttention, cy as ArtifactWorkflowCompletionState, cz as ArtifactWorkflowNodeAvailability, cA as ArtifactWorkflowNodeKind, cB as ArtifactWorkflowOperationPhase, cC as ArtifactWorkflowRecap, cD as ArtifactWorkflowRecapItem, b8 as Assignment, b9 as AssignmentListResponse, c5 as AssistantReplyPublicationInput, c6 as AssistantReplyPublicationResult, bP as BaseProjectionResult, ba as Build, bb as BuildListResponse, bc as BuildPolicy, bd as BuildStatus, bQ as CanonicalProjectedRecord, bR as CommitChangeReceipt, bS as CommitSafeError, bT as CommitTransitionReceipt, aI as ConditionIR, a_ as ConnectOptions, a$ as ConversationSessionInfo, b0 as ConversationSessionListOptions, b1 as ConversationSessionListResponse, b2 as ConversationSessionListStatus, be as CreateEnvironmentData, bf as CreatePermissionProfileData, bg as CreateSandboxData, b3 as CreateSessionOptions, dv as DefineRelationshipOptions, aR as DeleteResponse, D as DomainState, bv as EffectArtifactOptionsInvocation, bw as EffectArtifactRelationshipOption, bx as EffectArtifactRelationshipOptionsResult, bU as EffectCommitContext, by as EffectHandler, bz as EffectInfo, bA as EffectInvocationMetadata, bB as EffectInvocationMode, bV as EffectProjectionResult, bC as EffectSchema, bD as EffectVersionSelector, bE as EffectWithHandler, bF as EffectsChangedEvent, s as Environment, c7 as EnvironmentFeedbackRecord, dw as EnvironmentImporter, dx as EnvironmentImporterImportOptions, bh as EnvironmentListResponse, t as EnvironmentSession, dy as EnvironmentSetupImporterClaim, dz as EnvironmentSetupLifecycleStatus, dA as EnvironmentSetupSummary, dB as EnvironmentSetupTriggerReason, dC as EnvironmentStateMachineProxy, dD as EnvironmentStateObservationInput, dE as EnvironmentStateProxy, dF as EnvironmentStateTarget, dG as EnvironmentStateUpdateInput, bW as ExternalCommitOptions, an as FeedDiagnostic, ao as FeedDiagnosticListener, av as FeedDocumentState, J as FeedFeedbackTone, a4 as FeedFileSource, H as FeedIconToken, Q as FeedItemBase, L as FeedItemKind, ae as FeedListOptions, al as FeedListTransport, X as FeedObjectReference, af as FeedPage, aG as FeedPublisher, ad as FeedSnapshot, am as FeedSnapshotRegressionReason, B as FeedSource, z as FeedSourceActor, ag as FeedSubscribeOptions, ah as FeedSubscriptionChange, Z as FeedTableCell, _ as FeedTableColumn, a1 as FeedTableProjection, a0 as FeedTableRow, $ as FeedTableRowReference, N as FeedTarget, K as FeedTransientFeedbackTone, dj as FeedTransientPatchMessage, V as FeedbackFeedItem, a5 as FileFeedItem, ap as GRANULAR_FEED_DIAGNOSTIC_EVENT, G as Granular, aX as GranularAuth, aY as GranularOptions, aS as GraphQLResult, bG as InstanceEffectHandler, I as InstanceToolHandler, c8 as Job, dk as JobActionTraceMessage, c9 as JobFeedbackInput, ca as JobFeedbackMetadata, cb as JobFeedbackRecord, cc as JobFeedbackSentiment, cd as JobFeedbackToolCall, ce as JobStatus, cf as JobSubmitResult, bi as Manifest, dV as ManifestApprovalRequiredSpec, dW as ManifestCreatesSpec, dX as ManifestDryRunSpec, dY as ManifestEffectDeclaration, dZ as ManifestEffectSchema, d_ as ManifestEnumRuleSpec, d$ as ManifestEventStreamDef, e0 as ManifestEventTypeDef, e1 as ManifestFilterBySpec, e2 as ManifestImport, bj as ManifestListResponse, e3 as ManifestOperation, e4 as ManifestPostConditionSpec, e5 as ManifestPropertySpec, e6 as ManifestRelationshipDef, e7 as ManifestReverseSpec, e8 as ManifestStateMachineSpec, e9 as ManifestStateMachineStateSpec, ea as ManifestStateMachineTransitionSpec, eb as ManifestStateTransitionActionSpec, ec as ManifestStateTransitionAssigneeSpec, ed as ManifestStateTransitionExpectedOutcomeSpec, ee as ManifestStateTransitionInputBinding, ef as ManifestStateTransitionOutcomeSpec, eg as ManifestStateTransitionPermissionSpec, eh as ManifestStateTransitionRelatedStateRequirementSpec, ei as ManifestStateTransitionRequirementsSpec, ej as ManifestValidationOperator, ek as ManifestValidationRuleSpec, el as ManifestVolume, cU as ManualActionListOptions, cV as ManualActionOccurrence, cW as ManualActionRecordResult, cX as ManualActionRelatedRecord, cY as ManualActionSource, cZ as ManualActionStatus, c_ as ManualActionSuggestion, c$ as ManualActionSuggestionOptions, d0 as ManualActionTarget, d2 as MarkUserEnvironmentReadOptions, aJ as MatchedPolicy, U as MessageFeedItem, dH as ModelRef, a6 as NormalizedSuggestedArtifact, bX as ObjectProjectionChange, bY as ObjectReference, Y as ObjectsFeedItem, bZ as ObservationReceipt, O as OntologyHandle, b4 as OpenEnvironmentOptions, bk as PermissionProfile, bl as PermissionProfileListResponse, bm as PermissionRules, aK as PolicyOperator, aL as PolicyOrigin, aM as PolicyPredicateSource, aN as PolicyRuleIR, aO as PolicySource, b_ as ProjectionChange, a8 as PromptFeedItem, bH as PublishEffectsResult, aC as PublishFeedbackOptions, x as PublishToolsResult, aD as PublishTransientFeedbackOptions, dl as RPCRequest, dm as RPCRequestFromServer, dn as RPCResponse, dI as RecordImport, dJ as RecordImportItem, dK as RecordImportItemStatus, dL as RecordImportOptions, dM as RecordImportStats, dN as RecordImportStatus, dO as RecordImportWriteMode, d1 as RecordManualActionInput, d3 as RecordMentionInput, dP as RecordObjectResult, dQ as RecordObjectStateValue, dR as RecordObjectsChunkInfo, dS as RecordObjectsOptions, d4 as RecordSearchOptions, d5 as RecordSearchResult, b5 as RecordUserOptions, dT as RelationshipInfo, b$ as RelationshipProjectionChange, bI as ResolvedEffectApprovalRequired, bJ as ResolvedEffectDryRun, bK as ResolvedEffectPostCondition, bL as ResolvedEffectReverse, dU as RunEnvironmentImporterOptions, bn as Sandbox, bo as SandboxListResponse, bp as SemanticVersionDiff, bq as SemanticVersionDiffEntry, v as Session, cE as SessionArtifactApprovalOptions, cF as SessionArtifactAutonomyPolicy, cG as SessionArtifactExecutionOptions, cH as SessionArtifactExecutionResult, cI as SessionArtifactFieldProvenance, cJ as SessionArtifactFieldProvenanceSource, cK as SessionArtifactKind, cL as SessionArtifactListOptions, cM as SessionArtifactRelationshipCreateInput, cN as SessionArtifactRelationshipOption, cO as SessionArtifactRelationshipOptionsInput, cP as SessionArtifactRelationshipOptionsResult, cQ as SessionArtifactRequestContext, cR as SessionArtifactRequestContextSource, cS as SessionArtifactStatus, cT as SessionArtifactValidationResult, aT as SessionCollectionListOptions, d6 as SessionCollectionListResult, d7 as SessionDocumentResult, ai as SessionFeedApi, aB as SessionFeedController, au as SessionFeedControllerOptions, cn as SessionFileKind, co as SessionFileRecord, cp as SessionFileSource, cq as SessionFileStatus, cr as SessionFileUploadOptions, d8 as SessionHeapFieldType, d9 as SessionHeapFieldValue, da as SessionHeapVariable, db as SessionJobListOptions, dc as SessionJobRecord, c0 as SessionMutationView, cg as SessionTimelineEvent, ch as SessionTranscriptActionSuggestion, ci as SessionTranscriptShowRefs, aE as SettleTransientFeedbackOptions, dp as SnapshotResetMessage, c1 as SourceAcknowledgement, c2 as StateObservationProjectionChange, aU as StreamEvent, aV as StreamStats, aW as StreamSubscription, b6 as Subject, a2 as TableFeedItem, y as ToolHandler, bM as ToolInfo, dq as ToolInvokeParams, dr as ToolResultParams, w as ToolSchema, bN as ToolsChangedEvent, ac as TransientFeedItem, a9 as TransientFeedItemBase, ab as TransientFeedbackFeedItem, aF as TransientFeedbackHandle, aa as TransientMessageFeedItem, c3 as TransitionOutcomeProjection, c4 as TransitionProjectionResult, b7 as User, dd as UserEnvironmentArtifactAttention, de as UserEnvironmentMessagePreview, df as UserEnvironmentPrompt, dg as UserEnvironmentSessionState, dh as UserEnvironmentState, di as UserEnvironmentStateOptions, cj as UserMessageAppendResult, ck as UserMessageInput, cl as UserMessageShowRefs, cm as UserMessageTarget, br as Version, bs as VersionTag, bt as VersionTracking, W as WSClient, ds as WSClientOptions, dt as WSDisconnectInfo, du as WSReconnectErrorInfo, aH as createFeedPublisher, at as emitFeedDiagnostic, as as emitFeedDiagnosticToDefaultSink, aw as emptyFeedSnapshot, ax as hasCanonicalSessionFeedActivation, ay as isCanonicalSessionFeedDocument, u as isGraphQLMutationDocument, aj as mergeFeedItemsBySequence, ar as normalizeFeedDiagnostic, aq as normalizeFeedDiagnosticKind, aA as normalizeFeedPage, ak as orderTransientFeedItems, az as readSessionFeedSnapshot } from './client-
|
|
1
|
+
import { E as EnvironmentData, a as EnvironmentRecordImportSummary, b as EndpointMode, c as EffectCommitRequest, C as CommitReceipt, T as ToolWithHandler, P as ProjectionResult, d as ProjectionMapper, e as CommitTransitionOutcomeDeclaration, f as CommitDeclaration, g as EffectHandlerContext, F as FeedPublishTransport, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, h as RecordObjectOptions, i as ManifestContent, j as CommitTransitionInvocation, S as SessionHeapEntry, k as SessionHeapList, l as FeedItem, m as SessionHeapSnapshot, n as Prompt, o as SessionTranscriptEntry, A as ArtifactWorkflowNode, p as ArtifactWorkflowNodeStatus, q as ArtifactWorkflow, r as SessionArtifactRecord } from './client-BZtpnc8M.mjs';
|
|
2
|
+
export { aP as APIError, aQ as AccessTokenProvider, a7 as ActionSuggestionFeedItem, aZ as AdoptEnvironmentOptions, bO as AgentCommitStatus, cs as ArtifactApprovalDecisionInput, ct as ArtifactApprovalDecisionResult, cu as ArtifactApprovalTask, cv as ArtifactApprovalTaskListOptions, cw as ArtifactApprovalTaskStatus, a3 as ArtifactFeedItem, bu as ArtifactOptionsHandler, cx as ArtifactWorkflowAttention, cy as ArtifactWorkflowCompletionState, cz as ArtifactWorkflowNodeAvailability, cA as ArtifactWorkflowNodeKind, cB as ArtifactWorkflowOperationPhase, cC as ArtifactWorkflowRecap, cD as ArtifactWorkflowRecapItem, b8 as Assignment, b9 as AssignmentListResponse, c5 as AssistantReplyPublicationInput, c6 as AssistantReplyPublicationResult, bP as BaseProjectionResult, ba as Build, bb as BuildListResponse, bc as BuildPolicy, bd as BuildStatus, bQ as CanonicalProjectedRecord, bR as CommitChangeReceipt, bS as CommitSafeError, bT as CommitTransitionReceipt, aI as ConditionIR, a_ as ConnectOptions, a$ as ConversationSessionInfo, b0 as ConversationSessionListOptions, b1 as ConversationSessionListResponse, b2 as ConversationSessionListStatus, be as CreateEnvironmentData, bf as CreatePermissionProfileData, bg as CreateSandboxData, b3 as CreateSessionOptions, dv as DefineRelationshipOptions, aR as DeleteResponse, D as DomainState, bv as EffectArtifactOptionsInvocation, bw as EffectArtifactRelationshipOption, bx as EffectArtifactRelationshipOptionsResult, bU as EffectCommitContext, by as EffectHandler, bz as EffectInfo, bA as EffectInvocationMetadata, bB as EffectInvocationMode, bV as EffectProjectionResult, bC as EffectSchema, bD as EffectVersionSelector, bE as EffectWithHandler, bF as EffectsChangedEvent, s as Environment, c7 as EnvironmentFeedbackRecord, dw as EnvironmentImporter, dx as EnvironmentImporterImportOptions, bh as EnvironmentListResponse, t as EnvironmentSession, dy as EnvironmentSetupImporterClaim, dz as EnvironmentSetupLifecycleStatus, dA as EnvironmentSetupSummary, dB as EnvironmentSetupTriggerReason, dC as EnvironmentStateMachineProxy, dD as EnvironmentStateObservationInput, dE as EnvironmentStateProxy, dF as EnvironmentStateTarget, dG as EnvironmentStateUpdateInput, bW as ExternalCommitOptions, an as FeedDiagnostic, ao as FeedDiagnosticListener, av as FeedDocumentState, J as FeedFeedbackTone, a4 as FeedFileSource, H as FeedIconToken, Q as FeedItemBase, L as FeedItemKind, ae as FeedListOptions, al as FeedListTransport, X as FeedObjectReference, af as FeedPage, aG as FeedPublisher, ad as FeedSnapshot, am as FeedSnapshotRegressionReason, B as FeedSource, z as FeedSourceActor, ag as FeedSubscribeOptions, ah as FeedSubscriptionChange, Z as FeedTableCell, _ as FeedTableColumn, a1 as FeedTableProjection, a0 as FeedTableRow, $ as FeedTableRowReference, N as FeedTarget, K as FeedTransientFeedbackTone, dj as FeedTransientPatchMessage, V as FeedbackFeedItem, a5 as FileFeedItem, ap as GRANULAR_FEED_DIAGNOSTIC_EVENT, G as Granular, aX as GranularAuth, aY as GranularOptions, aS as GraphQLResult, bG as InstanceEffectHandler, I as InstanceToolHandler, c8 as Job, dk as JobActionTraceMessage, c9 as JobFeedbackInput, ca as JobFeedbackMetadata, cb as JobFeedbackRecord, cc as JobFeedbackSentiment, cd as JobFeedbackToolCall, ce as JobStatus, cf as JobSubmitResult, bi as Manifest, dV as ManifestApprovalRequiredSpec, dW as ManifestCreatesSpec, dX as ManifestDryRunSpec, dY as ManifestEffectDeclaration, dZ as ManifestEffectSchema, d_ as ManifestEnumRuleSpec, d$ as ManifestEventStreamDef, e0 as ManifestEventTypeDef, e1 as ManifestFilterBySpec, e2 as ManifestImport, bj as ManifestListResponse, e3 as ManifestOperation, e4 as ManifestPostConditionSpec, e5 as ManifestPropertySpec, e6 as ManifestRelationshipDef, e7 as ManifestReverseSpec, e8 as ManifestStateMachineSpec, e9 as ManifestStateMachineStateSpec, ea as ManifestStateMachineTransitionSpec, eb as ManifestStateTransitionActionSpec, ec as ManifestStateTransitionAssigneeSpec, ed as ManifestStateTransitionExpectedOutcomeSpec, ee as ManifestStateTransitionInputBinding, ef as ManifestStateTransitionOutcomeSpec, eg as ManifestStateTransitionPermissionSpec, eh as ManifestStateTransitionRelatedStateRequirementSpec, ei as ManifestStateTransitionRequirementsSpec, ej as ManifestValidationOperator, ek as ManifestValidationRuleSpec, el as ManifestVolume, cU as ManualActionListOptions, cV as ManualActionOccurrence, cW as ManualActionRecordResult, cX as ManualActionRelatedRecord, cY as ManualActionSource, cZ as ManualActionStatus, c_ as ManualActionSuggestion, c$ as ManualActionSuggestionOptions, d0 as ManualActionTarget, d2 as MarkUserEnvironmentReadOptions, aJ as MatchedPolicy, U as MessageFeedItem, dH as ModelRef, a6 as NormalizedSuggestedArtifact, bX as ObjectProjectionChange, bY as ObjectReference, Y as ObjectsFeedItem, bZ as ObservationReceipt, O as OntologyHandle, b4 as OpenEnvironmentOptions, bk as PermissionProfile, bl as PermissionProfileListResponse, bm as PermissionRules, aK as PolicyOperator, aL as PolicyOrigin, aM as PolicyPredicateSource, aN as PolicyRuleIR, aO as PolicySource, b_ as ProjectionChange, a8 as PromptFeedItem, bH as PublishEffectsResult, aC as PublishFeedbackOptions, x as PublishToolsResult, aD as PublishTransientFeedbackOptions, dl as RPCRequest, dm as RPCRequestFromServer, dn as RPCResponse, dI as RecordImport, dJ as RecordImportItem, dK as RecordImportItemStatus, dL as RecordImportOptions, dM as RecordImportStats, dN as RecordImportStatus, dO as RecordImportWriteMode, d1 as RecordManualActionInput, d3 as RecordMentionInput, dP as RecordObjectResult, dQ as RecordObjectStateValue, dR as RecordObjectsChunkInfo, dS as RecordObjectsOptions, d4 as RecordSearchOptions, d5 as RecordSearchResult, b5 as RecordUserOptions, dT as RelationshipInfo, b$ as RelationshipProjectionChange, bI as ResolvedEffectApprovalRequired, bJ as ResolvedEffectDryRun, bK as ResolvedEffectPostCondition, bL as ResolvedEffectReverse, dU as RunEnvironmentImporterOptions, bn as Sandbox, bo as SandboxListResponse, bp as SemanticVersionDiff, bq as SemanticVersionDiffEntry, v as Session, cE as SessionArtifactApprovalOptions, cF as SessionArtifactAutonomyPolicy, cG as SessionArtifactExecutionOptions, cH as SessionArtifactExecutionResult, cI as SessionArtifactFieldProvenance, cJ as SessionArtifactFieldProvenanceSource, cK as SessionArtifactKind, cL as SessionArtifactListOptions, cM as SessionArtifactRelationshipCreateInput, cN as SessionArtifactRelationshipOption, cO as SessionArtifactRelationshipOptionsInput, cP as SessionArtifactRelationshipOptionsResult, cQ as SessionArtifactRequestContext, cR as SessionArtifactRequestContextSource, cS as SessionArtifactStatus, cT as SessionArtifactValidationResult, aT as SessionCollectionListOptions, d6 as SessionCollectionListResult, d7 as SessionDocumentResult, ai as SessionFeedApi, aB as SessionFeedController, au as SessionFeedControllerOptions, cn as SessionFileKind, co as SessionFileRecord, cp as SessionFileSource, cq as SessionFileStatus, cr as SessionFileUploadOptions, d8 as SessionHeapFieldType, d9 as SessionHeapFieldValue, da as SessionHeapVariable, db as SessionJobListOptions, dc as SessionJobRecord, c0 as SessionMutationView, cg as SessionTimelineEvent, ch as SessionTranscriptActionSuggestion, ci as SessionTranscriptShowRefs, aE as SettleTransientFeedbackOptions, dp as SnapshotResetMessage, c1 as SourceAcknowledgement, c2 as StateObservationProjectionChange, aU as StreamEvent, aV as StreamStats, aW as StreamSubscription, b6 as Subject, a2 as TableFeedItem, y as ToolHandler, bM as ToolInfo, dq as ToolInvokeParams, dr as ToolResultParams, w as ToolSchema, bN as ToolsChangedEvent, ac as TransientFeedItem, a9 as TransientFeedItemBase, ab as TransientFeedbackFeedItem, aF as TransientFeedbackHandle, aa as TransientMessageFeedItem, c3 as TransitionOutcomeProjection, c4 as TransitionProjectionResult, b7 as User, dd as UserEnvironmentArtifactAttention, de as UserEnvironmentMessagePreview, df as UserEnvironmentPrompt, dg as UserEnvironmentSessionState, dh as UserEnvironmentState, di as UserEnvironmentStateOptions, cj as UserMessageAppendResult, ck as UserMessageInput, cl as UserMessageShowRefs, cm as UserMessageTarget, br as Version, bs as VersionTag, bt as VersionTracking, W as WSClient, ds as WSClientOptions, dt as WSDisconnectInfo, du as WSReconnectErrorInfo, aH as createFeedPublisher, at as emitFeedDiagnostic, as as emitFeedDiagnosticToDefaultSink, aw as emptyFeedSnapshot, ax as hasCanonicalSessionFeedActivation, ay as isCanonicalSessionFeedDocument, u as isGraphQLMutationDocument, aj as mergeFeedItemsBySequence, ar as normalizeFeedDiagnostic, aq as normalizeFeedDiagnosticKind, aA as normalizeFeedPage, ak as orderTransientFeedItems, az as readSessionFeedSnapshot } from './client-BZtpnc8M.mjs';
|
|
3
3
|
export { BuildGranularAgentSystemPromptInput, GeneratedJobCodeIssue, GranularAgentExecutionCheckpoint, GranularAgentHeapSummaryOptions, GranularAgentManualActionMemorySuggestion, GranularAgentPromptCapabilities, GranularAgentReferentFocus, GranularAgentSessionContext, GranularAgentToolInfo, GranularAgentWorkflowFocus, GranularReasoningTraceChunkResult, GranularReasoningTraceOptions, HarnessContinuationDecision, HarnessControllerBudgets, HarnessProjectionOptions, HarnessPromptLike, HarnessRenderedContinuation, HarnessRenderedPrompt, HarnessTemplate, HarnessTemplateManifest, HarnessTemplateSelectionOptions, HarnessTemplateStatus, HarnessVerifierSnapshot, HarnessVerifierSnapshotInput, ReviewGeneratedJobCodeOptions, buildContinuationInstruction, buildContinuationInstructionFromTemplate, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentFileBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentManualActionBlock, buildGranularAgentManualActionMemorySummary, buildGranularAgentReferentBlock, buildGranularAgentRuntimeImportsBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentSystemPromptFromTemplate, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, consumeGranularReasoningOnlyChunk, consumeGranularReasoningTraceChunk, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getDefaultHarnessTemplateId, getExclusivePromptTarget, hasOpenPrompt, hashHarnessTemplateValue, listHarnessTemplates, projectConversationReferentFocus, projectConversationReferentSummary, projectHeapSummary, projectLoopSummary, projectSessionFileSummary, projectWorkflowFocus, projectWorkflowSummary, renderContinuationInstructionFromTemplate, renderGranularAgentSystemPromptFromTemplate, resolveHarnessTemplate, reviewGeneratedJobCode, stripGranularReasoningTrace, validateHarnessTemplateManifest } from './agent-harness.mjs';
|
|
4
4
|
export { h as GranularQuotaPolicy, i as GranularQuotaProgress, G as GranularSpendContext, N as NormalizedOpenAIUsage, b as OPENAI_MODEL_PRICING_USD_PER_MILLION, O as OpenAIModelPricing, a as OpenAITokenSpend, d as OpenAIUsageSpendEvent, Q as QuotaLineItemFilter, j as QuotaPeriod, k as QuotaScopeType, l as QuotaStatus, R as RecordOpenAIUsageSpendOptions, e as RecordOpenAIUsageSpendResult, S as SpendLineItemType, m as SpendSummary, f as buildOpenAISpendEventId, c as calculateOpenAITokenSpend, g as getOpenAIModelPricing, n as normalizeOpenAIUsage, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-ZMtzJoMN.mjs';
|
|
5
5
|
import '@automerge/automerge';
|
|
6
6
|
import '@automerge/automerge/slim';
|
|
7
7
|
|
|
8
|
+
/** HTTP failure details shared by the SDK and CLI. No retry is implied. */
|
|
9
|
+
declare class GranularApiError extends Error {
|
|
10
|
+
readonly status: number;
|
|
11
|
+
readonly path: string;
|
|
12
|
+
readonly code: string;
|
|
13
|
+
readonly body?: unknown;
|
|
14
|
+
readonly idempotencyKey?: string;
|
|
15
|
+
constructor(message: string, status: number, path: string, details?: {
|
|
16
|
+
body?: string;
|
|
17
|
+
idempotencyKey?: string;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
8
21
|
type EnvironmentSetupResponse = {
|
|
9
22
|
environment?: Partial<EnvironmentData>;
|
|
10
23
|
setup?: EnvironmentData["setup"] | null;
|
|
@@ -397,4 +410,4 @@ interface ArtifactSurfaceModel {
|
|
|
397
410
|
}
|
|
398
411
|
declare function selectArtifactSurface(artifact: SessionArtifactRecord, context?: ArtifactSurfaceContext): ArtifactSurfaceModel;
|
|
399
412
|
|
|
400
|
-
export { type ArtifactSurfaceAction, type ArtifactSurfaceActionId, type ArtifactSurfaceContext, type ArtifactSurfaceKind, type ArtifactSurfaceModel, ArtifactWorkflow, ArtifactWorkflowNode, ArtifactWorkflowNodeStatus, CommitDeclaration, CommitReceipt, CommitTransitionInvocation, CommitTransitionOutcomeDeclaration, type CommitTransport, type ConditionalPolicySpec, type DefinedStateMachine, EffectCommitRequest, EffectHandlerContext, EndpointMode, EnvironmentData, EnvironmentRecordImportSummary, type EnvironmentSetupPollInput, type EnvironmentSetupProgress, type EnvironmentSetupRequestError, type EnvironmentSetupResponse, FeedItem, FeedPublishTransport, type JobPresentation, type LimitPolicySpec, ManifestContent, ManifestEffectMetamodelSpec, type NormalizedPromptChoiceOption, type PermissionActionSpec, type PermissionPolicySpec, type PermissionProfileFile, type PolicyDecision, type PolicyEvaluationContext, type PolicyOutcome, ProjectionMapper, ProjectionResult, Prompt, RecordObjectOptions, type RecordSnapshotCommitSource, ResolvedEffectBehaviors, SessionArtifactRecord, SessionHeapEntry, SessionHeapList, SessionHeapSnapshot, SessionTranscriptEntry, type StateMachineDefinition, ToolWithHandler, type ValidationRuleEvaluationInput, type ValidationRuleEvaluationResult, artifactReviewedOperation, assertArtifactWorkflow, buildSessionTranscript, buildSessionTranscriptFromFeedItems, canInspectArtifactWorkflowNode, canonicalizeCommitValue, changedRecordSnapshots, defineEffect, defineProjection, defineStateMachine, environmentSetupProgressFromError, environmentSetupProgressFromResponse, evaluateValidationRule, extractPromptTokens, getArtifactWorkflowNavigationLeaves, getArtifactWorkflowNavigationTarget, getArtifactWorkflowNodes, getCurrentArtifactWorkflowNode, invokeRegisteredEffect, isArtifactWorkflowNodeNavigableLeaf, isArtifactWorkflowNodeTerminal, isLocalApiUrl, normalizeEffectBehaviors, normalizePrompt, normalizePromptChoiceOption, normalizePromptText, normalizePromptType, pollEnvironmentSetup, projectArtifactWorkflow, projectRecordSnapshotMutation, requireArtifactWorkflow, requireArtifactWorkflowResult, resolveApiUrl, resolveAuthTokenForApiUrl, resolveJobPresentation, resolvePromptAnswer, scorePromptChoiceMatch, selectArtifactSurface, validateProjectionResult, validationRuleFailureMessage };
|
|
413
|
+
export { type ArtifactSurfaceAction, type ArtifactSurfaceActionId, type ArtifactSurfaceContext, type ArtifactSurfaceKind, type ArtifactSurfaceModel, ArtifactWorkflow, ArtifactWorkflowNode, ArtifactWorkflowNodeStatus, CommitDeclaration, CommitReceipt, CommitTransitionInvocation, CommitTransitionOutcomeDeclaration, type CommitTransport, type ConditionalPolicySpec, type DefinedStateMachine, EffectCommitRequest, EffectHandlerContext, EndpointMode, EnvironmentData, EnvironmentRecordImportSummary, type EnvironmentSetupPollInput, type EnvironmentSetupProgress, type EnvironmentSetupRequestError, type EnvironmentSetupResponse, FeedItem, FeedPublishTransport, GranularApiError, type JobPresentation, type LimitPolicySpec, ManifestContent, ManifestEffectMetamodelSpec, type NormalizedPromptChoiceOption, type PermissionActionSpec, type PermissionPolicySpec, type PermissionProfileFile, type PolicyDecision, type PolicyEvaluationContext, type PolicyOutcome, ProjectionMapper, ProjectionResult, Prompt, RecordObjectOptions, type RecordSnapshotCommitSource, ResolvedEffectBehaviors, SessionArtifactRecord, SessionHeapEntry, SessionHeapList, SessionHeapSnapshot, SessionTranscriptEntry, type StateMachineDefinition, ToolWithHandler, type ValidationRuleEvaluationInput, type ValidationRuleEvaluationResult, artifactReviewedOperation, assertArtifactWorkflow, buildSessionTranscript, buildSessionTranscriptFromFeedItems, canInspectArtifactWorkflowNode, canonicalizeCommitValue, changedRecordSnapshots, defineEffect, defineProjection, defineStateMachine, environmentSetupProgressFromError, environmentSetupProgressFromResponse, evaluateValidationRule, extractPromptTokens, getArtifactWorkflowNavigationLeaves, getArtifactWorkflowNavigationTarget, getArtifactWorkflowNodes, getCurrentArtifactWorkflowNode, invokeRegisteredEffect, isArtifactWorkflowNodeNavigableLeaf, isArtifactWorkflowNodeTerminal, isLocalApiUrl, normalizeEffectBehaviors, normalizePrompt, normalizePromptChoiceOption, normalizePromptText, normalizePromptType, pollEnvironmentSetup, projectArtifactWorkflow, projectRecordSnapshotMutation, requireArtifactWorkflow, requireArtifactWorkflowResult, resolveApiUrl, resolveAuthTokenForApiUrl, resolveJobPresentation, resolvePromptAnswer, scorePromptChoiceMatch, selectArtifactSurface, validateProjectionResult, validationRuleFailureMessage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
import { E as EnvironmentData, a as EnvironmentRecordImportSummary, b as EndpointMode, c as EffectCommitRequest, C as CommitReceipt, T as ToolWithHandler, P as ProjectionResult, d as ProjectionMapper, e as CommitTransitionOutcomeDeclaration, f as CommitDeclaration, g as EffectHandlerContext, F as FeedPublishTransport, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, h as RecordObjectOptions, i as ManifestContent, j as CommitTransitionInvocation, S as SessionHeapEntry, k as SessionHeapList, l as FeedItem, m as SessionHeapSnapshot, n as Prompt, o as SessionTranscriptEntry, A as ArtifactWorkflowNode, p as ArtifactWorkflowNodeStatus, q as ArtifactWorkflow, r as SessionArtifactRecord } from './client-
|
|
2
|
-
export { aP as APIError, aQ as AccessTokenProvider, a7 as ActionSuggestionFeedItem, aZ as AdoptEnvironmentOptions, bO as AgentCommitStatus, cs as ArtifactApprovalDecisionInput, ct as ArtifactApprovalDecisionResult, cu as ArtifactApprovalTask, cv as ArtifactApprovalTaskListOptions, cw as ArtifactApprovalTaskStatus, a3 as ArtifactFeedItem, bu as ArtifactOptionsHandler, cx as ArtifactWorkflowAttention, cy as ArtifactWorkflowCompletionState, cz as ArtifactWorkflowNodeAvailability, cA as ArtifactWorkflowNodeKind, cB as ArtifactWorkflowOperationPhase, cC as ArtifactWorkflowRecap, cD as ArtifactWorkflowRecapItem, b8 as Assignment, b9 as AssignmentListResponse, c5 as AssistantReplyPublicationInput, c6 as AssistantReplyPublicationResult, bP as BaseProjectionResult, ba as Build, bb as BuildListResponse, bc as BuildPolicy, bd as BuildStatus, bQ as CanonicalProjectedRecord, bR as CommitChangeReceipt, bS as CommitSafeError, bT as CommitTransitionReceipt, aI as ConditionIR, a_ as ConnectOptions, a$ as ConversationSessionInfo, b0 as ConversationSessionListOptions, b1 as ConversationSessionListResponse, b2 as ConversationSessionListStatus, be as CreateEnvironmentData, bf as CreatePermissionProfileData, bg as CreateSandboxData, b3 as CreateSessionOptions, dv as DefineRelationshipOptions, aR as DeleteResponse, D as DomainState, bv as EffectArtifactOptionsInvocation, bw as EffectArtifactRelationshipOption, bx as EffectArtifactRelationshipOptionsResult, bU as EffectCommitContext, by as EffectHandler, bz as EffectInfo, bA as EffectInvocationMetadata, bB as EffectInvocationMode, bV as EffectProjectionResult, bC as EffectSchema, bD as EffectVersionSelector, bE as EffectWithHandler, bF as EffectsChangedEvent, s as Environment, c7 as EnvironmentFeedbackRecord, dw as EnvironmentImporter, dx as EnvironmentImporterImportOptions, bh as EnvironmentListResponse, t as EnvironmentSession, dy as EnvironmentSetupImporterClaim, dz as EnvironmentSetupLifecycleStatus, dA as EnvironmentSetupSummary, dB as EnvironmentSetupTriggerReason, dC as EnvironmentStateMachineProxy, dD as EnvironmentStateObservationInput, dE as EnvironmentStateProxy, dF as EnvironmentStateTarget, dG as EnvironmentStateUpdateInput, bW as ExternalCommitOptions, an as FeedDiagnostic, ao as FeedDiagnosticListener, av as FeedDocumentState, J as FeedFeedbackTone, a4 as FeedFileSource, H as FeedIconToken, Q as FeedItemBase, L as FeedItemKind, ae as FeedListOptions, al as FeedListTransport, X as FeedObjectReference, af as FeedPage, aG as FeedPublisher, ad as FeedSnapshot, am as FeedSnapshotRegressionReason, B as FeedSource, z as FeedSourceActor, ag as FeedSubscribeOptions, ah as FeedSubscriptionChange, Z as FeedTableCell, _ as FeedTableColumn, a1 as FeedTableProjection, a0 as FeedTableRow, $ as FeedTableRowReference, N as FeedTarget, K as FeedTransientFeedbackTone, dj as FeedTransientPatchMessage, V as FeedbackFeedItem, a5 as FileFeedItem, ap as GRANULAR_FEED_DIAGNOSTIC_EVENT, G as Granular, aX as GranularAuth, aY as GranularOptions, aS as GraphQLResult, bG as InstanceEffectHandler, I as InstanceToolHandler, c8 as Job, dk as JobActionTraceMessage, c9 as JobFeedbackInput, ca as JobFeedbackMetadata, cb as JobFeedbackRecord, cc as JobFeedbackSentiment, cd as JobFeedbackToolCall, ce as JobStatus, cf as JobSubmitResult, bi as Manifest, dV as ManifestApprovalRequiredSpec, dW as ManifestCreatesSpec, dX as ManifestDryRunSpec, dY as ManifestEffectDeclaration, dZ as ManifestEffectSchema, d_ as ManifestEnumRuleSpec, d$ as ManifestEventStreamDef, e0 as ManifestEventTypeDef, e1 as ManifestFilterBySpec, e2 as ManifestImport, bj as ManifestListResponse, e3 as ManifestOperation, e4 as ManifestPostConditionSpec, e5 as ManifestPropertySpec, e6 as ManifestRelationshipDef, e7 as ManifestReverseSpec, e8 as ManifestStateMachineSpec, e9 as ManifestStateMachineStateSpec, ea as ManifestStateMachineTransitionSpec, eb as ManifestStateTransitionActionSpec, ec as ManifestStateTransitionAssigneeSpec, ed as ManifestStateTransitionExpectedOutcomeSpec, ee as ManifestStateTransitionInputBinding, ef as ManifestStateTransitionOutcomeSpec, eg as ManifestStateTransitionPermissionSpec, eh as ManifestStateTransitionRelatedStateRequirementSpec, ei as ManifestStateTransitionRequirementsSpec, ej as ManifestValidationOperator, ek as ManifestValidationRuleSpec, el as ManifestVolume, cU as ManualActionListOptions, cV as ManualActionOccurrence, cW as ManualActionRecordResult, cX as ManualActionRelatedRecord, cY as ManualActionSource, cZ as ManualActionStatus, c_ as ManualActionSuggestion, c$ as ManualActionSuggestionOptions, d0 as ManualActionTarget, d2 as MarkUserEnvironmentReadOptions, aJ as MatchedPolicy, U as MessageFeedItem, dH as ModelRef, a6 as NormalizedSuggestedArtifact, bX as ObjectProjectionChange, bY as ObjectReference, Y as ObjectsFeedItem, bZ as ObservationReceipt, O as OntologyHandle, b4 as OpenEnvironmentOptions, bk as PermissionProfile, bl as PermissionProfileListResponse, bm as PermissionRules, aK as PolicyOperator, aL as PolicyOrigin, aM as PolicyPredicateSource, aN as PolicyRuleIR, aO as PolicySource, b_ as ProjectionChange, a8 as PromptFeedItem, bH as PublishEffectsResult, aC as PublishFeedbackOptions, x as PublishToolsResult, aD as PublishTransientFeedbackOptions, dl as RPCRequest, dm as RPCRequestFromServer, dn as RPCResponse, dI as RecordImport, dJ as RecordImportItem, dK as RecordImportItemStatus, dL as RecordImportOptions, dM as RecordImportStats, dN as RecordImportStatus, dO as RecordImportWriteMode, d1 as RecordManualActionInput, d3 as RecordMentionInput, dP as RecordObjectResult, dQ as RecordObjectStateValue, dR as RecordObjectsChunkInfo, dS as RecordObjectsOptions, d4 as RecordSearchOptions, d5 as RecordSearchResult, b5 as RecordUserOptions, dT as RelationshipInfo, b$ as RelationshipProjectionChange, bI as ResolvedEffectApprovalRequired, bJ as ResolvedEffectDryRun, bK as ResolvedEffectPostCondition, bL as ResolvedEffectReverse, dU as RunEnvironmentImporterOptions, bn as Sandbox, bo as SandboxListResponse, bp as SemanticVersionDiff, bq as SemanticVersionDiffEntry, v as Session, cE as SessionArtifactApprovalOptions, cF as SessionArtifactAutonomyPolicy, cG as SessionArtifactExecutionOptions, cH as SessionArtifactExecutionResult, cI as SessionArtifactFieldProvenance, cJ as SessionArtifactFieldProvenanceSource, cK as SessionArtifactKind, cL as SessionArtifactListOptions, cM as SessionArtifactRelationshipCreateInput, cN as SessionArtifactRelationshipOption, cO as SessionArtifactRelationshipOptionsInput, cP as SessionArtifactRelationshipOptionsResult, cQ as SessionArtifactRequestContext, cR as SessionArtifactRequestContextSource, cS as SessionArtifactStatus, cT as SessionArtifactValidationResult, aT as SessionCollectionListOptions, d6 as SessionCollectionListResult, d7 as SessionDocumentResult, ai as SessionFeedApi, aB as SessionFeedController, au as SessionFeedControllerOptions, cn as SessionFileKind, co as SessionFileRecord, cp as SessionFileSource, cq as SessionFileStatus, cr as SessionFileUploadOptions, d8 as SessionHeapFieldType, d9 as SessionHeapFieldValue, da as SessionHeapVariable, db as SessionJobListOptions, dc as SessionJobRecord, c0 as SessionMutationView, cg as SessionTimelineEvent, ch as SessionTranscriptActionSuggestion, ci as SessionTranscriptShowRefs, aE as SettleTransientFeedbackOptions, dp as SnapshotResetMessage, c1 as SourceAcknowledgement, c2 as StateObservationProjectionChange, aU as StreamEvent, aV as StreamStats, aW as StreamSubscription, b6 as Subject, a2 as TableFeedItem, y as ToolHandler, bM as ToolInfo, dq as ToolInvokeParams, dr as ToolResultParams, w as ToolSchema, bN as ToolsChangedEvent, ac as TransientFeedItem, a9 as TransientFeedItemBase, ab as TransientFeedbackFeedItem, aF as TransientFeedbackHandle, aa as TransientMessageFeedItem, c3 as TransitionOutcomeProjection, c4 as TransitionProjectionResult, b7 as User, dd as UserEnvironmentArtifactAttention, de as UserEnvironmentMessagePreview, df as UserEnvironmentPrompt, dg as UserEnvironmentSessionState, dh as UserEnvironmentState, di as UserEnvironmentStateOptions, cj as UserMessageAppendResult, ck as UserMessageInput, cl as UserMessageShowRefs, cm as UserMessageTarget, br as Version, bs as VersionTag, bt as VersionTracking, W as WSClient, ds as WSClientOptions, dt as WSDisconnectInfo, du as WSReconnectErrorInfo, aH as createFeedPublisher, at as emitFeedDiagnostic, as as emitFeedDiagnosticToDefaultSink, aw as emptyFeedSnapshot, ax as hasCanonicalSessionFeedActivation, ay as isCanonicalSessionFeedDocument, u as isGraphQLMutationDocument, aj as mergeFeedItemsBySequence, ar as normalizeFeedDiagnostic, aq as normalizeFeedDiagnosticKind, aA as normalizeFeedPage, ak as orderTransientFeedItems, az as readSessionFeedSnapshot } from './client-
|
|
1
|
+
import { E as EnvironmentData, a as EnvironmentRecordImportSummary, b as EndpointMode, c as EffectCommitRequest, C as CommitReceipt, T as ToolWithHandler, P as ProjectionResult, d as ProjectionMapper, e as CommitTransitionOutcomeDeclaration, f as CommitDeclaration, g as EffectHandlerContext, F as FeedPublishTransport, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, h as RecordObjectOptions, i as ManifestContent, j as CommitTransitionInvocation, S as SessionHeapEntry, k as SessionHeapList, l as FeedItem, m as SessionHeapSnapshot, n as Prompt, o as SessionTranscriptEntry, A as ArtifactWorkflowNode, p as ArtifactWorkflowNodeStatus, q as ArtifactWorkflow, r as SessionArtifactRecord } from './client-C7bj1UeD.js';
|
|
2
|
+
export { aP as APIError, aQ as AccessTokenProvider, a7 as ActionSuggestionFeedItem, aZ as AdoptEnvironmentOptions, bO as AgentCommitStatus, cs as ArtifactApprovalDecisionInput, ct as ArtifactApprovalDecisionResult, cu as ArtifactApprovalTask, cv as ArtifactApprovalTaskListOptions, cw as ArtifactApprovalTaskStatus, a3 as ArtifactFeedItem, bu as ArtifactOptionsHandler, cx as ArtifactWorkflowAttention, cy as ArtifactWorkflowCompletionState, cz as ArtifactWorkflowNodeAvailability, cA as ArtifactWorkflowNodeKind, cB as ArtifactWorkflowOperationPhase, cC as ArtifactWorkflowRecap, cD as ArtifactWorkflowRecapItem, b8 as Assignment, b9 as AssignmentListResponse, c5 as AssistantReplyPublicationInput, c6 as AssistantReplyPublicationResult, bP as BaseProjectionResult, ba as Build, bb as BuildListResponse, bc as BuildPolicy, bd as BuildStatus, bQ as CanonicalProjectedRecord, bR as CommitChangeReceipt, bS as CommitSafeError, bT as CommitTransitionReceipt, aI as ConditionIR, a_ as ConnectOptions, a$ as ConversationSessionInfo, b0 as ConversationSessionListOptions, b1 as ConversationSessionListResponse, b2 as ConversationSessionListStatus, be as CreateEnvironmentData, bf as CreatePermissionProfileData, bg as CreateSandboxData, b3 as CreateSessionOptions, dv as DefineRelationshipOptions, aR as DeleteResponse, D as DomainState, bv as EffectArtifactOptionsInvocation, bw as EffectArtifactRelationshipOption, bx as EffectArtifactRelationshipOptionsResult, bU as EffectCommitContext, by as EffectHandler, bz as EffectInfo, bA as EffectInvocationMetadata, bB as EffectInvocationMode, bV as EffectProjectionResult, bC as EffectSchema, bD as EffectVersionSelector, bE as EffectWithHandler, bF as EffectsChangedEvent, s as Environment, c7 as EnvironmentFeedbackRecord, dw as EnvironmentImporter, dx as EnvironmentImporterImportOptions, bh as EnvironmentListResponse, t as EnvironmentSession, dy as EnvironmentSetupImporterClaim, dz as EnvironmentSetupLifecycleStatus, dA as EnvironmentSetupSummary, dB as EnvironmentSetupTriggerReason, dC as EnvironmentStateMachineProxy, dD as EnvironmentStateObservationInput, dE as EnvironmentStateProxy, dF as EnvironmentStateTarget, dG as EnvironmentStateUpdateInput, bW as ExternalCommitOptions, an as FeedDiagnostic, ao as FeedDiagnosticListener, av as FeedDocumentState, J as FeedFeedbackTone, a4 as FeedFileSource, H as FeedIconToken, Q as FeedItemBase, L as FeedItemKind, ae as FeedListOptions, al as FeedListTransport, X as FeedObjectReference, af as FeedPage, aG as FeedPublisher, ad as FeedSnapshot, am as FeedSnapshotRegressionReason, B as FeedSource, z as FeedSourceActor, ag as FeedSubscribeOptions, ah as FeedSubscriptionChange, Z as FeedTableCell, _ as FeedTableColumn, a1 as FeedTableProjection, a0 as FeedTableRow, $ as FeedTableRowReference, N as FeedTarget, K as FeedTransientFeedbackTone, dj as FeedTransientPatchMessage, V as FeedbackFeedItem, a5 as FileFeedItem, ap as GRANULAR_FEED_DIAGNOSTIC_EVENT, G as Granular, aX as GranularAuth, aY as GranularOptions, aS as GraphQLResult, bG as InstanceEffectHandler, I as InstanceToolHandler, c8 as Job, dk as JobActionTraceMessage, c9 as JobFeedbackInput, ca as JobFeedbackMetadata, cb as JobFeedbackRecord, cc as JobFeedbackSentiment, cd as JobFeedbackToolCall, ce as JobStatus, cf as JobSubmitResult, bi as Manifest, dV as ManifestApprovalRequiredSpec, dW as ManifestCreatesSpec, dX as ManifestDryRunSpec, dY as ManifestEffectDeclaration, dZ as ManifestEffectSchema, d_ as ManifestEnumRuleSpec, d$ as ManifestEventStreamDef, e0 as ManifestEventTypeDef, e1 as ManifestFilterBySpec, e2 as ManifestImport, bj as ManifestListResponse, e3 as ManifestOperation, e4 as ManifestPostConditionSpec, e5 as ManifestPropertySpec, e6 as ManifestRelationshipDef, e7 as ManifestReverseSpec, e8 as ManifestStateMachineSpec, e9 as ManifestStateMachineStateSpec, ea as ManifestStateMachineTransitionSpec, eb as ManifestStateTransitionActionSpec, ec as ManifestStateTransitionAssigneeSpec, ed as ManifestStateTransitionExpectedOutcomeSpec, ee as ManifestStateTransitionInputBinding, ef as ManifestStateTransitionOutcomeSpec, eg as ManifestStateTransitionPermissionSpec, eh as ManifestStateTransitionRelatedStateRequirementSpec, ei as ManifestStateTransitionRequirementsSpec, ej as ManifestValidationOperator, ek as ManifestValidationRuleSpec, el as ManifestVolume, cU as ManualActionListOptions, cV as ManualActionOccurrence, cW as ManualActionRecordResult, cX as ManualActionRelatedRecord, cY as ManualActionSource, cZ as ManualActionStatus, c_ as ManualActionSuggestion, c$ as ManualActionSuggestionOptions, d0 as ManualActionTarget, d2 as MarkUserEnvironmentReadOptions, aJ as MatchedPolicy, U as MessageFeedItem, dH as ModelRef, a6 as NormalizedSuggestedArtifact, bX as ObjectProjectionChange, bY as ObjectReference, Y as ObjectsFeedItem, bZ as ObservationReceipt, O as OntologyHandle, b4 as OpenEnvironmentOptions, bk as PermissionProfile, bl as PermissionProfileListResponse, bm as PermissionRules, aK as PolicyOperator, aL as PolicyOrigin, aM as PolicyPredicateSource, aN as PolicyRuleIR, aO as PolicySource, b_ as ProjectionChange, a8 as PromptFeedItem, bH as PublishEffectsResult, aC as PublishFeedbackOptions, x as PublishToolsResult, aD as PublishTransientFeedbackOptions, dl as RPCRequest, dm as RPCRequestFromServer, dn as RPCResponse, dI as RecordImport, dJ as RecordImportItem, dK as RecordImportItemStatus, dL as RecordImportOptions, dM as RecordImportStats, dN as RecordImportStatus, dO as RecordImportWriteMode, d1 as RecordManualActionInput, d3 as RecordMentionInput, dP as RecordObjectResult, dQ as RecordObjectStateValue, dR as RecordObjectsChunkInfo, dS as RecordObjectsOptions, d4 as RecordSearchOptions, d5 as RecordSearchResult, b5 as RecordUserOptions, dT as RelationshipInfo, b$ as RelationshipProjectionChange, bI as ResolvedEffectApprovalRequired, bJ as ResolvedEffectDryRun, bK as ResolvedEffectPostCondition, bL as ResolvedEffectReverse, dU as RunEnvironmentImporterOptions, bn as Sandbox, bo as SandboxListResponse, bp as SemanticVersionDiff, bq as SemanticVersionDiffEntry, v as Session, cE as SessionArtifactApprovalOptions, cF as SessionArtifactAutonomyPolicy, cG as SessionArtifactExecutionOptions, cH as SessionArtifactExecutionResult, cI as SessionArtifactFieldProvenance, cJ as SessionArtifactFieldProvenanceSource, cK as SessionArtifactKind, cL as SessionArtifactListOptions, cM as SessionArtifactRelationshipCreateInput, cN as SessionArtifactRelationshipOption, cO as SessionArtifactRelationshipOptionsInput, cP as SessionArtifactRelationshipOptionsResult, cQ as SessionArtifactRequestContext, cR as SessionArtifactRequestContextSource, cS as SessionArtifactStatus, cT as SessionArtifactValidationResult, aT as SessionCollectionListOptions, d6 as SessionCollectionListResult, d7 as SessionDocumentResult, ai as SessionFeedApi, aB as SessionFeedController, au as SessionFeedControllerOptions, cn as SessionFileKind, co as SessionFileRecord, cp as SessionFileSource, cq as SessionFileStatus, cr as SessionFileUploadOptions, d8 as SessionHeapFieldType, d9 as SessionHeapFieldValue, da as SessionHeapVariable, db as SessionJobListOptions, dc as SessionJobRecord, c0 as SessionMutationView, cg as SessionTimelineEvent, ch as SessionTranscriptActionSuggestion, ci as SessionTranscriptShowRefs, aE as SettleTransientFeedbackOptions, dp as SnapshotResetMessage, c1 as SourceAcknowledgement, c2 as StateObservationProjectionChange, aU as StreamEvent, aV as StreamStats, aW as StreamSubscription, b6 as Subject, a2 as TableFeedItem, y as ToolHandler, bM as ToolInfo, dq as ToolInvokeParams, dr as ToolResultParams, w as ToolSchema, bN as ToolsChangedEvent, ac as TransientFeedItem, a9 as TransientFeedItemBase, ab as TransientFeedbackFeedItem, aF as TransientFeedbackHandle, aa as TransientMessageFeedItem, c3 as TransitionOutcomeProjection, c4 as TransitionProjectionResult, b7 as User, dd as UserEnvironmentArtifactAttention, de as UserEnvironmentMessagePreview, df as UserEnvironmentPrompt, dg as UserEnvironmentSessionState, dh as UserEnvironmentState, di as UserEnvironmentStateOptions, cj as UserMessageAppendResult, ck as UserMessageInput, cl as UserMessageShowRefs, cm as UserMessageTarget, br as Version, bs as VersionTag, bt as VersionTracking, W as WSClient, ds as WSClientOptions, dt as WSDisconnectInfo, du as WSReconnectErrorInfo, aH as createFeedPublisher, at as emitFeedDiagnostic, as as emitFeedDiagnosticToDefaultSink, aw as emptyFeedSnapshot, ax as hasCanonicalSessionFeedActivation, ay as isCanonicalSessionFeedDocument, u as isGraphQLMutationDocument, aj as mergeFeedItemsBySequence, ar as normalizeFeedDiagnostic, aq as normalizeFeedDiagnosticKind, aA as normalizeFeedPage, ak as orderTransientFeedItems, az as readSessionFeedSnapshot } from './client-C7bj1UeD.js';
|
|
3
3
|
export { BuildGranularAgentSystemPromptInput, GeneratedJobCodeIssue, GranularAgentExecutionCheckpoint, GranularAgentHeapSummaryOptions, GranularAgentManualActionMemorySuggestion, GranularAgentPromptCapabilities, GranularAgentReferentFocus, GranularAgentSessionContext, GranularAgentToolInfo, GranularAgentWorkflowFocus, GranularReasoningTraceChunkResult, GranularReasoningTraceOptions, HarnessContinuationDecision, HarnessControllerBudgets, HarnessProjectionOptions, HarnessPromptLike, HarnessRenderedContinuation, HarnessRenderedPrompt, HarnessTemplate, HarnessTemplateManifest, HarnessTemplateSelectionOptions, HarnessTemplateStatus, HarnessVerifierSnapshot, HarnessVerifierSnapshotInput, ReviewGeneratedJobCodeOptions, buildContinuationInstruction, buildContinuationInstructionFromTemplate, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentFileBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentManualActionBlock, buildGranularAgentManualActionMemorySummary, buildGranularAgentReferentBlock, buildGranularAgentRuntimeImportsBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentSystemPromptFromTemplate, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, consumeGranularReasoningOnlyChunk, consumeGranularReasoningTraceChunk, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getDefaultHarnessTemplateId, getExclusivePromptTarget, hasOpenPrompt, hashHarnessTemplateValue, listHarnessTemplates, projectConversationReferentFocus, projectConversationReferentSummary, projectHeapSummary, projectLoopSummary, projectSessionFileSummary, projectWorkflowFocus, projectWorkflowSummary, renderContinuationInstructionFromTemplate, renderGranularAgentSystemPromptFromTemplate, resolveHarnessTemplate, reviewGeneratedJobCode, stripGranularReasoningTrace, validateHarnessTemplateManifest } from './agent-harness.js';
|
|
4
4
|
export { h as GranularQuotaPolicy, i as GranularQuotaProgress, G as GranularSpendContext, N as NormalizedOpenAIUsage, b as OPENAI_MODEL_PRICING_USD_PER_MILLION, O as OpenAIModelPricing, a as OpenAITokenSpend, d as OpenAIUsageSpendEvent, Q as QuotaLineItemFilter, j as QuotaPeriod, k as QuotaScopeType, l as QuotaStatus, R as RecordOpenAIUsageSpendOptions, e as RecordOpenAIUsageSpendResult, S as SpendLineItemType, m as SpendSummary, f as buildOpenAISpendEventId, c as calculateOpenAITokenSpend, g as getOpenAIModelPricing, n as normalizeOpenAIUsage, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-ZMtzJoMN.js';
|
|
5
5
|
import '@automerge/automerge';
|
|
6
6
|
import '@automerge/automerge/slim';
|
|
7
7
|
|
|
8
|
+
/** HTTP failure details shared by the SDK and CLI. No retry is implied. */
|
|
9
|
+
declare class GranularApiError extends Error {
|
|
10
|
+
readonly status: number;
|
|
11
|
+
readonly path: string;
|
|
12
|
+
readonly code: string;
|
|
13
|
+
readonly body?: unknown;
|
|
14
|
+
readonly idempotencyKey?: string;
|
|
15
|
+
constructor(message: string, status: number, path: string, details?: {
|
|
16
|
+
body?: string;
|
|
17
|
+
idempotencyKey?: string;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
8
21
|
type EnvironmentSetupResponse = {
|
|
9
22
|
environment?: Partial<EnvironmentData>;
|
|
10
23
|
setup?: EnvironmentData["setup"] | null;
|
|
@@ -397,4 +410,4 @@ interface ArtifactSurfaceModel {
|
|
|
397
410
|
}
|
|
398
411
|
declare function selectArtifactSurface(artifact: SessionArtifactRecord, context?: ArtifactSurfaceContext): ArtifactSurfaceModel;
|
|
399
412
|
|
|
400
|
-
export { type ArtifactSurfaceAction, type ArtifactSurfaceActionId, type ArtifactSurfaceContext, type ArtifactSurfaceKind, type ArtifactSurfaceModel, ArtifactWorkflow, ArtifactWorkflowNode, ArtifactWorkflowNodeStatus, CommitDeclaration, CommitReceipt, CommitTransitionInvocation, CommitTransitionOutcomeDeclaration, type CommitTransport, type ConditionalPolicySpec, type DefinedStateMachine, EffectCommitRequest, EffectHandlerContext, EndpointMode, EnvironmentData, EnvironmentRecordImportSummary, type EnvironmentSetupPollInput, type EnvironmentSetupProgress, type EnvironmentSetupRequestError, type EnvironmentSetupResponse, FeedItem, FeedPublishTransport, type JobPresentation, type LimitPolicySpec, ManifestContent, ManifestEffectMetamodelSpec, type NormalizedPromptChoiceOption, type PermissionActionSpec, type PermissionPolicySpec, type PermissionProfileFile, type PolicyDecision, type PolicyEvaluationContext, type PolicyOutcome, ProjectionMapper, ProjectionResult, Prompt, RecordObjectOptions, type RecordSnapshotCommitSource, ResolvedEffectBehaviors, SessionArtifactRecord, SessionHeapEntry, SessionHeapList, SessionHeapSnapshot, SessionTranscriptEntry, type StateMachineDefinition, ToolWithHandler, type ValidationRuleEvaluationInput, type ValidationRuleEvaluationResult, artifactReviewedOperation, assertArtifactWorkflow, buildSessionTranscript, buildSessionTranscriptFromFeedItems, canInspectArtifactWorkflowNode, canonicalizeCommitValue, changedRecordSnapshots, defineEffect, defineProjection, defineStateMachine, environmentSetupProgressFromError, environmentSetupProgressFromResponse, evaluateValidationRule, extractPromptTokens, getArtifactWorkflowNavigationLeaves, getArtifactWorkflowNavigationTarget, getArtifactWorkflowNodes, getCurrentArtifactWorkflowNode, invokeRegisteredEffect, isArtifactWorkflowNodeNavigableLeaf, isArtifactWorkflowNodeTerminal, isLocalApiUrl, normalizeEffectBehaviors, normalizePrompt, normalizePromptChoiceOption, normalizePromptText, normalizePromptType, pollEnvironmentSetup, projectArtifactWorkflow, projectRecordSnapshotMutation, requireArtifactWorkflow, requireArtifactWorkflowResult, resolveApiUrl, resolveAuthTokenForApiUrl, resolveJobPresentation, resolvePromptAnswer, scorePromptChoiceMatch, selectArtifactSurface, validateProjectionResult, validationRuleFailureMessage };
|
|
413
|
+
export { type ArtifactSurfaceAction, type ArtifactSurfaceActionId, type ArtifactSurfaceContext, type ArtifactSurfaceKind, type ArtifactSurfaceModel, ArtifactWorkflow, ArtifactWorkflowNode, ArtifactWorkflowNodeStatus, CommitDeclaration, CommitReceipt, CommitTransitionInvocation, CommitTransitionOutcomeDeclaration, type CommitTransport, type ConditionalPolicySpec, type DefinedStateMachine, EffectCommitRequest, EffectHandlerContext, EndpointMode, EnvironmentData, EnvironmentRecordImportSummary, type EnvironmentSetupPollInput, type EnvironmentSetupProgress, type EnvironmentSetupRequestError, type EnvironmentSetupResponse, FeedItem, FeedPublishTransport, GranularApiError, type JobPresentation, type LimitPolicySpec, ManifestContent, ManifestEffectMetamodelSpec, type NormalizedPromptChoiceOption, type PermissionActionSpec, type PermissionPolicySpec, type PermissionProfileFile, type PolicyDecision, type PolicyEvaluationContext, type PolicyOutcome, ProjectionMapper, ProjectionResult, Prompt, RecordObjectOptions, type RecordSnapshotCommitSource, ResolvedEffectBehaviors, SessionArtifactRecord, SessionHeapEntry, SessionHeapList, SessionHeapSnapshot, SessionTranscriptEntry, type StateMachineDefinition, ToolWithHandler, type ValidationRuleEvaluationInput, type ValidationRuleEvaluationResult, artifactReviewedOperation, assertArtifactWorkflow, buildSessionTranscript, buildSessionTranscriptFromFeedItems, canInspectArtifactWorkflowNode, canonicalizeCommitValue, changedRecordSnapshots, defineEffect, defineProjection, defineStateMachine, environmentSetupProgressFromError, environmentSetupProgressFromResponse, evaluateValidationRule, extractPromptTokens, getArtifactWorkflowNavigationLeaves, getArtifactWorkflowNavigationTarget, getArtifactWorkflowNodes, getCurrentArtifactWorkflowNode, invokeRegisteredEffect, isArtifactWorkflowNodeNavigableLeaf, isArtifactWorkflowNodeTerminal, isLocalApiUrl, normalizeEffectBehaviors, normalizePrompt, normalizePromptChoiceOption, normalizePromptText, normalizePromptType, pollEnvironmentSetup, projectArtifactWorkflow, projectRecordSnapshotMutation, requireArtifactWorkflow, requireArtifactWorkflowResult, resolveApiUrl, resolveAuthTokenForApiUrl, resolveJobPresentation, resolvePromptAnswer, scorePromptChoiceMatch, selectArtifactSurface, validateProjectionResult, validationRuleFailureMessage };
|
package/dist/index.js
CHANGED
|
@@ -4012,6 +4012,34 @@ var init_wrapper = __esm({
|
|
|
4012
4012
|
}
|
|
4013
4013
|
});
|
|
4014
4014
|
|
|
4015
|
+
// src/api-error.ts
|
|
4016
|
+
var GranularApiError = class extends Error {
|
|
4017
|
+
constructor(message, status, path, details = {}) {
|
|
4018
|
+
super(message);
|
|
4019
|
+
this.status = status;
|
|
4020
|
+
this.path = path;
|
|
4021
|
+
this.name = "GranularApiError";
|
|
4022
|
+
this.idempotencyKey = details.idempotencyKey;
|
|
4023
|
+
let body = details.body;
|
|
4024
|
+
if (typeof body === "string") {
|
|
4025
|
+
try {
|
|
4026
|
+
body = JSON.parse(body);
|
|
4027
|
+
} catch {
|
|
4028
|
+
}
|
|
4029
|
+
}
|
|
4030
|
+
this.body = body;
|
|
4031
|
+
const payload = body && typeof body === "object" ? body : void 0;
|
|
4032
|
+
const firstError = Array.isArray(payload?.errors) ? payload.errors[0] : void 0;
|
|
4033
|
+
const extensions = firstError && typeof firstError === "object" ? firstError.extensions : void 0;
|
|
4034
|
+
this.code = [payload?.code, extensions?.code, firstError?.code].find(
|
|
4035
|
+
(value) => typeof value === "string" && value.length > 0
|
|
4036
|
+
) ?? `HTTP_${status}`;
|
|
4037
|
+
}
|
|
4038
|
+
code;
|
|
4039
|
+
body;
|
|
4040
|
+
idempotencyKey;
|
|
4041
|
+
};
|
|
4042
|
+
|
|
4015
4043
|
// ../../node_modules/zod/v3/external.js
|
|
4016
4044
|
var external_exports = {};
|
|
4017
4045
|
__export(external_exports, {
|
|
@@ -15228,8 +15256,11 @@ import { ${tools[0]?.name || "example"} } from "@granular/actions/backend";
|
|
|
15228
15256
|
this.emit("prompt:answered", { ...prompt, status: "answered" });
|
|
15229
15257
|
return;
|
|
15230
15258
|
}
|
|
15259
|
+
const previous = this.promptCache.get(prompt.id);
|
|
15231
15260
|
this.promptCache.set(prompt.id, prompt);
|
|
15232
|
-
|
|
15261
|
+
if (!previous || promptSnapshotFingerprint(previous) !== promptSnapshotFingerprint(prompt)) {
|
|
15262
|
+
this.emit("prompt", prompt);
|
|
15263
|
+
}
|
|
15233
15264
|
};
|
|
15234
15265
|
this.client.on("prompt", emitPrompt);
|
|
15235
15266
|
this.client.on("prompt.request", emitPrompt);
|
|
@@ -18063,8 +18094,12 @@ var Environment = class _Environment {
|
|
|
18063
18094
|
}
|
|
18064
18095
|
});
|
|
18065
18096
|
if (!response.ok) {
|
|
18066
|
-
|
|
18067
|
-
|
|
18097
|
+
const errorText = await response.text();
|
|
18098
|
+
throw new GranularApiError(
|
|
18099
|
+
`Control Plane API Error (${response.status}): ${errorText}`,
|
|
18100
|
+
response.status,
|
|
18101
|
+
path,
|
|
18102
|
+
{ body: errorText }
|
|
18068
18103
|
);
|
|
18069
18104
|
}
|
|
18070
18105
|
return response.json();
|
|
@@ -18121,12 +18156,12 @@ var Environment = class _Environment {
|
|
|
18121
18156
|
* );
|
|
18122
18157
|
* ```
|
|
18123
18158
|
*/
|
|
18124
|
-
async graphql(query, variables) {
|
|
18159
|
+
async graphql(query, variables, options) {
|
|
18125
18160
|
const authToken = await this.resolveAuthToken();
|
|
18126
18161
|
if (this._beforeMutationSend && isGraphQLMutationDocument(query)) {
|
|
18127
18162
|
this._beforeMutationSend?.();
|
|
18128
18163
|
}
|
|
18129
|
-
const idempotencyKey = this._graphqlIdempotencyKey?.(query, variables)
|
|
18164
|
+
const idempotencyKey = options?.idempotencyKey || this._graphqlIdempotencyKey?.(query, variables) || `gr1:${Date.now()}:${crypto.randomUUID()}`;
|
|
18130
18165
|
const response = await fetch(this._apiEndpoint, {
|
|
18131
18166
|
method: "POST",
|
|
18132
18167
|
headers: {
|
|
@@ -18137,12 +18172,18 @@ var Environment = class _Environment {
|
|
|
18137
18172
|
body: JSON.stringify({
|
|
18138
18173
|
environmentId: this.environmentId,
|
|
18139
18174
|
query,
|
|
18140
|
-
variables
|
|
18175
|
+
variables,
|
|
18176
|
+
...options?.readPreference ? { readPreference: options.readPreference } : {}
|
|
18141
18177
|
})
|
|
18142
18178
|
});
|
|
18143
18179
|
if (!response.ok) {
|
|
18144
18180
|
const errorText = await response.text();
|
|
18145
|
-
throw new
|
|
18181
|
+
throw new GranularApiError(
|
|
18182
|
+
`GraphQL API Error (${response.status}): ${errorText}`,
|
|
18183
|
+
response.status,
|
|
18184
|
+
this._apiEndpoint,
|
|
18185
|
+
{ body: errorText, idempotencyKey }
|
|
18186
|
+
);
|
|
18146
18187
|
}
|
|
18147
18188
|
return response.json();
|
|
18148
18189
|
}
|
|
@@ -20294,7 +20335,7 @@ var Granular = class _Granular {
|
|
|
20294
20335
|
const outdatedMatches = this.sortEnvironmentsByRecency(
|
|
20295
20336
|
userEnvironments.filter((environment2) => environment2.tagId === tag.tagId)
|
|
20296
20337
|
);
|
|
20297
|
-
if (outdatedMatches.length > 0 && options.createFreshIfOutdated !== true) {
|
|
20338
|
+
if (!resetKey && outdatedMatches.length > 0 && options.createFreshIfOutdated !== true) {
|
|
20298
20339
|
requireMatchingEnvironmentProfile(outdatedMatches[0]);
|
|
20299
20340
|
const environment2 = requireMatchingEnvironmentProfile(
|
|
20300
20341
|
await activate(outdatedMatches[0])
|
|
@@ -21458,6 +21499,9 @@ var Granular = class _Granular {
|
|
|
21458
21499
|
)
|
|
21459
21500
|
);
|
|
21460
21501
|
},
|
|
21502
|
+
/** Retire a settled environment and release its named slot. Ordinary
|
|
21503
|
+
* access is revoked; durable graph data and history are retained.
|
|
21504
|
+
* Mounted or unsettled environments reject with HTTP409. */
|
|
21461
21505
|
delete: async (environmentId) => {
|
|
21462
21506
|
return this.request(
|
|
21463
21507
|
`/control/environments/${environmentId}`,
|
|
@@ -21672,7 +21716,12 @@ var Granular = class _Granular {
|
|
|
21672
21716
|
await sleep(LOCAL_CONTROL_REQUEST_RETRY_DELAY_MS * attempt);
|
|
21673
21717
|
continue;
|
|
21674
21718
|
}
|
|
21675
|
-
throw new
|
|
21719
|
+
throw new GranularApiError(
|
|
21720
|
+
`Granular API Error (${response.status}): ${errorText}`,
|
|
21721
|
+
response.status,
|
|
21722
|
+
path,
|
|
21723
|
+
{ body: errorText }
|
|
21724
|
+
);
|
|
21676
21725
|
}
|
|
21677
21726
|
throw new Error(`Granular API Error: exhausted retries for ${url}`);
|
|
21678
21727
|
}
|
|
@@ -25195,6 +25244,7 @@ exports.Environment = Environment;
|
|
|
25195
25244
|
exports.EnvironmentSession = EnvironmentSession;
|
|
25196
25245
|
exports.GRANULAR_FEED_DIAGNOSTIC_EVENT = GRANULAR_FEED_DIAGNOSTIC_EVENT;
|
|
25197
25246
|
exports.Granular = Granular;
|
|
25247
|
+
exports.GranularApiError = GranularApiError;
|
|
25198
25248
|
exports.OPENAI_MODEL_PRICING_USD_PER_MILLION = OPENAI_MODEL_PRICING_USD_PER_MILLION;
|
|
25199
25249
|
exports.OntologyHandle = OntologyHandle;
|
|
25200
25250
|
exports.Session = Session;
|