@intentic/extension-manifest 1.431.0 → 1.432.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 (68) hide show
  1. package/README.md +46 -2
  2. package/dist/manifest.d.ts +294 -0
  3. package/dist/manifest.d.ts.map +1 -1
  4. package/dist/manifest.js +96 -1
  5. package/dist/manifest.js.map +1 -1
  6. package/dist/permissions.d.ts +23 -0
  7. package/dist/permissions.d.ts.map +1 -1
  8. package/dist/permissions.js +28 -1
  9. package/dist/permissions.js.map +1 -1
  10. package/dist/points/automation-templates.d.ts +68 -0
  11. package/dist/points/automation-templates.d.ts.map +1 -1
  12. package/dist/points/automation-templates.js +29 -1
  13. package/dist/points/automation-templates.js.map +1 -1
  14. package/dist/points/capabilities.d.ts +357 -50
  15. package/dist/points/capabilities.d.ts.map +1 -1
  16. package/dist/points/capabilities.js +22 -51
  17. package/dist/points/capabilities.js.map +1 -1
  18. package/dist/points/capability-broker.d.ts +110 -0
  19. package/dist/points/capability-broker.d.ts.map +1 -0
  20. package/dist/points/capability-broker.js +125 -0
  21. package/dist/points/capability-broker.js.map +1 -0
  22. package/dist/points/channel-facts.d.ts +46 -0
  23. package/dist/points/channel-facts.d.ts.map +1 -0
  24. package/dist/points/channel-facts.js +80 -0
  25. package/dist/points/channel-facts.js.map +1 -0
  26. package/dist/points/index.d.ts +585 -0
  27. package/dist/points/index.d.ts.map +1 -1
  28. package/dist/points/index.js +12 -0
  29. package/dist/points/index.js.map +1 -1
  30. package/dist/points/listener.d.ts +10 -0
  31. package/dist/points/listener.d.ts.map +1 -1
  32. package/dist/points/listener.js +6 -0
  33. package/dist/points/listener.js.map +1 -1
  34. package/dist/points/model-roles.d.ts +31 -0
  35. package/dist/points/model-roles.d.ts.map +1 -0
  36. package/dist/points/model-roles.js +27 -0
  37. package/dist/points/model-roles.js.map +1 -0
  38. package/dist/points/public-routes.d.ts +91 -0
  39. package/dist/points/public-routes.d.ts.map +1 -0
  40. package/dist/points/public-routes.js +140 -0
  41. package/dist/points/public-routes.js.map +1 -0
  42. package/dist/points/sleep-watch.d.ts +15 -0
  43. package/dist/points/sleep-watch.d.ts.map +1 -0
  44. package/dist/points/sleep-watch.js +30 -0
  45. package/dist/points/sleep-watch.js.map +1 -0
  46. package/dist/points/watch-kinds.d.ts +102 -0
  47. package/dist/points/watch-kinds.d.ts.map +1 -0
  48. package/dist/points/watch-kinds.js +118 -0
  49. package/dist/points/watch-kinds.js.map +1 -0
  50. package/intentic-extension.schema.json +1387 -36
  51. package/package.json +2 -2
  52. package/src/manifest.ts +130 -1
  53. package/src/permissions.test.ts +39 -1
  54. package/src/permissions.ts +84 -4
  55. package/src/points/automation-templates.ts +43 -5
  56. package/src/points/capabilities.ts +37 -80
  57. package/src/points/capability-broker.ts +203 -0
  58. package/src/points/channel-facts.test.ts +38 -0
  59. package/src/points/channel-facts.ts +119 -0
  60. package/src/points/index.ts +12 -0
  61. package/src/points/listener.ts +14 -0
  62. package/src/points/model-roles.ts +44 -0
  63. package/src/points/public-routes.test.ts +132 -0
  64. package/src/points/public-routes.ts +198 -0
  65. package/src/points/sleep-watch.ts +54 -0
  66. package/src/points/watch-kinds.test.ts +73 -0
  67. package/src/points/watch-kinds.ts +172 -0
  68. package/src/powers.test.ts +97 -7
package/README.md CHANGED
@@ -38,8 +38,10 @@ flowchart LR
38
38
  between slashes and matches one whole path segment, never a `.` or `..` the URL would resolve away. A malformed entry
39
39
  (`**`, a `*` inside a segment, an unknown method, a relative path) fails the manifest parse rather than the first
40
40
  call it gates.
41
- - `extensionRouteReach` is the whole rule for an extension's own token: the two routes every extension reaches about
42
- itself (`EXTENSION_OWN_ROUTES`: its settings and its event stream), its own listener provider's routes, and whatever
41
+ - `extensionRouteReach` is the whole rule for an extension's own token: the routes every extension reaches about
42
+ itself (`EXTENSION_OWN_ROUTES`: its settings and its event stream, the doors its other `permissions` open, and since
43
+ 2026-11-26 the turn doors its tools' calls open, each judged by the daemon on its own declaration and the call's
44
+ ticket), its own listener provider's routes, and whatever
43
45
  `permissions.daemon` declares. The daemon's grant and the SDK's test fake both judge by it, and `./permissions` exports
44
46
  the rule alone, for a process that should not load the manifest schema.
45
47
  - What a field MEANS to the host is declared on the field, with `.meta({ power, effect, mintsServer })`
