@lobu/runtime-device 20.1.0 → 21.0.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.
Files changed (121) hide show
  1. package/dist/component.json +1 -1
  2. package/dist/dependencies.bun.lock +46 -40
  3. package/npm-shrinkwrap.json +283 -237
  4. package/package.json +1 -1
  5. package/vendor/cli/dist/commands/_lib/apply/apply-cmd.d.ts +7 -2
  6. package/vendor/cli/dist/commands/_lib/apply/apply-cmd.js +77 -75
  7. package/vendor/cli/dist/commands/_lib/apply/client.d.ts +40 -25
  8. package/vendor/cli/dist/commands/_lib/apply/client.js +31 -39
  9. package/vendor/cli/dist/commands/_lib/apply/deployment.d.ts +1 -1
  10. package/vendor/cli/dist/commands/_lib/apply/deployment.js +2 -2
  11. package/vendor/cli/dist/commands/_lib/apply/desired-state.d.ts +47 -11
  12. package/vendor/cli/dist/commands/_lib/apply/desired-state.js +106 -7
  13. package/vendor/cli/dist/commands/_lib/apply/diff.d.ts +14 -6
  14. package/vendor/cli/dist/commands/_lib/apply/diff.js +42 -23
  15. package/vendor/cli/dist/commands/_lib/apply/map-config.js +2 -3
  16. package/vendor/cli/dist/commands/_lib/apply/render.js +2 -0
  17. package/vendor/cli/dist/commands/_lib/apply/rollback-cmd.js +3 -3
  18. package/vendor/cli/dist/commands/_lib/connector-loader.d.ts +5 -1
  19. package/vendor/cli/dist/commands/_lib/connector-loader.js +1 -1
  20. package/vendor/cli/dist/commands/_lib/ensure-deps-installed.d.ts +15 -26
  21. package/vendor/cli/dist/commands/_lib/ensure-deps-installed.js +227 -136
  22. package/vendor/cli/dist/commands/_lib/view-bundler.d.ts +33 -0
  23. package/vendor/cli/dist/commands/_lib/view-bundler.js +207 -0
  24. package/vendor/cli/dist/commands/_lib/view-reapply.d.ts +60 -0
  25. package/vendor/cli/dist/commands/_lib/view-reapply.js +182 -0
  26. package/vendor/cli/dist/commands/dev.d.ts +14 -5
  27. package/vendor/cli/dist/commands/dev.js +56 -8
  28. package/vendor/cli/dist/commands/init.d.ts +1 -1
  29. package/vendor/cli/dist/commands/init.js +4 -4
  30. package/vendor/cli/dist/commands/login.js +3 -0
  31. package/vendor/cli/dist/config/define.d.ts +25 -8
  32. package/vendor/cli/dist/config/define.js +24 -0
  33. package/vendor/cli/dist/connectors/README.md +15 -16
  34. package/vendor/cli/dist/connectors/chat-user-identity.ts +41 -0
  35. package/vendor/cli/dist/connectors/github.ts +15 -9
  36. package/vendor/cli/dist/connectors/google-identity.ts +11 -0
  37. package/vendor/cli/dist/connectors/google_calendar.ts +21 -31
  38. package/vendor/cli/dist/connectors/google_drive.ts +106 -131
  39. package/vendor/cli/dist/connectors/google_gmail.ts +53 -30
  40. package/vendor/cli/dist/connectors/hackernews.ts +2 -5
  41. package/vendor/cli/dist/connectors/jira.ts +62 -27
  42. package/vendor/cli/dist/connectors/linear.ts +55 -21
  43. package/vendor/cli/dist/connectors/microsoft_outlook.ts +151 -110
  44. package/vendor/cli/dist/connectors/postgres.ts +19 -11
  45. package/vendor/cli/dist/connectors/producthunt.ts +8 -6
  46. package/vendor/cli/dist/connectors/reddit.ts +2 -2
  47. package/vendor/cli/dist/connectors/rss.ts +2 -2
  48. package/vendor/cli/dist/connectors/slack-identity.ts +19 -0
  49. package/vendor/cli/dist/connectors/whatsapp_web.ts +5 -4
  50. package/vendor/cli/dist/connectors/x.ts +32 -17
  51. package/vendor/cli/dist/connectors/youtube.ts +18 -5
  52. package/vendor/cli/dist/internal/connector-compiler.d.ts +1 -1
  53. package/vendor/cli/dist/internal/connector-compiler.js +216 -17
  54. package/vendor/cli/dist/internal/credentials.js +5 -1
  55. package/vendor/cli/dist/internal/oauth.d.ts +15 -1
  56. package/vendor/cli/dist/internal/oauth.js +9 -1
  57. package/vendor/cli/dist/runtime-components.json +4 -4
  58. package/vendor/cli/package.json +2 -1
  59. package/vendor/connector-sdk/dist/connector-runtime.d.ts +4 -6
  60. package/vendor/connector-sdk/dist/connector-runtime.js +3 -5
  61. package/vendor/connector-sdk/dist/connector-types.d.ts +28 -13
  62. package/vendor/connector-sdk/dist/define-connector.d.ts +4 -1
  63. package/vendor/connector-sdk/dist/define-connector.js +4 -1
  64. package/vendor/connector-sdk/dist/http-client.d.ts +18 -7
  65. package/vendor/connector-sdk/dist/http-client.js +15 -13
  66. package/vendor/connector-sdk/dist/index.d.ts +1 -1
  67. package/vendor/connector-sdk/dist/retry.d.ts +15 -3
  68. package/vendor/connector-sdk/dist/retry.js +40 -64
  69. package/vendor/connector-sdk/package.json +1 -1
  70. package/vendor/connector-worker/dist/agent-turn/guest-entry.js +122 -10
  71. package/vendor/connector-worker/dist/agent-turn/guest.bundle.js +78 -10
  72. package/vendor/connector-worker/dist/agent-turn/types.d.ts +34 -4
  73. package/vendor/connector-worker/dist/compile/index.d.ts +21 -2
  74. package/vendor/connector-worker/dist/compile/index.js +41 -8
  75. package/vendor/connector-worker/dist/compile/source-capture.d.ts +10 -0
  76. package/vendor/connector-worker/dist/compile/source-capture.js +108 -0
  77. package/vendor/connector-worker/dist/daemon/agent-turn.js +97 -10
  78. package/vendor/connector-worker/dist/daemon/automation-process.d.ts +32 -0
  79. package/vendor/connector-worker/dist/daemon/automation-process.js +102 -1
  80. package/vendor/connector-worker/dist/daemon/automation.d.ts +1 -1
  81. package/vendor/connector-worker/dist/daemon/builtins/index.js +8 -0
  82. package/vendor/connector-worker/dist/daemon/builtins/os-shell.d.ts +13 -1
  83. package/vendor/connector-worker/dist/daemon/builtins/os-shell.js +28 -2
  84. package/vendor/connector-worker/dist/daemon/executor.d.ts +0 -1
  85. package/vendor/connector-worker/dist/daemon/executor.js +42 -51
  86. package/vendor/connector-worker/dist/daemon/start.js +5 -1
  87. package/vendor/connector-worker/dist/executor/interface.d.ts +12 -8
  88. package/vendor/connector-worker/dist/executor/isolate.js +45 -28
  89. package/vendor/connector-worker/dist/self-check/index.js +15 -13
  90. package/vendor/connector-worker/package.json +1 -1
  91. package/vendor/core/dist/agent-policy.js +3 -0
  92. package/vendor/core/dist/connector-query-errors.d.ts +3 -3
  93. package/vendor/core/dist/connector-query-errors.js +8 -3
  94. package/vendor/core/dist/contracts/tools/manage-connections.d.ts +24 -0
  95. package/vendor/core/dist/contracts/tools/manage-connections.js +13 -0
  96. package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +15 -25
  97. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +3 -5
  98. package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +11 -0
  99. package/vendor/core/dist/contracts/tools/manage-feeds.js +12 -1
  100. package/vendor/core/dist/contracts/tools/manage-operations.d.ts +47 -6
  101. package/vendor/core/dist/contracts/tools/manage-operations.js +36 -1
  102. package/vendor/core/dist/contracts/tools/manage-views.d.ts +293 -0
  103. package/vendor/core/dist/contracts/tools/manage-views.js +203 -0
  104. package/vendor/core/dist/contracts/tools/source-files-schema.d.ts +7 -0
  105. package/vendor/core/dist/contracts/tools/source-files-schema.js +19 -0
  106. package/vendor/core/dist/contracts/tools/source-files.d.ts +14 -0
  107. package/vendor/core/dist/contracts/tools/source-files.js +55 -0
  108. package/vendor/core/dist/contracts/tools/view-content-hash.d.ts +37 -0
  109. package/vendor/core/dist/contracts/tools/view-content-hash.js +58 -0
  110. package/vendor/core/dist/contracts/tools/view-path.d.ts +18 -0
  111. package/vendor/core/dist/contracts/tools/view-path.js +24 -0
  112. package/vendor/core/dist/contracts/worker/protocol.d.ts +73 -8
  113. package/vendor/core/dist/contracts/worker/protocol.js +58 -9
  114. package/vendor/core/dist/credentials.d.ts +16 -1
  115. package/vendor/core/dist/credentials.js +10 -1
  116. package/vendor/core/dist/reserved.d.ts +3 -3
  117. package/vendor/core/dist/reserved.js +9 -1
  118. package/vendor/core/dist/utils/secret-redaction.js +2 -0
  119. package/vendor/core/package.json +25 -5
  120. package/vendor/core/dist/contracts/tools/manage-view-templates.d.ts +0 -165
  121. package/vendor/core/dist/contracts/tools/manage-view-templates.js +0 -130
