@immediately-run/sandbox-protocol 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sandbox.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // GENERATED by scripts/generate.mjs — DO NOT EDIT.
3
3
  // Source of truth: src/descriptors.protocol.mjs (@immediately-run/sandbox-protocol)
4
- // descriptorsHash: 235f4011d391bd63
4
+ // descriptorsHash: 02b97d7ee61b5716
5
5
  //
6
6
  // The sandbox↔SDK wire vocabulary (PLATFORM_LAYERING_SPEC §2 / S1). Import the
7
7
  // constants instead of writing the string: a rename then has ONE edit site and
package/dist/sdk.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** Every wire name this side speaks, as a union. */
2
- export type WireName = 'api-catalog' | 'auth-state' | 'compile' | 'debug-enabled' | 'debug-log' | 'debug-query' | 'debug-query-result' | 'diagnostics' | 'dnd-cancel' | 'dropped-item' | 'editor-context' | 'form-factor' | 'fs-change' | 'invitations' | 'launch-dismiss' | 'launch-ended' | 'llm-provider' | 'metadata-update' | 'mount-add' | 'mount-remove' | 'protocol-contribute' | 'protocol-dnd' | 'protocol-editor' | 'protocol-fetch' | 'protocol-ipc' | 'protocol-launch' | 'protocol-llm' | 'protocol-secrets' | 'protocol-settings' | 'protocol-spaces' | 'protocol-task' | 'protocol-theme' | 'protocol-vcs' | 'region-message' | 'request-api-catalog' | 'request-auth-state' | 'request-debug-enabled' | 'request-diagnostics' | 'request-editor-context' | 'request-form-factor' | 'request-handshake' | 'request-invitations' | 'request-llm-provider' | 'request-mounts' | 'request-secrets-metadata' | 'request-session-mounts' | 'request-theme' | 'request-vcs-state' | 'sdk-handshake' | 'secrets-metadata' | 'session-mounts' | 'task-cancel' | 'task-complete' | 'task-input' | 'theme' | 'urlchange' | 'vcs-state';
2
+ export type WireName = 'api-catalog' | 'auth-state' | 'compile' | 'debug-enabled' | 'debug-log' | 'debug-query' | 'debug-query-result' | 'diagnostics' | 'dnd-cancel' | 'dropped-item' | 'editor-context' | 'form-factor' | 'fs-change' | 'host-attention' | 'invitations' | 'launch-dismiss' | 'launch-ended' | 'llm-provider' | 'metadata-update' | 'mount-add' | 'mount-remove' | 'protocol-analytics' | 'protocol-contribute' | 'protocol-dnd' | 'protocol-editor' | 'protocol-fetch' | 'protocol-ipc' | 'protocol-launch' | 'protocol-llm' | 'protocol-secrets' | 'protocol-settings' | 'protocol-spaces' | 'protocol-task' | 'protocol-theme' | 'protocol-vcs' | 'region-message' | 'request-api-catalog' | 'request-auth-state' | 'request-debug-enabled' | 'request-diagnostics' | 'request-editor-context' | 'request-form-factor' | 'request-handshake' | 'request-host-attention' | 'request-invitations' | 'request-llm-provider' | 'request-mounts' | 'request-secrets-metadata' | 'request-session-mounts' | 'request-theme' | 'request-vcs-state' | 'sdk-handshake' | 'secrets-metadata' | 'session-mounts' | 'task-cancel' | 'task-complete' | 'task-input' | 'theme' | 'urlchange' | 'vcs-state';
3
3
  /** `api-catalog` — push · host->app. polled with `request-api-catalog`. */
4
4
  export declare const API_CATALOG = "api-catalog";
5
5
  /** Read off this message today: `methods`. */
@@ -63,6 +63,9 @@ export declare const FORM_FACTOR = "form-factor";
63
63
  /** `fs-change` — push · host->app. */
64
64
  export declare const FS_CHANGE = "fs-change";
65
65
  /** Read off this message today: `epoch`, `paths`. */
66
+ /** `host-attention` — push · host->app. polled with `request-host-attention`. */
67
+ export declare const HOST_ATTENTION = "host-attention";
68
+ /** Read off this message today: `attention`. */
66
69
  /** `invitations` — push · host->app. polled with `request-invitations`. */
67
70
  export declare const INVITATIONS = "invitations";