@@ -47,6 +49,48 @@ flowchart LR
47
49
  when it adds one), the effects a card discloses in the capability catalog, and the capability kinds whose ids
48
50
  become `mcp__<id>__` servers in the contract's reserved-name check. A new field is either given a meaning where it
49
51
  is defined or has none.
52
+ - `automationTemplates` takes every field the daemon's own templates carry (a `once` or webhook trigger's fields, `tz`,
53
+ `afterSessions`, a watch's `source`, `fireOn`, `until` and `target`), shaped loosely here and parsed by the daemon's
54
+ own template schema when it builds the catalogue, which drops what would not save (2026-11-26).
55
+ - `watchKinds` (`points/watch-kinds.ts`, 2026-11-26) declares a ready-made check the extension's backend answers: its
56
+ id, label, the sentence a source of it reads as, and its parameters as fields. `watchSentence` and
57
+ `watchParamsProblem` are the one reading of a declaration, which the daemon, the Automations view and the approval
58
+ card share; the `automations` command repeats the sentence rule in plain JavaScript. A `superRefine` on the envelope
59
+ holds a kind to a `server` bundle and to the extension's own cards.
60
+ - `modelRoles` (`points/model-roles.ts`, 2026-11-26) declares the jobs the extension starts agent runs for, which the
61
+ owner puts on model setups beside the sandbox's own: an id (`MODEL_ROLE_ID`, the key a stored choice and a run's
62
+ `job` name), a label, an explanation, an icon and the setup it is suggested. The contract serves a declaration as
63
+ a job (`contributedModelRole`), always a whole session, suggested `medium` unless it says otherwise. An id declared
64
+ twice in one manifest fails its parse.
65
+ - `publicRoutes` (`points/public-routes.ts`, 2026-11-26) declares routes anyone on the internet may call at
66
+ `/door/<id>/<path>`, each a power whose sentence names the route and the secret a signed one is checked against: a
67
+ path of lowercase words and lone `*`s, its methods, and which of the core's protections apply (`automation` reads an
68
+ automation of the extension's own listener from the first `*`, `origins: "listed"` holds a browser to its allowed
69
+ origins and `key` lets a caller with no Origin present its door key instead, `signature` names a scheme and a sandbox
70
+ secret, `turnstile` names the sandbox secret a Cloudflare Turnstile token is verified with, `keyFromBrowsers` lets an
71
+ automation that opts in admit an unlisted browser with its key, `proofOfWork`, `rate`, `dailyMax` (a number, or
72
+ `"none"` on a GET-only route), `bodyMax`, and (2026-11-27) `wakes`, a power of its own: a call at the route's wake
73
+ URL may wake a sleeping hosted sandbox, its only `*` an automation's). `publicRouteFor` is the one reading of which declared route a
74
+ request lands on, which the daemon's door and the SDK's fake share; a `superRefine` holds the routes to a `server`
75
+ bundle and an automation's route to the extension's own `contributes.listener`.
76
+ - `listener.strangers` (`visitor` or `report`, 2026-11-26) says anyone on the internet reaches the source, which holds
77
+ its wakes to the owner's admission floor for a website visitor or a bug report instead of a team chat's; the daemon
78
+ reads it in place of a table of provider names. It is a power of its own.
79
+ - A cli card may declare `sleepWatch` (`points/sleep-watch.ts`, 2026-11-27): the one credential Intentic's servers may
80
+ hold while a hosted sandbox sleeps, for a service that delivers only over a live connection (`discord`, the only one
81
+ the platform speaks). It names the secret field and a consent field, which the parse holds to a switch (`boolean`)
82
+ declared `hosted: true` and off by default; a field declaring `hosted` is drawn only on a sandbox Intentic hosts.
83
+ `sleepWatchConsented` is the one reading of the switch. A `processors` path may sit under a `when` over the card's
84
+ answers, as Discord's path to Intentic sits under that switch.
85
+ - A card states facts about its platform (`points/channel-facts.ts`, 2026-11-26), which the core reads in place of its
86
+ own tables keyed by provider name: `channel.messageLimit`, `channel.publish.target` (a pattern of the targets its
87
+ backend publishes an approved post to, which must compile), `channel.posting`, `processors` (one entry per path its
88
+ data takes: a flow the Data protection page words, operator, region, third country, hosts, a `hostField`), and on a
89
+ cli card `status: { from: "listener" }`. Each only describes, so none is a power.
90
+ - A cli card's `commandActions` entry says who decides its rule (`gatedBy`: `sandbox`, the command guard, or `backend`,
91
+ the card's backend asking the outward-action door) and what it comes to while no rule names it (`unruled`: `allow` or
92
+ `hold`). `commandActionGate` is the one reading, `selfGated: true`, deprecated since 2.52.0, counting as `backend`
93
+ and `hold`.
50
94
  - `toolServersOf` is the one reading of which MCP servers a manifest serves the agent: `contributes.tools`, or a cli
51
95
  card's `mcp`, its alias for one release. A `superRefine` on the envelope says what no single field can: tools need
52
96
  a `server` bundle or a declared process to serve them.
