@lobu/runtime-device 24.7.0 → 24.9.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 (88) hide show
  1. package/dist/component.json +1 -1
  2. package/dist/dependencies.bun.lock +35 -51
  3. package/npm-shrinkwrap.json +214 -334
  4. package/package.json +4 -2
  5. package/vendor/cli/dist/bundled-skills/lobu/SKILL.md +14 -3
  6. package/vendor/cli/dist/chrome-extension/manifest.json +5 -4
  7. package/vendor/cli/dist/chrome-extension/tools.js +2 -3
  8. package/vendor/cli/dist/commands/_lib/apply/apply-cmd.js +27 -0
  9. package/vendor/cli/dist/commands/_lib/apply/client.d.ts +16 -5
  10. package/vendor/cli/dist/commands/_lib/apply/client.js +31 -9
  11. package/vendor/cli/dist/commands/_lib/apply/deployment.d.ts +8 -12
  12. package/vendor/cli/dist/commands/_lib/apply/deployment.js +14 -1
  13. package/vendor/cli/dist/commands/_lib/apply/desired-state.d.ts +8 -4
  14. package/vendor/cli/dist/commands/_lib/apply/desired-state.js +2 -1
  15. package/vendor/cli/dist/commands/_lib/apply/diff.d.ts +26 -7
  16. package/vendor/cli/dist/commands/_lib/apply/diff.js +101 -30
  17. package/vendor/cli/dist/commands/_lib/apply/map-config.js +29 -2
  18. package/vendor/cli/dist/commands/_lib/apply/render.js +2 -0
  19. package/vendor/cli/dist/commands/_lib/apply/shared.d.ts +20 -0
  20. package/vendor/cli/dist/commands/_lib/apply/shared.js +22 -0
  21. package/vendor/cli/dist/commands/_lib/init-from-org/bootstrap.js +14 -0
  22. package/vendor/cli/dist/commands/dev.js +28 -4
  23. package/vendor/cli/dist/commands/memory/_lib/seed-cmd.js +6 -2
  24. package/vendor/cli/dist/config/define.d.ts +21 -3
  25. package/vendor/cli/dist/connectors/README.md +6 -2
  26. package/vendor/cli/dist/connectors/github.ts +16 -3
  27. package/vendor/cli/dist/connectors/imessage.ts +953 -0
  28. package/vendor/cli/dist/connectors/linkedin.ts +20 -377
  29. package/vendor/cli/dist/connectors/market_quotes.ts +388 -91
  30. package/vendor/cli/dist/connectors/postgres.ts +21 -14
  31. package/vendor/cli/dist/connectors/x-dm-adapter.js +55 -21
  32. package/vendor/cli/dist/connectors/x.ts +1 -1
  33. package/vendor/cli/dist/runtime-components.json +4 -4
  34. package/vendor/cli/dist/templates/AGENTS.md.tmpl +1 -1
  35. package/vendor/cli/package.json +1 -1
  36. package/vendor/connector-sdk/dist/connector-types.d.ts +23 -2
  37. package/vendor/connector-sdk/package.json +1 -1
  38. package/vendor/connector-worker/dist/daemon/automation.js +7 -4
  39. package/vendor/connector-worker/dist/env.d.ts +15 -0
  40. package/vendor/connector-worker/dist/env.js +17 -0
  41. package/vendor/connector-worker/dist/executor/isolate.d.ts +3 -1
  42. package/vendor/connector-worker/dist/executor/isolate.js +32 -8
  43. package/vendor/connector-worker/package.json +1 -1
  44. package/vendor/core/dist/classify-error.d.ts +3 -4
  45. package/vendor/core/dist/classify-error.js +8 -8
  46. package/vendor/core/dist/connector-query-errors.d.ts +6 -0
  47. package/vendor/core/dist/connector-query-errors.js +4 -0
  48. package/vendor/core/dist/contracts/tools/collection-presentation.d.ts +17 -1
  49. package/vendor/core/dist/contracts/tools/collection-presentation.js +27 -3
  50. package/vendor/core/dist/contracts/tools/manage-automations.d.ts +39 -0
  51. package/vendor/core/dist/contracts/tools/manage-automations.js +11 -1
  52. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +1 -1
  53. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +2 -0
  54. package/vendor/core/dist/contracts/tools/manage-entity.js +7 -0
  55. package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +2 -0
  56. package/vendor/core/dist/contracts/tools/manage-feeds.js +3 -0
  57. package/vendor/core/dist/contracts/tools/manage-views.d.ts +249 -7
  58. package/vendor/core/dist/contracts/tools/manage-views.js +83 -21
  59. package/vendor/core/dist/contracts/tools/navigation.d.ts +248 -0
  60. package/vendor/core/dist/contracts/tools/navigation.js +284 -0
  61. package/vendor/core/dist/contracts/tools/view-attach.d.ts +7 -0
  62. package/vendor/core/dist/contracts/tools/view-attach.js +15 -0
  63. package/vendor/core/dist/contracts/tools/view-content-hash.d.ts +4 -1
  64. package/vendor/core/dist/contracts/tools/view-content-hash.js +4 -2
  65. package/vendor/core/dist/contracts/tools/view-definition.d.ts +2 -0
  66. package/vendor/core/dist/contracts/tools/view-definition.js +52 -0
  67. package/vendor/core/dist/contracts/tools/view-host.d.ts +68 -0
  68. package/vendor/core/dist/contracts/tools/view-host.js +30 -1
  69. package/vendor/core/dist/contracts/tools/view-scope.d.ts +31 -0
  70. package/vendor/core/dist/contracts/tools/view-scope.js +45 -0
  71. package/vendor/core/dist/error-report.js +1 -0
  72. package/vendor/core/dist/errors.d.ts +17 -24
  73. package/vendor/core/dist/errors.js +17 -24
  74. package/vendor/core/dist/types.d.ts +0 -6
  75. package/vendor/core/package.json +11 -1
  76. package/vendor/views/dist/api.d.ts +30 -5
  77. package/vendor/views/dist/api.js +22 -8
  78. package/vendor/views/dist/bridge.d.ts +17 -0
  79. package/vendor/views/dist/bridge.js +49 -1
  80. package/vendor/views/dist/components.d.ts +27 -5
  81. package/vendor/views/dist/components.js +57 -7
  82. package/vendor/views/dist/embed.d.ts +98 -0
  83. package/vendor/views/dist/embed.js +418 -0
  84. package/vendor/views/dist/index.d.ts +3 -1
  85. package/vendor/views/dist/index.js +1 -0
  86. package/vendor/views/package.json +1 -1
  87. package/vendor/cli/dist/connectors/linkedin-takeout.ts +0 -577
  88. package/vendor/cli/dist/connectors/takeout-utils.ts +0 -240