68
71
  /** Read off this message today: `invites`. */
@@ -88,6 +91,17 @@ export declare const MOUNT_ADD = "mount-add";
88
91
  /** `mount-remove` — message · host->app. */
89
92
  export declare const MOUNT_REMOVE = "mount-remove";
90
93
  /** Read off this message today: `id`, `path`, `reason`. */
94
+ /** `protocol-analytics` — request · app->host. */
95
+ export declare const PROTOCOL_ANALYTICS = "protocol-analytics";
96
+ /** Params of `protocol-analytics` method `emit`. */
97
+ export interface ProtocolAnalyticsEmitParams {
98
+ name: string;
99
+ props?: unknown | undefined;
100
+ }
101
+ /** Params of `protocol-analytics` method `route`. */
102
+ export interface ProtocolAnalyticsRouteParams {
103
+ path: string;
104
+ }
91
105
  /** `protocol-contribute` — stream · app->host. */
92
106
  export declare const PROTOCOL_CONTRIBUTE = "protocol-contribute";
93
107
  /** Params of `protocol-contribute` method `run`. */
@@ -269,6 +283,8 @@ export declare const REQUEST_EDITOR_CONTEXT = "request-editor-context";
269
283
  export declare const REQUEST_FORM_FACTOR = "request-form-factor";
270
284
  /** `request-handshake` — message · host->app. */
271
285
  export declare const REQUEST_HANDSHAKE = "request-handshake";
286
+ /** `request-host-attention` — poll · app->host. */
287
+ export declare const REQUEST_HOST_ATTENTION = "request-host-attention";
272
288
  /** `request-invitations` — poll · app->host. */
273
289
  export declare const REQUEST_INVITATIONS = "request-invitations";
274
290
  /** `request-llm-provider` — poll · app->host. */
