@anchrd/colab-sdk 0.1.5 → 0.1.7

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.
@@ -607,6 +607,13 @@ export declare const ActionRow: z.ZodUnion<readonly [z.ZodObject<{
607
607
  }, z.core.$strict>]>;
608
608
  export type ActionRow = z.infer<typeof ActionRow>;
609
609
  export declare function isNodeRow(row: ActionRow): row is ActionItem;
610
+ export declare const MachineInstructions: z.ZodObject<{
611
+ path: z.ZodString;
612
+ status: z.ZodNullable<z.ZodString>;
613
+ markdown: z.ZodString;
614
+ version: z.ZodNullable<z.ZodInt>;
615
+ }, z.core.$strict>;
616
+ export type MachineInstructions = z.infer<typeof MachineInstructions>;
610
617
  export declare const ActionList: z.ZodObject<{
611
618
  items: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
612
619
  node: z.ZodObject<{
@@ -805,6 +812,7 @@ export declare const ActionList: z.ZodObject<{
805
812
  path: z.ZodString;
806
813
  status: z.ZodNullable<z.ZodString>;
807
814
  markdown: z.ZodString;
815
+ version: z.ZodNullable<z.ZodInt>;
808
816
  }, z.core.$strict>>;
809
817
  }, z.core.$strict>;
810
818
  export type ActionList = z.infer<typeof ActionList>;
@@ -164,6 +164,11 @@ export const ActionRow = z.union([ActionItem, ActionNoticeItem]);
164
164
  export function isNodeRow(row) {
165
165
  return "node" in row;
166
166
  }
167
+ // A machine's own INSTRUCTIONS (#46): one link of #39's chain and the number of the version it was
168
+ // read from, null when there is none. A run of an Operator records that number (#581, E111).
169
+ export const MachineInstructions = InstructionsLink.extend({
170
+ version: z.int().min(1).nullable(),
171
+ });
167
172
  export const ActionList = z.strictObject({
168
173
  // Newest first by since, then by node id (a notice by package and noticeKey). The filters tasks
169
174
  // and chats leave the notices out.
@@ -172,6 +177,7 @@ export const ActionList = z.strictObject({
172
177
  // Every row without the filter, for the number at the Actions icon.
173
178
  count: z.number().int(),
174
179
  // Only for a machine reading its own Actions over MCP, never over REST: the INSTRUCTIONS of its
175
- // root folder as one link of #39's chain, empty when there is none (traps P033, P034).
176
- instructions: InstructionsLink.optional(),
180
+ // root folder as one link of #39's chain with its version, empty when there is none (traps P033,
181
+ // P034).
182
+ instructions: MachineInstructions.optional(),
177
183
  });
@@ -34,7 +34,7 @@ export declare const resources: {
34
34
  readonly secret: "secrets";
35
35
  };
36
36
  export declare const actions: readonly ["list", "get", "create", "update", "archive", "restore", "purge"];
37
- export declare const verbs: readonly ["invite", "resend", "disable", "enable", "rotate", "share", "move", "start", "complete", "test", "revoke", "remove", "unlock", "publish", "schedule", "unpublish"];
37
+ export declare const verbs: readonly ["invite", "resend", "disable", "enable", "rotate", "share", "move", "start", "complete", "test", "revoke", "remove", "unlock", "publish", "schedule", "unpublish", "cancel"];
38
38
  export type Package = (typeof packages)[number];
39
39
  export type Resource = keyof typeof resources;
40
40
  export type Action = (typeof actions)[number] | (typeof verbs)[number];
@@ -84,6 +84,10 @@ export const verbs = [
84
84
  "publish",
85
85
  "schedule",
86
86
  "unpublish",
87
+ // A connector's run at the provider is ended before it completes (#567, E108):
88
+ // `fal_request_cancel`. Not `revoke`, which ends an access in Colab, and not `archive`: nothing
89
+ // stays to restore, and a cancelled run may still be billed.
90
+ "cancel",
87
91
  ];
88
92
  export function isPackage(word) {
89
93
  return packages.includes(word);
@@ -647,6 +647,12 @@ export declare const OperatorRunTouched: z.ZodObject<{
647
647
  connectors: z.ZodArray<z.ZodString>;
648
648
  }, z.core.$strict>;
649
649
  export type OperatorRunTouched = z.infer<typeof OperatorRunTouched>;
650
+ export declare const OperatorRunInstructions: z.ZodObject<{
651
+ version: z.ZodNullable<z.ZodInt>;
652
+ status: z.ZodNullable<z.ZodString>;
653
+ cut: z.ZodBoolean;
654
+ }, z.core.$strict>;
655
+ export type OperatorRunInstructions = z.infer<typeof OperatorRunInstructions>;
650
656
  export declare const OperatorRun: z.ZodObject<{
651
657
  trigger: z.ZodEnum<{
652
658
  schedule: "schedule";
@@ -673,6 +679,11 @@ export declare const OperatorRun: z.ZodObject<{
673
679
  processes: z.ZodArray<z.ZodString>;
674
680
  connectors: z.ZodArray<z.ZodString>;
675
681
  }, z.core.$strict>;
682
+ instructions: z.ZodNullable<z.ZodObject<{
683
+ version: z.ZodNullable<z.ZodInt>;
684
+ status: z.ZodNullable<z.ZodString>;
685
+ cut: z.ZodBoolean;
686
+ }, z.core.$strict>>;
676
687
  credentialKind: z.ZodNullable<z.ZodEnum<{
677
688
  subscription: "subscription";
678
689
  apikey: "apikey";
@@ -809,6 +820,11 @@ export declare const OperatorRunList: z.ZodObject<{
809
820
  processes: z.ZodArray<z.ZodString>;
810
821
  connectors: z.ZodArray<z.ZodString>;
811
822
  }, z.core.$strict>;
823
+ instructions: z.ZodNullable<z.ZodObject<{
824
+ version: z.ZodNullable<z.ZodInt>;
825
+ status: z.ZodNullable<z.ZodString>;
826
+ cut: z.ZodBoolean;
827
+ }, z.core.$strict>>;
812
828
  credentialKind: z.ZodNullable<z.ZodEnum<{
813
829
  subscription: "subscription";
814
830
  apikey: "apikey";
@@ -328,6 +328,13 @@ export const OperatorRunTouched = z.strictObject({
328
328
  processes: z.array(z.string().max(200)).max(200),
329
329
  connectors: z.array(z.string().max(200)).max(200),
330
330
  });
331
+ // The INSTRUCTIONS a run got as its system message (#581, E111): the version of the document in the
332
+ // Operator's root folder, its validation status then, and whether it was cut at the limit.
333
+ export const OperatorRunInstructions = z.strictObject({
334
+ version: z.int().min(1).nullable(),
335
+ status: z.string().nullable(),
336
+ cut: z.boolean(),
337
+ });
331
338
  // Who ran, named by the backend (#448): the machine's name in `access`, archived ones included, and
332
339
  // when the Operator was deleted (archived), so a run of a deleted Operator still says whose it was.
333
340
  const RunMachine = {
@@ -346,6 +353,8 @@ export const OperatorRun = z.strictObject({
346
353
  // The summary the Operator wrote at the end itself.
347
354
  summary: z.string().nullable(),
348
355
  touched: OperatorRunTouched,
356
+ // Null when the run got none: no text in its INSTRUCTIONS, or a run from before #581.
357
+ instructions: OperatorRunInstructions.nullable(),
349
358
  // The credential's kind decides how the cost reads: `apikey` is cost, `subscription` the API
350
359
  // equivalent (E81).
351
360
  credentialKind: CredentialKind.nullable(),
package/dist/sdk.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { ActionChat, ActionItem, ActionList, ActionListInput, ActionNotice, ActionNoticeButton, ActionNoticeCrumb, ActionNoticeItem, ActionNoticeKind, ActionNoticeReason, ActionNoticeTitle, ActionProcess, ActionRow, ActionRun, ActionSection, ActionTask, actionFilters, isNodeRow, } from "./actions/actions.js";
1
+ export { ActionChat, ActionItem, ActionList, ActionListInput, ActionNotice, ActionNoticeButton, ActionNoticeCrumb, ActionNoticeItem, ActionNoticeKind, ActionNoticeReason, ActionNoticeTitle, ActionProcess, ActionRow, ActionRun, ActionSection, ActionTask, actionFilters, isNodeRow, MachineInstructions, } from "./actions/actions.js";
2
2
  export { adminModeHeader, adminModeOn } from "./admin-mode.js";
3
3
  export { App, AppId, AppList, AppListInput, AppRevoked, AppRevokeInput, OwnAppListQuery, OwnSessionListQuery, Session, SessionId, SessionList, SessionListInput, SessionRevokeInput, SessionsRevoked, } from "./apps/apps.js";
4
4
  export { NodeArchived, NodeArchiveInput, NodePurged, NodePurgeInput, NodeRestoreInput, } from "./archive/archive.js";
@@ -26,7 +26,7 @@ export { Flag, Limit } from "./list-input.js";
26
26
  export { MachineArchiveInput, MachineCreateInput, MachineId, MachineKey, MachinePurged, MachinePurgeInput, MachineRestoreInput, MachineRotateInput, MachineUpdateInput, } from "./machines/machines.js";
27
27
  export { ChatRead, ChatUpdateInput, Message, MessageAuthor, MessageCreateInput, MessageId, MessageList, MessageListInput, messageMaxLength, } from "./messages/messages.js";
28
28
  export { BoardShownKind, BoardSystem, FolderCreated, FolderCreateInput, IntelligenceUser, IntelligenceUserList, IntelligenceUserListInput, NodeDetail, NodeGetInput, NodeHit, NodeHitFoundIn, NodeHitGroup, NodeId, NodeKind, NodeList, NodeListInput, NodeListItem, NodeMoved, NodeMoveInput, NodePath, NodePerson, NodeQuery, NodeReader, NodeSearch, NodeSection, NodeSort, NodeUpdateInput, NodeValidation, nodeKinds, responsibleKinds, SearchIndexState, SecretFields, SecretId, } from "./nodes/nodes.js";
29
- export { Credential, CredentialCreateInput, CredentialGetInput, CredentialId, CredentialKind, CredentialList, CredentialListInput, CredentialRevokeInput, CredentialState, CredentialTested, CredentialTestInput, CredentialTestResult, CredentialUpdateInput, GatewayTarget, MachineDisableInput, MachineEnableInput, MachineGetInput, MachineListInput, modelsOf, Operator, OperatorLimits, OperatorList, OperatorMachineArchiveInput, OperatorMachineCreateInput, OperatorMachineUpdateInput, OperatorModel, type OperatorProviderEntry, OperatorRun, OperatorRunGetInput, OperatorRunId, OperatorRunList, OperatorRunListInput, OperatorRunReason, OperatorRunStatus, OperatorRunTokens, OperatorRunTouched, OperatorRunTrigger, OperatorRunUsage, OperatorState, operatorDefaults, operatorProviders, PauseReason, Subagents, Trigger, } from "./operators/operators.js";
29
+ export { Credential, CredentialCreateInput, CredentialGetInput, CredentialId, CredentialKind, CredentialList, CredentialListInput, CredentialRevokeInput, CredentialState, CredentialTested, CredentialTestInput, CredentialTestResult, CredentialUpdateInput, GatewayTarget, MachineDisableInput, MachineEnableInput, MachineGetInput, MachineListInput, modelsOf, Operator, OperatorLimits, OperatorList, OperatorMachineArchiveInput, OperatorMachineCreateInput, OperatorMachineUpdateInput, OperatorModel, type OperatorProviderEntry, OperatorRun, OperatorRunGetInput, OperatorRunId, OperatorRunInstructions, OperatorRunList, OperatorRunListInput, OperatorRunReason, OperatorRunStatus, OperatorRunTokens, OperatorRunTouched, OperatorRunTrigger, OperatorRunUsage, OperatorState, operatorDefaults, operatorProviders, PauseReason, Subagents, Trigger, } from "./operators/operators.js";
30
30
  export { PageDetail, PageGetInput, PageHead, PageHeading, PageId, PageList, PageListInput, PageSummary, } from "./pages/pages.js";
31
31
  export { IdempotencyKey, Rev } from "./primitives/primitives.js";
32
32
  export { Locale, locales, Name, ProfileImageResponse, ProfileUpdateInput, profileImageMaxBytes, profileImageTypes, Theme, TimeZone, themes, } from "./profile/profile.js";
package/dist/sdk.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // The contract between UI, backends and outside services, published as `@anchrd/colab-sdk`. The
2
2
  // package exports only this file, so everything public is named here once.
3
3
  // biome-ignore lint/performance/noBarrelFile: this file IS the entry point of the package.
4
- export { ActionChat, ActionItem, ActionList, ActionListInput, ActionNotice, ActionNoticeButton, ActionNoticeCrumb, ActionNoticeItem, ActionNoticeKind, ActionNoticeReason, ActionNoticeTitle, ActionProcess, ActionRow, ActionRun, ActionSection, ActionTask, actionFilters, isNodeRow, } from "./actions/actions.js";
4
+ export { ActionChat, ActionItem, ActionList, ActionListInput, ActionNotice, ActionNoticeButton, ActionNoticeCrumb, ActionNoticeItem, ActionNoticeKind, ActionNoticeReason, ActionNoticeTitle, ActionProcess, ActionRow, ActionRun, ActionSection, ActionTask, actionFilters, isNodeRow, MachineInstructions, } from "./actions/actions.js";
5
5
  export { adminModeHeader, adminModeOn } from "./admin-mode.js";
6
6
  export { App, AppId, AppList, AppListInput, AppRevoked, AppRevokeInput, OwnAppListQuery, OwnSessionListQuery, Session, SessionId, SessionList, SessionListInput, SessionRevokeInput, SessionsRevoked, } from "./apps/apps.js";
7
7
  export { NodeArchived, NodeArchiveInput, NodePurged, NodePurgeInput, NodeRestoreInput, } from "./archive/archive.js";
@@ -29,7 +29,7 @@ export { Flag, Limit } from "./list-input.js";
29
29
  export { MachineArchiveInput, MachineCreateInput, MachineId, MachineKey, MachinePurged, MachinePurgeInput, MachineRestoreInput, MachineRotateInput, MachineUpdateInput, } from "./machines/machines.js";
30
30
  export { ChatRead, ChatUpdateInput, Message, MessageAuthor, MessageCreateInput, MessageId, MessageList, MessageListInput, messageMaxLength, } from "./messages/messages.js";
31
31
  export { BoardShownKind, BoardSystem, FolderCreated, FolderCreateInput, IntelligenceUser, IntelligenceUserList, IntelligenceUserListInput, NodeDetail, NodeGetInput, NodeHit, NodeHitFoundIn, NodeHitGroup, NodeId, NodeKind, NodeList, NodeListInput, NodeListItem, NodeMoved, NodeMoveInput, NodePath, NodePerson, NodeQuery, NodeReader, NodeSearch, NodeSection, NodeSort, NodeUpdateInput, NodeValidation, nodeKinds, responsibleKinds, SearchIndexState, SecretFields, SecretId, } from "./nodes/nodes.js";
32
- export { Credential, CredentialCreateInput, CredentialGetInput, CredentialId, CredentialKind, CredentialList, CredentialListInput, CredentialRevokeInput, CredentialState, CredentialTested, CredentialTestInput, CredentialTestResult, CredentialUpdateInput, GatewayTarget, MachineDisableInput, MachineEnableInput, MachineGetInput, MachineListInput, modelsOf, Operator, OperatorLimits, OperatorList, OperatorMachineArchiveInput, OperatorMachineCreateInput, OperatorMachineUpdateInput, OperatorModel, OperatorRun, OperatorRunGetInput, OperatorRunId, OperatorRunList, OperatorRunListInput, OperatorRunReason, OperatorRunStatus, OperatorRunTokens, OperatorRunTouched, OperatorRunTrigger, OperatorRunUsage, OperatorState, operatorDefaults, operatorProviders, PauseReason, Subagents, Trigger, } from "./operators/operators.js";
32
+ export { Credential, CredentialCreateInput, CredentialGetInput, CredentialId, CredentialKind, CredentialList, CredentialListInput, CredentialRevokeInput, CredentialState, CredentialTested, CredentialTestInput, CredentialTestResult, CredentialUpdateInput, GatewayTarget, MachineDisableInput, MachineEnableInput, MachineGetInput, MachineListInput, modelsOf, Operator, OperatorLimits, OperatorList, OperatorMachineArchiveInput, OperatorMachineCreateInput, OperatorMachineUpdateInput, OperatorModel, OperatorRun, OperatorRunGetInput, OperatorRunId, OperatorRunInstructions, OperatorRunList, OperatorRunListInput, OperatorRunReason, OperatorRunStatus, OperatorRunTokens, OperatorRunTouched, OperatorRunTrigger, OperatorRunUsage, OperatorState, operatorDefaults, operatorProviders, PauseReason, Subagents, Trigger, } from "./operators/operators.js";
33
33
  export { PageDetail, PageGetInput, PageHead, PageHeading, PageId, PageList, PageListInput, PageSummary, } from "./pages/pages.js";
34
34
  export { IdempotencyKey, Rev } from "./primitives/primitives.js";
35
35
  export { Locale, locales, Name, ProfileImageResponse, ProfileUpdateInput, profileImageMaxBytes, profileImageTypes, Theme, TimeZone, themes, } from "./profile/profile.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anchrd/colab-sdk",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Types, Zod schemas and the service client of Colab, the contract between its UI, backends and outside services.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",