@@ -1,20 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ManageViewsResultSchema = exports.ManageViewsSchema = exports.RemoveViewAction = exports.ListViewsAction = exports.GetViewAction = exports.SetViewAction = exports.ViewRowSchema = exports.ViewDefinitionSchema = exports.ViewActionDeclSchema = exports.ViewParamDeclSchema = exports.ViewAttachmentSchema = exports.ViewKeySchema = void 0;
3
+ exports.ManageViewsResultSchema = exports.ManageViewsSchema = exports.SetNavigationAction = exports.GetNavigationAction = exports.RemoveViewAction = exports.ListViewsAction = exports.GetViewAction = exports.SetViewAction = exports.ViewRowSchema = exports.ViewDefinitionSchema = exports.ViewActionDeclSchema = exports.ViewParamDeclSchema = exports.ViewAttachmentSchema = exports.ViewScopeSchema = exports.ViewKeySchema = void 0;
4
4
  const typebox_1 = require("@sinclair/typebox");
5
+ const view_scope_1 = require("./view-scope");
6
+ var view_scope_2 = require("./view-scope");
7
+ Object.defineProperty(exports, "ViewKeySchema", { enumerable: true, get: function () { return view_scope_2.ViewKeySchema; } });
8
+ Object.defineProperty(exports, "ViewScopeSchema", { enumerable: true, get: function () { return view_scope_2.ViewScopeSchema; } });
9
+ const navigation_1 = require("./navigation");
5
10
  const collection_selection_1 = require("./collection-selection");
6
11
  const source_files_schema_1 = require("./source-files-schema");
7
12
  // ============================================
8
13
  // Lobu views: React modules rendered in the sandboxed frame.
9
14
  // ============================================