@@ -16,6 +16,11 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
16
16
  permissions: z.ZodOptional<z.ZodObject<{
17
17
  sandbox: z.ZodOptional<z.ZodArray<z.ZodString>>;
18
18
  daemon: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
+ events: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"run">, z.ZodLiteral<"activity">, z.ZodLiteral<"ci">]>>>;
20
+ work: z.ZodOptional<z.ZodBoolean>;
21
+ exec: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"command">, z.ZodLiteral<"toolchain">]>>>;
22
+ fires: z.ZodOptional<z.ZodArray<z.ZodString>>;
23
+ turn: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"browser">, z.ZodLiteral<"owner-browser">, z.ZodLiteral<"jobs">]>>>;
19
24
  }, z.core.$strip>>;
20
25
  contributes: z.ZodOptional<z.ZodObject<{
21
26
  agent: z.ZodOptional<z.ZodObject<{
@@ -31,16 +36,50 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
31
36
  kind: z.ZodEnum<{
32
37
  event: "event";
33
38
  listener: "listener";
39
+ once: "once";
34
40
  schedule: "schedule";
35
41
  workspace: "workspace";
36
42
  }>;
37
43
  cron: z.ZodOptional<z.ZodString>;
44
+ tz: z.ZodOptional<z.ZodString>;
45
+ afterSessions: z.ZodOptional<z.ZodNumber>;
46
+ at: z.ZodOptional<z.ZodNumber>;
47
+ dailyMax: z.ZodOptional<z.ZodNumber>;
48
+ signature: z.ZodOptional<z.ZodObject<{
49
+ scheme: z.ZodString;
50
+ secret: z.ZodString;
51
+ }, z.core.$strip>>;
38
52
  provider: z.ZodOptional<z.ZodString>;
53
+ channelId: z.ZodOptional<z.ZodString>;
39
54
  eventType: z.ZodOptional<z.ZodString>;
40
55
  mentioned: z.ZodOptional<z.ZodBoolean>;
56
+ branch: z.ZodOptional<z.ZodString>;
57
+ allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
58
  event: z.ZodOptional<z.ZodString>;
59
+ repo: z.ZodOptional<z.ZodString>;
42
60
  }, z.core.$strip>;
43
61
  guard: z.ZodOptional<z.ZodString>;
62
+ source: z.ZodOptional<z.ZodObject<{
63
+ kind: z.ZodString;
64
+ }, z.core.$catchall<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>>;
65
+ fireOn: z.ZodOptional<z.ZodEnum<{
66
+ change: "change";
67
+ pass: "pass";
68
+ }>>;
69
+ until: z.ZodOptional<z.ZodEnum<{
70
+ "first-fire": "first-fire";
71
+ }>>;
72
+ target: z.ZodOptional<z.ZodObject<{
73
+ kind: z.ZodEnum<{
74
+ agent: "agent";
75
+ conversation: "conversation";
76
+ extension: "extension";
77
+ notify: "notify";
78
+ }>;
79
+ conversationId: z.ZodOptional<z.ZodString>;
80
+ extension: z.ZodOptional<z.ZodString>;
81
+ handler: z.ZodOptional<z.ZodString>;
82
+ }, z.core.$strip>>;
44
83
  holdForSeconds: z.ZodOptional<z.ZodNumber>;
45
84
  prompt: z.ZodString;
46
85
  note: z.ZodOptional<z.ZodString>;
@@ -76,6 +115,27 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
76
115
  url: z.ZodString;
77
116
  }, z.core.$strip>>>;
78
117
  }, z.core.$strip>;
118
+ channel: z.ZodOptional<z.ZodObject<{
119
+ messageLimit: z.ZodOptional<z.ZodNumber>;
120
+ publish: z.ZodOptional<z.ZodObject<{
121
+ target: z.ZodString;
122
+ }, z.core.$strip>>;
123
+ posting: z.ZodOptional<z.ZodString>;
124
+ }, z.core.$strip>>;
125
+ processors: z.ZodOptional<z.ZodArray<z.ZodObject<{
126
+ flow: z.ZodEnum<{
127
+ connector: "connector";
128
+ "email-imap": "email-imap";
129
+ "email-smtp": "email-smtp";
130
+ "team-chat": "team-chat";
131
+ }>;
132
+ operator: z.ZodOptional<z.ZodString>;
133
+ region: z.ZodOptional<z.ZodString>;
134
+ thirdCountry: z.ZodOptional<z.ZodBoolean>;
135
+ hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
136
+ hostField: z.ZodOptional<z.ZodString>;
137
+ when: z.ZodOptional<z.ZodString>;
138
+ }, z.core.$strip>>>;
79
139
  kind: z.ZodLiteral<"cli">;
80
140
  fields: z.ZodArray<z.ZodObject<{
81
141
  key: z.ZodString;
@@ -87,6 +147,7 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
87
147
  advanced: z.ZodOptional<z.ZodBoolean>;
88
148
  boolean: z.ZodOptional<z.ZodBoolean>;
89
149
  hint: z.ZodOptional<z.ZodString>;
150
+ hosted: z.ZodOptional<z.ZodBoolean>;
90
151
  rebuild: z.ZodOptional<z.ZodBoolean>;
91
152
  default: z.ZodOptional<z.ZodString>;
92
153
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -188,7 +249,53 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
188
249
  }>;
189
250
  why: z.ZodOptional<z.ZodString>;
190
251
  }, z.core.$strip>>>;