@@ -732,6 +732,7 @@ exports.CompleteRequestSchema = typebox_1.Type.Composite([
732
732
  items_collected: typebox_1.Type.Optional(typebox_1.Type.Integer()),
733
733
  error_message: typebox_1.Type.Optional(typebox_1.Type.String()),
734
734
  checkpoint: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown())),
735
+ more: typebox_1.Type.Optional(typebox_1.Type.Boolean()),
735
736
  auth_update: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown())),
736
737
  }),
737
738
  exports.WorkerExitDiagnosticsSchema,
@@ -840,13 +841,21 @@ exports.TURN_TOOL_OUTPUT_MAX_CHARS = 2000;
840
841
  * The server renders this into the established `tool_use` custom event, so the
841
842
  * SPA, promptfoo provider and menubar keep one tool-trace shape.
842
843
  *
843
- * Best-effort like the delta it rides with, and for the same reason: a tool
844
- * trace is a VIEW of the turn, never the turn's answer, so a dropped one costs
845
- * visibility and nothing else.
844
+ * Mandatory external-effect evidence. The worker retains each trace until the
845
+ * server explicitly acknowledges durable storage; capacity overflow fails the
846
+ * turn honestly rather than dropping evidence.
846
847
  */
847
848
  exports.TurnToolEventSchema = typebox_1.Type.Object({
848
849
  tool_call_id: typebox_1.Type.String({ maxLength: 256 }),
849
850
  name: typebox_1.Type.String({ maxLength: 256 }),
851
+ /**
852
+ * The accepted input run this call was started for, so a result that lands
853
+ * after a mid-turn follow-up stays attributed to the message that initiated
854
+ * it rather than to whichever input is active when it finishes. Absent on
855
+ * traces from workers that predate per-input attribution; the completion
856
+ * route then attributes them to the owning input.
857
+ */
858
+ input_run_id: typebox_1.Type.Optional(typebox_1.Type.Integer({ minimum: 1 })),
850
859
  /**
851
860
  * The call's arguments, as the model sent them. The SPA renders `input` as
852
861
  * the tool row's args. Absent when the start of the call was not observed.
@@ -872,12 +881,14 @@ exports.TurnToolEventSchema = typebox_1.Type.Object({
872
881
  * How many finished tool traces a turn holds at once, on the worker's queue and
873
882
  * as the bound on the completion body's trailing batch.
874
883
  *
875
- * One definition because it is now both: the worker drops the oldest past this
876
- * cap, and the completion route rejects a body that exceeds it. A trace is a
877
- * view of the turn, so a turn that spends its budget on tool calls sheds the
878
- * oldest rather than growing an unbounded queue or an unbounded request.
884
+ * One definition because it is now both: the worker fails the turn rather than
885
+ * exceed this cap, and the completion route rejects a body that exceeds it. A
886
+ * trace is mandatory external-effect evidence, so a turn that spends its budget
887
+ * on tool calls fails honestly with its retained prefix instead of growing an
888
+ * unbounded queue, shedding the oldest silently, or filing an unbounded
889
+ * request.
879
890
  */
880
- exports.TURN_TOOL_EVENT_QUEUE_MAX = 20;
891
+ exports.TURN_TOOL_EVENT_QUEUE_MAX = 50;
881
892
  /** Per-execution input bound shared by repeatable offers and committed receipts. */
882
893
  exports.AGENT_TURN_INPUT_MAX = 32;
883
894
  exports.CompleteAgentTurnRequestSchema = typebox_1.Type.Object({
@@ -896,6 +907,27 @@ exports.CompleteAgentTurnRequestSchema = typebox_1.Type.Object({
896
907
  consumed_inputs: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
897
908
  run_id: typebox_1.Type.Integer({ minimum: 1 }),
898
909
  session_entry_id: typebox_1.Type.String({ minLength: 1 }),
910
+ /**
911
+ * This input's own answer text, not the execution's. Present on
912
+ * receipts from workers with per-input attribution; absent on
913
+ * receipts from older workers, which the completion route delivers
914
+ * as one execution-wide reply (the pre-#3662 contract those claims
915
+ * were admitted under).
916
+ */
917
+ response_text: typebox_1.Type.Optional(typebox_1.Type.String({ minLength: 1, maxLength: 32000 })),
918
+ /**
919
+ * The tools this input's answer actually used, in first-call order.
920
+ * Per-input like the answer: never the execution-wide ledger, which
921
+ * would attribute a sibling input's calls to this reply.
922
+ */
923
+ tools_used: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String({ maxLength: 256 }), { maxItems: 50 })),
924
+ /**
925
+ * The first tool error attributed to this input, quoted exactly as the
926
+ * tool returned it. Preserved independently of how the model paraphrases
927
+ * the failure in prose, so the durable record keeps the actionable
928
+ * message even when the reply does not.
929
+ */
930
+ first_error: typebox_1.Type.Optional(typebox_1.Type.String({ minLength: 1, maxLength: exports.TURN_TOOL_OUTPUT_MAX_CHARS })),
899
931
  }), { maxItems: exports.AGENT_TURN_INPUT_MAX })),