10
- // A view key names the module: lowercase, dashes, 1-64 chars. The folder is
11
- // only a convention — the key is the identity (no `custom:<name>` prefix).
12
- exports.ViewKeySchema = typebox_1.Type.String({
13
- pattern: "^[a-z0-9][a-z0-9-]{0,63}$",
14
- minLength: 1,
15
- maxLength: 64,
16
- description: "View key, e.g. 'pipeline'.",
17
- });
18
15
  // Where a view appears: one page per entry, named by its key. The attach line
19
16
  // lives in the module source; there are no attach/detach verbs — changing it
20
17
  // means re-saving the view. How the view renders there is the view's own
@@ -76,21 +73,51 @@ exports.ViewParamDeclSchema = typebox_1.Type.Object({
76
73
  description: "Offer this param in the host's filter bar: an applied value shows as a chip above the view. Options make it a pick list; without them the host asks for a value of the param's type.",
77
74
  })),
78
75
  });
79
- // Actions a view declares as metadata; each emits an event kind through the
80
- // template-action chokepoint. A removed action stops working on the next read
81
- // because the check runs against the CURRENT view row.
76
+ /** Most metadata fields one view action may write. */
77
+ const VIEW_ACTION_MAX_UPDATE_FIELDS = 50;
78
+ // Actions a view declares as metadata. An action emits an event kind through
79
+ // the template-action chokepoint, writes an allowlist of entity fields through
80
+ // the shared entity update path, or both in one transaction. At least one is
81
+ // required (checked by `readViewDefinition`). A removed action stops working on
82
+ // the next read because the check runs against the CURRENT view row.
82
83
  exports.ViewActionDeclSchema = typebox_1.Type.Object({
83
- emits: typebox_1.Type.String({
84
+ emits: typebox_1.Type.Optional(typebox_1.Type.String({
84
85
  minLength: 1,
85
86
  maxLength: 128,
86
87
  description: "Event kind appended when the action fires, e.g. 'deal.won'.",
87
- }),
88
+ })),
89
+ updates: typebox_1.Type.Optional(typebox_1.Type.Object({
90
+ entityType: typebox_1.Type.String({
91
+ minLength: 1,
92
+ maxLength: 128,
93
+ description: "Entity type the action writes. The view must attach to it (collection or record).",
94
+ }),
95
+ fields: typebox_1.Type.Array(typebox_1.Type.String({ minLength: 1, maxLength: 128 }), {
96
+ minItems: 1,
97
+ maxItems: VIEW_ACTION_MAX_UPDATE_FIELDS,
98
+ uniqueItems: true,
99
+ description: "Metadata fields the action may set. Schema-stamped fields (x-lobu-stamps) are server-owned and refused.",
100
+ }),
101
+ }, {
102
+ additionalProperties: false,
103
+ description: "Entity fields the action may write: value carries { entity_id, set }.",
104
+ })),
105
+ });
106
+ /** Most external origins one view may load images from. */
107
+ const VIEW_MAX_RESOURCES = 8;
108
+ // External origins the view may load images from (map tiles, logos). Each is a
109
+ // bare https origin with a public hostname; anything else the view requests,
110
+ // and images from any other origin, stay blocked. Checked by
111
+ // `readViewDefinition`, which also drops duplicates.
112
+ const ViewResourcesSchema = typebox_1.Type.Array(typebox_1.Type.String({ minLength: 1, maxLength: 260 }), {
113
+ maxItems: VIEW_MAX_RESOURCES,
114
+ description: "External origins the view may load images from, e.g. 'https://tile.openstreetmap.org': https, a public hostname, no path. At most 8.",
88
115
  });
89
116
  // Everything a view declares about itself, read from its module's
90
117
  // `export const view = defineView({...})`. The module is the only place these
91
118
  // live: `set` takes the source and the server reads this out of it.
92
119
  exports.ViewDefinitionSchema = typebox_1.Type.Object({
93
- key: exports.ViewKeySchema,
120
+ key: view_scope_1.ViewKeySchema,
94
121
  name: typebox_1.Type.Optional(typebox_1.Type.String({
95
122
  minLength: 1,
96
123
  maxLength: 120,
@@ -104,13 +131,14 @@ exports.ViewDefinitionSchema = typebox_1.Type.Object({
104
131
  description: "Declared URL params.",
105
132
  })),
106
133
  actions: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), exports.ViewActionDeclSchema, {
107
- description: "Declared actions and the event kind each emits.",
134
+ description: "Declared actions: the event kind each emits and the entity fields each may update.",
108
135
  })),
136
+ resources: typebox_1.Type.Optional(ViewResourcesSchema),
109
137
  }, { additionalProperties: false });