252
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
253
+ action: z.ZodString;
254
+ methods: z.ZodOptional<z.ZodArray<z.ZodString>>;
255
+ paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
256
+ read: z.ZodOptional<z.ZodBoolean>;
257
+ channel: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
258
+ field: z.ZodString;
259
+ }, z.core.$strip>, z.ZodObject<{
260
+ after: z.ZodString;
261
+ }, z.core.$strip>]>>;
262
+ content: z.ZodOptional<z.ZodObject<{
263
+ field: z.ZodString;
264
+ }, z.core.$strip>>;
265
+ }, z.core.$strip>>>;
266
+ }, z.core.$strip>>;
267
+ status: z.ZodOptional<z.ZodObject<{
268
+ from: z.ZodLiteral<"listener">;
269
+ pairingSteps: z.ZodOptional<z.ZodString>;
270
+ }, z.core.$strip>>;
271
+ sleepWatch: z.ZodOptional<z.ZodObject<{
272
+ service: z.ZodEnum<{
273
+ discord: "discord";
274
+ }>;
275
+ credential: z.ZodString;
276
+ consent: z.ZodString;
191
277
  }, z.core.$strip>>;
278
+ commandActions: z.ZodOptional<z.ZodArray<z.ZodObject<{
279
+ action: z.ZodString;
280
+ command: z.ZodArray<z.ZodString>;
281
+ read: z.ZodOptional<z.ZodBoolean>;
282
+ channel: z.ZodOptional<z.ZodObject<{
283
+ arg: z.ZodNumber;
284
+ }, z.core.$strip>>;
285
+ content: z.ZodOptional<z.ZodObject<{
286
+ arg: z.ZodNumber;
287
+ rest: z.ZodOptional<z.ZodBoolean>;
288
+ }, z.core.$strip>>;
289
+ gatedBy: z.ZodOptional<z.ZodEnum<{
290
+ backend: "backend";
291
+ sandbox: "sandbox";
292
+ }>>;
293
+ unruled: z.ZodOptional<z.ZodEnum<{
294
+ allow: "allow";
295
+ hold: "hold";
296
+ }>>;
297
+ selfGated: z.ZodOptional<z.ZodBoolean>;
298
+ }, z.core.$strip>>>;
192
299
  mcp: z.ZodOptional<z.ZodString>;
193
300
  }, z.core.$strip>, z.ZodObject<{
194
301
  id: z.ZodString;
@@ -223,6 +330,7 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
223
330
  advanced: z.ZodOptional<z.ZodBoolean>;
224
331
  boolean: z.ZodOptional<z.ZodBoolean>;
225
332
  hint: z.ZodOptional<z.ZodString>;
333
+ hosted: z.ZodOptional<z.ZodBoolean>;
226
334
  rebuild: z.ZodOptional<z.ZodBoolean>;
227
335
  default: z.ZodOptional<z.ZodString>;
228
336
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -254,6 +362,27 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
254
362
  microsoft: "microsoft";
255
363
  }>>;
256
364
  }, z.core.$strip>>;
365
+ channel: z.ZodOptional<z.ZodObject<{
366
+ messageLimit: z.ZodOptional<z.ZodNumber>;
367
+ publish: z.ZodOptional<z.ZodObject<{
368
+ target: z.ZodString;
369
+ }, z.core.$strip>>;
370
+ posting: z.ZodOptional<z.ZodString>;
371
+ }, z.core.$strip>>;
372
+ processors: z.ZodOptional<z.ZodArray<z.ZodObject<{
373
+ flow: z.ZodEnum<{
374
+ connector: "connector";
375
+ "email-imap": "email-imap";
376
+ "email-smtp": "email-smtp";
377
+ "team-chat": "team-chat";
378
+ }>;
379
+ operator: z.ZodOptional<z.ZodString>;
380
+ region: z.ZodOptional<z.ZodString>;
381
+ thirdCountry: z.ZodOptional<z.ZodBoolean>;
382
+ hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
383
+ hostField: z.ZodOptional<z.ZodString>;
384
+ when: z.ZodOptional<z.ZodString>;
385
+ }, z.core.$strip>>>;
257
386
  kind: z.ZodLiteral<"browser">;
258
387
  loginUrl: z.ZodOptional<z.ZodURL>;
259
388
  homeUrl: z.ZodOptional<z.ZodURL>;
@@ -291,6 +420,7 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
291
420
  advanced: z.ZodOptional<z.ZodBoolean>;
292
421
  boolean: z.ZodOptional<z.ZodBoolean>;
293
422
  hint: z.ZodOptional<z.ZodString>;
423
+ hosted: z.ZodOptional<z.ZodBoolean>;
294
424
  rebuild: z.ZodOptional<z.ZodBoolean>;
295
425
  default: z.ZodOptional<z.ZodString>;
296
426
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -322,6 +452,27 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
322
452
  microsoft: "microsoft";
323
453
  }>>;
324
454
  }, z.core.$strip>>;