900
932
  /**
901
933
  * Every tool this turn invoked, first-call order. Absent and `[]` are NOT
@@ -904,6 +936,14 @@ exports.CompleteAgentTurnRequestSchema = typebox_1.Type.Object({
904
936
  * must send the array even when it called nothing.
905
937
  */
906
938
  tools_used: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())),
939
+ /**
940
+ * The owner input's first tool error, quoted exactly as the tool returned
941
+ * it. Steered inputs carry theirs on their `consumed_inputs` receipts, so
942
+ * every terminal reply is stamped with its own input's failure rather than
943
+ * the execution-wide first one. Preserved independently of how the model
944
+ * paraphrases the failure in prose.
945
+ */
946
+ first_error: typebox_1.Type.Optional(typebox_1.Type.String({ minLength: 1, maxLength: exports.TURN_TOOL_OUTPUT_MAX_CHARS })),
907
947
  /**
908
948
  * The turn already posted its answer INTO the conversation it is replying to,
909
949
  * through the `send_message`/`present_event` conversation tool. The user has
@@ -1049,7 +1089,7 @@ exports.HeartbeatRequestSchema = typebox_1.Type.Object({
1049
1089
  * the same reason: the turn already reports on this interval, and where the
1050
1090
  * traces are delivered is read from the run's own row, never from this body.
1051
1091
  */
1052
- turn_tool_events: typebox_1.Type.Optional(typebox_1.Type.Array(exports.TurnToolEventSchema)),
1092
+ turn_tool_events: typebox_1.Type.Optional(typebox_1.Type.Array(exports.TurnToolEventSchema, { maxItems: exports.TURN_TOOL_EVENT_QUEUE_MAX })),
1053
1093
  });
