@granular-software/sdk 0.4.63 → 0.4.65

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.
@@ -1,4 +1,4 @@
1
- import { cO as WSClientOptions, Y as SessionFeedApi, b0 as GranularQuotaProgress, T as ToolWithHandler, g as PublishToolsResult, bQ as Job, h as ToolHandler, I as InstanceToolHandler, bT as UserMessageInput, bU as UserMessageAppendResult, bD as EffectInfo, P as Prompt, bC as ToolInfo, bF as EffectsChangedEvent, bE as ToolsChangedEvent, D as DomainState, $ as FeedListTransport, aI as GranularOptions, dk as EnvironmentImporter, aL as RecordUserOptions, aK as User, aN as OpenEnvironmentOptions, bd as EnvironmentData, ba as BuildPolicy, dh as EnvironmentSetupSummary, aT as ConversationSessionListOptions, aR as ConversationSessionInfo, aU as ConversationSessionListResponse, aQ as CreateSessionOptions, cY as RecordObjectOptions, d3 as RecordObjectResult, d5 as RecordObjectsOptions, dc as RecordImport, d8 as RecordImportStatus, db as RecordImportItem, dd as EnvironmentRecordImportSummary, bO as EnvironmentFeedbackRecord, d as SessionHeapSnapshot, cC as SessionDocumentResult, bV as AssistantReplyPublicationInput, bW as AssistantReplyPublicationResult, cD as SessionCollectionListOptions, cF as SessionCollectionListResult, bZ as SessionTimelineEvent, cE as SessionJobListOptions, cv as SessionJobRecord, c6 as SessionArtifactListOptions, c5 as SessionArtifactRecord, c8 as SessionArtifactRelationshipOptionsInput, ca as SessionArtifactRelationshipOptionsResult, cb as SessionArtifactRelationshipCreateInput, c7 as SessionArtifactValidationResult, cd as SessionArtifactExecutionOptions, cc as SessionArtifactExecutionResult, ce as SessionArtifactApprovalOptions, co as RecordManualActionInput, cq as ManualActionRecordResult, cr as ManualActionListOptions, cp as ManualActionOccurrence, ct as ManualActionSuggestionOptions, cs as ManualActionSuggestion, ch as ArtifactApprovalTaskListOptions, cg as ArtifactApprovalTask, ci as ArtifactApprovalDecisionInput, cj as ArtifactApprovalDecisionResult, c1 as SessionFileRecord, cu as SessionFileUploadOptions, S as SessionHeapEntry, b as SessionHeapList, cy as SessionHeapVariable, e as SessionTranscriptEntry, dP as GraphQLResult, cA as RecordSearchOptions, cz as RecordSearchResult, cB as RecordMentionInput, cX as DefineRelationshipOptions, cW as RelationshipInfo, cV as ModelRef, dO as ManifestContent, d0 as EnvironmentStateUpdateInput, c_ as EnvironmentStateTarget, d2 as EnvironmentStateProxy, d7 as RecordImportOptions, cK as UserEnvironmentStateOptions, cJ as UserEnvironmentState, cL as MarkUserEnvironmentReadOptions, aO as AdoptEnvironmentOptions, aP as ConnectOptions, df as RunEnvironmentImporterOptions, au as OpenAIUsageSpendEvent, at as GranularSpendContext, aw as RecordOpenAIUsageSpendResult, b3 as SandboxListResponse, b1 as Sandbox, b2 as CreateSandboxData, dR as DeleteResponse, b5 as PermissionProfile, b6 as CreatePermissionProfileData, be as CreateEnvironmentData, dS as StreamEvent, dT as StreamSubscription, dU as StreamStats, aM as Subject, b9 as AssignmentListResponse } from './spend-DtsHRNb5.mjs';
1
+ import { de as WSClientOptions, a5 as SessionFeedApi, b9 as GranularQuotaProgress, T as ToolWithHandler, o as PublishToolsResult, cg as Job, p as ToolHandler, I as InstanceToolHandler, cj as UserMessageInput, ck as UserMessageAppendResult, c3 as EffectInfo, l as Prompt, c2 as ToolInfo, c5 as EffectsChangedEvent, c4 as ToolsChangedEvent, D as DomainState, a8 as FeedListTransport, aR as GranularOptions, dM as EnvironmentImporter, aU as RecordUserOptions, aT as User, aW as OpenEnvironmentOptions, bm as EnvironmentData, bj as BuildPolicy, dJ as EnvironmentSetupSummary, b0 as ConversationSessionListOptions, a_ as ConversationSessionInfo, b1 as ConversationSessionListResponse, aZ as CreateSessionOptions, f as RecordObjectOptions, dv as RecordObjectResult, dx as RecordObjectsOptions, dE as RecordImport, dA as RecordImportStatus, dD as RecordImportItem, dF as EnvironmentRecordImportSummary, ce as EnvironmentFeedbackRecord, k as SessionHeapSnapshot, d2 as SessionDocumentResult, cl as AssistantReplyPublicationInput, cm as AssistantReplyPublicationResult, d3 as SessionCollectionListOptions, d5 as SessionCollectionListResult, cp as SessionTimelineEvent, d4 as SessionJobListOptions, cX as SessionJobRecord, bO as SessionMutationView, cy as SessionArtifactListOptions, cx as SessionArtifactRecord, cA as SessionArtifactRelationshipOptionsInput, cC as SessionArtifactRelationshipOptionsResult, cD as SessionArtifactRelationshipCreateInput, cz as SessionArtifactValidationResult, cF as SessionArtifactExecutionOptions, cE as SessionArtifactExecutionResult, cG as SessionArtifactApprovalOptions, cQ as RecordManualActionInput, cS as ManualActionRecordResult, cT as ManualActionListOptions, cR as ManualActionOccurrence, cV as ManualActionSuggestionOptions, cU as ManualActionSuggestion, cJ as ArtifactApprovalTaskListOptions, cI as ArtifactApprovalTask, cK as ArtifactApprovalDecisionInput, cL as ArtifactApprovalDecisionResult, ct as SessionFileRecord, cW as SessionFileUploadOptions, S as SessionHeapEntry, i as SessionHeapList, c_ as SessionHeapVariable, m as SessionTranscriptEntry, ee as GraphQLResult, d0 as RecordSearchOptions, c$ as RecordSearchResult, d1 as RecordMentionInput, dn as DefineRelationshipOptions, dm as RelationshipInfo, dl as ModelRef, g as ManifestContent, ds as EnvironmentStateUpdateInput, dq as EnvironmentStateTarget, du as EnvironmentStateProxy, dz as RecordImportOptions, da as UserEnvironmentStateOptions, d9 as UserEnvironmentState, db as MarkUserEnvironmentReadOptions, b as ProjectionMapper, bH as EffectProjectionResult, bM as ExternalCommitOptions, C as CommitReceipt, bI as TransitionProjectionResult, bN as ObservationReceipt, aX as AdoptEnvironmentOptions, aY as ConnectOptions, dH as RunEnvironmentImporterOptions, aD as OpenAIUsageSpendEvent, aC as GranularSpendContext, aF as RecordOpenAIUsageSpendResult, bc as SandboxListResponse, ba as Sandbox, bb as CreateSandboxData, eg as DeleteResponse, be as PermissionProfile, bf as CreatePermissionProfileData, bn as CreateEnvironmentData, eh as StreamEvent, ei as StreamSubscription, ej as StreamStats, aV as Subject, bi as AssignmentListResponse } from './spend-CESUvrZC.mjs';
2
2
  import * as Automerge from '@automerge/automerge';
3
3
  import { Doc } from '@automerge/automerge/slim';
4
4
 
@@ -389,6 +389,44 @@ declare class Environment {
389
389
  cancelImport: (importId: string) => Promise<RecordImport>;
390
390
  getAwaitingCount: () => Promise<number>;
391
391
  };
