@standards/schema 1.0.0-alpha.421 → 1.0.0-alpha.425

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,7 +1,7 @@
1
1
 
2
- import { AIGenerationType, AIModelPricing, AddAttributeInput, AgentAsideExchange, AgentConfig, AgentMessageAttachment, AgentSession, AgentSessionMode, AggregateGroupByInput, ArchitectChange, ArtifactQuote, ArtifactRevisionView, Attribute, AuditListOptions, BinaryResponse, CollectionContentSource, CollectionScreen, ConnectorTriggerMatch, ContentViewDefinition, CreateCustomObjectInput, CreatePermissionInput, CreateUserProfile, DecisionListParams, DocumentLayout, DownloadedFile, DraftAppendCommand, DraftFocus, DraftPublishCommand, DraftStep, DraftableState, EnvVarEntry, EnvironmentHarnessId, EnvironmentSize, FilterGenerationInput, FilterState, FormRow, FormulaGenerationInput, GeocodingAutocompleteParams, GithubTriggerSender, HttpMethod, LoginSecretEntry, MEETINGS_MAX_ONLY_CONNECTIONS, MailboxLocation, MailboxQuery, MailboxReadState, MentionEntityType, MentionReference, ModelDefinition, NativeToolGroup, OAuthAttemptView, OAuthCompleteOutcome, ObjectImage, ObjectRecord, Operation, OperationDefinition, OperationInput, OperationObjectPermission, OperationOutput, OperationParsedInput, OperationPermission, OperationResult, OperationStatus, OperationThrottle, OperationUpload, OperationWireOutput, OutputType, PageBlockData, PathParams, PreferenceEntry, PreferenceValues, ProposalRevision, PublishOutcomeCode, RecordAppearance, RecordDocuments, RecordGraphNodeRef, RecordGraphRequest, RecordOperationResult, RecordQueryDefinition, RecordScreen, RegexGenerationInput, RelationScope, RoutineAudienceSource, RoutingPrice, SchemaOwner, SchemaStateDefinition, SessionApprovalMode, SlackTriggerSender, SortGenerationInput, SortRule, StoredArtifactResult, SyncBundleInput, ToolGrantReason, ToolGroupGrant, ToolImpact, ToolPartErrorCode, ToolPartState, TriggerEventType, UpdateObjectInput, UploadedPart, UserStatus, ViewContentDefinition, ViewOperation, agentApprovalResolutionSchema, agentHealthSchema, agentRequestAnswerSchema, agentSetupResponseSchema, attachedRecordDocumentSchema, attributeSaveOutputSchema, browserProfilePreparationSchema, draftAppendOutputSchema, editAgentSessionMessageResultSchema, envVarEntrySchema, globalSearchGroupedPageSchema, loginSecretEntrySchema, meetingsOperations, meetingsQuery, meetingsQueryFields, operation, operationGroup, publishDraftOutputSchema, recordDeletionCountSchema, recordMeetingsBody, recordsBulkCreateResultSchema, recordsBulkDeleteResultSchema, recordsBulkUpdateResultSchema, resolvedRelationsBatchSchema, schemaDraftOutputSchema, setAgentSessionWorkPostureResultSchema, type, viewPreferenceAddressSchema } from "../index-DY7cHmBV.mjs";
3
- import { TenantId } from "../utils-qZ-SCngX.mjs";
4
- import { ValidationError, ValidationErrorDetail } from "../exceptions-DtcTc7fk.mjs";
2
+ import { AIGenerationType, AIModelPricing, AddAttributeInput, AgentAsideExchange, AgentConfig, AgentMessageAttachment, AgentSession, AgentSessionMode, AggregateGroupByInput, ArchitectChange, ArtifactQuote, ArtifactRevisionView, Attribute, AuditListOptions, BinaryResponse, CollectionContentSource, CollectionScreen, ConnectorTriggerMatch, ContentViewDefinition, CreateCustomObjectInput, CreatePermissionInput, CreateUserProfile, DecisionAnswer, DecisionListParams, DocumentLayout, DownloadedFile, DraftAppendCommand, DraftFocus, DraftPublishCommand, DraftStep, DraftableState, EnvVarEntry, EnvironmentHarnessId, EnvironmentSize, FilterGenerationInput, FilterState, FormRow, FormulaGenerationInput, GeocodingAutocompleteParams, GithubTriggerSender, HttpMethod, LoginSecretEntry, MEETINGS_MAX_ONLY_CONNECTIONS, MailboxLocation, MailboxQuery, MailboxReadState, MentionEntityType, MentionReference, ModelDefinition, NativeToolGroup, OAuthAttemptView, OAuthCompleteOutcome, ObjectBuilderLike, ObjectImage, ObjectRecord, Operation, OperationDefinition, OperationInput, OperationObjectPermission, OperationOutput, OperationParsedInput, OperationPermission, OperationResult, OperationStatus, OperationThrottle, OperationUpload, OperationWireOutput, OutputType, PageBlockData, PathParams, PreferenceEntry, PreferenceValues, ProposalRevision, PublishOutcomeCode, RecordAppearance, RecordDocuments, RecordGraphNodeRef, RecordGraphRequest, RecordOperationResult, RecordQueryDefinition, RecordScreen, RegexGenerationInput, RelationScope, RoutineAudienceSource, RoutingPrice, SchemaOwner, SchemaStateDefinition, SessionApprovalMode, SlackTriggerSender, SortGenerationInput, SortRule, StoredArtifactResult, SyncBundleInput, ToolGrantReason, ToolGroupGrant, ToolImpact, ToolPartErrorCode, ToolPartState, TriggerEventType, UpdateObjectInput, UploadedPart, UserStatus, ViewContentDefinition, ViewOperation, agentApprovalResolutionSchema, agentHealthSchema, agentRequestAnswerSchema, agentSetupResponseSchema, attachedRecordDocumentSchema, attributeSaveOutputSchema, browserProfilePreparationSchema, draftAppendOutputSchema, editAgentSessionMessageResultSchema, envVarEntrySchema, globalSearchGroupedPageSchema, loginSecretEntrySchema, meetingsOperations, meetingsQuery, meetingsQueryFields, operation, operationGroup, publishDraftOutputSchema, recordDeletionCountSchema, recordMeetingsBody, recordsBulkCreateResultSchema, recordsBulkDeleteResultSchema, recordsBulkUpdateResultSchema, resolvedRelationsBatchSchema, schemaDraftOutputSchema, setAgentSessionWorkPostureResultSchema, type, viewPreferenceAddressSchema } from "../record-query-YF8WzWYV.mjs";
3
+ import { TenantId } from "../utils-hkE18pLQ.mjs";
4
+ import { ValidationError, ValidationErrorDetail } from "../exceptions-RLmYnywT.mjs";
5
5
  import * as z$2 from "zod";