1054
1094
  /**
1055
1095
  * Request the gateway dispatch a chrome connector action on behalf of a
@@ -1101,6 +1141,12 @@ exports.DispatchChromeActionResponseSchema = typebox_1.Type.Object({
1101
1141
  * already passed acknowledges without publishing, and the worker retires the
1102
1142
  * batch — there is nothing more it can do about it. Only the ABSENCE of an ack
1103
1143
  * keeps the text queued.
1144
+ *
1145
+ * `turn_tool_ack` is the same honesty for the tool traces that rode the beat:
1146
+ * `received` names how many of the sent traces the server durably stored. The
1147
+ * worker retires only that prefix and re-sends the rest. A liveness-only beat
1148
+ * carries no ack and acknowledges nothing; only its absence keeps evidence
1149
+ * queued.
1104
1150
  */
1105
1151
  exports.HeartbeatResponseSchema = typebox_1.Type.Object({
1106
1152
  continue: typebox_1.Type.Optional(typebox_1.Type.Boolean()),
@@ -1130,5 +1176,8 @@ exports.HeartbeatResponseSchema = typebox_1.Type.Object({
1130
1176
  sequence: typebox_1.Type.Integer({ minimum: 0 }),
1131
1177
  published: typebox_1.Type.Boolean(),
1132
1178
  })),
1179
+ turn_tool_ack: typebox_1.Type.Optional(typebox_1.Type.Object({
1180
+ received: typebox_1.Type.Integer({ minimum: 0 }),
1181
+ })),
1133
1182
  });
1134
1183
  //# sourceMappingURL=protocol.js.map
@@ -17,6 +17,13 @@ export interface OAuthClientInfo {
17
17
  tokenEndpoint?: string;
18
18
  revocationEndpoint?: string;
19
19
  userinfoEndpoint?: string;
20
+ /**
21
+ * RFC 8707 resource indicator this grant was minted for (e.g.
22
+ * `https://app.lobu.ai/mcp/<workspace>`). Recorded at login so every later
23
+ * refresh can replay it — the issuer rejects a resource-scoped refresh that
24
+ * omits or changes the indicator.
25
+ */
26
+ resource?: string;
20
27
  }
21
28
  /**
22
29
  * The auth-relevant fields every stored credential carries. Consumers may store
@@ -74,9 +81,17 @@ export interface RefreshedToken {
74
81
  * body). Returns null on any network / non-2xx / parse failure. The issuer may
75
82
  * rotate the refresh token, so callers MUST persist the returned `refreshToken`
76
83
  * when present.
84
+ *
85
+ * When the grant was minted for a specific protected resource, `options.resource`
86
+ * MUST be the one recorded at authorization time. The Lobu issuer compares the
87
+ * refresh request's indicator against the stored one and answers `invalid_grant`
88
+ * on any mismatch — including an omitted indicator — so a resource-scoped
89
+ * credential that refreshes without it can never be renewed.
77
90
  */
78
91
  export declare function refreshOAuthToken(tokenEndpoint: string, client: {
79
92
  clientId: string;
80
93
  clientSecret?: string;
81
- }, refreshToken: string): Promise<RefreshedToken | null>;
94
+ }, refreshToken: string, options?: {
95
+ resource?: string;
96
+ }): Promise<RefreshedToken | null>;
82
97
  //# sourceMappingURL=credentials.d.ts.map
@@ -133,8 +133,14 @@ function credentialCanRefresh(cred) {
133
133
  * body). Returns null on any network / non-2xx / parse failure. The issuer may
134
134
  * rotate the refresh token, so callers MUST persist the returned `refreshToken`
135
135
  * when present.
136
+ *
137
+ * When the grant was minted for a specific protected resource, `options.resource`
138
+ * MUST be the one recorded at authorization time. The Lobu issuer compares the
139
+ * refresh request's indicator against the stored one and answers `invalid_grant`
140
+ * on any mismatch — including an omitted indicator — so a resource-scoped
141
+ * credential that refreshes without it can never be renewed.
136
142
  */