455
+ channel: z.ZodOptional<z.ZodObject<{
456
+ messageLimit: z.ZodOptional<z.ZodNumber>;
457
+ publish: z.ZodOptional<z.ZodObject<{
458
+ target: z.ZodString;
459
+ }, z.core.$strip>>;
460
+ posting: z.ZodOptional<z.ZodString>;
461
+ }, z.core.$strip>>;
462
+ processors: z.ZodOptional<z.ZodArray<z.ZodObject<{
463
+ flow: z.ZodEnum<{
464
+ connector: "connector";
465
+ "email-imap": "email-imap";
466
+ "email-smtp": "email-smtp";
467
+ "team-chat": "team-chat";
468
+ }>;
469
+ operator: z.ZodOptional<z.ZodString>;
470
+ region: z.ZodOptional<z.ZodString>;
471
+ thirdCountry: z.ZodOptional<z.ZodBoolean>;
472
+ hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
473
+ hostField: z.ZodOptional<z.ZodString>;
474
+ when: z.ZodOptional<z.ZodString>;
475
+ }, z.core.$strip>>>;
325
476
  kind: z.ZodLiteral<"device">;
326
477
  skill: z.ZodString;
327
478
  }, z.core.$strip>, z.ZodObject<{
@@ -357,6 +508,7 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
357
508
  advanced: z.ZodOptional<z.ZodBoolean>;
358
509
  boolean: z.ZodOptional<z.ZodBoolean>;
359
510
  hint: z.ZodOptional<z.ZodString>;
511
+ hosted: z.ZodOptional<z.ZodBoolean>;
360
512
  rebuild: z.ZodOptional<z.ZodBoolean>;
361
513
  default: z.ZodOptional<z.ZodString>;
362
514
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -388,6 +540,27 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
388
540
  microsoft: "microsoft";
389
541
  }>>;
390
542
  }, z.core.$strip>>;
543
+ channel: z.ZodOptional<z.ZodObject<{
544
+ messageLimit: z.ZodOptional<z.ZodNumber>;
545
+ publish: z.ZodOptional<z.ZodObject<{
546
+ target: z.ZodString;
547
+ }, z.core.$strip>>;
548
+ posting: z.ZodOptional<z.ZodString>;
549
+ }, z.core.$strip>>;
550
+ processors: z.ZodOptional<z.ZodArray<z.ZodObject<{
551
+ flow: z.ZodEnum<{
552
+ connector: "connector";
553
+ "email-imap": "email-imap";
554
+ "email-smtp": "email-smtp";
555
+ "team-chat": "team-chat";
556
+ }>;
557
+ operator: z.ZodOptional<z.ZodString>;
558
+ region: z.ZodOptional<z.ZodString>;
559
+ thirdCountry: z.ZodOptional<z.ZodBoolean>;
560
+ hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
561
+ hostField: z.ZodOptional<z.ZodString>;
562
+ when: z.ZodOptional<z.ZodString>;
563
+ }, z.core.$strip>>>;
391
564
  kind: z.ZodLiteral<"webext">;
392
565
  install: z.ZodOptional<z.ZodURL>;
393
566
  skill: z.ZodString;
@@ -424,6 +597,7 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
424
597
  advanced: z.ZodOptional<z.ZodBoolean>;
425
598
  boolean: z.ZodOptional<z.ZodBoolean>;
426
599
  hint: z.ZodOptional<z.ZodString>;
600
+ hosted: z.ZodOptional<z.ZodBoolean>;
427
601
  rebuild: z.ZodOptional<z.ZodBoolean>;
428
602
  default: z.ZodOptional<z.ZodString>;
429
603
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -455,6 +629,27 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
455
629
  microsoft: "microsoft";
456
630
  }>>;
457
631
  }, z.core.$strip>>;
632
+ channel: z.ZodOptional<z.ZodObject<{
633
+ messageLimit: z.ZodOptional<z.ZodNumber>;
634
+ publish: z.ZodOptional<z.ZodObject<{
635
+ target: z.ZodString;
636
+ }, z.core.$strip>>;
637
+ posting: z.ZodOptional<z.ZodString>;
638
+ }, z.core.$strip>>;
639
+ processors: z.ZodOptional<z.ZodArray<z.ZodObject<{
640
+ flow: z.ZodEnum<{
641
+ connector: "connector";
642
+ "email-imap": "email-imap";
643
+ "email-smtp": "email-smtp";
644
+ "team-chat": "team-chat";
645
+ }>;
646
+ operator: z.ZodOptional<z.ZodString>;
647
+ region: z.ZodOptional<z.ZodString>;
648
+ thirdCountry: z.ZodOptional<z.ZodBoolean>;
649
+ hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
650
+ hostField: z.ZodOptional<z.ZodString>;
651
+ when: z.ZodOptional<z.ZodString>;
652
+ }, z.core.$strip>>>;
458
653
  kind: z.ZodLiteral<"phone">;
459
654
  install: z.ZodOptional<z.ZodURL>;
460
655
  skill: z.ZodString;
@@ -491,6 +686,7 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
491
686
  advanced: z.ZodOptional<z.ZodBoolean>;
492
687
  boolean: z.ZodOptional<z.ZodBoolean>;
493
688
  hint: z.ZodOptional<z.ZodString>;
689
+ hosted: z.ZodOptional<z.ZodBoolean>;
494
690
  rebuild: z.ZodOptional<z.ZodBoolean>;
495
691
  default: z.ZodOptional<z.ZodString>;
496
692
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -522,6 +718,27 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
522
718
  microsoft: "microsoft";
523
719
  }>>;
524
720
  }, z.core.$strip>>;