110
138
  // Public projection of a stored view: metadata only, never the bundle. The
111
139
  // bundle travels over the view resource / shell route; the source over get.
112
140
  exports.ViewRowSchema = typebox_1.Type.Object({
113
- key: exports.ViewKeySchema,
141
+ key: view_scope_1.ViewKeySchema,
114
142
  name: typebox_1.Type.String(),
115
143
  description: typebox_1.Type.String(),
116
144
  content_hash: typebox_1.Type.String({
@@ -119,6 +147,7 @@ exports.ViewRowSchema = typebox_1.Type.Object({
119
147
  attach: typebox_1.Type.Array(exports.ViewAttachmentSchema),
120
148
  params: typebox_1.Type.Record(typebox_1.Type.String(), exports.ViewParamDeclSchema),
121
149
  actions: typebox_1.Type.Record(typebox_1.Type.String(), exports.ViewActionDeclSchema),
150
+ resources: ViewResourcesSchema,
122
151
  // Optional because a reader outside the workspace (a public workspace's
123
152
  // visitor) gets the list without anyone's user id in it.
124
153
  last_writer: typebox_1.Type.Optional(typebox_1.Type.String({
@@ -137,12 +166,12 @@ exports.ViewRowSchema = typebox_1.Type.Object({
137
166
  // variant must read true for every one of them.
138
167
  exports.SetViewAction = typebox_1.Type.Object({
139
168
  action: typebox_1.Type.Literal("set", {
140
- description: "Store a view: read its key, name, description, attach, params and actions from the module's `export const view = defineView({...})`, compile it, and upsert by that key.",
169
+ description: "Store a view: read its key, name, description, attach, params, actions and resources from the module's `export const view = defineView({...})`, compile it, and upsert by that key.",
141
170
  }),
142
171
  source_code: typebox_1.Type.String({
143
172
  minLength: 1,
144
173
  maxLength: 1000000,
145
- description: "[set] The view module source (TSX). Its `defineView({...})` argument must be a literal; it is the only place the view's key, name, description, attach, params and actions are declared.",
174
+ description: "[set] The view module source (TSX). Its `defineView({...})` argument must be a literal; it is the only place the view's key, name, description, attach, params, actions and resources are declared.",
146
175
  }),
147
176
  compiled_code: typebox_1.Type.Optional(typebox_1.Type.String({
148
177
  minLength: 1,
@@ -159,7 +188,7 @@ exports.GetViewAction = typebox_1.Type.Object({
159
188
  action: typebox_1.Type.Literal("get", {
160
189
  description: "Fetch one view's metadata + source.",
161
190
  }),
162
- key: exports.ViewKeySchema,
191
+ key: view_scope_1.ViewKeySchema,
163
192
  });
164
193
  exports.ListViewsAction = typebox_1.Type.Object({
165
194
  action: typebox_1.Type.Literal("list", {
@@ -170,13 +199,35 @@ exports.RemoveViewAction = typebox_1.Type.Object({
170
199
  action: typebox_1.Type.Literal("remove", {
171
200
  description: "Delete a view by key.",
172
201
  }),
173
- key: exports.ViewKeySchema,
202
+ key: view_scope_1.ViewKeySchema,
203
+ });
204
+ // The workspace's sidebar navigation (see ./navigation). One versioned
205
+ // document per workspace; `set_navigation` replaces it whole, and only when
206
+ // `expected_revision` is still the stored revision (409 otherwise).
207
+ exports.GetNavigationAction = typebox_1.Type.Object({
208
+ action: typebox_1.Type.Literal("get_navigation", {
209
+ description: "Read the workspace navigation: { revision, config, sections }. config is the stored document (null = automatic defaults), returned only to owner/admin callers with admin access; sections is what the sidebar renders for the caller.",
210
+ }),
211
+ });
212
+ exports.SetNavigationAction = typebox_1.Type.Object({
213
+ action: typebox_1.Type.Literal("set_navigation", {
214
+ description: "Replace the workspace navigation document. Fails with 409 when expected_revision is stale.",
215
+ }),
216
+ expected_revision: typebox_1.Type.Integer({
217
+ minimum: 0,
218
+ description: "[set_navigation] The revision get_navigation returned; the write applies only if it is still current.",
219
+ }),
220
+ config: typebox_1.Type.Union([navigation_1.NavigationConfigSchema, typebox_1.Type.Null()], {
221
+ description: "[set_navigation] The whole navigation document, or null to return to the automatic defaults.",
222
+ }),
174
223
  });
175
224
  exports.ManageViewsSchema = typebox_1.Type.Union([
176
225
  exports.SetViewAction,
177
226
  exports.GetViewAction,
178
227
  exports.ListViewsAction,
179
228
  exports.RemoveViewAction,
229
+ exports.GetNavigationAction,
230
+ exports.SetNavigationAction,
180
231
  ]);
181
232
  // ============================================
182
233
  // Result Types
@@ -211,5 +262,16 @@ exports.ManageViewsResultSchema = typebox_1.Type.Union([
211
262
  key: typebox_1.Type.String(),
212
263
  removed: typebox_1.Type.Boolean(),
213
264
  }),
265
+ typebox_1.Type.Object({
266
+ action: typebox_1.Type.Literal("get_navigation"),
267
+ revision: typebox_1.Type.Integer(),
268
+ config: typebox_1.Type.Optional(typebox_1.Type.Union([navigation_1.NavigationConfigSchema, typebox_1.Type.Null()])),
269
+ sections: typebox_1.Type.Array(navigation_1.ResolvedNavigationSectionSchema),
270
+ }),
271
+ typebox_1.Type.Object({
272
+ action: typebox_1.Type.Literal("set_navigation"),
273
+ revision: typebox_1.Type.Integer(),
274
+ config: typebox_1.Type.Union([navigation_1.NavigationConfigSchema, typebox_1.Type.Null()]),
275
+ }),
214
276
  ]);
215
277
  //# sourceMappingURL=manage-views.js.map
@@ -0,0 +1,248 @@
1
+ import { type Static } from "@sinclair/typebox";
2
+ /**
3
+ * Resource ceilings, not product limits: a workspace with a thousand views can
4
+ * nest and group them freely. The tree is recursive; these only stop a
5
+ * document from being unbounded.
6
+ */
7
+ /** Deepest item nesting: a section's items are level 1. */
8
+ export declare const NAVIGATION_MAX_DEPTH = 32;
9
+ export declare const NAVIGATION_MAX_SECTIONS = 100;
10
+ /** Items across every section and level. */
11
+ export declare const NAVIGATION_MAX_ITEMS = 5000;
12
+ /** The whole document, serialized as UTF-8 JSON. */
13
+ export declare const NAVIGATION_MAX_BYTES: number;
14
+ export declare const PageRefSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
15
+ kind: import("@sinclair/typebox").TLiteral<"view">;
16
+ key: import("@sinclair/typebox").TString;
17
+ scope: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
18
+ collection: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
19
+ search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
20
+ filters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
21
+ field: import("@sinclair/typebox").TString;
22
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"eq">, import("@sinclair/typebox").TLiteral<"neq">]>;
23
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>;
24
+ }>, import("@sinclair/typebox").TObject<{
25
+ field: import("@sinclair/typebox").TString;
26
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"lt">, import("@sinclair/typebox").TLiteral<"lte">, import("@sinclair/typebox").TLiteral<"gt">, import("@sinclair/typebox").TLiteral<"gte">]>;
27
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
28
+ }>]>>>;
29
+ segment: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
30
+ }>>;
31
+ type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
32
+ entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
33
+ event: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
34
+ }>>;
35
+ params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean]>>>;
36
+ }>, import("@sinclair/typebox").TObject<{
37
+ kind: import("@sinclair/typebox").TLiteral<"collection">;
38
+ entityType: import("@sinclair/typebox").TString;
39
+ }>, import("@sinclair/typebox").TObject<{
40
+ kind: import("@sinclair/typebox").TLiteral<"record">;
41
+ entityId: import("@sinclair/typebox").TInteger;
42
+ }>, import("@sinclair/typebox").TObject<{
43
+ kind: import("@sinclair/typebox").TLiteral<"link">;
44
+ href: import("@sinclair/typebox").TString;
45
+ }>]>;
46
+ export type PageRef = Static<typeof PageRefSchema>;
47
+ export interface NavigationItem {
48
+ id: string;
49
+ label?: string;
50
+ icon?: string;
51
+ target?: PageRef;
52
+ children?: NavigationItem[];
53
+ }
54
+ /**
55
+ * One item. `children` holds items of this same shape; the wire schema
56
+ * describes the shape once (no recursive `$ref`, which not every MCP host or
57
+ * JSON-schema tool reads) and `validateNavigationConfig` checks every nested
58
+ * item against it while it walks the tree.
59
+ */
60
+ export declare const NavigationItemSchema: import("@sinclair/typebox").TObject<{
61
+ id: import("@sinclair/typebox").TString;
62
+ label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
63
+ icon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
64
+ target: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
65
+ kind: import("@sinclair/typebox").TLiteral<"view">;
66
+ key: import("@sinclair/typebox").TString;
67
+ scope: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
68
+ collection: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
69
+ search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
70
+ filters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
71
+ field: import("@sinclair/typebox").TString;
72
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"eq">, import("@sinclair/typebox").TLiteral<"neq">]>;
73
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>;
74
+ }>, import("@sinclair/typebox").TObject<{
75
+ field: import("@sinclair/typebox").TString;
76
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"lt">, import("@sinclair/typebox").TLiteral<"lte">, import("@sinclair/typebox").TLiteral<"gt">, import("@sinclair/typebox").TLiteral<"gte">]>;
77
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
78
+ }>]>>>;
79
+ segment: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
80
+ }>>;
81
+ type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
82
+ entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
83
+ event: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
84
+ }>>;
85
+ params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean]>>>;
86
+ }>, import("@sinclair/typebox").TObject<{
87
+ kind: import("@sinclair/typebox").TLiteral<"collection">;
88
+ entityType: import("@sinclair/typebox").TString;
89
+ }>, import("@sinclair/typebox").TObject<{
90
+ kind: import("@sinclair/typebox").TLiteral<"record">;
91
+ entityId: import("@sinclair/typebox").TInteger;
92
+ }>, import("@sinclair/typebox").TObject<{
93
+ kind: import("@sinclair/typebox").TLiteral<"link">;
94
+ href: import("@sinclair/typebox").TString;
95
+ }>]>>;
96
+ children: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>>;
97
+ }>;
98
+ export declare const NavigationSectionSchema: import("@sinclair/typebox").TObject<{
99
+ id: import("@sinclair/typebox").TString;
100
+ label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
101
+ items: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
102
+ id: import("@sinclair/typebox").TString;
103
+ label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
104
+ icon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
105
+ target: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
106
+ kind: import("@sinclair/typebox").TLiteral<"view">;
107
+ key: import("@sinclair/typebox").TString;
108
+ scope: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
109
+ collection: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
110
+ search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
111
+ filters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
112
+ field: import("@sinclair/typebox").TString;
113
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"eq">, import("@sinclair/typebox").TLiteral<"neq">]>;
114
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>;
115
+ }>, import("@sinclair/typebox").TObject<{
116
+ field: import("@sinclair/typebox").TString;
117
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"lt">, import("@sinclair/typebox").TLiteral<"lte">, import("@sinclair/typebox").TLiteral<"gt">, import("@sinclair/typebox").TLiteral<"gte">]>;
118
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
119
+ }>]>>>;
120
+ segment: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
121
+ }>>;
122
+ type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
123
+ entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
124
+ event: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
125
+ }>>;
126
+ params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean]>>>;
127
+ }>, import("@sinclair/typebox").TObject<{
128
+ kind: import("@sinclair/typebox").TLiteral<"collection">;
129
+ entityType: import("@sinclair/typebox").TString;
130
+ }>, import("@sinclair/typebox").TObject<{
131
+ kind: import("@sinclair/typebox").TLiteral<"record">;
132
+ entityId: import("@sinclair/typebox").TInteger;
133
+ }>, import("@sinclair/typebox").TObject<{
134
+ kind: import("@sinclair/typebox").TLiteral<"link">;
135
+ href: import("@sinclair/typebox").TString;
136
+ }>]>>;
137
+ children: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>>;
138
+ }>>;
139
+ }>;
140
+ export interface NavigationSection {
141
+ id: string;
142
+ label?: string;
143
+ items: NavigationItem[];
144
+ }
145
+ export declare const NavigationConfigSchema: import("@sinclair/typebox").TObject<{
146
+ schemaVersion: import("@sinclair/typebox").TLiteral<1>;
147
+ sections: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
148
+ id: import("@sinclair/typebox").TString;
149
+ label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
150
+ items: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
151
+ id: import("@sinclair/typebox").TString;
152
+ label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
153
+ icon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
154
+ target: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
155
+ kind: import("@sinclair/typebox").TLiteral<"view">;
156
+ key: import("@sinclair/typebox").TString;
157
+ scope: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
158
+ collection: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
159
+ search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
160
+ filters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
161
+ field: import("@sinclair/typebox").TString;
162
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"eq">, import("@sinclair/typebox").TLiteral<"neq">]>;
163
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>;
164
+ }>, import("@sinclair/typebox").TObject<{
165
+ field: import("@sinclair/typebox").TString;
166
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"lt">, import("@sinclair/typebox").TLiteral<"lte">, import("@sinclair/typebox").TLiteral<"gt">, import("@sinclair/typebox").TLiteral<"gte">]>;
167
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
168
+ }>]>>>;
169
+ segment: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
170
+ }>>;
171
+ type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
172
+ entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
173
+ event: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
174
+ }>>;
175
+ params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean]>>>;
176
+ }>, import("@sinclair/typebox").TObject<{
177
+ kind: import("@sinclair/typebox").TLiteral<"collection">;
178
+ entityType: import("@sinclair/typebox").TString;
179
+ }>, import("@sinclair/typebox").TObject<{
180
+ kind: import("@sinclair/typebox").TLiteral<"record">;
181
+ entityId: import("@sinclair/typebox").TInteger;
182
+ }>, import("@sinclair/typebox").TObject<{
183
+ kind: import("@sinclair/typebox").TLiteral<"link">;
184
+ href: import("@sinclair/typebox").TString;
185
+ }>]>>;
186
+ children: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>>;
187
+ }>>;
188
+ }>>;
189
+ }>;
190
+ export interface NavigationConfig {
191
+ schemaVersion: 1;
192
+ sections: NavigationSection[];
193
+ }
194
+ /** One rendered entry: what the sidebar draws after the server resolved it. */
195
+ export interface ResolvedNavigationItem {
196
+ id: string;
197
+ label: string;
198
+ icon?: string;
199
+ /** App path (`/<workspace>/...`, with query) or an external https URL. */
200
+ href?: string;
201
+ external?: boolean;
202
+ children: ResolvedNavigationItem[];
203
+ }
204
+ export interface ResolvedNavigationSection {
205
+ id: string;
206
+ label?: string;
207
+ items: ResolvedNavigationItem[];
208
+ }
209
+ export declare const ResolvedNavigationSectionSchema: import("@sinclair/typebox").TObject<{
210
+ id: import("@sinclair/typebox").TString;
211
+ label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
212
+ items: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
213
+ id: import("@sinclair/typebox").TString;
214
+ label: import("@sinclair/typebox").TString;
215
+ icon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
216
+ href: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
217
+ external: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
218
+ children: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>;
219
+ }>>;
220
+ }>;
221
+ export type NavigationDestination = {
222
+ kind: "internal";
223
+ path: string;
224
+ } | {
225
+ kind: "external";
226
+ href: string;
227
+ };
228
+ /**
229
+ * Where a link may go, decided once for both authored navigation links and a
230
+ * view's `openLink`: an absolute `https:` URL off this origin, or a path inside
231
+ * `/<workspace>/` on it. Everything else is refused — other schemes
232
+ * (`javascript:`, `data:`, `http:`), credentials in the URL, and any path that
233
+ * resolves outside the workspace (another workspace, `/account`, `..`).
234
+ */
235
+ export declare function linkDestination(url: string, origin: string, workspace: string): NavigationDestination | null;
236
+ /**
237
+ * An authored `link` href: an absolute https URL, or a path explicitly relative
238
+ * to the workspace root — no scheme, no leading slash, no `.`/`..` segment (in
239
+ * any encoding), no backslash or control character.
240
+ */
241
+ export declare function navigationHrefDestination(href: string, origin: string, workspace: string): NavigationDestination | null;
242
+ /**
243
+ * The one validator every writer runs (server `set`, CLI apply and pull):
244
+ * schema shape and bounds, then the rules a schema cannot say. Returns every
245
+ * problem as `<path>: <message>`; empty means valid.
246
+ */
247
+ export declare function validateNavigationConfig(config: unknown): string[];
248
+ //# sourceMappingURL=navigation.d.ts.map