137
- async function refreshOAuthToken(tokenEndpoint, client, refreshToken) {
143
+ async function refreshOAuthToken(tokenEndpoint, client, refreshToken, options = {}) {
138
144
  const body = {
139
145
  grant_type: "refresh_token",
140
146
  refresh_token: refreshToken,
@@ -142,6 +148,9 @@ async function refreshOAuthToken(tokenEndpoint, client, refreshToken) {
142
148
  };
143
149
  if (client.clientSecret)
144
150
  body.client_secret = client.clientSecret;
151
+ // RFC 8707: echo the authorized resource so the issuer's audience check passes.
152
+ if (options.resource)
153
+ body.resource = options.resource;
145
154
  let response;
146
155
  try {
147
156
  response = await fetch(tokenEndpoint, {
@@ -17,7 +17,7 @@ export declare function isSystemEntityType(et: {
17
17
  * Owner-level route segments under /$owner/. Entity type slugs and org slugs
18
18
  * must never collide with these.
19
19
  */
20
- export declare const OWNER_ROUTE_SEGMENTS: readonly ["activity", "agents", "connectors", "memory", "members", "settings"];
20
+ export declare const OWNER_ROUTE_SEGMENTS: readonly ["activity", "agents", "connectors", "data", "memory", "members", "settings"];
21
21
  /**
22
22
  * Legacy page slugs removed from the UI router. Bookmarks and previously sent
23
23
  * chat messages can still contain URLs under these segments, so the segments
@@ -31,14 +31,14 @@ export declare const REMOVED_OWNER_SEGMENTS: readonly ["events", "automations",
31
31
  * pages, global prefixes, and infra subdomains that must not be claimed as
32
32
  * org slugs.
33
33
  */
34
- export declare const RESERVED_PATHS: readonly ["activity", "agents", "connectors", "memory", "members", "settings", "events", "automations", "connections", "sources", "environments", "infrastructure", "inference-providers", "devices", "auth", "api", "inbox", "templates", "help", "account", "me", "admin", "health", "login", "logout", "signup", "register", "contents", "entity-types", "www", "mcp", "static", "assets", "cdn", "docs", "mail", "connector", "oauth", "orgs", "slack", "dashboard"];
34
+ export declare const RESERVED_PATHS: readonly ["activity", "agents", "connectors", "data", "memory", "members", "settings", "events", "automations", "connections", "sources", "environments", "infrastructure", "inference-providers", "devices", "auth", "api", "inbox", "templates", "help", "account", "me", "admin", "health", "login", "logout", "signup", "register", "contents", "entity-types", "www", "mcp", "static", "assets", "cdn", "docs", "mail", "connector", "oauth", "orgs", "slack", "dashboard"];
35
35
  export declare const RESERVED_PATHS_SET: ReadonlySet<string>;
36
36
  /**
37
37
  * Slugs users cannot use when *creating* an entity type. Route collisions plus
38
38
  * product words that are not knowledge types. Create-time hygiene only — not
39
39
  * hide/prune policy (that is `$` prefix only).
40
40
  */
41
- export declare const RESERVED_ENTITY_TYPE_SLUGS: readonly ["activity", "agents", "connectors", "memory", "members", "settings", "events", "automations", "connections", "sources", "environments", "infrastructure", "inference-providers", "devices", "entity-types", "recent", "chat", "organization", "user", "automation", "content", "source", "connector"];
41
+ export declare const RESERVED_ENTITY_TYPE_SLUGS: readonly ["activity", "agents", "connectors", "data", "memory", "members", "settings", "events", "automations", "connections", "sources", "environments", "infrastructure", "inference-providers", "devices", "entity-types", "recent", "chat", "-", "organization", "user", "automation", "content", "source", "connector"];
42
42
  /**
43
43
  * Whether a proposed entity-type slug is illegal for user/API create.
44
44
  * `$…` is reserved for platform-named types ($member, $resource).
@@ -13,6 +13,7 @@ exports.isSystemEntityType = isSystemEntityType;
13
13
  exports.isReservedEntityTypeSlug = isReservedEntityTypeSlug;
14
14
  exports.normalizeEntityTypeSlug = normalizeEntityTypeSlug;
15
15
  exports.isReservedConnectorKey = isReservedConnectorKey;
16
+ const view_path_1 = require("./contracts/tools/view-path");
16
17
  // ── Entity type classification ──────────────────────────────────────────────
17
18
  /**
18
19
  * True when a type is platform-owned (hidden from rail, never pruned).
@@ -30,6 +31,8 @@ exports.OWNER_ROUTE_SEGMENTS = [
30
31
  "activity",
31
32
  "agents",
32
33
  "connectors",
34
+ "data",
35
+ // Redirects to /events: stored notification permalinks point here.
33
36
  "memory",
34
37
  "members",
35
38
  "settings",
@@ -119,6 +122,9 @@ exports.RESERVED_ENTITY_TYPE_SLUGS = [
119
122
  "entity-types",
120
123
  "recent",
121
124
  "chat",
125
+ // The web host's view marker (`/<type>/-/views/<key>`): a type stored as `-`
126
+ // would make its own list page parse as a view path.
127
+ view_path_1.VIEW_PATH_MARKER,
122
128
  // Product words that are not knowledge types.
123
129
  "organization",
124
130
  "user",
@@ -132,7 +138,9 @@ exports.RESERVED_ENTITY_TYPE_SLUGS = [
132
138
  * `$…` is reserved for platform-named types ($member, $resource).
133
139
  */
134
140
  function isReservedEntityTypeSlug(slug) {
135
- const s = slug.toLowerCase();
141
+ // Checked in its STORED form: create rewrites `!` to `-` and `entity_types`
142
+ // to `entity-types`, so checking the raw input let those through.
143
+ const s = normalizeEntityTypeSlug(slug);
136
144
  if (s.startsWith("$"))
137
145
  return true;
138
146
  return exports.RESERVED_ENTITY_TYPE_SLUGS.includes(s);
@@ -111,6 +111,8 @@ function redactUriCredentials(value) {
111
111
  * non-denylisted key.
112
112
  */
113
113
  function deepRedactSecrets(value) {
114
+ if (value instanceof Date)
115
+ return value.toISOString();
114
116
  if (Array.isArray(value))
115
117
  return value.map(deepRedactSecrets);
116
118
  if (value && typeof value === "object") {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/core",
3
- "version": "20.1.0",
3
+ "version": "21.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Core types and utilities for Lobu agent platform",
6
6
  "repository": {
@@ -56,6 +56,11 @@
56
56
  "import": "./dist/errors.js",
57
57
  "require": "./dist/errors.js"
58
58
  },
59
+ "./connector-query-errors": {
60
+ "types": "./dist/connector-query-errors.d.ts",
61
+ "import": "./dist/connector-query-errors.js",
62
+ "require": "./dist/connector-query-errors.js"
63
+ },
59
64
  "./ajv": {
60
65
  "types": "./dist/utils/ajv.d.ts",
61
66
  "import": "./dist/utils/ajv.js",
@@ -121,10 +126,15 @@
121
126
  "import": "./dist/contracts/tools/manage-schedules.js",
122
127
  "require": "./dist/contracts/tools/manage-schedules.js"
123
128
  },
124
- "./contracts/tools/manage-view-templates": {
125
- "types": "./dist/contracts/tools/manage-view-templates.d.ts",
126
- "import": "./dist/contracts/tools/manage-view-templates.js",
127
- "require": "./dist/contracts/tools/manage-view-templates.js"
129
+ "./contracts/tools/manage-views": {
130
+ "types": "./dist/contracts/tools/manage-views.d.ts",
131
+ "import": "./dist/contracts/tools/manage-views.js",
132
+ "require": "./dist/contracts/tools/manage-views.js"
133
+ },
134
+ "./contracts/tools/view-content-hash": {
135
+ "types": "./dist/contracts/tools/view-content-hash.d.ts",
136
+ "import": "./dist/contracts/tools/view-content-hash.js",
137
+ "require": "./dist/contracts/tools/view-content-hash.js"
128
138
  },
129
139
  "./contracts/tools/manage-auth-profiles": {
130
140
  "types": "./dist/contracts/tools/manage-auth-profiles.d.ts",
@@ -195,6 +205,16 @@
195
205
  "types": "./dist/agent-tooling.d.ts",
196
206
  "import": "./dist/agent-tooling.js",
197
207
  "require": "./dist/agent-tooling.js"
208
+ },
209
+ "./contracts/tools/view-path": {
210
+ "types": "./dist/contracts/tools/view-path.d.ts",
211
+ "import": "./dist/contracts/tools/view-path.js",
212
+ "require": "./dist/contracts/tools/view-path.js"
213
+ },
214
+ "./contracts/tools/source-files": {
215
+ "types": "./dist/contracts/tools/source-files.d.ts",
216
+ "import": "./dist/contracts/tools/source-files.js",
217
+ "require": "./dist/contracts/tools/source-files.js"
198
218
  }
199
219
  },
200
220
  "dependencies": {
@@ -1,165 +0,0 @@
1
- import { type Static } from "@sinclair/typebox";
2
- import type { ActionInput } from "./action-input";
3
- export declare const ViewTemplateVersionRowSchema: import("@sinclair/typebox").TObject<{
4
- id: import("@sinclair/typebox").TInteger;
5
- version: import("@sinclair/typebox").TInteger;
6
- tab_name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
7
- tab_order: import("@sinclair/typebox").TInteger;
8
- json_template: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
9
- change_notes: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
10
- created_by: import("@sinclair/typebox").TString;
11
- created_by_username: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
12
- created_at: import("@sinclair/typebox").TString;
13
- }>;
14
- export type ViewTemplateVersionRow = Static<typeof ViewTemplateVersionRowSchema>;
15
- export declare const ViewTemplateTabInfoSchema: import("@sinclair/typebox").TObject<{
16
- tab_name: import("@sinclair/typebox").TString;
17
- tab_order: import("@sinclair/typebox").TInteger;
18
- current_version: import("@sinclair/typebox").TInteger;
19
- current_version_id: import("@sinclair/typebox").TInteger;
20
- json_template: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
21
- }>;
22
- export declare const SetViewTemplateAction: import("@sinclair/typebox").TObject<{
23
- action: import("@sinclair/typebox").TLiteral<"set">;
24
- resource_type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"entity_type">, import("@sinclair/typebox").TLiteral<"entity">]>;
25
- resource_id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
26
- json_template: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
27
- tab_name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
28
- tab_order: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
29
- change_notes: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
30
- }>;
31
- export declare const GetViewTemplateAction: import("@sinclair/typebox").TObject<{
32
- action: import("@sinclair/typebox").TLiteral<"get">;
33
- resource_type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"entity_type">, import("@sinclair/typebox").TLiteral<"entity">]>;
34
- resource_id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
35
- tab_name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
36
- }>;
37
- export declare const RollbackViewTemplateAction: import("@sinclair/typebox").TObject<{
38
- action: import("@sinclair/typebox").TLiteral<"rollback">;
39
- resource_type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"entity_type">, import("@sinclair/typebox").TLiteral<"entity">]>;
40
- resource_id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
41
- version: import("@sinclair/typebox").TNumber;
42
- tab_name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
43
- }>;
44
- export declare const RemoveViewTemplateTabAction: import("@sinclair/typebox").TObject<{
45
- action: import("@sinclair/typebox").TLiteral<"remove_tab">;
46
- resource_type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"entity_type">, import("@sinclair/typebox").TLiteral<"entity">]>;
47
- resource_id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
48
- tab_name: import("@sinclair/typebox").TString;
49
- }>;
50
- export declare const ClearViewTemplateAction: import("@sinclair/typebox").TObject<{
51
- action: import("@sinclair/typebox").TLiteral<"clear">;
52
- resource_type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"entity_type">, import("@sinclair/typebox").TLiteral<"entity">]>;
53
- resource_id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
54
- }>;
55
- export declare const ManageViewTemplatesSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
56
- action: import("@sinclair/typebox").TLiteral<"set">;
57
- resource_type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"entity_type">, import("@sinclair/typebox").TLiteral<"entity">]>;
58
- resource_id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
59
- json_template: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
60
- tab_name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
61
- tab_order: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
62
- change_notes: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
63
- }>, import("@sinclair/typebox").TObject<{
64
- action: import("@sinclair/typebox").TLiteral<"get">;
65
- resource_type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"entity_type">, import("@sinclair/typebox").TLiteral<"entity">]>;
66
- resource_id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
67
- tab_name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
68
- }>, import("@sinclair/typebox").TObject<{
69
- action: import("@sinclair/typebox").TLiteral<"rollback">;
70
- resource_type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"entity_type">, import("@sinclair/typebox").TLiteral<"entity">]>;
71
- resource_id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
72
- version: import("@sinclair/typebox").TNumber;
73
- tab_name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
74
- }>, import("@sinclair/typebox").TObject<{
75
- action: import("@sinclair/typebox").TLiteral<"remove_tab">;
76
- resource_type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"entity_type">, import("@sinclair/typebox").TLiteral<"entity">]>;
77
- resource_id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
78
- tab_name: import("@sinclair/typebox").TString;
79
- }>, import("@sinclair/typebox").TObject<{
80
- action: import("@sinclair/typebox").TLiteral<"clear">;
81
- resource_type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"entity_type">, import("@sinclair/typebox").TLiteral<"entity">]>;
82
- resource_id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
83
- }>]>;
84
- export type ManageViewTemplatesArgs = Static<typeof ManageViewTemplatesSchema>;
85
- export type ViewTemplateGetInput = ActionInput<ManageViewTemplatesArgs, "get">;
86
- export type ViewTemplateSetInput = ActionInput<ManageViewTemplatesArgs, "set">;
87
- export type ViewTemplateRollbackInput = ActionInput<ManageViewTemplatesArgs, "rollback">;
88
- export type ViewTemplateRemoveTabInput = ActionInput<ManageViewTemplatesArgs, "remove_tab">;
89
- /**
90
- * Result of `manage_view_templates` — discriminated union keyed on `action`.
91
- * TypeBox-first: `Static<>` derives the TS type from the same schema exposed as
92
- * the tool's `outputSchema`.
93
- */
94
- export declare const ManageViewTemplatesResultSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
95
- action: import("@sinclair/typebox").TLiteral<"set">;
96
- version: import("@sinclair/typebox").TObject<{
97
- id: import("@sinclair/typebox").TInteger;
98
- version: import("@sinclair/typebox").TInteger;
99
- tab_name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
100
- tab_order: import("@sinclair/typebox").TInteger;
101
- json_template: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
102
- change_notes: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
103
- created_by: import("@sinclair/typebox").TString;
104
- created_by_username: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
105
- created_at: import("@sinclair/typebox").TString;
106
- }>;
107
- message: import("@sinclair/typebox").TString;
108
- }>, import("@sinclair/typebox").TObject<{
109
- action: import("@sinclair/typebox").TLiteral<"get">;
110
- default_tab: import("@sinclair/typebox").TObject<{
111
- current: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
112
- id: import("@sinclair/typebox").TInteger;
113
- version: import("@sinclair/typebox").TInteger;
114
- tab_name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
115
- tab_order: import("@sinclair/typebox").TInteger;
116
- json_template: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
117
- change_notes: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
118
- created_by: import("@sinclair/typebox").TString;
119
- created_by_username: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
120
- created_at: import("@sinclair/typebox").TString;
121
- }>, import("@sinclair/typebox").TNull]>;
122
- history: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
123
- id: import("@sinclair/typebox").TInteger;
124
- version: import("@sinclair/typebox").TInteger;
125
- tab_name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
126
- tab_order: import("@sinclair/typebox").TInteger;
127
- json_template: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
128
- change_notes: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
129
- created_by: import("@sinclair/typebox").TString;
130
- created_by_username: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
131
- created_at: import("@sinclair/typebox").TString;
132
- }>>;
133
- }>;
134
- tabs: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
135
- tab_name: import("@sinclair/typebox").TString;
136
- tab_order: import("@sinclair/typebox").TInteger;
137
- current_version: import("@sinclair/typebox").TInteger;
138
- current_version_id: import("@sinclair/typebox").TInteger;
139
- json_template: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
140
- }>>;
141
- }>, import("@sinclair/typebox").TObject<{
142
- action: import("@sinclair/typebox").TLiteral<"rollback">;
143
- version: import("@sinclair/typebox").TObject<{
144
- id: import("@sinclair/typebox").TInteger;
145
- version: import("@sinclair/typebox").TInteger;
146
- tab_name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
147
- tab_order: import("@sinclair/typebox").TInteger;
148
- json_template: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
149
- change_notes: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
150
- created_by: import("@sinclair/typebox").TString;
151
- created_by_username: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
152
- created_at: import("@sinclair/typebox").TString;
153
- }>;
154
- message: import("@sinclair/typebox").TString;
155
- }>, import("@sinclair/typebox").TObject<{
156
- action: import("@sinclair/typebox").TLiteral<"remove_tab">;
157
- success: import("@sinclair/typebox").TBoolean;
158
- message: import("@sinclair/typebox").TString;
159
- }>, import("@sinclair/typebox").TObject<{
160
- action: import("@sinclair/typebox").TLiteral<"clear">;
161
- success: import("@sinclair/typebox").TBoolean;
162
- message: import("@sinclair/typebox").TString;
163
- }>]>;
164
- export type ManageViewTemplatesResult = Static<typeof ManageViewTemplatesResultSchema>;
165
- //# sourceMappingURL=manage-view-templates.d.ts.map
@@ -1,130 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ManageViewTemplatesResultSchema = exports.ManageViewTemplatesSchema = exports.ClearViewTemplateAction = exports.RemoveViewTemplateTabAction = exports.RollbackViewTemplateAction = exports.GetViewTemplateAction = exports.SetViewTemplateAction = exports.ViewTemplateTabInfoSchema = exports.ViewTemplateVersionRowSchema = void 0;
4
- const typebox_1 = require("@sinclair/typebox");
5
- // ============================================
6
- // View template versioning types + helpers
7
- // ============================================
8
- exports.ViewTemplateVersionRowSchema = typebox_1.Type.Object({
9
- id: typebox_1.Type.Integer(),
10
- version: typebox_1.Type.Integer(),
11
- tab_name: typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()]),
12
- tab_order: typebox_1.Type.Integer(),
13
- json_template: typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown()),
14
- change_notes: typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()]),
15
- created_by: typebox_1.Type.String(),
16
- created_by_username: typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()]),
17
- created_at: typebox_1.Type.String(),
18
- });
19
- exports.ViewTemplateTabInfoSchema = typebox_1.Type.Object({
20
- tab_name: typebox_1.Type.String(),
21
- tab_order: typebox_1.Type.Integer(),
22
- current_version: typebox_1.Type.Integer(),
23
- current_version_id: typebox_1.Type.Integer(),
24
- json_template: typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown()),
25
- });
26
- // ============================================
27
- // Input Schema (union of per-action variants)
28
- // ============================================
29
- //
30
- // The wire schema flattens this union into ONE MCP object and merges duplicate
31
- // properties first-occurrence-wins, so a property carried by more than one
32
- // variant must read true for every one of them.
33
- const ResourceType = typebox_1.Type.Union([typebox_1.Type.Literal("entity_type"), typebox_1.Type.Literal("entity")], { description: "Type of resource: entity_type or entity" });
34
- const ResourceId = typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Number()], {
35
- description: "Resource identifier: entity type slug (string) or entity id (number)",
36
- });
37
- const TabName = typebox_1.Type.String({
38
- description: "Tab name. Omit for the default/overview tab; required for `remove_tab`. `get` returns the default tab and every named tab whether or not it is given.",
39
- });
40
- exports.SetViewTemplateAction = typebox_1.Type.Object({
41
- action: typebox_1.Type.Literal("set", {
42
- description: "Create a new version of a view template / tab.",
43
- }),
44
- resource_type: ResourceType,
45
- resource_id: ResourceId,
46
- json_template: typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown(), {
47
- description: '[set] The JSON template content. May include a data_sources key: { "data_sources": { "name": { "query": "SELECT ... FROM entities" } }, ...template }. Queries run against org-scoped virtual tables. Use {{entityId}} for current entity context.',
48
- }),
49
- tab_name: typebox_1.Type.Optional(TabName),
50
- tab_order: typebox_1.Type.Optional(typebox_1.Type.Number({ description: "[set] Sort order for tabs (default 0)" })),
51
- change_notes: typebox_1.Type.Optional(typebox_1.Type.String({ description: "[set] Notes describing the change" })),
52
- });
53
- exports.GetViewTemplateAction = typebox_1.Type.Object({
54
- action: typebox_1.Type.Literal("get", {
55
- description: "Fetch current default + tabs + history.",
56
- }),
57
- resource_type: ResourceType,
58
- resource_id: ResourceId,
59
- tab_name: typebox_1.Type.Optional(TabName),
60
- });
61
- exports.RollbackViewTemplateAction = typebox_1.Type.Object({
62
- action: typebox_1.Type.Literal("rollback", {
63
- description: "Roll back to a prior version.",
64
- }),
65
- resource_type: ResourceType,
66
- resource_id: ResourceId,
67
- version: typebox_1.Type.Number({
68
- description: "[rollback] Version number to rollback to",
69
- }),
70
- tab_name: typebox_1.Type.Optional(TabName),
71
- });
72
- exports.RemoveViewTemplateTabAction = typebox_1.Type.Object({
73
- action: typebox_1.Type.Literal("remove_tab", { description: "Delete a named tab." }),
74
- resource_type: ResourceType,
75
- resource_id: ResourceId,
76
- tab_name: TabName,
77
- });
78
- exports.ClearViewTemplateAction = typebox_1.Type.Object({
79
- action: typebox_1.Type.Literal("clear", {
80
- description: "Null the default (non-tab) template.",
81
- }),
82
- resource_type: ResourceType,
83
- resource_id: ResourceId,
84
- });
85
- exports.ManageViewTemplatesSchema = typebox_1.Type.Union([
86
- exports.SetViewTemplateAction,
87
- exports.GetViewTemplateAction,
88
- exports.RollbackViewTemplateAction,
89
- exports.RemoveViewTemplateTabAction,
90
- exports.ClearViewTemplateAction,
91
- ]);
92
- // ============================================
93
- // Result Types
94
- // ============================================
95
- /**
96
- * Result of `manage_view_templates` — discriminated union keyed on `action`.
97
- * TypeBox-first: `Static<>` derives the TS type from the same schema exposed as
98
- * the tool's `outputSchema`.
99
- */
100
- exports.ManageViewTemplatesResultSchema = typebox_1.Type.Union([
101
- typebox_1.Type.Object({
102
- action: typebox_1.Type.Literal("set"),
103
- version: exports.ViewTemplateVersionRowSchema,
104
- message: typebox_1.Type.String(),
105
- }),
106
- typebox_1.Type.Object({
107
- action: typebox_1.Type.Literal("get"),
108
- default_tab: typebox_1.Type.Object({
109
- current: typebox_1.Type.Union([exports.ViewTemplateVersionRowSchema, typebox_1.Type.Null()]),
110
- history: typebox_1.Type.Array(exports.ViewTemplateVersionRowSchema),
111
- }),
112
- tabs: typebox_1.Type.Array(exports.ViewTemplateTabInfoSchema),
113
- }),
114
- typebox_1.Type.Object({
115
- action: typebox_1.Type.Literal("rollback"),
116
- version: exports.ViewTemplateVersionRowSchema,
117
- message: typebox_1.Type.String(),
118
- }),
119
- typebox_1.Type.Object({
120
- action: typebox_1.Type.Literal("remove_tab"),
121
- success: typebox_1.Type.Boolean(),
122
- message: typebox_1.Type.String(),
123
- }),
124
- typebox_1.Type.Object({
125
- action: typebox_1.Type.Literal("clear"),
126
- success: typebox_1.Type.Boolean(),
127
- message: typebox_1.Type.String(),
128
- }),
129
- ]);
130
- //# sourceMappingURL=manage-view-templates.js.map