721
+ channel: z.ZodOptional<z.ZodObject<{
722
+ messageLimit: z.ZodOptional<z.ZodNumber>;
723
+ publish: z.ZodOptional<z.ZodObject<{
724
+ target: z.ZodString;
725
+ }, z.core.$strip>>;
726
+ posting: z.ZodOptional<z.ZodString>;
727
+ }, z.core.$strip>>;
728
+ processors: z.ZodOptional<z.ZodArray<z.ZodObject<{
729
+ flow: z.ZodEnum<{
730
+ connector: "connector";
731
+ "email-imap": "email-imap";
732
+ "email-smtp": "email-smtp";
733
+ "team-chat": "team-chat";
734
+ }>;
735
+ operator: z.ZodOptional<z.ZodString>;
736
+ region: z.ZodOptional<z.ZodString>;
737
+ thirdCountry: z.ZodOptional<z.ZodBoolean>;
738
+ hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
739
+ hostField: z.ZodOptional<z.ZodString>;
740
+ when: z.ZodOptional<z.ZodString>;
741
+ }, z.core.$strip>>>;
525
742
  kind: z.ZodLiteral<"agent">;
526
743
  }, z.core.$strip>], "kind">>>;
527
744
  commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -550,6 +767,10 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
550
767
  type: z.ZodString;
551
768
  label: z.ZodString;
552
769
  }, z.core.$strip>>;
770
+ strangers: z.ZodOptional<z.ZodEnum<{
771
+ report: "report";
772
+ visitor: "visitor";
773
+ }>>;
553
774
  automation: z.ZodObject<{
554
775
  label: z.ZodString;
555
776
  mentionLabel: z.ZodOptional<z.ZodString>;
@@ -576,6 +797,17 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
576
797
  starterPrompt: z.ZodString;
577
798
  }, z.core.$strip>;
578
799
  }, z.core.$strip>>;
800
+ modelRoles: z.ZodOptional<z.ZodArray<z.ZodObject<{
801
+ id: z.ZodString;
802
+ label: z.ZodString;
803
+ explanation: z.ZodString;
804
+ icon: z.ZodOptional<z.ZodString>;
805
+ setup: z.ZodOptional<z.ZodEnum<{
806
+ high: "high";
807
+ low: "low";
808
+ medium: "medium";
809
+ }>>;
810
+ }, z.core.$strip>>>;
579
811
  processes: z.ZodOptional<z.ZodArray<z.ZodObject<{
580
812
  name: z.ZodString;
581
813
  command: z.ZodString;
@@ -584,6 +816,41 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
584
816
  preview: z.ZodOptional<z.ZodBoolean>;
585
817
  autoStart: z.ZodOptional<z.ZodBoolean>;
586
818
  }, z.core.$strip>>>;
819
+ publicRoutes: z.ZodOptional<z.ZodArray<z.ZodObject<{
820
+ path: z.ZodString;
821
+ methods: z.ZodArray<z.ZodEnum<{
822
+ DELETE: "DELETE";
823
+ GET: "GET";
824
+ PATCH: "PATCH";
825
+ POST: "POST";
826
+ PUT: "PUT";
827
+ }>>;
828
+ automation: z.ZodOptional<z.ZodLiteral<true>>;
829
+ origins: z.ZodOptional<z.ZodEnum<{
830
+ any: "any";
831
+ listed: "listed";
832
+ }>>;
833
+ key: z.ZodOptional<z.ZodLiteral<true>>;
834
+ keyFromBrowsers: z.ZodOptional<z.ZodLiteral<true>>;
835
+ signature: z.ZodOptional<z.ZodObject<{
836
+ scheme: z.ZodEnum<{
837
+ github: "github";
838
+ linear: "linear";
839
+ sentry: "sentry";
840
+ "standard-webhooks": "standard-webhooks";
841
+ stripe: "stripe";
842
+ }>;
843
+ secret: z.ZodString;
844
+ }, z.core.$strip>>;
845
+ turnstile: z.ZodOptional<z.ZodObject<{
846
+ secret: z.ZodString;
847
+ }, z.core.$strip>>;
848
+ proofOfWork: z.ZodOptional<z.ZodLiteral<true>>;
849
+ rate: z.ZodOptional<z.ZodNumber>;
850
+ dailyMax: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"none">]>>;
851
+ bodyMax: z.ZodOptional<z.ZodNumber>;
852
+ wakes: z.ZodOptional<z.ZodLiteral<true>>;
853
+ }, z.core.$strip>>>;
587
854
  settings: z.ZodOptional<z.ZodArray<z.ZodObject<{
588
855
  key: z.ZodString;
589
856
  type: z.ZodEnum<{
@@ -633,8 +900,35 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
633
900
  }>;
634
901
  badge: z.ZodOptional<z.ZodBoolean>;
635
902
  }, z.core.$strip>>>;
903
+ watchKinds: z.ZodOptional<z.ZodArray<z.ZodObject<{
904
+ id: z.ZodString;
905
+ label: z.ZodString;
906
+ icon: z.ZodOptional<z.ZodString>;
907
+ logo: z.ZodOptional<z.ZodString>;
908
+ description: z.ZodString;
909
+ sentence: z.ZodString;
910
+ fields: z.ZodArray<z.ZodObject<{
911
+ key: z.ZodString;
912
+ label: z.ZodString;
913
+ type: z.ZodOptional<z.ZodEnum<{
914
+ switch: "switch";
915
+ text: "text";
916
+ }>>;
917
+ required: z.ZodOptional<z.ZodBoolean>;
918
+ placeholder: z.ZodOptional<z.ZodString>;
919
+ hint: z.ZodOptional<z.ZodString>;
920
+ pattern: z.ZodOptional<z.ZodString>;
921
+ patternHint: z.ZodOptional<z.ZodString>;
922
+ maxLength: z.ZodOptional<z.ZodNumber>;
923
+ }, z.core.$strip>>;
924
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
925
+ }, z.core.$strip>>>;
636
926
  }, z.core.$strip>>;