6
6
  /**
7
7
  * A timestamp on the wire: an ISO 8601 string (`Date#toISOString()`, UTC),
@@ -91,17 +91,50 @@ export interface OperationWireRequest {
91
91
  headers: Record<string, string>;
92
92
  uploads?: readonly UploadedPart[];
93
93
  }
94
+ /** An actor's id: a UUID, so it never collides with `"system"`. */
95
+ export type ActorId = string;
96
+ /**
97
+ * Who an in-process call acts as, when the caller names it instead of
98
+ * letting the ambient context decide: an actor of the tenant, or the
99
+ * tenant's system actor (the platform acting as itself).
100
+ */
101
+ export type OperationCaller = {
102
+ readonly actorId: ActorId;
103
+ } | {
104
+ readonly system: true;
105
+ };
106
+ /** `as(actor)`'s argument as the caller it names. */
107
+ export declare function callerOf(actor: ActorId | "system"): OperationCaller;
94
108
  /**
95
109
  * What runs operations in the caller's own process: the runtime implements
96
110
  * it (`createOperationHost`), the client's in-process transport calls it.
97
- * `execute` runs under the caller's tenant and actor context, checks the
98
- * operation's permissions itself, and resolves to the answer as it goes on
99
- * the wire (the output schema's encoding; a `bytes` operation's
100
- * `BinaryResponse`). A refusal rejects with an {@link OperationRefused}.
111
+ * `execute` checks the operation's permissions itself and resolves to the
112
+ * answer as it goes on the wire (the output schema's encoding; a `bytes`
113
+ * operation's `BinaryResponse`). A refusal rejects with an
114
+ * {@link OperationRefused}.
115
+ *
116
+ * Without `caller`, the call acts as the actor the ambient context implies
117
+ * (the request's, the job's, the write's author), or as the system where no
118
+ * request, job or hook runs. With `caller`, it acts as that actor, in the
119
+ * ambient tenant (else the host's default one), the ambient actor recorded as
120
+ * the one who triggered it.
101
121
  */