392
+ /**
393
+ * Acknowledge a declared product mutation that already happened outside a
394
+ * Granular-run effect (for example, in a webhook consumer). These methods
395
+ * run the declaration's pure projection mapper; they never call its handler.
396
+ */
397
+ get commit(): {
398
+ effect: <TResult>(effect: ToolWithHandler & {
399
+ commit: {
400
+ kind: "effect";
401
+ project: ProjectionMapper<TResult, EffectProjectionResult>;
402
+ };
403
+ }, productResult: TResult, options?: ExternalCommitOptions) => Promise<CommitReceipt>;
404
+ transition: <TResult>(transition: {
405
+ from: string;
406
+ outcomes: Record<string, unknown>;
407
+ effect: ToolWithHandler & {
408
+ commit: {
409
+ kind: "transition";
410
+ project: ProjectionMapper<TResult, TransitionProjectionResult>;
411
+ };
412
+ };
413
+ }, productResult: TResult, options?: ExternalCommitOptions) => Promise<CommitReceipt>;
414
+ get: (commitId: string) => Promise<CommitReceipt>;
415
+ retry: (commitId: string) => Promise<CommitReceipt>;
416
+ };
417
+ /** Inspect or retry the agent synchronization of a product snapshot. */
418
+ get observation(): {
419
+ get: (observationId: string) => Promise<ObservationReceipt>;
420
+ retry: (observationId: string) => Promise<ObservationReceipt>;
421
+ };
422
+ private persistExternalEffect;
423
+ private persistExternalTransition;
424
+ private requireExternalIdentity;
425
+ /**
426
+ * Synchronize a versioned product snapshot without claiming an effect or
427
+ * lifecycle transition. This records no transition history.
428
+ */
429
+ observe<TResult>(mapper: ProjectionMapper<TResult, EffectProjectionResult>, productResult: TResult): Promise<ObservationReceipt>;
392
430
  /**
393
431
  * Mirror product-owned workflow state into Granular without making Granular
394
432
  * own the customer application's state machine.
@@ -829,6 +867,13 @@ declare class EnvironmentSession extends Session {
829
867
  get: (jobId: string) => Promise<SessionJobRecord>;
830
868
  latest: (options?: Pick<SessionJobListOptions, "status">) => Promise<SessionJobRecord | null>;
831
869
  };
870
+ get mutations(): {
871
+ list: (options?: {
872
+ limit?: number;
873
+ }) => Promise<{
874
+ items: SessionMutationView[];
875
+ }>;
876
+ };
832
877
  get artifacts(): {
833
878
  list: (options?: SessionArtifactListOptions) => Promise<SessionCollectionListResult<SessionArtifactRecord>>;
834
879
  listForLatestJob: (options?: Omit<SessionArtifactListOptions, "jobId" | "latestJob">) => Promise<SessionCollectionListResult<SessionArtifactRecord>>;
@@ -840,6 +885,7 @@ declare class EnvironmentSession extends Session {
840
885
  updateInputs: (artifactId: string, patch: {
841
886
  inputValues?: Record<string, unknown>;
842
887
  relationships?: Record<string, string | string[] | null>;
888
+ relationshipLabels?: Record<string, Record<string, string>>;
843
889
  expectedUpdatedAt?: number;
844
890
  }) => Promise<SessionArtifactRecord>;
845
891
  relationshipOptions: (artifactId: string, input: SessionArtifactRelationshipOptionsInput) => Promise<SessionArtifactRelationshipOptionsResult>;
@@ -1,4 +1,4 @@
1
- import { cO as WSClientOptions, Y as SessionFeedApi, b0 as GranularQuotaProgress, T as ToolWithHandler, g as PublishToolsResult, bQ as Job, h as ToolHandler, I as InstanceToolHandler, bT as UserMessageInput, bU as UserMessageAppendResult, bD as EffectInfo, P as Prompt, bC as ToolInfo, bF as EffectsChangedEvent, bE as ToolsChangedEvent, D as DomainState, $ as FeedListTransport, aI as GranularOptions, dk as EnvironmentImporter, aL as RecordUserOptions, aK as User, aN as OpenEnvironmentOptions, bd as EnvironmentData, ba as BuildPolicy, dh as EnvironmentSetupSummary, aT as ConversationSessionListOptions, aR as ConversationSessionInfo, aU as ConversationSessionListResponse, aQ as CreateSessionOptions, cY as RecordObjectOptions, d3 as RecordObjectResult, d5 as RecordObjectsOptions, dc as RecordImport, d8 as RecordImportStatus, db as RecordImportItem, dd as EnvironmentRecordImportSummary, bO as EnvironmentFeedbackRecord, d as SessionHeapSnapshot, cC as SessionDocumentResult, bV as AssistantReplyPublicationInput, bW as AssistantReplyPublicationResult, cD as SessionCollectionListOptions, cF as SessionCollectionListResult, bZ as SessionTimelineEvent, cE as SessionJobListOptions, cv as SessionJobRecord, c6 as SessionArtifactListOptions, c5 as SessionArtifactRecord, c8 as SessionArtifactRelationshipOptionsInput, ca as SessionArtifactRelationshipOptionsResult, cb as SessionArtifactRelationshipCreateInput, c7 as SessionArtifactValidationResult, cd as SessionArtifactExecutionOptions, cc as SessionArtifactExecutionResult, ce as SessionArtifactApprovalOptions, co as RecordManualActionInput, cq as ManualActionRecordResult, cr as ManualActionListOptions, cp as ManualActionOccurrence, ct as ManualActionSuggestionOptions, cs as ManualActionSuggestion, ch as ArtifactApprovalTaskListOptions, cg as ArtifactApprovalTask, ci as ArtifactApprovalDecisionInput, cj as ArtifactApprovalDecisionResult, c1 as SessionFileRecord, cu as SessionFileUploadOptions, S as SessionHeapEntry, b as SessionHeapList, cy as SessionHeapVariable, e as SessionTranscriptEntry, dP as GraphQLResult, cA as RecordSearchOptions, cz as RecordSearchResult, cB as RecordMentionInput, cX as DefineRelationshipOptions, cW as RelationshipInfo, cV as ModelRef, dO as ManifestContent, d0 as EnvironmentStateUpdateInput, c_ as EnvironmentStateTarget, d2 as EnvironmentStateProxy, d7 as RecordImportOptions, cK as UserEnvironmentStateOptions, cJ as UserEnvironmentState, cL as MarkUserEnvironmentReadOptions, aO as AdoptEnvironmentOptions, aP as ConnectOptions, df as RunEnvironmentImporterOptions, au as OpenAIUsageSpendEvent, at as GranularSpendContext, aw as RecordOpenAIUsageSpendResult, b3 as SandboxListResponse, b1 as Sandbox, b2 as CreateSandboxData, dR as DeleteResponse, b5 as PermissionProfile, b6 as CreatePermissionProfileData, be as CreateEnvironmentData, dS as StreamEvent, dT as StreamSubscription, dU as StreamStats, aM as Subject, b9 as AssignmentListResponse } from './spend-DtsHRNb5.js';
1
+ import { de as WSClientOptions, a5 as SessionFeedApi, b9 as GranularQuotaProgress, T as ToolWithHandler, o as PublishToolsResult, cg as Job, p as ToolHandler, I as InstanceToolHandler, cj as UserMessageInput, ck as UserMessageAppendResult, c3 as EffectInfo, l as Prompt, c2 as ToolInfo, c5 as EffectsChangedEvent, c4 as ToolsChangedEvent, D as DomainState, a8 as FeedListTransport, aR as GranularOptions, dM as EnvironmentImporter, aU as RecordUserOptions, aT as User, aW as OpenEnvironmentOptions, bm as EnvironmentData, bj as BuildPolicy, dJ as EnvironmentSetupSummary, b0 as ConversationSessionListOptions, a_ as ConversationSessionInfo, b1 as ConversationSessionListResponse, aZ as CreateSessionOptions, f as RecordObjectOptions, dv as RecordObjectResult, dx as RecordObjectsOptions, dE as RecordImport, dA as RecordImportStatus, dD as RecordImportItem, dF as EnvironmentRecordImportSummary, ce as EnvironmentFeedbackRecord, k as SessionHeapSnapshot, d2 as SessionDocumentResult, cl as AssistantReplyPublicationInput, cm as AssistantReplyPublicationResult, d3 as SessionCollectionListOptions, d5 as SessionCollectionListResult, cp as SessionTimelineEvent, d4 as SessionJobListOptions, cX as SessionJobRecord, bO as SessionMutationView, cy as SessionArtifactListOptions, cx as SessionArtifactRecord, cA as SessionArtifactRelationshipOptionsInput, cC as SessionArtifactRelationshipOptionsResult, cD as SessionArtifactRelationshipCreateInput, cz as SessionArtifactValidationResult, cF as SessionArtifactExecutionOptions, cE as SessionArtifactExecutionResult, cG as SessionArtifactApprovalOptions, cQ as RecordManualActionInput, cS as ManualActionRecordResult, cT as ManualActionListOptions, cR as ManualActionOccurrence, cV as ManualActionSuggestionOptions, cU as ManualActionSuggestion, cJ as ArtifactApprovalTaskListOptions, cI as ArtifactApprovalTask, cK as ArtifactApprovalDecisionInput, cL as ArtifactApprovalDecisionResult, ct as SessionFileRecord, cW as SessionFileUploadOptions, S as SessionHeapEntry, i as SessionHeapList, c_ as SessionHeapVariable, m as SessionTranscriptEntry, ee as GraphQLResult, d0 as RecordSearchOptions, c$ as RecordSearchResult, d1 as RecordMentionInput, dn as DefineRelationshipOptions, dm as RelationshipInfo, dl as ModelRef, g as ManifestContent, ds as EnvironmentStateUpdateInput, dq as EnvironmentStateTarget, du as EnvironmentStateProxy, dz as RecordImportOptions, da as UserEnvironmentStateOptions, d9 as UserEnvironmentState, db as MarkUserEnvironmentReadOptions, b as ProjectionMapper, bH as EffectProjectionResult, bM as ExternalCommitOptions, C as CommitReceipt, bI as TransitionProjectionResult, bN as ObservationReceipt, aX as AdoptEnvironmentOptions, aY as ConnectOptions, dH as RunEnvironmentImporterOptions, aD as OpenAIUsageSpendEvent, aC as GranularSpendContext, aF as RecordOpenAIUsageSpendResult, bc as SandboxListResponse, ba as Sandbox, bb as CreateSandboxData, eg as DeleteResponse, be as PermissionProfile, bf as CreatePermissionProfileData, bn as CreateEnvironmentData, eh as StreamEvent, ei as StreamSubscription, ej as StreamStats, aV as Subject, bi as AssignmentListResponse } from './spend-CESUvrZC.js';
2
2
  import * as Automerge from '@automerge/automerge';
3
3
  import { Doc } from '@automerge/automerge/slim';
4
4
 
@@ -389,6 +389,44 @@ declare class Environment {
389
389
  cancelImport: (importId: string) => Promise<RecordImport>;
390
390
  getAwaitingCount: () => Promise<number>;
391
391
  };
392
+ /**
393
+ * Acknowledge a declared product mutation that already happened outside a
394
+ * Granular-run effect (for example, in a webhook consumer). These methods
395
+ * run the declaration's pure projection mapper; they never call its handler.
396
+ */
397
+ get commit(): {
398
+ effect: <TResult>(effect: ToolWithHandler & {
399
+ commit: {
400
+ kind: "effect";
401
+ project: ProjectionMapper<TResult, EffectProjectionResult>;
402
+ };
403
+ }, productResult: TResult, options?: ExternalCommitOptions) => Promise<CommitReceipt>;
404
+ transition: <TResult>(transition: {
405
+ from: string;
406
+ outcomes: Record<string, unknown>;
407
+ effect: ToolWithHandler & {
408
+ commit: {
409
+ kind: "transition";
410
+ project: ProjectionMapper<TResult, TransitionProjectionResult>;
411
+ };
412
+ };
413
+ }, productResult: TResult, options?: ExternalCommitOptions) => Promise<CommitReceipt>;
414
+ get: (commitId: string) => Promise<CommitReceipt>;
415
+ retry: (commitId: string) => Promise<CommitReceipt>;
416
+ };
417
+ /** Inspect or retry the agent synchronization of a product snapshot. */
418
+ get observation(): {
419
+ get: (observationId: string) => Promise<ObservationReceipt>;
420
+ retry: (observationId: string) => Promise<ObservationReceipt>;
421
+ };
422
+ private persistExternalEffect;
423
+ private persistExternalTransition;
424
+ private requireExternalIdentity;
425
+ /**
426
+ * Synchronize a versioned product snapshot without claiming an effect or
427
+ * lifecycle transition. This records no transition history.
428
+ */
429
+ observe<TResult>(mapper: ProjectionMapper<TResult, EffectProjectionResult>, productResult: TResult): Promise<ObservationReceipt>;
392
430
  /**
393
431
  * Mirror product-owned workflow state into Granular without making Granular
394
432
  * own the customer application's state machine.
@@ -829,6 +867,13 @@ declare class EnvironmentSession extends Session {
829
867
  get: (jobId: string) => Promise<SessionJobRecord>;
830
868
  latest: (options?: Pick<SessionJobListOptions, "status">) => Promise<SessionJobRecord | null>;
831
869
  };
870
+ get mutations(): {
871
+ list: (options?: {
872
+ limit?: number;
873
+ }) => Promise<{
874
+ items: SessionMutationView[];
875
+ }>;
876
+ };
832
877
  get artifacts(): {
833
878
  list: (options?: SessionArtifactListOptions) => Promise<SessionCollectionListResult<SessionArtifactRecord>>;
834
879
  listForLatestJob: (options?: Omit<SessionArtifactListOptions, "jobId" | "latestJob">) => Promise<SessionCollectionListResult<SessionArtifactRecord>>;
@@ -840,6 +885,7 @@ declare class EnvironmentSession extends Session {
840
885
  updateInputs: (artifactId: string, patch: {
841
886
  inputValues?: Record<string, unknown>;
842
887
  relationships?: Record<string, string | string[] | null>;
888
+ relationshipLabels?: Record<string, Record<string, string>>;
843
889
  expectedUpdatedAt?: number;
844
890
  }) => Promise<SessionArtifactRecord>;
845
891
  relationshipOptions: (artifactId: string, input: SessionArtifactRelationshipOptionsInput) => Promise<SessionArtifactRelationshipOptionsResult>;
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- export { E as Environment, a as EnvironmentSession, G as Granular, O as OntologyHandle, S as Session, W as WSClient } from './client-lk-dmdKR.mjs';
2
- import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, F as FeedPublishTransport, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as FeedItem, d as SessionHeapSnapshot, P as Prompt, e as SessionTranscriptEntry } from './spend-DtsHRNb5.mjs';
3
- export { dQ as APIError, aH as AccessTokenProvider, C as ActionSuggestionFeedItem, aO as AdoptEnvironmentOptions, ci as ArtifactApprovalDecisionInput, cj as ArtifactApprovalDecisionResult, cg as ArtifactApprovalTask, ch as ArtifactApprovalTaskListOptions, cf as ArtifactApprovalTaskStatus, A as ArtifactFeedItem, bx as ArtifactOptionsHandler, b8 as Assignment, b9 as AssignmentListResponse, bV as AssistantReplyPublicationInput, bW as AssistantReplyPublicationResult, bj as Build, bl as BuildListResponse, ba as BuildPolicy, bi as BuildStatus, aD as ConditionIR, aP as ConnectOptions, aR as ConversationSessionInfo, aT as ConversationSessionListOptions, aU as ConversationSessionListResponse, aS as ConversationSessionListStatus, be as CreateEnvironmentData, b6 as CreatePermissionProfileData, b2 as CreateSandboxData, aQ as CreateSessionOptions, cX as DefineRelationshipOptions, dR as DeleteResponse, D as DomainState, bt as EffectArtifactOptionsInvocation, bv as EffectArtifactRelationshipOption, bw as EffectArtifactRelationshipOptionsResult, bG as EffectHandler, bD as EffectInfo, bu as EffectInvocationMetadata, bs as EffectInvocationMode, by as EffectSchema, bB as EffectVersionSelector, bz as EffectWithHandler, bF as EffectsChangedEvent, bd as EnvironmentData, bO as EnvironmentFeedbackRecord, dk as EnvironmentImporter, dj as EnvironmentImporterImportOptions, bf as EnvironmentListResponse, dd as EnvironmentRecordImportSummary, di as EnvironmentSetupImporterClaim, dg as EnvironmentSetupLifecycleStatus, dh as EnvironmentSetupSummary, de as EnvironmentSetupTriggerReason, d1 as EnvironmentStateMachineProxy, c$ as EnvironmentStateObservationInput, d2 as EnvironmentStateProxy, c_ as EnvironmentStateTarget, d0 as EnvironmentStateUpdateInput, a1 as FeedDiagnostic, a2 as FeedDiagnosticListener, a9 as FeedDocumentState, l as FeedFeedbackTone, z as FeedFileSource, k as FeedIconToken, p as FeedItemBase, n as FeedItemKind, U as FeedListOptions, $ as FeedListTransport, s as FeedObjectReference, V as FeedPage, ak as FeedPublisher, Q as FeedSnapshot, a0 as FeedSnapshotRegressionReason, j as FeedSource, i as FeedSourceActor, W as FeedSubscribeOptions, X as FeedSubscriptionChange, t as FeedTableCell, u as FeedTableColumn, x as FeedTableProjection, w as FeedTableRow, v as FeedTableRowReference, o as FeedTarget, m as FeedTransientFeedbackTone, r as FeedbackFeedItem, B as FileFeedItem, a3 as GRANULAR_FEED_DIAGNOSTIC_EVENT, aJ as GranularAuth, aI as GranularOptions, a$ as GranularQuotaPolicy, b0 as GranularQuotaProgress, at as GranularSpendContext, dP as GraphQLResult, bH as InstanceEffectHandler, I as InstanceToolHandler, bQ as Job, bM as JobFeedbackInput, bL as JobFeedbackMetadata, bN as JobFeedbackRecord, bJ as JobFeedbackSentiment, bK as JobFeedbackToolCall, bI as JobStatus, bP as JobSubmitResult, bg as Manifest, dE as ManifestApprovalRequiredSpec, dO as ManifestContent, dF as ManifestCreatesSpec, dC as ManifestDryRunSpec, dI as ManifestEffectDeclaration, dH as ManifestEffectSchema, dn as ManifestEnumRuleSpec, dK as ManifestEventStreamDef, dJ as ManifestEventTypeDef, dp as ManifestFilterBySpec, dM as ManifestImport, bh as ManifestListResponse, dL as ManifestOperation, dB as ManifestPostConditionSpec, dl as ManifestPropertySpec, dG as ManifestRelationshipDef, dD as ManifestReverseSpec, dA as ManifestStateMachineSpec, dr as ManifestStateMachineStateSpec, dz as ManifestStateMachineTransitionSpec, dt as ManifestStateTransitionActionSpec, du as ManifestStateTransitionAssigneeSpec, dy as ManifestStateTransitionExpectedOutcomeSpec, ds as ManifestStateTransitionInputBinding, dx as ManifestStateTransitionPermissionSpec, dv as ManifestStateTransitionRelatedStateRequirementSpec, dw as ManifestStateTransitionRequirementsSpec, dm as ManifestValidationOperator, dq as ManifestValidationRuleSpec, dN as ManifestVolume, cr as ManualActionListOptions, cp as ManualActionOccurrence, cq as ManualActionRecordResult, cn as ManualActionRelatedRecord, cl as ManualActionSource, ck as ManualActionStatus, cs as ManualActionSuggestion, ct as ManualActionSuggestionOptions, cm as ManualActionTarget, cL as MarkUserEnvironmentReadOptions, aG as MatchedPolicy, q as MessageFeedItem, cV as ModelRef, an as NormalizedOpenAIUsage, N as NormalizedSuggestedArtifact, ap as OPENAI_MODEL_PRICING_USD_PER_MILLION, O as ObjectsFeedItem, am as OpenAIModelPricing, ao as OpenAITokenSpend, au as OpenAIUsageSpendEvent, aN as OpenEnvironmentOptions, b5 as PermissionProfile, b7 as PermissionProfileListResponse, b4 as PermissionRules, aC as PolicyOperator, aE as PolicyOrigin, aB as PolicyPredicateSource, aF as PolicyRuleIR, aA as PolicySource, G as PromptFeedItem, bA as PublishEffectsResult, ag as PublishFeedbackOptions, g as PublishToolsResult, ah as PublishTransientFeedbackOptions, a_ as QuotaLineItemFilter, aX as QuotaPeriod, aW as QuotaScopeType, aY as QuotaStatus, cP as RPCRequest, cS as RPCRequestFromServer, cQ as RPCResponse, dc as RecordImport, db as RecordImportItem, d9 as RecordImportItemStatus, d7 as RecordImportOptions, da as RecordImportStats, d8 as RecordImportStatus, d6 as RecordImportWriteMode, co as RecordManualActionInput, cB as RecordMentionInput, cY as RecordObjectOptions, d3 as RecordObjectResult, cZ as RecordObjectStateValue, d4 as RecordObjectsChunkInfo, d5 as RecordObjectsOptions, av as RecordOpenAIUsageSpendOptions, aw as RecordOpenAIUsageSpendResult, cA as RecordSearchOptions, cz as RecordSearchResult, aL as RecordUserOptions, cW as RelationshipInfo, br as ResolvedEffectApprovalRequired, bp as ResolvedEffectDryRun, bo as ResolvedEffectPostCondition, bq as ResolvedEffectReverse, df as RunEnvironmentImporterOptions, b1 as Sandbox, b3 as SandboxListResponse, bn as SemanticVersionDiff, bm as SemanticVersionDiffEntry, ce as SessionArtifactApprovalOptions, c4 as SessionArtifactAutonomyPolicy, cd as SessionArtifactExecutionOptions, cc as SessionArtifactExecutionResult, c3 as SessionArtifactKind, c6 as SessionArtifactListOptions, c5 as SessionArtifactRecord, cb as SessionArtifactRelationshipCreateInput, c9 as SessionArtifactRelationshipOption, c8 as SessionArtifactRelationshipOptionsInput, ca as SessionArtifactRelationshipOptionsResult, c2 as SessionArtifactStatus, c7 as SessionArtifactValidationResult, cD as SessionCollectionListOptions, cF as SessionCollectionListResult, cC as SessionDocumentResult, Y as SessionFeedApi, af as SessionFeedController, a8 as SessionFeedControllerOptions, b$ as SessionFileKind, c1 as SessionFileRecord, b_ as SessionFileSource, c0 as SessionFileStatus, cu as SessionFileUploadOptions, cw as SessionHeapFieldType, cx as SessionHeapFieldValue, cy as SessionHeapVariable, cE as SessionJobListOptions, cv as SessionJobRecord, bZ as SessionTimelineEvent, bX as SessionTranscriptActionSuggestion, bY as SessionTranscriptShowRefs, ai as SettleTransientFeedbackOptions, cR as SnapshotResetMessage, aV as SpendLineItemType, aZ as SpendSummary, dS as StreamEvent, dU as StreamStats, dT as StreamSubscription, aM as Subject, y as TableFeedItem, h as ToolHandler, bC as ToolInfo, cT as ToolInvokeParams, cU as ToolResultParams, f as ToolSchema, bE as ToolsChangedEvent, L as TransientFeedItem, H as TransientFeedItemBase, K as TransientFeedbackFeedItem, aj as TransientFeedbackHandle, J as TransientMessageFeedItem, aK as User, cH as UserEnvironmentMessagePreview, cG as UserEnvironmentPrompt, cI as UserEnvironmentSessionState, cJ as UserEnvironmentState, cK as UserEnvironmentStateOptions, bU as UserMessageAppendResult, bT as UserMessageInput, bR as UserMessageShowRefs, bS as UserMessageTarget, bk as Version, bc as VersionTag, bb as VersionTracking, cO as WSClientOptions, cM as WSDisconnectInfo, cN as WSReconnectErrorInfo, ay as buildOpenAISpendEventId, as as calculateOpenAITokenSpend, al as createFeedPublisher, a7 as emitFeedDiagnostic, a6 as emitFeedDiagnosticToDefaultSink, aa as emptyFeedSnapshot, aq as getOpenAIModelPricing, ab as hasCanonicalSessionFeedActivation, ac as isCanonicalSessionFeedDocument, Z as mergeFeedItemsBySequence, a5 as normalizeFeedDiagnostic, a4 as normalizeFeedDiagnosticKind, ae as normalizeFeedPage, ar as normalizeOpenAIUsage, _ as orderTransientFeedItems, ad as readSessionFeedSnapshot, az as recordOpenAIUsageSpend, ax as toGranularHttpBase } from './spend-DtsHRNb5.mjs';
1
+ export { E as Environment, a as EnvironmentSession, G as Granular, O as OntologyHandle, S as Session, W as WSClient } from './client-S-z8bri1.mjs';
2
+ import { E as EndpointMode, a as EffectCommitRequest, C as CommitReceipt, T as ToolWithHandler, P as ProjectionResult, b as ProjectionMapper, c as CommitTransitionOutcomeDeclaration, d as CommitDeclaration, e as EffectHandlerContext, F as FeedPublishTransport, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, f as RecordObjectOptions, g as ManifestContent, h as CommitTransitionInvocation, S as SessionHeapEntry, i as SessionHeapList, j as FeedItem, k as SessionHeapSnapshot, l as Prompt, m as SessionTranscriptEntry } from './spend-CESUvrZC.mjs';
3
+ export { ef as APIError, aQ as AccessTokenProvider, W as ActionSuggestionFeedItem, aX as AdoptEnvironmentOptions, bJ as AgentCommitStatus, cK as ArtifactApprovalDecisionInput, cL as ArtifactApprovalDecisionResult, cI as ArtifactApprovalTask, cJ as ArtifactApprovalTaskListOptions, cH as ArtifactApprovalTaskStatus, N as ArtifactFeedItem, bZ as ArtifactOptionsHandler, bh as Assignment, bi as AssignmentListResponse, cl as AssistantReplyPublicationInput, cm as AssistantReplyPublicationResult, bG as BaseProjectionResult, bs as Build, bu as BuildListResponse, bj as BuildPolicy, br as BuildStatus, bB as CanonicalProjectedRecord, bK as CommitChangeReceipt, bz as CommitSafeError, bL as CommitTransitionReceipt, aM as ConditionIR, aY as ConnectOptions, a_ as ConversationSessionInfo, b0 as ConversationSessionListOptions, b1 as ConversationSessionListResponse, a$ as ConversationSessionListStatus, bn as CreateEnvironmentData, bf as CreatePermissionProfileData, bb as CreateSandboxData, aZ as CreateSessionOptions, dn as DefineRelationshipOptions, eg as DeleteResponse, D as DomainState, bV as EffectArtifactOptionsInvocation, bX as EffectArtifactRelationshipOption, bY as EffectArtifactRelationshipOptionsResult, bP as EffectCommitContext, c6 as EffectHandler, c3 as EffectInfo, bW as EffectInvocationMetadata, bU as EffectInvocationMode, bH as EffectProjectionResult, b_ as EffectSchema, c1 as EffectVersionSelector, b$ as EffectWithHandler, c5 as EffectsChangedEvent, bm as EnvironmentData, ce as EnvironmentFeedbackRecord, dM as EnvironmentImporter, dL as EnvironmentImporterImportOptions, bo as EnvironmentListResponse, dF as EnvironmentRecordImportSummary, dK as EnvironmentSetupImporterClaim, dI as EnvironmentSetupLifecycleStatus, dJ as EnvironmentSetupSummary, dG as EnvironmentSetupTriggerReason, dt as EnvironmentStateMachineProxy, dr as EnvironmentStateObservationInput, du as EnvironmentStateProxy, dq as EnvironmentStateTarget, ds as EnvironmentStateUpdateInput, bM as ExternalCommitOptions, aa as FeedDiagnostic, ab as FeedDiagnosticListener, ai as FeedDocumentState, t as FeedFeedbackTone, Q as FeedFileSource, s as FeedIconToken, x as FeedItemBase, v as FeedItemKind, a1 as FeedListOptions, a8 as FeedListTransport, A as FeedObjectReference, a2 as FeedPage, at as FeedPublisher, a0 as FeedSnapshot, a9 as FeedSnapshotRegressionReason, r as FeedSource, q as FeedSourceActor, a3 as FeedSubscribeOptions, a4 as FeedSubscriptionChange, B as FeedTableCell, G as FeedTableColumn, K as FeedTableProjection, J as FeedTableRow, H as FeedTableRowReference, w as FeedTarget, u as FeedTransientFeedbackTone, z as FeedbackFeedItem, U as FileFeedItem, ac as GRANULAR_FEED_DIAGNOSTIC_EVENT, aS as GranularAuth, aR as GranularOptions, b8 as GranularQuotaPolicy, b9 as GranularQuotaProgress, aC as GranularSpendContext, ee as GraphQLResult, c7 as InstanceEffectHandler, I as InstanceToolHandler, cg as Job, cc as JobFeedbackInput, cb as JobFeedbackMetadata, cd as JobFeedbackRecord, c9 as JobFeedbackSentiment, ca as JobFeedbackToolCall, c8 as JobStatus, cf as JobSubmitResult, bp 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, bq 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, cT as ManualActionListOptions, cR as ManualActionOccurrence, cS as ManualActionRecordResult, cP as ManualActionRelatedRecord, cN as ManualActionSource, cM as ManualActionStatus, cU as ManualActionSuggestion, cV as ManualActionSuggestionOptions, cO as ManualActionTarget, db as MarkUserEnvironmentReadOptions, aP as MatchedPolicy, y as MessageFeedItem, dl as ModelRef, aw as NormalizedOpenAIUsage, V as NormalizedSuggestedArtifact, ay as OPENAI_MODEL_PRICING_USD_PER_MILLION, bC as ObjectProjectionChange, bx as ObjectReference, O as ObjectsFeedItem, bN as ObservationReceipt, av as OpenAIModelPricing, ax as OpenAITokenSpend, aD as OpenAIUsageSpendEvent, aW as OpenEnvironmentOptions, be as PermissionProfile, bg as PermissionProfileListResponse, bd as PermissionRules, aL as PolicyOperator, aN as PolicyOrigin, aK as PolicyPredicateSource, aO as PolicyRuleIR, aJ as PolicySource, bF as ProjectionChange, X as PromptFeedItem, c0 as PublishEffectsResult, ap as PublishFeedbackOptions, o as PublishToolsResult, aq as PublishTransientFeedbackOptions, b7 as QuotaLineItemFilter, b4 as QuotaPeriod, b3 as QuotaScopeType, b5 as QuotaStatus, df as RPCRequest, di as RPCRequestFromServer, dg as RPCResponse, dE as RecordImport, dD as RecordImportItem, dB as RecordImportItemStatus, dz as RecordImportOptions, dC as RecordImportStats, dA as RecordImportStatus, dy as RecordImportWriteMode, cQ as RecordManualActionInput, d1 as RecordMentionInput, dv as RecordObjectResult, dp as RecordObjectStateValue, dw as RecordObjectsChunkInfo, dx as RecordObjectsOptions, aE as RecordOpenAIUsageSpendOptions, aF as RecordOpenAIUsageSpendResult, d0 as RecordSearchOptions, c$ as RecordSearchResult, aU as RecordUserOptions, dm as RelationshipInfo, bD as RelationshipProjectionChange, bT as ResolvedEffectApprovalRequired, bR as ResolvedEffectDryRun, bQ as ResolvedEffectPostCondition, bS as ResolvedEffectReverse, dH as RunEnvironmentImporterOptions, ba as Sandbox, bc as SandboxListResponse, bw as SemanticVersionDiff, bv as SemanticVersionDiffEntry, cG as SessionArtifactApprovalOptions, cw as SessionArtifactAutonomyPolicy, cF as SessionArtifactExecutionOptions, cE as SessionArtifactExecutionResult, cv as SessionArtifactKind, cy as SessionArtifactListOptions, cx as SessionArtifactRecord, cD as SessionArtifactRelationshipCreateInput, cB as SessionArtifactRelationshipOption, cA as SessionArtifactRelationshipOptionsInput, cC as SessionArtifactRelationshipOptionsResult, cu as SessionArtifactStatus, cz as SessionArtifactValidationResult, d3 as SessionCollectionListOptions, d5 as SessionCollectionListResult, d2 as SessionDocumentResult, a5 as SessionFeedApi, ao as SessionFeedController, ah as SessionFeedControllerOptions, cr as SessionFileKind, ct as SessionFileRecord, cq as SessionFileSource, cs as SessionFileStatus, cW as SessionFileUploadOptions, cY as SessionHeapFieldType, cZ as SessionHeapFieldValue, c_ as SessionHeapVariable, d4 as SessionJobListOptions, cX as SessionJobRecord, bO as SessionMutationView, cp as SessionTimelineEvent, cn as SessionTranscriptActionSuggestion, co as SessionTranscriptShowRefs, ar as SettleTransientFeedbackOptions, dh as SnapshotResetMessage, by as SourceAcknowledgement, b2 as SpendLineItemType, b6 as SpendSummary, bE as StateObservationProjectionChange, eh as StreamEvent, ej as StreamStats, ei as StreamSubscription, aV as Subject, L as TableFeedItem, p as ToolHandler, c2 as ToolInfo, dj as ToolInvokeParams, dk as ToolResultParams, n as ToolSchema, c4 as ToolsChangedEvent, $ as TransientFeedItem, Y as TransientFeedItemBase, _ as TransientFeedbackFeedItem, as as TransientFeedbackHandle, Z as TransientMessageFeedItem, bA as TransitionOutcomeProjection, bI as TransitionProjectionResult, aT as User, d7 as UserEnvironmentMessagePreview, d6 as UserEnvironmentPrompt, d8 as UserEnvironmentSessionState, d9 as UserEnvironmentState, da as UserEnvironmentStateOptions, ck as UserMessageAppendResult, cj as UserMessageInput, ch as UserMessageShowRefs, ci as UserMessageTarget, bt as Version, bl as VersionTag, bk as VersionTracking, de as WSClientOptions, dc as WSDisconnectInfo, dd as WSReconnectErrorInfo, aH as buildOpenAISpendEventId, aB as calculateOpenAITokenSpend, au as createFeedPublisher, ag as emitFeedDiagnostic, af as emitFeedDiagnosticToDefaultSink, aj as emptyFeedSnapshot, az as getOpenAIModelPricing, ak as hasCanonicalSessionFeedActivation, al as isCanonicalSessionFeedDocument, a6 as mergeFeedItemsBySequence, ae as normalizeFeedDiagnostic, ad as normalizeFeedDiagnosticKind, an as normalizeFeedPage, aA as normalizeOpenAIUsage, a7 as orderTransientFeedItems, am as readSessionFeedSnapshot, aI as recordOpenAIUsageSpend, aG as toGranularHttpBase } from './spend-CESUvrZC.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';
@@ -20,11 +20,49 @@ declare function isLocalApiUrl(url: string): boolean;
20
20
  declare function resolveAuthTokenForApiUrl(authToken: string, apiUrl: string): string;
21
21
  declare function resolveApiUrl(explicitApiUrl?: string, mode?: EndpointMode): string;
22
22
 
23
+ interface StateMachineDefinition {
24
+ name: string;
25
+ label?: string;
26
+ states: Record<string, {
27
+ label?: string;
28
+ isFinal?: boolean;
29
+ }>;
30
+ transitions: Record<string, {
31
+ label?: string;
32
+ from: string;
33
+ effect: ToolWithHandler;
34
+ outcomes: Record<string, CommitTransitionOutcomeDeclaration>;
35
+ }>;
36
+ }
37
+ type DefinedStateMachine<TDefinition extends StateMachineDefinition = StateMachineDefinition> = TDefinition & {
38
+ transitions: TDefinition["transitions"];
39
+ };
40
+ interface CommitTransport {
41
+ persist(request: EffectCommitRequest): Promise<CommitReceipt>;
42
+ mappingFailed?(input: {
43
+ effectKey: string;
44
+ effectName: string;
45
+ invocationId: string;
46
+ idempotencyKey: string;
47
+ environmentId: string;
48
+ message: string;
49
+ }): Promise<void>;
50
+ }
51
+ declare function defineProjection<TResult, TProjection extends ProjectionResult = ProjectionResult>(mapper: ProjectionMapper<TResult, TProjection>): ProjectionMapper<TResult, TProjection>;
52
+ declare function defineEffect<TEffect extends ToolWithHandler>(effect: TEffect): TEffect;
53
+ declare function defineStateMachine<const TDefinition extends StateMachineDefinition>(definition: TDefinition): DefinedStateMachine<TDefinition>;
54
+ declare function validateProjectionResult(declaration: CommitDeclaration<any>, projection: ProjectionResult): void;
55
+ /** Stable JSON used by tests, fingerprints, and source-event conflict checks. */
56
+ declare function canonicalizeCommitValue(value: unknown): string;
57
+
58
+ type EffectRuntimeWireContext = Omit<EffectHandlerContext, "commit"> & {
59
+ commit?: never;
60
+ };
23
61
  type EffectRuntimeRequest = {
24
62
  effectKey: string;
25
63
  effectName: string;
26
64
  input: unknown;
27
- context?: EffectHandlerContext;
65
+ context?: EffectRuntimeWireContext;
28
66
  };