637
927
  }, z.core.$strip>;
638
928
  export type ExtensionManifest = z.infer<typeof ExtensionManifestSchema>;
929
+ export declare const declaredOfBackend: (manifest: Pick<ExtensionManifest, "permissions" | "contributes">) => {
930
+ declared: import("./permissions.js").ExtensionDeclaredReach;
931
+ watchKinds: string[];
932
+ };
639
933
  export declare const extensionIdOf: (manifest: Pick<ExtensionManifest, "publisher" | "name">) => string;
640
934
  //# sourceMappingURL=manifest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqHxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAyC,CAAC;AAC9E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAIxE,eAAO,MAAM,aAAa,aAAc,IAAI,CAAC,iBAAiB,EAAE,WAAW,GAAG,MAAM,CAAC,KAAG,MAAkD,CAAC"}
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA+OxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAyC,CAAC;AAC9E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAIxE,eAAO,MAAM,iBAAiB,aAAc,IAAI,CAAC,iBAAiB,EAAE,aAAa,GAAG,aAAa,CAAC;IAC9F,QAAQ;IACR,UAAU;CACZ,CAAC;AAIH,eAAO,MAAM,aAAa,aAAc,IAAI,CAAC,iBAAiB,EAAE,WAAW,GAAG,MAAM,CAAC,KAAG,MAAkD,CAAC"}
package/dist/manifest.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { MARK_FIELDS } from "./mark.js";
3
- import { permissionProblem } from "./permissions.js";
3
+ import { declaredReachOf, EXTENSION_FIRE_HANDLER, permissionProblem } from "./permissions.js";
4
4
  import { contributesSchema } from "./points/index.js";
5
5
  const permissionEntry = () => z.string().superRefine((entry, ctx) => {
6
6
  const problem = permissionProblem(entry);
@@ -46,11 +46,99 @@ const ManifestShape = z.object({
46
46
  .array(permissionEntry().meta({ power: { key: "daemon:${value}", sentence: "its backend calls the daemon route ${value}" } }))
47
47
  .optional()
48
48
  .describe("Daemon routes your SERVER half may call. Separate from `sandbox` because the two halves run as different principals: the UI as the owner's session, the backend as a minted per-extension token, so a grant to one must never quietly widen the other."),
49
+ events: z
50
+ .array(z.union([
51
+ z.literal("run").meta({ power: { key: "events:run", sentence: "its backend hears when a conversation it started finishes a turn" } }),
52
+ z
53
+ .literal("activity")
54
+ .meta({ power: { key: "events:activity", sentence: "its backend hears whether any agent turn is running in the sandbox" } }),
55
+ z
56
+ .literal("ci")
57
+ .meta({ power: { key: "events:ci", sentence: "its backend hears every CI run and job the workspace's forges report" } }),
58
+ ]))
59
+ .optional()
60
+ .describe("Events your backend hears through `api.events` beyond its settings and the workspace's changes: `run`, a turn ending in a conversation it started through POST /agent with its own token; `activity`, whether any agent turn is running in the sandbox; `ci`, each run and job the workspace's GitHub and GitLab forges report as it is heard (the CI feed)."),
61
+ work: z
62
+ .boolean()
63
+ .meta({ power: { key: "work", sentence: "its backend keeps the sandbox awake, and a restart waiting, while it holds work in flight" } })
64
+ .optional()
65
+ .describe("Whether your backend may hold work in flight with `api.work.hold(label)`: while held, the sandbox stays awake and an update or restart waits for it, as for an agent's turn."),
66
+ exec: z
67
+ .array(z.union([
68
+ z.literal("command").meta({ power: { key: "exec:command", sentence: "its backend runs commands, admitted like an agent's" } }),
69
+ z
70
+ .literal("toolchain")
71
+ .meta({ power: { key: "exec:toolchain", sentence: "its backend runs heavy tools, queued with the sandbox's builds and tests" } }),
72
+ ]))
73
+ .optional()
74
+ .describe("The workload classes `api.exec` may run a command under: `command`, admitted and ranked as an agent's shell command; `toolchain`, a heavy tool (a build, a test run, an analyser), which also takes turns in the sandbox's heavy-command queue."),
75
+ fires: z
76
+ .array(z
77
+ .string()
78
+ .regex(EXTENSION_FIRE_HANDLER, "a handler is a lowercase word: letters, digits and dashes")
79
+ .meta({ power: { key: "fires:${value}", sentence: 'the sandbox\'s automations wake its backend\'s "${value}" handler' } }))
80
+ .optional()
81
+ .describe("Handlers an automation may fire in your backend (`api.automations.onFire(name, handler)`): an automation whose target is `{ kind: \"extension\" }` names this extension and one of these, and fires it on its trigger under the scheduler's admission, holds and journal, without an agent."),
82
+ turn: z
83
+ .array(z.union([
84
+ z.literal("browser").meta({
85
+ power: {
86
+ key: "turn:browser",
87
+ sentence: "its agent tools drive the sandbox's signed-in browsers, for the accounts the calling turn holds and on those accounts' own sites",
88
+ },
89
+ }),
90
+ z
91
+ .literal("owner-browser")
92
+ .meta({ power: { key: "turn:owner-browser", sentence: "its agent tools use the owner's own browser when the calling turn holds it" } }),
93
+ z.literal("jobs").meta({ power: { key: "turn:jobs", sentence: "its agent tools start background jobs in the calling conversation" } }),
94
+ ]))
95
+ .optional()
96
+ .describe("What your agent tools (`contributes.tools`, served by `api.tools.serve`) may do with the grants of the turn that calls them: `browser`, drive the sandbox's signed-in browser of an account the turn holds, on that account's own sites (`api.browser.call`); `owner-browser`, call the owner's own browser the turn holds (`api.ownerBrowser.call`); `jobs`, start a background job in the calling conversation that the agent collects with `wait` (`api.jobs.start`). Never more than the turn holds."),
49
97
  })
50
98
  .optional()
51
99
  .describe('How far this extension may reach into the daemon, as "<METHOD> <path-glob>" entries where `*` matches one path segment: e.g. "GET /panels", "POST /panels/*/start". The install dialog shows these, the host refuses anything undeclared, and the usage ledger records which were actually earned.'),
52
100
  contributes: contributesSchema.optional(),
53
101
  });