102
122
  export interface OperationHost {
103
- execute(op: Operation, request: OperationWireRequest): Promise<unknown>;
123
+ execute(op: Operation, request: OperationWireRequest, caller?: OperationCaller): Promise<unknown>;
124
+ }
125
+ /** What a server registers: its host, and the object builders of the bundles it declares. */
126
+ export interface RegisteredOperationHost {
127
+ readonly host: OperationHost;
128
+ readonly objects: readonly ObjectBuilderLike[];
104
129
  }
130
+ /**
131
+ * Register this process's host, so the client's default instance calls it
132
+ * in process. Returns the function that unregisters it (on shutdown). A
133
+ * second registration replaces the first.
134
+ */
135
+ export declare function registerOperationHost(host: OperationHost, objects?: readonly ObjectBuilderLike[]): () => void;
136
+ /** The host this process registered, if any. */
137
+ export declare function registeredOperationHost(): RegisteredOperationHost | undefined;
105
138
  /**
106
139
  * A refusal as the HTTP API answers it: its status and its JSON body (the
107
140
  * `{ success: false, statusCode, message, code, … }` envelope, redacted as
@@ -1455,7 +1488,7 @@ export declare const decisionsOperations: {
1455
1488
  why: z$2.ZodOptional<z$2.ZodString>;
1456
1489
  change: z$2.ZodOptional<z$2.ZodString>;
1457
1490
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1458
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1491
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
1459
1492
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
1460
1493
  effect: z$2.ZodOptional<z$2.ZodString>;
1461
1494
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -1639,7 +1672,7 @@ export declare const decisionsOperations: {
1639
1672
  why: z$2.ZodOptional<z$2.ZodString>;
1640
1673
  change: z$2.ZodOptional<z$2.ZodString>;
1641
1674
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1642
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1675
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
1643
1676
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
1644
1677
  effect: z$2.ZodOptional<z$2.ZodString>;
1645
1678
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -1792,7 +1825,7 @@ export declare const decisionsOperations: {
1792
1825
  why: z$2.ZodOptional<z$2.ZodString>;
1793
1826
  change: z$2.ZodOptional<z$2.ZodString>;
1794
1827
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1795
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1828
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
1796
1829
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
1797
1830
  effect: z$2.ZodOptional<z$2.ZodString>;
1798
1831
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -1955,7 +1988,7 @@ export declare const decisionsOperations: {
1955
1988
  why: z$2.ZodOptional<z$2.ZodString>;
1956
1989
  change: z$2.ZodOptional<z$2.ZodString>;
1957
1990
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1958
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1991
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
1959
1992
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
1960
1993
  effect: z$2.ZodOptional<z$2.ZodString>;
1961
1994
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -2125,7 +2158,7 @@ export declare const decisionsOperations: {
2125
2158
  why: z$2.ZodOptional<z$2.ZodString>;
2126
2159
  change: z$2.ZodOptional<z$2.ZodString>;
2127
2160
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2128
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2161
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
2129
2162
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
2130
2163
  effect: z$2.ZodOptional<z$2.ZodString>;
2131
2164
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -2310,7 +2343,7 @@ export declare const decisionsOperations: {
2310
2343
  why: z$2.ZodOptional<z$2.ZodString>;
2311
2344
  change: z$2.ZodOptional<z$2.ZodString>;
2312
2345
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2313
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2346
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
2314
2347
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
2315
2348
  effect: z$2.ZodOptional<z$2.ZodString>;
2316
2349
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -2480,7 +2513,7 @@ export declare const decisionsOperations: {
2480
2513
  why: z$2.ZodOptional<z$2.ZodString>;
2481
2514
  change: z$2.ZodOptional<z$2.ZodString>;
2482
2515
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2483
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2516
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
2484
2517
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
2485
2518
  effect: z$2.ZodOptional<z$2.ZodString>;
2486
2519
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -2546,7 +2579,7 @@ export declare const decisionsOperations: {
2546
2579
  why: z$2.ZodOptional<z$2.ZodString>;
2547
2580
  change: z$2.ZodOptional<z$2.ZodString>;
2548
2581
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2549
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2582
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
2550
2583
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
2551
2584
  effect: z$2.ZodOptional<z$2.ZodString>;
2552
2585
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -2634,7 +2667,7 @@ export declare const decisionsOperations: {
2634
2667
  why: z$2.ZodOptional<z$2.ZodString>;
2635
2668
  change: z$2.ZodOptional<z$2.ZodString>;
2636
2669
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2637
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2670
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
2638
2671
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
2639
2672
  effect: z$2.ZodOptional<z$2.ZodString>;
2640
2673
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -6168,7 +6201,12 @@ export declare const environmentEnvVarsOperations: {
6168
6201
  envVarId: z$2.ZodString;
6169
6202
  }, z$2.core.$strip>, OutputType<void>>>;
6170
6203
  };
6171
- /** `GET /machines` (machines and links §6): what the viewer reads, cursor-paged. */
6204
+ /**
6205
+ * `GET /machines` (machines and links §6): what the viewer reads, cursor-paged.
6206
+ * `status=running` answers every running machine, unpaged; `status=stopped`
6207
+ * the others, paged, and only it takes `q`, a search of their titles. A host
6208
+ * with no machines answers 503 `CONFIGURATION_REQUIRED`.
6209
+ */
6172
6210
  export declare const listMachinesQuery: z$2.ZodObject<{
6173
6211
  environmentId: z$2.ZodOptional<z$2.ZodGUID>;
6174
6212
  kind: z$2.ZodOptional<z$2.ZodEnum<{
@@ -6176,6 +6214,11 @@ export declare const listMachinesQuery: z$2.ZodObject<{
6176
6214
  conversation: "conversation";
6177
6215
  run: "run";
6178
6216
  }>>;
6217
+ status: z$2.ZodOptional<z$2.ZodEnum<{
6218
+ running: "running";
6219
+ stopped: "stopped";
6220
+ }>>;
6221
+ q: z$2.ZodOptional<z$2.ZodString>;
6179
6222
  cursor: z$2.ZodOptional<z$2.ZodString>;
6180
6223
  }, z$2.core.$strict>;
6181
6224
  /** `POST /links/:id/duration`: the link expires `durationMs` from now, at most `LINK_MAX_MS`. */
@@ -6202,6 +6245,11 @@ export declare const machinesOperations: {
6202
6245
  conversation: "conversation";
6203
6246
  run: "run";
6204
6247
  }>>;
6248
+ status: z$2.ZodOptional<z$2.ZodEnum<{
6249
+ running: "running";
6250
+ stopped: "stopped";
6251
+ }>>;
6252
+ q: z$2.ZodOptional<z$2.ZodString>;
6205
6253
  cursor: z$2.ZodOptional<z$2.ZodString>;
6206
6254
  }, z$2.core.$strict>;
