@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.
- package/dist/agent-evals.d.mts +2 -2
- package/dist/agent-evals.d.ts +2 -2
- package/dist/agent-evals.js +713 -65
- package/dist/agent-evals.js.map +1 -1
- package/dist/agent-evals.mjs +713 -65
- package/dist/agent-evals.mjs.map +1 -1
- package/dist/cli/index.js +713 -65
- package/dist/{client-lk-dmdKR.d.mts → client-S-z8bri1.d.mts} +47 -1
- package/dist/{client-KqJIH7WE.d.ts → client-z6shQivt.d.ts} +47 -1
- package/dist/index.d.mts +72 -5
- package/dist/index.d.ts +72 -5
- package/dist/index.js +1058 -83
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1052 -84
- package/dist/index.mjs.map +1 -1
- package/dist/{spend-DtsHRNb5.d.mts → spend-CESUvrZC.d.mts} +239 -4
- package/dist/{spend-DtsHRNb5.d.ts → spend-CESUvrZC.d.ts} +239 -4
- package/dist/spend.d.mts +1 -1
- package/dist/spend.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 {
|
|
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-
|
|
2
|
-
import { E as EndpointMode, T as ToolWithHandler,
|
|
3
|
-
export {
|
|
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?:
|
|
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-
|
|
2
|
-
import { E as EndpointMode, T as ToolWithHandler,
|
|
3
|
-
export {
|
|
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?:
|
|
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 };
|