29
67
  interface EffectRuntimeFeedbackBridge {
30
68
  /** Ephemeral registry capability for this one active invocation. */
@@ -33,10 +71,39 @@ interface EffectRuntimeFeedbackBridge {
33
71
  }
34
72
  interface InvokeRegisteredEffectOptions {
35
73
  feedback?: EffectRuntimeFeedbackBridge;
74
+ /** Durable product-acknowledgement transport for declared write effects. */
75
+ commit?: CommitTransport;
76
+ /** Internal effect-host hook used to return the durable receipt separately from the product result. */
77
+ commitAcknowledged?: (receipt: CommitReceipt) => void | Promise<void>;
36
78
  }
37
79
  declare function normalizeEffectBehaviors(value?: ManifestEffectMetamodelSpec | ResolvedEffectBehaviors | null): ResolvedEffectBehaviors;
38
80
  declare function invokeRegisteredEffect(effectMap: Map<string, ToolWithHandler>, request: EffectRuntimeRequest, options?: InvokeRegisteredEffectOptions): Promise<unknown>;
39
81
 
82
+ interface RecordSnapshotCommitSource {
83
+ reference: string;
84
+ version?: string;
85
+ beforeRecords: RecordObjectOptions[];
86
+ afterRecords: RecordObjectOptions[];
87
+ }
88
+ /**
89
+ * Keeps only records whose canonical projection changed. This is useful for
90
+ * persisting bounded, replayable mapper input beside a product mutation.
91
+ */
92
+ declare function changedRecordSnapshots(beforeRecords: RecordObjectOptions[], afterRecords: RecordObjectOptions[]): Pick<RecordSnapshotCommitSource, "beforeRecords" | "afterRecords">;
93
+ /**
94
+ * Deterministically maps a persisted before/after product snapshot to commit
95
+ * changes. It performs no I/O and never guesses ontology labels or paths.
96
+ */
97
+ declare function projectRecordSnapshotMutation(input: {
98
+ manifest: ManifestContent;
99
+ effect: ToolWithHandler;
100
+ effectInput: unknown;
101
+ result: unknown;
102
+ source: RecordSnapshotCommitSource;
103
+ commitKind: "effect" | "transition";
104
+ transition?: CommitTransitionInvocation;
105
+ }): ProjectionResult;
106
+
40
107
  interface ValidationRuleEvaluationInput {
41
108
  operator?: string | null;
42
109
  stringValue?: string;
@@ -196,4 +263,4 @@ declare function buildSessionTranscript(input: {
196
263
  canonicalFeedItems?: FeedItem[];
197
264
  }): SessionTranscriptEntry[];
198
265
 
199
- export { type ConditionalPolicySpec, EffectHandlerContext, EndpointMode, FeedItem, FeedPublishTransport, type JobPresentation, type LimitPolicySpec, ManifestEffectMetamodelSpec, type NormalizedPromptChoiceOption, type PermissionActionSpec, type PermissionPolicySpec, type PermissionProfileFile, type PolicyDecision, type PolicyEvaluationContext, type PolicyOutcome, Prompt, ResolvedEffectBehaviors, SessionHeapEntry, SessionHeapList, SessionHeapSnapshot, SessionTranscriptEntry, ToolWithHandler, type ValidationRuleEvaluationInput, type ValidationRuleEvaluationResult, buildSessionTranscript, buildSessionTranscriptFromFeedItems, evaluateValidationRule, extractPromptTokens, invokeRegisteredEffect, isLocalApiUrl, normalizeEffectBehaviors, normalizePrompt, normalizePromptChoiceOption, normalizePromptText, normalizePromptType, resolveApiUrl, resolveAuthTokenForApiUrl, resolveJobPresentation, resolvePromptAnswer, scorePromptChoiceMatch, validationRuleFailureMessage };
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 };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { E as Environment, a as EnvironmentSession, G as Granular, O as OntologyHandle, S as Session, W as WSClient } from './client-KqJIH7WE.js';
2
- import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, F as FeedPublishTransport, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as FeedItem, d as SessionHeapSnapshot, P as Prompt, e as SessionTranscriptEntry } from './spend-DtsHRNb5.js';
3
- export { dQ as APIError, aH as AccessTokenProvider, C as ActionSuggestionFeedItem, aO as AdoptEnvironmentOptions, ci as ArtifactApprovalDecisionInput, cj as ArtifactApprovalDecisionResult, cg as ArtifactApprovalTask, ch as ArtifactApprovalTaskListOptions, cf as ArtifactApprovalTaskStatus, A as ArtifactFeedItem, bx as ArtifactOptionsHandler, b8 as Assignment, b9 as AssignmentListResponse, bV as AssistantReplyPublicationInput, bW as AssistantReplyPublicationResult, bj as Build, bl as BuildListResponse, ba as BuildPolicy, bi as BuildStatus, aD as ConditionIR, aP as ConnectOptions, aR as ConversationSessionInfo, aT as ConversationSessionListOptions, aU as ConversationSessionListResponse, aS as ConversationSessionListStatus, be as CreateEnvironmentData, b6 as CreatePermissionProfileData, b2 as CreateSandboxData, aQ as CreateSessionOptions, cX as DefineRelationshipOptions, dR as DeleteResponse, D as DomainState, bt as EffectArtifactOptionsInvocation, bv as EffectArtifactRelationshipOption, bw as EffectArtifactRelationshipOptionsResult, bG as EffectHandler, bD as EffectInfo, bu as EffectInvocationMetadata, bs as EffectInvocationMode, by as EffectSchema, bB as EffectVersionSelector, bz as EffectWithHandler, bF as EffectsChangedEvent, bd as EnvironmentData, bO as EnvironmentFeedbackRecord, dk as EnvironmentImporter, dj as EnvironmentImporterImportOptions, bf as EnvironmentListResponse, dd as EnvironmentRecordImportSummary, di as EnvironmentSetupImporterClaim, dg as EnvironmentSetupLifecycleStatus, dh as EnvironmentSetupSummary, de as EnvironmentSetupTriggerReason, d1 as EnvironmentStateMachineProxy, c$ as EnvironmentStateObservationInput, d2 as EnvironmentStateProxy, c_ as EnvironmentStateTarget, d0 as EnvironmentStateUpdateInput, a1 as FeedDiagnostic, a2 as FeedDiagnosticListener, a9 as FeedDocumentState, l as FeedFeedbackTone, z as FeedFileSource, k as FeedIconToken, p as FeedItemBase, n as FeedItemKind, U as FeedListOptions, $ as FeedListTransport, s as FeedObjectReference, V as FeedPage, ak as FeedPublisher, Q as FeedSnapshot, a0 as FeedSnapshotRegressionReason, j as FeedSource, i as FeedSourceActor, W as FeedSubscribeOptions, X as FeedSubscriptionChange, t as FeedTableCell, u as FeedTableColumn, x as FeedTableProjection, w as FeedTableRow, v as FeedTableRowReference, o as FeedTarget, m as FeedTransientFeedbackTone, r as FeedbackFeedItem, B as FileFeedItem, a3 as GRANULAR_FEED_DIAGNOSTIC_EVENT, aJ as GranularAuth, aI as GranularOptions, a$ as GranularQuotaPolicy, b0 as GranularQuotaProgress, at as GranularSpendContext, dP as GraphQLResult, bH as InstanceEffectHandler, I as InstanceToolHandler, bQ as Job, bM as JobFeedbackInput, bL as JobFeedbackMetadata, bN as JobFeedbackRecord, bJ as JobFeedbackSentiment, bK as JobFeedbackToolCall, bI as JobStatus, bP as JobSubmitResult, bg as Manifest, dE as ManifestApprovalRequiredSpec, dO as ManifestContent, dF as ManifestCreatesSpec, dC as ManifestDryRunSpec, dI as ManifestEffectDeclaration, dH as ManifestEffectSchema, dn as ManifestEnumRuleSpec, dK as ManifestEventStreamDef, dJ as ManifestEventTypeDef, dp as ManifestFilterBySpec, dM as ManifestImport, bh as ManifestListResponse, dL as ManifestOperation, dB as ManifestPostConditionSpec, dl as ManifestPropertySpec, dG as ManifestRelationshipDef, dD as ManifestReverseSpec, dA as ManifestStateMachineSpec, dr as ManifestStateMachineStateSpec, dz as ManifestStateMachineTransitionSpec, dt as ManifestStateTransitionActionSpec, du as ManifestStateTransitionAssigneeSpec, dy as ManifestStateTransitionExpectedOutcomeSpec, ds as ManifestStateTransitionInputBinding, dx as ManifestStateTransitionPermissionSpec, dv as ManifestStateTransitionRelatedStateRequirementSpec, dw as ManifestStateTransitionRequirementsSpec, dm as ManifestValidationOperator, dq as ManifestValidationRuleSpec, dN as ManifestVolume, cr as ManualActionListOptions, cp as ManualActionOccurrence, cq as ManualActionRecordResult, cn as ManualActionRelatedRecord, cl as ManualActionSource, ck as ManualActionStatus, cs as ManualActionSuggestion, ct as ManualActionSuggestionOptions, cm as ManualActionTarget, cL as MarkUserEnvironmentReadOptions, aG as MatchedPolicy, q as MessageFeedItem, cV as ModelRef, an as NormalizedOpenAIUsage, N as NormalizedSuggestedArtifact, ap as OPENAI_MODEL_PRICING_USD_PER_MILLION, O as ObjectsFeedItem, am as OpenAIModelPricing, ao as OpenAITokenSpend, au as OpenAIUsageSpendEvent, aN as OpenEnvironmentOptions, b5 as PermissionProfile, b7 as PermissionProfileListResponse, b4 as PermissionRules, aC as PolicyOperator, aE as PolicyOrigin, aB as PolicyPredicateSource, aF as PolicyRuleIR, aA as PolicySource, G as PromptFeedItem, bA as PublishEffectsResult, ag as PublishFeedbackOptions, g as PublishToolsResult, ah as PublishTransientFeedbackOptions, a_ as QuotaLineItemFilter, aX as QuotaPeriod, aW as QuotaScopeType, aY as QuotaStatus, cP as RPCRequest, cS as RPCRequestFromServer, cQ as RPCResponse, dc as RecordImport, db as RecordImportItem, d9 as RecordImportItemStatus, d7 as RecordImportOptions, da as RecordImportStats, d8 as RecordImportStatus, d6 as RecordImportWriteMode, co as RecordManualActionInput, cB as RecordMentionInput, cY as RecordObjectOptions, d3 as RecordObjectResult, cZ as RecordObjectStateValue, d4 as RecordObjectsChunkInfo, d5 as RecordObjectsOptions, av as RecordOpenAIUsageSpendOptions, aw as RecordOpenAIUsageSpendResult, cA as RecordSearchOptions, cz as RecordSearchResult, aL as RecordUserOptions, cW as RelationshipInfo, br as ResolvedEffectApprovalRequired, bp as ResolvedEffectDryRun, bo as ResolvedEffectPostCondition, bq as ResolvedEffectReverse, df as RunEnvironmentImporterOptions, b1 as Sandbox, b3 as SandboxListResponse, bn as SemanticVersionDiff, bm as SemanticVersionDiffEntry, ce as SessionArtifactApprovalOptions, c4 as SessionArtifactAutonomyPolicy, cd as SessionArtifactExecutionOptions, cc as SessionArtifactExecutionResult, c3 as SessionArtifactKind, c6 as SessionArtifactListOptions, c5 as SessionArtifactRecord, cb as SessionArtifactRelationshipCreateInput, c9 as SessionArtifactRelationshipOption, c8 as SessionArtifactRelationshipOptionsInput, ca as SessionArtifactRelationshipOptionsResult, c2 as SessionArtifactStatus, c7 as SessionArtifactValidationResult, cD as SessionCollectionListOptions, cF as SessionCollectionListResult, cC as SessionDocumentResult, Y as SessionFeedApi, af as SessionFeedController, a8 as SessionFeedControllerOptions, b$ as SessionFileKind, c1 as SessionFileRecord, b_ as SessionFileSource, c0 as SessionFileStatus, cu as SessionFileUploadOptions, cw as SessionHeapFieldType, cx as SessionHeapFieldValue, cy as SessionHeapVariable, cE as SessionJobListOptions, cv as SessionJobRecord, bZ as SessionTimelineEvent, bX as SessionTranscriptActionSuggestion, bY as SessionTranscriptShowRefs, ai as SettleTransientFeedbackOptions, cR as SnapshotResetMessage, aV as SpendLineItemType, aZ as SpendSummary, dS as StreamEvent, dU as StreamStats, dT as StreamSubscription, aM as Subject, y as TableFeedItem, h as ToolHandler, bC as ToolInfo, cT as ToolInvokeParams, cU as ToolResultParams, f as ToolSchema, bE as ToolsChangedEvent, L as TransientFeedItem, H as TransientFeedItemBase, K as TransientFeedbackFeedItem, aj as TransientFeedbackHandle, J as TransientMessageFeedItem, aK as User, cH as UserEnvironmentMessagePreview, cG as UserEnvironmentPrompt, cI as UserEnvironmentSessionState, cJ as UserEnvironmentState, cK as UserEnvironmentStateOptions, bU as UserMessageAppendResult, bT as UserMessageInput, bR as UserMessageShowRefs, bS as UserMessageTarget, bk as Version, bc as VersionTag, bb as VersionTracking, cO as WSClientOptions, cM as WSDisconnectInfo, cN as WSReconnectErrorInfo, ay as buildOpenAISpendEventId, as as calculateOpenAITokenSpend, al as createFeedPublisher, a7 as emitFeedDiagnostic, a6 as emitFeedDiagnosticToDefaultSink, aa as emptyFeedSnapshot, aq as getOpenAIModelPricing, ab as hasCanonicalSessionFeedActivation, ac as isCanonicalSessionFeedDocument, Z as mergeFeedItemsBySequence, a5 as normalizeFeedDiagnostic, a4 as normalizeFeedDiagnosticKind, ae as normalizeFeedPage, ar as normalizeOpenAIUsage, _ as orderTransientFeedItems, ad as readSessionFeedSnapshot, az as recordOpenAIUsageSpend, ax as toGranularHttpBase } from './spend-DtsHRNb5.js';
1
+ export { E as Environment, a as EnvironmentSession, G as Granular, O as OntologyHandle, S as Session, W as WSClient } from './client-z6shQivt.js';
2
+ import { E as EndpointMode, a as EffectCommitRequest, C as CommitReceipt, T as ToolWithHandler, P as ProjectionResult, b as ProjectionMapper, c as CommitTransitionOutcomeDeclaration, d as CommitDeclaration, e as EffectHandlerContext, F as FeedPublishTransport, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, f as RecordObjectOptions, g as ManifestContent, h as CommitTransitionInvocation, S as SessionHeapEntry, i as SessionHeapList, j as FeedItem, k as SessionHeapSnapshot, l as Prompt, m as SessionTranscriptEntry } from './spend-CESUvrZC.js';
3
+ export { ef as APIError, aQ as AccessTokenProvider, W as ActionSuggestionFeedItem, aX as AdoptEnvironmentOptions, bJ as AgentCommitStatus, cK as ArtifactApprovalDecisionInput, cL as ArtifactApprovalDecisionResult, cI as ArtifactApprovalTask, cJ as ArtifactApprovalTaskListOptions, cH as ArtifactApprovalTaskStatus, N as ArtifactFeedItem, bZ as ArtifactOptionsHandler, bh as Assignment, bi as AssignmentListResponse, cl as AssistantReplyPublicationInput, cm as AssistantReplyPublicationResult, bG as BaseProjectionResult, bs as Build, bu as BuildListResponse, bj as BuildPolicy, br as BuildStatus, bB as CanonicalProjectedRecord, bK as CommitChangeReceipt, bz as CommitSafeError, bL as CommitTransitionReceipt, aM as ConditionIR, aY as ConnectOptions, a_ as ConversationSessionInfo, b0 as ConversationSessionListOptions, b1 as ConversationSessionListResponse, a$ as ConversationSessionListStatus, bn as CreateEnvironmentData, bf as CreatePermissionProfileData, bb as CreateSandboxData, aZ as CreateSessionOptions, dn as DefineRelationshipOptions, eg as DeleteResponse, D as DomainState, bV as EffectArtifactOptionsInvocation, bX as EffectArtifactRelationshipOption, bY as EffectArtifactRelationshipOptionsResult, bP as EffectCommitContext, c6 as EffectHandler, c3 as EffectInfo, bW as EffectInvocationMetadata, bU as EffectInvocationMode, bH as EffectProjectionResult, b_ as EffectSchema, c1 as EffectVersionSelector, b$ as EffectWithHandler, c5 as EffectsChangedEvent, bm as EnvironmentData, ce as EnvironmentFeedbackRecord, dM as EnvironmentImporter, dL as EnvironmentImporterImportOptions, bo as EnvironmentListResponse, dF as EnvironmentRecordImportSummary, dK as EnvironmentSetupImporterClaim, dI as EnvironmentSetupLifecycleStatus, dJ as EnvironmentSetupSummary, dG as EnvironmentSetupTriggerReason, dt as EnvironmentStateMachineProxy, dr as EnvironmentStateObservationInput, du as EnvironmentStateProxy, dq as EnvironmentStateTarget, ds as EnvironmentStateUpdateInput, bM as ExternalCommitOptions, aa as FeedDiagnostic, ab as FeedDiagnosticListener, ai as FeedDocumentState, t as FeedFeedbackTone, Q as FeedFileSource, s as FeedIconToken, x as FeedItemBase, v as FeedItemKind, a1 as FeedListOptions, a8 as FeedListTransport, A as FeedObjectReference, a2 as FeedPage, at as FeedPublisher, a0 as FeedSnapshot, a9 as FeedSnapshotRegressionReason, r as FeedSource, q as FeedSourceActor, a3 as FeedSubscribeOptions, a4 as FeedSubscriptionChange, B as FeedTableCell, G as FeedTableColumn, K as FeedTableProjection, J as FeedTableRow, H as FeedTableRowReference, w as FeedTarget, u as FeedTransientFeedbackTone, z as FeedbackFeedItem, U as FileFeedItem, ac as GRANULAR_FEED_DIAGNOSTIC_EVENT, aS as GranularAuth, aR as GranularOptions, b8 as GranularQuotaPolicy, b9 as GranularQuotaProgress, aC as GranularSpendContext, ee as GraphQLResult, c7 as InstanceEffectHandler, I as InstanceToolHandler, cg as Job, cc as JobFeedbackInput, cb as JobFeedbackMetadata, cd as JobFeedbackRecord, c9 as JobFeedbackSentiment, ca as JobFeedbackToolCall, c8 as JobStatus, cf as JobSubmitResult, bp 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, bq 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, cT as ManualActionListOptions, cR as ManualActionOccurrence, cS as ManualActionRecordResult, cP as ManualActionRelatedRecord, cN as ManualActionSource, cM as ManualActionStatus, cU as ManualActionSuggestion, cV as ManualActionSuggestionOptions, cO as ManualActionTarget, db as MarkUserEnvironmentReadOptions, aP as MatchedPolicy, y as MessageFeedItem, dl as ModelRef, aw as NormalizedOpenAIUsage, V as NormalizedSuggestedArtifact, ay as OPENAI_MODEL_PRICING_USD_PER_MILLION, bC as ObjectProjectionChange, bx as ObjectReference, O as ObjectsFeedItem, bN as ObservationReceipt, av as OpenAIModelPricing, ax as OpenAITokenSpend, aD as OpenAIUsageSpendEvent, aW as OpenEnvironmentOptions, be as PermissionProfile, bg as PermissionProfileListResponse, bd as PermissionRules, aL as PolicyOperator, aN as PolicyOrigin, aK as PolicyPredicateSource, aO as PolicyRuleIR, aJ as PolicySource, bF as ProjectionChange, X as PromptFeedItem, c0 as PublishEffectsResult, ap as PublishFeedbackOptions, o as PublishToolsResult, aq as PublishTransientFeedbackOptions, b7 as QuotaLineItemFilter, b4 as QuotaPeriod, b3 as QuotaScopeType, b5 as QuotaStatus, df as RPCRequest, di as RPCRequestFromServer, dg as RPCResponse, dE as RecordImport, dD as RecordImportItem, dB as RecordImportItemStatus, dz as RecordImportOptions, dC as RecordImportStats, dA as RecordImportStatus, dy as RecordImportWriteMode, cQ as RecordManualActionInput, d1 as RecordMentionInput, dv as RecordObjectResult, dp as RecordObjectStateValue, dw as RecordObjectsChunkInfo, dx as RecordObjectsOptions, aE as RecordOpenAIUsageSpendOptions, aF as RecordOpenAIUsageSpendResult, d0 as RecordSearchOptions, c$ as RecordSearchResult, aU as RecordUserOptions, dm as RelationshipInfo, bD as RelationshipProjectionChange, bT as ResolvedEffectApprovalRequired, bR as ResolvedEffectDryRun, bQ as ResolvedEffectPostCondition, bS as ResolvedEffectReverse, dH as RunEnvironmentImporterOptions, ba as Sandbox, bc as SandboxListResponse, bw as SemanticVersionDiff, bv as SemanticVersionDiffEntry, cG as SessionArtifactApprovalOptions, cw as SessionArtifactAutonomyPolicy, cF as SessionArtifactExecutionOptions, cE as SessionArtifactExecutionResult, cv as SessionArtifactKind, cy as SessionArtifactListOptions, cx as SessionArtifactRecord, cD as SessionArtifactRelationshipCreateInput, cB as SessionArtifactRelationshipOption, cA as SessionArtifactRelationshipOptionsInput, cC as SessionArtifactRelationshipOptionsResult, cu as SessionArtifactStatus, cz as SessionArtifactValidationResult, d3 as SessionCollectionListOptions, d5 as SessionCollectionListResult, d2 as SessionDocumentResult, a5 as SessionFeedApi, ao as SessionFeedController, ah as SessionFeedControllerOptions, cr as SessionFileKind, ct as SessionFileRecord, cq as SessionFileSource, cs as SessionFileStatus, cW as SessionFileUploadOptions, cY as SessionHeapFieldType, cZ as SessionHeapFieldValue, c_ as SessionHeapVariable, d4 as SessionJobListOptions, cX as SessionJobRecord, bO as SessionMutationView, cp as SessionTimelineEvent, cn as SessionTranscriptActionSuggestion, co as SessionTranscriptShowRefs, ar as SettleTransientFeedbackOptions, dh as SnapshotResetMessage, by as SourceAcknowledgement, b2 as SpendLineItemType, b6 as SpendSummary, bE as StateObservationProjectionChange, eh as StreamEvent, ej as StreamStats, ei as StreamSubscription, aV as Subject, L as TableFeedItem, p as ToolHandler, c2 as ToolInfo, dj as ToolInvokeParams, dk as ToolResultParams, n as ToolSchema, c4 as ToolsChangedEvent, $ as TransientFeedItem, Y as TransientFeedItemBase, _ as TransientFeedbackFeedItem, as as TransientFeedbackHandle, Z as TransientMessageFeedItem, bA as TransitionOutcomeProjection, bI as TransitionProjectionResult, aT as User, d7 as UserEnvironmentMessagePreview, d6 as UserEnvironmentPrompt, d8 as UserEnvironmentSessionState, d9 as UserEnvironmentState, da as UserEnvironmentStateOptions, ck as UserMessageAppendResult, cj as UserMessageInput, ch as UserMessageShowRefs, ci as UserMessageTarget, bt as Version, bl as VersionTag, bk as VersionTracking, de as WSClientOptions, dc as WSDisconnectInfo, dd as WSReconnectErrorInfo, aH as buildOpenAISpendEventId, aB as calculateOpenAITokenSpend, au as createFeedPublisher, ag as emitFeedDiagnostic, af as emitFeedDiagnosticToDefaultSink, aj as emptyFeedSnapshot, az as getOpenAIModelPricing, ak as hasCanonicalSessionFeedActivation, al as isCanonicalSessionFeedDocument, a6 as mergeFeedItemsBySequence, ae as normalizeFeedDiagnostic, ad as normalizeFeedDiagnosticKind, an as normalizeFeedPage, aA as normalizeOpenAIUsage, a7 as orderTransientFeedItems, am as readSessionFeedSnapshot, aI as recordOpenAIUsageSpend, aG as toGranularHttpBase } from './spend-CESUvrZC.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';
@@ -20,11 +20,49 @@ declare function isLocalApiUrl(url: string): boolean;
20
20
  declare function resolveAuthTokenForApiUrl(authToken: string, apiUrl: string): string;
