@granular-software/sdk 0.4.67 → 0.4.68
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 +2 -2
- package/dist/agent-evals.d.ts +2 -2
- package/dist/{client-BT1DJddL.d.ts → client-BNpPrX2X.d.mts} +1 -1
- package/dist/{client-BkX2cb20.d.mts → client-C-GYQSJC.d.ts} +1 -1
- package/dist/index.d.mts +52 -4
- package/dist/index.d.ts +52 -4
- package/dist/index.js +255 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +253 -1
- package/dist/index.mjs.map +1 -1
- package/dist/{spend-D4r0SA-H.d.mts → spend-BDGtgZtl.d.mts} +1 -1
- package/dist/{spend-D4r0SA-H.d.ts → spend-BDGtgZtl.d.ts} +1 -1
- package/dist/spend.d.mts +1 -1
- package/dist/spend.d.ts +1 -1
- package/package.json +1 -1
package/dist/agent-evals.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as EnvironmentSession, G as Granular } from './client-
|
|
2
|
-
import {
|
|
1
|
+
import { a as EnvironmentSession, G as Granular } from './client-BNpPrX2X.mjs';
|
|
2
|
+
import { aE as GranularSpendContext, az as OpenAITokenSpend, n as Prompt, h as RecordObjectOptions, i as ManifestContent, m as SessionHeapSnapshot, T as ToolWithHandler, a_ as ConnectOptions, bo as CreateEnvironmentData, aT as GranularOptions } from './spend-BDGtgZtl.mjs';
|
|
3
3
|
import { GranularAgentToolInfo, GeneratedJobCodeIssue, BuildGranularAgentSystemPromptInput, HarnessRenderedPrompt, HarnessRenderedContinuation, HarnessControllerBudgets } from './agent-harness.mjs';
|
|
4
4
|
import '@automerge/automerge';
|
|
5
5
|
import '@automerge/automerge/slim';
|
package/dist/agent-evals.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as EnvironmentSession, G as Granular } from './client-
|
|
2
|
-
import {
|
|
1
|
+
import { a as EnvironmentSession, G as Granular } from './client-C-GYQSJC.js';
|
|
2
|
+
import { aE as GranularSpendContext, az as OpenAITokenSpend, n as Prompt, h as RecordObjectOptions, i as ManifestContent, m as SessionHeapSnapshot, T as ToolWithHandler, a_ as ConnectOptions, bo as CreateEnvironmentData, aT as GranularOptions } from './spend-BDGtgZtl.js';
|
|
3
3
|
import { GranularAgentToolInfo, GeneratedJobCodeIssue, BuildGranularAgentSystemPromptInput, HarnessRenderedPrompt, HarnessRenderedContinuation, HarnessControllerBudgets } from './agent-harness.js';
|
|
4
4
|
import '@automerge/automerge';
|
|
5
5
|
import '@automerge/automerge/slim';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { df as WSClientOptions, a7 as SessionFeedApi, bb as GranularQuotaProgress, T as ToolWithHandler, q as PublishToolsResult, ch as Job, r as ToolHandler, I as InstanceToolHandler, ck as UserMessageInput, cl as UserMessageAppendResult, c4 as EffectInfo, n as Prompt, c3 as ToolInfo, c6 as EffectsChangedEvent, c5 as ToolsChangedEvent, D as DomainState, aa as FeedListTransport, aT as GranularOptions, dM as EnvironmentImporter, aW as RecordUserOptions, aV as User, aY as OpenEnvironmentOptions, E as EnvironmentData, aS as AccessTokenProvider, bl as BuildPolicy, dJ as EnvironmentSetupSummary, b2 as ConversationSessionListOptions, b0 as ConversationSessionInfo, b3 as ConversationSessionListResponse, a$ as CreateSessionOptions, h as RecordObjectOptions, dw as RecordObjectResult, dy as RecordObjectsOptions, dF as RecordImport, dB as RecordImportStatus, dE as RecordImportItem, a as EnvironmentRecordImportSummary, cf as EnvironmentFeedbackRecord, m as SessionHeapSnapshot, d3 as SessionDocumentResult, cm as AssistantReplyPublicationInput, cn as AssistantReplyPublicationResult, d4 as SessionCollectionListOptions, d6 as SessionCollectionListResult, cq as SessionTimelineEvent, d5 as SessionJobListOptions, cY as SessionJobRecord, bP as SessionMutationView, cz as SessionArtifactListOptions, cy as SessionArtifactRecord, cB as SessionArtifactRelationshipOptionsInput, cD as SessionArtifactRelationshipOptionsResult, cE as SessionArtifactRelationshipCreateInput, cA as SessionArtifactValidationResult, cG as SessionArtifactExecutionOptions, cF as SessionArtifactExecutionResult, cH as SessionArtifactApprovalOptions, cR as RecordManualActionInput, cT as ManualActionRecordResult, cU as ManualActionListOptions, cS as ManualActionOccurrence, cW as ManualActionSuggestionOptions, cV as ManualActionSuggestion, cK as ArtifactApprovalTaskListOptions, cJ as ArtifactApprovalTask, cL as ArtifactApprovalDecisionInput, cM as ArtifactApprovalDecisionResult, cu as SessionFileRecord, cX as SessionFileUploadOptions, S as SessionHeapEntry, k as SessionHeapList, c$ as SessionHeapVariable, o as SessionTranscriptEntry, ee as GraphQLResult, d1 as RecordSearchOptions, d0 as RecordSearchResult, d2 as RecordMentionInput, dp as DefineRelationshipOptions, dn as RelationshipInfo, dm as ModelRef, i as ManifestContent, dt as EnvironmentStateUpdateInput, dr as EnvironmentStateTarget, dv as EnvironmentStateProxy, dA as RecordImportOptions, db as UserEnvironmentStateOptions, da as UserEnvironmentState, dc as MarkUserEnvironmentReadOptions, d as ProjectionMapper, bI as EffectProjectionResult, bN as ExternalCommitOptions, C as CommitReceipt, bJ as TransitionProjectionResult, bO as ObservationReceipt, aZ as AdoptEnvironmentOptions, a_ as ConnectOptions, dH as RunEnvironmentImporterOptions, aF as OpenAIUsageSpendEvent, aE as GranularSpendContext, aH as RecordOpenAIUsageSpendResult, be as SandboxListResponse, bc as Sandbox, bd as CreateSandboxData, eg as DeleteResponse, bg as PermissionProfile, bh as CreatePermissionProfileData, bo as CreateEnvironmentData, eh as StreamEvent, ei as StreamSubscription, ej as StreamStats, aX as Subject, bk as AssignmentListResponse } from './spend-BDGtgZtl.mjs';
|
|
2
2
|
import * as Automerge from '@automerge/automerge';
|
|
3
3
|
import { Doc } from '@automerge/automerge/slim';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { df as WSClientOptions, a7 as SessionFeedApi, bb as GranularQuotaProgress, T as ToolWithHandler, q as PublishToolsResult, ch as Job, r as ToolHandler, I as InstanceToolHandler, ck as UserMessageInput, cl as UserMessageAppendResult, c4 as EffectInfo, n as Prompt, c3 as ToolInfo, c6 as EffectsChangedEvent, c5 as ToolsChangedEvent, D as DomainState, aa as FeedListTransport, aT as GranularOptions, dM as EnvironmentImporter, aW as RecordUserOptions, aV as User, aY as OpenEnvironmentOptions, E as EnvironmentData, aS as AccessTokenProvider, bl as BuildPolicy, dJ as EnvironmentSetupSummary, b2 as ConversationSessionListOptions, b0 as ConversationSessionInfo, b3 as ConversationSessionListResponse, a$ as CreateSessionOptions, h as RecordObjectOptions, dw as RecordObjectResult, dy as RecordObjectsOptions, dF as RecordImport, dB as RecordImportStatus, dE as RecordImportItem, a as EnvironmentRecordImportSummary, cf as EnvironmentFeedbackRecord, m as SessionHeapSnapshot, d3 as SessionDocumentResult, cm as AssistantReplyPublicationInput, cn as AssistantReplyPublicationResult, d4 as SessionCollectionListOptions, d6 as SessionCollectionListResult, cq as SessionTimelineEvent, d5 as SessionJobListOptions, cY as SessionJobRecord, bP as SessionMutationView, cz as SessionArtifactListOptions, cy as SessionArtifactRecord, cB as SessionArtifactRelationshipOptionsInput, cD as SessionArtifactRelationshipOptionsResult, cE as SessionArtifactRelationshipCreateInput, cA as SessionArtifactValidationResult, cG as SessionArtifactExecutionOptions, cF as SessionArtifactExecutionResult, cH as SessionArtifactApprovalOptions, cR as RecordManualActionInput, cT as ManualActionRecordResult, cU as ManualActionListOptions, cS as ManualActionOccurrence, cW as ManualActionSuggestionOptions, cV as ManualActionSuggestion, cK as ArtifactApprovalTaskListOptions, cJ as ArtifactApprovalTask, cL as ArtifactApprovalDecisionInput, cM as ArtifactApprovalDecisionResult, cu as SessionFileRecord, cX as SessionFileUploadOptions, S as SessionHeapEntry, k as SessionHeapList, c$ as SessionHeapVariable, o as SessionTranscriptEntry, ee as GraphQLResult, d1 as RecordSearchOptions, d0 as RecordSearchResult, d2 as RecordMentionInput, dp as DefineRelationshipOptions, dn as RelationshipInfo, dm as ModelRef, i as ManifestContent, dt as EnvironmentStateUpdateInput, dr as EnvironmentStateTarget, dv as EnvironmentStateProxy, dA as RecordImportOptions, db as UserEnvironmentStateOptions, da as UserEnvironmentState, dc as MarkUserEnvironmentReadOptions, d as ProjectionMapper, bI as EffectProjectionResult, bN as ExternalCommitOptions, C as CommitReceipt, bJ as TransitionProjectionResult, bO as ObservationReceipt, aZ as AdoptEnvironmentOptions, a_ as ConnectOptions, dH as RunEnvironmentImporterOptions, aF as OpenAIUsageSpendEvent, aE as GranularSpendContext, aH as RecordOpenAIUsageSpendResult, be as SandboxListResponse, bc as Sandbox, bd as CreateSandboxData, eg as DeleteResponse, bg as PermissionProfile, bh as CreatePermissionProfileData, bo as CreateEnvironmentData, eh as StreamEvent, ei as StreamSubscription, ej as StreamStats, aX as Subject, bk as AssignmentListResponse } from './spend-BDGtgZtl.js';
|
|
2
2
|
import * as Automerge from '@automerge/automerge';
|
|
3
3
|
import { Doc } from '@automerge/automerge/slim';
|
|
4
4
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,58 @@
|
|
|
1
|
-
export { E as Environment, a as EnvironmentSession, G as Granular, O as OntologyHandle, S as Session, W as WSClient, i as isGraphQLMutationDocument } from './client-
|
|
2
|
-
import { E as
|
|
3
|
-
export { ef as APIError,
|
|
1
|
+
export { E as Environment, a as EnvironmentSession, G as Granular, O as OntologyHandle, S as Session, W as WSClient, i as isGraphQLMutationDocument } from './client-BNpPrX2X.mjs';
|
|
2
|
+
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 } from './spend-BDGtgZtl.mjs';
|
|
3
|
+
export { ef as APIError, aS as AccessTokenProvider, Y as ActionSuggestionFeedItem, aZ as AdoptEnvironmentOptions, bK as AgentCommitStatus, cL as ArtifactApprovalDecisionInput, cM as ArtifactApprovalDecisionResult, cJ as ArtifactApprovalTask, cK as ArtifactApprovalTaskListOptions, cI as ArtifactApprovalTaskStatus, U as ArtifactFeedItem, b_ as ArtifactOptionsHandler, bj as Assignment, bk as AssignmentListResponse, cm as AssistantReplyPublicationInput, cn as AssistantReplyPublicationResult, bH as BaseProjectionResult, bt as Build, bv as BuildListResponse, bl as BuildPolicy, bs as BuildStatus, bC as CanonicalProjectedRecord, bL as CommitChangeReceipt, bA as CommitSafeError, bM as CommitTransitionReceipt, aO as ConditionIR, a_ as ConnectOptions, b0 as ConversationSessionInfo, b2 as ConversationSessionListOptions, b3 as ConversationSessionListResponse, b1 as ConversationSessionListStatus, bo as CreateEnvironmentData, bh as CreatePermissionProfileData, bd as CreateSandboxData, a$ as CreateSessionOptions, dp as DefineRelationshipOptions, eg as DeleteResponse, D as DomainState, bW as EffectArtifactOptionsInvocation, bY as EffectArtifactRelationshipOption, bZ as EffectArtifactRelationshipOptionsResult, bQ as EffectCommitContext, c7 as EffectHandler, c4 as EffectInfo, bX as EffectInvocationMetadata, bV as EffectInvocationMode, bI as EffectProjectionResult, b$ as EffectSchema, c2 as EffectVersionSelector, c0 as EffectWithHandler, c6 as EffectsChangedEvent, cf as EnvironmentFeedbackRecord, dM as EnvironmentImporter, dL as EnvironmentImporterImportOptions, bp as EnvironmentListResponse, dK as EnvironmentSetupImporterClaim, dI as EnvironmentSetupLifecycleStatus, dJ as EnvironmentSetupSummary, dG as EnvironmentSetupTriggerReason, du as EnvironmentStateMachineProxy, ds as EnvironmentStateObservationInput, dv as EnvironmentStateProxy, dr as EnvironmentStateTarget, dt as EnvironmentStateUpdateInput, bN as ExternalCommitOptions, ac as FeedDiagnostic, ad as FeedDiagnosticListener, ak as FeedDocumentState, v as FeedFeedbackTone, V as FeedFileSource, u as FeedIconToken, z as FeedItemBase, x as FeedItemKind, a3 as FeedListOptions, aa as FeedListTransport, G as FeedObjectReference, a4 as FeedPage, av as FeedPublisher, a2 as FeedSnapshot, ab as FeedSnapshotRegressionReason, t as FeedSource, s as FeedSourceActor, a5 as FeedSubscribeOptions, a6 as FeedSubscriptionChange, H as FeedTableCell, J as FeedTableColumn, N as FeedTableProjection, L as FeedTableRow, K as FeedTableRowReference, y as FeedTarget, w as FeedTransientFeedbackTone, B as FeedbackFeedItem, W as FileFeedItem, ae as GRANULAR_FEED_DIAGNOSTIC_EVENT, aU as GranularAuth, aT as GranularOptions, ba as GranularQuotaPolicy, bb as GranularQuotaProgress, aE as GranularSpendContext, ee as GraphQLResult, c8 as InstanceEffectHandler, I as InstanceToolHandler, ch as Job, cd as JobFeedbackInput, cc as JobFeedbackMetadata, ce as JobFeedbackRecord, ca as JobFeedbackSentiment, cb as JobFeedbackToolCall, c9 as JobStatus, cg as JobSubmitResult, bq as Manifest, e4 as ManifestApprovalRequiredSpec, e5 as ManifestCreatesSpec, e2 as ManifestDryRunSpec, e8 as ManifestEffectDeclaration, e7 as ManifestEffectSchema, dP as ManifestEnumRuleSpec, ea as ManifestEventStreamDef, e9 as ManifestEventTypeDef, dQ as ManifestFilterBySpec, ec as ManifestImport, br as ManifestListResponse, eb as ManifestOperation, e1 as ManifestPostConditionSpec, dN as ManifestPropertySpec, e6 as ManifestRelationshipDef, e3 as ManifestReverseSpec, e0 as ManifestStateMachineSpec, dS as ManifestStateMachineStateSpec, d$ as ManifestStateMachineTransitionSpec, dU as ManifestStateTransitionActionSpec, dV as ManifestStateTransitionAssigneeSpec, dZ as ManifestStateTransitionExpectedOutcomeSpec, dT as ManifestStateTransitionInputBinding, d_ as ManifestStateTransitionOutcomeSpec, dY as ManifestStateTransitionPermissionSpec, dW as ManifestStateTransitionRelatedStateRequirementSpec, dX as ManifestStateTransitionRequirementsSpec, dO as ManifestValidationOperator, dR as ManifestValidationRuleSpec, ed as ManifestVolume, cU as ManualActionListOptions, cS as ManualActionOccurrence, cT as ManualActionRecordResult, cQ as ManualActionRelatedRecord, cO as ManualActionSource, cN as ManualActionStatus, cV as ManualActionSuggestion, cW as ManualActionSuggestionOptions, cP as ManualActionTarget, dc as MarkUserEnvironmentReadOptions, aR as MatchedPolicy, A as MessageFeedItem, dm as ModelRef, ay as NormalizedOpenAIUsage, X as NormalizedSuggestedArtifact, aA as OPENAI_MODEL_PRICING_USD_PER_MILLION, bD as ObjectProjectionChange, by as ObjectReference, O as ObjectsFeedItem, bO as ObservationReceipt, ax as OpenAIModelPricing, az as OpenAITokenSpend, aF as OpenAIUsageSpendEvent, aY as OpenEnvironmentOptions, bg as PermissionProfile, bi as PermissionProfileListResponse, bf as PermissionRules, aN as PolicyOperator, aP as PolicyOrigin, aM as PolicyPredicateSource, aQ as PolicyRuleIR, aL as PolicySource, bG as ProjectionChange, Z as PromptFeedItem, c1 as PublishEffectsResult, ar as PublishFeedbackOptions, q as PublishToolsResult, as as PublishTransientFeedbackOptions, b9 as QuotaLineItemFilter, b6 as QuotaPeriod, b5 as QuotaScopeType, b7 as QuotaStatus, dg as RPCRequest, dj as RPCRequestFromServer, dh as RPCResponse, dF as RecordImport, dE as RecordImportItem, dC as RecordImportItemStatus, dA as RecordImportOptions, dD as RecordImportStats, dB as RecordImportStatus, dz as RecordImportWriteMode, cR as RecordManualActionInput, d2 as RecordMentionInput, dw as RecordObjectResult, dq as RecordObjectStateValue, dx as RecordObjectsChunkInfo, dy as RecordObjectsOptions, aG as RecordOpenAIUsageSpendOptions, aH as RecordOpenAIUsageSpendResult, d1 as RecordSearchOptions, d0 as RecordSearchResult, aW as RecordUserOptions, dn as RelationshipInfo, bE as RelationshipProjectionChange, bU as ResolvedEffectApprovalRequired, bS as ResolvedEffectDryRun, bR as ResolvedEffectPostCondition, bT as ResolvedEffectReverse, dH as RunEnvironmentImporterOptions, bc as Sandbox, be as SandboxListResponse, bx as SemanticVersionDiff, bw as SemanticVersionDiffEntry, cH as SessionArtifactApprovalOptions, cx as SessionArtifactAutonomyPolicy, cG as SessionArtifactExecutionOptions, cF as SessionArtifactExecutionResult, cw as SessionArtifactKind, cz as SessionArtifactListOptions, cy as SessionArtifactRecord, cE as SessionArtifactRelationshipCreateInput, cC as SessionArtifactRelationshipOption, cB as SessionArtifactRelationshipOptionsInput, cD as SessionArtifactRelationshipOptionsResult, cv as SessionArtifactStatus, cA as SessionArtifactValidationResult, d4 as SessionCollectionListOptions, d6 as SessionCollectionListResult, d3 as SessionDocumentResult, a7 as SessionFeedApi, aq as SessionFeedController, aj as SessionFeedControllerOptions, cs as SessionFileKind, cu as SessionFileRecord, cr as SessionFileSource, ct as SessionFileStatus, cX as SessionFileUploadOptions, cZ as SessionHeapFieldType, c_ as SessionHeapFieldValue, c$ as SessionHeapVariable, d5 as SessionJobListOptions, cY as SessionJobRecord, bP as SessionMutationView, cq as SessionTimelineEvent, co as SessionTranscriptActionSuggestion, cp as SessionTranscriptShowRefs, at as SettleTransientFeedbackOptions, di as SnapshotResetMessage, bz as SourceAcknowledgement, b4 as SpendLineItemType, b8 as SpendSummary, bF as StateObservationProjectionChange, eh as StreamEvent, ej as StreamStats, ei as StreamSubscription, aX as Subject, Q as TableFeedItem, r as ToolHandler, c3 as ToolInfo, dk as ToolInvokeParams, dl as ToolResultParams, p as ToolSchema, c5 as ToolsChangedEvent, a1 as TransientFeedItem, _ as TransientFeedItemBase, a0 as TransientFeedbackFeedItem, au as TransientFeedbackHandle, $ as TransientMessageFeedItem, bB as TransitionOutcomeProjection, bJ as TransitionProjectionResult, aV as User, d8 as UserEnvironmentMessagePreview, d7 as UserEnvironmentPrompt, d9 as UserEnvironmentSessionState, da as UserEnvironmentState, db as UserEnvironmentStateOptions, cl as UserMessageAppendResult, ck as UserMessageInput, ci as UserMessageShowRefs, cj as UserMessageTarget, bu as Version, bn as VersionTag, bm as VersionTracking, df as WSClientOptions, dd as WSDisconnectInfo, de as WSReconnectErrorInfo, aJ as buildOpenAISpendEventId, aD as calculateOpenAITokenSpend, aw as createFeedPublisher, ai as emitFeedDiagnostic, ah as emitFeedDiagnosticToDefaultSink, al as emptyFeedSnapshot, aB as getOpenAIModelPricing, am as hasCanonicalSessionFeedActivation, an as isCanonicalSessionFeedDocument, a8 as mergeFeedItemsBySequence, ag as normalizeFeedDiagnostic, af as normalizeFeedDiagnosticKind, ap as normalizeFeedPage, aC as normalizeOpenAIUsage, a9 as orderTransientFeedItems, ao as readSessionFeedSnapshot, aK as recordOpenAIUsageSpend, aI as toGranularHttpBase } from './spend-BDGtgZtl.mjs';
|
|
4
4
|
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';
|
|
5
5
|
import '@automerge/automerge';
|
|
6
6
|
import '@automerge/automerge/slim';
|
|
7
7
|
|
|
8
|
+
type EnvironmentSetupResponse = {
|
|
9
|
+
environment?: Partial<EnvironmentData>;
|
|
10
|
+
setup?: EnvironmentData["setup"] | null;
|
|
11
|
+
summary?: EnvironmentRecordImportSummary | null;
|
|
12
|
+
ready?: boolean;
|
|
13
|
+
retryAfterMs?: number | null;
|
|
14
|
+
readiness?: {
|
|
15
|
+
ready?: boolean;
|
|
16
|
+
setup?: EnvironmentData["setup"] | null;
|
|
17
|
+
summary?: EnvironmentRecordImportSummary | null;
|
|
18
|
+
retryAfterMs?: number | null;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
} | null;
|
|
21
|
+
};
|
|
22
|
+
type EnvironmentSetupProgress = {
|
|
23
|
+
environment: EnvironmentData;
|
|
24
|
+
setup: EnvironmentData["setup"] | null;
|
|
25
|
+
summary: EnvironmentRecordImportSummary | null;
|
|
26
|
+
ready: boolean;
|
|
27
|
+
retryAfterMs: number | null;
|
|
28
|
+
};
|
|
29
|
+
type EnvironmentSetupRequestError = {
|
|
30
|
+
status?: unknown;
|
|
31
|
+
body?: unknown;
|
|
32
|
+
retryAfterMs?: unknown;
|
|
33
|
+
};
|
|
34
|
+
type EnvironmentSetupPollInput = {
|
|
35
|
+
environment: EnvironmentData;
|
|
36
|
+
/** Abort a superseded workspace-opening attempt without waiting for timeout. */
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
request: (attempt: number, signal?: AbortSignal) => Promise<EnvironmentSetupResponse>;
|
|
39
|
+
onProgress?: (progress: EnvironmentSetupProgress) => void;
|
|
40
|
+
onRetry?: (input: {
|
|
41
|
+
attempt: number;
|
|
42
|
+
error: unknown;
|
|
43
|
+
}) => void;
|
|
44
|
+
isTransientError?: (error: unknown) => boolean;
|
|
45
|
+
maxAttempts?: number;
|
|
46
|
+
maxDurationMs?: number;
|
|
47
|
+
pollIntervalMs?: number;
|
|
48
|
+
retryDelayMs?: number;
|
|
49
|
+
sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
50
|
+
now?: () => number;
|
|
51
|
+
};
|
|
52
|
+
declare function environmentSetupProgressFromResponse(environment: EnvironmentData, response: EnvironmentSetupResponse, retryAfterMs?: number | null): EnvironmentSetupProgress;
|
|
53
|
+
declare function environmentSetupProgressFromError(environment: EnvironmentData, error: unknown): EnvironmentSetupProgress | null;
|
|
54
|
+
declare function pollEnvironmentSetup(input: EnvironmentSetupPollInput): Promise<EnvironmentData>;
|
|
55
|
+
|
|
8
56
|
declare function isLocalApiUrl(url: string): boolean;
|
|
9
57
|
/**
|
|
10
58
|
* Local dev + `sk_*` (WorkOS org key in env): map to the local gn_sk e2e key by default so every
|
|
@@ -263,4 +311,4 @@ declare function buildSessionTranscript(input: {
|
|
|
263
311
|
canonicalFeedItems?: FeedItem[];
|
|
264
312
|
}): SessionTranscriptEntry[];
|
|
265
313
|
|
|
266
|
-
export { CommitDeclaration, CommitReceipt, CommitTransitionInvocation, CommitTransitionOutcomeDeclaration, type CommitTransport, type ConditionalPolicySpec, type DefinedStateMachine, EffectCommitRequest, EffectHandlerContext, EndpointMode, 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, SessionHeapEntry, SessionHeapList, SessionHeapSnapshot, SessionTranscriptEntry, type StateMachineDefinition, ToolWithHandler, type ValidationRuleEvaluationInput, type ValidationRuleEvaluationResult, buildSessionTranscript, buildSessionTranscriptFromFeedItems, canonicalizeCommitValue, changedRecordSnapshots, defineEffect, defineProjection, defineStateMachine, evaluateValidationRule, extractPromptTokens, invokeRegisteredEffect, isLocalApiUrl, normalizeEffectBehaviors, normalizePrompt, normalizePromptChoiceOption, normalizePromptText, normalizePromptType, projectRecordSnapshotMutation, resolveApiUrl, resolveAuthTokenForApiUrl, resolveJobPresentation, resolvePromptAnswer, scorePromptChoiceMatch, validateProjectionResult, validationRuleFailureMessage };
|
|
314
|
+
export { 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, SessionHeapEntry, SessionHeapList, SessionHeapSnapshot, SessionTranscriptEntry, type StateMachineDefinition, ToolWithHandler, type ValidationRuleEvaluationInput, type ValidationRuleEvaluationResult, buildSessionTranscript, buildSessionTranscriptFromFeedItems, canonicalizeCommitValue, changedRecordSnapshots, defineEffect, defineProjection, defineStateMachine, environmentSetupProgressFromError, environmentSetupProgressFromResponse, evaluateValidationRule, extractPromptTokens, invokeRegisteredEffect, isLocalApiUrl, normalizeEffectBehaviors, normalizePrompt, normalizePromptChoiceOption, normalizePromptText, normalizePromptType, pollEnvironmentSetup, projectRecordSnapshotMutation, resolveApiUrl, resolveAuthTokenForApiUrl, resolveJobPresentation, resolvePromptAnswer, scorePromptChoiceMatch, validateProjectionResult, validationRuleFailureMessage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,58 @@
|
|
|
1
|
-
export { E as Environment, a as EnvironmentSession, G as Granular, O as OntologyHandle, S as Session, W as WSClient, i as isGraphQLMutationDocument } from './client-
|
|
2
|
-
import { E as
|
|
3
|
-
export { ef as APIError,
|
|
1
|
+
export { E as Environment, a as EnvironmentSession, G as Granular, O as OntologyHandle, S as Session, W as WSClient, i as isGraphQLMutationDocument } from './client-C-GYQSJC.js';
|
|
2
|
+
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 } from './spend-BDGtgZtl.js';
|
|
3
|
+
export { ef as APIError, aS as AccessTokenProvider, Y as ActionSuggestionFeedItem, aZ as AdoptEnvironmentOptions, bK as AgentCommitStatus, cL as ArtifactApprovalDecisionInput, cM as ArtifactApprovalDecisionResult, cJ as ArtifactApprovalTask, cK as ArtifactApprovalTaskListOptions, cI as ArtifactApprovalTaskStatus, U as ArtifactFeedItem, b_ as ArtifactOptionsHandler, bj as Assignment, bk as AssignmentListResponse, cm as AssistantReplyPublicationInput, cn as AssistantReplyPublicationResult, bH as BaseProjectionResult, bt as Build, bv as BuildListResponse, bl as BuildPolicy, bs as BuildStatus, bC as CanonicalProjectedRecord, bL as CommitChangeReceipt, bA as CommitSafeError, bM as CommitTransitionReceipt, aO as ConditionIR, a_ as ConnectOptions, b0 as ConversationSessionInfo, b2 as ConversationSessionListOptions, b3 as ConversationSessionListResponse, b1 as ConversationSessionListStatus, bo as CreateEnvironmentData, bh as CreatePermissionProfileData, bd as CreateSandboxData, a$ as CreateSessionOptions, dp as DefineRelationshipOptions, eg as DeleteResponse, D as DomainState, bW as EffectArtifactOptionsInvocation, bY as EffectArtifactRelationshipOption, bZ as EffectArtifactRelationshipOptionsResult, bQ as EffectCommitContext, c7 as EffectHandler, c4 as EffectInfo, bX as EffectInvocationMetadata, bV as EffectInvocationMode, bI as EffectProjectionResult, b$ as EffectSchema, c2 as EffectVersionSelector, c0 as EffectWithHandler, c6 as EffectsChangedEvent, cf as EnvironmentFeedbackRecord, dM as EnvironmentImporter, dL as EnvironmentImporterImportOptions, bp as EnvironmentListResponse, dK as EnvironmentSetupImporterClaim, dI as EnvironmentSetupLifecycleStatus, dJ as EnvironmentSetupSummary, dG as EnvironmentSetupTriggerReason, du as EnvironmentStateMachineProxy, ds as EnvironmentStateObservationInput, dv as EnvironmentStateProxy, dr as EnvironmentStateTarget, dt as EnvironmentStateUpdateInput, bN as ExternalCommitOptions, ac as FeedDiagnostic, ad as FeedDiagnosticListener, ak as FeedDocumentState, v as FeedFeedbackTone, V as FeedFileSource, u as FeedIconToken, z as FeedItemBase, x as FeedItemKind, a3 as FeedListOptions, aa as FeedListTransport, G as FeedObjectReference, a4 as FeedPage, av as FeedPublisher, a2 as FeedSnapshot, ab as FeedSnapshotRegressionReason, t as FeedSource, s as FeedSourceActor, a5 as FeedSubscribeOptions, a6 as FeedSubscriptionChange, H as FeedTableCell, J as FeedTableColumn, N as FeedTableProjection, L as FeedTableRow, K as FeedTableRowReference, y as FeedTarget, w as FeedTransientFeedbackTone, B as FeedbackFeedItem, W as FileFeedItem, ae as GRANULAR_FEED_DIAGNOSTIC_EVENT, aU as GranularAuth, aT as GranularOptions, ba as GranularQuotaPolicy, bb as GranularQuotaProgress, aE as GranularSpendContext, ee as GraphQLResult, c8 as InstanceEffectHandler, I as InstanceToolHandler, ch as Job, cd as JobFeedbackInput, cc as JobFeedbackMetadata, ce as JobFeedbackRecord, ca as JobFeedbackSentiment, cb as JobFeedbackToolCall, c9 as JobStatus, cg as JobSubmitResult, bq as Manifest, e4 as ManifestApprovalRequiredSpec, e5 as ManifestCreatesSpec, e2 as ManifestDryRunSpec, e8 as ManifestEffectDeclaration, e7 as ManifestEffectSchema, dP as ManifestEnumRuleSpec, ea as ManifestEventStreamDef, e9 as ManifestEventTypeDef, dQ as ManifestFilterBySpec, ec as ManifestImport, br as ManifestListResponse, eb as ManifestOperation, e1 as ManifestPostConditionSpec, dN as ManifestPropertySpec, e6 as ManifestRelationshipDef, e3 as ManifestReverseSpec, e0 as ManifestStateMachineSpec, dS as ManifestStateMachineStateSpec, d$ as ManifestStateMachineTransitionSpec, dU as ManifestStateTransitionActionSpec, dV as ManifestStateTransitionAssigneeSpec, dZ as ManifestStateTransitionExpectedOutcomeSpec, dT as ManifestStateTransitionInputBinding, d_ as ManifestStateTransitionOutcomeSpec, dY as ManifestStateTransitionPermissionSpec, dW as ManifestStateTransitionRelatedStateRequirementSpec, dX as ManifestStateTransitionRequirementsSpec, dO as ManifestValidationOperator, dR as ManifestValidationRuleSpec, ed as ManifestVolume, cU as ManualActionListOptions, cS as ManualActionOccurrence, cT as ManualActionRecordResult, cQ as ManualActionRelatedRecord, cO as ManualActionSource, cN as ManualActionStatus, cV as ManualActionSuggestion, cW as ManualActionSuggestionOptions, cP as ManualActionTarget, dc as MarkUserEnvironmentReadOptions, aR as MatchedPolicy, A as MessageFeedItem, dm as ModelRef, ay as NormalizedOpenAIUsage, X as NormalizedSuggestedArtifact, aA as OPENAI_MODEL_PRICING_USD_PER_MILLION, bD as ObjectProjectionChange, by as ObjectReference, O as ObjectsFeedItem, bO as ObservationReceipt, ax as OpenAIModelPricing, az as OpenAITokenSpend, aF as OpenAIUsageSpendEvent, aY as OpenEnvironmentOptions, bg as PermissionProfile, bi as PermissionProfileListResponse, bf as PermissionRules, aN as PolicyOperator, aP as PolicyOrigin, aM as PolicyPredicateSource, aQ as PolicyRuleIR, aL as PolicySource, bG as ProjectionChange, Z as PromptFeedItem, c1 as PublishEffectsResult, ar as PublishFeedbackOptions, q as PublishToolsResult, as as PublishTransientFeedbackOptions, b9 as QuotaLineItemFilter, b6 as QuotaPeriod, b5 as QuotaScopeType, b7 as QuotaStatus, dg as RPCRequest, dj as RPCRequestFromServer, dh as RPCResponse, dF as RecordImport, dE as RecordImportItem, dC as RecordImportItemStatus, dA as RecordImportOptions, dD as RecordImportStats, dB as RecordImportStatus, dz as RecordImportWriteMode, cR as RecordManualActionInput, d2 as RecordMentionInput, dw as RecordObjectResult, dq as RecordObjectStateValue, dx as RecordObjectsChunkInfo, dy as RecordObjectsOptions, aG as RecordOpenAIUsageSpendOptions, aH as RecordOpenAIUsageSpendResult, d1 as RecordSearchOptions, d0 as RecordSearchResult, aW as RecordUserOptions, dn as RelationshipInfo, bE as RelationshipProjectionChange, bU as ResolvedEffectApprovalRequired, bS as ResolvedEffectDryRun, bR as ResolvedEffectPostCondition, bT as ResolvedEffectReverse, dH as RunEnvironmentImporterOptions, bc as Sandbox, be as SandboxListResponse, bx as SemanticVersionDiff, bw as SemanticVersionDiffEntry, cH as SessionArtifactApprovalOptions, cx as SessionArtifactAutonomyPolicy, cG as SessionArtifactExecutionOptions, cF as SessionArtifactExecutionResult, cw as SessionArtifactKind, cz as SessionArtifactListOptions, cy as SessionArtifactRecord, cE as SessionArtifactRelationshipCreateInput, cC as SessionArtifactRelationshipOption, cB as SessionArtifactRelationshipOptionsInput, cD as SessionArtifactRelationshipOptionsResult, cv as SessionArtifactStatus, cA as SessionArtifactValidationResult, d4 as SessionCollectionListOptions, d6 as SessionCollectionListResult, d3 as SessionDocumentResult, a7 as SessionFeedApi, aq as SessionFeedController, aj as SessionFeedControllerOptions, cs as SessionFileKind, cu as SessionFileRecord, cr as SessionFileSource, ct as SessionFileStatus, cX as SessionFileUploadOptions, cZ as SessionHeapFieldType, c_ as SessionHeapFieldValue, c$ as SessionHeapVariable, d5 as SessionJobListOptions, cY as SessionJobRecord, bP as SessionMutationView, cq as SessionTimelineEvent, co as SessionTranscriptActionSuggestion, cp as SessionTranscriptShowRefs, at as SettleTransientFeedbackOptions, di as SnapshotResetMessage, bz as SourceAcknowledgement, b4 as SpendLineItemType, b8 as SpendSummary, bF as StateObservationProjectionChange, eh as StreamEvent, ej as StreamStats, ei as StreamSubscription, aX as Subject, Q as TableFeedItem, r as ToolHandler, c3 as ToolInfo, dk as ToolInvokeParams, dl as ToolResultParams, p as ToolSchema, c5 as ToolsChangedEvent, a1 as TransientFeedItem, _ as TransientFeedItemBase, a0 as TransientFeedbackFeedItem, au as TransientFeedbackHandle, $ as TransientMessageFeedItem, bB as TransitionOutcomeProjection, bJ as TransitionProjectionResult, aV as User, d8 as UserEnvironmentMessagePreview, d7 as UserEnvironmentPrompt, d9 as UserEnvironmentSessionState, da as UserEnvironmentState, db as UserEnvironmentStateOptions, cl as UserMessageAppendResult, ck as UserMessageInput, ci as UserMessageShowRefs, cj as UserMessageTarget, bu as Version, bn as VersionTag, bm as VersionTracking, df as WSClientOptions, dd as WSDisconnectInfo, de as WSReconnectErrorInfo, aJ as buildOpenAISpendEventId, aD as calculateOpenAITokenSpend, aw as createFeedPublisher, ai as emitFeedDiagnostic, ah as emitFeedDiagnosticToDefaultSink, al as emptyFeedSnapshot, aB as getOpenAIModelPricing, am as hasCanonicalSessionFeedActivation, an as isCanonicalSessionFeedDocument, a8 as mergeFeedItemsBySequence, ag as normalizeFeedDiagnostic, af as normalizeFeedDiagnosticKind, ap as normalizeFeedPage, aC as normalizeOpenAIUsage, a9 as orderTransientFeedItems, ao as readSessionFeedSnapshot, aK as recordOpenAIUsageSpend, aI as toGranularHttpBase } from './spend-BDGtgZtl.js';
|
|
4
4
|
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';
|
|
5
5
|
import '@automerge/automerge';
|
|
6
6
|
import '@automerge/automerge/slim';
|
|
7
7
|
|
|
8
|
+
type EnvironmentSetupResponse = {
|
|
9
|
+
environment?: Partial<EnvironmentData>;
|
|
10
|
+
setup?: EnvironmentData["setup"] | null;
|
|
11
|
+
summary?: EnvironmentRecordImportSummary | null;
|
|
12
|
+
ready?: boolean;
|
|
13
|
+
retryAfterMs?: number | null;
|
|
14
|
+
readiness?: {
|
|
15
|
+
ready?: boolean;
|
|
16
|
+
setup?: EnvironmentData["setup"] | null;
|
|
17
|
+
summary?: EnvironmentRecordImportSummary | null;
|
|
18
|
+
retryAfterMs?: number | null;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
} | null;
|
|
21
|
+
};
|
|
22
|
+
type EnvironmentSetupProgress = {
|
|
23
|
+
environment: EnvironmentData;
|
|
24
|
+
setup: EnvironmentData["setup"] | null;
|
|
25
|
+
summary: EnvironmentRecordImportSummary | null;
|
|
26
|
+
ready: boolean;
|
|
27
|
+
retryAfterMs: number | null;
|
|
28
|
+
};
|
|
29
|
+
type EnvironmentSetupRequestError = {
|
|
30
|
+
status?: unknown;
|
|
31
|
+
body?: unknown;
|
|
32
|
+
retryAfterMs?: unknown;
|
|
33
|
+
};
|
|
34
|
+
type EnvironmentSetupPollInput = {
|
|
35
|
+
environment: EnvironmentData;
|
|
36
|
+
/** Abort a superseded workspace-opening attempt without waiting for timeout. */
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
request: (attempt: number, signal?: AbortSignal) => Promise<EnvironmentSetupResponse>;
|
|
39
|
+
onProgress?: (progress: EnvironmentSetupProgress) => void;
|
|
40
|
+
onRetry?: (input: {
|
|
41
|
+
attempt: number;
|
|
42
|
+
error: unknown;
|
|
43
|
+
}) => void;
|
|
44
|
+
isTransientError?: (error: unknown) => boolean;
|
|
45
|
+
maxAttempts?: number;
|
|
46
|
+
maxDurationMs?: number;
|
|
47
|
+
pollIntervalMs?: number;
|
|
48
|
+
retryDelayMs?: number;
|
|
49
|
+
sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
50
|
+
now?: () => number;
|
|
51
|
+
};
|
|
52
|
+
declare function environmentSetupProgressFromResponse(environment: EnvironmentData, response: EnvironmentSetupResponse, retryAfterMs?: number | null): EnvironmentSetupProgress;
|
|
53
|
+
declare function environmentSetupProgressFromError(environment: EnvironmentData, error: unknown): EnvironmentSetupProgress | null;
|
|
54
|
+
declare function pollEnvironmentSetup(input: EnvironmentSetupPollInput): Promise<EnvironmentData>;
|
|
55
|
+
|
|
8
56
|
declare function isLocalApiUrl(url: string): boolean;
|
|
9
57
|
/**
|
|
10
58
|
* Local dev + `sk_*` (WorkOS org key in env): map to the local gn_sk e2e key by default so every
|
|
@@ -263,4 +311,4 @@ declare function buildSessionTranscript(input: {
|
|
|
263
311
|
canonicalFeedItems?: FeedItem[];
|
|
264
312
|
}): SessionTranscriptEntry[];
|
|
265
313
|
|
|
266
|
-
export { CommitDeclaration, CommitReceipt, CommitTransitionInvocation, CommitTransitionOutcomeDeclaration, type CommitTransport, type ConditionalPolicySpec, type DefinedStateMachine, EffectCommitRequest, EffectHandlerContext, EndpointMode, 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, SessionHeapEntry, SessionHeapList, SessionHeapSnapshot, SessionTranscriptEntry, type StateMachineDefinition, ToolWithHandler, type ValidationRuleEvaluationInput, type ValidationRuleEvaluationResult, buildSessionTranscript, buildSessionTranscriptFromFeedItems, canonicalizeCommitValue, changedRecordSnapshots, defineEffect, defineProjection, defineStateMachine, evaluateValidationRule, extractPromptTokens, invokeRegisteredEffect, isLocalApiUrl, normalizeEffectBehaviors, normalizePrompt, normalizePromptChoiceOption, normalizePromptText, normalizePromptType, projectRecordSnapshotMutation, resolveApiUrl, resolveAuthTokenForApiUrl, resolveJobPresentation, resolvePromptAnswer, scorePromptChoiceMatch, validateProjectionResult, validationRuleFailureMessage };
|
|
314
|
+
export { 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, SessionHeapEntry, SessionHeapList, SessionHeapSnapshot, SessionTranscriptEntry, type StateMachineDefinition, ToolWithHandler, type ValidationRuleEvaluationInput, type ValidationRuleEvaluationResult, buildSessionTranscript, buildSessionTranscriptFromFeedItems, canonicalizeCommitValue, changedRecordSnapshots, defineEffect, defineProjection, defineStateMachine, environmentSetupProgressFromError, environmentSetupProgressFromResponse, evaluateValidationRule, extractPromptTokens, invokeRegisteredEffect, isLocalApiUrl, normalizeEffectBehaviors, normalizePrompt, normalizePromptChoiceOption, normalizePromptText, normalizePromptType, pollEnvironmentSetup, projectRecordSnapshotMutation, resolveApiUrl, resolveAuthTokenForApiUrl, resolveJobPresentation, resolvePromptAnswer, scorePromptChoiceMatch, validateProjectionResult, validationRuleFailureMessage };
|
package/dist/index.js
CHANGED
|
@@ -20431,6 +20431,258 @@ var Granular = class _Granular {
|
|
|
20431
20431
|
}
|
|
20432
20432
|
};
|
|
20433
20433
|
|
|
20434
|
+
// src/environment-setup.ts
|
|
20435
|
+
var EnvironmentSetupTerminalError = class extends Error {
|
|
20436
|
+
constructor(setup) {
|
|
20437
|
+
super(
|
|
20438
|
+
setup?.errorMessage?.trim() || "Environment setup failed before all records were imported."
|
|
20439
|
+
);
|
|
20440
|
+
this.name = "EnvironmentSetupTerminalError";
|
|
20441
|
+
}
|
|
20442
|
+
};
|
|
20443
|
+
function environmentSetupFailedError(setup) {
|
|
20444
|
+
return new EnvironmentSetupTerminalError(setup);
|
|
20445
|
+
}
|
|
20446
|
+
function environmentSetupAbortError() {
|
|
20447
|
+
const error = new Error("Environment setup polling was aborted.");
|
|
20448
|
+
error.name = "AbortError";
|
|
20449
|
+
return error;
|
|
20450
|
+
}
|
|
20451
|
+
function throwIfAborted(signal) {
|
|
20452
|
+
if (signal.aborted) {
|
|
20453
|
+
throw environmentSetupAbortError();
|
|
20454
|
+
}
|
|
20455
|
+
}
|
|
20456
|
+
function abortableSleep(ms, signal) {
|
|
20457
|
+
return new Promise((resolve, reject) => {
|
|
20458
|
+
if (signal.aborted) {
|
|
20459
|
+
reject(environmentSetupAbortError());
|
|
20460
|
+
return;
|
|
20461
|
+
}
|
|
20462
|
+
const timeout = setTimeout(() => {
|
|
20463
|
+
signal.removeEventListener("abort", abort);
|
|
20464
|
+
resolve();
|
|
20465
|
+
}, ms);
|
|
20466
|
+
const abort = () => {
|
|
20467
|
+
clearTimeout(timeout);
|
|
20468
|
+
signal.removeEventListener("abort", abort);
|
|
20469
|
+
reject(environmentSetupAbortError());
|
|
20470
|
+
};
|
|
20471
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
20472
|
+
});
|
|
20473
|
+
}
|
|
20474
|
+
function setupIsRunning(setup) {
|
|
20475
|
+
return setup?.lifecycleStatus === "running";
|
|
20476
|
+
}
|
|
20477
|
+
function setupHasFailed(setup) {
|
|
20478
|
+
return setup?.lifecycleStatus === "failed";
|
|
20479
|
+
}
|
|
20480
|
+
function hasRecordFailures(setup) {
|
|
20481
|
+
return Boolean(
|
|
20482
|
+
setup && (setup.failedRecords > 0 || setup.canceledRecords > 0)
|
|
20483
|
+
);
|
|
20484
|
+
}
|
|
20485
|
+
function setupHasTerminalLifecycleFailure(setup) {
|
|
20486
|
+
return setupHasFailed(setup);
|
|
20487
|
+
}
|
|
20488
|
+
function importsAreActive(summary) {
|
|
20489
|
+
return Boolean(
|
|
20490
|
+
summary && (summary.awaitingRecords > 0 || summary.activeImports > 0)
|
|
20491
|
+
);
|
|
20492
|
+
}
|
|
20493
|
+
function numericRetryAfter(value) {
|
|
20494
|
+
return typeof value === "number" && Number.isFinite(value) ? Math.max(0, Math.round(value)) : null;
|
|
20495
|
+
}
|
|
20496
|
+
function environmentSetupTimeoutError(maxDurationMs) {
|
|
20497
|
+
return new Error(`Environment setup timed out after ${maxDurationMs}ms.`);
|
|
20498
|
+
}
|
|
20499
|
+
function environmentSetupProgressFromResponse(environment, response, retryAfterMs) {
|
|
20500
|
+
const readiness = response.readiness;
|
|
20501
|
+
const nextEnvironment = {
|
|
20502
|
+
...environment,
|
|
20503
|
+
...response.environment || {}
|
|
20504
|
+
};
|
|
20505
|
+
const explicitReady = typeof readiness?.ready === "boolean" ? readiness.ready : typeof response.ready === "boolean" ? response.ready : void 0;
|
|
20506
|
+
const hasResponseSetup = Object.prototype.hasOwnProperty.call(
|
|
20507
|
+
response,
|
|
20508
|
+
"setup"
|
|
20509
|
+
);
|
|
20510
|
+
const hasReadinessSetup = readiness !== null && typeof readiness === "object" && Object.prototype.hasOwnProperty.call(readiness, "setup");
|
|
20511
|
+
const hasEnvironmentSetup = response.environment !== null && typeof response.environment === "object" && Object.prototype.hasOwnProperty.call(response.environment, "setup");
|
|
20512
|
+
const setup = hasResponseSetup ? response.setup ?? null : hasReadinessSetup ? readiness?.setup ?? null : hasEnvironmentSetup ? response.environment?.setup ?? null : explicitReady === true ? null : nextEnvironment.setup ?? null;
|
|
20513
|
+
nextEnvironment.setup = setup;
|
|
20514
|
+
const summary = response.summary ?? readiness?.summary ?? null;
|
|
20515
|
+
const retry = [
|
|
20516
|
+
retryAfterMs,
|
|
20517
|
+
response.retryAfterMs,
|
|
20518
|
+
readiness?.retryAfterMs
|
|
20519
|
+
].find((value) => typeof value === "number" && Number.isFinite(value));
|
|
20520
|
+
const recordFailures = hasRecordFailures(setup) || hasRecordFailures(summary);
|
|
20521
|
+
return {
|
|
20522
|
+
environment: nextEnvironment,
|
|
20523
|
+
setup,
|
|
20524
|
+
summary,
|
|
20525
|
+
ready: explicitReady !== false && !setupIsRunning(setup) && !setupHasFailed(setup) && (explicitReady === true || !recordFailures) && !importsAreActive(summary),
|
|
20526
|
+
retryAfterMs: numericRetryAfter(retry)
|
|
20527
|
+
};
|
|
20528
|
+
}
|
|
20529
|
+
function environmentSetupProgressFromError(environment, error) {
|
|
20530
|
+
if (!error || typeof error !== "object") return null;
|
|
20531
|
+
const candidate = error;
|
|
20532
|
+
if (candidate.status !== 503 && candidate.status !== 202 || typeof candidate.body !== "string") {
|
|
20533
|
+
return null;
|
|
20534
|
+
}
|
|
20535
|
+
try {
|
|
20536
|
+
const response = JSON.parse(candidate.body);
|
|
20537
|
+
const explicitReady = response?.readiness?.ready ?? (typeof response?.ready === "boolean" ? response.ready : void 0);
|
|
20538
|
+
if (candidate.status === 202) {
|
|
20539
|
+
const progress = environmentSetupProgressFromResponse(
|
|
20540
|
+
environment,
|
|
20541
|
+
response,
|
|
20542
|
+
numericRetryAfter(candidate.retryAfterMs)
|
|
20543
|
+
);
|
|
20544
|
+
return explicitReady === void 0 ? { ...progress, ready: false } : progress;
|
|
20545
|
+
}
|
|
20546
|
+
return explicitReady === false ? environmentSetupProgressFromResponse(
|
|
20547
|
+
environment,
|
|
20548
|
+
response,
|
|
20549
|
+
numericRetryAfter(candidate.retryAfterMs)
|
|
20550
|
+
) : null;
|
|
20551
|
+
} catch {
|
|
20552
|
+
return null;
|
|
20553
|
+
}
|
|
20554
|
+
}
|
|
20555
|
+
function defaultTransientError(error) {
|
|
20556
|
+
if (!error) return false;
|
|
20557
|
+
const status = typeof error === "object" ? error.status : void 0;
|
|
20558
|
+
if (typeof status === "number") {
|
|
20559
|
+
return status === 408 || status === 425 || status === 429 || status >= 500;
|
|
20560
|
+
}
|
|
20561
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
20562
|
+
return /failed to fetch|network error|network connection lost|connection (?:reset|closed|refused)|econnreset|socket hang up|socket connection was closed unexpectedly|dns|timed out/i.test(
|
|
20563
|
+
message
|
|
20564
|
+
);
|
|
20565
|
+
}
|
|
20566
|
+
async function pollEnvironmentSetup(input) {
|
|
20567
|
+
const maxAttempts = Math.max(1, input.maxAttempts ?? 3);
|
|
20568
|
+
const maxDurationMs = Math.max(1, input.maxDurationMs ?? 12e4);
|
|
20569
|
+
const sleep2 = input.sleep || ((ms, signal2) => abortableSleep(ms, signal2 || new AbortController().signal));
|
|
20570
|
+
const now = input.now || (() => Date.now());
|
|
20571
|
+
const isTransientError = input.isTransientError || defaultTransientError;
|
|
20572
|
+
const internalController = input.signal ? null : new AbortController();
|
|
20573
|
+
const signal = input.signal || internalController.signal;
|
|
20574
|
+
const startedAt = now();
|
|
20575
|
+
let currentEnvironment = input.environment;
|
|
20576
|
+
let transientFailures = 0;
|
|
20577
|
+
let attempt = 0;
|
|
20578
|
+
const waitForNextAttempt = async (requestedDelayMs) => {
|
|
20579
|
+
throwIfAborted(signal);
|
|
20580
|
+
const remainingMs = maxDurationMs - Math.max(0, now() - startedAt);
|
|
20581
|
+
if (remainingMs <= 0) {
|
|
20582
|
+
throw environmentSetupTimeoutError(maxDurationMs);
|
|
20583
|
+
}
|
|
20584
|
+
await sleep2(Math.min(Math.max(0, requestedDelayMs), remainingMs), signal);
|
|
20585
|
+
throwIfAborted(signal);
|
|
20586
|
+
};
|
|
20587
|
+
const requestWithinDeadline = async (requestAttempt) => {
|
|
20588
|
+
throwIfAborted(signal);
|
|
20589
|
+
const remainingMs = maxDurationMs - Math.max(0, now() - startedAt);
|
|
20590
|
+
if (remainingMs <= 0) {
|
|
20591
|
+
throw environmentSetupTimeoutError(maxDurationMs);
|
|
20592
|
+
}
|
|
20593
|
+
const requestController = new AbortController();
|
|
20594
|
+
let timeoutHandle = null;
|
|
20595
|
+
let abortHandler = null;
|
|
20596
|
+
const requestPromise = Promise.resolve().then(
|
|
20597
|
+
() => input.request(requestAttempt, requestController.signal)
|
|
20598
|
+
);
|
|
20599
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
20600
|
+
if (!Number.isFinite(remainingMs)) return;
|
|
20601
|
+
timeoutHandle = setTimeout(
|
|
20602
|
+
() => {
|
|
20603
|
+
reject(environmentSetupTimeoutError(maxDurationMs));
|
|
20604
|
+
requestController.abort();
|
|
20605
|
+
},
|
|
20606
|
+
Math.max(1, Math.ceil(remainingMs))
|
|
20607
|
+
);
|
|
20608
|
+
});
|
|
20609
|
+
const abortPromise = new Promise((_, reject) => {
|
|
20610
|
+
abortHandler = () => {
|
|
20611
|
+
requestController.abort();
|
|
20612
|
+
reject(environmentSetupAbortError());
|
|
20613
|
+
};
|
|
20614
|
+
signal.addEventListener("abort", abortHandler, { once: true });
|
|
20615
|
+
});
|
|
20616
|
+
try {
|
|
20617
|
+
return await Promise.race([requestPromise, timeoutPromise, abortPromise]);
|
|
20618
|
+
} finally {
|
|
20619
|
+
if (timeoutHandle !== null) {
|
|
20620
|
+
clearTimeout(timeoutHandle);
|
|
20621
|
+
}
|
|
20622
|
+
if (abortHandler !== null) {
|
|
20623
|
+
signal.removeEventListener("abort", abortHandler);
|
|
20624
|
+
}
|
|
20625
|
+
}
|
|
20626
|
+
};
|
|
20627
|
+
while (true) {
|
|
20628
|
+
throwIfAborted(signal);
|
|
20629
|
+
if (now() - startedAt >= maxDurationMs) {
|
|
20630
|
+
throw environmentSetupTimeoutError(maxDurationMs);
|
|
20631
|
+
}
|
|
20632
|
+
attempt += 1;
|
|
20633
|
+
try {
|
|
20634
|
+
const progress = environmentSetupProgressFromResponse(
|
|
20635
|
+
currentEnvironment,
|
|
20636
|
+
await requestWithinDeadline(attempt)
|
|
20637
|
+
);
|
|
20638
|
+
throwIfAborted(signal);
|
|
20639
|
+
currentEnvironment = progress.environment;
|
|
20640
|
+
input.onProgress?.(progress);
|
|
20641
|
+
if (setupHasTerminalLifecycleFailure(progress.setup) && !progress.ready) {
|
|
20642
|
+
throw environmentSetupFailedError(progress.setup);
|
|
20643
|
+
}
|
|
20644
|
+
if (progress.ready) return progress.environment;
|
|
20645
|
+
transientFailures = 0;
|
|
20646
|
+
await waitForNextAttempt(
|
|
20647
|
+
progress.retryAfterMs ?? input.pollIntervalMs ?? 1e3
|
|
20648
|
+
);
|
|
20649
|
+
} catch (error) {
|
|
20650
|
+
throwIfAborted(signal);
|
|
20651
|
+
if (error instanceof EnvironmentSetupTerminalError) {
|
|
20652
|
+
throw error;
|
|
20653
|
+
}
|
|
20654
|
+
const pending = environmentSetupProgressFromError(
|
|
20655
|
+
currentEnvironment,
|
|
20656
|
+
error
|
|
20657
|
+
);
|
|
20658
|
+
if (pending) {
|
|
20659
|
+
currentEnvironment = pending.environment;
|
|
20660
|
+
input.onProgress?.(pending);
|
|
20661
|
+
if (setupHasTerminalLifecycleFailure(pending.setup) && !pending.ready) {
|
|
20662
|
+
throw environmentSetupFailedError(pending.setup);
|
|
20663
|
+
}
|
|
20664
|
+
if (pending.ready) return pending.environment;
|
|
20665
|
+
transientFailures = 0;
|
|
20666
|
+
await waitForNextAttempt(
|
|
20667
|
+
pending.retryAfterMs ?? input.pollIntervalMs ?? 1e3
|
|
20668
|
+
);
|
|
20669
|
+
continue;
|
|
20670
|
+
}
|
|
20671
|
+
if (!isTransientError(error) || transientFailures + 1 >= maxAttempts) {
|
|
20672
|
+
throw error;
|
|
20673
|
+
}
|
|
20674
|
+
transientFailures += 1;
|
|
20675
|
+
input.onRetry?.({ attempt: transientFailures, error });
|
|
20676
|
+
const retryAfterMs = numericRetryAfter(
|
|
20677
|
+
error && typeof error === "object" ? error.retryAfterMs : null
|
|
20678
|
+
);
|
|
20679
|
+
await waitForNextAttempt(
|
|
20680
|
+
retryAfterMs ?? (input.retryDelayMs ?? 1500) * transientFailures
|
|
20681
|
+
);
|
|
20682
|
+
}
|
|
20683
|
+
}
|
|
20684
|
+
}
|
|
20685
|
+
|
|
20434
20686
|
// src/record-snapshot-projection.ts
|
|
20435
20687
|
function stableValue(value) {
|
|
20436
20688
|
if (Array.isArray(value)) return value.map(stableValue);
|
|
@@ -23755,6 +24007,8 @@ exports.defineStateMachine = defineStateMachine;
|
|
|
23755
24007
|
exports.emitFeedDiagnostic = emitFeedDiagnostic;
|
|
23756
24008
|
exports.emitFeedDiagnosticToDefaultSink = emitFeedDiagnosticToDefaultSink;
|
|
23757
24009
|
exports.emptyFeedSnapshot = emptyFeedSnapshot;
|
|
24010
|
+
exports.environmentSetupProgressFromError = environmentSetupProgressFromError;
|
|
24011
|
+
exports.environmentSetupProgressFromResponse = environmentSetupProgressFromResponse;
|
|
23758
24012
|
exports.evaluateContinuation = evaluateContinuation;
|
|
23759
24013
|
exports.evaluateValidationRule = evaluateValidationRule;
|
|
23760
24014
|
exports.extractPromptTokens = extractPromptTokens;
|
|
@@ -23781,6 +24035,7 @@ exports.normalizePromptChoiceOption = normalizePromptChoiceOption;
|
|
|
23781
24035
|
exports.normalizePromptText = normalizePromptText;
|
|
23782
24036
|
exports.normalizePromptType = normalizePromptType;
|
|
23783
24037
|
exports.orderTransientFeedItems = orderTransientFeedItems;
|
|
24038
|
+
exports.pollEnvironmentSetup = pollEnvironmentSetup;
|
|
23784
24039
|
exports.projectConversationReferentFocus = projectConversationReferentFocus;
|
|
23785
24040
|
exports.projectConversationReferentSummary = projectConversationReferentSummary;
|
|
23786
24041
|
exports.projectHeapSummary = projectHeapSummary;
|