102
+ const servedChecks = (manifest, ctx) => {
103
+ const kinds = manifest.contributes?.watchKinds ?? [];
104
+ if (kinds.length > 0 && manifest.server === undefined) {
105
+ ctx.addIssue({ code: "custom", path: ["contributes", "watchKinds"], message: "watch kinds need a `server` bundle to answer their checks" });
106
+ }
107
+ const cards = new Set((manifest.contributes?.capabilities ?? []).map((card) => card.id));
108
+ for (const [index, kind] of kinds.entries()) {
109
+ const foreign = (kind.capabilities ?? []).find((card) => !cards.has(card));
110
+ if (foreign !== undefined) {
111
+ ctx.addIssue({ code: "custom", path: ["contributes", "watchKinds", index, "capabilities"], message: `"${foreign}" is not one of this extension's own capability cards` });
112
+ }
113
+ }
114
+ const ids = kinds.map((kind) => kind.id);
115
+ const doubled = ids.find((id, index) => ids.indexOf(id) !== index);
116
+ if (doubled !== undefined) {
117
+ ctx.addIssue({ code: "custom", path: ["contributes", "watchKinds"], message: `the watch kind "${doubled}" is declared twice` });
118
+ }
119
+ };
120
+ const declaredRoles = (manifest, ctx) => {
121
+ const ids = (manifest.contributes?.modelRoles ?? []).map((role) => role.id);
122
+ const doubled = ids.find((id, index) => ids.indexOf(id) !== index);
123
+ if (doubled !== undefined) {
124
+ ctx.addIssue({ code: "custom", path: ["contributes", "modelRoles"], message: `the model role "${doubled}" is declared twice` });
125
+ }
126
+ };
127
+ const servedPublicRoutes = (manifest, ctx) => {
128
+ const routes = manifest.contributes?.publicRoutes ?? [];
129
+ if (routes.length > 0 && manifest.server === undefined) {
130
+ ctx.addIssue({ code: "custom", path: ["contributes", "publicRoutes"], message: "public routes need a `server` bundle to answer them" });
131
+ }
132
+ for (const [index, route] of routes.entries()) {
133
+ if (route.automation === true && manifest.contributes?.listener === undefined) {
134
+ ctx.addIssue({
135
+ code: "custom",
136
+ path: ["contributes", "publicRoutes", index, "automation"],
137
+ message: "a route scoped to an automation reads it from this extension's own `contributes.listener`, which it does not declare",
138
+ });
139
+ }
140
+ }
141
+ };
54
142
  const servedTools = (manifest, ctx) => {
55
143
  const contributes = manifest.contributes;
56
144
  const tools = contributes?.tools;
@@ -60,6 +148,9 @@ const servedTools = (manifest, ctx) => {
60
148
  ctx.addIssue({ code: "custom", path: ["contributes", "capabilities"], message: `card "${card.id}" declares \`mcp\`, which only a \`server\` bundle can answer` });
61
149
  }
62
150
  }
151
+ servedChecks(manifest, ctx);
152
+ declaredRoles(manifest, ctx);
153
+ servedPublicRoutes(manifest, ctx);
63
154
  if (tools === undefined) {
64
155
  return;
65
156
  }
@@ -84,5 +175,9 @@ const servedTools = (manifest, ctx) => {
84
175
  }
85
176
  };
86
177
  export const ExtensionManifestSchema = ManifestShape.superRefine(servedTools);
178
+ export const declaredOfBackend = (manifest) => ({
179
+ declared: declaredReachOf(manifest.permissions),
180
+ watchKinds: (manifest.contributes?.watchKinds ?? []).map((kind) => kind.id),
181
+ });
87
182
  export const extensionIdOf = (manifest) => `${manifest.publisher}.${manifest.name}`;
88
183
  //# sourceMappingURL=manifest.js.map