6207
6255
  readonly output: z$2.ZodObject<{
@@ -24787,6 +24835,7 @@ export declare const recordsOperations: {
24787
24835
  readonly STATE_GATE: "SCHEMA_STATE_GATE";
24788
24836
  readonly ACTOR_CONTEXT_REQUIRED: "SCHEMA_ACTOR_CONTEXT_REQUIRED";
24789
24837
  readonly ACTOR_REQUIRED: "ACTOR_CONTEXT_REQUIRED";
24838
+ readonly ACTOR_CONTEXT_LOST: "ACTOR_CONTEXT_LOST";
24790
24839
  readonly TENANT_CONFIRMATION_MISMATCH: "SCHEMA_TENANT_CONFIRMATION_MISMATCH";
24791
24840
  readonly SESSION_REQUIRED: "SCHEMA_SESSION_REQUIRED";
24792
24841
  readonly API_KEY_OWNER_ROLE_REFUSED: "SCHEMA_API_KEY_OWNER_ROLE_REFUSED";
@@ -25180,6 +25229,7 @@ export declare const recordsOperations: {
25180
25229
  readonly STATE_GATE: "SCHEMA_STATE_GATE";
25181
25230
  readonly ACTOR_CONTEXT_REQUIRED: "SCHEMA_ACTOR_CONTEXT_REQUIRED";
25182
25231
  readonly ACTOR_REQUIRED: "ACTOR_CONTEXT_REQUIRED";
25232
+ readonly ACTOR_CONTEXT_LOST: "ACTOR_CONTEXT_LOST";
25183
25233
  readonly TENANT_CONFIRMATION_MISMATCH: "SCHEMA_TENANT_CONFIRMATION_MISMATCH";
25184
25234
  readonly SESSION_REQUIRED: "SCHEMA_SESSION_REQUIRED";
25185
25235
  readonly API_KEY_OWNER_ROLE_REFUSED: "SCHEMA_API_KEY_OWNER_ROLE_REFUSED";
@@ -1,8 +1,8 @@
1
1
 
2
- import { AIGenerationType, AIModelPricing, AddAttributeInput, AgentAsideExchange, AgentConfig, AgentMessageAttachment, AgentSession, AgentSessionMode, AggregateGroupByInput, ArchitectChange, ArtifactQuote, ArtifactRevisionView, Attribute, AuditListOptions, BinaryResponse, CollectionContentSource, CollectionScreen, ConnectorTriggerMatch, ContentViewDefinition, CreateCustomObjectInput, CreatePermissionInput, CreateUserProfile, DecisionListParams, DocumentLayout, DownloadedFile, DraftAppendCommand, DraftFocus, DraftPublishCommand, DraftStep, DraftableState, EnvVarEntry, EnvironmentHarnessId, EnvironmentSize, FilterGenerationInput, FilterState, FormRow, FormulaGenerationInput, GeocodingAutocompleteParams, GithubTriggerSender, HttpMethod, LoginSecretEntry, MEETINGS_MAX_ONLY_CONNECTIONS, MailboxLocation, MailboxQuery, MailboxReadState, MentionEntityType, MentionReference, ModelDefinition, NativeToolGroup, OAuthAttemptView, OAuthCompleteOutcome, ObjectImage, ObjectRecord, Operation, OperationDefinition, OperationInput, OperationObjectPermission, OperationOutput, OperationParsedInput, OperationPermission, OperationResult, OperationStatus, OperationThrottle, OperationUpload, OperationWireOutput, OutputType, PageBlockData, PathParams, PreferenceEntry, PreferenceValues, ProposalRevision, PublishOutcomeCode, RecordAppearance, RecordDocuments, RecordGraphNodeRef, RecordGraphRequest, RecordOperationResult, RecordQueryDefinition, RecordScreen, RegexGenerationInput, RelationScope, RoutineAudienceSource, RoutingPrice, SchemaOwner, SchemaStateDefinition, SessionApprovalMode, SlackTriggerSender, SortGenerationInput, SortRule, StoredArtifactResult, SyncBundleInput, ToolGrantReason, ToolGroupGrant, ToolImpact, ToolPartErrorCode, ToolPartState, TriggerEventType, UpdateObjectInput, UploadedPart, UserStatus, ViewContentDefinition, ViewOperation, agentApprovalResolutionSchema, agentHealthSchema, agentRequestAnswerSchema, agentSetupResponseSchema, attachedRecordDocumentSchema, attributeSaveOutputSchema, browserProfilePreparationSchema, draftAppendOutputSchema, editAgentSessionMessageResultSchema, envVarEntrySchema, globalSearchGroupedPageSchema, loginSecretEntrySchema, meetingsOperations, meetingsQuery, meetingsQueryFields, operation, operationGroup, publishDraftOutputSchema, recordDeletionCountSchema, recordMeetingsBody, recordsBulkCreateResultSchema, recordsBulkDeleteResultSchema, recordsBulkUpdateResultSchema, resolvedRelationsBatchSchema, schemaDraftOutputSchema, setAgentSessionWorkPostureResultSchema, type, viewPreferenceAddressSchema } from "../index-Ba3rZe7X.js";
2
+ import { AIGenerationType, AIModelPricing, AddAttributeInput, AgentAsideExchange, AgentConfig, AgentMessageAttachment, AgentSession, AgentSessionMode, AggregateGroupByInput, ArchitectChange, ArtifactQuote, ArtifactRevisionView, Attribute, AuditListOptions, BinaryResponse, CollectionContentSource, CollectionScreen, ConnectorTriggerMatch, ContentViewDefinition, CreateCustomObjectInput, CreatePermissionInput, CreateUserProfile, DecisionAnswer, DecisionListParams, DocumentLayout, DownloadedFile, DraftAppendCommand, DraftFocus, DraftPublishCommand, DraftStep, DraftableState, EnvVarEntry, EnvironmentHarnessId, EnvironmentSize, FilterGenerationInput, FilterState, FormRow, FormulaGenerationInput, GeocodingAutocompleteParams, GithubTriggerSender, HttpMethod, LoginSecretEntry, MEETINGS_MAX_ONLY_CONNECTIONS, MailboxLocation, MailboxQuery, MailboxReadState, MentionEntityType, MentionReference, ModelDefinition, NativeToolGroup, OAuthAttemptView, OAuthCompleteOutcome, ObjectBuilderLike, ObjectImage, ObjectRecord, Operation, OperationDefinition, OperationInput, OperationObjectPermission, OperationOutput, OperationParsedInput, OperationPermission, OperationResult, OperationStatus, OperationThrottle, OperationUpload, OperationWireOutput, OutputType, PageBlockData, PathParams, PreferenceEntry, PreferenceValues, ProposalRevision, PublishOutcomeCode, RecordAppearance, RecordDocuments, RecordGraphNodeRef, RecordGraphRequest, RecordOperationResult, RecordQueryDefinition, RecordScreen, RegexGenerationInput, RelationScope, RoutineAudienceSource, RoutingPrice, SchemaOwner, SchemaStateDefinition, SessionApprovalMode, SlackTriggerSender, SortGenerationInput, SortRule, StoredArtifactResult, SyncBundleInput, ToolGrantReason, ToolGroupGrant, ToolImpact, ToolPartErrorCode, ToolPartState, TriggerEventType, UpdateObjectInput, UploadedPart, UserStatus, ViewContentDefinition, ViewOperation, agentApprovalResolutionSchema, agentHealthSchema, agentRequestAnswerSchema, agentSetupResponseSchema, attachedRecordDocumentSchema, attributeSaveOutputSchema, browserProfilePreparationSchema, draftAppendOutputSchema, editAgentSessionMessageResultSchema, envVarEntrySchema, globalSearchGroupedPageSchema, loginSecretEntrySchema, meetingsOperations, meetingsQuery, meetingsQueryFields, operation, operationGroup, publishDraftOutputSchema, recordDeletionCountSchema, recordMeetingsBody, recordsBulkCreateResultSchema, recordsBulkDeleteResultSchema, recordsBulkUpdateResultSchema, resolvedRelationsBatchSchema, schemaDraftOutputSchema, setAgentSessionWorkPostureResultSchema, type, viewPreferenceAddressSchema } from "../index-BT3TfqdG.js";
3
3
  import "../zod-locale.js";
4
- import { TenantId } from "../utils-CzDInA43.js";
5
- import { ValidationError, ValidationErrorDetail } from "../exceptions-EheEZJ0K.js";
4
+ import { TenantId } from "../utils-CIqqP6hZ.js";
5
+ import { ValidationError, ValidationErrorDetail } from "../exceptions-B29yRRaG.js";
6
6
  import * as z$2 from "zod";
7
7
  /**
8
8
  * A timestamp on the wire: an ISO 8601 string (`Date#toISOString()`, UTC),
@@ -92,17 +92,50 @@ export interface OperationWireRequest {
92
92
  headers: Record<string, string>;
93
93
  uploads?: readonly UploadedPart[];
94
94
  }
95
+ /** An actor's id: a UUID, so it never collides with `"system"`. */
96
+ export type ActorId = string;
97
+ /**
98
+ * Who an in-process call acts as, when the caller names it instead of
99
+ * letting the ambient context decide: an actor of the tenant, or the
100
+ * tenant's system actor (the platform acting as itself).
101
+ */
102
+ export type OperationCaller = {
103
+ readonly actorId: ActorId;
104
+ } | {
105
+ readonly system: true;
106
+ };
107
+ /** `as(actor)`'s argument as the caller it names. */
108
+ export declare function callerOf(actor: ActorId | "system"): OperationCaller;
95
109
  /**
96
110
  * What runs operations in the caller's own process: the runtime implements
97
111
  * it (`createOperationHost`), the client's in-process transport calls it.
98
- * `execute` runs under the caller's tenant and actor context, checks the
99
- * operation's permissions itself, and resolves to the answer as it goes on
100
- * the wire (the output schema's encoding; a `bytes` operation's
101
- * `BinaryResponse`). A refusal rejects with an {@link OperationRefused}.
112
+ * `execute` checks the operation's permissions itself and resolves to the
113
+ * answer as it goes on the wire (the output schema's encoding; a `bytes`
114
+ * operation's `BinaryResponse`). A refusal rejects with an
115
+ * {@link OperationRefused}.
116
+ *
117
+ * Without `caller`, the call acts as the actor the ambient context implies
118
+ * (the request's, the job's, the write's author), or as the system where no
119
+ * request, job or hook runs. With `caller`, it acts as that actor, in the
120
+ * ambient tenant (else the host's default one), the ambient actor recorded as
121
+ * the one who triggered it.
102
122
  */
103
123
  export interface OperationHost {
104
- execute(op: Operation, request: OperationWireRequest): Promise<unknown>;
124
+ execute(op: Operation, request: OperationWireRequest, caller?: OperationCaller): Promise<unknown>;
125
+ }
126
+ /** What a server registers: its host, and the object builders of the bundles it declares. */
127
+ export interface RegisteredOperationHost {
128
+ readonly host: OperationHost;
129
+ readonly objects: readonly ObjectBuilderLike[];
105
130
  }
131
+ /**
132
+ * Register this process's host, so the client's default instance calls it
133
+ * in process. Returns the function that unregisters it (on shutdown). A
134
+ * second registration replaces the first.
135
+ */
136
+ export declare function registerOperationHost(host: OperationHost, objects?: readonly ObjectBuilderLike[]): () => void;
137
+ /** The host this process registered, if any. */
138
+ export declare function registeredOperationHost(): RegisteredOperationHost | undefined;
106
139
  /**
107
140
  * A refusal as the HTTP API answers it: its status and its JSON body (the
108
141
  * `{ success: false, statusCode, message, code, … }` envelope, redacted as
@@ -1456,7 +1489,7 @@ export declare const decisionsOperations: {
1456
1489
  why: z$2.ZodOptional<z$2.ZodString>;
1457
1490
  change: z$2.ZodOptional<z$2.ZodString>;
1458
1491
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1459
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1492
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
1460
1493
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
1461
1494
  effect: z$2.ZodOptional<z$2.ZodString>;
1462
1495
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -1640,7 +1673,7 @@ export declare const decisionsOperations: {
1640
1673
  why: z$2.ZodOptional<z$2.ZodString>;
1641
1674
  change: z$2.ZodOptional<z$2.ZodString>;
1642
1675
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1643
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1676
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
1644
1677
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
1645
1678
  effect: z$2.ZodOptional<z$2.ZodString>;
1646
1679
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -1793,7 +1826,7 @@ export declare const decisionsOperations: {
1793
1826
  why: z$2.ZodOptional<z$2.ZodString>;
1794
1827
  change: z$2.ZodOptional<z$2.ZodString>;
1795
1828
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1796
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1829
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
1797
1830
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
1798
1831
  effect: z$2.ZodOptional<z$2.ZodString>;
1799
1832
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -1956,7 +1989,7 @@ export declare const decisionsOperations: {
1956
1989
  why: z$2.ZodOptional<z$2.ZodString>;
1957
1990
  change: z$2.ZodOptional<z$2.ZodString>;
1958
1991
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1959
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
1992
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
1960
1993
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
1961
1994
  effect: z$2.ZodOptional<z$2.ZodString>;
1962
1995
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -2126,7 +2159,7 @@ export declare const decisionsOperations: {
2126
2159
  why: z$2.ZodOptional<z$2.ZodString>;
2127
2160
  change: z$2.ZodOptional<z$2.ZodString>;
2128
2161
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2129
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2162
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
2130
2163
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
2131
2164
  effect: z$2.ZodOptional<z$2.ZodString>;
2132
2165
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -2311,7 +2344,7 @@ export declare const decisionsOperations: {
2311
2344
  why: z$2.ZodOptional<z$2.ZodString>;
2312
2345
  change: z$2.ZodOptional<z$2.ZodString>;
2313
2346
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2314
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2347
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
2315
2348
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
2316
2349
  effect: z$2.ZodOptional<z$2.ZodString>;
2317
2350
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -2481,7 +2514,7 @@ export declare const decisionsOperations: {
2481
2514
  why: z$2.ZodOptional<z$2.ZodString>;
2482
2515
  change: z$2.ZodOptional<z$2.ZodString>;
2483
2516
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2484
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2517
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
2485
2518
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
2486
2519
  effect: z$2.ZodOptional<z$2.ZodString>;
2487
2520
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -2547,7 +2580,7 @@ export declare const decisionsOperations: {
2547
2580
  why: z$2.ZodOptional<z$2.ZodString>;
2548
2581
  change: z$2.ZodOptional<z$2.ZodString>;
2549
2582
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2550
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2583
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
2551
2584
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
2552
2585
  effect: z$2.ZodOptional<z$2.ZodString>;
2553
2586
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -2635,7 +2668,7 @@ export declare const decisionsOperations: {
2635
2668
  why: z$2.ZodOptional<z$2.ZodString>;
2636
2669
  change: z$2.ZodOptional<z$2.ZodString>;
2637
2670
  questions: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2638
- answer: z$2.ZodOptional<z$2.ZodType<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, z$2.core.$ZodTypeInternals<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>>>;
2671
+ answer: z$2.ZodOptional<z$2.ZodType<DecisionAnswer, DecisionAnswer, z$2.core.$ZodTypeInternals<DecisionAnswer, DecisionAnswer>>>;
2639
2672
  answeredBy: z$2.ZodOptional<z$2.ZodString>;
2640
2673
  effect: z$2.ZodOptional<z$2.ZodString>;
2641
2674
  links: z$2.ZodArray<z$2.ZodObject<{
@@ -6169,7 +6202,12 @@ export declare const environmentEnvVarsOperations: {
6169
6202
  envVarId: z$2.ZodString;
6170
6203
  }, z$2.core.$strip>, OutputType<void>>>;
6171
6204
  };
6172
- /** `GET /machines` (machines and links §6): what the viewer reads, cursor-paged. */
6205
+ /**
6206
+ * `GET /machines` (machines and links §6): what the viewer reads, cursor-paged.
6207
+ * `status=running` answers every running machine, unpaged; `status=stopped`
6208
+ * the others, paged, and only it takes `q`, a search of their titles. A host
6209
+ * with no machines answers 503 `CONFIGURATION_REQUIRED`.
6210
+ */
6173
6211
  export declare const listMachinesQuery: z$2.ZodObject<{
6174
6212
  environmentId: z$2.ZodOptional<z$2.ZodGUID>;
6175
6213
  kind: z$2.ZodOptional<z$2.ZodEnum<{
@@ -6177,6 +6215,11 @@ export declare const listMachinesQuery: z$2.ZodObject<{
6177
6215
  conversation: "conversation";
6178
6216
  run: "run";
6179
6217
  }>>;
6218
+ status: z$2.ZodOptional<z$2.ZodEnum<{
6219
+ running: "running";
6220
+ stopped: "stopped";
6221
+ }>>;
6222
+ q: z$2.ZodOptional<z$2.ZodString>;
6180
6223
  cursor: z$2.ZodOptional<z$2.ZodString>;
6181
6224
  }, z$2.core.$strict>;
6182
6225
  /** `POST /links/:id/duration`: the link expires `durationMs` from now, at most `LINK_MAX_MS`. */
@@ -6203,6 +6246,11 @@ export declare const machinesOperations: {
6203
6246
  conversation: "conversation";
6204
6247
  run: "run";
6205
6248
  }>>;
6249
+ status: z$2.ZodOptional<z$2.ZodEnum<{
6250
+ running: "running";
6251
+ stopped: "stopped";
6252
+ }>>;
6253
+ q: z$2.ZodOptional<z$2.ZodString>;
6206
6254
  cursor: z$2.ZodOptional<z$2.ZodString>;
6207
6255
  }, z$2.core.$strict>;
6208
6256
  readonly output: z$2.ZodObject<{
@@ -24788,6 +24836,7 @@ export declare const recordsOperations: {
24788
24836
  readonly STATE_GATE: "SCHEMA_STATE_GATE";
24789
24837
  readonly ACTOR_CONTEXT_REQUIRED: "SCHEMA_ACTOR_CONTEXT_REQUIRED";
24790
24838
  readonly ACTOR_REQUIRED: "ACTOR_CONTEXT_REQUIRED";
24839
+ readonly ACTOR_CONTEXT_LOST: "ACTOR_CONTEXT_LOST";
24791
24840
  readonly TENANT_CONFIRMATION_MISMATCH: "SCHEMA_TENANT_CONFIRMATION_MISMATCH";
24792
24841
  readonly SESSION_REQUIRED: "SCHEMA_SESSION_REQUIRED";
24793
24842
  readonly API_KEY_OWNER_ROLE_REFUSED: "SCHEMA_API_KEY_OWNER_ROLE_REFUSED";
@@ -25181,6 +25230,7 @@ export declare const recordsOperations: {
25181
25230
  readonly STATE_GATE: "SCHEMA_STATE_GATE";
25182
25231
  readonly ACTOR_CONTEXT_REQUIRED: "SCHEMA_ACTOR_CONTEXT_REQUIRED";
25183
25232
  readonly ACTOR_REQUIRED: "ACTOR_CONTEXT_REQUIRED";
25233
+ readonly ACTOR_CONTEXT_LOST: "ACTOR_CONTEXT_LOST";
25184
25234
  readonly TENANT_CONFIRMATION_MISMATCH: "SCHEMA_TENANT_CONFIRMATION_MISMATCH";
25185
25235
  readonly SESSION_REQUIRED: "SCHEMA_SESSION_REQUIRED";
25186
25236
  readonly API_KEY_OWNER_ROLE_REFUSED: "SCHEMA_API_KEY_OWNER_ROLE_REFUSED";