@uru-intelligence/cli 0.6.4 → 0.7.0

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/library.mjs CHANGED
@@ -5659,10 +5659,4112 @@ function pickString(record, keys) {
5659
5659
  }
5660
5660
  return;
5661
5661
  }
5662
+
5663
+ // ../../packages/platform-operations/src/output_schemas_library.ts
5664
+ var openObject = { type: "object", additionalProperties: true };
5665
+ var openObjectList = { type: "array", items: openObject };
5666
+ var nullableString = { anyOf: [{ type: "string" }, { type: "null" }] };
5667
+ var nullableInteger = { anyOf: [{ type: "integer" }, { type: "null" }] };
5668
+ var nullableObject = { anyOf: [openObject, { type: "null" }] };
5669
+ function withOutputSchema(operation, outputSchema) {
5670
+ const returned = { ...operation, outputSchema };
5671
+ return returned;
5672
+ }
5673
+ var contentPageOutputSchema = {
5674
+ type: "object",
5675
+ additionalProperties: true,
5676
+ properties: {
5677
+ originalBytes: { type: "integer" },
5678
+ returnedBytes: { type: "integer" },
5679
+ offset: { type: "integer" },
5680
+ limit: { type: "integer" },
5681
+ hasMore: { type: "boolean" },
5682
+ nextOffset: nullableInteger
5683
+ },
5684
+ required: ["originalBytes", "returnedBytes", "offset", "limit", "hasMore", "nextOffset"]
5685
+ };
5686
+ var libraryItemOutputSchema = {
5687
+ type: "object",
5688
+ additionalProperties: true,
5689
+ properties: {
5690
+ id: { type: "string" },
5691
+ name: { type: "string" },
5692
+ path: { type: "string" },
5693
+ type: { type: "string", enum: ["file", "directory"] },
5694
+ resourceType: { type: "string" },
5695
+ resourceId: nullableString,
5696
+ entryType: { type: "string", enum: ["resource", "shortcut"] },
5697
+ targetItemId: { type: "string" },
5698
+ effectiveResourceType: { type: "string" },
5699
+ executionResourceId: nullableString,
5700
+ resourceSlug: {
5701
+ ...nullableString,
5702
+ description: "Canonical public slug for typed tools. Use this exact value; never derive a slug from name."
5703
+ },
5704
+ accessRole: nullableString,
5705
+ mimeType: nullableString,
5706
+ sizeBytes: nullableInteger,
5707
+ previewStatus: nullableString,
5708
+ trashedAt: nullableString,
5709
+ deletedAt: nullableString,
5710
+ purgeAfter: nullableString,
5711
+ modifiedAt: {
5712
+ type: "string",
5713
+ description: "modifiedAt is the last time someone changed the item's content, name or description. Lists show folders first, then the most recently modified."
5714
+ },
5715
+ modifiedBy: {
5716
+ anyOf: [
5717
+ {
5718
+ type: "object",
5719
+ additionalProperties: false,
5720
+ properties: {
5721
+ userId: { type: "string" },
5722
+ name: nullableString
5723
+ },
5724
+ required: ["userId", "name"]
5725
+ },
5726
+ { type: "null" }
5727
+ ],
5728
+ description: "Who made the change in modifiedAt, shown when you can edit the item; null otherwise or when no person is known."
5729
+ },
5730
+ openMode: {
5731
+ type: "string",
5732
+ enum: ["pack_gem", "not_ready"],
5733
+ description: "Only on a Gem you reach through a shared folder or Bundle, or an Agent share, not through a share of the Gem: it opens on its own host as a Viewer (pack_gem), or that share is not made yet (not_ready). The row names the Gem and nothing of its source."
5734
+ }
5735
+ }
5736
+ };
5737
+ var libraryFilesystemOutputSchema = {
5738
+ type: "object",
5739
+ additionalProperties: true,
5740
+ properties: {
5741
+ warnings: { type: "array", items: { type: "object" } },
5742
+ partial: { type: "boolean" },
5743
+ truncated: { type: "boolean" },
5744
+ timingsMs: { type: "object" },
5745
+ resultSource: {
5746
+ type: "string",
5747
+ enum: [
5748
+ "local_manifest",
5749
+ "redis_manifest",
5750
+ "db_manifest",
5751
+ "live_build",
5752
+ "scoped_live_build",
5753
+ "descriptor_runtime",
5754
+ "direct_scan",
5755
+ "durable_index"
5756
+ ]
5757
+ },
5758
+ op: {
5759
+ type: "string",
5760
+ enum: [
5761
+ "ls",
5762
+ "search",
5763
+ "stat",
5764
+ "read",
5765
+ "mkdir",
5766
+ "write",
5767
+ "patch",
5768
+ "patch_preview",
5769
+ "cp",
5770
+ "mv",
5771
+ "rm",
5772
+ "restore",
5773
+ "empty_trash",
5774
+ "move_workspace",
5775
+ "favorite",
5776
+ "unfavorite"
5777
+ ]
5778
+ },
5779
+ path: { type: "string" },
5780
+ query: { type: "string" },
5781
+ resourceType: { type: "string" },
5782
+ accessRole: nullableString,
5783
+ capabilities: openObject,
5784
+ totalCount: { type: "integer" },
5785
+ limit: { type: "integer" },
5786
+ hasMore: {
5787
+ type: "boolean",
5788
+ description: "True when more ls/search results exist after this page."
5789
+ },
5790
+ nextCursor: {
5791
+ ...nullableString,
5792
+ description: "Pass it as cursor to read the next ls, search or skill_history page. Null or absent on the last page."
5793
+ },
5794
+ items: { type: "array", items: libraryItemOutputSchema },
5795
+ item: libraryItemOutputSchema,
5796
+ content: { type: "string" },
5797
+ contentMeta: contentPageOutputSchema,
5798
+ revisionId: {
5799
+ type: "string",
5800
+ description: "A stored file read, or a text file write: the revision the text came from or was saved as. Pass it as base_source_revision_id on the next write of a Markdown or plain text file."
5801
+ },
5802
+ changes: openObjectList,
5803
+ sharedWithMe: {
5804
+ type: "array",
5805
+ description: "op=search: up to five items shared with you whose title matches, from any workspace.",
5806
+ items: {
5807
+ type: "object",
5808
+ additionalProperties: true,
5809
+ properties: {
5810
+ itemId: { type: "string" },
5811
+ title: { type: "string" },
5812
+ kind: { type: "string" },
5813
+ role: { type: "string" },
5814
+ link: { type: "boolean" },
5815
+ senderName: nullableString,
5816
+ sharedAt: { type: "string" },
5817
+ modifiedAt: nullableString
5818
+ }
5819
+ }
5820
+ },
5821
+ deleted: { type: "array", items: libraryItemOutputSchema },
5822
+ permanent: { type: "boolean" },
5823
+ sourceWorkspaceId: { type: "string" },
5824
+ targetWorkspaceId: { type: "string" },
5825
+ payload: {
5826
+ type: "object",
5827
+ additionalProperties: true,
5828
+ properties: {
5829
+ content: { type: "string" },
5830
+ offset: { type: "integer" },
5831
+ returnedBytes: { type: "integer" },
5832
+ totalBytes: { type: "integer" },
5833
+ nextOffset: nullableInteger,
5834
+ hasMore: { type: "boolean" },
5835
+ currentSourceRevisionId: nullableString,
5836
+ sourceHash: nullableString
5837
+ }
5838
+ },
5839
+ lines: {
5840
+ ...openObjectList,
5841
+ description: "op=skill_history: the skill's saved versions and settings changes, newest first."
5842
+ },
5843
+ advisories: {
5844
+ ...openObjectList,
5845
+ description: "A skill save or restore: the files the skill page would warn about."
5846
+ },
5847
+ restoredFromVersion: {
5848
+ type: "integer",
5849
+ description: "op=restore_skill_version: the version number the new version copies."
5850
+ }
5851
+ }
5852
+ };
5853
+ var externalSourceItemOutputSchema = {
5854
+ type: "object",
5855
+ additionalProperties: true,
5856
+ properties: {
5857
+ id: { type: "string" },
5858
+ sourceId: { type: "string" },
5859
+ externalFileId: { type: "string" },
5860
+ libraryItemId: { type: "string" },
5861
+ externalName: { type: "string" },
5862
+ externalMimeType: nullableString,
5863
+ externalModifiedAt: nullableString,
5864
+ externalParentId: nullableString,
5865
+ createdAt: nullableString,
5866
+ updatedAt: nullableString
5867
+ }
5868
+ };
5869
+ var externalSourceProperties = {
5870
+ id: { type: "string" },
5871
+ workspaceId: { type: "string" },
5872
+ ownerUserId: { type: "string" },
5873
+ provider: { type: "string", enum: ["googledrive"] },
5874
+ connectionId: { type: "string" },
5875
+ connectionLabel: nullableString,
5876
+ connectionAccountIdentifier: nullableString,
5877
+ sourceKind: { type: "string", enum: ["file", "folder"] },
5878
+ driveId: nullableString,
5879
+ externalId: { type: "string" },
5880
+ externalName: { type: "string" },
5881
+ targetFolderId: nullableString,
5882
+ rootLibraryItemId: nullableString,
5883
+ rootLibraryFolderId: nullableString,
5884
+ enabled: { type: "boolean" },
5885
+ syncStatus: {
5886
+ type: "string",
5887
+ enum: ["pending", "ready", "syncing", "deleting", "error", "rebind_required"]
5888
+ },
5889
+ syncIntervalMinutes: { type: "integer" },
5890
+ lastSyncedAt: nullableString,
5891
+ lastError: nullableString,
5892
+ createdAt: nullableString,
5893
+ updatedAt: nullableString,
5894
+ items: { type: "array", items: externalSourceItemOutputSchema }
5895
+ };
5896
+ var externalSourceOutputSchema = {
5897
+ type: "object",
5898
+ additionalProperties: true,
5899
+ properties: externalSourceProperties
5900
+ };
5901
+ var libraryExternalSourcesOutputSchema = {
5902
+ type: "object",
5903
+ additionalProperties: true,
5904
+ properties: {
5905
+ ...externalSourceProperties,
5906
+ sources: { type: "array", items: externalSourceOutputSchema },
5907
+ source: externalSourceOutputSchema,
5908
+ ok: { type: "boolean" },
5909
+ deletedSourceId: { type: "string" },
5910
+ deletedLibraryItemIds: { type: "array", items: { type: "string" } }
5911
+ }
5912
+ };
5913
+ var libraryUploadOutputSchema = {
5914
+ type: "object",
5915
+ additionalProperties: true,
5916
+ properties: {
5917
+ files: openObjectList,
5918
+ uploadId: { type: "string" },
5919
+ workspaceId: {
5920
+ type: "string",
5921
+ description: "create_session: the workspace this upload belongs to. complete_session runs only there."
5922
+ },
5923
+ bucket: { type: "string" },
5924
+ objectPath: { type: "string" },
5925
+ endpoint: { type: "string" },
5926
+ token: { type: "string" },
5927
+ headers: openObject,
5928
+ metadata: openObject,
5929
+ expiresAt: { type: "string" },
5930
+ chunkSize: { type: "integer" },
5931
+ ok: { type: "boolean" },
5932
+ id: { type: "string" },
5933
+ libraryItemId: { type: "string" },
5934
+ currentFileId: { type: "string" },
5935
+ versionNumber: { type: "integer" },
5936
+ filename: { type: "string" },
5937
+ mimeType: { type: "string" },
5938
+ sizeBytes: { type: "integer" },
5939
+ storageStatus: {
5940
+ type: "string",
5941
+ description: "complete_session: uploaded when the file is in the Library; finalizing while its bytes are checked and moved (a new file is not in the Library yet, a new version is not current yet)."
5942
+ },
5943
+ previewAvailable: { type: "boolean" },
5944
+ downloadAvailable: { type: "boolean" },
5945
+ conflictStrategy: { type: "string" },
5946
+ match: nullableObject
5947
+ }
5948
+ };
5949
+ var libraryCollabOutputSchema = {
5950
+ type: "object",
5951
+ additionalProperties: true,
5952
+ properties: {
5953
+ item: openObject,
5954
+ itemId: { type: "string" },
5955
+ versions: {
5956
+ type: "array",
5957
+ items: {
5958
+ type: "object",
5959
+ additionalProperties: true,
5960
+ properties: {
5961
+ content: { type: "string" },
5962
+ contentMeta: contentPageOutputSchema
5963
+ }
5964
+ }
5965
+ },
5966
+ totalCount: { type: "integer" },
5967
+ limit: { type: "integer" },
5968
+ offset: { type: "integer" },
5969
+ hasMore: { type: "boolean" },
5970
+ nextOffset: nullableInteger,
5971
+ permissions: openObjectList,
5972
+ permission: nullableObject,
5973
+ shareSettings: nullableObject,
5974
+ comment: openObject,
5975
+ labelValue: openObject,
5976
+ owner: openObject,
5977
+ shares: openObjectList,
5978
+ throughPacks: openObjectList,
5979
+ organization: nullableObject,
5980
+ capabilities: openObjectList,
5981
+ caller: openObject,
5982
+ nextCursor: nullableString,
5983
+ share: openObject,
5984
+ people: openObjectList,
5985
+ emailed: { anyOf: [{ type: "integer" }, { type: "boolean" }] },
5986
+ emailExpected: { type: "string" },
5987
+ sendAllowanceRemaining: { type: "integer" },
5988
+ warning: nullableString,
5989
+ linkTurnedOff: { type: "boolean" },
5990
+ shareId: { type: "string" },
5991
+ recipientId: { type: "string" },
5992
+ closedRecipientIds: { type: "array", items: { type: "string" } },
5993
+ summary: openObject,
5994
+ events: openObjectList,
5995
+ members: openObjectList,
5996
+ contacts: openObjectList,
5997
+ gems: openObjectList,
5998
+ truncated: { type: "boolean" },
5999
+ cards: openObjectList,
6000
+ card: openObject,
6001
+ rows: {
6002
+ ...openObjectList,
6003
+ description: "received_get: each way you can open the item. sent_list: one row per person or general access level. The keys inside each row are snake_case (recipient_id, shared_at), unlike the rest of the answer."
6004
+ },
6005
+ counts: openObject,
6006
+ accessKeptThrough: nullableObject,
6007
+ revoked: openObjectList,
6008
+ refused: openObjectList,
6009
+ receivedNeedsYou: { type: "integer" },
6010
+ sentWaiting: { type: "integer" },
6011
+ remainingToday: { type: "integer" },
6012
+ perDay: { type: "integer" },
6013
+ resetsAt: nullableString
6014
+ }
6015
+ };
6016
+ var skillSettingsWordsSchema = {
6017
+ type: "object",
6018
+ additionalProperties: true,
6019
+ description: "The settings in the words skills.settings takes. can names the settings you may change.",
6020
+ properties: {
6021
+ people_who_can_open: { type: "boolean" },
6022
+ linked_agents: { type: "boolean" },
6023
+ teams: {
6024
+ type: "array",
6025
+ items: {
6026
+ type: "object",
6027
+ additionalProperties: true,
6028
+ properties: { id: { type: "string" }, name: { type: "string" } },
6029
+ required: ["id", "name"]
6030
+ }
6031
+ },
6032
+ whole_workspace: { type: "boolean" },
6033
+ blocked: { type: "boolean" },
6034
+ in_my_chats: { type: "boolean" },
6035
+ can: {
6036
+ type: "object",
6037
+ additionalProperties: true,
6038
+ properties: {
6039
+ people_who_can_open: { type: "boolean" },
6040
+ linked_agents: { type: "boolean" },
6041
+ teams: { type: "array", items: { type: "string" } },
6042
+ whole_workspace: { type: "boolean" },
6043
+ block: { type: "boolean" }
6044
+ },
6045
+ required: ["people_who_can_open", "linked_agents", "teams", "whole_workspace", "block"]
6046
+ }
6047
+ },
6048
+ required: ["people_who_can_open", "linked_agents", "teams", "whole_workspace", "blocked", "in_my_chats", "can"]
6049
+ };
6050
+ var skillSettingsOutputSchema = {
6051
+ type: "object",
6052
+ additionalProperties: true,
6053
+ properties: {
6054
+ item_id: nullableString,
6055
+ name: { type: "string" },
6056
+ title: { type: "string" },
6057
+ settings: skillSettingsWordsSchema,
6058
+ built_in: { type: "boolean" },
6059
+ blocked: { type: "boolean" }
6060
+ }
6061
+ };
6062
+ var importReportRow = {
6063
+ type: "object",
6064
+ additionalProperties: true,
6065
+ properties: {
6066
+ kind: { type: "string", enum: ["skill"] },
6067
+ name: { type: "string" },
6068
+ title: { type: "string" },
6069
+ path: { type: "string" },
6070
+ item_id: nullableString,
6071
+ files: { type: "array", items: { type: "string" } }
6072
+ },
6073
+ required: ["kind", "name", "title", "path", "item_id", "files"]
6074
+ };
6075
+ var libraryImportOutputSchema = {
6076
+ type: "object",
6077
+ additionalProperties: true,
6078
+ properties: {
6079
+ applied: { type: "boolean" },
6080
+ result_kind: { type: "string", enum: ["skill"] },
6081
+ imported: { type: "array", items: importReportRow },
6082
+ refused: {
6083
+ type: "array",
6084
+ items: {
6085
+ type: "object",
6086
+ additionalProperties: true,
6087
+ properties: { path: { type: "string" }, reason: { type: "string" } },
6088
+ required: ["path", "reason"]
6089
+ }
6090
+ },
6091
+ advisories: openObjectList,
6092
+ message: { type: "string" }
6093
+ }
6094
+ };
6095
+
6096
+ // ../../packages/platform-operations/src/operation_groups_agents.ts
6097
+ var text = { type: "string" };
6098
+ var nullableText = { type: ["string", "null"] };
6099
+ var flag = { type: "boolean" };
6100
+ function object2(properties, required) {
6101
+ const returned = { type: "object", additionalProperties: true, properties, required: [...required] };
6102
+ return returned;
6103
+ }
6104
+ var locks = object2({ identity: flag, links: flag, behavior: flag, tools: flag, access: flag }, ["identity", "links", "behavior", "tools", "access"]);
6105
+ var agentRow = object2({
6106
+ item_id: text,
6107
+ name: text,
6108
+ role: text,
6109
+ description: text,
6110
+ status: text,
6111
+ model: nullableText
6112
+ }, ["item_id", "name", "role", "description", "status", "model"]);
6113
+ var agentView = object2({
6114
+ item_id: text,
6115
+ name: text,
6116
+ role: text,
6117
+ description: text,
6118
+ instructions: text,
6119
+ status: text,
6120
+ model: nullableText,
6121
+ locks,
6122
+ version: { type: "integer", minimum: 0 },
6123
+ updated_at: text
6124
+ }, ["item_id", "name", "role", "description", "instructions", "status", "model", "locks", "version", "updated_at"]);
6125
+ var listOutputSchema = {
6126
+ type: "object",
6127
+ additionalProperties: true,
6128
+ properties: {
6129
+ agents: { type: "array", items: agentRow },
6130
+ total: { type: "integer", minimum: 0 },
6131
+ next_cursor: nullableText
6132
+ }
6133
+ };
6134
+ var agentOutputSchema = {
6135
+ type: "object",
6136
+ additionalProperties: true,
6137
+ properties: { agent: agentView }
6138
+ };
6139
+ var writeOutputSchema = object2({ message: text, agent: agentView }, ["message", "agent"]);
6140
+ function buildAgentsOperations(op) {
6141
+ const returned = [
6142
+ withOutputSchema(op("agents.list", "agents", "List the Agents you can open, with an optional search text.", "agents_query", "list", "read"), listOutputSchema),
6143
+ withOutputSchema(op("agents.get", "agents", "Read one Agent: its name, role, description, instructions, model, status and locks.", "agents_query", "get", "read"), agentOutputSchema),
6144
+ withOutputSchema(op("agents.create", "agents", "Make a new Agent with a name and what it does.", "agents", "create", "write"), writeOutputSchema),
6145
+ withOutputSchema(op("agents.update", "agents", "Change an Agent: its name, role, description, instructions, model, status or locks. Send only the fields to change.", "agents", "update", "write"), writeOutputSchema)
6146
+ ];
6147
+ return returned;
6148
+ }
6149
+
6150
+ // ../../packages/platform-operations/src/operation_groups_apps.ts
6151
+ var APPS_PICK_MODES = ["need", "rule", "account"];
6152
+ var APP_SOURCES = ["own", "adopted", "custom", "offered", "company", "uru", "gem", "marketplace"];
6153
+ var APP_GROUPS = ["yours", "offered", "company", "uru", "gem", "marketplace"];
6154
+ var text2 = { type: "string" };
6155
+ var nullableText2 = { type: ["string", "null"] };
6156
+ function object3(properties, required) {
6157
+ const returned = { type: "object", additionalProperties: true, properties, required: [...required] };
6158
+ return returned;
6159
+ }
6160
+ var appProperties = {
6161
+ key: text2,
6162
+ name: text2,
6163
+ source: { type: "string", enum: [...APP_SOURCES] },
6164
+ app_slug: nullableText2,
6165
+ owner_name: nullableText2,
6166
+ category: nullableText2,
6167
+ hosted_by_uru: { type: "boolean" },
6168
+ disabled_reason: nullableText2,
6169
+ action_count: { type: ["integer", "null"], minimum: 0 }
6170
+ };
6171
+ var appRow = object3(appProperties, ["key", "name", "source", "hosted_by_uru", "disabled_reason", "action_count"]);
6172
+ var actionRow = object3({ key: text2, name: text2 }, ["key", "name"]);
6173
+ var groupRow = object3({
6174
+ id: { type: "string", enum: [...APP_GROUPS] },
6175
+ apps: { type: "array", items: appRow },
6176
+ total: { type: "integer", minimum: 0 },
6177
+ next_cursor: nullableText2,
6178
+ popular: { type: "boolean" }
6179
+ }, ["id", "apps", "total", "next_cursor", "popular"]);
6180
+ var appWithActions = object3({
6181
+ ...appProperties,
6182
+ actions: {
6183
+ type: ["object", "null"],
6184
+ additionalProperties: true,
6185
+ properties: {
6186
+ read: { type: "array", items: actionRow },
6187
+ change: { type: "array", items: actionRow }
6188
+ }
6189
+ }
6190
+ }, ["key", "name", "source", "actions"]);
6191
+ var queryOutputSchema = object3({
6192
+ mode: { type: "string", enum: [...APPS_PICK_MODES] },
6193
+ query: text2,
6194
+ groups: { type: "array", items: groupRow },
6195
+ categories: { type: "array", items: text2 },
6196
+ next_cursor: nullableText2,
6197
+ app: appWithActions
6198
+ }, []);
6199
+ function buildAppsOperations(op) {
6200
+ const returned = [
6201
+ withOutputSchema(op("apps.list", "apps", "List the apps you can pick for an Agent need, a rule, or an offered account: your apps, company tools, Uru tools, Gem tools and apps to connect, with search and pages.", "apps_query", "list", "read"), queryOutputSchema),
6202
+ withOutputSchema(op("apps.get", "apps", "Read one app from the app picker by its key, with its read and change actions.", "apps_query", "get", "read"), queryOutputSchema)
6203
+ ];
6204
+ return returned;
6205
+ }
6206
+
6207
+ // ../../packages/platform-operations/src/operation_groups_rules.ts
6208
+ var ASKING_LEVELS = ["never", "on_write", "always"];
6209
+ var levelOutputSchema = {
6210
+ type: "object",
6211
+ additionalProperties: true,
6212
+ properties: {
6213
+ level: { type: "string", enum: [...ASKING_LEVELS] },
6214
+ level_name: { type: "string" },
6215
+ changed_chats: { type: "integer", minimum: 0 },
6216
+ message: { type: "string" }
6217
+ },
6218
+ required: ["level", "level_name"]
6219
+ };
6220
+ function buildRulesOperations(op) {
6221
+ const returned = [
6222
+ withOutputSchema(op("rules.level_get", "rules", "Read your asking level: never (ask only when it is important), on_write (ask before anything that changes something) or always (ask before every action).", "rules_query", "level_get", "read"), levelOutputSchema),
6223
+ withOutputSchema(op("rules.level_set", "rules", "Change your asking level for your chats: never, on_write or always. Only you can change it, and only in Uru can you lower it.", "rules", "level_set", "write"), levelOutputSchema)
6224
+ ];
6225
+ return returned;
6226
+ }
6227
+
6228
+ // ../../packages/platform-operations/src/operation_groups_connections.ts
6229
+ var CONNECTIONS_ACCESS_OPS = [
6230
+ "offer_answer",
6231
+ "workspace_actions_set",
6232
+ "adopt",
6233
+ "adoption_withdraw",
6234
+ "adoption_answer",
6235
+ "adoption_revoke",
6236
+ "gem_tool_ask",
6237
+ "gem_tool_answer"
6238
+ ];
6239
+ var CONNECTIONS_WRITE_OPS = [
6240
+ "connect",
6241
+ "connector_add",
6242
+ "update",
6243
+ "actions_set",
6244
+ "disconnect",
6245
+ "offer",
6246
+ "offer_withdraw",
6247
+ ...CONNECTIONS_ACCESS_OPS
6248
+ ];
6249
+ var CONNECTIONS_PERSON_ONLY_OPS = [
6250
+ "connector_add",
6251
+ "actions_set",
6252
+ "offer",
6253
+ "offer_withdraw",
6254
+ ...CONNECTIONS_ACCESS_OPS
6255
+ ];
6256
+ var text3 = { type: "string" };
6257
+ var nullableText3 = { type: ["string", "null"] };
6258
+ function object4(properties, required) {
6259
+ const returned = { type: "object", additionalProperties: true, properties, required: [...required] };
6260
+ return returned;
6261
+ }
6262
+ var connectionRow = object4({
6263
+ id: text3,
6264
+ app: text3,
6265
+ name: text3,
6266
+ label: nullableText3,
6267
+ kind: { type: "string", enum: ["app", "custom_connector"] },
6268
+ status: text3,
6269
+ main: { type: "boolean" },
6270
+ needs_attention: { type: "boolean" },
6271
+ syncing_tools: { type: "boolean" }
6272
+ }, ["id", "app", "name", "kind", "status"]);
6273
+ var namedAction = object4({ id: text3, name: nullableText3 }, ["id", "name"]);
6274
+ var namedActionList = { type: "array", items: namedAction };
6275
+ var offerRow = object4({
6276
+ id: text3,
6277
+ connection_id: text3,
6278
+ name: text3,
6279
+ app: text3,
6280
+ state: text3,
6281
+ owner_name: nullableText3,
6282
+ yours: { type: "boolean" },
6283
+ offered_actions: namedActionList,
6284
+ allowed_actions: namedActionList,
6285
+ denied_actions: namedActionList,
6286
+ can_ask: { type: "boolean" },
6287
+ your_request: nullableText3
6288
+ }, ["id", "connection_id", "name", "state"]);
6289
+ var adoptionRow = object4({
6290
+ id: text3,
6291
+ offer_id: text3,
6292
+ connection_id: text3,
6293
+ state: text3,
6294
+ yours: { type: "boolean" }
6295
+ }, ["id", "offer_id", "connection_id", "state"]);
6296
+ var gemToolRow = object4({
6297
+ request: text3,
6298
+ tool: text3,
6299
+ name: text3,
6300
+ state: text3
6301
+ }, ["request", "tool", "state"]);
6302
+ var actionRow2 = object4({
6303
+ action: text3,
6304
+ name: text3,
6305
+ allowed: { type: "boolean" },
6306
+ admin_locked: { type: "boolean" }
6307
+ }, ["action", "allowed"]);
6308
+ var accessEnum = { type: "string", enum: ["all", "none", "some"] };
6309
+ var queryOutputSchema2 = object4({
6310
+ source: { type: "string", enum: ["mine", "offered"] },
6311
+ connections: { type: "array", items: connectionRow },
6312
+ offers: { type: "array", items: offerRow },
6313
+ total: { type: "integer", minimum: 0 },
6314
+ next_cursor: nullableText3,
6315
+ connection: connectionRow,
6316
+ access: accessEnum,
6317
+ actions: { type: "array", items: actionRow2 }
6318
+ }, []);
6319
+ var writeOutputSchema2 = object4({
6320
+ message: text3,
6321
+ connection: connectionRow,
6322
+ connection_id: text3,
6323
+ app: text3,
6324
+ open_url: nullableText3,
6325
+ already_connected: { type: "boolean" },
6326
+ label: text3,
6327
+ access: accessEnum,
6328
+ actions: { type: "array", items: actionRow2 },
6329
+ offer: offerRow,
6330
+ adoption: adoptionRow,
6331
+ gem: text3,
6332
+ gem_title: text3,
6333
+ requests: { type: "array", items: gemToolRow },
6334
+ outcome: text3,
6335
+ state: text3
6336
+ }, ["message"]);
6337
+ function buildConnectionsOperations(op) {
6338
+ const returned = [
6339
+ withOutputSchema(op("connections.list", "connections", "List your own app accounts and custom connectors in this workspace, or the accounts people offered to it.", "connections_query", "list", "read"), queryOutputSchema2),
6340
+ withOutputSchema(op("connections.get", "connections", "Read one of your accounts and which of its actions it allows.", "connections_query", "get", "read"), queryOutputSchema2),
6341
+ withOutputSchema(op("connections.connect", "connections", "Start signing in to an app. The answer has a link: the person opens it and signs in in their browser.", "connections", "connect", "write"), writeOutputSchema2),
6342
+ withOutputSchema(op("connections.connector_add", "connections", "Add a custom connector by its server address and a name. Only a signed-in person can do this.", "connections", "connector_add", "write"), writeOutputSchema2),
6343
+ withOutputSchema(op("connections.update", "connections", 'Rename one of your accounts, for example "work".', "connections", "update", "write"), writeOutputSchema2),
6344
+ withOutputSchema(op("connections.actions_set", "connections", "Set which actions one of your accounts allows: all, none, or the ones you list. Only a signed-in person can do this.", "connections", "actions_set", "write"), writeOutputSchema2),
6345
+ withOutputSchema(op("connections.disconnect", "connections", "Disconnect one of your accounts, or remove a custom connector. Tools that use it stop working.", "connections", "disconnect", "destructive"), writeOutputSchema2),
6346
+ withOutputSchema(op("connections.offer", "connections", "Offer one of your accounts to this workspace, so others can ask to use it. Only a signed-in person can do this.", "connections", "offer", "write"), writeOutputSchema2),
6347
+ withOutputSchema(op("connections.offer_withdraw", "connections", "Take back the offer of one of your accounts. People who use it lose it. Only a signed-in person can do this.", "connections", "offer_withdraw", "write"), writeOutputSchema2),
6348
+ withOutputSchema(op("connections.offer_answer", "connections", "Approve or reject an account a person offered to this workspace. Only a workspace admin or owner can do this, and only a signed-in person.", "connections", "offer_answer", "write"), writeOutputSchema2),
6349
+ withOutputSchema(op("connections.workspace_actions_set", "connections", "Set which actions of an offered account people in this workspace may use, and which actions nobody may use. Only a workspace admin or owner can do this, and only a signed-in person.", "connections", "workspace_actions_set", "write"), writeOutputSchema2),
6350
+ withOutputSchema(op("connections.adopt", "connections", "Ask to use an account another person offered to this workspace. An admin approves, then you can use it in every chat. Only a signed-in person can do this.", "connections", "adopt", "write"), writeOutputSchema2),
6351
+ withOutputSchema(op("connections.adoption_withdraw", "connections", "Take back your own ask to use an offered account, or stop using it. Only a signed-in person can do this.", "connections", "adoption_withdraw", "write"), writeOutputSchema2),
6352
+ withOutputSchema(op("connections.adoption_answer", "connections", "Approve or reject a person's ask to use an offered account. Only a workspace admin or owner can do this, and only a signed-in person.", "connections", "adoption_answer", "write"), writeOutputSchema2),
6353
+ withOutputSchema(op("connections.adoption_revoke", "connections", "End one person's use of an offered account. That person withdraws it, or a workspace admin revokes it. Only a signed-in person can do this.", "connections", "adoption_revoke", "destructive"), writeOutputSchema2),
6354
+ withOutputSchema(op("connections.gem_tool_ask", "connections", "Ask the owner of a Gem to let you use one of its offered tasks as a tool in this workspace. Only a signed-in person can do this.", "connections", "gem_tool_ask", "write"), writeOutputSchema2),
6355
+ withOutputSchema(op("connections.gem_tool_answer", "connections", "Approve or block a person's ask to use a task of your Gem as a tool. Only the Gem owner can do this, and only a signed-in person.", "connections", "gem_tool_answer", "write"), writeOutputSchema2)
6356
+ ];
6357
+ return returned;
6358
+ }
6359
+
6360
+ // ../../packages/platform-operations/src/operation_groups_links.ts
6361
+ var text4 = { type: "string" };
6362
+ var nullableText4 = { type: ["string", "null"] };
6363
+ function object5(properties, required) {
6364
+ const returned = { type: "object", additionalProperties: true, properties, required: [...required] };
6365
+ return returned;
6366
+ }
6367
+ var itemRef = object5({ item_id: text4, name: text4, type: text4, path: nullableText4 }, ["item_id", "name", "type", "path"]);
6368
+ var linkRow = object5({
6369
+ from: itemRef,
6370
+ to: itemRef,
6371
+ kind: { type: "string", enum: ["agent", "text", "bundle", "gem", "workspace", "team", "manual"] },
6372
+ private: { type: "boolean" },
6373
+ position: { type: "integer", minimum: 1 },
6374
+ load_at_start: { type: "boolean" },
6375
+ goes_along: { type: "boolean" },
6376
+ stays_reason: nullableText4,
6377
+ link_text: nullableText4
6378
+ }, ["from", "to", "kind", "private", "load_at_start", "goes_along", "stays_reason", "link_text"]);
6379
+ var listOutputSchema2 = object5({
6380
+ item: itemRef,
6381
+ direction: { type: "string", enum: ["out", "in"] },
6382
+ links: { type: "array", items: linkRow },
6383
+ total: { type: "integer", minimum: 0 },
6384
+ next_cursor: nullableText4
6385
+ }, ["item", "direction", "links", "total", "next_cursor"]);
6386
+ var writeOutputSchema3 = object5({
6387
+ message: text4,
6388
+ from: itemRef,
6389
+ to: itemRef,
6390
+ private: { type: "boolean" },
6391
+ load_at_start: { type: "boolean" },
6392
+ position: { type: "integer", minimum: 1 },
6393
+ goes_along: { type: "boolean" },
6394
+ stays_reason: nullableText4,
6395
+ removed: { type: "boolean" }
6396
+ }, ["message", "from", "to"]);
6397
+ function buildLinksOperations(op) {
6398
+ const returned = [
6399
+ withOutputSchema(op("links.list", "links", "List the links of a Library item: the items it links to (direction out), or the items that link to it (direction in).", "links_query", "list", "read"), listOutputSchema2),
6400
+ withOutputSchema(op("links.add", "links", "Link a Library item to an Agent. The link goes along when you share the Agent; with private it stays with you.", "links", "add", "write"), writeOutputSchema3),
6401
+ withOutputSchema(op("links.update", "links", "Change one link of an Agent: make it Private or not, load it when a chat starts, or move it to a new position.", "links", "update", "write"), writeOutputSchema3),
6402
+ withOutputSchema(op("links.remove", "links", "Remove one link from an Agent. The item itself stays in the Library.", "links", "remove", "write"), writeOutputSchema3)
6403
+ ];
6404
+ return returned;
6405
+ }
6406
+
6407
+ // ../../packages/platform-operations/src/output_schemas_tools.ts
6408
+ var webSearchResultSchema = {
6409
+ type: "object",
6410
+ additionalProperties: true,
6411
+ properties: {
6412
+ title: { type: "string" },
6413
+ url: { type: "string" },
6414
+ snippet: { type: "string" },
6415
+ content: { type: "string" },
6416
+ score: { type: "number" }
6417
+ }
6418
+ };
6419
+ var webSearchOutputSchema = {
6420
+ type: "object",
6421
+ additionalProperties: true,
6422
+ properties: {
6423
+ query: { type: "string" },
6424
+ results: { type: "array", items: webSearchResultSchema },
6425
+ count: { type: "integer" }
6426
+ }
6427
+ };
6428
+ var webFetchOutputSchema = {
6429
+ type: "object",
6430
+ additionalProperties: true,
6431
+ properties: {
6432
+ url: { type: "string" },
6433
+ title: { type: "string" },
6434
+ content: { type: "string" },
6435
+ text: { type: "string" },
6436
+ markdown: { type: "string" },
6437
+ status: { type: "integer" }
6438
+ }
6439
+ };
6440
+ var webSearchAndFetchOutputSchema = {
6441
+ type: "object",
6442
+ additionalProperties: true,
6443
+ properties: {
6444
+ query: { type: "string" },
6445
+ results: { type: "array", items: webSearchResultSchema },
6446
+ fetched: { type: "array", items: webFetchOutputSchema },
6447
+ count: { type: "integer" }
6448
+ }
6449
+ };
6450
+ var workspaceMembersOutputSchema = {
6451
+ type: "object",
6452
+ additionalProperties: true,
6453
+ required: ["success", "workspaceId", "members", "count"],
6454
+ properties: {
6455
+ success: { type: "boolean" },
6456
+ workspaceId: { type: "string" },
6457
+ members: {
6458
+ type: "array",
6459
+ items: {
6460
+ type: "object",
6461
+ additionalProperties: true,
6462
+ required: ["userId", "email", "name", "workspaceRole", "joinedAt"],
6463
+ properties: {
6464
+ userId: { type: "string" },
6465
+ email: { type: "string" },
6466
+ name: { type: "string" },
6467
+ workspaceRole: { type: "string" },
6468
+ joinedAt: { type: ["string", "null"] }
6469
+ }
6470
+ }
6471
+ },
6472
+ count: { type: "integer" }
6473
+ }
6474
+ };
6475
+ var listWorkspaceTeamsOutputSchema = {
6476
+ type: "object",
6477
+ additionalProperties: true,
6478
+ properties: {
6479
+ success: { type: "boolean" },
6480
+ teams: { type: "array", items: { type: "object", additionalProperties: true } },
6481
+ count: { type: "integer" },
6482
+ manageableCount: { type: "integer" },
6483
+ workspaceAdminOrOwner: { type: "boolean" },
6484
+ manageableOnly: { type: "boolean" },
6485
+ error: { type: "string" }
6486
+ }
6487
+ };
6488
+ var downloadFileContentOutputSchema = {
6489
+ type: "object",
6490
+ additionalProperties: true,
6491
+ properties: {
6492
+ success: { type: "boolean" },
6493
+ filename: { type: "string" },
6494
+ contentType: { type: "string" },
6495
+ fileSize: { type: "integer" },
6496
+ textExtracted: { type: "boolean" },
6497
+ extractionMethod: { type: "string" },
6498
+ isTruncated: { type: "boolean" },
6499
+ content: { type: ["string", "null"] },
6500
+ contentPreview: { type: "string" },
6501
+ contentSummary: { type: "string" },
6502
+ rawContentSample: { type: ["string", "null"] },
6503
+ message: { type: "string" }
6504
+ }
6505
+ };
6506
+ var downloadFileForUserOutputSchema = {
6507
+ type: "object",
6508
+ additionalProperties: true,
6509
+ properties: {
6510
+ success: { type: "boolean" },
6511
+ filename: { type: "string" },
6512
+ safeFilename: { type: "string" },
6513
+ contentType: { type: "string" },
6514
+ fileSize: { type: "integer" },
6515
+ description: { type: "string" },
6516
+ deliveryMode: { type: "string", enum: ["server", "direct"] },
6517
+ downloadUrl: { type: "string" },
6518
+ expiresAt: { type: "string" },
6519
+ isTextFile: { type: "boolean" },
6520
+ fileContent: { type: ["string", "null"] },
6521
+ encoding: { type: "string", enum: ["utf-8", "base64"] },
6522
+ message: { type: "string" }
6523
+ }
6524
+ };
6525
+ var openObjectSchema = {
6526
+ type: "object",
6527
+ additionalProperties: true
6528
+ };
6529
+ var stringArraySchema = {
6530
+ type: "array",
6531
+ items: { type: "string" }
6532
+ };
6533
+ var gemComponentSummaryProperties = {
6534
+ id: { type: "string" },
6535
+ slug: { type: "string" },
6536
+ displayName: { type: "string" },
6537
+ summary: { type: "string" },
6538
+ category: { type: "string" },
6539
+ tier: { type: "string" },
6540
+ framework: { type: "string" },
6541
+ tags: stringArraySchema,
6542
+ version: { type: "string" },
6543
+ status: { type: "string" },
6544
+ usageSnippet: { type: "string" },
6545
+ supportedVariants: stringArraySchema,
6546
+ themeTokens: stringArraySchema,
6547
+ usesDatasetRuntime: { type: "boolean" },
6548
+ usesPersonaRuntime: { type: "boolean" },
6549
+ usesAiRuntime: { type: "boolean" },
6550
+ previewKey: { type: ["string", "null"] }
6551
+ };
6552
+ var gemComponentSummarySchema = {
6553
+ type: "object",
6554
+ additionalProperties: true,
6555
+ properties: gemComponentSummaryProperties
6556
+ };
6557
+ var gemComponentDetailSchema = {
6558
+ type: "object",
6559
+ additionalProperties: true,
6560
+ properties: {
6561
+ ...gemComponentSummaryProperties,
6562
+ workspaceId: { type: ["string", "null"] },
6563
+ sourceCode: { type: "string" },
6564
+ sourceLanguage: { type: "string" },
6565
+ entryExport: { type: ["string", "null"] },
6566
+ propsSchema: openObjectSchema,
6567
+ bindingSchema: openObjectSchema,
6568
+ styleSchema: openObjectSchema,
6569
+ eventsSchema: openObjectSchema,
6570
+ supportsClassName: { type: "boolean" },
6571
+ supportsInlineStyle: { type: "boolean" },
6572
+ exampleProps: openObjectSchema,
6573
+ exampleNotes: { type: ["string", "null"] },
6574
+ selectionHints: stringArraySchema,
6575
+ createdAt: { type: "string" },
6576
+ updatedAt: { type: "string" }
6577
+ }
6578
+ };
6579
+ var gemComponentsListOutputSchema = {
6580
+ type: "object",
6581
+ additionalProperties: true,
6582
+ properties: {
6583
+ components: { type: "array", items: gemComponentSummarySchema },
6584
+ total: { type: "integer" }
6585
+ }
6586
+ };
6587
+ var gemComponentsGetOutputSchema = {
6588
+ type: "object",
6589
+ additionalProperties: true,
6590
+ properties: {
6591
+ component: gemComponentDetailSchema
6592
+ }
6593
+ };
6594
+ var searchToolsOutputSchema = {
6595
+ type: "object",
6596
+ additionalProperties: true,
6597
+ properties: {
6598
+ query: { type: "string" },
6599
+ count: { type: "integer" },
6600
+ tools: {
6601
+ type: "array",
6602
+ items: {
6603
+ type: "object",
6604
+ additionalProperties: true,
6605
+ properties: {
6606
+ name: { type: "string" },
6607
+ title: { type: "string" },
6608
+ description: { type: "string" },
6609
+ inputSchema: { type: "object" },
6610
+ outputSchema: { type: "object" },
6611
+ annotations: { type: "object" },
6612
+ category: { type: "string" },
6613
+ examples: {
6614
+ type: "array",
6615
+ items: { type: "object", additionalProperties: true }
6616
+ },
6617
+ errorCodes: {
6618
+ type: "array",
6619
+ items: { type: "string" }
6620
+ },
6621
+ score: { type: "number" }
6622
+ },
6623
+ required: ["name", "description", "inputSchema"]
6624
+ }
6625
+ }
6626
+ },
6627
+ required: ["query", "count", "tools"]
6628
+ };
6629
+ var frictionReportOutputSchema = {
6630
+ type: "object",
6631
+ additionalProperties: true,
6632
+ properties: {
6633
+ report: {
6634
+ type: "object",
6635
+ additionalProperties: true,
6636
+ properties: {
6637
+ id: { type: "string" },
6638
+ status: { type: "string" },
6639
+ category: { type: "string" },
6640
+ severity: { type: "string" },
6641
+ occurrenceCount: { type: "integer" },
6642
+ firstReportedAt: { type: "string" },
6643
+ lastReportedAt: { type: "string" }
6644
+ },
6645
+ required: [
6646
+ "id",
6647
+ "status",
6648
+ "category",
6649
+ "severity",
6650
+ "occurrenceCount",
6651
+ "firstReportedAt",
6652
+ "lastReportedAt"
6653
+ ]
6654
+ },
6655
+ deduplicated: { type: "boolean" },
6656
+ redactionsApplied: { type: "integer" },
6657
+ message: { type: "string" }
6658
+ },
6659
+ required: ["report", "deduplicated", "redactionsApplied", "message"]
6660
+ };
6661
+ var notificationChannelSettingSchema = {
6662
+ type: "object",
6663
+ additionalProperties: true,
6664
+ properties: {
6665
+ channel: { type: "string" },
6666
+ enabled: { type: "boolean" },
6667
+ toastEnabled: { type: "boolean" },
6668
+ activityRequired: { type: "boolean" }
6669
+ }
6670
+ };
6671
+ var notificationSettingsOutputSchema = {
6672
+ anyOf: [
6673
+ {
6674
+ type: "object",
6675
+ additionalProperties: true,
6676
+ properties: {
6677
+ inApp: { type: "array", items: notificationChannelSettingSchema },
6678
+ email: openObjectSchema,
6679
+ slack: openObjectSchema
6680
+ }
6681
+ },
6682
+ { type: "array", items: notificationChannelSettingSchema }
6683
+ ]
6684
+ };
6685
+ var platformSupportReadOutputSchema = {
6686
+ type: "object",
6687
+ additionalProperties: true,
6688
+ properties: {
6689
+ operation: { type: "string" },
6690
+ rows: { type: "array", items: openObjectSchema },
6691
+ references: { type: "array", items: openObjectSchema },
6692
+ coverage: {
6693
+ type: "object",
6694
+ additionalProperties: true,
6695
+ properties: {
6696
+ state: { type: "string", enum: ["available", "partial", "unavailable", "not_configured", "expired", "gap"] },
6697
+ since: { type: "string" },
6698
+ until: { type: "string" },
6699
+ lastSuccessAt: { type: ["string", "null"] },
6700
+ pendingCount: { type: ["number", "null"] },
6701
+ truncated: { type: "boolean" },
6702
+ note: { type: ["string", "null"] }
6703
+ }
6704
+ }
6705
+ }
6706
+ };
6707
+ var platformToolSchema = {
6708
+ type: "object",
6709
+ additionalProperties: true,
6710
+ properties: {
6711
+ name: { type: "string" },
6712
+ title: { type: "string" },
6713
+ description: { type: "string" },
6714
+ inputSchema: openObjectSchema,
6715
+ outputSchema: openObjectSchema,
6716
+ annotations: openObjectSchema,
6717
+ category: { type: "string" },
6718
+ examples: { type: "array", items: openObjectSchema },
6719
+ errorCodes: { type: "array", items: { type: "string" } }
6720
+ },
6721
+ required: ["name", "description"]
6722
+ };
6723
+ var platformToolListOutputSchema = {
6724
+ type: "array",
6725
+ items: platformToolSchema
6726
+ };
6727
+ var platformToolSchemaOutputSchema = platformToolSchema;
6728
+ var platformToolRunOutputSchema = {
6729
+ type: "object",
6730
+ additionalProperties: true,
6731
+ properties: {
6732
+ success: { type: "boolean" },
6733
+ result: {},
6734
+ toolId: { type: "string" },
6735
+ executionTimeMs: { type: ["number", "null"] },
6736
+ executorKind: { type: "string" },
6737
+ error: { type: ["string", "null"] },
6738
+ errorCode: { type: ["string", "null"] },
6739
+ code: { type: ["string", "null"] },
6740
+ retryable: { type: ["boolean", "null"] }
6741
+ },
6742
+ required: ["success", "toolId"]
6743
+ };
6744
+ var webAccessRowSchema = {
6745
+ type: "object",
6746
+ additionalProperties: true,
6747
+ properties: {
6748
+ host: { type: "string" },
6749
+ approved_by_user_id: { type: "string" },
6750
+ approved_by_name: { type: ["string", "null"] },
6751
+ approved_by_you: { type: "boolean" },
6752
+ approved_at: { type: "string" },
6753
+ ends_at: { type: "string" },
6754
+ days_left: { type: "integer", minimum: 0 }
6755
+ },
6756
+ required: ["host", "approved_by_user_id", "approved_by_name", "approved_by_you", "approved_at", "ends_at", "days_left"]
6757
+ };
6758
+ var webAccessListOutputSchema = {
6759
+ type: "object",
6760
+ additionalProperties: true,
6761
+ properties: {
6762
+ thread_id: { type: "string" },
6763
+ websites: { type: "array", items: webAccessRowSchema }
6764
+ },
6765
+ required: ["thread_id", "websites"]
6766
+ };
6767
+ var webAccessTakeBackOutputSchema = {
6768
+ type: "object",
6769
+ additionalProperties: true,
6770
+ properties: {
6771
+ thread_id: { type: "string" },
6772
+ host: { type: "string" },
6773
+ taken_back: { type: "boolean" },
6774
+ message: { type: "string" }
6775
+ },
6776
+ required: ["thread_id", "host", "taken_back", "message"]
6777
+ };
6778
+
6779
+ // ../../packages/platform-operations/src/operation_groups_notifications.ts
6780
+ function buildNotificationOperations(op) {
6781
+ return [
6782
+ withOutputSchema(op("notifications.get", "notifications", "Read your in-app, email, and Slack notification settings.", "notification_settings", "get", "read"), notificationSettingsOutputSchema),
6783
+ withOutputSchema(op("notifications.set_in_app", "notifications", "Change what shows in Activity and pop-ups in this workspace. Required Activity records stay visible.", "notification_settings", "set_in_app", "write"), notificationSettingsOutputSchema),
6784
+ withOutputSchema(op("notifications.set_email", "notifications", "Change one optional email kind for your account in every workspace.", "notification_settings", "set_email", "write"), notificationSettingsOutputSchema),
6785
+ withOutputSchema(op("notifications.set_slack", "notifications", "Set optional integration alerts to your Slack account and channel.", "notification_settings", "set_slack", "write"), notificationSettingsOutputSchema)
6786
+ ];
6787
+ }
6788
+
6789
+ // ../../packages/platform-operations/src/operation_groups_skills.ts
6790
+ var text5 = { type: "string" };
6791
+ var nullableText5 = { type: ["string", "null"] };
6792
+ var count = { type: "integer", minimum: 0 };
6793
+ function object6(properties, required = []) {
6794
+ const returned = required.length === 0 ? { type: "object", additionalProperties: true, properties } : { type: "object", additionalProperties: true, properties, required: [...required] };
6795
+ return returned;
6796
+ }
6797
+ var fromFileOutputSchema = object6({ item_id: text5, name: text5, version_id: text5, version_number: { type: "integer", minimum: 1 }, digest: text5, message: text5 });
6798
+ var onOff = { type: "boolean" };
6799
+ var nullableCount = { type: ["integer", "null"], minimum: 0 };
6800
+ var inventoryOutputSchema = object6({
6801
+ skills: {
6802
+ type: "array",
6803
+ items: object6({
6804
+ item_id: text5,
6805
+ title: text5,
6806
+ name: text5,
6807
+ description: nullableText5,
6808
+ owner_name: nullableText5,
6809
+ owner_left: onOff,
6810
+ can_open: onOff,
6811
+ people_who_can_open: onOff,
6812
+ linked_agents: onOff,
6813
+ teams: { type: "array", items: text5 },
6814
+ whole_workspace: onOff,
6815
+ blocked: onOff,
6816
+ updated_at: nullableText5,
6817
+ runs_30_days: nullableCount
6818
+ }, ["item_id", "title", "name", "can_open", "blocked"])
6819
+ },
6820
+ others: { type: "array", items: object6({ owner_name: nullableText5, owner_left: onOff, count }, ["count"]) },
6821
+ built_ins: {
6822
+ type: "array",
6823
+ items: object6({ name: text5, description: text5, runs_30_days: count, blocked: onOff, always_on: onOff }, ["name", "blocked", "always_on"])
6824
+ }
6825
+ });
6826
+ function buildSkillOperations(op) {
6827
+ return [
6828
+ withOutputSchema(op("skills.settings", "library", "Change where a skill loads: people who can open it, linked Agents, teams, the whole workspace, Block, and your own In my chats switch.", "skill_settings", "update", "write", ["cli", "mcp"]), skillSettingsOutputSchema),
6829
+ withOutputSchema(op("skills.from_file", "library", "Turn a Markdown or plain text file into a skill. The file keeps its id, shares and links; each older text becomes a skill version.", "library_fs", "turn_into_skill", "write", ["cli", "mcp"]), fromFileOutputSchema),
6830
+ withOutputSchema(op("skills.inventory", "library", "For a workspace owner or admin: every skill of the workspace, with its owner, where it loads, Block and its runs in the last 30 days.", "library_query", "skill_inventory", "read", ["cli", "mcp"]), inventoryOutputSchema),
6831
+ withOutputSchema(op("skills.history", "library", "A skill's History, newest first: each saved version and each settings change, one page at a time.", "library_query", "skill_history", "read", ["cli", "mcp"]), libraryFilesystemOutputSchema),
6832
+ withOutputSchema(op("skills.version_get", "library", "Read one version of a skill (the current one when no version is named): its digest, its file list and one file.", "library_query", "skill_version", "read", ["cli", "mcp"]), libraryFilesystemOutputSchema),
6833
+ withOutputSchema(op("skills.version_restore", "library", "Restore an older version of a skill as a new version, from the digest you read; refused when someone saved after your read.", "library_fs", "restore_skill_version", "write", ["cli", "mcp"]), libraryFilesystemOutputSchema)
6834
+ ];
6835
+ }
6836
+
6837
+ // ../../packages/platform-operations/src/output_schemas_reach.ts
6838
+ var openObject2 = { type: "object", additionalProperties: true };
6839
+ var openObjectList2 = { type: "array", items: openObject2 };
6840
+ var contactsOutputSchema = {
6841
+ type: "object",
6842
+ additionalProperties: true,
6843
+ description: "Op-dependent result: a contact (ContactDetail), a contact's summary, an import's counts, a split's two contacts, an export's Dataset, a company with joined, your addresses (loginEmail and addresses), a sent address code (codeId, email, expiresAt), or { deleted: true } / { dismissed: true }.",
6844
+ properties: {
6845
+ contactId: { type: "string" },
6846
+ primaryEmail: { type: "string" },
6847
+ jobTitle: { type: ["string", "null"] },
6848
+ privateNote: { type: ["string", "null"] },
6849
+ emails: openObjectList2,
6850
+ created: { type: "integer" },
6851
+ existing: { type: "integer" },
6852
+ refused: openObjectList2,
6853
+ contact: openObject2,
6854
+ from: openObject2,
6855
+ datasetId: { type: "string" },
6856
+ datasetPath: { type: "string" },
6857
+ company: { anyOf: [openObject2, { type: "null" }] },
6858
+ joined: { type: "integer" },
6859
+ deleted: { type: "boolean" },
6860
+ dismissed: { type: "boolean" },
6861
+ loginEmail: { type: ["string", "null"] },
6862
+ addresses: openObjectList2,
6863
+ codeId: { type: "string" },
6864
+ expiresAt: { type: "string" }
6865
+ }
6866
+ };
6867
+ var contactsQueryOutputSchema = {
6868
+ type: "object",
6869
+ additionalProperties: true,
6870
+ description: "Op-dependent result: a page of contacts, one contact, search rows, activity lines, shares, duplicate pairs, companies, one company, its people, its matrix, company suggestions, or your addresses (loginEmail and addresses)."
6871
+ };
6872
+ var distributionOutputSchema = {
6873
+ type: "object",
6874
+ additionalProperties: true,
6875
+ description: "The follow-up with its new state.",
6876
+ properties: {
6877
+ followUpId: { type: "string" },
6878
+ kind: { type: "string" },
6879
+ state: { type: "string" },
6880
+ item: openObject2
6881
+ }
6882
+ };
6883
+ var distributionQueryOutputSchema = {
6884
+ type: "object",
6885
+ additionalProperties: true,
6886
+ description: "Op-dependent result: the overview, a page of items, one item's results, one person's opens, or the follow-ups with their counts."
6887
+ };
6888
+ var uuid3 = { type: "string", format: "uuid" };
6889
+ var string3 = { type: "string" };
6890
+ var nullableString2 = { type: ["string", "null"] };
6891
+ function closedRecord(properties) {
6892
+ const returned = { type: "object", additionalProperties: false, properties, required: Object.keys(properties) };
6893
+ return returned;
6894
+ }
6895
+ var noteItem = closedRecord({ itemId: uuid3, name: string3 });
6896
+ var draftProperties = {
6897
+ id: uuid3,
6898
+ followUpId: nullableString2,
6899
+ sourceWorkspaceId: uuid3,
6900
+ shareId: uuid3,
6901
+ recipientEmail: { type: "string", format: "email" },
6902
+ recipientName: nullableString2,
6903
+ item: noteItem,
6904
+ shareUrl: { type: "string", format: "uri" },
6905
+ subject: string3,
6906
+ body: string3,
6907
+ version: { type: "integer", minimum: 1 },
6908
+ connectionId: nullableString2,
6909
+ gmailDraftId: nullableString2,
6910
+ gmailDraftUrl: { type: ["string", "null"], format: "uri" },
6911
+ gmailSyncedVersion: { type: ["integer", "null"], minimum: 1 },
6912
+ gmailAvailable: { type: "boolean" },
6913
+ createdAt: string3,
6914
+ updatedAt: string3
6915
+ };
6916
+ var draftOutput = closedRecord(draftProperties);
6917
+ var draftListEntryOutput = closedRecord({ ...draftProperties, openedAfterDraftAt: nullableString2 });
6918
+ var noteOutput = closedRecord({
6919
+ followUpId: string3,
6920
+ shareId: uuid3,
6921
+ recipient: closedRecord({ email: { type: "string", format: "email" }, name: nullableString2 }),
6922
+ item: noteItem,
6923
+ shareUrl: { type: "string", format: "uri" },
6924
+ subject: string3,
6925
+ body: string3,
6926
+ gmailConnections: { type: "array", items: closedRecord({
6927
+ connectionId: string3,
6928
+ label: string3,
6929
+ draftAction: closedRecord({
6930
+ ref: closedRecord({ kind: { const: "connector" }, connectionId: string3, capabilityId: string3 }),
6931
+ callName: string3,
6932
+ arguments: closedRecord({
6933
+ recipient_email: { type: "string", format: "email" },
6934
+ subject: string3,
6935
+ body: string3,
6936
+ is_html: { const: false },
6937
+ user_id: { const: "me" }
6938
+ })
6939
+ })
6940
+ }) }
6941
+ });
6942
+ var pageOutput = closedRecord({ drafts: { type: "array", items: draftListEntryOutput } });
6943
+ var deleteOutput = closedRecord({ deleted: { const: true } });
6944
+ var distributionNoteOutputSchema = { anyOf: [noteOutput, draftOutput, pageOutput, deleteOutput] };
6945
+ var collectionsOutputSchema = {
6946
+ type: "object",
6947
+ additionalProperties: true,
6948
+ description: "Op-dependent result: a create's Bundle and its items' outcome, a Bundle with its items, an add's added, already, refused and reached_people, a remove's removed and not_members, a reorder's item_ids, or { trashed: true }.",
6949
+ properties: {
6950
+ collection: openObject2,
6951
+ members: { anyOf: [openObject2, openObjectList2] },
6952
+ collectionId: { type: "string" },
6953
+ added: { type: "array", items: { type: "string" } },
6954
+ already: { type: "array", items: { type: "string" } },
6955
+ refused: openObjectList2,
6956
+ reachedPeople: { type: "integer" },
6957
+ removed: { type: "array", items: { type: "string" } },
6958
+ notMembers: { type: "array", items: { type: "string" } },
6959
+ itemIds: { type: "array", items: { type: "string" } },
6960
+ trashed: { type: "boolean" }
6961
+ }
6962
+ };
6963
+ var collectionsListOutputSchema = {
6964
+ type: "object",
6965
+ additionalProperties: true,
6966
+ description: "Op-dependent result: a page of Bundles, or one Bundle with its items in order.",
6967
+ properties: {
6968
+ collections: openObjectList2,
6969
+ nextCursor: { anyOf: [{ type: "string" }, { type: "null" }] },
6970
+ itemShareable: { type: "boolean" }
6971
+ }
6972
+ };
6973
+
6974
+ // ../../packages/platform-operations/src/operation_groups_collections.ts
6975
+ var BUNDLE_REF = ["bundle"];
6976
+ var COLLECTIONS_OPERATION_INPUT_FIELDS = {
6977
+ bundles_query: {
6978
+ list: ["q", "contains_item_id", "folder_path", "cursor", "limit"],
6979
+ get: [...BUNDLE_REF]
6980
+ },
6981
+ bundles: {
6982
+ create: ["name", "description", "folder_path", "items", "idempotency_key"],
6983
+ update: [...BUNDLE_REF, "name", "description"],
6984
+ delete: [...BUNDLE_REF],
6985
+ items_add: [...BUNDLE_REF, "items"],
6986
+ items_remove: [...BUNDLE_REF, "items"],
6987
+ items_reorder: [...BUNDLE_REF, "order"]
6988
+ }
6989
+ };
6990
+ var openObject3 = { type: "object", additionalProperties: true };
6991
+ var collectionDetailOutputSchema = {
6992
+ type: "object",
6993
+ additionalProperties: true,
6994
+ properties: {
6995
+ collectionId: { type: "string" },
6996
+ name: { type: "string" },
6997
+ description: { anyOf: [{ type: "string" }, { type: "null" }] },
6998
+ workspaceId: { type: "string" },
6999
+ role: { type: "string" },
7000
+ canEdit: { type: "boolean" },
7001
+ canShare: { type: "boolean" },
7002
+ members: { type: "array", items: openObject3 },
7003
+ sharedWithCount: { anyOf: [{ type: "integer" }, { type: "null" }] },
7004
+ topFolders: { type: "array", items: openObject3 },
7005
+ modifiedAt: { type: "string" }
7006
+ }
7007
+ };
7008
+ function buildCollectionsOperations(op) {
7009
+ return [
7010
+ withOutputSchema(op("bundles.list", "bundles", "List the Bundles in this workspace that you can change.", "bundles_query", "list", "read"), collectionsListOutputSchema),
7011
+ withOutputSchema(op("bundles.get", "bundles", "Read one Bundle and the items in it that you can open, in order.", "bundles_query", "get", "read"), collectionDetailOutputSchema),
7012
+ withOutputSchema(op("bundles.create", "bundles", "Create a Bundle: a pack of files and other Library items from different folders, to share as one.", "bundles", "create", "write"), collectionsOutputSchema),
7013
+ withOutputSchema(op("bundles.update", "bundles", "Rename a Bundle or change its description.", "bundles", "update", "write"), collectionsOutputSchema),
7014
+ withOutputSchema(op("bundles.delete", "bundles", "Delete a Bundle. The items stay in their folders.", "bundles", "delete", "destructive"), collectionsOutputSchema),
7015
+ withOutputSchema(op("bundles.items_add", "bundles", "Add items you can share to a Bundle. Everyone with access to the Bundle can open them at once.", "bundles", "items_add", "write"), collectionsOutputSchema),
7016
+ withOutputSchema(op("bundles.items_remove", "bundles", "Remove items from a Bundle. The items stay in their folders.", "bundles", "items_remove", "destructive"), collectionsOutputSchema),
7017
+ withOutputSchema(op("bundles.items_reorder", "bundles", "Put the items of a Bundle in a new order.", "bundles", "items_reorder", "write"), collectionsOutputSchema)
7018
+ ];
7019
+ }
7020
+
7021
+ // ../../packages/platform-operations/src/operation_groups_contacts.ts
7022
+ var CONTACTS_OPERATION_INPUT_FIELDS = {
7023
+ contacts: {
7024
+ create: ["email", "name", "company_id", "from_share"],
7025
+ import: ["contacts"],
7026
+ update: ["contact_id", "job_title", "private_note", "name", "company_id"],
7027
+ archive: ["contact_id"],
7028
+ restore: ["contact_id"],
7029
+ delete: ["contact_id"],
7030
+ email_add: ["contact_id", "email"],
7031
+ email_remove: ["contact_id", "email"],
7032
+ email_make_primary: ["contact_id", "email"],
7033
+ split: ["contact_id", "email", "idempotency_key"],
7034
+ merge: ["keep_contact_id", "merge_contact_id", "name_from", "primary_email", "idempotency_key"],
7035
+ duplicate_dismiss: ["contact_a_id", "contact_b_id"],
7036
+ export_dataset: ["name", "filters", "contact_ids", "idempotency_key"],
7037
+ company_create: ["name", "domains", "contact_ids", "idempotency_key"],
7038
+ company_update: ["company_id", "name"],
7039
+ company_delete: ["company_id"],
7040
+ company_domain_add: ["company_id", "domain"],
7041
+ company_domain_remove: ["company_id", "domain"],
7042
+ company_suggestion_confirm: ["domain", "name"],
7043
+ company_suggestion_dismiss: ["domain"],
7044
+ other_address_send_code: ["email"],
7045
+ other_address_prove: ["code_id", "code"],
7046
+ other_address_remove: ["address_id"]
7047
+ }
7048
+ };
7049
+ var openObject4 = { type: "object", additionalProperties: true };
7050
+ var openObjectList3 = { type: "array", items: openObject4 };
7051
+ var contactListOutputSchema = {
7052
+ type: "object",
7053
+ additionalProperties: true,
7054
+ properties: {
7055
+ contacts: openObjectList3,
7056
+ total: { type: "integer" },
7057
+ counts: openObject4,
7058
+ facets: openObject4,
7059
+ nextCursor: {
7060
+ type: ["string", "null"],
7061
+ description: "Pass it as cursor to read the next page. Null or absent on the last page."
7062
+ }
7063
+ }
7064
+ };
7065
+ var contactGetOutputSchema = {
7066
+ type: "object",
7067
+ additionalProperties: true,
7068
+ properties: {
7069
+ contactId: { type: "string" },
7070
+ primaryEmail: { type: "string" },
7071
+ jobTitle: { type: ["string", "null"] },
7072
+ privateNote: { type: ["string", "null"] },
7073
+ emails: openObjectList3,
7074
+ facts: openObject4,
7075
+ mergedInto: openObject4,
7076
+ mergedAt: { type: "string" }
7077
+ }
7078
+ };
7079
+ function buildContactsOperations(op) {
7080
+ return [
7081
+ withOutputSchema(op("contacts.list", "contacts", "List your private contacts, the same list in every workspace, with filters and counts.", "contacts_query", "list", "read"), contactListOutputSchema),
7082
+ withOutputSchema(op("contacts.get", "contacts", "Read one of your contacts: their addresses, company, the shares you sent them and their opens.", "contacts_query", "get", "read"), contactGetOutputSchema),
7083
+ withOutputSchema(op("contacts.search", "contacts", "Find a contact's email address by their name, address or company.", "contacts_query", "search", "read"), contactsQueryOutputSchema),
7084
+ withOutputSchema(op("contacts.activity", "contacts", "List the shares you sent one contact and when they opened them.", "contacts_query", "activity", "read"), contactsQueryOutputSchema),
7085
+ withOutputSchema(op("contacts.shares", "contacts", "List the shares one contact holds from you, with their opens.", "contacts_query", "shares", "read"), contactsQueryOutputSchema),
7086
+ withOutputSchema(op("contacts.duplicates", "contacts", "List pairs of your contacts that look like one person.", "contacts_query", "duplicates", "read"), contactsQueryOutputSchema),
7087
+ withOutputSchema(op("contacts.companies_list", "contacts", "List your companies by name, last activity, or people count.", "contacts_query", "companies_list", "read"), contactsQueryOutputSchema),
7088
+ withOutputSchema(op("contacts.company_get", "contacts", "Read one of your companies: its domains, people and opens.", "contacts_query", "company_get", "read"), contactsQueryOutputSchema),
7089
+ withOutputSchema(op("contacts.company_people", "contacts", "List the contacts of one company.", "contacts_query", "company_people", "read"), contactsQueryOutputSchema),
7090
+ withOutputSchema(op("contacts.company_matrix", "contacts", "Show which people of one company opened which items you sent them.", "contacts_query", "company_matrix", "read"), contactsQueryOutputSchema),
7091
+ withOutputSchema(op("contacts.company_activity", "contacts", "List the shares you sent the people of one company and when they opened them.", "contacts_query", "company_activity", "read"), contactsQueryOutputSchema),
7092
+ withOutputSchema(op("contacts.company_suggestions", "contacts", "List companies suggested from the work domains of your contacts.", "contacts_query", "company_suggestions", "read"), contactsQueryOutputSchema),
7093
+ withOutputSchema(op("contacts.create", "contacts", "Add a contact by email address.", "contacts", "create", "write"), contactsOutputSchema),
7094
+ withOutputSchema(op("contacts.import", "contacts", "Add up to 200 contacts in one call.", "contacts", "import", "write"), contactsOutputSchema),
7095
+ withOutputSchema(op("contacts.update", "contacts", "Change a contact's name, company, job title, or private note.", "contacts", "update", "write"), contactsOutputSchema),
7096
+ withOutputSchema(op("contacts.archive", "contacts", "Archive a contact.", "contacts", "archive", "write"), contactsOutputSchema),
7097
+ withOutputSchema(op("contacts.restore", "contacts", "Restore an archived contact.", "contacts", "restore", "write"), contactsOutputSchema),
7098
+ withOutputSchema(op("contacts.delete", "contacts", "Delete a contact. Uru will not add that address again unless you add it yourself.", "contacts", "delete", "destructive"), contactsOutputSchema),
7099
+ withOutputSchema(op("contacts.email_add", "contacts", "Add one more email address to a contact.", "contacts", "email_add", "write"), contactsOutputSchema),
7100
+ withOutputSchema(op("contacts.email_remove", "contacts", "Remove an email address from a contact and stop Uru adding it again.", "contacts", "email_remove", "destructive"), contactsOutputSchema),
7101
+ withOutputSchema(op("contacts.email_make_primary", "contacts", "Make one of a contact's addresses the primary one.", "contacts", "email_make_primary", "write"), contactsOutputSchema),
7102
+ withOutputSchema(op("contacts.split", "contacts", "Move one address of a contact into a new contact of its own.", "contacts", "split", "write"), contactsOutputSchema),
7103
+ withOutputSchema(op("contacts.merge", "contacts", "Merge two contacts into one.", "contacts", "merge", "destructive"), contactsOutputSchema),
7104
+ withOutputSchema(op("contacts.duplicate_dismiss", "contacts", "Mark two contacts as different people.", "contacts", "duplicate_dismiss", "write"), contactsOutputSchema),
7105
+ withOutputSchema(op("contacts.export_dataset", "contacts", "Copy your contacts into a Dataset in this workspace, where everyone who can open the Dataset sees them.", "contacts", "export_dataset", "write"), contactsOutputSchema),
7106
+ withOutputSchema(op("contacts.company_create", "contacts", "Create a company with its domains and contacts.", "contacts", "company_create", "write"), contactsOutputSchema),
7107
+ withOutputSchema(op("contacts.company_update", "contacts", "Rename a company.", "contacts", "company_update", "write"), contactsOutputSchema),
7108
+ withOutputSchema(op("contacts.company_delete", "contacts", "Delete a company. Its contacts stay; their company is cleared.", "contacts", "company_delete", "destructive"), contactsOutputSchema),
7109
+ withOutputSchema(op("contacts.company_domain_add", "contacts", "Add a web domain to a company; your contacts on that domain join it.", "contacts", "company_domain_add", "write"), contactsOutputSchema),
7110
+ withOutputSchema(op("contacts.company_domain_remove", "contacts", "Remove a web domain from a company.", "contacts", "company_domain_remove", "write"), contactsOutputSchema),
7111
+ withOutputSchema(op("contacts.company_suggestion_confirm", "contacts", "Confirm a suggested company; your contacts on its domain join it.", "contacts", "company_suggestion_confirm", "write"), contactsOutputSchema),
7112
+ withOutputSchema(op("contacts.company_suggestion_dismiss", "contacts", "Dismiss a suggested company.", "contacts", "company_suggestion_dismiss", "write"), contactsOutputSchema),
7113
+ withOutputSchema(op("contacts.other_addresses", "contacts", "List your login address and the other email addresses you proved are yours. A share to one of them counts as your own.", "contacts_query", "other_addresses", "read"), contactsQueryOutputSchema),
7114
+ withOutputSchema(op("contacts.other_address_send_code", "contacts", "Send a code to another email address of yours, to prove it is yours. The person reads the code in that inbox.", "contacts", "other_address_send_code", "write"), contactsOutputSchema),
7115
+ withOutputSchema(op("contacts.other_address_prove", "contacts", "Answer the code sent to an address. A right code adds the address to your other addresses.", "contacts", "other_address_prove", "write"), contactsOutputSchema),
7116
+ withOutputSchema(op("contacts.other_address_remove", "contacts", "Remove one of your other addresses. Shares to it count as shares to another person again. Prove it again with a new code to add it back.", "contacts", "other_address_remove", "write"), contactsOutputSchema)
7117
+ ];
7118
+ }
7119
+
7120
+ // ../../packages/platform-operations/src/operation_groups_distribution.ts
7121
+ var DISTRIBUTION_OPERATION_INPUT_FIELDS = {
7122
+ distribution_query: {
7123
+ overview: ["period", "kind", "in_workspace_id", "tz"],
7124
+ items: [
7125
+ "company_id",
7126
+ "sharing_state",
7127
+ "pins",
7128
+ "label_id",
7129
+ "q",
7130
+ "kind",
7131
+ "in_workspace_id",
7132
+ "not_opened",
7133
+ "expiring_soon",
7134
+ "sort",
7135
+ "period",
7136
+ "tz",
7137
+ "limit",
7138
+ "offset"
7139
+ ],
7140
+ item_results: ["item_id", "q", "state", "sort", "limit", "offset", "team", "tz"],
7141
+ item_people_export: ["item_id", "q", "state", "sort", "team", "tz"],
7142
+ person_opens: ["share_id", "recipient_id", "cursor", "limit"],
7143
+ follow_ups: ["state", "kind", "in_workspace_id", "offset", "tz"]
7144
+ },
7145
+ distribution: {
7146
+ snooze: ["follow_up_id", "for", "tz"],
7147
+ done: ["follow_up_id", "tz"],
7148
+ restore: ["follow_up_id", "tz"]
7149
+ }
7150
+ };
7151
+ var openObject5 = { type: "object", additionalProperties: true };
7152
+ var openObjectList4 = { type: "array", items: openObject5 };
7153
+ var overviewOutputSchema = {
7154
+ type: "object",
7155
+ additionalProperties: true,
7156
+ properties: {
7157
+ period: { type: "string" },
7158
+ tz: { type: "string" },
7159
+ tiles: openObject5,
7160
+ previous: { anyOf: [openObject5, { type: "null" }] },
7161
+ series: openObjectList4,
7162
+ marks: openObjectList4,
7163
+ topItems: openObjectList4,
7164
+ topPeople: openObjectList4,
7165
+ topCompanies: openObjectList4,
7166
+ empty: { type: "boolean" }
7167
+ }
7168
+ };
7169
+ var itemResultsOutputSchema = {
7170
+ type: "object",
7171
+ additionalProperties: true,
7172
+ properties: {
7173
+ access: { type: "string" },
7174
+ itemId: { type: "string" },
7175
+ item: openObject5,
7176
+ stats: openObject5,
7177
+ people: openObjectList4,
7178
+ byCompany: openObjectList4,
7179
+ byVersion: openObjectList4,
7180
+ byMember: openObjectList4,
7181
+ byChild: openObjectList4,
7182
+ throughPacks: openObjectList4
7183
+ }
7184
+ };
7185
+ function buildDistributionOperations(op) {
7186
+ return [
7187
+ withOutputSchema(op("distribution.note_prepare", "distribution", "Prepare an editable follow-up note using the recipient’s current share link.", "distribution_note", "prepare", "read"), distributionNoteOutputSchema),
7188
+ withOutputSchema(op("distribution.note_start", "distribution", "Start or restore your private saved follow-up note.", "distribution_note", "start", "write"), distributionNoteOutputSchema),
7189
+ withOutputSchema(op("distribution.note_start_item", "distribution", "Start or restore your private note to an authorized item recipient.", "distribution_note", "start_item", "write"), distributionNoteOutputSchema),
7190
+ withOutputSchema(op("distribution.note_drafts_list", "distribution", "List your private saved notes, optionally for one owned contact.", "distribution_note", "list", "read"), distributionNoteOutputSchema),
7191
+ withOutputSchema(op("distribution.note_draft_get", "distribution", "Restore your private saved note.", "distribution_note", "get", "read"), distributionNoteOutputSchema),
7192
+ withOutputSchema(op("distribution.note_draft_update", "distribution", "Save changes to your private note at its current version.", "distribution_note", "update", "write"), distributionNoteOutputSchema),
7193
+ withOutputSchema(op("distribution.note_draft_delete", "distribution", "Discard your private Uru note without deleting a Gmail draft.", "distribution_note", "delete", "destructive"), distributionNoteOutputSchema),
7194
+ withOutputSchema(op("distribution.overview", "distribution", "Read the results of the shares you sent by name over a period: people reached and opened, time spent, which companies opened your files, top items and follow-ups.", "distribution_query", "overview", "read"), overviewOutputSchema),
7195
+ withOutputSchema(op("distribution.items_list", "distribution", "List the items you sent by name and the people you sent them to: who opened each, who has not opened it yet, and for how long.", "distribution_query", "items", "read"), distributionQueryOutputSchema),
7196
+ withOutputSchema(op("distribution.item_results", "distribution", "Read who opened one item you sent, such as a board pack, when and for how long, by person, company and Version.", "distribution_query", "item_results", "read"), itemResultsOutputSchema),
7197
+ withOutputSchema(op("distribution.item_people_export", "distribution", "Export every matching person and result for one item as CSV, with the same People filters and no page limit.", "distribution_query", "item_people_export", "read"), distributionQueryOutputSchema),
7198
+ withOutputSchema(op("distribution.person_opens", "distribution", "Read when one person opened a share you sent them, and for how long.", "distribution_query", "person_opens", "read"), distributionQueryOutputSchema),
7199
+ withOutputSchema(op("distribution.follow_ups_list", "distribution", "List your follow-ups: people who came back, have not opened, or are about to lose access.", "distribution_query", "follow_ups", "read"), distributionQueryOutputSchema),
7200
+ withOutputSchema(op("distribution.follow_up_snooze", "distribution", "Snooze a follow-up for a day, three days or a week.", "distribution", "snooze", "write"), distributionOutputSchema),
7201
+ withOutputSchema(op("distribution.follow_up_done", "distribution", "Mark a follow-up done.", "distribution", "done", "write"), distributionOutputSchema),
7202
+ withOutputSchema(op("distribution.follow_up_restore", "distribution", "Show a snoozed or done follow-up again.", "distribution", "restore", "write"), distributionOutputSchema)
7203
+ ];
7204
+ }
7205
+
7206
+ // ../../packages/platform-operations/src/operation_groups_gems.ts
7207
+ var GEM_MUTATION_IDEMPOTENCY_FIELDS = {
7208
+ release_retry: ["release_id", "idempotency_key"],
7209
+ release_change_apply: ["release_id", "idempotency_key", "targets"],
7210
+ public_tool_delegation_enable: [
7211
+ "share_id",
7212
+ "tool_role",
7213
+ "tool_operation",
7214
+ "viewer_request_limit",
7215
+ "deployment_request_limit",
7216
+ "binder_cost_limit",
7217
+ "connection_request_limit",
7218
+ "idempotency_key"
7219
+ ],
7220
+ public_tool_delegation_revoke: [
7221
+ "share_id",
7222
+ "tool_role",
7223
+ "tool_operation",
7224
+ "idempotency_key"
7225
+ ],
7226
+ schedule_run_now: ["capability_name", "idempotency_key"],
7227
+ event_target_run_now: ["target_id", "idempotency_key"],
7228
+ call_action: ["capability_name", "idempotency_key"],
7229
+ job_start: ["capability_name", "idempotency_key"]
7230
+ };
7231
+ var GEM_TARGET = ["gem_id", "path"];
7232
+ var GEM_SOURCE_WITNESS = ["base_source_revision_id", "base_source_hash"];
7233
+ var GEM_QUERY_TARGET = ["gem_id", "path", "detail"];
7234
+ var GEM_OPERATION_INPUT_FIELDS = {
7235
+ gem_control_plane: {
7236
+ init: ["path", "files", "entrypoint", "content", "content_base64", "name", "metadata"],
7237
+ git_source_setup: [],
7238
+ git_source_connection_callback: ["state", "setup_action", "installation_id", "code"],
7239
+ git_source_import: [
7240
+ "connection_id",
7241
+ "repository_id",
7242
+ "ref",
7243
+ "app_directory",
7244
+ "commit_sha",
7245
+ "title",
7246
+ "folder_id",
7247
+ "automatic_publishing",
7248
+ "previews_enabled",
7249
+ "idempotency_key"
7250
+ ],
7251
+ git_source_command: [
7252
+ ...GEM_TARGET,
7253
+ "action",
7254
+ "import_id",
7255
+ "idempotency_key",
7256
+ "expected_revision",
7257
+ "automatic_publishing",
7258
+ "previews_enabled",
7259
+ "preview_id",
7260
+ "head_sha",
7261
+ "resource_policy_hash",
7262
+ "ref",
7263
+ "commit_sha",
7264
+ "app_directory"
7265
+ ],
7266
+ git_source_copy: [...GEM_TARGET],
7267
+ fs_write: [...GEM_TARGET, "content", "content_base64", "create", "entrypoint", ...GEM_SOURCE_WITNESS],
7268
+ fs_batch_write: [...GEM_TARGET, "files", ...GEM_SOURCE_WITNESS],
7269
+ fs_sync: [...GEM_TARGET, "files", "delete_paths", "upload_id", ...GEM_SOURCE_WITNESS],
7270
+ fs_upload: [
7271
+ ...GEM_TARGET,
7272
+ "upload_id",
7273
+ "upload_phase",
7274
+ "files",
7275
+ "base_source_revision_id",
7276
+ "sha256",
7277
+ "offset",
7278
+ "content_base64"
7279
+ ],
7280
+ fs_import: [
7281
+ ...GEM_TARGET,
7282
+ "library_paths",
7283
+ "thread_file_ids",
7284
+ "target_dir",
7285
+ "replace",
7286
+ ...GEM_SOURCE_WITNESS
7287
+ ],
7288
+ fs_patch: [...GEM_TARGET, "file_path", "patch", ...GEM_SOURCE_WITNESS],
7289
+ fs_mkdir: [...GEM_TARGET, "recursive", ...GEM_SOURCE_WITNESS],
7290
+ fs_rm: [...GEM_TARGET, "delete_paths", ...GEM_SOURCE_WITNESS],
7291
+ fs_mv: [...GEM_TARGET, "target_path", "recursive", ...GEM_SOURCE_WITNESS],
7292
+ fs_cp: [...GEM_TARGET, "target_path", "recursive", ...GEM_SOURCE_WITNESS],
7293
+ build: [...GEM_TARGET, "source_revision_id", "force"],
7294
+ version_save: [
7295
+ ...GEM_TARGET,
7296
+ "files",
7297
+ ...GEM_SOURCE_WITNESS,
7298
+ "source_revision_id",
7299
+ "force",
7300
+ "name",
7301
+ "message",
7302
+ "tags",
7303
+ "preview_alias",
7304
+ "idempotency_key",
7305
+ "metadata"
7306
+ ],
7307
+ version_publish: [
7308
+ ...GEM_TARGET,
7309
+ "version_id",
7310
+ "files",
7311
+ ...GEM_SOURCE_WITNESS,
7312
+ "force",
7313
+ "name",
7314
+ "message",
7315
+ "tags",
7316
+ "idempotency_key",
7317
+ "metadata"
7318
+ ],
7319
+ version_restore: [...GEM_TARGET, "version_id", ...GEM_SOURCE_WITNESS],
7320
+ version_preview: [...GEM_TARGET, "version_id", "idempotency_key"],
7321
+ version_retry: [...GEM_TARGET, "version_id"],
7322
+ upsert_binding: [
7323
+ ...GEM_TARGET,
7324
+ "source_ref_type",
7325
+ "source_ref",
7326
+ "target_resource_type",
7327
+ "target_resource_id",
7328
+ "target_resource_ref",
7329
+ "binding_status",
7330
+ "policy_level",
7331
+ "metadata",
7332
+ "expected_binding_set_version",
7333
+ "expected_binding_set_hash",
7334
+ "binding_choices",
7335
+ "allow_actions",
7336
+ "explicit_tool_action_regrant"
7337
+ ],
7338
+ resolve_safe_bindings: [...GEM_TARGET, "build_id"],
7339
+ store_secret: [...GEM_TARGET, "secret_name", "secret_value", "metadata"],
7340
+ delete_secret: [...GEM_TARGET, "secret_name", "metadata"],
7341
+ release_create: [...GEM_TARGET, "version_id", "idempotency_key", "metadata"],
7342
+ release_retry: [...GEM_TARGET, "release_id", "idempotency_key", "metadata"],
7343
+ release_change_apply: [...GEM_TARGET, "release_id", "idempotency_key", "targets"],
7344
+ release_change_resume: [...GEM_TARGET, "change_id"],
7345
+ debug_token: [...GEM_TARGET, "deployment_id"],
7346
+ security_scan: [...GEM_TARGET, "version_id"],
7347
+ public_tool_delegation_enable: [
7348
+ ...GEM_TARGET,
7349
+ ...GEM_MUTATION_IDEMPOTENCY_FIELDS.public_tool_delegation_enable
7350
+ ],
7351
+ public_tool_delegation_revoke: [
7352
+ ...GEM_TARGET,
7353
+ ...GEM_MUTATION_IDEMPOTENCY_FIELDS.public_tool_delegation_revoke
7354
+ ],
7355
+ run_recover: [...GEM_TARGET, "run_id", "plan_token"],
7356
+ run_cancel: [...GEM_TARGET, "run_id"],
7357
+ runtime_stop: [...GEM_TARGET],
7358
+ runtime_start: [...GEM_TARGET],
7359
+ runtime_restart: [...GEM_TARGET],
7360
+ capability_set_enabled: [
7361
+ ...GEM_TARGET,
7362
+ "capability_type",
7363
+ "capability_name",
7364
+ "enabled",
7365
+ "build_id",
7366
+ "deployment_id"
7367
+ ],
7368
+ schedule_arm: [...GEM_TARGET, "capability_name"],
7369
+ schedule_pause: [...GEM_TARGET, "capability_name"],
7370
+ schedule_resume: [...GEM_TARGET, "capability_name"],
7371
+ schedule_target_set: [...GEM_TARGET, "capability_name", "release_id", "expected_deployment_id"],
7372
+ schedule_run_now: [...GEM_TARGET, ...GEM_MUTATION_IDEMPOTENCY_FIELDS.schedule_run_now],
7373
+ event_target_update: [...GEM_TARGET, "target_id", "state", "input"],
7374
+ event_target_release_set: [
7375
+ ...GEM_TARGET,
7376
+ "capability_name",
7377
+ "event_type",
7378
+ "release_id",
7379
+ "expected_deployment_id"
7380
+ ],
7381
+ event_target_run_now: [...GEM_TARGET, ...GEM_MUTATION_IDEMPOTENCY_FIELDS.event_target_run_now],
7382
+ domains_set: [...GEM_TARGET, "hostname"],
7383
+ domains_check: [...GEM_TARGET, "app_domain_id"],
7384
+ domains_delete: [...GEM_TARGET, "app_domain_id"],
7385
+ call_action: [...GEM_TARGET, "capability_name", "input", "idempotency_key", "deployment_id"],
7386
+ job_start: [...GEM_TARGET, "capability_name", "input", "idempotency_key", "deployment_id"],
7387
+ job_cancel: [...GEM_TARGET, "execution_id", "deployment_id", "idempotency_key"],
7388
+ storage_shared_delete: [...GEM_TARGET, "key"],
7389
+ storage_shared_clear: [...GEM_TARGET]
7390
+ },
7391
+ gem_query: {
7392
+ git_source_connections_list: ["page", "detail"],
7393
+ git_source_connection_poll: ["setup_id", "detail"],
7394
+ git_source_inspect: ["connection_id", "repository_id", "ref", "app_directory", "detail"],
7395
+ git_source_status: [...GEM_QUERY_TARGET],
7396
+ git_source_preview_inspect: [...GEM_QUERY_TARGET, "preview_id", "head_sha"],
7397
+ git_source_preview_open: [...GEM_QUERY_TARGET, "preview_id"],
7398
+ inspect: [...GEM_QUERY_TARGET, "build_id", "limit", "include_binding_choices"],
7399
+ fs_tree: [...GEM_QUERY_TARGET, "recursive", "source_revision_id"],
7400
+ fs_read: [...GEM_QUERY_TARGET, "source_revision_id", "offset", "limit"],
7401
+ fs_patch_preview: [...GEM_QUERY_TARGET, "file_path", "patch"],
7402
+ fs_status: [...GEM_QUERY_TARGET, "base", "paths"],
7403
+ fs_diff: [...GEM_QUERY_TARGET, "base", "mode", "paths", "patch_byte_limit"],
7404
+ validate: [...GEM_QUERY_TARGET],
7405
+ build_steps: [...GEM_QUERY_TARGET, "limit"],
7406
+ edits_list: [...GEM_QUERY_TARGET, "limit", "cursor"],
7407
+ edit_get: [...GEM_QUERY_TARGET, "edit_id"],
7408
+ versions_list: [...GEM_QUERY_TARGET, "limit", "cursor"],
7409
+ version_get: [...GEM_QUERY_TARGET, "version_id"],
7410
+ version_diff: [...GEM_QUERY_TARGET, "from_version_id", "to_version_id"],
7411
+ build_logs: [...GEM_QUERY_TARGET, "build_id", "limit"],
7412
+ build_job: [...GEM_QUERY_TARGET, "hosted_job_id"],
7413
+ build_inspect: [...GEM_QUERY_TARGET, "deployment_id", "build_id", "limit"],
7414
+ releases_list: [...GEM_QUERY_TARGET, "limit", "cursor"],
7415
+ release_get: [...GEM_QUERY_TARGET, "release_id"],
7416
+ release_change_get: [...GEM_QUERY_TARGET, "change_id"],
7417
+ deployment_status: [
7418
+ ...GEM_QUERY_TARGET,
7419
+ "deployment_id",
7420
+ "version_id",
7421
+ "build_id",
7422
+ "limit",
7423
+ "status",
7424
+ "request_id",
7425
+ "execution_id"
7426
+ ],
7427
+ checks: [
7428
+ ...GEM_QUERY_TARGET,
7429
+ "deployment_id",
7430
+ "version_id",
7431
+ "build_id",
7432
+ "limit",
7433
+ "status",
7434
+ "request_id",
7435
+ "execution_id"
7436
+ ],
7437
+ logs: [
7438
+ ...GEM_QUERY_TARGET,
7439
+ "cursor",
7440
+ "limit",
7441
+ "deployment_id",
7442
+ "release_id",
7443
+ "run_id",
7444
+ "level",
7445
+ "request_id",
7446
+ "since",
7447
+ "until"
7448
+ ],
7449
+ runs_list: [...GEM_QUERY_TARGET, "limit", "cursor", "status", "version_id"],
7450
+ run_get: [...GEM_QUERY_TARGET, "run_id"],
7451
+ run_recovery_preview: [...GEM_QUERY_TARGET, "run_id"],
7452
+ capabilities_list: [...GEM_QUERY_TARGET, "deployment_id", "build_id", "limit"],
7453
+ schedules_list: [...GEM_QUERY_TARGET, "release_id"],
7454
+ event_targets_list: [...GEM_QUERY_TARGET, "release_id"],
7455
+ get_gem_analytics: [...GEM_QUERY_TARGET, "share_id", "limit"],
7456
+ domains_list: [...GEM_QUERY_TARGET],
7457
+ api_describe: [...GEM_QUERY_TARGET, "deployment_id", "build_id"],
7458
+ tool_declaration: ["tool_paths"],
7459
+ call_query: [...GEM_QUERY_TARGET, "capability_name", "input", "idempotency_key", "deployment_id"],
7460
+ job_status: [...GEM_QUERY_TARGET, "deployment_id", "execution_id"],
7461
+ storage_usage: [...GEM_QUERY_TARGET],
7462
+ storage_shared_list: [...GEM_QUERY_TARGET, "prefix", "cursor", "limit"],
7463
+ storage_shared_get: [...GEM_QUERY_TARGET, "key"]
7464
+ }
7465
+ };
7466
+ function buildGemOperations(op) {
7467
+ const gemOperations = [
7468
+ op("gems.init", "gems", "Create a Gem project at a visible library/<name>.gem path.", "gem_control_plane", "init", "write"),
7469
+ op("gems.git_source_setup", "gems", "Begin the nonce-bound GitHub source connection flow for the current workspace.", "gem_control_plane", "git_source_setup", "write"),
7470
+ op("gems.git_source_connections_list", "gems", "List GitHub installations and repositories available to the current workspace actor.", "gem_query", "git_source_connections_list", "read"),
7471
+ op("gems.git_source_connection_poll", "gems", "Read the state of a GitHub source setup continuation.", "gem_query", "git_source_connection_poll", "read"),
7472
+ op("gems.git_source_connection_callback", "gems", "Complete a nonce-bound GitHub installation or OAuth callback.", "gem_control_plane", "git_source_connection_callback", "write"),
7473
+ op("gems.git_source_inspect", "gems", "Inspect an exact GitHub ref before importing it as a Gem.", "gem_query", "git_source_inspect", "read"),
7474
+ op("gems.git_source_import", "gems", "Import an inspected exact Git commit as a Git-backed Gem.", "gem_control_plane", "git_source_import", "write"),
7475
+ op("gems.git_source_status", "gems", "Read Git source binding, policy, import, preview, and allowed-action state for a Gem.", "gem_query", "git_source_status", "read"),
7476
+ op("gems.git_source_command", "gems", "Apply a bounded Git source command such as refresh, retry, policy change, publish, or preview approval.", "gem_control_plane", "git_source_command", "write"),
7477
+ op("gems.git_source_copy", "gems", "Make a new, unlinked, editable Gem from a GitHub-linked Gem's latest saved Version. The copy carries no Shares, secrets, tool grants, schedules or Git binding.", "gem_control_plane", "git_source_copy", "write"),
7478
+ op("gems.git_source_preview_inspect", "gems", "Inspect the exact preview head and resource policy before approval.", "gem_query", "git_source_preview_inspect", "read"),
7479
+ op("gems.git_source_preview_open", "gems", "Mint an authenticated URL for a ready Git source preview.", "gem_query", "git_source_preview_open", "read"),
7480
+ op("gems.inspect", "gems", "Inspect Gem release readiness, bindings, secrets, and setup checks.", "gem_query", "inspect", "read"),
7481
+ op("gems.fs_tree", "gems", "List the source file tree of a Gem project directory.", "gem_query", "fs_tree", "read"),
7482
+ op("gems.fs_read", "gems", "Read a file from a Gem project directory.", "gem_query", "fs_read", "read"),
7483
+ op("gems.fs_write", "gems", "Write a file inside a Gem project directory. Send base_source_revision_id: the currentSourceRevisionId of your last read or write. A write from an old state is refused and lists the newer edits.", "gem_control_plane", "fs_write", "write"),
7484
+ op("gems.fs_batch_write", "gems", "Write multiple Gem files atomically through the server source layer. Send base_source_revision_id from your last read or write.", "gem_control_plane", "fs_batch_write", "write"),
7485
+ op("gems.fs_sync", "gems", "Synchronize Gem files and deletions atomically through the server source layer.", "gem_control_plane", "fs_sync", "write"),
7486
+ op("gems.fs_upload", "gems", "Stage the files of a Gem source push in parts, for a push too large for one request. A final gems.fs_sync with the same upload_id saves them. Staged bytes expire after 15 minutes.", "gem_control_plane", "fs_upload", "write"),
7487
+ op("gems.fs_import", "gems", "Copy Library files and folders, or files of this chat, into a Gem source directory in one Edit. The server reads each file with your own access, runs the size and secret checks, and refuses an existing path unless replace is true. The result warns when a file now reaches more people.", "gem_control_plane", "fs_import", "write"),
7488
+ op("gems.fs_patch", "gems", "Apply a patch to Gem source files.", "gem_control_plane", "fs_patch", "write"),
7489
+ op("gems.fs_patch_preview", "gems", "Preview a patch to Gem source files without creating a source revision.", "gem_query", "fs_patch_preview", "read"),
7490
+ op("gems.fs_mkdir", "gems", "Create a directory inside a Gem project.", "gem_control_plane", "fs_mkdir", "write"),
7491
+ op("gems.fs_rm", "gems", "Remove a file or directory from a Gem project.", "gem_control_plane", "fs_rm", "destructive"),
7492
+ op("gems.fs_mv", "gems", "Move or rename a Gem project file.", "gem_control_plane", "fs_mv", "write"),
7493
+ op("gems.fs_cp", "gems", "Copy a Gem project file.", "gem_control_plane", "fs_cp", "write"),
7494
+ op("gems.fs_status", "gems", "Compare current Gem source against live, last build, or another version.", "gem_query", "fs_status", "read"),
7495
+ op("gems.fs_diff", "gems", "Read a git-like diff for Gem source changes.", "gem_query", "fs_diff", "read"),
7496
+ op("gems.validate", "gems", "Enqueue a read-only hosted compile of the current Gem source. Returns hosted_job_id immediately. Poll gems.build_job until queued, pending, running, succeeded, failed, or expired. Never creates a durable Build, Version, Release, or Share change. Does not accept force.", "gem_query", "validate", "read"),
7497
+ op("gems.build", "gems", "Enqueue a durable hosted compile, or reuse a ready Build. Returns hosted_job_id immediately (or status succeeded with build_id when a ready Build already exists). Poll gems.build_job until terminal. Pass force=true to rebuild.", "gem_control_plane", "build", "write"),
7498
+ op("gems.build_steps", "gems", "Read a Gem's build step log: each save, build wait, publish wait, failed step and rework with its start, end, result and cause tag, newest first, with total minutes per kind. Holds no prompt or file text.", "gem_query", "build_steps", "read"),
7499
+ op("gems.edits_list", "gems", "List coherent Gem source edits.", "gem_query", "edits_list", "read"),
7500
+ op("gems.edit_get", "gems", "Inspect one coherent Gem Edit.", "gem_query", "edit_get", "read"),
7501
+ op("gems.versions_list", "gems", "List frozen Gem Versions.", "gem_query", "versions_list", "read"),
7502
+ op("gems.version_get", "gems", "Inspect one frozen Gem Version.", "gem_query", "version_get", "read"),
7503
+ op("gems.version_diff", "gems", "Compare two frozen Gem Versions.", "gem_query", "version_diff", "read"),
7504
+ op("gems.version_save", "gems", "Write the given files (optional), build, and save one exact state as a Version in one call. With no files, send source_revision_id: the currentSourceRevisionId of your last read or write. A save moves no Share; gems.version_publish does.", "gem_control_plane", "version_save", "write"),
7505
+ op("gems.version_publish", "gems", "Publish: move every Share that follows the Gem to a Version. With no version_id it writes the given files (optional), builds, and saves the exact state named by source_revision_id (or written by files) first, then publishes that Version. With a version_id it publishes that saved Version and builds nothing. It is the only Gem operation that changes what a following Share serves.", "gem_control_plane", "version_publish", "write"),
7506
+ op("gems.version_restore", "gems", "Restore one saved Gem Version into Current as a new Edit without changing Shares. Send base_source_revision_id from your last read; a restore from an old state is refused.", "gem_control_plane", "version_restore", "write"),
7507
+ op("gems.version_preview", "gems", "Open or provision an isolated preview for one Version without changing Shares.", "gem_control_plane", "version_preview", "write"),
7508
+ op("gems.version_retry", "gems", "Re-queue the build of a Version that failed and never sealed a Build, keeping the same Version identity and source snapshot. Available for every Gem, whether its source is Uru or GitHub. Only a failed Version qualifies, and a build already in flight is refused.", "gem_control_plane", "version_retry", "write"),
7509
+ op("gems.build_logs", "gems", "Read build diagnostics for a Gem build.", "gem_query", "build_logs", "read"),
7510
+ op("gems.build_job", "gems", "Read hosted compile status by hosted_job_id. Reports queued, pending, running, succeeded, failed, or expired, plus build_id when a durable Build was persisted, plus compact logs. A failed or expired compile adds failure_kind (a listed kind, or unknown) and failure_reason with kind, known, stage, reason, and next_step in plain words.", "gem_query", "build_job", "read"),
7511
+ op("gems.build_inspect", "gems", "Inspect a Gem runtime contract and release overview.", "gem_query", "build_inspect", "read"),
7512
+ op("gems.upsert_binding", "gems", "Bind a declared Gem need to an approved platform resource. Keep an existing generic tool target exactly as returned by Gem inspection. New tool roles use the expected binding-set version and hash with a complete binding_choices map of opaque connection_ref values read from gems.inspect. A direct action call name is not a binding target. A Gem has one set of tool bindings: its preview builds and its releases use it alike.", "gem_control_plane", "upsert_binding", "write"),
7513
+ op("gems.resolve_safe_bindings", "gems", "Resolve deterministic safe bindings for a ready Gem build.", "gem_control_plane", "resolve_safe_bindings", "write"),
7514
+ op("gems.store_secret", "gems", "Store a user-supplied Gem secret value server-side.", "gem_control_plane", "store_secret", "write"),
7515
+ op("gems.releases_list", "gems", "List logical hosted Releases.", "gem_query", "releases_list", "read"),
7516
+ op("gems.release_get", "gems", "Inspect one Release and its attempts.", "gem_query", "release_get", "read"),
7517
+ op("gems.release_create", "gems", "Create or reuse a hosted Release for one Version without changing Shares.", "gem_control_plane", "release_create", "write"),
7518
+ op("gems.release_retry", "gems", "Retry a failed or revoked logical Release with the same Version and Release identity; every retry key keeps its own durable result, active attempts are rejected, and stale pending reservations can recover after the orphan timeout.", "gem_control_plane", "release_retry", "write"),
7519
+ op("gems.release_change_apply", "gems", "Save one Release change for selected Viewer Shares, schedules, and event rules. The change affects future viewers and work only.", "gem_control_plane", "release_change_apply", "write"),
7520
+ op("gems.release_change_get", "gems", "Read one saved Release change and the delivery state of its targets.", "gem_query", "release_change_get", "read"),
7521
+ op("gems.release_change_resume", "gems", "Resume one saved Release change for targets that are safe to retry.", "gem_control_plane", "release_change_resume", "write"),
7522
+ op("gems.status", "gems", "Read Gem deployment status, checks, runtime runs, and recent logs.", "gem_query", "deployment_status", "read"),
7523
+ op("gems.checks", "gems", "Inspect registered checks for a Gem deployment or immutable version.", "gem_query", "checks", "read"),
7524
+ op("gems.logs", "gems", "Read server-side Gem runtime logs with filters.", "gem_query", "logs", "read"),
7525
+ op("gems.debug_token", "gems", "Mint a short-lived, single-deployment debug session for live Gem inspection.", "gem_control_plane", "debug_token", "write"),
7526
+ op("gems.security_scan", "gems", "Run the check before Publish on one Gem Version, without Publish. gems.version_publish runs the same check.", "gem_control_plane", "security_scan", "write"),
7527
+ op("gems.public_tool_delegation_enable", "gems", "Enable one bounded anonymous public-tool delegation for a Gem tool on one Share.", "gem_control_plane", "public_tool_delegation_enable", "write"),
7528
+ op("gems.public_tool_delegation_revoke", "gems", "Revoke one bounded anonymous public-tool delegation.", "gem_control_plane", "public_tool_delegation_revoke", "destructive"),
7529
+ op("gems.runs_list", "gems", "List bounded server Gem executions. A failed run has explanation: why it failed and one next step.", "gem_query", "runs_list", "read"),
7530
+ op("gems.run_get", "gems", "Inspect one bounded Gem execution.", "gem_query", "run_get", "read"),
7531
+ op("gems.run_recovery_preview", "gems", "Preview recovery for a stuck Gem job whose provider create is known not to have succeeded.", "gem_query", "run_recovery_preview", "read"),
7532
+ op("gems.run_recover", "gems", "Recover one stuck Gem job by reusing its saved admission after a current safe recovery plan is checked.", "gem_control_plane", "run_recover", "destructive"),
7533
+ op("gems.run_cancel", "gems", "Cancel one running Gem execution when supported.", "gem_control_plane", "run_cancel", "destructive"),
7534
+ op("gems.runtime_stop", "gems", "Stop the machine a serverful Gem serves from, right now. This is not an off switch: the platform starts the machine again on the next visitor request. Use it to clear a wedged runtime, not to take a Gem offline. Revoke its Shares for that.", "gem_control_plane", "runtime_stop", "destructive"),
7535
+ op("gems.runtime_start", "gems", "Start the machine a serverful Gem serves from, without waiting for a visitor request to wake it.", "gem_control_plane", "runtime_start", "write"),
7536
+ op("gems.runtime_restart", "gems", "Restart the machine a serverful Gem serves from. The usual remedy for a runtime that has wedged, and far cheaper than republishing the Gem. In-flight requests are dropped.", "gem_control_plane", "runtime_restart", "destructive"),
7537
+ op("gems.capabilities_list", "gems", "List a Gem's declared capabilities with their live state: switched on or off, whether a deployment has materialized them, and what each one last did.", "gem_query", "capabilities_list", "read"),
7538
+ op("gems.capability_set_enabled", "gems", "Switch one declared query, action or job capability on or off. A switched-off capability stays listed and stays bound; the runtime refuses to dispatch it.", "gem_control_plane", "capability_set_enabled", "write"),
7539
+ op("gems.schedules_list", "gems", "List a Gem's declared job schedules and their current runtime state. Each schedule has explanation: Active, Not active (it cannot start its job now) or Status unknown, with the reason and one next step.", "gem_query", "schedules_list", "read"),
7540
+ op("gems.schedule_arm", "gems", "Arm one declared Gem job schedule.", "gem_control_plane", "schedule_arm", "write"),
7541
+ op("gems.schedule_pause", "gems", "Pause one declared Gem job schedule.", "gem_control_plane", "schedule_pause", "write"),
7542
+ op("gems.schedule_resume", "gems", "Resume one declared Gem job schedule.", "gem_control_plane", "schedule_resume", "write"),
7543
+ op("gems.schedule_target_set", "gems", "Select one ready Release for future runs of one Gem schedule. A Share Version change does not change this target.", "gem_control_plane", "schedule_target_set", "write"),
7544
+ op("gems.schedule_run_now", "gems", "Run one active Gem job schedule now.", "gem_control_plane", "schedule_run_now", "write"),
7545
+ op("gems.event_targets_list", "gems", "List a Gem's event rules that start jobs from reported platform events.", "gem_query", "event_targets_list", "read"),
7546
+ op("gems.event_target_update", "gems", "Update one Gem event rule's paused state or job input.", "gem_control_plane", "event_target_update", "write"),
7547
+ op("gems.event_target_release_set", "gems", "Select one ready Release for one event-started Gem job. Other event rules keep their targets.", "gem_control_plane", "event_target_release_set", "write"),
7548
+ op("gems.event_target_run_now", "gems", "Run one active Gem event rule now.", "gem_control_plane", "event_target_run_now", "write"),
7549
+ op("gems.analytics", "gems", "Read access-checked Share view summaries and run-ledger totals for a Gem without returning customer content.", "gem_query", "get_gem_analytics", "read"),
7550
+ op("gems.domains_set", "gems", "Attach or update a custom domain for a Gem. Pass the hostname only; " + "the current Release is resolved for you. Requires a ready Release.", "gem_control_plane", "domains_set", "write"),
7551
+ op("gems.domains_list", "gems", "List custom domains for a Gem.", "gem_query", "domains_list", "read"),
7552
+ op("gems.domains_check", "gems", "Check one custom domain and refresh its provider state.", "gem_control_plane", "domains_check", "write"),
7553
+ op("gems.domains_delete", "gems", "Delete one custom domain after provider cleanup succeeds.", "gem_control_plane", "domains_delete", "destructive"),
7554
+ op("gems.storage_usage", "gems", "Show how much of the Gem's 20 MB storage its viewers use, in total and in the shared scope.", "gem_query", "storage_usage", "read"),
7555
+ op("gems.storage_shared_list", "gems", "List the keys of the Gem's shared storage, with their sizes. Personal data of viewers is never listed.", "gem_query", "storage_shared_list", "read"),
7556
+ op("gems.storage_shared_get", "gems", "Read one key of the Gem's shared storage.", "gem_query", "storage_shared_get", "read"),
7557
+ op("gems.storage_shared_delete", "gems", "Delete one key of the Gem's shared storage. Every viewer stops seeing it.", "gem_control_plane", "storage_shared_delete", "destructive"),
7558
+ op("gems.storage_shared_clear", "gems", "Delete every key of the Gem's shared storage. Personal data of viewers stays.", "gem_control_plane", "storage_shared_clear", "destructive"),
7559
+ op("gems.api_describe", "gems", "Describe a Gem's declared queries, actions, jobs and datasets for the " + "selected Release. Returns the saved input and output schemas when " + "the source declares them, together with the exact Release identity. " + "An undeclared schema stays unknown; the platform does not infer it. " + "A Gem with no callable operations reports that state explicitly.", "gem_query", "api_describe", "read"),
7560
+ op("gems.tool_declaration", "gems", "Read the Gem declaration of catalog actions by their Executor tool " + "paths, as tools.search returns them. Each answer carries the exact " + "integration, operation and binding to put in a Gem's uru.json, or " + "null when the action cannot be bound in a Gem.", "gem_query", "tool_declaration", "read"),
7561
+ op("gems.call_query", "gems", "Run one of a Gem's declared queries and return its result. Read-only. " + "Use gem_query op='api_describe' to list what this Gem declares; a name " + "it does not declare is refused rather than guessed at.", "gem_query", "call_query", "read"),
7562
+ op("gems.call_action", "gems", "Run one of a Gem's declared actions. This performs the action's real " + "effect and writes a durable audit row BEFORE doing so — if the row " + "cannot be written the call does not happen.", "gem_control_plane", "call_action", "write"),
7563
+ op("gems.job_cancel", "gems", "Stop a job started by job_start, naming the execution_id it returned. " + "This is NOT run_cancel, which cancels a durable bounded Run by " + "run_id — two different objects that share a word. Writes a durable " + "audit row before cancelling.", "gem_control_plane", "job_cancel", "write"),
7564
+ op("gems.job_start", "gems", "Start one of a Gem's declared jobs. Writes a durable audit row before " + "starting, and returns the request id that row is filed under.", "gem_control_plane", "job_start", "write"),
7565
+ op("gems.job_status", "gems", "Read the pending or terminal result for one job started by job_start. " + "Supply the exact deployment_id and execution_id returned by that call. " + "The result remains available after the short-lived status cache expires. " + "A failed job has explanation: why it failed and one next step.", "gem_query", "job_status", "read"),
7566
+ withOutputSchema(op("gems.components_list", "gems", "List verified Gem component templates.", "GEM_COMPONENTS_LIST", undefined, "read"), gemComponentsListOutputSchema),
7567
+ withOutputSchema(op("gems.components_get", "gems", "Fetch one verified Gem component definition.", "GEM_COMPONENTS_GET", undefined, "read"), gemComponentsGetOutputSchema)
7568
+ ];
7569
+ return gemOperations;
7570
+ }
7571
+
7572
+ // ../../packages/platform-operations/src/operation_groups_home.ts
7573
+ var SURFACES = ["cli", "mcp", "docs"];
7574
+ var uuid4 = { type: "string", format: "uuid" };
7575
+ var widgetSchema = {
7576
+ type: "object",
7577
+ additionalProperties: true,
7578
+ properties: {
7579
+ widgetId: { type: "string" },
7580
+ kind: { type: "string", enum: ["focus", "pin", "person", "guru", "timeline", "activity"] },
7581
+ span: { type: "integer", enum: [1, 2, 3] },
7582
+ view: { type: "string", enum: ["one-column", "two-columns", "three-columns", "list"] },
7583
+ rowSpan: { type: "integer", enum: [1, 2] },
7584
+ name: { type: "string" },
7585
+ collapsed: { type: "boolean" },
7586
+ sectionId: uuid4,
7587
+ personUserId: uuid4
7588
+ },
7589
+ required: ["widgetId", "kind", "span"]
7590
+ };
7591
+ var layoutOutputSchema = {
7592
+ type: "object",
7593
+ additionalProperties: true,
7594
+ properties: {
7595
+ layout: { type: "array", items: widgetSchema },
7596
+ revision: { type: "integer", minimum: 0 }
7597
+ },
7598
+ required: ["layout", "revision"]
7599
+ };
7600
+ var workspacesOutputSchema = {
7601
+ type: "object",
7602
+ additionalProperties: true,
7603
+ properties: {
7604
+ picked: { type: "array", items: uuid4 },
7605
+ total: { type: "integer", minimum: 0 },
7606
+ lost: {
7607
+ type: "array",
7608
+ items: {
7609
+ type: "object",
7610
+ additionalProperties: true,
7611
+ properties: {
7612
+ workspaceId: uuid4,
7613
+ name: { type: "string" },
7614
+ organizationName: { type: ["string", "null"] }
7615
+ },
7616
+ required: ["workspaceId", "name", "organizationName"]
7617
+ }
7618
+ },
7619
+ revision: { type: "string" }
7620
+ },
7621
+ required: ["picked", "total", "lost", "revision"]
7622
+ };
7623
+ function withOutputSchema2(operation, outputSchema) {
7624
+ const returned = { ...operation, outputSchema };
7625
+ return returned;
7626
+ }
7627
+ function buildHomePersonOperations(op) {
7628
+ const layoutOp = (id, summary, backendOp, safety) => withOutputSchema2(op(id, "home", summary, backendOp === "layout_get" ? "home_layout_query" : "home_layout_manage", backendOp, safety, SURFACES, "universal"), layoutOutputSchema);
7629
+ const workspacesOp = (id, summary, backendOp, safety) => withOutputSchema2(op(id, "home", summary, backendOp === "workspaces_get" ? "home_workspaces_query" : "home_workspaces_manage", backendOp, safety, SURFACES, "universal"), workspacesOutputSchema);
7630
+ const returned = [
7631
+ layoutOp("home.layout_get", "Read your Home layout: the widgets in reading order and the layout revision.", "layout_get", "read"),
7632
+ layoutOp("home.layout_set", "Replace your whole Home layout. A pin widget left out is deleted with its pins. An agent in a thread may delete only a section whose pins are all in its own workspace.", "layout_set", "destructive"),
7633
+ layoutOp("home.widget_add", "Add a widget at the bottom of your Home, full width. A pin widget makes a new own section. An agent in a thread may make one.", "widget_add", "write"),
7634
+ layoutOp("home.widget_remove", "Remove a widget from your Home. A pin widget is deleted with its pins. An agent in a thread may delete only a section whose pins are all in its own workspace.", "widget_remove", "destructive"),
7635
+ layoutOp("home.widget_move", "Move a Home widget to another place in the reading order.", "widget_move", "write"),
7636
+ layoutOp("home.widget_resize", "Set how many of the three Home columns a widget takes.", "widget_resize", "write"),
7637
+ layoutOp("home.widget_rename", "Rename a Home widget. Renaming a pin widget renames its section.", "widget_rename", "write"),
7638
+ layoutOp("home.widget_set_view", "Set how a Home widget lays out its items: one, two or three columns, or a list.", "widget_set_view", "write"),
7639
+ layoutOp("home.widget_set_row_span", "Make the Activity widget on your Home one or two rows tall. Two rows tall at the left or right edge, the next widgets fill the thirds beside it in a second row, and a wider next widget narrows to those thirds; full width, it is just taller.", "widget_set_row_span", "write"),
7640
+ layoutOp("home.focus_fold", "Fold the Focus widget on your Home to its one-line row.", "focus_fold", "write"),
7641
+ layoutOp("home.focus_unfold", "Open the folded Focus widget on your Home.", "focus_unfold", "write"),
7642
+ workspacesOp("home.workspaces_get", "Read the workspaces your Home covers, the workspaces it lost and the revision.", "workspaces_get", "read"),
7643
+ workspacesOp("home.workspaces_set", "Choose the workspaces your Home covers. Every one must be a workspace you belong to.", "workspaces_set", "write")
7644
+ ];
7645
+ return returned;
7646
+ }
7647
+
7648
+ // ../../packages/platform-operations/src/operation_groups_home_pins.ts
7649
+ var SURFACES2 = ["cli", "mcp", "docs"];
7650
+ var uuid5 = { type: "string", format: "uuid" };
7651
+ var text6 = { type: "string" };
7652
+ var nullableUuid = { anyOf: [uuid5, { type: "null" }] };
7653
+ var count2 = { type: "integer", minimum: 0 };
7654
+ function object7(properties, required) {
7655
+ const returned = { type: "object", additionalProperties: true, properties, required: [...required] };
7656
+ return returned;
7657
+ }
7658
+ function list(items) {
7659
+ const returned = { type: "array", items };
7660
+ return returned;
7661
+ }
7662
+ var pin = object7({ id: uuid5, kind: text6, resourceId: uuid5, title: text6, href: text6, position: count2, createdAt: text6, updatedAt: text6 }, ["id", "kind", "resourceId", "title", "href", "position"]);
7663
+ var unavailablePin = object7({ id: uuid5, kind: text6, position: count2, updatedAt: text6 }, ["id", "kind", "position"]);
7664
+ var section = object7({ id: uuid5, name: text6, count: count2, revision: text6 }, ["id", "name"]);
7665
+ var personPin = object7({
7666
+ id: uuid5,
7667
+ kind: text6,
7668
+ resourceId: uuid5,
7669
+ title: text6,
7670
+ href: text6,
7671
+ workspaceId: uuid5,
7672
+ givenByUserId: nullableUuid,
7673
+ createdAt: text6
7674
+ }, ["id", "kind", "resourceId", "title", "href", "workspaceId", "givenByUserId"]);
7675
+ var sectionPin = object7({ pinId: uuid5, kind: text6, resourceId: uuid5, workspaceId: uuid5, title: text6, href: text6, position: count2, pinnedAt: text6 }, ["pinId", "kind", "resourceId", "workspaceId", "title", "href", "position"]);
7676
+ var presentIn = {
7677
+ anyOf: [
7678
+ object7({ workspaceId: uuid5, sectionId: nullableUuid, sectionName: { type: ["string", "null"] } }, ["workspaceId"]),
7679
+ { type: "null" }
7680
+ ]
7681
+ };
7682
+ var addStatus = {
7683
+ status: { type: "string", enum: ["created", "already_present"] },
7684
+ alreadyPresent: { type: "boolean" },
7685
+ presentIn,
7686
+ message: text6
7687
+ };
7688
+ var anyObject = { type: "object", additionalProperties: true };
7689
+ var pinsQueryOutputSchema = {
7690
+ type: "object",
7691
+ additionalProperties: true,
7692
+ anyOf: [
7693
+ object7({
7694
+ pins: list(pin),
7695
+ unavailablePins: list(unavailablePin),
7696
+ unavailableNextCursor: { type: ["string", "null"] },
7697
+ revision: text6
7698
+ }, ["pins", "unavailablePins", "unavailableNextCursor", "revision"]),
7699
+ object7({ section, pins: list(sectionPin), unavailableCount: count2 }, ["section", "pins", "unavailableCount"]),
7700
+ object7({ sections: list(section) }, ["sections"]),
7701
+ object7({ lists: list(anyObject) }, ["lists"]),
7702
+ object7({ pins: list(personPin) }, ["pins"]),
7703
+ object7({ sections: list(anyObject), people: list(anyObject) }, ["sections", "people"])
7704
+ ]
7705
+ };
7706
+ var pinsManageOutputSchema = {
7707
+ type: "object",
7708
+ additionalProperties: true,
7709
+ anyOf: [
7710
+ object7({ pin, ...addStatus, revision: text6 }, ["pin", "status", "alreadyPresent", "revision"]),
7711
+ object7({
7712
+ results: list(object7({ kind: text6, targetId: text6, ...addStatus, pin }, ["kind", "targetId", "status", "alreadyPresent", "pin"])),
7713
+ revision: text6
7714
+ }, ["results", "revision"]),
7715
+ object7({ removed: { type: "boolean" }, pinId: nullableUuid, kind: { type: ["string", "null"] }, resourceId: nullableUuid, revision: text6 }, ["removed", "pinId", "kind", "resourceId", "revision"]),
7716
+ object7({
7717
+ pins: list(pin),
7718
+ unavailablePins: list(unavailablePin),
7719
+ unavailableNextCursor: { type: ["string", "null"] },
7720
+ revision: text6
7721
+ }, ["pins", "unavailablePins", "unavailableNextCursor", "revision"]),
7722
+ object7({ section, widgetId: text6, layoutRevision: count2 }, ["section"]),
7723
+ object7({ deleted: { const: true }, sectionId: uuid5 }, ["deleted", "sectionId"]),
7724
+ object7({ pin: personPin, alreadyPresent: { type: "boolean" }, message: text6 }, ["pin", "alreadyPresent"]),
7725
+ object7({ removed: { type: "boolean" }, pinId: uuid5 }, ["removed", "pinId"])
7726
+ ]
7727
+ };
7728
+ function withOutputSchema3(operation, outputSchema) {
7729
+ const returned = { ...operation, outputSchema };
7730
+ return returned;
7731
+ }
7732
+ function buildHomePinListOperations(op) {
7733
+ const pinsOp = (id, summary, backendOp, safety) => {
7734
+ const query = safety === "read";
7735
+ return withOutputSchema3(op(id, "home", summary, query ? "home_pins_query" : "home_pins_manage", backendOp, safety, SURFACES2, "universal"), query ? pinsQueryOutputSchema : pinsManageOutputSchema);
7736
+ };
7737
+ const returned = [
7738
+ pinsOp("home.pins_list", "List durable Home pins, including recoverable unavailable rows; with section_id, the pins of one own section over your Home workspaces.", "pins_list", "read"),
7739
+ pinsOp("home.pins_add", "Add a durable Home pin for an authorized target, into a named own section (section_id) at a position.", "pins_add", "write"),
7740
+ pinsOp("home.pins_remove", "Remove a durable Home pin.", "pins_remove", "write"),
7741
+ pinsOp("home.pins_reorder", "Reorder visible durable Home pins, or the pins of one own section (section_id).", "pins_reorder", "write"),
7742
+ pinsOp("home.sections_list", "List your own Home pin sections with their ids, names and pin counts.", "sections_list", "read"),
7743
+ pinsOp("home.sections_create", "Make a new own pin section. It shows as a pin widget at the bottom of your Home. An agent in a thread may make one.", "section_create", "write"),
7744
+ pinsOp("home.sections_rename", "Rename one of your own Home pin sections.", "section_rename", "write"),
7745
+ pinsOp("home.sections_delete", "Delete one of your own Home pin sections with every pin in it. An agent in a thread may delete only a section whose pins are all in its own workspace.", "section_delete", "destructive"),
7746
+ pinsOp("home.person_lists_list", 'List the "Pinned by" lists on your Home: Uru Guru and each member who can pin for you, with pin counts.', "person_lists_list", "read"),
7747
+ pinsOp("home.person_lists_items", "List the pins one member, or Uru Guru, made for you, newest first.", "person_list_items", "read"),
7748
+ pinsOp("home.person_pins_given_list", "List the pins you made for one member, newest first.", "person_pins_given_list", "read"),
7749
+ pinsOp("home.person_pins_add", 'Pin an item for another member. It lands in their "Pinned by <you>" list.', "person_pin_add", "write"),
7750
+ pinsOp("home.person_pins_remove", "Remove a pin you made for another member.", "person_pin_remove", "write"),
7751
+ pinsOp("home.pin_targets", "Show where one item can be pinned: your own sections and the members of its workspace.", "pin_targets", "read")
7752
+ ];
7753
+ return returned;
7754
+ }
7755
+
7756
+ // ../../packages/platform-operations/src/output_schemas.ts
7757
+ var gemToolResultSchema = {
7758
+ anyOf: [
7759
+ {
7760
+ type: "object",
7761
+ additionalProperties: true,
7762
+ description: "Operation-specific payload. Lifecycle payload shapes are preserved inside this envelope."
7763
+ },
7764
+ { type: "array", items: {} },
7765
+ { type: "string" },
7766
+ { type: "number" },
7767
+ { type: "boolean" }
7768
+ ]
7769
+ };
7770
+ var nullableString3 = { type: ["string", "null"] };
7771
+ var homeActivityRowSchema = {
7772
+ type: "object",
7773
+ additionalProperties: true,
7774
+ properties: {
7775
+ notification_id: { type: "string", format: "uuid" },
7776
+ workspace_id: { type: ["string", "null"], format: "uuid" },
7777
+ source_type: { type: "string" },
7778
+ status: { type: "string", enum: ["unread", "read", "dismissed"] },
7779
+ read: { type: "boolean" },
7780
+ done: { type: "boolean" },
7781
+ awaiting_answer: {
7782
+ type: "boolean",
7783
+ description: "True while somebody must still answer this approval or request. Only the person answers it."
7784
+ },
7785
+ tabs: {
7786
+ type: "array",
7787
+ items: { type: "string", enum: ["needs-you", "shared-with-you", "shared-by-you", "runs"] }
7788
+ },
7789
+ created_at: { type: "string" },
7790
+ expires_at: nullableString3,
7791
+ target_url: nullableString3,
7792
+ actor: {
7793
+ type: ["object", "null"],
7794
+ additionalProperties: true,
7795
+ properties: { kind: nullableString3, name: nullableString3, user_id: nullableString3 }
7796
+ },
7797
+ item: {
7798
+ type: ["object", "null"],
7799
+ additionalProperties: true,
7800
+ properties: { kind: nullableString3, title: nullableString3, id: nullableString3, href: nullableString3 }
7801
+ },
7802
+ details: { type: "object", additionalProperties: true },
7803
+ content_trust: { const: "untrusted_user_content" }
7804
+ },
7805
+ required: ["notification_id", "source_type", "status", "read", "done", "awaiting_answer", "tabs", "created_at"]
7806
+ };
7807
+ var homeActivityListOutputSchema = {
7808
+ type: "object",
7809
+ additionalProperties: true,
7810
+ properties: {
7811
+ rows: { type: "array", items: homeActivityRowSchema },
7812
+ next_cursor: nullableString3
7813
+ }
7814
+ };
7815
+ var homeActivityGetOutputSchema = {
7816
+ type: "object",
7817
+ additionalProperties: true,
7818
+ properties: { row: homeActivityRowSchema }
7819
+ };
7820
+ var homeActivityUnreadCountOutputSchema = {
7821
+ type: "object",
7822
+ additionalProperties: true,
7823
+ properties: { unread_count: { type: "integer", minimum: 0 } }
7824
+ };
7825
+ var homeActivityWriteOutputSchema = {
7826
+ type: "object",
7827
+ additionalProperties: true,
7828
+ properties: {
7829
+ updated_count: { type: "integer", minimum: 0 },
7830
+ notification_ids: { type: "array", items: { type: "string", format: "uuid" } }
7831
+ },
7832
+ required: ["updated_count", "notification_ids"]
7833
+ };
7834
+ var gemToolErrorSchema = {
7835
+ type: "object",
7836
+ additionalProperties: false,
7837
+ required: ["code", "message", "errorId"],
7838
+ properties: {
7839
+ code: { type: "string" },
7840
+ message: { type: "string" },
7841
+ details: { type: "object", additionalProperties: true },
7842
+ errorId: {
7843
+ type: "string",
7844
+ pattern: "^[0-9A-HJKMNP-TV-Z]{26}$",
7845
+ description: "Opaque ULID for server-side error correlation."
7846
+ }
7847
+ }
7848
+ };
7849
+ var gemOperationOutputSchema = {
7850
+ type: "object",
7851
+ additionalProperties: false,
7852
+ required: ["schema", "result", "error"],
7853
+ properties: {
7854
+ schema: { const: "uru.gem.result.v1" },
7855
+ result: { oneOf: [gemToolResultSchema, { type: "null" }] },
7856
+ error: { oneOf: [gemToolErrorSchema, { type: "null" }] }
7857
+ },
7858
+ oneOf: [
7859
+ {
7860
+ properties: {
7861
+ result: gemToolResultSchema,
7862
+ error: { type: "null" }
7863
+ }
7864
+ },
7865
+ {
7866
+ properties: {
7867
+ result: { type: "null" },
7868
+ error: gemToolErrorSchema
7869
+ }
7870
+ }
7871
+ ]
7872
+ };
7873
+
7874
+ // ../../packages/platform-operations/src/operation_groups_home_activity.ts
7875
+ var SURFACES3 = ["cli", "mcp", "docs"];
7876
+ function withOutputSchema4(operation, outputSchema) {
7877
+ const returned = { ...operation, outputSchema };
7878
+ return returned;
7879
+ }
7880
+ function buildHomeActivityOperations(op) {
7881
+ const activityOp = (id, summary, backendOp, safety, outputSchema) => withOutputSchema4(op(id, "home", summary, safety === "read" ? "home_activity_query" : "home_activity_manage", backendOp, safety, SURFACES3, "universal"), outputSchema);
7882
+ const returned = [
7883
+ activityOp("home.activity_list", "List your Home Activity rows over the workspaces your Home covers, by tab, open or Done.", "activity_list", "read", homeActivityListOutputSchema),
7884
+ activityOp("home.activity_get", "Read one Home Activity row by its id.", "activity_get", "read", homeActivityGetOutputSchema),
7885
+ activityOp("home.activity_unread_count", "Count your unread Home Activity rows over the workspaces your Home covers.", "activity_unread_count", "read", homeActivityUnreadCountOutputSchema),
7886
+ activityOp("home.activity_mark_read", "Mark Home Activity rows read.", "activity_mark_read", "write", homeActivityWriteOutputSchema),
7887
+ activityOp("home.activity_done", "Move Home Activity rows to Done. A row that still needs an answer is refused.", "activity_done", "write", homeActivityWriteOutputSchema),
7888
+ activityOp("home.activity_restore", "Move Home Activity rows from Done back to the open list.", "activity_restore", "write", homeActivityWriteOutputSchema)
7889
+ ];
7890
+ return returned;
7891
+ }
7892
+
7893
+ // ../../packages/platform-operations/src/operation_groups_shares.ts
7894
+ var SHARE_MUTATION_IDEMPOTENCY_FIELDS = {
7895
+ share_create: ["idempotency_key"],
7896
+ share_items: ["item_ids", "idempotency_key"],
7897
+ share_update: ["share_id", "idempotency_key"],
7898
+ share_add_people: ["share_id", "people", "idempotency_key"],
7899
+ share_remove_person: ["share_id", "recipient_id", "idempotency_key"],
7900
+ share_move_person: ["share_id", "recipient_id", "role", "idempotency_key"],
7901
+ share_revoke: ["share_id", "idempotency_key"],
7902
+ share_rotate: ["share_id", "idempotency_key"],
7903
+ share_resend_email: ["share_id", "recipient_id", "idempotency_key"]
7904
+ };
7905
+ var SHARE_ITEM = ["item_id", "path"];
7906
+ var SHARE_PAGE = ["cursor", "limit"];
7907
+ var SHARE_CREATE_BODY = [
7908
+ "kind",
7909
+ "name",
7910
+ "message",
7911
+ "people",
7912
+ "notify",
7913
+ "audience",
7914
+ "gate",
7915
+ "expires_at",
7916
+ "needed_by",
7917
+ "notify_on_open",
7918
+ "download",
7919
+ "version",
7920
+ "confirm_used_items"
7921
+ ];
7922
+ var SHARE_OPERATION_INPUT_FIELDS = {
7923
+ sharing_query: {
7924
+ item_shares: [...SHARE_ITEM, ...SHARE_PAGE],
7925
+ share_get: ["share_id", ...SHARE_PAGE],
7926
+ share_opens: ["share_id", "recipient_id", "audience_id", ...SHARE_PAGE],
7927
+ share_people_search: [...SHARE_ITEM, "q"],
7928
+ audience_people: ["share_id", "audience_id", ...SHARE_PAGE],
7929
+ received_list: [
7930
+ "q",
7931
+ "kind",
7932
+ "role",
7933
+ "state",
7934
+ "from_contact_id",
7935
+ "placed_in_workspace_id",
7936
+ "sort",
7937
+ ...SHARE_PAGE
7938
+ ],
7939
+ received_get: [...SHARE_ITEM],
7940
+ sent_list: [
7941
+ "status",
7942
+ "opened",
7943
+ "kind",
7944
+ "role",
7945
+ "to_contact_id",
7946
+ "to_company_id",
7947
+ "to_audience",
7948
+ "in_workspace_id",
7949
+ "q",
7950
+ ...SHARE_PAGE
7951
+ ],
7952
+ share_counts: [],
7953
+ send_allowance: [],
7954
+ access_requests: ["request_state"],
7955
+ link_open: ["link"],
7956
+ list_permissions: [...SHARE_ITEM],
7957
+ list_versions: [...SHARE_ITEM, "limit", "offset", "content_limit", "content_offset"],
7958
+ get_version: [...SHARE_ITEM, "version_id"],
7959
+ diff_versions: [...SHARE_ITEM, "from_version_id", "to_version_id"],
7960
+ list_labels: []
7961
+ },
7962
+ library_collab: {
7963
+ share_items: ["item_ids", "idempotency_key", ...SHARE_CREATE_BODY],
7964
+ share_create: [...SHARE_ITEM, "idempotency_key", ...SHARE_CREATE_BODY],
7965
+ share_update: [
7966
+ "share_id",
7967
+ "idempotency_key",
7968
+ "name",
7969
+ "message",
7970
+ "version",
7971
+ "gate",
7972
+ "expires_at",
7973
+ "needed_by",
7974
+ "notify_on_open",
7975
+ "download",
7976
+ "audience",
7977
+ "audience_confirm_link_off",
7978
+ "search_indexing_disabled",
7979
+ "link_preview_enabled",
7980
+ "confirm_used_items"
7981
+ ],
7982
+ share_add_people: ["share_id", "idempotency_key", "people", "notify", "confirm_used_items"],
7983
+ share_remove_person: [...SHARE_MUTATION_IDEMPOTENCY_FIELDS.share_remove_person],
7984
+ share_move_person: [
7985
+ ...SHARE_MUTATION_IDEMPOTENCY_FIELDS.share_move_person,
7986
+ "notify",
7987
+ "message",
7988
+ "expires_at",
7989
+ "confirm_used_items"
7990
+ ],
7991
+ share_revoke: [...SHARE_MUTATION_IDEMPOTENCY_FIELDS.share_revoke],
7992
+ share_rotate: [...SHARE_MUTATION_IDEMPOTENCY_FIELDS.share_rotate, "rotate_scope"],
7993
+ share_resend_email: [...SHARE_MUTATION_IDEMPOTENCY_FIELDS.share_resend_email],
7994
+ share_owner_link: [...SHARE_ITEM],
7995
+ received_place: [...SHARE_ITEM, "to_workspace_id", "take_out"],
7996
+ received_remove: [...SHARE_ITEM],
7997
+ sent_revoke: ["recipient_ids", "audience_ids"],
7998
+ set_share_settings: [
7999
+ ...SHARE_ITEM,
8000
+ "writers_can_share",
8001
+ "copy_requires_writer_permission",
8002
+ "confirm_revoke_editor_shares"
8003
+ ],
8004
+ transfer_ownership: [...SHARE_ITEM, "new_owner_user_id"],
8005
+ restore_version: [...SHARE_ITEM, "version_id"],
8006
+ comment: [...SHARE_ITEM, "body"],
8007
+ resolve_comment: [...SHARE_ITEM, "comment_id"],
8008
+ label: [...SHARE_ITEM, "label_id", "label_value"],
8009
+ unlabel: [...SHARE_ITEM, "label_id"],
8010
+ create_label: ["name", "color", "field_schema"]
8011
+ }
8012
+ };
8013
+ function buildShareOperations(op) {
8014
+ return [
8015
+ withOutputSchema(op("shares.list", "shares", "List who has access to one Library item of any kind, such as a file, folder or Gem: each person, their role and their link, the general access, and what you may do.", "sharing_query", "item_shares", "read"), libraryCollabOutputSchema),
8016
+ withOutputSchema(op("shares.get", "shares", "Read one share with its people, each person's state and own link.", "sharing_query", "share_get", "read"), libraryCollabOutputSchema),
8017
+ withOutputSchema(op("shares.opens", "shares", "Read who opened a share, when and for how long. Only the person who added that person and the person who made the share see it.", "sharing_query", "share_opens", "read"), libraryCollabOutputSchema),
8018
+ withOutputSchema(op("shares.people_search", "shares", "Search the people of the item's workspace or organization, and your own contacts, to share an item with.", "sharing_query", "share_people_search", "read"), libraryCollabOutputSchema),
8019
+ withOutputSchema(op("shares.audience_people", "shares", "List the people who came in through one workspace or organization level of a share.", "sharing_query", "audience_people", "read"), libraryCollabOutputSchema),
8020
+ withOutputSchema(op("shares.received_list", "shares", "List everything shared with you (received and incoming), one card per item, from every workspace you are in.", "sharing_query", "received_list", "read"), libraryCollabOutputSchema),
8021
+ withOutputSchema(op("shares.received_get", "shares", "Read one item shared with you and every way you can open it.", "sharing_query", "received_get", "read"), libraryCollabOutputSchema),
8022
+ withOutputSchema(op("shares.sent_list", "shares", "List what you shared, one row per person or general access level.", "sharing_query", "sent_list", "read"), libraryCollabOutputSchema),
8023
+ withOutputSchema(op("shares.counts", "shares", "Count the shares that need you and the people you shared with who have not signed up yet.", "sharing_query", "share_counts", "read"), libraryCollabOutputSchema),
8024
+ withOutputSchema(op("shares.send_allowance", "shares", "Read how many more people you can email today.", "sharing_query", "send_allowance", "read"), libraryCollabOutputSchema),
8025
+ withOutputSchema(op("shares.access_requests", "shares", "List pending, verified requests for access to shares you sent.", "sharing_query", "access_requests", "read"), libraryCollabOutputSchema),
8026
+ withOutputSchema(op("shares.link_open", "shares", "Open a share link by its address or key under the link's own gate: its state, item kind and name, your role, the sharer's first name, and its content when it needs no code or passcode. A link that needs a code or passcode answers its gate only: open that one in a browser.", "sharing_query", "link_open", "read"), libraryCollabOutputSchema),
8027
+ withOutputSchema(op("shares.items", "shares", "Share selected Library items with the same people and settings, with a separate result and link for each item.", "library_collab", "share_items", "write"), libraryCollabOutputSchema),
8028
+ withOutputSchema(op("shares.create", "shares", "Share any Library item, such as a file, folder or Gem, with named people such as a client, with general access, or both. Each new person gets their own link and one email unless notify is false. A person who already has access keeps one access, changed to this role and these settings.", "library_collab", "share_create", "write"), libraryCollabOutputSchema),
8029
+ withOutputSchema(op("shares.update", "shares", "Change one share: its name, note, gate, expiry, open notices, download, general access, or a Gem's Version.", "library_collab", "share_update", "write"), libraryCollabOutputSchema),
8030
+ withOutputSchema(op("shares.people_add", "shares", "Name more people on one share, with its role and settings. Each new person gets their own link and one email unless notify is false. A person who already has access moves onto this share.", "library_collab", "share_add_people", "write"), libraryCollabOutputSchema),
8031
+ withOutputSchema(op("shares.people_remove", "shares", "Remove one person from a share. Their link stops working at once.", "library_collab", "share_remove_person", "destructive"), libraryCollabOutputSchema),
8032
+ withOutputSchema(op("shares.people_move", "shares", "Change one person's role on an item in one step, by their row. They keep their link, and their end, note, gate, download and open notices stay. Their other links end.", "library_collab", "share_move_person", "destructive"), libraryCollabOutputSchema),
8033
+ withOutputSchema(op("shares.revoke", "shares", "Revoke one share. Every link it carries stops working at once.", "library_collab", "share_revoke", "destructive"), libraryCollabOutputSchema),
8034
+ withOutputSchema(op("shares.link_rotate", "shares", "Replace a share's general access link, or on a Gem with scope all every person's link too. Each replaced link stops working at once.", "library_collab", "share_rotate", "destructive"), libraryCollabOutputSchema),
8035
+ withOutputSchema(op("shares.email_resend", "shares", "Send one named person their share email again.", "library_collab", "share_resend_email", "write"), libraryCollabOutputSchema),
8036
+ withOutputSchema(op("shares.owner_link", "shares", "Make your own link to a Gem you own, when it is missing, and answer it: one row, yours, with its own key, Version, gate and expiry. It emails nobody and counts no opens.", "library_collab", "share_owner_link", "write"), libraryCollabOutputSchema),
8037
+ withOutputSchema(op("shares.received_place", "shares", "Add or put a file or other item someone shared with you into your Library in one of your workspaces, or take it out. The item itself never moves.", "library_collab", "received_place", "write"), libraryCollabOutputSchema),
8038
+ withOutputSchema(op("shares.received_remove", "shares", "Remove something shared with you: your access ends and its card leaves your list. Access a workspace gives you stays.", "library_collab", "received_remove", "destructive"), libraryCollabOutputSchema),
8039
+ withOutputSchema(op("shares.sent_revoke", "shares", "Close person rows and general access levels you shared, by id.", "library_collab", "sent_revoke", "destructive"), libraryCollabOutputSchema)
8040
+ ];
8041
+ }
8042
+
8043
+ // ../../packages/platform-operations/src/output_schemas_automations.ts
8044
+ var openObjectSchema2 = {
8045
+ type: "object",
8046
+ additionalProperties: true
8047
+ };
8048
+ var automationObjectSchema = {
8049
+ type: "object",
8050
+ additionalProperties: true,
8051
+ properties: {
8052
+ id: { type: "string" },
8053
+ workspaceId: { type: "string" },
8054
+ ownerUserId: { type: "string" },
8055
+ name: { type: "string" },
8056
+ description: { type: ["string", "null"] },
8057
+ status: { type: "string", enum: ["draft", "active", "paused", "archived"] },
8058
+ graphJson: openObjectSchema2,
8059
+ createdAt: { type: "string" },
8060
+ updatedAt: { type: "string" }
8061
+ }
8062
+ };
8063
+ var automationTriggerObjectSchema = {
8064
+ type: "object",
8065
+ additionalProperties: true,
8066
+ properties: {
8067
+ id: { type: "string" },
8068
+ automationId: { type: "string" },
8069
+ type: { type: "string" },
8070
+ config: openObjectSchema2,
8071
+ createdAt: { type: "string" },
8072
+ updatedAt: { type: "string" }
8073
+ }
8074
+ };
8075
+ var automationRunObjectSchema = {
8076
+ type: "object",
8077
+ additionalProperties: true,
8078
+ properties: {
8079
+ id: { type: "string" },
8080
+ automationId: { type: "string" },
8081
+ status: { type: "string" },
8082
+ startedAt: { type: ["string", "null"] },
8083
+ completedAt: { type: ["string", "null"] },
8084
+ metrics: openObjectSchema2
8085
+ }
8086
+ };
8087
+ var automationRunNodeExecutionObjectSchema = {
8088
+ type: "object",
8089
+ additionalProperties: true,
8090
+ properties: {
8091
+ nodeId: { type: "string" },
8092
+ threadId: { type: "string" },
8093
+ runId: { type: "string" },
8094
+ threadStatus: { type: ["string", "null"] },
8095
+ costUsd: { type: ["number", "null"] },
8096
+ finalAnswerExcerpt: { type: ["string", "null"] },
8097
+ outputValid: { type: ["boolean", "null"] },
8098
+ runIndex: { type: ["integer", "null"] },
8099
+ attempt: { type: ["integer", "null"] }
8100
+ }
8101
+ };
8102
+ function requireAtLeastOneOutputProperty(propertyNames) {
8103
+ const returned = propertyNames.map((propertyName) => ({ required: [propertyName] }));
8104
+ return returned;
8105
+ }
8106
+ var automationQueryOutputSchema = {
8107
+ type: "object",
8108
+ additionalProperties: true,
8109
+ properties: {
8110
+ automations: { type: "array", items: automationObjectSchema },
8111
+ automation: automationObjectSchema,
8112
+ valid: { type: "boolean" },
8113
+ mode: { type: "string", enum: ["structural", "contextual"] },
8114
+ findings: { type: "array", items: openObjectSchema2 },
8115
+ success: { type: "boolean" },
8116
+ query: { type: "string" },
8117
+ category: { type: ["string", "null"] },
8118
+ results: { type: "array", items: openObjectSchema2 },
8119
+ error: { type: "string" },
8120
+ message: { type: "string" },
8121
+ evaluation: { type: ["object", "null"], additionalProperties: true },
8122
+ evaluations: { type: "array", items: openObjectSchema2 },
8123
+ issues: { type: "array", items: openObjectSchema2 },
8124
+ rubric: openObjectSchema2,
8125
+ authority: openObjectSchema2,
8126
+ runs: { type: "array", items: automationRunObjectSchema },
8127
+ run: automationRunObjectSchema,
8128
+ logs: { type: "array", items: openObjectSchema2 },
8129
+ recentLogs: { type: "array", items: openObjectSchema2 },
8130
+ nodeExecutions: {
8131
+ type: "array",
8132
+ items: automationRunNodeExecutionObjectSchema
8133
+ },
8134
+ note: { type: "string" },
8135
+ timeline: { type: "array", items: openObjectSchema2 },
8136
+ runId: { type: "string" },
8137
+ source: { type: "string" },
8138
+ triggers: { type: "array", items: openObjectSchema2 },
8139
+ trigger: openObjectSchema2,
8140
+ connections: { type: "array", items: openObjectSchema2 },
8141
+ approvals: { type: "array", items: openObjectSchema2 },
8142
+ rubrics: { type: "array", items: openObjectSchema2 },
8143
+ count: { type: "integer" },
8144
+ view: { type: "string", enum: ["summary", "detailed"] },
8145
+ nextCursor: { type: ["string", "null"] },
8146
+ hasMore: { type: "boolean" },
8147
+ messages: { type: "array", items: openObjectSchema2 },
8148
+ outputFiles: { type: "array", items: openObjectSchema2 },
8149
+ path: { type: "string" },
8150
+ mime: { type: ["string", "null"] },
8151
+ bytes: { type: ["integer", "null"] },
8152
+ content: { type: "string" },
8153
+ truncated: { type: "boolean" }
8154
+ },
8155
+ anyOf: requireAtLeastOneOutputProperty([
8156
+ "automations",
8157
+ "automation",
8158
+ "valid",
8159
+ "success",
8160
+ "results",
8161
+ "evaluation",
8162
+ "evaluations",
8163
+ "issues",
8164
+ "rubric",
8165
+ "authority",
8166
+ "runs",
8167
+ "run",
8168
+ "logs",
8169
+ "recentLogs",
8170
+ "nodeExecutions",
8171
+ "timeline",
8172
+ "source",
8173
+ "triggers",
8174
+ "trigger",
8175
+ "connections",
8176
+ "approvals",
8177
+ "rubrics",
8178
+ "count",
8179
+ "messages",
8180
+ "content"
8181
+ ])
8182
+ };
8183
+ var destructiveReceiptRequestSchema = {
8184
+ type: "object",
8185
+ properties: {
8186
+ issuerType: { const: "mcp_elicitation" },
8187
+ audience: { const: "uru:destructive-confirmation" },
8188
+ clientId: { type: "string" },
8189
+ actorSubjectDigest: { type: "string" },
8190
+ authenticationContextDigest: { type: "string" },
8191
+ workspaceId: { type: "string", format: "uuid" },
8192
+ challengeId: { type: "string", format: "uuid" },
8193
+ impactDigest: { type: "string" },
8194
+ operation: { type: "string" },
8195
+ targetId: { type: "string" },
8196
+ parentTargetId: { type: ["string", "null"] },
8197
+ expectedRevision: { type: "string" },
8198
+ summary: { type: "string" },
8199
+ expiresAt: { type: "string", format: "date-time" }
8200
+ },
8201
+ required: [
8202
+ "issuerType",
8203
+ "audience",
8204
+ "clientId",
8205
+ "actorSubjectDigest",
8206
+ "authenticationContextDigest",
8207
+ "workspaceId",
8208
+ "challengeId",
8209
+ "impactDigest",
8210
+ "operation",
8211
+ "targetId",
8212
+ "parentTargetId",
8213
+ "expectedRevision",
8214
+ "summary",
8215
+ "expiresAt"
8216
+ ]
8217
+ };
8218
+ var webhookCredentialRotationOutputProperties = {
8219
+ trigger_id: { type: "string", minLength: 1 },
8220
+ credential_version: { type: "integer", minimum: 1 },
8221
+ credential_state: {
8222
+ type: "string",
8223
+ enum: [
8224
+ "pending_reveal",
8225
+ "pending_activation",
8226
+ "active",
8227
+ "grace",
8228
+ "revoked",
8229
+ "expired"
8230
+ ]
8231
+ },
8232
+ reveal_state: { type: "string", minLength: 1 },
8233
+ setup_state: { type: "string", minLength: 1 },
8234
+ setup_action_id: { type: "string", minLength: 1 },
8235
+ trigger_version: { type: "integer", minimum: 1 },
8236
+ expires_at: { type: "string", format: "date-time" },
8237
+ listening: { type: "boolean" },
8238
+ signing_secret_source: { type: "string", enum: ["uru_generated", "sender"] },
8239
+ signature_scheme: { type: "string", enum: ["hmac_sha256_hex", "standard_webhooks"] },
8240
+ secret_returned: { const: false }
8241
+ };
8242
+ var webhookCredentialRotationOutputSchema = {
8243
+ type: "object",
8244
+ additionalProperties: true,
8245
+ required: [
8246
+ "trigger_id",
8247
+ "credential_version",
8248
+ "credential_state",
8249
+ "reveal_state",
8250
+ "setup_state",
8251
+ "setup_action_id",
8252
+ "trigger_version",
8253
+ "expires_at",
8254
+ "listening",
8255
+ "signing_secret_source",
8256
+ "signature_scheme",
8257
+ "secret_returned"
8258
+ ],
8259
+ properties: webhookCredentialRotationOutputProperties
8260
+ };
8261
+ var webhookTestDeliveryOutputProperties = {
8262
+ credentialVersion: { type: "integer", minimum: 1 },
8263
+ activated: { type: "boolean" },
8264
+ graceExpiresAt: { type: ["string", "null"] },
8265
+ outcome: {
8266
+ type: "object",
8267
+ additionalProperties: true,
8268
+ required: ["kind"],
8269
+ properties: {
8270
+ kind: {
8271
+ type: "string",
8272
+ enum: [
8273
+ "run_started",
8274
+ "run_start_failed",
8275
+ "not_run",
8276
+ "duplicate",
8277
+ "throttled",
8278
+ "ignored",
8279
+ "unavailable"
8280
+ ]
8281
+ },
8282
+ runId: { type: "string" },
8283
+ runStatus: { type: "string" },
8284
+ reason: { type: "string" },
8285
+ retryAfterSeconds: { type: ["integer", "null"] }
8286
+ }
8287
+ }
8288
+ };
8289
+ var webhookTestDeliveryOutputSchema = {
8290
+ type: "object",
8291
+ additionalProperties: true,
8292
+ required: ["credentialVersion", "activated", "listening", "graceExpiresAt", "outcome"],
8293
+ properties: {
8294
+ ...webhookTestDeliveryOutputProperties,
8295
+ listening: { type: "boolean" }
8296
+ }
8297
+ };
8298
+ var automationOutputSchema = {
8299
+ type: "object",
8300
+ additionalProperties: true,
8301
+ properties: {
8302
+ automation: automationObjectSchema,
8303
+ run: automationRunObjectSchema,
8304
+ trigger: automationTriggerObjectSchema,
8305
+ id: { type: "string" },
8306
+ runId: { type: "string" },
8307
+ status: { type: "string" },
8308
+ success: { type: "boolean" },
8309
+ ok: { type: "boolean" },
8310
+ deleted: { type: "boolean" },
8311
+ automationId: { type: "string" },
8312
+ authority: openObjectSchema2,
8313
+ idempotentReplay: { type: "boolean" },
8314
+ count: { type: "integer" },
8315
+ updated: { type: "boolean" },
8316
+ streamUrl: { type: "string" },
8317
+ resumeUrl: { type: "string" },
8318
+ cancelUrl: { type: "string" },
8319
+ statusUrl: { type: "string" },
8320
+ approvalId: { type: "string" },
8321
+ applied: { type: "boolean" },
8322
+ changes: { type: "array", items: openObjectSchema2 },
8323
+ previewToken: { type: "string" },
8324
+ confirmationChallengeId: { type: "string", format: "uuid" },
8325
+ impactDigest: { type: "string" },
8326
+ summary: { type: "string" },
8327
+ expiresAt: { type: "string", format: "date-time" },
8328
+ receiptRequest: destructiveReceiptRequestSchema,
8329
+ result: openObjectSchema2,
8330
+ warnings: { type: "array", items: openObjectSchema2 },
8331
+ ...webhookCredentialRotationOutputProperties,
8332
+ ...webhookTestDeliveryOutputProperties
8333
+ },
8334
+ anyOf: [
8335
+ ...requireAtLeastOneOutputProperty([
8336
+ "automation",
8337
+ "run",
8338
+ "trigger",
8339
+ "id",
8340
+ "runId",
8341
+ "status",
8342
+ "success",
8343
+ "ok",
8344
+ "deleted",
8345
+ "automationId",
8346
+ "authority",
8347
+ "count",
8348
+ "updated",
8349
+ "streamUrl",
8350
+ "approvalId",
8351
+ "previewToken",
8352
+ "confirmationChallengeId",
8353
+ "result"
8354
+ ]),
8355
+ webhookCredentialRotationOutputSchema,
8356
+ webhookTestDeliveryOutputSchema
8357
+ ]
8358
+ };
8359
+
8360
+ // ../../packages/types/src/home-timeline.ts
8361
+ var HOME_TIMELINE_MINUTES_PER_DAY = 24 * 60;
8362
+ var HOME_TIMELINE_TARGET_TYPES = [
8363
+ "gem",
8364
+ "dataset",
8365
+ "automation",
8366
+ "file",
8367
+ "persona",
8368
+ "folder"
8369
+ ];
8370
+ var HOME_TIMELINE_MAX_RULES = 100;
8371
+ var HOME_TIMELINE_MAX_TIMEZONE_LENGTH = 64;
8372
+ var HOME_TIMELINE_MAX_CALENDAR_ID_LENGTH = 512;
8373
+ var HOME_TIMELINE_MAX_MATCH_TEXT_LENGTH = 256;
8374
+ var HOME_TIMELINE_MAX_CALENDAR_TEXT_LENGTH = 16384;
8375
+ var HOME_TIMELINE_MAX_CALENDAR_EVENTS = 500;
8376
+ var HOME_TIMELINE_MAX_CALENDAR_ATTENDEES = 100;
8377
+ var HOME_TIMELINE_MAX_CALENDAR_PREVIEW_HOURS = 24 * 7;
8378
+ var HOME_TIMELINE_MAX_DAY_SPAN_MS = 48 * 60 * 60 * 1000;
8379
+ var HOME_TIMELINE_TARGET_ACCEPTED_IDS = "any id the Library shows for it: id, targetItemId, resourceId, or executionResourceId (the id of a Library shortcut to it works too)";
8380
+
8381
+ // ../../packages/platform-operations/src/output_schemas_home_timeline.ts
8382
+ function snakeToCamel(key) {
8383
+ return key.replace(/_([a-z0-9])/g, (_match, letter) => letter.toUpperCase());
8384
+ }
8385
+ function isSchemaList(value) {
8386
+ return Array.isArray(value);
8387
+ }
8388
+ function toWireValue(value) {
8389
+ if (value === null || typeof value !== "object") {
8390
+ return value;
8391
+ }
8392
+ if (isSchemaList(value)) {
8393
+ return value.map(toWireValue);
8394
+ }
8395
+ return wireOutputSchema(value);
8396
+ }
8397
+ function wireOutputSchema(schema) {
8398
+ const output = {};
8399
+ for (const [key, child] of Object.entries(schema)) {
8400
+ if (key === "additionalProperties" && child === false) {
8401
+ continue;
8402
+ }
8403
+ if (key === "properties" && child !== null && typeof child === "object" && !isSchemaList(child)) {
8404
+ const properties = {};
8405
+ for (const [propertyKey, propertySchema] of Object.entries(child)) {
8406
+ properties[snakeToCamel(propertyKey)] = toWireValue(propertySchema);
8407
+ }
8408
+ output["properties"] = properties;
8409
+ continue;
8410
+ }
8411
+ if (key === "required" && isSchemaList(child)) {
8412
+ output["required"] = child.map((entry) => typeof entry === "string" ? snakeToCamel(entry) : toWireValue(entry));
8413
+ continue;
8414
+ }
8415
+ output[key] = toWireValue(child);
8416
+ }
8417
+ const returned = output;
8418
+ return returned;
8419
+ }
8420
+ var uuidSchema = { type: "string", format: "uuid" };
8421
+ var homeTimelineTimestampSchema = {
8422
+ type: "string",
8423
+ format: "date-time",
8424
+ pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:Z|\\+00:00)$"
8425
+ };
8426
+ var homeTimelineTargetSchema = {
8427
+ type: "object",
8428
+ additionalProperties: false,
8429
+ properties: {
8430
+ type: { type: "string", enum: [...HOME_TIMELINE_TARGET_TYPES] },
8431
+ id: {
8432
+ ...uuidSchema,
8433
+ description: `The target's id. Accepts ${HOME_TIMELINE_TARGET_ACCEPTED_IDS}. A rule stores the target's resource id.`
8434
+ }
8435
+ },
8436
+ required: ["type", "id"]
8437
+ };
8438
+ var weeklyConditionSchema = {
8439
+ type: "object",
8440
+ additionalProperties: false,
8441
+ properties: {
8442
+ type: { const: "weekly" },
8443
+ weekdays: {
8444
+ type: "array",
8445
+ items: { type: "integer", minimum: 0, maximum: 6 },
8446
+ minItems: 1,
8447
+ maxItems: 7,
8448
+ uniqueItems: true
8449
+ },
8450
+ start_time: {
8451
+ type: ["string", "null"],
8452
+ pattern: "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
8453
+ },
8454
+ end_time: {
8455
+ type: ["string", "null"],
8456
+ pattern: "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$|^24:00$"
8457
+ }
8458
+ },
8459
+ required: ["type", "weekdays", "start_time", "end_time"]
8460
+ };
8461
+ var calendarConditionSchema = {
8462
+ type: "object",
8463
+ additionalProperties: false,
8464
+ properties: {
8465
+ type: { const: "calendar_event" },
8466
+ calendar_connection_id: {
8467
+ type: "string",
8468
+ minLength: 1,
8469
+ maxLength: HOME_TIMELINE_MAX_CALENDAR_ID_LENGTH
8470
+ },
8471
+ calendar_id: {
8472
+ type: ["string", "null"],
8473
+ minLength: 1,
8474
+ maxLength: HOME_TIMELINE_MAX_CALENDAR_ID_LENGTH
8475
+ },
8476
+ match: {
8477
+ oneOf: [
8478
+ {
8479
+ type: "object",
8480
+ additionalProperties: false,
8481
+ properties: { mode: { const: "any" } },
8482
+ required: ["mode"]
8483
+ },
8484
+ {
8485
+ type: "object",
8486
+ additionalProperties: false,
8487
+ properties: {
8488
+ mode: { const: "text" },
8489
+ text: {
8490
+ type: "string",
8491
+ minLength: 1,
8492
+ maxLength: HOME_TIMELINE_MAX_MATCH_TEXT_LENGTH
8493
+ }
8494
+ },
8495
+ required: ["mode", "text"]
8496
+ },
8497
+ {
8498
+ type: "object",
8499
+ additionalProperties: false,
8500
+ properties: {
8501
+ mode: { const: "event" },
8502
+ event_id: {
8503
+ type: "string",
8504
+ minLength: 1,
8505
+ maxLength: HOME_TIMELINE_MAX_CALENDAR_ID_LENGTH
8506
+ }
8507
+ },
8508
+ required: ["mode", "event_id"]
8509
+ }
8510
+ ]
8511
+ }
8512
+ },
8513
+ required: ["type", "calendar_connection_id", "match"]
8514
+ };
8515
+ var fallbackConditionSchema = {
8516
+ type: "object",
8517
+ additionalProperties: false,
8518
+ properties: { type: { const: "fallback" } },
8519
+ required: ["type"]
8520
+ };
8521
+ var homeTimelineConditionSchema = {
8522
+ oneOf: [weeklyConditionSchema, calendarConditionSchema, fallbackConditionSchema]
8523
+ };
8524
+ var timelineRuleSchema = {
8525
+ type: "object",
8526
+ additionalProperties: false,
8527
+ properties: {
8528
+ id: uuidSchema,
8529
+ position: { type: "integer", minimum: 0 },
8530
+ enabled: { type: "boolean" },
8531
+ timezone: {
8532
+ type: "string",
8533
+ minLength: 1,
8534
+ maxLength: HOME_TIMELINE_MAX_TIMEZONE_LENGTH
8535
+ },
8536
+ target: homeTimelineTargetSchema,
8537
+ condition: homeTimelineConditionSchema,
8538
+ created_at: homeTimelineTimestampSchema,
8539
+ updated_at: homeTimelineTimestampSchema
8540
+ },
8541
+ required: [
8542
+ "id",
8543
+ "position",
8544
+ "enabled",
8545
+ "timezone",
8546
+ "target",
8547
+ "condition",
8548
+ "created_at",
8549
+ "updated_at"
8550
+ ]
8551
+ };
8552
+ var unavailableRuleSchema = {
8553
+ type: "object",
8554
+ additionalProperties: false,
8555
+ properties: {
8556
+ id: uuidSchema,
8557
+ position: { type: "integer", minimum: 0 },
8558
+ enabled: { type: "boolean" },
8559
+ updated_at: homeTimelineTimestampSchema
8560
+ },
8561
+ required: ["id", "position", "enabled", "updated_at"]
8562
+ };
8563
+ var eventSchema = {
8564
+ type: "object",
8565
+ additionalProperties: false,
8566
+ properties: {
8567
+ id: {
8568
+ type: "string",
8569
+ minLength: 1,
8570
+ maxLength: HOME_TIMELINE_MAX_CALENDAR_ID_LENGTH
8571
+ },
8572
+ calendar_id: {
8573
+ type: ["string", "null"],
8574
+ minLength: 1,
8575
+ maxLength: HOME_TIMELINE_MAX_CALENDAR_ID_LENGTH
8576
+ },
8577
+ summary: { type: "string", maxLength: HOME_TIMELINE_MAX_CALENDAR_TEXT_LENGTH },
8578
+ description: {
8579
+ type: "string",
8580
+ maxLength: HOME_TIMELINE_MAX_CALENDAR_TEXT_LENGTH
8581
+ },
8582
+ location: { type: "string", maxLength: HOME_TIMELINE_MAX_CALENDAR_TEXT_LENGTH },
8583
+ start_at: homeTimelineTimestampSchema,
8584
+ end_at: homeTimelineTimestampSchema,
8585
+ all_day: { type: "boolean" },
8586
+ attendees: {
8587
+ type: "array",
8588
+ maxItems: HOME_TIMELINE_MAX_CALENDAR_ATTENDEES,
8589
+ items: {
8590
+ type: "object",
8591
+ additionalProperties: false,
8592
+ properties: {
8593
+ display_name: {
8594
+ type: ["string", "null"],
8595
+ maxLength: HOME_TIMELINE_MAX_CALENDAR_ID_LENGTH
8596
+ },
8597
+ email: {
8598
+ type: ["string", "null"],
8599
+ maxLength: HOME_TIMELINE_MAX_CALENDAR_ID_LENGTH
8600
+ }
8601
+ },
8602
+ required: ["display_name", "email"]
8603
+ }
8604
+ },
8605
+ organizer: {
8606
+ oneOf: [
8607
+ {
8608
+ type: "object",
8609
+ additionalProperties: false,
8610
+ properties: {
8611
+ display_name: {
8612
+ type: ["string", "null"],
8613
+ maxLength: HOME_TIMELINE_MAX_CALENDAR_ID_LENGTH
8614
+ },
8615
+ email: {
8616
+ type: ["string", "null"],
8617
+ maxLength: HOME_TIMELINE_MAX_CALENDAR_ID_LENGTH
8618
+ }
8619
+ },
8620
+ required: ["display_name", "email"]
8621
+ },
8622
+ { type: "null" }
8623
+ ]
8624
+ }
8625
+ },
8626
+ required: [
8627
+ "id",
8628
+ "calendar_id",
8629
+ "summary",
8630
+ "description",
8631
+ "location",
8632
+ "start_at",
8633
+ "end_at",
8634
+ "all_day",
8635
+ "attendees",
8636
+ "organizer"
8637
+ ]
8638
+ };
8639
+ var currentEventSchema = {
8640
+ type: "object",
8641
+ additionalProperties: false,
8642
+ properties: {
8643
+ id: {
8644
+ type: "string",
8645
+ minLength: 1,
8646
+ maxLength: HOME_TIMELINE_MAX_CALENDAR_ID_LENGTH
8647
+ },
8648
+ calendar_id: {
8649
+ type: "string",
8650
+ minLength: 1,
8651
+ maxLength: HOME_TIMELINE_MAX_CALENDAR_ID_LENGTH
8652
+ },
8653
+ summary: { type: "string", maxLength: HOME_TIMELINE_MAX_CALENDAR_TEXT_LENGTH },
8654
+ start_at: homeTimelineTimestampSchema,
8655
+ end_at: homeTimelineTimestampSchema,
8656
+ all_day: { type: "boolean" }
8657
+ },
8658
+ required: ["id", "calendar_id", "summary", "start_at", "end_at", "all_day"]
8659
+ };
8660
+ var slotSchema = {
8661
+ type: "object",
8662
+ additionalProperties: false,
8663
+ properties: {
8664
+ rule_id: uuidSchema,
8665
+ target: homeTimelineTargetSchema,
8666
+ timezone: {
8667
+ type: "string",
8668
+ minLength: 1,
8669
+ maxLength: HOME_TIMELINE_MAX_TIMEZONE_LENGTH
8670
+ },
8671
+ starts_at: homeTimelineTimestampSchema,
8672
+ ends_at: homeTimelineTimestampSchema,
8673
+ condition: {
8674
+ oneOf: [
8675
+ weeklyConditionSchema,
8676
+ {
8677
+ type: "object",
8678
+ additionalProperties: false,
8679
+ properties: { type: { const: "calendar_event" } },
8680
+ required: ["type"]
8681
+ },
8682
+ {
8683
+ type: "object",
8684
+ additionalProperties: false,
8685
+ properties: { type: { const: "fallback" } },
8686
+ required: ["type"]
8687
+ }
8688
+ ]
8689
+ },
8690
+ event: { oneOf: [currentEventSchema, { type: "null" }] },
8691
+ workspace_id: uuidSchema,
8692
+ title: { type: "string" },
8693
+ kind: { type: "string", enum: [...HOME_TIMELINE_TARGET_TYPES] },
8694
+ thumbnail: { type: ["string", "null"] },
8695
+ version_label: { type: ["string", "null"] },
8696
+ changed_at: { oneOf: [homeTimelineTimestampSchema, { type: "null" }] }
8697
+ },
8698
+ required: [
8699
+ "rule_id",
8700
+ "target",
8701
+ "timezone",
8702
+ "starts_at",
8703
+ "ends_at",
8704
+ "condition",
8705
+ "event",
8706
+ "workspace_id",
8707
+ "title",
8708
+ "kind",
8709
+ "thumbnail",
8710
+ "version_label",
8711
+ "changed_at"
8712
+ ]
8713
+ };
8714
+ var homeNoticeScopeSchema = { type: "string", enum: ["organization", "workspace"] };
8715
+ var homeNoticeTimestampSchema = { type: "string", format: "date-time" };
8716
+ var homeNoticeNullableTimestampSchema = { anyOf: [homeNoticeTimestampSchema, { type: "null" }] };
8717
+ var noticeSchema = {
8718
+ type: "object",
8719
+ additionalProperties: false,
8720
+ properties: {
8721
+ id: uuidSchema,
8722
+ scope: homeNoticeScopeSchema,
8723
+ title: { type: "string" },
8724
+ body: { type: "string" },
8725
+ required: { type: "boolean" },
8726
+ starts_at: homeNoticeTimestampSchema,
8727
+ ends_at: homeNoticeNullableTimestampSchema,
8728
+ created_at: homeNoticeTimestampSchema,
8729
+ read_at: homeNoticeNullableTimestampSchema
8730
+ },
8731
+ required: ["id", "scope", "title", "body", "required", "starts_at", "ends_at", "created_at", "read_at"]
8732
+ };
8733
+ var managedNoticeSchema = {
8734
+ type: "object",
8735
+ additionalProperties: false,
8736
+ properties: {
8737
+ id: uuidSchema,
8738
+ scope: homeNoticeScopeSchema,
8739
+ title: { type: "string" },
8740
+ body: { type: "string" },
8741
+ required: { type: "boolean" },
8742
+ starts_at: homeNoticeTimestampSchema,
8743
+ ends_at: homeNoticeNullableTimestampSchema,
8744
+ created_at: homeNoticeTimestampSchema,
8745
+ status: { type: "string", enum: ["scheduled", "live", "ended"] }
8746
+ },
8747
+ required: ["id", "scope", "title", "body", "required", "starts_at", "ends_at", "created_at", "status"]
8748
+ };
8749
+ var homeTimelineQueryOutputSchema = wireOutputSchema({
8750
+ type: "object",
8751
+ properties: {
8752
+ rules: {
8753
+ type: "array",
8754
+ items: timelineRuleSchema,
8755
+ maxItems: HOME_TIMELINE_MAX_RULES
8756
+ },
8757
+ unavailable_rules: {
8758
+ type: "array",
8759
+ items: unavailableRuleSchema,
8760
+ maxItems: HOME_TIMELINE_MAX_RULES
8761
+ },
8762
+ slots: {
8763
+ type: "array",
8764
+ items: slotSchema,
8765
+ maxItems: HOME_TIMELINE_MAX_RULES
8766
+ },
8767
+ unresolved_rules: {
8768
+ type: "array",
8769
+ maxItems: HOME_TIMELINE_MAX_RULES,
8770
+ items: { type: "object" }
8771
+ },
8772
+ day_starts_at: homeTimelineTimestampSchema,
8773
+ day_ends_at: homeTimelineTimestampSchema,
8774
+ events: {
8775
+ type: "array",
8776
+ items: eventSchema,
8777
+ maxItems: HOME_TIMELINE_MAX_CALENDAR_EVENTS
8778
+ },
8779
+ account_label: {
8780
+ type: ["string", "null"],
8781
+ maxLength: HOME_TIMELINE_MAX_CALENDAR_ID_LENGTH
8782
+ }
8783
+ },
8784
+ oneOf: [
8785
+ {
8786
+ type: "object",
8787
+ additionalProperties: false,
8788
+ properties: {
8789
+ rules: {
8790
+ type: "array",
8791
+ items: timelineRuleSchema,
8792
+ maxItems: HOME_TIMELINE_MAX_RULES
8793
+ },
8794
+ unavailable_rules: {
8795
+ type: "array",
8796
+ items: unavailableRuleSchema,
8797
+ maxItems: HOME_TIMELINE_MAX_RULES
8798
+ }
8799
+ },
8800
+ required: ["rules", "unavailable_rules"]
8801
+ },
8802
+ {
8803
+ type: "object",
8804
+ additionalProperties: false,
8805
+ properties: {
8806
+ slots: {
8807
+ type: "array",
8808
+ items: slotSchema,
8809
+ maxItems: HOME_TIMELINE_MAX_RULES
8810
+ },
8811
+ unavailable_rules: {
8812
+ type: "array",
8813
+ items: unavailableRuleSchema,
8814
+ maxItems: HOME_TIMELINE_MAX_RULES
8815
+ },
8816
+ unresolved_rules: {
8817
+ type: "array",
8818
+ maxItems: HOME_TIMELINE_MAX_RULES,
8819
+ items: {
8820
+ type: "object",
8821
+ additionalProperties: false,
8822
+ properties: {
8823
+ id: uuidSchema,
8824
+ position: { type: "integer", minimum: 0 },
8825
+ enabled: { type: "boolean" },
8826
+ updated_at: homeTimelineTimestampSchema,
8827
+ reason: {
8828
+ type: "string",
8829
+ enum: [
8830
+ "calendar_not_authorized",
8831
+ "calendar_unavailable",
8832
+ "calendar_window_too_large",
8833
+ "invalid_timezone"
8834
+ ]
8835
+ }
8836
+ },
8837
+ required: ["id", "position", "enabled", "reason", "updated_at"]
8838
+ }
8839
+ },
8840
+ day_starts_at: homeTimelineTimestampSchema,
8841
+ day_ends_at: homeTimelineTimestampSchema
8842
+ },
8843
+ required: [
8844
+ "slots",
8845
+ "unavailable_rules",
8846
+ "unresolved_rules",
8847
+ "day_starts_at",
8848
+ "day_ends_at"
8849
+ ]
8850
+ },
8851
+ {
8852
+ type: "object",
8853
+ additionalProperties: false,
8854
+ properties: {
8855
+ events: {
8856
+ type: "array",
8857
+ items: eventSchema,
8858
+ maxItems: HOME_TIMELINE_MAX_CALENDAR_EVENTS
8859
+ },
8860
+ account_label: {
8861
+ type: ["string", "null"],
8862
+ maxLength: HOME_TIMELINE_MAX_CALENDAR_ID_LENGTH
8863
+ }
8864
+ },
8865
+ required: ["events", "account_label"]
8866
+ }
8867
+ ]
8868
+ });
8869
+ var homeTimelineManageOutputSchema = wireOutputSchema({
8870
+ type: "object",
8871
+ properties: {
8872
+ rule: timelineRuleSchema,
8873
+ status: { type: "string", enum: ["created", "already_present"] },
8874
+ deleted: { const: true },
8875
+ rule_id: uuidSchema,
8876
+ rules: {
8877
+ type: "array",
8878
+ items: timelineRuleSchema,
8879
+ maxItems: HOME_TIMELINE_MAX_RULES
8880
+ }
8881
+ },
8882
+ oneOf: [
8883
+ {
8884
+ type: "object",
8885
+ additionalProperties: false,
8886
+ properties: {
8887
+ rules: {
8888
+ type: "array",
8889
+ items: timelineRuleSchema,
8890
+ maxItems: HOME_TIMELINE_MAX_RULES
8891
+ }
8892
+ },
8893
+ required: ["rules"]
8894
+ },
8895
+ {
8896
+ type: "object",
8897
+ additionalProperties: false,
8898
+ properties: {
8899
+ rule: timelineRuleSchema,
8900
+ status: { type: "string", enum: ["created", "already_present"] }
8901
+ },
8902
+ required: ["rule"]
8903
+ },
8904
+ {
8905
+ type: "object",
8906
+ additionalProperties: false,
8907
+ properties: { deleted: { const: true }, rule_id: uuidSchema },
8908
+ required: ["deleted", "rule_id"]
8909
+ }
8910
+ ]
8911
+ });
8912
+ var homeNoticesQueryOutputSchema = wireOutputSchema({
8913
+ type: "object",
8914
+ properties: {
8915
+ notices: { type: "array", items: { anyOf: [noticeSchema, managedNoticeSchema] } },
8916
+ can_post: { type: "boolean" },
8917
+ can_post_organization: { type: "boolean" }
8918
+ },
8919
+ required: ["notices", "can_post_organization"]
8920
+ });
8921
+ var homeNoticesManageOutputSchema = wireOutputSchema({
8922
+ type: "object",
8923
+ properties: {
8924
+ notice: { anyOf: [noticeSchema, managedNoticeSchema] },
8925
+ dismissed: { const: true },
8926
+ deleted: { const: true },
8927
+ notice_id: uuidSchema
8928
+ }
8929
+ });
8930
+
8931
+ // ../../packages/platform-operations/src/output_schemas_datasets.ts
8932
+ var openObject6 = { type: "object", additionalProperties: true };
8933
+ var datasetResultOutputSchema = {
8934
+ type: "object",
8935
+ additionalProperties: true,
8936
+ properties: { result: {} }
8937
+ };
8938
+ var datasetExternalSourceGetOutputSchema = {
8939
+ anyOf: [datasetResultOutputSchema, { type: "null" }],
8940
+ description: "The external source binding, or null when none is configured."
8941
+ };
8942
+ var datasetRowOutput = {
8943
+ type: "object",
8944
+ additionalProperties: false,
8945
+ properties: {
8946
+ row_id: { type: "string" },
8947
+ fields: openObject6,
8948
+ deleted: { type: "boolean" }
8949
+ },
8950
+ required: ["row_id", "fields"]
8951
+ };
8952
+ var datasetQueryOutputSchema = {
8953
+ type: "object",
8954
+ additionalProperties: true,
8955
+ properties: {
8956
+ rows: { type: "array", items: datasetRowOutput },
8957
+ total: { anyOf: [{ type: "integer" }, { type: "null" }] },
8958
+ limit: { type: "integer" },
8959
+ has_more: { type: "boolean" },
8960
+ next_cursor: { anyOf: [{ type: "string" }, { type: "null" }] },
8961
+ source_meta: {
8962
+ anyOf: [openObject6, { type: "null" }]
8963
+ }
8964
+ },
8965
+ required: ["rows", "limit", "has_more", "next_cursor"]
8966
+ };
8967
+
8968
+ // ../../packages/platform-operations/src/workspace_selection.ts
8969
+ var WORKSPACE_SELECTION_TOOL_IDS = new Set([
8970
+ "LIST_WORKSPACES"
8971
+ ]);
8972
+ var PERSON_SCOPED_TOOL_IDS = new Set([
8973
+ "HOME_LAYOUT_QUERY",
8974
+ "HOME_LAYOUT_MANAGE",
8975
+ "HOME_WORKSPACES_QUERY",
8976
+ "HOME_WORKSPACES_MANAGE",
8977
+ "HOME_ACTIVITY_QUERY",
8978
+ "HOME_ACTIVITY_MANAGE"
8979
+ ]);
8980
+ var LIST_WORKSPACES_ORGANIZATION_KINDS = ["starter", "organization"];
8981
+ var LIST_WORKSPACES_ACCESS_MODES = [
8982
+ "open",
8983
+ "ask_to_join",
8984
+ "invite_only",
8985
+ "hidden"
8986
+ ];
8987
+ var LIST_WORKSPACES_TOOL_DESCRIPTOR = {
8988
+ name: "list_workspaces",
8989
+ description: "List the workspaces you can name in workspace_id.",
8990
+ inputSchema: {
8991
+ type: "object",
8992
+ properties: {},
8993
+ additionalProperties: false
8994
+ },
8995
+ outputSchema: {
8996
+ type: "object",
8997
+ additionalProperties: true,
8998
+ required: ["success", "workspaces", "count"],
8999
+ properties: {
9000
+ success: { type: "boolean" },
9001
+ workspaces: {
9002
+ type: "array",
9003
+ items: {
9004
+ type: "object",
9005
+ additionalProperties: true,
9006
+ properties: {
9007
+ id: { type: "string" },
9008
+ name: { type: "string" },
9009
+ description: { type: "string" },
9010
+ role: { type: "string" },
9011
+ joinedAt: { type: "string" },
9012
+ isActive: { type: "boolean" },
9013
+ kind: { type: "string", enum: ["personal", "organization"] },
9014
+ slug: { type: ["string", "null"] },
9015
+ organizationId: { type: "string" },
9016
+ organizationName: { type: "string" },
9017
+ organizationSlug: { type: "string" },
9018
+ organizationKind: {
9019
+ type: "string",
9020
+ enum: [...LIST_WORKSPACES_ORGANIZATION_KINDS]
9021
+ },
9022
+ organizationIsViewerStarter: { type: "boolean" },
9023
+ accessMode: { type: "string", enum: [...LIST_WORKSPACES_ACCESS_MODES] }
9024
+ }
9025
+ }
9026
+ },
9027
+ count: { type: "integer" },
9028
+ message: { type: "string" },
9029
+ error: { type: "string" }
9030
+ }
9031
+ }
9032
+ };
9033
+
9034
+ // ../../packages/platform-operations/src/operation_groups.ts
9035
+ var LIBRARY_ITEM = ["path", "item_id"];
9036
+ var LIBRARY_TEXT_WITNESS = ["base_source_revision_id", "base_source_hash", "change_summary"];
9037
+ var AUTOMATION_TARGET = ["automation_id", "item_id", "path"];
9038
+ var LIBRARY_OPERATION_INPUT_FIELDS = {
9039
+ library_query: {
9040
+ ls: [...LIBRARY_ITEM, "resource_type", "recursive", "include_trashed", "limit", "cursor"],
9041
+ stat: [...LIBRARY_ITEM, "include_trashed", "include_metadata"],
9042
+ read: [...LIBRARY_ITEM, "resource_type", "limit", "offset"],
9043
+ search: ["query", "path", "resource_type", "include_trashed", "limit", "cursor"],
9044
+ patch_preview: [...LIBRARY_ITEM, "resource_type", "patch"],
9045
+ skill_history: [...LIBRARY_ITEM, "cursor"],
9046
+ skill_version: [...LIBRARY_ITEM, "version", "file_path", "limit", "offset"],
9047
+ skill_inventory: []
9048
+ },
9049
+ library_fs: {
9050
+ mkdir: ["path", "recursive"],
9051
+ write: [
9052
+ ...LIBRARY_ITEM,
9053
+ "resource_type",
9054
+ "content",
9055
+ "content_base64",
9056
+ "create",
9057
+ "folder_id",
9058
+ ...LIBRARY_TEXT_WITNESS
9059
+ ],
9060
+ patch: [...LIBRARY_ITEM, "resource_type", "patch", ...LIBRARY_TEXT_WITNESS],
9061
+ save_skill: [
9062
+ ...LIBRARY_ITEM,
9063
+ "files",
9064
+ "delete_paths",
9065
+ "title",
9066
+ "name",
9067
+ "description",
9068
+ "inputs",
9069
+ "base_digest",
9070
+ "create",
9071
+ "folder_id"
9072
+ ],
9073
+ restore_skill_version: [...LIBRARY_ITEM, "version", "base_digest"],
9074
+ turn_into_skill: [
9075
+ ...LIBRARY_ITEM,
9076
+ "name",
9077
+ "description",
9078
+ "base_source_revision_id",
9079
+ "people_who_can_open",
9080
+ "linked_agents"
9081
+ ],
9082
+ import: ["path", "files", "title", "dry_run"],
9083
+ cp: [...LIBRARY_ITEM, "target_path"],
9084
+ mv: [...LIBRARY_ITEM, "target_path", "confirmation_token"],
9085
+ move_workspace: [
9086
+ ...LIBRARY_ITEM,
9087
+ "target_workspace_id",
9088
+ "target_parent_folder_id",
9089
+ "share_with_target_workspace",
9090
+ "target_workspace_role"
9091
+ ],
9092
+ rm: [...LIBRARY_ITEM, "recursive", "permanent"],
9093
+ restore: [...LIBRARY_ITEM],
9094
+ empty_trash: ["path"],
9095
+ favorite: [...LIBRARY_ITEM],
9096
+ unfavorite: [...LIBRARY_ITEM]
9097
+ },
9098
+ library_upload: {
9099
+ preflight: [...LIBRARY_ITEM, "parent_folder_id", "relative_path", "conflict", "filename"],
9100
+ create_session: [
9101
+ ...LIBRARY_ITEM,
9102
+ "parent_folder_id",
9103
+ "relative_path",
9104
+ "conflict",
9105
+ "filename",
9106
+ "size_bytes",
9107
+ "mime_type",
9108
+ "sha256"
9109
+ ],
9110
+ complete_session: [
9111
+ ...LIBRARY_ITEM,
9112
+ "parent_folder_id",
9113
+ "relative_path",
9114
+ "conflict",
9115
+ "upload_id",
9116
+ "bucket",
9117
+ "object_path",
9118
+ "filename",
9119
+ "size_bytes",
9120
+ "mime_type",
9121
+ "sha256"
9122
+ ]
9123
+ },
9124
+ automation_query: {
9125
+ list: ["status_filter", "parent_folder_id", "audience", "view", "limit", "cursor"],
9126
+ get: [...AUTOMATION_TARGET],
9127
+ validate: [...AUTOMATION_TARGET, "mode", "graph_json"],
9128
+ runs_list: [...AUTOMATION_TARGET, "limit", "cursor", "include"],
9129
+ run_get: ["run_id", "automation_id"],
9130
+ run_debug: ["run_id", "automation_id", "log_limit", "log_level"],
9131
+ run_logs: ["run_id", "automation_id", "limit", "level"],
9132
+ run_timeline: ["run_id", "automation_id", "limit"],
9133
+ triggers_discover: ["source", "app_name", "trigger_name", "category"],
9134
+ triggers_list: [...AUTOMATION_TARGET],
9135
+ score_history: [...AUTOMATION_TARGET, "rubric_id", "limit", "cursor"],
9136
+ issues_list: [...AUTOMATION_TARGET, "limit", "audience"],
9137
+ evaluations_list: [...AUTOMATION_TARGET, "rubric_id", "limit", "cursor"],
9138
+ evaluation_latest: [...AUTOMATION_TARGET, "rubric_id"],
9139
+ evaluation_get: ["evaluation_id"],
9140
+ approvals_pending: [...AUTOMATION_TARGET, "limit"],
9141
+ connections_list: ["app_name"],
9142
+ rubrics_list: [...AUTOMATION_TARGET, "limit"],
9143
+ rubric_get: ["rubric_id", ...AUTOMATION_TARGET],
9144
+ execution_authority_get: [...AUTOMATION_TARGET],
9145
+ node_thread_get: ["run_id", "automation_id", "node_id", "run_index", "cursor", "limit"],
9146
+ node_thread_file_read: ["run_id", "automation_id", "node_id", "path", "run_index", "max_chars"]
9147
+ }
9148
+ };
9149
+ function buildOperationGroups(op) {
9150
+ const gemOperations = buildGemOperations(op);
9151
+ const contactsOperations = buildContactsOperations(op);
9152
+ const distributionOperations = buildDistributionOperations(op);
9153
+ const collectionsOperations = buildCollectionsOperations(op);
9154
+ const libraryOperations = [
9155
+ withOutputSchema(op("library.ls", "library", "List visible Library folders and resources.", "library_query", "ls", "read"), libraryFilesystemOutputSchema),
9156
+ withOutputSchema(op("library.stat", "library", "Read metadata for a visible Library path.", "library_query", "stat", "read"), libraryFilesystemOutputSchema),
9157
+ withOutputSchema(op("library.read", "library", "Read a visible text-backed Library resource by path.", "library_query", "read", "read"), libraryFilesystemOutputSchema),
9158
+ withOutputSchema(op("library.search", "library", "Find and search visible Library resources server-side.", "library_query", "search", "read"), libraryFilesystemOutputSchema),
9159
+ withOutputSchema(op("library.mkdir", "library", "Create a Library folder (a directory).", "library_fs", "mkdir", "write"), libraryFilesystemOutputSchema),
9160
+ withOutputSchema(op("library.write", "library", "Create or replace a text-backed Library resource by path.", "library_fs", "write", "write"), libraryFilesystemOutputSchema),
9161
+ withOutputSchema(op("library.patch", "library", "Apply Codex patch text to visible typed Library text resources; use library.write for full replacement.", "library_fs", "patch", "write"), libraryFilesystemOutputSchema),
9162
+ withOutputSchema(op("library.save_skill", "library", "Save several files of a skill as one new version, or make a new skill with create.", "library_fs", "save_skill", "write"), libraryFilesystemOutputSchema),
9163
+ withOutputSchema(op("library.import", "library", "Import one skill from its files (SKILL.md and the files beside it) into a Library folder; dry_run gives the report and changes nothing.", "library_fs", "import", "write"), libraryImportOutputSchema),
9164
+ withOutputSchema(op("library.patch_preview", "library", "Preview an ordered Codex patch for text-backed Library resources without writing.", "library_query", "patch_preview", "read"), libraryFilesystemOutputSchema),
9165
+ withOutputSchema(op("library.cp", "library", "Copy a supported Library item when the backing resource supports copy semantics.", "library_fs", "cp", "write"), libraryFilesystemOutputSchema),
9166
+ withOutputSchema(op("library.mv", "library", "Move or rename a Library item.", "library_fs", "mv", "write"), libraryFilesystemOutputSchema),
9167
+ withOutputSchema(op("library.move_workspace", "library", "Move a Library item to another workspace.", "library_fs", "move_workspace", "destructive"), libraryFilesystemOutputSchema),
9168
+ withOutputSchema(op("library.rm", "library", "Trash (delete) a Library item.", "library_fs", "rm", "write"), libraryFilesystemOutputSchema),
9169
+ withOutputSchema(op("library.restore", "library", "Restore a trashed Library item.", "library_fs", "restore", "write"), libraryFilesystemOutputSchema),
9170
+ withOutputSchema(op("library.empty_trash", "library", "Permanently empty Library trash.", "library_fs", "empty_trash", "destructive"), libraryFilesystemOutputSchema),
9171
+ withOutputSchema(op("library.favorite", "library", "Add a visible Library item to the caller's favorites.", "library_fs", "favorite", "write"), libraryFilesystemOutputSchema),
9172
+ withOutputSchema(op("library.unfavorite", "library", "Remove a visible Library item from the caller's favorites.", "library_fs", "unfavorite", "write"), libraryFilesystemOutputSchema),
9173
+ withOutputSchema(op("library.sources_list", "library", "List the caller’s connected Library sources: the source connections that bring outside files into the Library.", "library_external_sources_query", "list", "read"), libraryExternalSourcesOutputSchema),
9174
+ withOutputSchema(op("library.sources_get", "library", "Inspect one connected Library source and its mirrored items.", "library_external_sources_query", "get", "read"), libraryExternalSourcesOutputSchema),
9175
+ withOutputSchema(op("library.sources_create", "library", "Connect Google Drive files or folders to the Library.", "library_external_sources", "create", "write"), libraryExternalSourcesOutputSchema),
9176
+ withOutputSchema(op("library.sources_edit", "library", "Change a connected Library source schedule or enable state.", "library_external_sources", "edit", "write"), libraryExternalSourcesOutputSchema),
9177
+ withOutputSchema(op("library.sources_pause", "library", "Pause a connected Library source.", "library_external_sources", "pause", "write"), libraryExternalSourcesOutputSchema),
9178
+ withOutputSchema(op("library.sources_resume", "library", "Resume a paused Library source.", "library_external_sources", "resume", "write"), libraryExternalSourcesOutputSchema),
9179
+ withOutputSchema(op("library.sources_run_now", "library", "Run a connected Library source sync now.", "library_external_sources", "run_now", "write"), libraryExternalSourcesOutputSchema),
9180
+ withOutputSchema(op("library.sources_cancel", "library", "Cancel the active sync for a connected Library source.", "library_external_sources", "cancel", "write"), libraryExternalSourcesOutputSchema),
9181
+ withOutputSchema(op("library.sources_reconnect", "library", "Reconnect a source after its Google Drive access expires.", "library_external_sources", "reconnect", "write"), libraryExternalSourcesOutputSchema),
9182
+ withOutputSchema(op("library.sources_remove", "library", "Remove a connected source and move confirmed mirrors to Library trash.", "library_external_sources", "remove", "destructive"), libraryExternalSourcesOutputSchema),
9183
+ withOutputSchema(op("library.upload_preflight", "library", "Preflight a Library upload.", "library_upload", "preflight", "read"), libraryUploadOutputSchema),
9184
+ withOutputSchema(op("library.upload_create_session", "library", "Create a direct Library upload session.", "library_upload", "create_session", "write"), libraryUploadOutputSchema),
9185
+ withOutputSchema(op("library.upload_complete_session", "library", "Complete a direct Library upload session.", "library_upload", "complete_session", "write"), libraryUploadOutputSchema)
9186
+ ];
9187
+ const sharingOperations = [
9188
+ ...buildShareOperations(op),
9189
+ withOutputSchema(op("shares.permissions_list", "shares", "List permissions for a Library resource.", "sharing_query", "list_permissions", "read"), libraryCollabOutputSchema),
9190
+ withOutputSchema(op("shares.settings_set", "shares", "Set share settings for a Library resource.", "library_collab", "set_share_settings", "write"), libraryCollabOutputSchema),
9191
+ withOutputSchema(op("library.transfer_ownership", "library", "Transfer ownership for a Library resource.", "library_collab", "transfer_ownership", "destructive"), libraryCollabOutputSchema),
9192
+ withOutputSchema(op("versions.list", "versions", "List Library resource versions.", "sharing_query", "list_versions", "read"), libraryCollabOutputSchema),
9193
+ withOutputSchema(op("versions.get", "versions", "Read one complete authorized Library resource version.", "sharing_query", "get_version", "read"), libraryCollabOutputSchema),
9194
+ withOutputSchema(op("versions.diff", "versions", "Read a semantic diff between two Library resource versions.", "sharing_query", "diff_versions", "read"), libraryCollabOutputSchema),
9195
+ withOutputSchema(op("versions.restore", "versions", "Restore a Library resource version.", "library_collab", "restore_version", "destructive"), libraryCollabOutputSchema),
9196
+ withOutputSchema(op("comments.add", "comments", "Comment on a Library resource.", "library_collab", "comment", "write"), libraryCollabOutputSchema),
9197
+ withOutputSchema(op("comments.resolve", "comments", "Resolve a Library resource comment.", "library_collab", "resolve_comment", "write"), libraryCollabOutputSchema),
9198
+ withOutputSchema(op("labels.add", "labels", "Apply a Library label.", "library_collab", "label", "write"), libraryCollabOutputSchema),
9199
+ withOutputSchema(op("labels.remove", "labels", "Remove a Library label.", "library_collab", "unlabel", "write"), libraryCollabOutputSchema),
9200
+ withOutputSchema(op("labels.list", "labels", "List Library labels in the current workspace.", "sharing_query", "list_labels", "read"), libraryCollabOutputSchema),
9201
+ withOutputSchema(op("labels.create", "labels", "Create a Library label in the current workspace.", "library_collab", "create_label", "write"), libraryCollabOutputSchema)
9202
+ ];
9203
+ const datasetOperations = [
9204
+ withOutputSchema(op("datasets.create", "datasets", "Create a typed Dataset.", "dataset_manage", "create", "write"), datasetResultOutputSchema),
9205
+ withOutputSchema(op("datasets.update", "datasets", "Update Dataset metadata and schema.", "dataset_manage", "update", "write"), datasetResultOutputSchema),
9206
+ withOutputSchema(op("datasets.get", "datasets", "Read Dataset metadata and stable property identities.", "dataset_get", undefined, "read"), datasetResultOutputSchema),
9207
+ withOutputSchema(op("datasets.external_source_get", "datasets", "Read the external source binding for a Dataset.", "dataset_external_source_get", undefined, "read"), datasetExternalSourceGetOutputSchema),
9208
+ withOutputSchema(op("datasets.external_source_put", "datasets", "Create or update the external source binding for a Dataset.", "dataset_external_source_put", undefined, "write"), datasetResultOutputSchema),
9209
+ withOutputSchema(op("datasets.external_source_test", "datasets", "Test a Dataset external source connection and query preview.", "dataset_external_source_test", undefined, "read"), datasetResultOutputSchema),
9210
+ withOutputSchema(op("datasets.external_source_sync", "datasets", "Start a one-shot refresh from a Dataset external source.", "dataset_external_source_sync", undefined, "write"), datasetResultOutputSchema),
9211
+ withOutputSchema(op("datasets.query", "datasets", "Query Dataset rows with filters, search, sorting, pages, totals, and aggregates.", "dataset_query", undefined, "read"), datasetQueryOutputSchema),
9212
+ withOutputSchema(op("datasets.history", "datasets", "List Dataset change history.", "dataset_history", undefined, "read"), datasetResultOutputSchema),
9213
+ withOutputSchema(op("datasets.rows_upsert", "datasets", "Insert or update Dataset rows.", "dataset_rows", "upsert", "write"), datasetResultOutputSchema),
9214
+ withOutputSchema(op("datasets.rows_delete", "datasets", "Soft-delete Dataset rows.", "dataset_rows", "delete", "write"), datasetResultOutputSchema),
9215
+ withOutputSchema(op("datasets.rows_restore", "datasets", "Restore soft-deleted Dataset rows.", "dataset_rows", "restore", "write"), datasetResultOutputSchema),
9216
+ withOutputSchema(op("datasets.restore", "datasets", "Restore a supported saved Dataset state as a new forward change.", "dataset_restore", undefined, "write"), datasetResultOutputSchema),
9217
+ withOutputSchema(op("datasets.jobs", "datasets", "List Dataset work jobs.", "dataset_jobs", undefined, "read"), datasetResultOutputSchema),
9218
+ withOutputSchema(op("datasets.job_get", "datasets", "Read one Dataset work job.", "dataset_job_get", undefined, "read"), datasetResultOutputSchema),
9219
+ withOutputSchema(op("datasets.job_cancel", "datasets", "Cancel one Dataset work job.", "dataset_job_cancel", undefined, "write"), datasetResultOutputSchema),
9220
+ withOutputSchema(op("datasets.sql", "datasets", "Run one read-only SQL statement over accessible Dataset rows.", "dataset_sql", undefined, "read"), datasetResultOutputSchema),
9221
+ withOutputSchema(op("datasets.sql_write", "datasets", "Run one SQL write over named Dataset rows with manage access.", "dataset_sql_write", undefined, "write", ["cli", "mcp", "docs"]), datasetResultOutputSchema)
9222
+ ];
9223
+ const workspaceOperations = [
9224
+ withOutputSchema(op("workspace.list", "workspace", "List available workspaces.", "list_workspaces", undefined, "read"), LIST_WORKSPACES_TOOL_DESCRIPTOR.outputSchema),
9225
+ withOutputSchema(op("workspace.teams_list", "workspace", "List workspace teams.", "list_workspace_teams", undefined, "read"), listWorkspaceTeamsOutputSchema),
9226
+ withOutputSchema(op("workspace.members_list", "workspace", "List workspace members for sharing.", "workspace_members_list", undefined, "read"), workspaceMembersOutputSchema)
9227
+ ];
9228
+ const automationOperations = [
9229
+ withOutputSchema(op("automations.list", "automations", "List the automations you can open in the active workspace.", "automation_query", "list", "read"), automationQueryOutputSchema),
9230
+ withOutputSchema(op("automations.get", "automations", "Get one automation definition.", "automation_query", "get", "read"), automationQueryOutputSchema),
9231
+ withOutputSchema(op("automations.validate", "automations", "Validate an automation graph without mutation.", "automation_query", "validate", "read"), automationQueryOutputSchema),
9232
+ withOutputSchema(op("automations.runs_list", "automations", "List automation runs.", "automation_query", "runs_list", "read"), automationQueryOutputSchema),
9233
+ withOutputSchema(op("automations.run_get", "automations", "Get one automation run and its node execution state.", "automation_query", "run_get", "read"), automationQueryOutputSchema),
9234
+ withOutputSchema(op("automations.run_debug", "automations", "Debug an automation run.", "automation_query", "run_debug", "read"), automationQueryOutputSchema),
9235
+ withOutputSchema(op("automations.run_logs", "automations", "Read automation run logs.", "automation_query", "run_logs", "read"), automationQueryOutputSchema),
9236
+ withOutputSchema(op("automations.run_timeline", "automations", "Read automation run timeline.", "automation_query", "run_timeline", "read"), automationQueryOutputSchema),
9237
+ withOutputSchema(op("automations.run", "automations", "Start an automation run and return a durable run handle.", "automation_execute", "start", "write"), automationOutputSchema),
9238
+ withOutputSchema(op("automations.run_cancel", "automations", "Cancel a queued or active automation run.", "automation_execute", "cancel", "destructive"), automationOutputSchema),
9239
+ withOutputSchema(op("automations.webhook_test_delivery", "automations", "Send a signed test delivery to a turned-on webhook trigger and start a test run of the saved automation. Turning a new URL on needs the person's password in the app.", "automation_execute", "webhook_test_delivery", "write"), automationOutputSchema),
9240
+ withOutputSchema(op("automations.triggers_discover", "automations", "Discover automation triggers.", "automation_query", "triggers_discover", "read"), automationQueryOutputSchema),
9241
+ withOutputSchema(op("automations.triggers_list", "automations", "List configured automation triggers and runtime status.", "automation_query", "triggers_list", "read"), automationQueryOutputSchema),
9242
+ withOutputSchema(op("automations.score_history", "automations", "Read automation score history and trend aggregates.", "automation_query", "score_history", "read"), automationQueryOutputSchema),
9243
+ withOutputSchema(op("automations.issues_list", "automations", "List visible automation evaluation issues.", "automation_query", "issues_list", "read"), automationQueryOutputSchema),
9244
+ withOutputSchema(op("automations.evaluations_list", "automations", "List evaluations for one automation.", "automation_query", "evaluations_list", "read"), automationQueryOutputSchema),
9245
+ withOutputSchema(op("automations.evaluation_latest", "automations", "Read the latest evaluation for one automation.", "automation_query", "evaluation_latest", "read"), automationQueryOutputSchema),
9246
+ withOutputSchema(op("automations.evaluation_get", "automations", "Read one evaluation and its criterion scores.", "automation_query", "evaluation_get", "read"), automationQueryOutputSchema),
9247
+ withOutputSchema(op("automations.approvals_pending", "automations", "List pending approvals assigned to the caller.", "automation_query", "approvals_pending", "read"), automationQueryOutputSchema),
9248
+ withOutputSchema(op("automations.connections_list", "automations", "List automation connections.", "automation_query", "connections_list", "read"), automationQueryOutputSchema),
9249
+ withOutputSchema(op("rubrics.list", "rubrics", "List caller-owned or automation-visible rubrics.", "automation_query", "rubrics_list", "read"), automationQueryOutputSchema),
9250
+ withOutputSchema(op("rubrics.get", "rubrics", "Read one authorized immutable rubric revision.", "automation_query", "rubric_get", "read"), automationQueryOutputSchema),
9251
+ withOutputSchema(op("automations.execution_authority_get", "automations", "Read display-safe automation execution-principal health.", "automation_query", "execution_authority_get", "read"), automationQueryOutputSchema),
9252
+ withOutputSchema(op("automations.node_thread_get", "automations", "Read one automation run node's real chat thread.", "automation_query", "node_thread_get", "read"), automationQueryOutputSchema),
9253
+ withOutputSchema(op("automations.node_thread_file_read", "automations", "Read one output file an automation run node wrote.", "automation_query", "node_thread_file_read", "read"), automationQueryOutputSchema),
9254
+ withOutputSchema(op("automations.create", "automations", "Create an automation.", "automation_author", "create", "write"), automationOutputSchema),
9255
+ withOutputSchema(op("automations.delete", "automations", "Delete an automation and its dependent runtime state.", "automation_author", "delete", "destructive"), automationOutputSchema),
9256
+ withOutputSchema(op("automations.quick_schedule", "automations", "Create a scheduled draft automation.", "automation_author", "quick_schedule", "write"), automationOutputSchema),
9257
+ withOutputSchema(op("automations.update_metadata", "automations", "Update automation metadata.", "automation_author", "update_metadata", "write"), automationOutputSchema),
9258
+ withOutputSchema(op("automations.set_status", "automations", "Change automation lifecycle status.", "automation_author", "set_status", "write"), automationOutputSchema),
9259
+ withOutputSchema(op("automations.graph_patch", "automations", "Patch an automation graph.", "automation_author", "graph_patch", "write"), automationOutputSchema),
9260
+ withOutputSchema(op("automations.triggers_create", "automations", "Create an automation trigger.", "automation_author", "trigger_create", "write"), automationOutputSchema),
9261
+ withOutputSchema(op("automations.triggers_update", "automations", "Update an automation trigger.", "automation_author", "trigger_update", "write"), automationOutputSchema),
9262
+ withOutputSchema(op("automations.triggers_delete", "automations", "Delete an automation trigger.", "automation_author", "trigger_delete", "destructive"), automationOutputSchema),
9263
+ withOutputSchema(op("automations.webhook_secret_rotate", "automations", "Begin a server-managed webhook credential rotation when the guarded lifecycle is enabled.", "automation_author", "webhook_secret_rotate", "write"), automationOutputSchema),
9264
+ withOutputSchema(op("rubrics.create", "rubrics", "Create a caller-owned automation rubric.", "automation_author", "rubric_create", "write"), automationOutputSchema),
9265
+ withOutputSchema(op("rubrics.update", "rubrics", "Append an immutable rubric definition revision. Automations you can edit move to it; graded_automations names the revision that grades each one now.", "automation_author", "rubric_update", "write"), automationOutputSchema),
9266
+ withOutputSchema(op("rubrics.archive", "rubrics", "Archive a rubric while retaining history.", "automation_author", "rubric_archive", "destructive"), automationOutputSchema),
9267
+ withOutputSchema(op("rubrics.delete", "rubrics", "Preview or permanently delete a caller-owned rubric. Past evaluations and their scores are kept and stay readable.", "automation_author", "rubric_delete", "destructive"), automationOutputSchema),
9268
+ withOutputSchema(op("rubrics.assign", "rubrics", "Pin an immutable rubric revision to an automation.", "automation_author", "rubric_assign", "write"), automationOutputSchema),
9269
+ withOutputSchema(op("rubrics.unassign", "rubrics", "Disable a rubric assignment on an automation.", "automation_author", "rubric_unassign", "destructive"), automationOutputSchema),
9270
+ withOutputSchema(op("automations.execution_principal_rebind", "automations", "Rebind an automation to the owner self-principal generation.", "automation_author", "execution_principal_rebind", "write"), automationOutputSchema),
9271
+ withOutputSchema(op("automations.evaluation_start", "automations", "Start an immutable rubric evaluation attempt for a completed run.", "automation_execute", "evaluation_start", "write"), automationOutputSchema)
9272
+ ];
9273
+ const webAndFileOperations = [
9274
+ withOutputSchema(op("web.search", "web", "Search the web.", "web_search", undefined, "read"), webSearchOutputSchema),
9275
+ withOutputSchema(op("web.fetch", "web", "Fetch a web page.", "web_fetch", undefined, "read"), webFetchOutputSchema),
9276
+ withOutputSchema(op("web.search_and_fetch", "web", "Search and fetch web pages.", "web_search_and_fetch", undefined, "read"), webSearchAndFetchOutputSchema),
9277
+ withOutputSchema(op("web.access_list", "web", "List the websites the sandbox of a chat may reach: who approved each one and when it ends.", "web_access_query", "list", "read"), webAccessListOutputSchema),
9278
+ withOutputSchema(op("web.access_take_back", "web", "Take back one website from the sandbox of a chat. It stops now; the sandbox asks again if it needs it.", "web_access", "take_back", "write"), webAccessTakeBackOutputSchema),
9279
+ withOutputSchema(op("file.download_content", "files", "Download file content for agent use.", "DOWNLOAD_FILE_CONTENT", undefined, "read"), downloadFileContentOutputSchema),
9280
+ withOutputSchema(op("file.download_for_user", "files", "Prepare a file download for the user.", "DOWNLOAD_FILE_FOR_USER", undefined, "read"), downloadFileForUserOutputSchema)
9281
+ ];
9282
+ const registryUtilityOperations = [
9283
+ withOutputSchema(op("tools.support_read", "tools", "Read fixed safe platform support facts with a saved Agent identity and an explicit staff read grant.", "platform_support_read", undefined, "read"), platformSupportReadOutputSchema),
9284
+ withOutputSchema(op("tools.search", "tools", "Search platform tools by task.", "search_tools", undefined, "read"), searchToolsOutputSchema),
9285
+ withOutputSchema(op("tools.list", "tools", "List platform tools.", "list_platform_tools", undefined, "read", ["cli", "docs"]), platformToolListOutputSchema),
9286
+ withOutputSchema(op("tools.schema", "tools", "Read a platform tool schema.", "get_platform_tool_schema", undefined, "read", ["cli", "docs"]), platformToolSchemaOutputSchema),
9287
+ withOutputSchema(op("tools.run", "tools", "Run a platform tool by name.", "execute_platform_tool_by_name", undefined, "write", ["cli", "docs"]), platformToolRunOutputSchema)
9288
+ ];
9289
+ const homeOperations = [
9290
+ ...buildHomePinListOperations(op),
9291
+ withOutputSchema(op("home.timeline_rules_list", "home", "List durable Home Timeline rules and unavailable-target recovery rows.", "home_timeline_query", "timeline_rules_list", "read", ["cli", "mcp", "docs"], "universal"), homeTimelineQueryOutputSchema),
9292
+ withOutputSchema(op("home.timeline_day", "home", "Evaluate Home Timeline rules across an explicit day range.", "home_timeline_query", "timeline_day", "read", ["cli", "mcp", "docs"], "universal"), homeTimelineQueryOutputSchema),
9293
+ withOutputSchema(op("home.timeline_calendar_events", "home", "Preview authorized Home Timeline calendar events.", "home_timeline_query", "timeline_calendar_events", "read", ["cli", "mcp", "docs"], "universal"), homeTimelineQueryOutputSchema),
9294
+ withOutputSchema(op("home.timeline_rule_create", "home", "Create a durable Home Timeline rule.", "home_timeline_manage", "timeline_rule_create", "write", ["cli", "mcp", "docs"], "universal"), homeTimelineManageOutputSchema),
9295
+ withOutputSchema(op("home.timeline_rule_update", "home", "Update a durable Home Timeline rule.", "home_timeline_manage", "timeline_rule_update", "write", ["cli", "mcp", "docs"], "universal"), homeTimelineManageOutputSchema),
9296
+ withOutputSchema(op("home.timeline_rule_delete", "home", "Delete a durable Home Timeline rule.", "home_timeline_manage", "timeline_rule_delete", "destructive", ["cli", "mcp", "docs"], "universal"), homeTimelineManageOutputSchema),
9297
+ withOutputSchema(op("home.timeline_rules_reorder", "home", "Reorder your Home Timeline rules. Send every rule id you can see, in the new order.", "home_timeline_manage", "timeline_rules_reorder", "write", ["cli", "mcp", "docs"], "universal"), homeTimelineManageOutputSchema),
9298
+ withOutputSchema(op("home.notices_list", "home", "List the live Home notices you have not dismissed, and whether you may post one.", "home_notices_query", "notices_list", "read", ["cli", "mcp", "docs"], "universal"), homeNoticesQueryOutputSchema),
9299
+ withOutputSchema(op("home.notices_managed_list", "home", "List the Home notices an admin manages, with the status of each.", "home_notices_query", "notices_managed_list", "read", ["cli", "mcp", "docs"], "universal"), homeNoticesQueryOutputSchema),
9300
+ withOutputSchema(op("home.notice_mark_read", "home", "Mark a Home notice opened. Only a person opens a required notice.", "home_notices_manage", "notice_mark_read", "write", ["cli", "mcp", "docs"], "universal"), homeNoticesManageOutputSchema),
9301
+ withOutputSchema(op("home.notice_dismiss", "home", "Dismiss a Home notice for you only. Only a person dismisses a required notice.", "home_notices_manage", "notice_dismiss", "write", ["cli", "mcp", "docs"], "universal"), homeNoticesManageOutputSchema),
9302
+ withOutputSchema(op("home.notice_post", "home", "Post a workspace Home notice. Only a person signed in to Uru posts an Organization notice.", "home_notices_manage", "notice_post", "write", ["cli", "mcp", "docs"], "universal"), homeNoticesManageOutputSchema),
9303
+ withOutputSchema(op("home.notice_update", "home", "Edit a Home notice that has not ended. Only a person signed in to Uru edits a required notice.", "home_notices_manage", "notice_update", "write", ["cli", "mcp", "docs"], "universal"), homeNoticesManageOutputSchema),
9304
+ withOutputSchema(op("home.notice_end", "home", "End a live Home notice now. Only a person signed in to Uru ends a required notice.", "home_notices_manage", "notice_end", "write", ["cli", "mcp", "docs"], "universal"), homeNoticesManageOutputSchema),
9305
+ withOutputSchema(op("home.notice_delete", "home", "Delete a scheduled Home notice nobody has seen.", "home_notices_manage", "notice_delete", "destructive", ["cli", "mcp", "docs"], "universal"), homeNoticesManageOutputSchema),
9306
+ ...buildHomePersonOperations(op),
9307
+ ...buildHomeActivityOperations(op)
9308
+ ];
9309
+ return {
9310
+ gemOperations,
9311
+ libraryOperations,
9312
+ sharingOperations,
9313
+ contactsOperations,
9314
+ distributionOperations,
9315
+ collectionsOperations,
9316
+ datasetOperations,
9317
+ workspaceOperations,
9318
+ automationOperations,
9319
+ webAndFileOperations,
9320
+ homeOperations,
9321
+ registryUtilityOperations
9322
+ };
9323
+ }
9324
+
9325
+ // ../../packages/platform-operations/src/operation_input_fields.ts
9326
+ function mergeOperationInputFieldTables(tables) {
9327
+ const merged = {};
9328
+ for (const table of tables) {
9329
+ for (const [tool, ops] of Object.entries(table)) {
9330
+ const target = merged[tool] ??= {};
9331
+ for (const [op, fields] of Object.entries(ops)) {
9332
+ if (target[op] !== undefined) {
9333
+ throw new Error(`platform_operation_input_fields_duplicate: ${tool}.${op}`);
9334
+ }
9335
+ target[op] = fields;
9336
+ }
9337
+ }
9338
+ }
9339
+ return merged;
9340
+ }
9341
+ // ../../packages/platform-operations/src/planned_operations.ts
9342
+ function buildPlannedOperations(op) {
9343
+ return [
9344
+ withOutputSchema(op("friction.report", "tools", "Record any perceived Uru friction, including bugs, unclear guidance, inaccessible data, failed tools, missing capabilities, and blocked workflows, for workspace triage.", "report_friction", undefined, "write", ["mcp", "docs"]), frictionReportOutputSchema),
9345
+ withOutputSchema(op("secret.put", "secrets", "Store a Gem secret value through the canonical CLI/MCP operation registry; values are write-only and never returned.", "gem_control_plane", "store_secret", "write"), gemOperationOutputSchema),
9346
+ withOutputSchema(op("secret.list", "secrets", "List Gem secret metadata without returning secret values.", "gem_query", "inspect", "read"), gemOperationOutputSchema),
9347
+ withOutputSchema(op("secret.rm", "secrets", "Revoke a Gem secret and delete its encrypted value.", "gem_control_plane", "delete_secret", "destructive"), gemOperationOutputSchema)
9348
+ ];
9349
+ }
9350
+ // ../../packages/platform-operations/src/internal_tool_ids.ts
9351
+ var internalOnlyPlatformToolIds = new Set([
9352
+ "DOWNLOAD_FILE_CONTENT",
9353
+ "DOWNLOAD_FILE_FOR_USER",
9354
+ "GEM_COMPONENTS_GET",
9355
+ "GEM_COMPONENTS_LIST"
9356
+ ]);
9357
+ // ../../packages/platform-operations/src/dataset_source_names.ts
9358
+ var RETIRED_DATASET_SOURCE_NAMES = [
9359
+ "CREATE_DATASET",
9360
+ "DATASET_CREATE",
9361
+ "UPDATE_DATASET",
9362
+ "DATASET_UPDATE",
9363
+ "LIST_DATASET_ROWS",
9364
+ "DATASET_QUERY",
9365
+ "GET_DATASET",
9366
+ "DATASET_GET",
9367
+ "UPSERT_DATASET_ROWS",
9368
+ "DELETE_DATASET_ROWS",
9369
+ "RESTORE_DATASET_ROWS",
9370
+ "DATASET_ROWS",
9371
+ "DATASET_SQL_READ",
9372
+ "DATASET_SQL_WRITE",
9373
+ "DATASET_SQL"
9374
+ ];
9375
+ var RETIRED_DATASET_SOURCE_PATTERN = new RegExp(`\\b(${RETIRED_DATASET_SOURCE_NAMES.join("|")})\\b`);
9376
+ // ../../packages/platform-operations/src/execution_observation.ts
9377
+ var OBSERVED_PROVIDER_TYPES = [
9378
+ "composio",
9379
+ "managed_mcp",
9380
+ "external_mcp"
9381
+ ];
9382
+ var EXECUTION_OBSERVATION_PROVIDER_TYPES = new Set(OBSERVED_PROVIDER_TYPES);
9383
+ // ../../packages/platform-operations/src/tool_refusal_envelope.ts
9384
+ var OPERATION_ERROR_CODES = [
9385
+ "invalid_input",
9386
+ "not_found",
9387
+ "forbidden",
9388
+ "conflict",
9389
+ "auth_required",
9390
+ "needs_connection",
9391
+ "blocked_by_rule",
9392
+ "needs_person",
9393
+ "rate_limited",
9394
+ "internal"
9395
+ ];
9396
+ function isOperationErrorCode(value) {
9397
+ return typeof value === "string" && OPERATION_ERROR_CODES.includes(value);
9398
+ }
9399
+ // ../../packages/platform-operations/src/tool_name_aliases.ts
9400
+ var renamedPlatformToolNames = new Map([
9401
+ ["collections", "bundles"],
9402
+ ["collections_query", "bundles_query"],
9403
+ ["persona_query", "agents_query"],
9404
+ ["search_personas", "agents_query"],
9405
+ ["get_persona", "agents_query"],
9406
+ ["list_workspace_members", "workspace_members_list"],
9407
+ ["home_focus_query", "home_timeline_query"],
9408
+ ["home_focus_manage", "home_timeline_manage"]
9409
+ ]);
9410
+ var deletedPlatformToolReplacements = new Map([
9411
+ ["persona_manage", { call: "agents op=update", operationId: "agents.update" }],
9412
+ ["create_persona", { call: "agents op=create", operationId: "agents.create" }],
9413
+ ["update_persona", { call: "agents op=update", operationId: "agents.update" }],
9414
+ ["delete_persona", { call: "library_fs op=rm", operationId: "library.rm" }]
9415
+ ]);
9416
+ var renamedPlatformToolOperationIds = new Map([
9417
+ ["bundles", ["bundles.create", "bundles.update", "bundles.delete", "bundles.items_add", "bundles.items_remove", "bundles.items_reorder"]],
9418
+ ["bundles_query", ["bundles.list", "bundles.get"]],
9419
+ ["agents_query", ["agents.list", "agents.get"]],
9420
+ ["workspace_members_list", ["workspace.members_list"]],
9421
+ ["home_timeline_query", ["home.timeline_rules_list", "home.timeline_day", "home.timeline_calendar_events"]],
9422
+ ["home_timeline_manage", ["home.timeline_rule_create", "home.timeline_rule_update", "home.timeline_rule_delete", "home.timeline_rules_reorder"]]
9423
+ ]);
9424
+ var renamedSharingOperationIds = [
9425
+ ["sharing.item_shares", "shares.list"],
9426
+ ["sharing.share_get", "shares.get"],
9427
+ ["sharing.share_opens", "shares.opens"],
9428
+ ["sharing.share_people_search", "shares.people_search"],
9429
+ ["sharing.audience_people", "shares.audience_people"],
9430
+ ["sharing.received_list", "shares.received_list"],
9431
+ ["sharing.received_get", "shares.received_get"],
9432
+ ["sharing.sent_list", "shares.sent_list"],
9433
+ ["sharing.share_counts", "shares.counts"],
9434
+ ["sharing.send_allowance", "shares.send_allowance"],
9435
+ ["sharing.access_requests", "shares.access_requests"],
9436
+ ["sharing.share_items", "shares.items"],
9437
+ ["sharing.share_create", "shares.create"],
9438
+ ["sharing.share_update", "shares.update"],
9439
+ ["sharing.share_add_people", "shares.people_add"],
9440
+ ["sharing.share_remove_person", "shares.people_remove"],
9441
+ ["sharing.share_move_person", "shares.people_move"],
9442
+ ["sharing.share_revoke", "shares.revoke"],
9443
+ ["sharing.share_rotate", "shares.link_rotate"],
9444
+ ["sharing.share_resend_email", "shares.email_resend"],
9445
+ ["sharing.share_owner_link", "shares.owner_link"],
9446
+ ["sharing.received_place", "shares.received_place"],
9447
+ ["sharing.received_remove", "shares.received_remove"],
9448
+ ["sharing.sent_revoke", "shares.sent_revoke"],
9449
+ ["sharing.permissions_list", "shares.permissions_list"],
9450
+ ["sharing.settings_set", "shares.settings_set"],
9451
+ ["sharing.transfer_ownership", "library.transfer_ownership"],
9452
+ ["sharing.versions_list", "versions.list"],
9453
+ ["sharing.version_get", "versions.get"],
9454
+ ["sharing.versions_diff", "versions.diff"],
9455
+ ["sharing.version_restore", "versions.restore"],
9456
+ ["sharing.comment", "comments.add"],
9457
+ ["sharing.comment_resolve", "comments.resolve"],
9458
+ ["sharing.label", "labels.add"],
9459
+ ["sharing.unlabel", "labels.remove"],
9460
+ ["sharing.labels_list", "labels.list"],
9461
+ ["sharing.label_create", "labels.create"]
9462
+ ];
9463
+ var singularFamilyVerbs = {
9464
+ gem: [
9465
+ "init",
9466
+ "git_source_setup",
9467
+ "git_source_connections_list",
9468
+ "git_source_connection_poll",
9469
+ "git_source_connection_callback",
9470
+ "git_source_inspect",
9471
+ "git_source_import",
9472
+ "git_source_status",
9473
+ "git_source_command",
9474
+ "git_source_copy",
9475
+ "git_source_preview_inspect",
9476
+ "git_source_preview_open",
9477
+ "inspect",
9478
+ "fs_tree",
9479
+ "fs_read",
9480
+ "fs_write",
9481
+ "fs_batch_write",
9482
+ "fs_sync",
9483
+ "fs_upload",
9484
+ "fs_patch",
9485
+ "fs_patch_preview",
9486
+ "fs_mkdir",
9487
+ "fs_rm",
9488
+ "fs_mv",
9489
+ "fs_cp",
9490
+ "fs_status",
9491
+ "fs_diff",
9492
+ "validate",
9493
+ "build",
9494
+ "edits_list",
9495
+ "edit_get",
9496
+ "versions_list",
9497
+ "version_get",
9498
+ "version_diff",
9499
+ "version_save",
9500
+ "version_publish",
9501
+ "version_restore",
9502
+ "version_preview",
9503
+ "version_retry",
9504
+ "build_logs",
9505
+ "build_job",
9506
+ "build_inspect",
9507
+ "upsert_binding",
9508
+ "resolve_safe_bindings",
9509
+ "store_secret",
9510
+ "releases_list",
9511
+ "release_get",
9512
+ "release_create",
9513
+ "release_retry",
9514
+ "release_change_apply",
9515
+ "release_change_get",
9516
+ "release_change_resume",
9517
+ "status",
9518
+ "checks",
9519
+ "logs",
9520
+ "debug_token",
9521
+ "security_scan",
9522
+ "public_tool_delegation_enable",
9523
+ "public_tool_delegation_revoke",
9524
+ "runs_list",
9525
+ "run_get",
9526
+ "run_recovery_preview",
9527
+ "run_recover",
9528
+ "run_cancel",
9529
+ "runtime_stop",
9530
+ "runtime_start",
9531
+ "runtime_restart",
9532
+ "capabilities_list",
9533
+ "capability_set_enabled",
9534
+ "schedules_list",
9535
+ "schedule_arm",
9536
+ "schedule_pause",
9537
+ "schedule_resume",
9538
+ "schedule_target_set",
9539
+ "schedule_run_now",
9540
+ "event_targets_list",
9541
+ "event_target_update",
9542
+ "event_target_release_set",
9543
+ "event_target_run_now",
9544
+ "analytics",
9545
+ "domains_set",
9546
+ "domains_list",
9547
+ "domains_check",
9548
+ "domains_delete",
9549
+ "storage_usage",
9550
+ "storage_shared_list",
9551
+ "storage_shared_get",
9552
+ "storage_shared_delete",
9553
+ "storage_shared_clear",
9554
+ "api_describe",
9555
+ "tool_declaration",
9556
+ "call_query",
9557
+ "call_action",
9558
+ "job_cancel",
9559
+ "job_start",
9560
+ "job_status",
9561
+ "components_list",
9562
+ "components_get"
9563
+ ],
9564
+ dataset: [
9565
+ "create",
9566
+ "update",
9567
+ "get",
9568
+ "external_source_get",
9569
+ "external_source_put",
9570
+ "external_source_test",
9571
+ "external_source_sync",
9572
+ "query",
9573
+ "history",
9574
+ "rows_upsert",
9575
+ "rows_delete",
9576
+ "rows_restore",
9577
+ "restore",
9578
+ "jobs",
9579
+ "job_get",
9580
+ "job_cancel",
9581
+ "sql",
9582
+ "sql_write"
9583
+ ],
9584
+ automation: [
9585
+ "get",
9586
+ "validate",
9587
+ "runs_list",
9588
+ "run_get",
9589
+ "run_debug",
9590
+ "run_logs",
9591
+ "run_timeline",
9592
+ "run_cancel",
9593
+ "webhook_test_delivery",
9594
+ "triggers_discover",
9595
+ "triggers_list",
9596
+ "score_history",
9597
+ "issues_list",
9598
+ "evaluations_list",
9599
+ "evaluation_latest",
9600
+ "evaluation_get",
9601
+ "approvals_pending",
9602
+ "connections_list",
9603
+ "execution_authority_get",
9604
+ "node_thread_get",
9605
+ "node_thread_file_read",
9606
+ "create",
9607
+ "delete",
9608
+ "quick_schedule",
9609
+ "update_metadata",
9610
+ "set_status",
9611
+ "graph_patch",
9612
+ "webhook_secret_rotate",
9613
+ "execution_principal_rebind",
9614
+ "evaluation_start"
9615
+ ]
9616
+ };
9617
+ var renamedRubricVerbs = [
9618
+ ["rubrics_list", "list"],
9619
+ ["rubric_get", "get"],
9620
+ ["rubric_create", "create"],
9621
+ ["rubric_update", "update"],
9622
+ ["rubric_archive", "archive"],
9623
+ ["rubric_delete", "delete"],
9624
+ ["rubric_assign", "assign"],
9625
+ ["rubric_unassign", "unassign"]
9626
+ ];
9627
+ var renamedPlatformOperationIds = new Map([
9628
+ ...["list", "get", "create", "update", "delete", "items_add", "items_remove", "items_reorder"].map((verb) => [`collections.${verb}`, `bundles.${verb}`]),
9629
+ ...renamedSharingOperationIds,
9630
+ ["automation.run_start", "automations.run"],
9631
+ ["automation.trigger_create", "automations.triggers_create"],
9632
+ ["automation.trigger_update", "automations.triggers_update"],
9633
+ ["automation.trigger_delete", "automations.triggers_delete"],
9634
+ ...Object.entries(singularFamilyVerbs).flatMap(([family, verbs]) => verbs.map((verb) => [`${family}.${verb}`, `${family}s.${verb}`])),
9635
+ ...renamedRubricVerbs.map(([verb, rubricVerb]) => [`automation.${verb}`, `rubrics.${rubricVerb}`]),
9636
+ ...["rules_list", "day", "calendar_events", "rule_create", "rule_update", "rule_delete"].map((name) => [`home.focus_${name}`, `home.timeline_${name}`])
9637
+ ]);
9638
+ // ../../packages/platform-operations/src/wrapper_tool_names.ts
9639
+ var WRAPPER_LIST_TOOLS_SUFFIX = "__list_tools";
9640
+ var WRAPPER_EXECUTE_TOOL_SUFFIX = "__execute_tool";
9641
+ var MAX_WRAPPER_TOOL_NAME_LENGTH = 64;
9642
+ var MAX_WRAPPER_NAMESPACE_LENGTH = MAX_WRAPPER_TOOL_NAME_LENGTH - WRAPPER_EXECUTE_TOOL_SUFFIX.length;
9643
+
9644
+ // ../../packages/platform-operations/src/index.ts
9645
+ var ALL_SURFACES = [
9646
+ "cli",
9647
+ "mcp",
9648
+ "docs"
9649
+ ];
9650
+ var MCP_TOOL_NAME_PATTERN = /^[a-z][a-z0-9_]{0,63}$/;
9651
+ var RESERVED_MCP_WRAPPER_SUFFIXES = [
9652
+ WRAPPER_LIST_TOOLS_SUFFIX,
9653
+ WRAPPER_EXECUTE_TOOL_SUFFIX
9654
+ ];
9655
+ function isCanonicalMcpToolName(toolName) {
9656
+ return MCP_TOOL_NAME_PATTERN.test(toolName) && !RESERVED_MCP_WRAPPER_SUFFIXES.some((suffix) => toolName.endsWith(suffix));
9657
+ }
9658
+ var operationInputFields = mergeOperationInputFieldTables([
9659
+ GEM_OPERATION_INPUT_FIELDS,
9660
+ LIBRARY_OPERATION_INPUT_FIELDS,
9661
+ SHARE_OPERATION_INPUT_FIELDS,
9662
+ CONTACTS_OPERATION_INPUT_FIELDS,
9663
+ DISTRIBUTION_OPERATION_INPUT_FIELDS,
9664
+ COLLECTIONS_OPERATION_INPUT_FIELDS
9665
+ ]);
9666
+ var {
9667
+ gemOperations,
9668
+ libraryOperations,
9669
+ sharingOperations,
9670
+ contactsOperations,
9671
+ distributionOperations,
9672
+ collectionsOperations,
9673
+ datasetOperations,
9674
+ workspaceOperations,
9675
+ automationOperations,
9676
+ webAndFileOperations,
9677
+ homeOperations,
9678
+ registryUtilityOperations
9679
+ } = buildOperationGroups(op);
9680
+ var plannedOperations = buildPlannedOperations(op);
9681
+ var platformOperations = [
9682
+ ...buildNotificationOperations(op),
9683
+ ...buildSkillOperations(op),
9684
+ ...gemOperations,
9685
+ ...libraryOperations,
9686
+ ...sharingOperations,
9687
+ ...contactsOperations,
9688
+ ...buildConnectionsOperations(op),
9689
+ ...buildAppsOperations(op),
9690
+ ...buildLinksOperations(op),
9691
+ ...buildAgentsOperations(op),
9692
+ ...buildRulesOperations(op),
9693
+ ...distributionOperations,
9694
+ ...collectionsOperations,
9695
+ ...datasetOperations,
9696
+ ...workspaceOperations,
9697
+ ...automationOperations,
9698
+ ...webAndFileOperations,
9699
+ ...homeOperations,
9700
+ ...registryUtilityOperations,
9701
+ ...plannedOperations
9702
+ ];
9703
+ var namedTextCache = new Map;
9704
+ var SUBSCHEMA_KEYS = new Set([
9705
+ "items",
9706
+ "additionalItems",
9707
+ "additionalProperties",
9708
+ "unevaluatedItems",
9709
+ "unevaluatedProperties",
9710
+ "propertyNames",
9711
+ "contains",
9712
+ "not",
9713
+ "if",
9714
+ "then",
9715
+ "else"
9716
+ ]);
9717
+ var SUBSCHEMA_LIST_KEYS = new Set(["allOf", "anyOf", "oneOf", "prefixItems"]);
9718
+ var SUBSCHEMA_MAP_KEYS = new Set([
9719
+ "properties",
9720
+ "patternProperties",
9721
+ "$defs",
9722
+ "definitions",
9723
+ "dependentSchemas"
9724
+ ]);
9725
+ var operationInputSchemasByGroupedSchema = new WeakMap;
9726
+ var DRY_RUN_OPERATION_IDS = new Set([
9727
+ "library.import",
9728
+ "automations.delete",
9729
+ "rubrics.delete"
9730
+ ]);
9731
+ function op(id, family, summary, backendToolName, backendOp, safety, surfaces = ALL_SURFACES, availability = "universal") {
9732
+ const exposedSurfaces = isCanonicalMcpToolName(backendToolName) ? surfaces : surfaces.filter((surface) => surface !== "mcp");
9733
+ const inputFields = backendOp === undefined ? undefined : operationInputFields[backendToolName]?.[backendOp];
9734
+ return {
9735
+ id,
9736
+ family,
9737
+ summary,
9738
+ backendToolName,
9739
+ ...backendOp ? { backendOp } : {},
9740
+ ...inputFields === undefined ? {} : { inputFields },
9741
+ safety,
9742
+ surfaces: exposedSurfaces,
9743
+ availability,
9744
+ ...family === "gems" && exposedSurfaces.includes("mcp") ? { outputSchema: gemOperationOutputSchema } : {}
9745
+ };
9746
+ }
9747
+
9748
+ // ../../packages/types/src/automations/library_references.ts
9749
+ var AUTOMATION_REFERENCE_NOT_SHARED_WORDS = "Not shared with you";
9750
+ // ../../packages/types/src/shareAccessRequests.ts
9751
+ var SHARE_READER_SESSION_SECONDS = 7 * 24 * 60 * 60;
9752
+ // ../../packages/types/src/shares.ts
9753
+ var GEM_SHARED_WITH_YOU_CODE = "gem_shared_with_you";
9754
+ var SHARE_USED_ITEMS_WORDS = {
9755
+ heading: "Library items it uses",
9756
+ alsoShares: "Sharing this automation with an Editor also shares the Library items it uses that you may share.",
9757
+ sharesNone: "This automation uses Library items that this share does not pass on.",
9758
+ shared: "Editors get these too, as Editors.",
9759
+ withheld: `Not shared. Editors see these on the automation as “${AUTOMATION_REFERENCE_NOT_SHARED_WORDS}” and can still save it.`,
9760
+ changed: "The Library items this automation uses changed.",
9761
+ checkAndShare: "Check the list, then press Share again."
9762
+ };
9763
+ var SHARE_PAGE_CONTENT_TEXT_MAX_BYTES = 1024 * 1024;
5662
9764
  // package.json