@@ -332,6 +348,7 @@ export declare const WIRE_NAMES: {
332
348
  readonly EDITOR_CONTEXT: "editor-context";
333
349
  readonly FORM_FACTOR: "form-factor";
334
350
  readonly FS_CHANGE: "fs-change";
351
+ readonly HOST_ATTENTION: "host-attention";
335
352
  readonly INVITATIONS: "invitations";
336
353
  readonly LAUNCH_DISMISS: "launch-dismiss";
337
354
  readonly LAUNCH_ENDED: "launch-ended";
@@ -339,6 +356,7 @@ export declare const WIRE_NAMES: {
339
356
  readonly METADATA_UPDATE: "metadata-update";
340
357
  readonly MOUNT_ADD: "mount-add";
341
358
  readonly MOUNT_REMOVE: "mount-remove";
359
+ readonly PROTOCOL_ANALYTICS: "protocol-analytics";
342
360
  readonly PROTOCOL_CONTRIBUTE: "protocol-contribute";
343
361
  readonly PROTOCOL_DND: "protocol-dnd";
344
362
  readonly PROTOCOL_EDITOR: "protocol-editor";
@@ -360,6 +378,7 @@ export declare const WIRE_NAMES: {
360
378
  readonly REQUEST_EDITOR_CONTEXT: "request-editor-context";
361
379
  readonly REQUEST_FORM_FACTOR: "request-form-factor";
362
380
  readonly REQUEST_HANDSHAKE: "request-handshake";
381
+ readonly REQUEST_HOST_ATTENTION: "request-host-attention";
363
382
  readonly REQUEST_INVITATIONS: "request-invitations";
364
383
  readonly REQUEST_LLM_PROVIDER: "request-llm-provider";
365
384
  readonly REQUEST_MOUNTS: "request-mounts";
package/dist/sdk.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // GENERATED by scripts/generate.mjs — DO NOT EDIT.
3
3
  // Source of truth: src/descriptors.protocol.mjs (@immediately-run/sandbox-protocol)
4
- // descriptorsHash: 235f4011d391bd63
4
+ // descriptorsHash: 02b97d7ee61b5716
5
5
  //
6
6
  // The sandbox↔SDK wire vocabulary (PLATFORM_LAYERING_SPEC §2 / S1). Import the
7
7
  // constants instead of writing the string: a rename then has ONE edit site and
@@ -9,8 +9,8 @@
9
9
  // that has a declared shape; a name handled as `any` today gets its read field
10
10
  // list in the doc comment instead (R3-274e is where those grow real types).
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SECRETS_METADATA = exports.SDK_HANDSHAKE = exports.REQUEST_VCS_STATE = exports.REQUEST_THEME = exports.REQUEST_SESSION_MOUNTS = exports.REQUEST_SECRETS_METADATA = exports.REQUEST_MOUNTS = exports.REQUEST_LLM_PROVIDER = exports.REQUEST_INVITATIONS = exports.REQUEST_HANDSHAKE = exports.REQUEST_FORM_FACTOR = exports.REQUEST_EDITOR_CONTEXT = exports.REQUEST_DIAGNOSTICS = exports.REQUEST_DEBUG_ENABLED = exports.REQUEST_AUTH_STATE = exports.REQUEST_API_CATALOG = exports.REGION_MESSAGE = exports.PROTOCOL_VCS = exports.PROTOCOL_THEME = exports.PROTOCOL_TASK = exports.PROTOCOL_SPACES = exports.PROTOCOL_SETTINGS = exports.PROTOCOL_SECRETS = exports.PROTOCOL_LLM = exports.PROTOCOL_LAUNCH = exports.PROTOCOL_IPC = exports.PROTOCOL_FETCH = exports.PROTOCOL_EDITOR = exports.PROTOCOL_DND = exports.PROTOCOL_CONTRIBUTE = exports.MOUNT_REMOVE = exports.MOUNT_ADD = exports.METADATA_UPDATE = exports.LLM_PROVIDER = exports.LAUNCH_ENDED = exports.LAUNCH_DISMISS = exports.INVITATIONS = exports.FS_CHANGE = exports.FORM_FACTOR = exports.EDITOR_CONTEXT = exports.DROPPED_ITEM = exports.DND_CANCEL = exports.DIAGNOSTICS = exports.DEBUG_QUERY_RESULT = exports.DEBUG_QUERY = exports.DEBUG_LOG = exports.DEBUG_ENABLED = exports.COMPILE = exports.AUTH_STATE = exports.API_CATALOG = void 0;
13
- exports.WIRE_NAMES = exports.VCS_STATE = exports.URLCHANGE = exports.THEME = exports.TASK_INPUT = exports.TASK_COMPLETE = exports.TASK_CANCEL = exports.SESSION_MOUNTS = void 0;
12
+ exports.REQUEST_THEME = exports.REQUEST_SESSION_MOUNTS = exports.REQUEST_SECRETS_METADATA = exports.REQUEST_MOUNTS = exports.REQUEST_LLM_PROVIDER = exports.REQUEST_INVITATIONS = exports.REQUEST_HOST_ATTENTION = exports.REQUEST_HANDSHAKE = exports.REQUEST_FORM_FACTOR = exports.REQUEST_EDITOR_CONTEXT = exports.REQUEST_DIAGNOSTICS = exports.REQUEST_DEBUG_ENABLED = exports.REQUEST_AUTH_STATE = exports.REQUEST_API_CATALOG = exports.REGION_MESSAGE = exports.PROTOCOL_VCS = exports.PROTOCOL_THEME = exports.PROTOCOL_TASK = exports.PROTOCOL_SPACES = exports.PROTOCOL_SETTINGS = exports.PROTOCOL_SECRETS = exports.PROTOCOL_LLM = exports.PROTOCOL_LAUNCH = exports.PROTOCOL_IPC = exports.PROTOCOL_FETCH = exports.PROTOCOL_EDITOR = exports.PROTOCOL_DND = exports.PROTOCOL_CONTRIBUTE = exports.PROTOCOL_ANALYTICS = exports.MOUNT_REMOVE = exports.MOUNT_ADD = exports.METADATA_UPDATE = exports.LLM_PROVIDER = exports.LAUNCH_ENDED = exports.LAUNCH_DISMISS = exports.INVITATIONS = exports.HOST_ATTENTION = exports.FS_CHANGE = exports.FORM_FACTOR = exports.EDITOR_CONTEXT = exports.DROPPED_ITEM = exports.DND_CANCEL = exports.DIAGNOSTICS = exports.DEBUG_QUERY_RESULT = exports.DEBUG_QUERY = exports.DEBUG_LOG = exports.DEBUG_ENABLED = exports.COMPILE = exports.AUTH_STATE = exports.API_CATALOG = void 0;
13
+ exports.WIRE_NAMES = exports.VCS_STATE = exports.URLCHANGE = exports.THEME = exports.TASK_INPUT = exports.TASK_COMPLETE = exports.TASK_CANCEL = exports.SESSION_MOUNTS = exports.SECRETS_METADATA = exports.SDK_HANDSHAKE = exports.REQUEST_VCS_STATE = void 0;
14
14
  /** `api-catalog` — push · host->app. polled with `request-api-catalog`. */
15
15
  exports.API_CATALOG = 'api-catalog';
16
16
  /** Read off this message today: `methods`. */
@@ -44,6 +44,9 @@ exports.FORM_FACTOR = 'form-factor';
44
44
  /** `fs-change` — push · host->app. */
45
45
  exports.FS_CHANGE = 'fs-change';
46
46
  /** Read off this message today: `epoch`, `paths`. */
47
+ /** `host-attention` — push · host->app. polled with `request-host-attention`. */
48
+ exports.HOST_ATTENTION = 'host-attention';
49
+ /** Read off this message today: `attention`. */
47
50
  /** `invitations` — push · host->app. polled with `request-invitations`. */
48
51
  exports.INVITATIONS = 'invitations';
49
52
  /** Read off this message today: `invites`. */
@@ -62,6 +65,8 @@ exports.MOUNT_ADD = 'mount-add';
62
65
  /** `mount-remove` — message · host->app. */
63
66
  exports.MOUNT_REMOVE = 'mount-remove';
64
67
  /** Read off this message today: `id`, `path`, `reason`. */
68
+ /** `protocol-analytics` — request · app->host. */
69
+ exports.PROTOCOL_ANALYTICS = 'protocol-analytics';
65
70
  /** `protocol-contribute` — stream · app->host. */
66
71
  exports.PROTOCOL_CONTRIBUTE = 'protocol-contribute';
67
72
  /** `protocol-dnd` — request · app->host. */
@@ -104,6 +109,8 @@ exports.REQUEST_EDITOR_CONTEXT = 'request-editor-context';
104
109
  exports.REQUEST_FORM_FACTOR = 'request-form-factor';
105
110
  /** `request-handshake` — message · host->app. */
106
111
  exports.REQUEST_HANDSHAKE = 'request-handshake';
112
+ /** `request-host-attention` — poll · app->host. */
113
+ exports.REQUEST_HOST_ATTENTION = 'request-host-attention';
107
114
  /** `request-invitations` — poll · app->host. */
108
115
  exports.REQUEST_INVITATIONS = 'request-invitations';
109
116
  /** `request-llm-provider` — poll · app->host. */
@@ -155,6 +162,7 @@ exports.WIRE_NAMES = {
155
162
  EDITOR_CONTEXT: exports.EDITOR_CONTEXT,
156
163
  FORM_FACTOR: exports.FORM_FACTOR,
157
164
  FS_CHANGE: exports.FS_CHANGE,
165
+ HOST_ATTENTION: exports.HOST_ATTENTION,
158
166
  INVITATIONS: exports.INVITATIONS,
159
167
  LAUNCH_DISMISS: exports.LAUNCH_DISMISS,
160
168
  LAUNCH_ENDED: exports.LAUNCH_ENDED,
@@ -162,6 +170,7 @@ exports.WIRE_NAMES = {
162
170
  METADATA_UPDATE: exports.METADATA_UPDATE,
163
171
  MOUNT_ADD: exports.MOUNT_ADD,
164
172
  MOUNT_REMOVE: exports.MOUNT_REMOVE,
173
+ PROTOCOL_ANALYTICS: exports.PROTOCOL_ANALYTICS,
165
174
  PROTOCOL_CONTRIBUTE: exports.PROTOCOL_CONTRIBUTE,
166
175
  PROTOCOL_DND: exports.PROTOCOL_DND,
167
176
  PROTOCOL_EDITOR: exports.PROTOCOL_EDITOR,
@@ -183,6 +192,7 @@ exports.WIRE_NAMES = {
183
192
  REQUEST_EDITOR_CONTEXT: exports.REQUEST_EDITOR_CONTEXT,
184
193
  REQUEST_FORM_FACTOR: exports.REQUEST_FORM_FACTOR,
185
194
  REQUEST_HANDSHAKE: exports.REQUEST_HANDSHAKE,
195
+ REQUEST_HOST_ATTENTION: exports.REQUEST_HOST_ATTENTION,
186
196
  REQUEST_INVITATIONS: exports.REQUEST_INVITATIONS,
187
197
  REQUEST_LLM_PROVIDER: exports.REQUEST_LLM_PROVIDER,
188
198
  REQUEST_MOUNTS: exports.REQUEST_MOUNTS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immediately-run/sandbox-protocol",
3
- "version": "0.3.1",
3
+ "version": "0.5.0",
4
4
  "description": "The sandbox<->SDK wire protocol: ONE descriptor set, projected into the wire-name constants, the payload types, and the per-side snapshots both repos gate against (PLATFORM_LAYERING_SPEC S1). Consumed by sandbox and immediately-run-sdk so a wire change is a version bump, not a hand-copied file.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -503,6 +503,62 @@
503
503
  "src/onFsChange.ts"
504
504
  ]
505
505
  },
506
+ "host-attention": {
507
+ "kind": "push",
508
+ "direction": "host->app",
509
+ "poll": "request-host-attention",
510
+ "payload": {
511
+ "reads": [
512
+ "attention"
513
+ ]
514
+ },
515
+ "value": {
516
+ "fields": [
517
+ {
518
+ "name": "awaiting",
519
+ "optional": false,
520
+ "type": "boolean"
521
+ },
522
+ {
523
+ "name": "kind",
524
+ "optional": false,
525
+ "union": [
526
+ {
527
+ "type": "\"confirmation\""
528
+ },
529
+ {
530
+ "type": "\"consent\""
531
+ },
532
+ {
533
+ "type": "\"passkey\""
534
+ },
535
+ {
536
+ "type": "\"picker\""
537
+ },
538
+ {
539
+ "type": "null"
540
+ }
541
+ ]
542
+ },
543
+ {
544
+ "name": "since",
545
+ "optional": false,
546
+ "union": [
547
+ {
548
+ "type": "null"
549
+ },
550
+ {
551
+ "type": "number"
552
+ }
553
+ ]
554
+ }
555
+ ],
556
+ "type": "HostAttention"
557
+ },
558
+ "sites": [
559
+ "src/hostAttention.ts"
560
+ ]
561
+ },
506
562
  "invitations": {
507
563
  "kind": "push",
508
564
  "direction": "host->app",
@@ -697,6 +753,49 @@
697
753
  "src/mounts.ts"
698
754
  ]
699
755
  },
756
+ "protocol-analytics": {
757
+ "kind": "request",
758
+ "direction": "app->host",
759
+ "methods": {
760
+ "emit": {
761
+ "payload": {
762
+ "fields": [
763
+ {
764
+ "name": "name",
765
+ "optional": false,
766
+ "type": "string"
767
+ },
768
+ {
769
+ "name": "props",
770
+ "optional": true,
771
+ "union": [
772
+ {
773
+ "type": "Record<string, AnalyticsPropValue>"
774
+ },
775
+ {
776
+ "type": "undefined"
777
+ }
778
+ ]
779
+ }
780
+ ]
781
+ }
782
+ },
783
+ "route": {
784
+ "payload": {
785
+ "fields": [
786
+ {
787
+ "name": "path",
788
+ "optional": false,
789
+ "type": "string"
790
+ }
791
+ ]
792
+ }
793
+ }
794
+ },
795
+ "sites": [
796
+ "src/analytics.ts"
797
+ ]
798
+ },
700
799
  "protocol-contribute": {
701
800
  "kind": "stream",
702
801
  "direction": "app->host",
@@ -1634,6 +1733,16 @@
1634
1733
  "src/runtime.ts"
1635
1734
  ]
1636
1735
  },
1736
+ "request-host-attention": {
1737
+ "kind": "poll",
1738
+ "direction": "app->host",
1739
+ "payload": {
1740
+ "fields": []
1741
+ },
1742
+ "sites": [
1743
+ "src/hostAttention.ts"
1744
+ ]
1745
+ },
1637
1746
  "request-invitations": {
1638
1747
  "kind": "poll",
1639
1748
  "direction": "app->host",
@@ -2005,6 +2114,7 @@
2005
2114
  "dynamicFamilies": {
2006
2115
  "protocol-<scheme>": {
2007
2116
  "schemes": [
2117
+ "analytics",
2008
2118
  "contribute",
2009
2119
  "dnd",
2010
2120
  "editor",