21
21
  declare function resolveApiUrl(explicitApiUrl?: string, mode?: EndpointMode): string;
22
22
 
23
+ interface StateMachineDefinition {
24
+ name: string;
25
+ label?: string;
26
+ states: Record<string, {
27
+ label?: string;
28
+ isFinal?: boolean;
29
+ }>;
30
+ transitions: Record<string, {
31
+ label?: string;
32
+ from: string;
33
+ effect: ToolWithHandler;
34
+ outcomes: Record<string, CommitTransitionOutcomeDeclaration>;
35
+ }>;
36
+ }
37
+ type DefinedStateMachine<TDefinition extends StateMachineDefinition = StateMachineDefinition> = TDefinition & {
38
+ transitions: TDefinition["transitions"];
39
+ };
40
+ interface CommitTransport {
41
+ persist(request: EffectCommitRequest): Promise<CommitReceipt>;
42
+ mappingFailed?(input: {
43
+ effectKey: string;
44
+ effectName: string;
45
+ invocationId: string;
46
+ idempotencyKey: string;
47
+ environmentId: string;
48
+ message: string;
49
+ }): Promise<void>;
50
+ }
51
+ declare function defineProjection<TResult, TProjection extends ProjectionResult = ProjectionResult>(mapper: ProjectionMapper<TResult, TProjection>): ProjectionMapper<TResult, TProjection>;
52
+ declare function defineEffect<TEffect extends ToolWithHandler>(effect: TEffect): TEffect;
53
+ declare function defineStateMachine<const TDefinition extends StateMachineDefinition>(definition: TDefinition): DefinedStateMachine<TDefinition>;
54
+ declare function validateProjectionResult(declaration: CommitDeclaration<any>, projection: ProjectionResult): void;
55
+ /** Stable JSON used by tests, fingerprints, and source-event conflict checks. */
56
+ declare function canonicalizeCommitValue(value: unknown): string;
57
+
58
+ type EffectRuntimeWireContext = Omit<EffectHandlerContext, "commit"> & {
59
+ commit?: never;
60
+ };
23
61
  type EffectRuntimeRequest = {
24
62
  effectKey: string;
25
63
  effectName: string;
26
64
  input: unknown;
27
- context?: EffectHandlerContext;
65
+ context?: EffectRuntimeWireContext;
28
66
  };
