@granular-software/sdk 0.4.75 → 0.4.76
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 +54 -8
- package/dist/agent-evals.js.map +1 -1
- package/dist/agent-evals.mjs +54 -8
- package/dist/agent-evals.mjs.map +1 -1
- package/dist/cli/index.js +55 -9
- 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 +55 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +55 -9
- 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)
|
|
@@ -25967,8 +25995,12 @@ var Environment = class _Environment {
|
|
|
25967
25995
|
}
|
|
25968
25996
|
});
|
|
25969
25997
|
if (!response.ok) {
|
|
25970
|
-
|
|
25971
|
-
|
|
25998
|
+
const errorText = await response.text();
|
|
25999
|
+
throw new GranularApiError(
|
|
26000
|
+
`Control Plane API Error (${response.status}): ${errorText}`,
|
|
26001
|
+
response.status,
|
|
26002
|
+
path7,
|
|
26003
|
+
{ body: errorText }
|
|
25972
26004
|
);
|
|
25973
26005
|
}
|
|
25974
26006
|
return response.json();
|
|
@@ -26025,12 +26057,12 @@ var Environment = class _Environment {
|
|
|
26025
26057
|
* );
|
|
26026
26058
|
* ```
|
|
26027
26059
|
*/
|
|
26028
|
-
async graphql(query, variables) {
|
|
26060
|
+
async graphql(query, variables, options) {
|
|
26029
26061
|
const authToken = await this.resolveAuthToken();
|
|
26030
26062
|
if (this._beforeMutationSend && isGraphQLMutationDocument(query)) {
|
|
26031
26063
|
this._beforeMutationSend?.();
|
|
26032
26064
|
}
|
|
26033
|
-
const idempotencyKey = this._graphqlIdempotencyKey?.(query, variables)
|
|
26065
|
+
const idempotencyKey = options?.idempotencyKey || this._graphqlIdempotencyKey?.(query, variables) || `gr1:${Date.now()}:${crypto.randomUUID()}`;
|
|
26034
26066
|
const response = await fetch(this._apiEndpoint, {
|
|
26035
26067
|
method: "POST",
|
|
26036
26068
|
headers: {
|
|
@@ -26041,12 +26073,18 @@ var Environment = class _Environment {
|
|
|
26041
26073
|
body: JSON.stringify({
|
|
26042
26074
|
environmentId: this.environmentId,
|
|
26043
26075
|
query,
|
|
26044
|
-
variables
|
|
26076
|
+
variables,
|
|
26077
|
+
...options?.readPreference ? { readPreference: options.readPreference } : {}
|
|
26045
26078
|
})
|
|
26046
26079
|
});
|
|
26047
26080
|
if (!response.ok) {
|
|
26048
26081
|
const errorText = await response.text();
|
|
26049
|
-
throw new
|
|
26082
|
+
throw new GranularApiError(
|
|
26083
|
+
`GraphQL API Error (${response.status}): ${errorText}`,
|
|
26084
|
+
response.status,
|
|
26085
|
+
this._apiEndpoint,
|
|
26086
|
+
{ body: errorText, idempotencyKey }
|
|
26087
|
+
);
|
|
26050
26088
|
}
|
|
26051
26089
|
return response.json();
|
|
26052
26090
|
}
|
|
@@ -28198,7 +28236,7 @@ var Granular = class _Granular {
|
|
|
28198
28236
|
const outdatedMatches = this.sortEnvironmentsByRecency(
|
|
28199
28237
|
userEnvironments.filter((environment2) => environment2.tagId === tag2.tagId)
|
|
28200
28238
|
);
|
|
28201
|
-
if (outdatedMatches.length > 0 && options.createFreshIfOutdated !== true) {
|
|
28239
|
+
if (!resetKey && outdatedMatches.length > 0 && options.createFreshIfOutdated !== true) {
|
|
28202
28240
|
requireMatchingEnvironmentProfile(outdatedMatches[0]);
|
|
28203
28241
|
const environment2 = requireMatchingEnvironmentProfile(
|
|
28204
28242
|
await activate(outdatedMatches[0])
|
|
@@ -29362,6 +29400,9 @@ var Granular = class _Granular {
|
|
|
29362
29400
|
)
|
|
29363
29401
|
);
|
|
29364
29402
|
},
|
|
29403
|
+
/** Retire a settled environment and release its named slot. Ordinary
|
|
29404
|
+
* access is revoked; durable graph data and history are retained.
|
|
29405
|
+
* Mounted or unsettled environments reject with HTTP409. */
|
|
29365
29406
|
delete: async (environmentId) => {
|
|
29366
29407
|
return this.request(
|
|
29367
29408
|
`/control/environments/${environmentId}`,
|
|
@@ -29576,7 +29617,12 @@ var Granular = class _Granular {
|
|
|
29576
29617
|
await sleep(LOCAL_CONTROL_REQUEST_RETRY_DELAY_MS * attempt);
|
|
29577
29618
|
continue;
|
|
29578
29619
|
}
|
|
29579
|
-
throw new
|
|
29620
|
+
throw new GranularApiError(
|
|
29621
|
+
`Granular API Error (${response.status}): ${errorText}`,
|
|
29622
|
+
response.status,
|
|
29623
|
+
path7,
|
|
29624
|
+
{ body: errorText }
|
|
29625
|
+
);
|
|
29580
29626
|
}
|
|
29581
29627
|
throw new Error(`Granular API Error: exhausted retries for ${url}`);
|
|
29582
29628
|
}
|
|
@@ -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, {
|
|
@@ -18063,8 +18091,12 @@ var Environment = class _Environment {
|
|
|
18063
18091
|
}
|
|
18064
18092
|
});
|
|
18065
18093
|
if (!response.ok) {
|
|
18066
|
-
|
|
18067
|
-
|
|
18094
|
+
const errorText = await response.text();
|
|
18095
|
+
throw new GranularApiError(
|
|
18096
|
+
`Control Plane API Error (${response.status}): ${errorText}`,
|
|
18097
|
+
response.status,
|
|
18098
|
+
path,
|
|
18099
|
+
{ body: errorText }
|
|
18068
18100
|
);
|
|
18069
18101
|
}
|
|
18070
18102
|
return response.json();
|
|
@@ -18121,12 +18153,12 @@ var Environment = class _Environment {
|
|
|
18121
18153
|
* );
|
|
18122
18154
|
* ```
|
|
18123
18155
|
*/
|
|
18124
|
-
async graphql(query, variables) {
|
|
18156
|
+
async graphql(query, variables, options) {
|
|
18125
18157
|
const authToken = await this.resolveAuthToken();
|
|
18126
18158
|
if (this._beforeMutationSend && isGraphQLMutationDocument(query)) {
|
|
18127
18159
|
this._beforeMutationSend?.();
|
|
18128
18160
|
}
|
|
18129
|
-
const idempotencyKey = this._graphqlIdempotencyKey?.(query, variables)
|
|
18161
|
+
const idempotencyKey = options?.idempotencyKey || this._graphqlIdempotencyKey?.(query, variables) || `gr1:${Date.now()}:${crypto.randomUUID()}`;
|
|
18130
18162
|
const response = await fetch(this._apiEndpoint, {
|
|
18131
18163
|
method: "POST",
|
|
18132
18164
|
headers: {
|
|
@@ -18137,12 +18169,18 @@ var Environment = class _Environment {
|
|
|
18137
18169
|
body: JSON.stringify({
|
|
18138
18170
|
environmentId: this.environmentId,
|
|
18139
18171
|
query,
|
|
18140
|
-
variables
|
|
18172
|
+
variables,
|
|
18173
|
+
...options?.readPreference ? { readPreference: options.readPreference } : {}
|
|
18141
18174
|
})
|
|
18142
18175
|
});
|
|
18143
18176
|
if (!response.ok) {
|
|
18144
18177
|
const errorText = await response.text();
|
|
18145
|
-
throw new
|
|
18178
|
+
throw new GranularApiError(
|
|
18179
|
+
`GraphQL API Error (${response.status}): ${errorText}`,
|
|
18180
|
+
response.status,
|
|
18181
|
+
this._apiEndpoint,
|
|
18182
|
+
{ body: errorText, idempotencyKey }
|
|
18183
|
+
);
|
|
18146
18184
|
}
|
|
18147
18185
|
return response.json();
|
|
18148
18186
|
}
|
|
@@ -20294,7 +20332,7 @@ var Granular = class _Granular {
|
|
|
20294
20332
|
const outdatedMatches = this.sortEnvironmentsByRecency(
|
|
20295
20333
|
userEnvironments.filter((environment2) => environment2.tagId === tag.tagId)
|
|
20296
20334
|
);
|
|
20297
|
-
if (outdatedMatches.length > 0 && options.createFreshIfOutdated !== true) {
|
|
20335
|
+
if (!resetKey && outdatedMatches.length > 0 && options.createFreshIfOutdated !== true) {
|
|
20298
20336
|
requireMatchingEnvironmentProfile(outdatedMatches[0]);
|
|
20299
20337
|
const environment2 = requireMatchingEnvironmentProfile(
|
|
20300
20338
|
await activate(outdatedMatches[0])
|
|
@@ -21458,6 +21496,9 @@ var Granular = class _Granular {
|
|
|
21458
21496
|
)
|
|
21459
21497
|
);
|
|
21460
21498
|
},
|
|
21499
|
+
/** Retire a settled environment and release its named slot. Ordinary
|
|
21500
|
+
* access is revoked; durable graph data and history are retained.
|
|
21501
|
+
* Mounted or unsettled environments reject with HTTP409. */
|
|
21461
21502
|
delete: async (environmentId) => {
|
|
21462
21503
|
return this.request(
|
|
21463
21504
|
`/control/environments/${environmentId}`,
|
|
@@ -21672,7 +21713,12 @@ var Granular = class _Granular {
|
|
|
21672
21713
|
await sleep(LOCAL_CONTROL_REQUEST_RETRY_DELAY_MS * attempt);
|
|
21673
21714
|
continue;
|
|
21674
21715
|
}
|
|
21675
|
-
throw new
|
|
21716
|
+
throw new GranularApiError(
|
|
21717
|
+
`Granular API Error (${response.status}): ${errorText}`,
|
|
21718
|
+
response.status,
|
|
21719
|
+
path,
|
|
21720
|
+
{ body: errorText }
|
|
21721
|
+
);
|
|
21676
21722
|
}
|
|
21677
21723
|
throw new Error(`Granular API Error: exhausted retries for ${url}`);
|
|
21678
21724
|
}
|
|
@@ -25195,6 +25241,7 @@ exports.Environment = Environment;
|
|
|
25195
25241
|
exports.EnvironmentSession = EnvironmentSession;
|
|
25196
25242
|
exports.GRANULAR_FEED_DIAGNOSTIC_EVENT = GRANULAR_FEED_DIAGNOSTIC_EVENT;
|
|
25197
25243
|
exports.Granular = Granular;
|
|
25244
|
+
exports.GranularApiError = GranularApiError;
|
|
25198
25245
|
exports.OPENAI_MODEL_PRICING_USD_PER_MILLION = OPENAI_MODEL_PRICING_USD_PER_MILLION;
|
|
25199
25246
|
exports.OntologyHandle = OntologyHandle;
|
|
25200
25247
|
exports.Session = Session;
|