5663
9765
  var package_default = {
5664
9766
  name: "@uru-intelligence/cli",
5665
- version: "0.6.4",
9767
+ version: "0.7.0",
5666
9768
  private: false,
5667
9769
  description: "Uru full-platform command line interface",
5668
9770
  repository: {
@@ -5687,8 +9789,8 @@ var package_default = {
5687
9789
  access: "public"
5688
9790
  },
5689
9791
  scripts: {
5690
- lint: "node ../../scripts/run-with-repo-node.mjs oxlint --type-aware --deny-warnings -c ../../oxlint.config.mts . && node ../../scripts/checks/check-bun-test-integrity.mjs",
5691
- "lint:fix": "node ../../scripts/run-with-repo-node.mjs oxlint --type-aware --deny-warnings -c ../../oxlint.config.mts --fix .",
9792
+ lint: "node ../../scripts/run-with-repo-node.mjs oxlint --type-aware --deny-warnings -c ../../.oxlintrc.json . && node ../../scripts/checks/check-bun-test-integrity.mjs",
9793
+ "lint:fix": "node ../../scripts/run-with-repo-node.mjs oxlint --type-aware --deny-warnings -c ../../.oxlintrc.json --fix .",
5692
9794
  "type-check": "tsc --noEmit",
5693
9795
  "test:safety": "node ../../scripts/ci/run-named-test-files.mjs bun test --files-from test-lists/test-safety.txt",
5694
9796
  ci: "bun run lint && bun run type-check && bun run test:safety && bun run docs:check && bun run changelog:check && bun run build && bun run smoke:package && bun run smoke:binaries",
@@ -5711,6 +9813,8 @@ var package_default = {
5711
9813
  "@uru/release-contracts": "workspace:*",
5712
9814
  "@uru/types": "workspace:*",
5713
9815
  "bun-types": "1.3.14",
9816
+ "fast-check": "4.10.2",
9817
+ fflate: "0.8.3",
5714
9818
  typescript: "7.1.0-beta"
5715
9819
  },
5716
9820
  engines: {
@@ -5727,8 +9831,29 @@ var ExitCode = {
5727
9831
  Failure: 1,
5728
9832
  Cancelled: 2,
5729
9833
  Conflict: 3,
5730
- AuthRequired: 4
9834
+ AuthRequired: 4,
9835
+ NotFound: 5,
9836
+ Forbidden: 6,
9837
+ InvalidInput: 7
5731
9838
  };
9839
+ var OPERATION_ERROR_EXIT_CODES = {
9840
+ invalid_input: ExitCode.InvalidInput,
9841
+ not_found: ExitCode.NotFound,
9842
+ forbidden: ExitCode.Forbidden,
9843
+ conflict: ExitCode.Conflict,
9844
+ auth_required: ExitCode.AuthRequired,
9845
+ needs_connection: ExitCode.Failure,
9846
+ blocked_by_rule: ExitCode.Forbidden,
9847
+ needs_person: ExitCode.Failure,
9848
+ rate_limited: ExitCode.Failure,
9849
+ internal: ExitCode.Failure
9850
+ };
9851
+ function exitCodeForErrorCode(errorCode) {
9852
+ if (errorCode === GEM_SHARED_WITH_YOU_CODE) {
9853
+ return ExitCode.Forbidden;
9854
+ }
9855
+ return isOperationErrorCode(errorCode) ? OPERATION_ERROR_EXIT_CODES[errorCode] : undefined;
9856
+ }
5732
9857
 
5733
9858
  class CliError extends Error {
5734
9859
  exitCode;
@@ -5776,6 +9901,12 @@ function defaultCliErrorCode(exitCode) {
5776
9901
  return "conflict";
5777
9902
  case ExitCode.AuthRequired:
5778
9903
  return "auth_required";
9904
+ case ExitCode.NotFound:
9905
+ return "not_found";
9906
+ case ExitCode.Forbidden:
9907
+ return "forbidden";
9908
+ case ExitCode.InvalidInput:
9909
+ return "invalid_input";
5779
9910
  case ExitCode.Failure:
5780
9911
  return "failure";
5781
9912
  case ExitCode.Ok:
@@ -5835,7 +9966,7 @@ function gemToolError(operation, value) {
5835
9966
  return new CliError(`Gem ${operation} failed: code=${error.code}; message=${error.message}; error_id=${error.error_id}`, {
5836
9967
  errorCode: error.code,
5837
9968
  errorId: error.error_id,
5838
- ...error.code === "source_revision_conflict" ? { code: ExitCode.Conflict } : {}
9969
+ ...error.code === "revision_conflict" || error.code === "artifact_revision_conflict" || error.code === "version_tip_not_current" || error.code === "source_state_unavailable" ? { code: ExitCode.Conflict } : {}
5839
9970
  });
5840
9971
  }
5841
9972
  function requiredString(record, key, label) {
@@ -5858,12 +9989,6 @@ var TOOL_OUTPUT_REF_PATTERN = /^uru:tool-output:v1:[A-Za-z0-9_-]{1,512}$/u;
5858
9989
  var RESULT_REF_META_KEY = "uru/resultRef";
5859
9990
  var RESULT_RETENTION_META_KEY = "uru/resultRetention";
5860
9991
  var RESULT_RETENTION_META_VALUE = "v1";
5861
- var RESULT_HANDLE_META_KEYS = new Set([
5862
- RESULT_REF_META_KEY,
5863
- "uru/resultBytes",
5864
- "uru/resultSha256",
5865
- RESULT_RETENTION_META_KEY
5866
- ]);
5867
9992
 
5868
9993
  class UruApiClient {
5869
9994
  apiUrl;
@@ -5965,7 +10090,7 @@ class UruApiClient {
5965
10090
  }
5966
10091
  async gemToolResult(body, parameters, operation) {
5967
10092
  const result = toolTransportResult(body, parameters);
5968
- const resultRef = isJsonObject(result) ? retainedToolResultRef(result, "Meta") : null;
10093
+ const resultRef = isJsonObject(result) ? retainedToolResultRef(result) : null;
5969
10094
  return gemResult2(resultRef === null ? result : await this.readCompleteToolOutput(resultRef), operation);
5970
10095
  }
5971
10096
  async streamTool(name, parameters, onEvent, operation) {
@@ -5978,33 +10103,6 @@ class UruApiClient {
5978
10103
  async api(path, options) {
5979
10104
  return this.request(path, options);
5980
10105
  }
5981
- async executeAction(ref, argumentsValue, options = {}) {
5982
- const idempotencyKey = options.idempotencyKey;
5983
- if (idempotencyKey !== undefined && (idempotencyKey.trim() === "" || idempotencyKey.trim() !== idempotencyKey || idempotencyKey.length > 256 || /[\r\n]/.test(idempotencyKey))) {
5984
- throw new CliError("Use a non-empty idempotency key under 257 characters on one line.");
5985
- }
5986
- const body = settledActionResult(await this.request("/api/tool-control-plane/actions/execute", {
5987
- method: "POST",
5988
- body: { ref, arguments: argumentsValue },
5989
- ...idempotencyKey === undefined ? {} : { idempotencyKey }
5990
- }), argumentsValue);
5991
- return await this.readRetainedActionResult(body, argumentsValue) ?? body;
5992
- }
5993
- async readRetainedActionResult(body, argumentsValue) {
5994
- const resultRef = retainedToolResultRef(body, "_meta");
5995
- if (resultRef === null)
5996
- return null;
5997
- const value = await this.readCompleteToolOutput(resultRef);
5998
- if (!isOwnedActionEnvelope(body))
5999
- return settledActionResult(value, argumentsValue);
6000
- const { _meta: meta, ...evidence } = body;
6001
- const ownMeta = isJsonObject(meta) ? Object.fromEntries(Object.entries(meta).filter(([key]) => !RESULT_HANDLE_META_KEYS.has(key))) : {};
6002
- return settledActionResult({
6003
- ...evidence,
6004
- result: value,
6005
- ...Object.keys(ownMeta).length === 0 ? {} : { _meta: ownMeta }
6006
- }, argumentsValue);
6007
- }
6008
10106
  async readCompleteToolOutput(resultRef, pageBytes = TOOL_OUTPUT_PAGE_BYTES) {
6009
10107
  const chunks = [];
6010
10108
  let nextOffset = 0;
@@ -6233,28 +10331,8 @@ function parseToolOutputContentRange(value) {
6233
10331
  }
6234
10332
  return { start, end, total };
6235
10333
  }
6236
- function settledActionResult(body, requestBody) {
6237
- if (!isJsonObject(body))
6238
- throw new CliError("The action returned an invalid result.");
6239
- if (body["isError"] === true)
6240
- throw nestedMcpToolError(body, requestBody);
6241
- if (body["success"] === false)
6242
- throw toolTransportError(body, requestBody);
6243
- const nested = body["result"];
6244
- if (isJsonObject(nested) && nested["isError"] === true)
6245
- throw nestedMcpToolError(nested, requestBody);
6246
- if (isJsonObject(nested) && isToolResultEnvelope(nested))
6247
- throw toolTransportError(nested, requestBody);
6248
- return body;
6249
- }
6250
- function isOwnedActionEnvelope(body) {
6251
- return typeof body["success"] === "boolean" && Object.hasOwn(body, "result");
6252
- }
6253
- function retainedToolResultRef(body, metadataKey) {
6254
- const handle = isOwnedActionEnvelope(body) ? body["result"] : body;
6255
- if (!isJsonObject(handle))
6256
- return null;
6257
- const meta = handle[metadataKey];
10334
+ function retainedToolResultRef(handle) {
10335
+ const meta = handle["Meta"];
6258
10336
  const structured = handle["structuredContent"];
6259
10337
  if (!isJsonObject(meta) || !isJsonObject(structured))
6260
10338
  return null;
@@ -6290,7 +10368,7 @@ function nestedMcpToolError(result, requestBody) {
6290
10368
  const tip = pickString(structured, ["tip"]) ?? error.tip;
6291
10369
  const safeTip = tip === undefined ? undefined : stripTerminalControl(redactValues(tip, redactions));
6292
10370
  return new CliError(error.message, {
6293
- code: isWorkspaceCallRefusalCode(errorCode) ? ExitCode.Failure : error.exitCode,
10371
+ code: exitCodeForErrorCode(errorCode) ?? (isWorkspaceCallRefusalCode(errorCode) ? ExitCode.Failure : error.exitCode),
6294
10372
  errorCode,
6295
10373
  ...errorId === undefined ? {} : { errorId },
6296
10374
  ...httpStatus === undefined ? {} : { httpStatus },
@@ -6317,6 +10395,10 @@ function toolTransportError(body, requestBody) {
6317
10395
  if (isWorkspaceCallRefusalCode(error.errorCode)) {
6318
10396
  return new CliError(message, { code: ExitCode.Failure, ...structured });
6319
10397
  }
10398
+ const contractExitCode = exitCodeForErrorCode(error.errorCode);
10399
+ if (contractExitCode !== undefined) {
10400
+ return new CliError(message, { code: contractExitCode, ...structured });
10401
+ }
6320
10402
  if (status === 409) {
6321
10403
  return new CliError(message, {
6322
10404
  code: ExitCode.Conflict,
@@ -6457,7 +10539,7 @@ function apiError(status, payload, requestBody) {
6457
10539
  const safeServerDetails = isJsonObject(serverDetails) ? redactJsonDetails(serverDetails, redactions) : undefined;
6458
10540
  return new CliError(message, {
6459
10541
  ...tip === undefined ? {} : { tip: stripTerminalControl(redactValues(tip, redactions)) },
6460
- code: status === 401 && !isWorkspaceCallRefusalCode(backendCode) ? ExitCode.AuthRequired : ExitCode.Failure,
10542
+ code: exitCodeForErrorCode(backendCode) ?? (status === 401 && !isWorkspaceCallRefusalCode(backendCode) ? ExitCode.AuthRequired : ExitCode.Failure),
6461
10543
  errorCode: backendCode ?? (status === 401 ? "auth_required" : status === 403 ? "permission_denied" : "api_request_failed"),
6462
10544
  httpStatus: status,
6463
10545
  ...errorId === undefined ? {} : { errorId },