29
67
  interface EffectRuntimeFeedbackBridge {
30
68
  /** Ephemeral registry capability for this one active invocation. */
@@ -33,10 +71,39 @@ interface EffectRuntimeFeedbackBridge {
33
71
  }
34
72
  interface InvokeRegisteredEffectOptions {
35
73
  feedback?: EffectRuntimeFeedbackBridge;
74
+ /** Durable product-acknowledgement transport for declared write effects. */
75
+ commit?: CommitTransport;
76
+ /** Internal effect-host hook used to return the durable receipt separately from the product result. */
77
+ commitAcknowledged?: (receipt: CommitReceipt) => void | Promise<void>;
36
78
  }
37
79
  declare function normalizeEffectBehaviors(value?: ManifestEffectMetamodelSpec | ResolvedEffectBehaviors | null): ResolvedEffectBehaviors;
38
80
  declare function invokeRegisteredEffect(effectMap: Map<string, ToolWithHandler>, request: EffectRuntimeRequest, options?: InvokeRegisteredEffectOptions): Promise<unknown>;
39
81
 
82
+ interface RecordSnapshotCommitSource {
83
+ reference: string;
84
+ version?: string;
85
+ beforeRecords: RecordObjectOptions[];
86
+ afterRecords: RecordObjectOptions[];
87
+ }
88
+ /**
89
+ * Keeps only records whose canonical projection changed. This is useful for
90
+ * persisting bounded, replayable mapper input beside a product mutation.
91
+ */
92
+ declare function changedRecordSnapshots(beforeRecords: RecordObjectOptions[], afterRecords: RecordObjectOptions[]): Pick<RecordSnapshotCommitSource, "beforeRecords" | "afterRecords">;
93
+ /**
94
+ * Deterministically maps a persisted before/after product snapshot to commit
95
+ * changes. It performs no I/O and never guesses ontology labels or paths.
96
+ */
97
+ declare function projectRecordSnapshotMutation(input: {
98
+ manifest: ManifestContent;
99
+ effect: ToolWithHandler;
100
+ effectInput: unknown;
101
+ result: unknown;
102
+ source: RecordSnapshotCommitSource;
103
+ commitKind: "effect" | "transition";
104
+ transition?: CommitTransitionInvocation;
105
+ }): ProjectionResult;
106
+
40
107
  interface ValidationRuleEvaluationInput {
41
108
  operator?: string | null;
42
109
  stringValue?: string;
@@ -196,4 +263,4 @@ declare function buildSessionTranscript(input: {
196
263
  canonicalFeedItems?: FeedItem[];
197
264
  }): SessionTranscriptEntry[];
198
265
 
199
- export { type ConditionalPolicySpec, EffectHandlerContext, EndpointMode, FeedItem, FeedPublishTransport, type JobPresentation, type LimitPolicySpec, ManifestEffectMetamodelSpec, type NormalizedPromptChoiceOption, type PermissionActionSpec, type PermissionPolicySpec, type PermissionProfileFile, type PolicyDecision, type PolicyEvaluationContext, type PolicyOutcome, Prompt, ResolvedEffectBehaviors, SessionHeapEntry, SessionHeapList, SessionHeapSnapshot, SessionTranscriptEntry, ToolWithHandler, type ValidationRuleEvaluationInput, type ValidationRuleEvaluationResult, buildSessionTranscript, buildSessionTranscriptFromFeedItems, evaluateValidationRule, extractPromptTokens, invokeRegisteredEffect, isLocalApiUrl, normalizeEffectBehaviors, normalizePrompt, normalizePromptChoiceOption, normalizePromptText, normalizePromptType, resolveApiUrl, resolveAuthTokenForApiUrl, resolveJobPresentation, resolvePromptAnswer, scorePromptChoiceMatch, validationRuleFailureMessage };
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 };