@mostra/protocol 0.9.0 → 0.10.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 (211) hide show
  1. package/dist/actions.d.ts +30 -4
  2. package/dist/actions.d.ts.map +1 -1
  3. package/dist/actions.js +14 -4
  4. package/dist/actions.js.map +1 -1
  5. package/dist/artifact.d.ts +2 -1
  6. package/dist/artifact.d.ts.map +1 -1
  7. package/dist/artifact.js +2 -1
  8. package/dist/artifact.js.map +1 -1
  9. package/dist/browser.d.ts +5 -0
  10. package/dist/browser.d.ts.map +1 -1
  11. package/dist/browser.js +7 -2
  12. package/dist/browser.js.map +1 -1
  13. package/dist/capability.d.ts +0 -9
  14. package/dist/capability.d.ts.map +1 -1
  15. package/dist/capability.js +1 -17
  16. package/dist/capability.js.map +1 -1
  17. package/dist/diagnostics/codes/artifact.d.ts +1 -1
  18. package/dist/diagnostics/codes/artifact.d.ts.map +1 -1
  19. package/dist/diagnostics/codes/artifact.js +12 -1
  20. package/dist/diagnostics/codes/artifact.js.map +1 -1
  21. package/dist/diagnostics/codes/home.d.ts +1 -1
  22. package/dist/diagnostics/codes/home.d.ts.map +1 -1
  23. package/dist/diagnostics/codes/home.js +12 -1
  24. package/dist/diagnostics/codes/home.js.map +1 -1
  25. package/dist/diagnostics/codes/index.d.ts +3 -2
  26. package/dist/diagnostics/codes/index.d.ts.map +1 -1
  27. package/dist/diagnostics/codes/index.js +3 -1
  28. package/dist/diagnostics/codes/index.js.map +1 -1
  29. package/dist/diagnostics/codes/remote.d.ts +8 -0
  30. package/dist/diagnostics/codes/remote.d.ts.map +1 -0
  31. package/dist/diagnostics/codes/remote.js +99 -0
  32. package/dist/diagnostics/codes/remote.js.map +1 -0
  33. package/dist/diagnostics/diagnostic.d.ts +1 -1
  34. package/dist/diagnostics/diagnostic.d.ts.map +1 -1
  35. package/dist/diagnostics/diagnostic.js +2 -1
  36. package/dist/diagnostics/diagnostic.js.map +1 -1
  37. package/dist/duration.d.ts +13 -0
  38. package/dist/duration.d.ts.map +1 -0
  39. package/dist/duration.js +27 -0
  40. package/dist/duration.js.map +1 -0
  41. package/dist/ids.d.ts +17 -1
  42. package/dist/ids.d.ts.map +1 -1
  43. package/dist/ids.js +9 -1
  44. package/dist/ids.js.map +1 -1
  45. package/dist/index.d.ts +30 -8
  46. package/dist/index.js +30 -8
  47. package/dist/interaction.d.ts +28 -2
  48. package/dist/interaction.d.ts.map +1 -1
  49. package/dist/interaction.js +20 -5
  50. package/dist/interaction.js.map +1 -1
  51. package/dist/manifest.d.ts +59 -14
  52. package/dist/manifest.d.ts.map +1 -1
  53. package/dist/manifest.js +63 -15
  54. package/dist/manifest.js.map +1 -1
  55. package/dist/methods/artifact/export.d.ts +40 -0
  56. package/dist/methods/artifact/export.d.ts.map +1 -0
  57. package/dist/methods/artifact/export.js +36 -0
  58. package/dist/methods/artifact/export.js.map +1 -0
  59. package/dist/methods/artifact/import.d.ts +23 -0
  60. package/dist/methods/artifact/import.d.ts.map +1 -0
  61. package/dist/methods/artifact/import.js +25 -0
  62. package/dist/methods/artifact/import.js.map +1 -0
  63. package/dist/methods/artifact/publish.d.ts +2 -1
  64. package/dist/methods/artifact/publish.d.ts.map +1 -1
  65. package/dist/methods/artifact/publish.js +1 -1
  66. package/dist/methods/hosted/push.d.ts +76 -0
  67. package/dist/methods/hosted/push.d.ts.map +1 -0
  68. package/dist/methods/hosted/push.js +71 -0
  69. package/dist/methods/hosted/push.js.map +1 -0
  70. package/dist/methods/hosted/submission.d.ts +18 -0
  71. package/dist/methods/hosted/submission.d.ts.map +1 -0
  72. package/dist/methods/hosted/submission.js +23 -0
  73. package/dist/methods/hosted/submission.js.map +1 -0
  74. package/dist/methods/index.d.ts.map +1 -1
  75. package/dist/methods/index.js +38 -2
  76. package/dist/methods/index.js.map +1 -1
  77. package/dist/methods/instance/status.d.ts +3 -0
  78. package/dist/methods/instance/status.d.ts.map +1 -1
  79. package/dist/methods/instance/status.js +3 -1
  80. package/dist/methods/instance/status.js.map +1 -1
  81. package/dist/methods/mostra/initialize.d.ts +17 -3
  82. package/dist/methods/mostra/initialize.d.ts.map +1 -1
  83. package/dist/methods/mostra/initialize.js +11 -3
  84. package/dist/methods/mostra/initialize.js.map +1 -1
  85. package/dist/methods/port/relay-call.d.ts +33 -0
  86. package/dist/methods/port/relay-call.d.ts.map +1 -0
  87. package/dist/methods/port/relay-call.js +31 -0
  88. package/dist/methods/port/relay-call.js.map +1 -0
  89. package/dist/methods/port/relay-cancel.d.ts +16 -0
  90. package/dist/methods/port/relay-cancel.d.ts.map +1 -0
  91. package/dist/methods/port/relay-cancel.js +21 -0
  92. package/dist/methods/port/relay-cancel.js.map +1 -0
  93. package/dist/methods/port/relay-live.d.ts +25 -0
  94. package/dist/methods/port/relay-live.d.ts.map +1 -0
  95. package/dist/methods/port/relay-live.js +32 -0
  96. package/dist/methods/port/relay-live.js.map +1 -0
  97. package/dist/methods/port/relay-reconcile.d.ts +39 -0
  98. package/dist/methods/port/relay-reconcile.d.ts.map +1 -0
  99. package/dist/methods/port/relay-reconcile.js +35 -0
  100. package/dist/methods/port/relay-reconcile.js.map +1 -0
  101. package/dist/methods/port/relay-run.d.ts +47 -0
  102. package/dist/methods/port/relay-run.d.ts.map +1 -0
  103. package/dist/methods/port/relay-run.js +41 -0
  104. package/dist/methods/port/relay-run.js.map +1 -0
  105. package/dist/methods/port/submissions-deliver.d.ts +8 -0
  106. package/dist/methods/port/submissions-deliver.d.ts.map +1 -1
  107. package/dist/methods/port/submissions-deliver.js +4 -2
  108. package/dist/methods/port/submissions-deliver.js.map +1 -1
  109. package/dist/methods/relay/call-batch.d.ts +26 -0
  110. package/dist/methods/relay/call-batch.d.ts.map +1 -0
  111. package/dist/methods/relay/call-batch.js +30 -0
  112. package/dist/methods/relay/call-batch.js.map +1 -0
  113. package/dist/methods/relay/effect.d.ts +31 -0
  114. package/dist/methods/relay/effect.d.ts.map +1 -0
  115. package/dist/methods/relay/effect.js +30 -0
  116. package/dist/methods/relay/effect.js.map +1 -0
  117. package/dist/methods/relay/live-value.d.ts +33 -0
  118. package/dist/methods/relay/live-value.d.ts.map +1 -0
  119. package/dist/methods/relay/live-value.js +32 -0
  120. package/dist/methods/relay/live-value.js.map +1 -0
  121. package/dist/methods/relay/run-update.d.ts +46 -0
  122. package/dist/methods/relay/run-update.d.ts.map +1 -0
  123. package/dist/methods/relay/run-update.js +45 -0
  124. package/dist/methods/relay/run-update.js.map +1 -0
  125. package/dist/methods/remote/login-wait.d.ts +30 -0
  126. package/dist/methods/remote/login-wait.d.ts.map +1 -0
  127. package/dist/methods/remote/login-wait.js +36 -0
  128. package/dist/methods/remote/login-wait.js.map +1 -0
  129. package/dist/methods/remote/login.d.ts +41 -0
  130. package/dist/methods/remote/login.d.ts.map +1 -0
  131. package/dist/methods/remote/login.js +37 -0
  132. package/dist/methods/remote/login.js.map +1 -0
  133. package/dist/methods/remote/logout.d.ts +25 -0
  134. package/dist/methods/remote/logout.d.ts.map +1 -0
  135. package/dist/methods/remote/logout.js +28 -0
  136. package/dist/methods/remote/logout.js.map +1 -0
  137. package/dist/methods/remote/status.d.ts +14 -0
  138. package/dist/methods/remote/status.d.ts.map +1 -0
  139. package/dist/methods/remote/status.js +22 -0
  140. package/dist/methods/remote/status.js.map +1 -0
  141. package/dist/methods/remote/token.d.ts +19 -0
  142. package/dist/methods/remote/token.d.ts.map +1 -0
  143. package/dist/methods/remote/token.js +24 -0
  144. package/dist/methods/remote/token.js.map +1 -0
  145. package/dist/methods/share/start.d.ts +5 -2
  146. package/dist/methods/share/start.d.ts.map +1 -1
  147. package/dist/methods/share/start.js +6 -3
  148. package/dist/methods/share/start.js.map +1 -1
  149. package/dist/methods/state/patch.d.ts +7 -0
  150. package/dist/methods/state/patch.d.ts.map +1 -1
  151. package/dist/methods/state/patch.js +2 -1
  152. package/dist/methods/state/patch.js.map +1 -1
  153. package/dist/methods/view/url.d.ts +2 -1
  154. package/dist/methods/view/url.d.ts.map +1 -1
  155. package/dist/methods/view/url.js +2 -1
  156. package/dist/methods/view/url.js.map +1 -1
  157. package/dist/policy.d.ts +18 -0
  158. package/dist/policy.d.ts.map +1 -0
  159. package/dist/policy.js +23 -0
  160. package/dist/policy.js.map +1 -0
  161. package/dist/remote.d.ts +55 -0
  162. package/dist/remote.d.ts.map +1 -0
  163. package/dist/remote.js +52 -0
  164. package/dist/remote.js.map +1 -0
  165. package/dist/view.d.ts +1 -1
  166. package/dist/view.js +1 -1
  167. package/dist/view.js.map +1 -1
  168. package/package.json +2 -2
  169. package/schemas/protocol.draft-07.json +1607 -126
  170. package/schemas/protocol.schema.json +1543 -126
  171. package/src/actions.ts +45 -5
  172. package/src/browser.ts +6 -0
  173. package/src/capability.ts +0 -23
  174. package/src/diagnostics/codes/artifact.ts +12 -0
  175. package/src/diagnostics/codes/home.ts +12 -0
  176. package/src/diagnostics/codes/index.ts +6 -2
  177. package/src/diagnostics/codes/remote.ts +113 -0
  178. package/src/diagnostics/diagnostic.ts +3 -1
  179. package/src/duration.ts +29 -0
  180. package/src/ids.ts +33 -1
  181. package/src/index.ts +124 -8
  182. package/src/interaction.ts +42 -2
  183. package/src/manifest.ts +115 -24
  184. package/src/methods/artifact/export.ts +68 -0
  185. package/src/methods/artifact/import.ts +39 -0
  186. package/src/methods/hosted/push.ts +146 -0
  187. package/src/methods/hosted/submission.ts +34 -0
  188. package/src/methods/index.ts +36 -0
  189. package/src/methods/instance/status.ts +4 -0
  190. package/src/methods/mostra/initialize.ts +19 -3
  191. package/src/methods/port/relay-call.ts +58 -0
  192. package/src/methods/port/relay-cancel.ts +33 -0
  193. package/src/methods/port/relay-live.ts +48 -0
  194. package/src/methods/port/relay-reconcile.ts +71 -0
  195. package/src/methods/port/relay-run.ts +80 -0
  196. package/src/methods/port/submissions-deliver.ts +13 -1
  197. package/src/methods/relay/call-batch.ts +52 -0
  198. package/src/methods/relay/effect.ts +55 -0
  199. package/src/methods/relay/live-value.ts +54 -0
  200. package/src/methods/relay/run-update.ts +81 -0
  201. package/src/methods/remote/login-wait.ts +55 -0
  202. package/src/methods/remote/login.ts +72 -0
  203. package/src/methods/remote/logout.ts +42 -0
  204. package/src/methods/remote/status.ts +34 -0
  205. package/src/methods/remote/token.ts +39 -0
  206. package/src/methods/share/start.ts +12 -4
  207. package/src/methods/state/patch.ts +6 -0
  208. package/src/methods/view/url.ts +2 -1
  209. package/src/policy.ts +30 -0
  210. package/src/remote.ts +89 -0
  211. package/src/view.ts +1 -1
package/dist/ids.js CHANGED
@@ -111,6 +111,14 @@ const TokenId = generated(defineKind("tok", "capability token", "ulid", "TokenId
111
111
  const MutationId = generated(defineKind("mut", "mutation", "ulid", "MutationId"));
112
112
  /** Share IDs. */
113
113
  const ShareId = generated(defineKind("shr", "share", "ulid", "ShareId"));
114
+ /** Account IDs. */
115
+ const AccountId = generated(defineKind("acct", "account", "ulid", "AccountId"));
116
+ /** Hosted home IDs. */
117
+ const HomeId = generated(defineKind("hom", "hosted home", "ulid", "HomeId"));
118
+ /** Instance link IDs. */
119
+ const LinkId = generated(defineKind("lnk", "instance link", "ulid", "LinkId"));
120
+ /** Hosted route IDs. */
121
+ const RouteId = generated(defineKind("rte", "hosted route", "ulid", "RouteId"));
114
122
  /** Event cursors. */
115
123
  const Cursor = (() => {
116
124
  const pattern = /^(0|[1-9][0-9]{0,18})$/;
@@ -132,6 +140,6 @@ const Cursor = (() => {
132
140
  };
133
141
  })();
134
142
  //#endregion
135
- export { ArtifactId, CommentId, Cursor, DeliveryId, MutationId, RunId, ShareId, SubmissionId, ThreadId, TokenId, VersionId, ViewId, ViewerId };
143
+ export { AccountId, ArtifactId, CommentId, Cursor, DeliveryId, HomeId, LinkId, MutationId, RouteId, RunId, ShareId, SubmissionId, ThreadId, TokenId, VersionId, ViewId, ViewerId };
136
144
 
137
145
  //# sourceMappingURL=ids.js.map
package/dist/ids.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ids.js","names":[],"sources":["../src/ids.ts"],"sourcesContent":["/**\n * Prefixed, opaque identifiers (INTERFACES §1, DATA_MODEL §2).\n *\n * Every Mostra entity is named by a string of the form `<prefix>_<body>`. Callers treat IDs as\n * opaque: they validate the form at a boundary and never read meaning out of the body. Each ID\n * kind below is both a type and a value with the same name:\n *\n * ```ts\n * const artifact: ArtifactId = ArtifactId.parse(input);\n * const mutation: MutationId = MutationId.create();\n * const Params = z.object({ artifactId: ArtifactId.schema });\n * ```\n *\n * @packageDocumentation\n */\nimport * as z from \"zod\";\nimport { wireRegistry } from \"./wire-registry.ts\";\n\n/** The prefixes INTERFACES §1 assigns, one per entity. */\nexport type IdPrefix =\n | \"art\"\n | \"ver\"\n | \"vw\"\n | \"vwr\"\n | \"sub\"\n | \"dlv\"\n | \"run\"\n | \"thr\"\n | \"cmt\"\n | \"tok\"\n | \"mut\"\n | \"shr\";\n\n/**\n * A branded ID string. The brand exists only at the type level, so an `Id<\"art\">` is a plain\n * string at run time and on the wire.\n */\nexport type Id<P extends IdPrefix> = `${P}_${string}` & { readonly __mostraIdPrefix: P };\n\n/** How an ID kind's body is formed. */\nexport type IdBody = \"ulid\" | \"sha256-base32\";\n\n/** One ID kind: its prefix, validation and schema. */\nexport interface IdKind<P extends IdPrefix> {\n /** The prefix, without the underscore. */\n readonly prefix: P;\n /** The entity the ID names, in the PRODUCT vocabulary. */\n readonly entity: string;\n /** How the body is formed. */\n readonly body: IdBody;\n /** The exact form, anchored at both ends. */\n readonly pattern: RegExp;\n /** The Zod schema for this ID, registered for JSON Schema output under the kind's type name. */\n readonly schema: z.ZodType<Id<P>, string>;\n /** Whether `value` is an ID of this kind. */\n is(value: unknown): value is Id<P>;\n /**\n * Returns `value` as an ID of this kind.\n *\n * @throws TypeError when `value` is not of this kind's form. The message names the expected\n * form and never echoes the input.\n */\n parse(value: string): Id<P>;\n}\n\n/** An ID kind whose body is a ULID that the creator generates. */\nexport interface GeneratedIdKind<P extends IdPrefix> extends IdKind<P> {\n /** Generates a new ID from the current time and 80 bits of Web Crypto randomness. */\n create(): Id<P>;\n}\n\n/** Crockford's base32 alphabet, used by ULIDs and by content-addressed version IDs. */\nconst CROCKFORD = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\";\nconst BODY_LENGTH = 26;\n/** A ULID's first character encodes at most 3 bits (48-bit time in 26 × 5 = 130 bits). */\nconst ULID_BODY = \"[0-7][0-9A-HJKMNP-TV-Z]{25}\";\nconst BASE32_BODY = \"[0-9A-HJKMNP-TV-Z]{26}\";\n\nfunction defineKind<P extends IdPrefix>(\n prefix: P,\n entity: string,\n body: IdBody,\n typeName: string,\n): IdKind<P> {\n const pattern = new RegExp(`^${prefix}_${body === \"ulid\" ? ULID_BODY : BASE32_BODY}$`);\n const form = body === \"ulid\" ? \"a 26-character ULID\" : \"26 characters of Crockford base32\";\n const is = (value: unknown): value is Id<P> => typeof value === \"string\" && pattern.test(value);\n const schema = z\n .string()\n .regex(pattern)\n .register(wireRegistry, {\n id: typeName,\n description: `${entity[0]?.toUpperCase()}${entity.slice(1)} ID: \"${prefix}_\" followed by ${form}.`,\n }) as unknown as z.ZodType<Id<P>, string>;\n return {\n prefix,\n entity,\n body,\n pattern,\n schema,\n is,\n parse(value: string): Id<P> {\n if (is(value)) return value;\n throw new TypeError(`Expected ${entity} ID \"${prefix}_\" followed by ${form}.`);\n },\n };\n}\n\nfunction generated<P extends IdPrefix>(kind: IdKind<P>): GeneratedIdKind<P> {\n return { ...kind, create: () => kind.parse(`${kind.prefix}_${ulidBody(Date.now())}`) };\n}\n\n/**\n * Encodes a ULID body: 48 bits of milliseconds since the Unix epoch, then 80 random bits, as 26\n * Crockford base32 characters.\n */\nfunction ulidBody(now: number): string {\n if (!Number.isSafeInteger(now) || now < 0 || now > 0xffff_ffff_ffff) {\n throw new RangeError(\"ULID time must be a millisecond timestamp between 0 and 2^48 - 1.\");\n }\n let time = \"\";\n let rest = now;\n for (let i = 0; i < 10; i++) {\n time = CROCKFORD.charAt(rest % 32) + time;\n rest = Math.floor(rest / 32);\n }\n const random = new Uint8Array(10);\n globalThis.crypto.getRandomValues(random);\n return time + base32(random).slice(0, 16);\n}\n\n/** Encodes bytes as Crockford base32, most significant bit first, padding the last group with 0. */\nfunction base32(bytes: Uint8Array): string {\n let out = \"\";\n let buffer = 0;\n let bits = 0;\n for (const byte of bytes) {\n buffer = (buffer << 8) | byte;\n bits += 8;\n while (bits >= 5) {\n out += CROCKFORD.charAt((buffer >>> (bits - 5)) & 31);\n bits -= 5;\n }\n buffer &= (1 << bits) - 1;\n }\n if (bits > 0) out += CROCKFORD.charAt((buffer << (5 - bits)) & 31);\n return out;\n}\n\n/** An artifact ID (`art_` + ULID). */\nexport type ArtifactId = Id<\"art\">;\n/** Artifact IDs. */\nexport const ArtifactId: GeneratedIdKind<\"art\"> = generated(\n defineKind(\"art\", \"artifact\", \"ulid\", \"ArtifactId\"),\n);\n\n/** A version ID (`ver_` + 26 characters of base32 SHA-256): content-addressed, never generated. */\nexport type VersionId = Id<\"ver\">;\n/** The version ID kind, with the content-addressed constructor DATA_MODEL §2 defines. */\nexport interface VersionIdKind extends IdKind<\"ver\"> {\n /**\n * Returns the version ID for a SHA-256 digest: `ver_` plus the first 26 characters of the\n * digest in Crockford base32 (130 bits). The caller computes the digest of the artifact ID's\n * UTF-8 bytes, a `0x00` byte, and the 32-byte `sourceDigest` and `envDigest` (DATA_MODEL §2,\n * D89).\n *\n * @throws RangeError when `digest` is not 32 bytes long.\n */\n fromSha256(digest: Uint8Array): VersionId;\n}\n/** Version IDs. */\nexport const VersionId: VersionIdKind = {\n ...defineKind(\"ver\", \"version\", \"sha256-base32\", \"VersionId\"),\n fromSha256(digest: Uint8Array): VersionId {\n if (digest.length !== 32) {\n throw new RangeError(`A SHA-256 digest is 32 bytes, got ${digest.length}.`);\n }\n return VersionId.parse(`ver_${base32(digest).slice(0, BODY_LENGTH)}`);\n },\n};\n\n/** A view ID (`vw_` + ULID). */\nexport type ViewId = Id<\"vw\">;\n/** View IDs. */\nexport const ViewId: GeneratedIdKind<\"vw\"> = generated(defineKind(\"vw\", \"view\", \"ulid\", \"ViewId\"));\n\n/** A viewer ID (`vwr_` + ULID). */\nexport type ViewerId = Id<\"vwr\">;\n/** Viewer IDs. */\nexport const ViewerId: GeneratedIdKind<\"vwr\"> = generated(\n defineKind(\"vwr\", \"viewer\", \"ulid\", \"ViewerId\"),\n);\n\n/** A submission ID (`sub_` + ULID). */\nexport type SubmissionId = Id<\"sub\">;\n/** Submission IDs. */\nexport const SubmissionId: GeneratedIdKind<\"sub\"> = generated(\n defineKind(\"sub\", \"submission\", \"ulid\", \"SubmissionId\"),\n);\n\n/**\n * A delivery ID (`dlv_` + ULID): one submission's delivery to one host (D105). A redelivery after a\n * crash repeats it, so a host can treat deliveries idempotently.\n */\nexport type DeliveryId = Id<\"dlv\">;\n/** Delivery IDs. */\nexport const DeliveryId: GeneratedIdKind<\"dlv\"> = generated(\n defineKind(\"dlv\", \"delivery\", \"ulid\", \"DeliveryId\"),\n);\n\n/** An action run ID (`run_` + ULID). */\nexport type RunId = Id<\"run\">;\n/** Action run IDs. */\nexport const RunId: GeneratedIdKind<\"run\"> = generated(\n defineKind(\"run\", \"action run\", \"ulid\", \"RunId\"),\n);\n\n/** A review thread ID (`thr_` + ULID). */\nexport type ThreadId = Id<\"thr\">;\n/** Review thread IDs. */\nexport const ThreadId: GeneratedIdKind<\"thr\"> = generated(\n defineKind(\"thr\", \"thread\", \"ulid\", \"ThreadId\"),\n);\n\n/** A comment ID (`cmt_` + ULID). */\nexport type CommentId = Id<\"cmt\">;\n/** Comment IDs. */\nexport const CommentId: GeneratedIdKind<\"cmt\"> = generated(\n defineKind(\"cmt\", \"comment\", \"ulid\", \"CommentId\"),\n);\n\n/** A capability token ID (`tok_` + ULID). The token's secret is separate and never an ID. */\nexport type TokenId = Id<\"tok\">;\n/** Capability token IDs. */\nexport const TokenId: GeneratedIdKind<\"tok\"> = generated(\n defineKind(\"tok\", \"capability token\", \"ulid\", \"TokenId\"),\n);\n\n/** A mutation ID (`mut_` + ULID), generated by the client that sends the mutation. */\nexport type MutationId = Id<\"mut\">;\n/** Mutation IDs. */\nexport const MutationId: GeneratedIdKind<\"mut\"> = generated(\n defineKind(\"mut\", \"mutation\", \"ulid\", \"MutationId\"),\n);\n\n/** A share ID (`shr_` + ULID): one share of an artifact through a tunnel (D158). */\nexport type ShareId = Id<\"shr\">;\n/** Share IDs. */\nexport const ShareId: GeneratedIdKind<\"shr\"> = generated(\n defineKind(\"shr\", \"share\", \"ulid\", \"ShareId\"),\n);\n\n/**\n * An event cursor: the decimal string of a home-wide event position (INTERFACES §1). Decimal\n * strings keep 64-bit positions exact in JavaScript.\n */\nexport type Cursor = string & { readonly __mostraCursor: true };\n\n/** Event cursors. */\nexport const Cursor: {\n /** The exact form: a non-negative decimal integer without leading zeros, at most 19 digits. */\n readonly pattern: RegExp;\n readonly schema: z.ZodType<Cursor, string>;\n is(value: unknown): value is Cursor;\n /** @throws TypeError when `value` is not a cursor. */\n parse(value: string): Cursor;\n /** Orders two cursors: negative when `a` comes first, zero when equal, positive otherwise. */\n compare(a: Cursor, b: Cursor): number;\n} = (() => {\n const pattern = /^(0|[1-9][0-9]{0,18})$/;\n const is = (value: unknown): value is Cursor => typeof value === \"string\" && pattern.test(value);\n return {\n pattern,\n schema: z.string().regex(pattern).register(wireRegistry, {\n id: \"Cursor\",\n description: \"Event cursor: the decimal string of a home-wide event position.\",\n }) as unknown as z.ZodType<Cursor, string>,\n is,\n parse(value: string): Cursor {\n if (is(value)) return value;\n throw new TypeError(\"Expected an event cursor: a non-negative decimal integer string.\");\n },\n compare(a: Cursor, b: Cursor): number {\n return a.length === b.length ? (a < b ? -1 : a > b ? 1 : 0) : a.length - b.length;\n },\n };\n})();\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwEA,MAAM,YAAY;AAClB,MAAM,cAAc;;AAEpB,MAAM,YAAY;AAClB,MAAM,cAAc;AAEpB,SAAS,WACP,QACA,QACA,MACA,UACW;CACX,MAAM,UAAU,IAAI,OA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AM,UAAoC,OAAO,UAAU,YAAY,QAAQ,KAAK,KAAK;CAC/F,OAAO;EACL;EACA,QAAQ,EAAE,OAAO,CAAC,CAAC,MAAM,OAAO,CAAC,CAAC,SAAS,cAAc;GACvD,IAAI;GACJ,aAAa;EACf,CAAC;EACD;EACA,MAAM,OAAuB;GAC3B,IAAI,GAAG,KAAK,GAAG,OAAO;GACtB,MAAM,IAAI,UAAU,kEAAkE;EACxF;EACA,QAAQ,GAAW,GAAmB;GACpC,OAAO,EAAE,WAAW,EAAE,SAAU,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,IAAK,EAAE,SAAS,EAAE;EAC7E;CACF;AACF,EAAA,CAAG"}
1
+ {"version":3,"file":"ids.js","names":[],"sources":["../src/ids.ts"],"sourcesContent":["/**\n * Prefixed, opaque identifiers (INTERFACES §1, DATA_MODEL §2).\n *\n * Every Mostra entity is named by a string of the form `<prefix>_<body>`. Callers treat IDs as\n * opaque: they validate the form at a boundary and never read meaning out of the body. Each ID\n * kind below is both a type and a value with the same name:\n *\n * ```ts\n * const artifact: ArtifactId = ArtifactId.parse(input);\n * const mutation: MutationId = MutationId.create();\n * const Params = z.object({ artifactId: ArtifactId.schema });\n * ```\n *\n * @packageDocumentation\n */\nimport * as z from \"zod\";\nimport { wireRegistry } from \"./wire-registry.ts\";\n\n/** The prefixes INTERFACES §1 assigns, one per entity. */\nexport type IdPrefix =\n | \"art\"\n | \"ver\"\n | \"vw\"\n | \"vwr\"\n | \"sub\"\n | \"dlv\"\n | \"run\"\n | \"thr\"\n | \"cmt\"\n | \"tok\"\n | \"mut\"\n | \"shr\"\n | \"acct\"\n | \"hom\"\n | \"lnk\"\n | \"rte\";\n\n/**\n * A branded ID string. The brand exists only at the type level, so an `Id<\"art\">` is a plain\n * string at run time and on the wire.\n */\nexport type Id<P extends IdPrefix> = `${P}_${string}` & { readonly __mostraIdPrefix: P };\n\n/** How an ID kind's body is formed. */\nexport type IdBody = \"ulid\" | \"sha256-base32\";\n\n/** One ID kind: its prefix, validation and schema. */\nexport interface IdKind<P extends IdPrefix> {\n /** The prefix, without the underscore. */\n readonly prefix: P;\n /** The entity the ID names, in the PRODUCT vocabulary. */\n readonly entity: string;\n /** How the body is formed. */\n readonly body: IdBody;\n /** The exact form, anchored at both ends. */\n readonly pattern: RegExp;\n /** The Zod schema for this ID, registered for JSON Schema output under the kind's type name. */\n readonly schema: z.ZodType<Id<P>, string>;\n /** Whether `value` is an ID of this kind. */\n is(value: unknown): value is Id<P>;\n /**\n * Returns `value` as an ID of this kind.\n *\n * @throws TypeError when `value` is not of this kind's form. The message names the expected\n * form and never echoes the input.\n */\n parse(value: string): Id<P>;\n}\n\n/** An ID kind whose body is a ULID that the creator generates. */\nexport interface GeneratedIdKind<P extends IdPrefix> extends IdKind<P> {\n /** Generates a new ID from the current time and 80 bits of Web Crypto randomness. */\n create(): Id<P>;\n}\n\n/** Crockford's base32 alphabet, used by ULIDs and by content-addressed version IDs. */\nconst CROCKFORD = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\";\nconst BODY_LENGTH = 26;\n/** A ULID's first character encodes at most 3 bits (48-bit time in 26 × 5 = 130 bits). */\nconst ULID_BODY = \"[0-7][0-9A-HJKMNP-TV-Z]{25}\";\nconst BASE32_BODY = \"[0-9A-HJKMNP-TV-Z]{26}\";\n\nfunction defineKind<P extends IdPrefix>(\n prefix: P,\n entity: string,\n body: IdBody,\n typeName: string,\n): IdKind<P> {\n const pattern = new RegExp(`^${prefix}_${body === \"ulid\" ? ULID_BODY : BASE32_BODY}$`);\n const form = body === \"ulid\" ? \"a 26-character ULID\" : \"26 characters of Crockford base32\";\n const is = (value: unknown): value is Id<P> => typeof value === \"string\" && pattern.test(value);\n const schema = z\n .string()\n .regex(pattern)\n .register(wireRegistry, {\n id: typeName,\n description: `${entity[0]?.toUpperCase()}${entity.slice(1)} ID: \"${prefix}_\" followed by ${form}.`,\n }) as unknown as z.ZodType<Id<P>, string>;\n return {\n prefix,\n entity,\n body,\n pattern,\n schema,\n is,\n parse(value: string): Id<P> {\n if (is(value)) return value;\n throw new TypeError(`Expected ${entity} ID \"${prefix}_\" followed by ${form}.`);\n },\n };\n}\n\nfunction generated<P extends IdPrefix>(kind: IdKind<P>): GeneratedIdKind<P> {\n return { ...kind, create: () => kind.parse(`${kind.prefix}_${ulidBody(Date.now())}`) };\n}\n\n/**\n * Encodes a ULID body: 48 bits of milliseconds since the Unix epoch, then 80 random bits, as 26\n * Crockford base32 characters.\n */\nfunction ulidBody(now: number): string {\n if (!Number.isSafeInteger(now) || now < 0 || now > 0xffff_ffff_ffff) {\n throw new RangeError(\"ULID time must be a millisecond timestamp between 0 and 2^48 - 1.\");\n }\n let time = \"\";\n let rest = now;\n for (let i = 0; i < 10; i++) {\n time = CROCKFORD.charAt(rest % 32) + time;\n rest = Math.floor(rest / 32);\n }\n const random = new Uint8Array(10);\n globalThis.crypto.getRandomValues(random);\n return time + base32(random).slice(0, 16);\n}\n\n/** Encodes bytes as Crockford base32, most significant bit first, padding the last group with 0. */\nfunction base32(bytes: Uint8Array): string {\n let out = \"\";\n let buffer = 0;\n let bits = 0;\n for (const byte of bytes) {\n buffer = (buffer << 8) | byte;\n bits += 8;\n while (bits >= 5) {\n out += CROCKFORD.charAt((buffer >>> (bits - 5)) & 31);\n bits -= 5;\n }\n buffer &= (1 << bits) - 1;\n }\n if (bits > 0) out += CROCKFORD.charAt((buffer << (5 - bits)) & 31);\n return out;\n}\n\n/** An artifact ID (`art_` + ULID). */\nexport type ArtifactId = Id<\"art\">;\n/** Artifact IDs. */\nexport const ArtifactId: GeneratedIdKind<\"art\"> = generated(\n defineKind(\"art\", \"artifact\", \"ulid\", \"ArtifactId\"),\n);\n\n/** A version ID (`ver_` + 26 characters of base32 SHA-256): content-addressed, never generated. */\nexport type VersionId = Id<\"ver\">;\n/** The version ID kind, with the content-addressed constructor DATA_MODEL §2 defines. */\nexport interface VersionIdKind extends IdKind<\"ver\"> {\n /**\n * Returns the version ID for a SHA-256 digest: `ver_` plus the first 26 characters of the\n * digest in Crockford base32 (130 bits). The caller computes the digest of the artifact ID's\n * UTF-8 bytes, a `0x00` byte, and the 32-byte `sourceDigest` and `envDigest` (DATA_MODEL §2,\n * D89).\n *\n * @throws RangeError when `digest` is not 32 bytes long.\n */\n fromSha256(digest: Uint8Array): VersionId;\n}\n/** Version IDs. */\nexport const VersionId: VersionIdKind = {\n ...defineKind(\"ver\", \"version\", \"sha256-base32\", \"VersionId\"),\n fromSha256(digest: Uint8Array): VersionId {\n if (digest.length !== 32) {\n throw new RangeError(`A SHA-256 digest is 32 bytes, got ${digest.length}.`);\n }\n return VersionId.parse(`ver_${base32(digest).slice(0, BODY_LENGTH)}`);\n },\n};\n\n/** A view ID (`vw_` + ULID). */\nexport type ViewId = Id<\"vw\">;\n/** View IDs. */\nexport const ViewId: GeneratedIdKind<\"vw\"> = generated(defineKind(\"vw\", \"view\", \"ulid\", \"ViewId\"));\n\n/** A viewer ID (`vwr_` + ULID). */\nexport type ViewerId = Id<\"vwr\">;\n/** Viewer IDs. */\nexport const ViewerId: GeneratedIdKind<\"vwr\"> = generated(\n defineKind(\"vwr\", \"viewer\", \"ulid\", \"ViewerId\"),\n);\n\n/** A submission ID (`sub_` + ULID). */\nexport type SubmissionId = Id<\"sub\">;\n/** Submission IDs. */\nexport const SubmissionId: GeneratedIdKind<\"sub\"> = generated(\n defineKind(\"sub\", \"submission\", \"ulid\", \"SubmissionId\"),\n);\n\n/**\n * A delivery ID (`dlv_` + ULID): one submission's delivery to one host (D105). A redelivery after a\n * crash repeats it, so a host can treat deliveries idempotently.\n */\nexport type DeliveryId = Id<\"dlv\">;\n/** Delivery IDs. */\nexport const DeliveryId: GeneratedIdKind<\"dlv\"> = generated(\n defineKind(\"dlv\", \"delivery\", \"ulid\", \"DeliveryId\"),\n);\n\n/** An action run ID (`run_` + ULID). */\nexport type RunId = Id<\"run\">;\n/** Action run IDs. */\nexport const RunId: GeneratedIdKind<\"run\"> = generated(\n defineKind(\"run\", \"action run\", \"ulid\", \"RunId\"),\n);\n\n/** A review thread ID (`thr_` + ULID). */\nexport type ThreadId = Id<\"thr\">;\n/** Review thread IDs. */\nexport const ThreadId: GeneratedIdKind<\"thr\"> = generated(\n defineKind(\"thr\", \"thread\", \"ulid\", \"ThreadId\"),\n);\n\n/** A comment ID (`cmt_` + ULID). */\nexport type CommentId = Id<\"cmt\">;\n/** Comment IDs. */\nexport const CommentId: GeneratedIdKind<\"cmt\"> = generated(\n defineKind(\"cmt\", \"comment\", \"ulid\", \"CommentId\"),\n);\n\n/** A capability token ID (`tok_` + ULID). The token's secret is separate and never an ID. */\nexport type TokenId = Id<\"tok\">;\n/** Capability token IDs. */\nexport const TokenId: GeneratedIdKind<\"tok\"> = generated(\n defineKind(\"tok\", \"capability token\", \"ulid\", \"TokenId\"),\n);\n\n/** A mutation ID (`mut_` + ULID), generated by the client that sends the mutation. */\nexport type MutationId = Id<\"mut\">;\n/** Mutation IDs. */\nexport const MutationId: GeneratedIdKind<\"mut\"> = generated(\n defineKind(\"mut\", \"mutation\", \"ulid\", \"MutationId\"),\n);\n\n/** A share ID (`shr_` + ULID): one share of an artifact through a tunnel (D158). */\nexport type ShareId = Id<\"shr\">;\n/** Share IDs. */\nexport const ShareId: GeneratedIdKind<\"shr\"> = generated(\n defineKind(\"shr\", \"share\", \"ulid\", \"ShareId\"),\n);\n\n/** An account on a remote server (`acct_` + ULID, D165 item 8). */\nexport type AccountId = Id<\"acct\">;\n/** Account IDs. */\nexport const AccountId: GeneratedIdKind<\"acct\"> = generated(\n defineKind(\"acct\", \"account\", \"ulid\", \"AccountId\"),\n);\n\n/** A hosted home on a remote server (`hom_` + ULID, D165 item 1). */\nexport type HomeId = Id<\"hom\">;\n/** Hosted home IDs. */\nexport const HomeId: GeneratedIdKind<\"hom\"> = generated(\n defineKind(\"hom\", \"hosted home\", \"ulid\", \"HomeId\"),\n);\n\n/** An instance linked to a remote server (`lnk_` + ULID, D165 item 2): its owner link. */\nexport type LinkId = Id<\"lnk\">;\n/** Instance link IDs. */\nexport const LinkId: GeneratedIdKind<\"lnk\"> = generated(\n defineKind(\"lnk\", \"instance link\", \"ulid\", \"LinkId\"),\n);\n\n/** A hosted route (`rte_` + ULID): one artifact on one hosted home (D165, after the Opus review). */\nexport type RouteId = Id<\"rte\">;\n/** Hosted route IDs. */\nexport const RouteId: GeneratedIdKind<\"rte\"> = generated(\n defineKind(\"rte\", \"hosted route\", \"ulid\", \"RouteId\"),\n);\n\n/**\n * An event cursor: the decimal string of a home-wide event position (INTERFACES §1). Decimal\n * strings keep 64-bit positions exact in JavaScript.\n */\nexport type Cursor = string & { readonly __mostraCursor: true };\n\n/** Event cursors. */\nexport const Cursor: {\n /** The exact form: a non-negative decimal integer without leading zeros, at most 19 digits. */\n readonly pattern: RegExp;\n readonly schema: z.ZodType<Cursor, string>;\n is(value: unknown): value is Cursor;\n /** @throws TypeError when `value` is not a cursor. */\n parse(value: string): Cursor;\n /** Orders two cursors: negative when `a` comes first, zero when equal, positive otherwise. */\n compare(a: Cursor, b: Cursor): number;\n} = (() => {\n const pattern = /^(0|[1-9][0-9]{0,18})$/;\n const is = (value: unknown): value is Cursor => typeof value === \"string\" && pattern.test(value);\n return {\n pattern,\n schema: z.string().regex(pattern).register(wireRegistry, {\n id: \"Cursor\",\n description: \"Event cursor: the decimal string of a home-wide event position.\",\n }) as unknown as z.ZodType<Cursor, string>,\n is,\n parse(value: string): Cursor {\n if (is(value)) return value;\n throw new TypeError(\"Expected an event cursor: a non-negative decimal integer string.\");\n },\n compare(a: Cursor, b: Cursor): number {\n return a.length === b.length ? (a < b ? -1 : a > b ? 1 : 0) : a.length - b.length;\n },\n };\n})();\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA4EA,MAAM,YAAY;AAClB,MAAM,cAAc;;AAEpB,MAAM,YAAY;AAClB,MAAM,cAAc;AAEpB,SAAS,WACP,QACA,QACA,MACA,UACW;CACX,MAAM,UAAU,IAAI,OAAO,IAAI,OAAO,GAAG,SAAS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a,SAAiC,UAC5C,WAAW,OAAO,eAAe,QAAQ,QAAQ,CACnD;;AAKA,MAAa,SAAiC,UAC5C,WAAW,OAAO,iBAAiB,QAAQ,QAAQ,CACrD;;AAKA,MAAa,UAAkC,UAC7C,WAAW,OAAO,gBAAgB,QAAQ,SAAS,CACrD;;AASA,MAAa,gBASF;CACT,MAAM,UAAU;CAChB,MAAM,MAAM,UAAoC,OAAO,UAAU,YAAY,QAAQ,KAAK,KAAK;CAC/F,OAAO;EACL;EACA,QAAQ,EAAE,OAAO,CAAC,CAAC,MAAM,OAAO,CAAC,CAAC,SAAS,cAAc;GACvD,IAAI;GACJ,aAAa;EACf,CAAC;EACD;EACA,MAAM,OAAuB;GAC3B,IAAI,GAAG,KAAK,GAAG,OAAO;GACtB,MAAM,IAAI,UAAU,kEAAkE;EACxF;EACA,QAAQ,GAAW,GAAmB;GACpC,OAAO,EAAE,WAAW,EAAE,SAAU,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,IAAK,EAAE,SAAS,EAAE;EAC7E;CACF;AACF,EAAA,CAAG"}
package/dist/index.d.ts CHANGED
@@ -1,15 +1,17 @@
1
1
  import { ARGUMENT_BIGINT_DIGITS_MAX, AnyFunction, Frame, RemoteError, SerializationError, SerializeMode, UNSERIALIZABLE_CODE, ValueReader, ValueReaderOptions, ValueWriter, ValueWriterOptions, WireError, checkArgumentFrames, deserializeAll, fromBase64, serializeAll, toBase64, wireError } from "./serializer.js";
2
- import { ACTION_ARGS_MAX, ACTION_RESULT_MAX, ActionError, Batches, CallLine, CallRequest, EphemeralMessage, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LiveRequest, LiveState, LiveUpdate, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, RunAttachRequest, RunCancelRequest, RunDelta, RunProgress, RunReason, RunRequest, RunState, RunStatus, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, isFinalRunStatus } from "./actions.js";
3
- import { ARTIFACT_MANIFEST_KEYS, ArtifactFamily, ArtifactLink, ArtifactManifest, DemoSpec, SubmissionPolicy, TerminalSpec } from "./manifest.js";
2
+ import { ACTION_ARGS_MAX, ACTION_RESULT_MAX, ActionError, Batches, CallLine, CallRequest, EphemeralMessage, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LiveRequest, LiveState, LiveUpdate, READABLE_LIVE_KEY_PATTERN, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, RunAttachRequest, RunCancelRequest, RunDelta, RunProgress, RunReason, RunRequest, RunState, RunStatus, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, TALLY_LIVE_PREFIX, TallyValue, isFinalRunStatus } from "./actions.js";
3
+ import { Duration, durationMs } from "./duration.js";
4
+ import { SubmissionPolicy } from "./policy.js";
5
+ import { ARTIFACT_MANIFEST_KEYS, ArtifactFamily, ArtifactLink, ArtifactManifest, DemoSpec, HOSTED_OFFLINE_LIMIT_DEFAULT, HOSTED_OFFLINE_LIMIT_MAX_MS, HostedSettings, TALLY_CHOICES_MAX, TALLY_CHOICES_MIN, TallySpec, TerminalSpec, manifestProblem } from "./manifest.js";
4
6
  import { ArtifactDetail, ArtifactRef, ArtifactSummary, PublishReceipt, SourceRef, VersionSummary } from "./artifact.js";
5
7
  import { ControlsPolicy, DeliveryTarget, REVIEW_SET_ID_PATTERN, SubmitChannel, TrustedControl, VersionRef, ViewContext, ViewContextWire, readViewContext } from "./view.js";
6
8
  import { AnyBridgeMessage, BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX, Bridge, BridgeEvent, BridgeHostContext, BridgeImplementation, BridgeMessage, BridgeOptions, BridgePeer, BridgeReceiver, BridgeRejection, BridgeSide, CONTROL_LABEL_MAX, ControlRequest, FieldRegistration, FieldsParams, FlushResult, FrameSessionFailedParams, MCP_APPS_PROTOCOL_VERSION, OPEN_LINK_SCHEMES, SaveState, SubmitBlocker, UiInitializeParams, UiInitializeResult, VersionAvailableParams, connectBridge, mostraControlsRequest, mostraFieldFocus, mostraFields, mostraFlush, mostraFrameSessionEntered, mostraFrameSessionFailed, mostraPage, mostraReady, mostraVersionAvailable, uiInitialize, uiInitialized, uiOpenLink, uiSizeChanged } from "./bridge.js";
7
- import { ArtifactId, CommentId, Cursor, DeliveryId, GeneratedIdKind, Id, IdBody, IdKind, IdPrefix, MutationId, RunId, ShareId, SubmissionId, ThreadId, TokenId, VersionId, VersionIdKind, ViewId, ViewerId } from "./ids.js";
8
- import { Actor, DeliveryState, DeliveryStatus, DocumentRevision, EventFilter, EventRecord, EventTypePattern, FIELD_ID_MAX_LENGTH, FieldConflict, FieldOp, FieldScope, FieldState, MutationResult, Rect, ResultComment, Results, SIGNAL_NAME_PATTERN, SubmissionSummary, Viewer, ViewerKind, ViewerSpec, Viewport, WaitCondition, isFieldId } from "./interaction.js";
9
- import { BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, CarryOver, ChooseRequest, DocumentSnapshot, EnterRequest, EnterResult, FRAME_SESSION_HEADER, FieldsRequest, FollowRequest, FrameSessionFacts, FrameTicket, OrphanedField, PollResult, SIGNAL_PAYLOAD_MAX_BYTES, ShellSubmitRequest, SignalRequest, StreamSnapshot, StreamTicket, StreamTicketRequest, SubmitRequest } from "./browser.js";
9
+ import { AccountId, ArtifactId, CommentId, Cursor, DeliveryId, GeneratedIdKind, HomeId, Id, IdBody, IdKind, IdPrefix, LinkId, MutationId, RouteId, RunId, ShareId, SubmissionId, ThreadId, TokenId, VersionId, VersionIdKind, ViewId, ViewerId } from "./ids.js";
10
+ import { Actor, DeliveryState, DeliveryStatus, DocumentRevision, EventFilter, EventOrigin, EventRecord, EventTypePattern, FIELD_ID_MAX_LENGTH, FieldConflict, FieldOp, FieldScope, FieldState, MutationResult, Rect, ResultComment, Results, SIGNAL_NAME_PATTERN, SubmissionSummary, Viewer, ViewerKind, ViewerSpec, Viewport, WaitCondition, isFieldId } from "./interaction.js";
11
+ import { BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, CarryOver, ChooseRequest, DocumentSnapshot, EnterRequest, EnterResult, FRAME_SESSION_HEADER, FieldsRequest, FollowRequest, FrameSessionFacts, FrameTicket, OrphanedField, PollResult, SHELL_SESSION_HEADER, SIGNAL_PAYLOAD_MAX_BYTES, ShellSubmitRequest, SignalRequest, StreamSnapshot, StreamTicket, StreamTicketRequest, SubmitRequest } from "./browser.js";
10
12
  import { BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, BundlePlatform, BundlePlatformSchema, BundleSetup, bundleAssetName, isWindowsBundle } from "./bundle.js";
11
13
  import { canonicalJson } from "./canonical.js";
12
- import { ALL_SCOPES, CapabilityScope, Duration, durationMs, normalizeScopes, scopeAllows } from "./capability.js";
14
+ import { ALL_SCOPES, CapabilityScope, normalizeScopes, scopeAllows } from "./capability.js";
13
15
  import { DIAGNOSTIC_AREAS, Diagnostic, DiagnosticArea, DiagnosticCode, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity } from "./diagnostics/diagnostic.js";
14
16
  import { AreaCatalog, DEFAULT_DOCS_BASE, DiagnosticDetails, DiagnosticSpec, docsUrl } from "./diagnostics/spec.js";
15
17
  import { A11yDiagnosticCode, a11yDiagnosticCodes } from "./diagnostics/codes/a11y.js";
@@ -30,6 +32,7 @@ import { NetworkDiagnosticCode, networkDiagnosticCodes } from "./diagnostics/cod
30
32
  import { PlatformDiagnosticCode, platformDiagnosticCodes } from "./diagnostics/codes/platform.js";
31
33
  import { PublishDiagnosticCode, publishDiagnosticCodes } from "./diagnostics/codes/publish.js";
32
34
  import { RegressionDiagnosticCode, regressionDiagnosticCodes } from "./diagnostics/codes/regression.js";
35
+ import { RemoteDiagnosticCode, remoteDiagnosticCodes } from "./diagnostics/codes/remote.js";
33
36
  import { RuntimeDiagnosticCode, runtimeDiagnosticCodes } from "./diagnostics/codes/runtime.js";
34
37
  import { SecretDiagnosticCode, secretDiagnosticCodes } from "./diagnostics/codes/secret.js";
35
38
  import { ShareDiagnosticCode, shareDiagnosticCodes } from "./diagnostics/codes/share.js";
@@ -42,7 +45,9 @@ import { CreateDiagnosticOptions, KnownDiagnosticCode, createDiagnostic, diagnos
42
45
  import { CSRF_HEADER, Refusal, RequestFacts, RequestIntent, RequestPolicy, checkRequest, headerValue, isJsonContentType, refusal, safeEqual, safePath } from "./hygiene.js";
43
46
  import { AnyMethod, AnyNotification, MethodDefinition, MethodDirection, NotificationDefinition, defineMethod } from "./method.js";
44
47
  import { ArtifactCreateParams, ArtifactCreateResult, artifactCreateMethod } from "./methods/artifact/create.js";
48
+ import { ArtifactExportParams, ArtifactExportResult, ExportClass, artifactExportMethod } from "./methods/artifact/export.js";
45
49
  import { ArtifactGetParams, ArtifactGetResult, artifactGetMethod } from "./methods/artifact/get.js";
50
+ import { ArtifactImportParams, ArtifactImportResult, artifactImportMethod } from "./methods/artifact/import.js";
46
51
  import { ArtifactListFilter, ArtifactListParams, ArtifactListResult, artifactListMethod } from "./methods/artifact/list.js";
47
52
  import { ArtifactPublishParams, ArtifactPublishResult, artifactPublishMethod } from "./methods/artifact/publish.js";
48
53
  import { ARTIFACT_PROGRESS, ArtifactProgressParams, CompareRequest, CompareResult, DEFAULT_VIEWPORTS, ProbedField, RenderRequest, RenderResult, ScreenshotPolicy, TokenEstimate, VERIFY_PROBE, VERIFY_REPORT, VERIFY_RUNNER_METHODS, VerdictAria, VerdictScreenshot, VerifyVerdict, VerifyViewport, ariaSummary, estimateImageTokens, viewportsFor } from "./verify.js";
@@ -55,8 +60,12 @@ import { EVENTS_READ_MAX, EventsReadParams, EventsReadResult, eventsReadMethod }
55
60
  import { EVENTS_NOTIFY, EventsNotifyParams, EventsSubscribeParams, EventsSubscribeResult, eventsSubscribeMethod } from "./methods/events/subscribe.js";
56
61
  import { EventsUnsubscribeParams, EventsUnsubscribeResult, eventsUnsubscribeMethod } from "./methods/events/unsubscribe.js";
57
62
  import { GcCompactEvents, GcCompacted, GcCount, GcRunParams, GcRunResult, GcVersion, gcRunMethod } from "./methods/gc/run.js";
63
+ import { HostedPushParams, HostedPushResult, HostedRoute, ListingEntry, VersionPush, hostedPushMethod } from "./methods/hosted/push.js";
64
+ import { SubmissionEnvelope, SubmissionsDeliverResult, portSubmissionsDeliverMethod } from "./methods/port/submissions-deliver.js";
65
+ import { HostedSubmissionParams, HostedSubmissionResult, hostedSubmissionMethod } from "./methods/hosted/submission.js";
58
66
  import { hostMethods, hostNotifications } from "./methods/index.js";
59
67
  import { InstanceCheck, InstanceCheckParams, InstanceCheckResult, instanceCheckMethod } from "./methods/instance/check.js";
68
+ import { OwnerLinkInfo, RemoteLink, RemoteLinkState, ServerOrigin } from "./remote.js";
60
69
  import { HOST_PROTOCOL_REVISIONS, Revision, RevisionNegotiation, negotiateRevision } from "./revision.js";
61
70
  import { CLI_CLIENT_NAME, ClientCapabilities, ClientInfo, DependencyPolicy, HomeConfig, InstanceCapabilities, InstanceInfo, MostraInitializeParams, MostraInitializeResult, PortName, mostraInitializeMethod } from "./methods/mostra/initialize.js";
62
71
  import { PUBLIC_SHARE_DEFAULT_TTL, PUBLIC_SHARE_MAX_TTL_MS, Share, ShareStartParams, ShareStartResult, ShareVia, shareStartMethod } from "./methods/share/start.js";
@@ -66,10 +75,23 @@ import { MostraShutdownParams, MostraShutdownResult, mostraShutdownMethod } from
66
75
  import { ExternalBase, OriginString, PortAddressingExternalBaseParams, PortAddressingExternalBaseResult, portAddressingExternalBaseMethod } from "./methods/port/addressing-external-base.js";
67
76
  import { DraftMirror, DraftsMirrorResult, portDraftsMirrorMethod } from "./methods/port/drafts-mirror.js";
68
77
  import { IdentityVia, PortIdentityResolveParams, PortIdentityResolveResult, portIdentityResolveMethod } from "./methods/port/identity-resolve.js";
78
+ import { PortRelayRunParams, PortRelayRunResult, RelayViewer, portRelayRunMethod } from "./methods/port/relay-run.js";
79
+ import { PortRelayCallParams, PortRelayCallResult, portRelayCallMethod } from "./methods/port/relay-call.js";
80
+ import { PortRelayCancelParams, PortRelayCancelResult, portRelayCancelMethod } from "./methods/port/relay-cancel.js";
81
+ import { PortRelayLiveParams, PortRelayLiveResult, portRelayLiveMethod } from "./methods/port/relay-live.js";
82
+ import { PortRelayReconcileParams, PortRelayReconcileResult, RelayHeld, RelayReconciled, portRelayReconcileMethod } from "./methods/port/relay-reconcile.js";
69
83
  import { PortSecretsGetParams, PortSecretsGetResult, portSecretsGetMethod } from "./methods/port/secrets-get.js";
70
- import { SubmissionEnvelope, SubmissionsDeliverResult, portSubmissionsDeliverMethod } from "./methods/port/submissions-deliver.js";
71
84
  import { PortTrustedControlsActivatedParams, PortTrustedControlsActivatedResult, portTrustedControlsActivatedMethod } from "./methods/port/trusted-controls-activated.js";
72
85
  import { PortTrustedControlsPolicyParams, PortTrustedControlsPolicyResult, portTrustedControlsPolicyMethod } from "./methods/port/trusted-controls-policy.js";
86
+ import { RelayCallBatchParams, RelayCallBatchResult, relayCallBatchMethod } from "./methods/relay/call-batch.js";
87
+ import { RelayEffectParams, RelayEffectResult, relayEffectMethod } from "./methods/relay/effect.js";
88
+ import { RelayLiveValueParams, RelayLiveValueResult, relayLiveValueMethod } from "./methods/relay/live-value.js";
89
+ import { RelayRunEnd, RelayRunUpdateParams, RelayRunUpdateResult, relayRunUpdateMethod } from "./methods/relay/run-update.js";
90
+ import { RemoteLoginParams, RemoteLoginResult, remoteLoginMethod } from "./methods/remote/login.js";
91
+ import { RemoteLoginWaitParams, RemoteLoginWaitResult, remoteLoginWaitMethod } from "./methods/remote/login-wait.js";
92
+ import { RemoteLogoutParams, RemoteLogoutResult, remoteLogoutMethod } from "./methods/remote/logout.js";
93
+ import { RemoteStatusParams, RemoteStatusResult, remoteStatusMethod } from "./methods/remote/status.js";
94
+ import { RemoteTokenParams, RemoteTokenResult, remoteTokenMethod } from "./methods/remote/token.js";
73
95
  import { ResultsGetParams, ResultsGetResult, ResultsMarkdown, resultsGetMethod } from "./methods/results/get.js";
74
96
  import { SecretDeleteParams, SecretDeleteResult, secretDeleteMethod } from "./methods/secret/delete.js";
75
97
  import { SecretEntry, SecretSetParams, SecretSetResult, secretSetMethod } from "./methods/secret/set.js";
@@ -90,4 +112,4 @@ import { JSON_RPC_ERROR_CODES, RpcError } from "./rpc/error.js";
90
112
  import { LineSplitter, MAX_LINE_LENGTH, encodeLine } from "./rpc/lines.js";
91
113
  import { RpcPeer, RpcPeerOptions, RpcRequestContext, RpcRequestOptions, parseParams } from "./rpc/peer.js";
92
114
  import { CallContext, DEFAULT_WORKER_LIMITS, LiveSourceInfo, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, ServerStatePatchResult, WORKER_CHANNEL_REVISION, WORKER_METHODS, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, WorkerCancelParams, WorkerLimits, WorkerLiveParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerVersionRef } from "./worker.js";
93
- export { type A11yDiagnosticCode, ACTION_ARGS_MAX, ACTION_RESULT_MAX, ALL_SCOPES, ARGUMENT_BIGINT_DIGITS_MAX, ARTIFACT_MANIFEST_KEYS, ARTIFACT_PROGRESS, type ActionDiagnosticCode, ActionError, Actor, AddedPackage, type AnyBridgeMessage, type AnyFunction, type AnyMethod, type AnyNotification, type AreaCatalog, type ArtifactCreateParams, type ArtifactCreateResult, ArtifactDetail, type ArtifactDiagnosticCode, type ArtifactFamily, type ArtifactGetParams, type ArtifactGetResult, ArtifactId, ArtifactLink, type ArtifactListFilter, type ArtifactListParams, type ArtifactListResult, ArtifactManifest, ArtifactProgressParams, type ArtifactPublishParams, type ArtifactPublishResult, ArtifactRef, ArtifactSummary, type ArtifactVerifyParams, type ArtifactVerifyResult, BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX, BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, Batches, type Bridge, type BridgeEvent, type BridgeHostContext, type BridgeImplementation, type BridgeMessage, type BridgeOptions, type BridgePeer, type BridgeReceiver, type BridgeRejection, type BridgeSide, type BuildDiagnosticCode, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, type BundlePlatform, BundlePlatformSchema, BundleSetup, CLI_CLIENT_NAME, CONTROL_LABEL_MAX, CSRF_HEADER, type CallContext, type CallLine, CallRequest, CapabilityLink, CapabilityScope, CarryOver, ChildProcessStatus, ChooseRequest, type ClassifiedMessage, type CliDiagnosticCode, ClientCapabilities, ClientInfo, CommentId, type CompareRequest, type CompareResult, type ConsoleDiagnosticCode, type ControlRequest, ControlsPolicy, type CreateDiagnosticOptions, Cursor, DEFAULT_DOCS_BASE, DEFAULT_VIEWPORTS, DEFAULT_WORKER_LIMITS, DEV_NOTIFY, DIAGNOSTIC_AREAS, DeliveryCounts, DeliveryId, type DeliveryState, DeliveryStatus, type DeliveryTarget, type DemoSpec, type DepDiagnosticCode, DependencyPolicy, type DepsAddParams, type DepsAddResult, type DevEventKind, DevNotifyParams, type DevStartParams, type DevStartResult, type DevStopParams, type DevStopResult, Diagnostic, type DiagnosticArea, type DiagnosticCode, type DiagnosticDetails, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity, type DiagnosticSpec, DocumentRevision, DocumentSnapshot, DraftMirror, type DraftsMirrorResult, Duration, EVENTS_NOTIFY, EVENTS_READ_MAX, EnterRequest, EnterResult, type EnvDiagnosticCode, type EphemeralMessage, EventFilter, EventRecord, EventTypePattern, type EventsAckParams, type EventsAckResult, EventsNotifyParams, type EventsReadParams, type EventsReadResult, type EventsSubscribeParams, type EventsSubscribeResult, type EventsUnsubscribeParams, type EventsUnsubscribeResult, ExternalBase, FIELD_ID_MAX_LENGTH, FRAME_SESSION_HEADER, type FaceStatus, FieldConflict, type FieldDiagnosticCode, FieldOp, type FieldRegistration, type FieldScope, FieldState, type FieldsParams, FieldsRequest, type FlushResult, FollowRequest, type Frame, FrameSessionFacts, type FrameSessionFailedParams, FrameTicket, GatewayStatus, type GcCompactEvents, type GcCompacted, type GcCount, type GcRunParams, type GcRunResult, type GcVersion, type GeneratedIdKind, HOST_PROTOCOL_REVISIONS, HomeConfig, type HomeDiagnosticCode, type HostDiagnosticCode, type HygieneDiagnosticCode, type Id, type IdBody, type IdKind, type IdPrefix, type IdentityVia, InstanceCapabilities, type InstanceCheck, type InstanceCheckParams, type InstanceCheckResult, InstanceInfo, type InstanceStatusParams, type InstanceStatusResult, JSON_RPC_ERROR_CODES, JsonRpcErrorObject, JsonRpcFailure, type JsonRpcId, type JsonRpcMessage, JsonRpcNotification, type JsonRpcParams, JsonRpcRequest, type JsonRpcResponse, JsonRpcSuccess, type KnownDiagnosticCode, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LineSplitter, type LiveDiagnosticCode, type LivePushParams, type LivePushResult, LiveRequest, type LiveSourceInfo, type LiveState, type LiveUpdate, MAX_LINE_LENGTH, MCP_APPS_PROTOCOL_VERSION, type ManifestDiagnosticCode, type MethodDefinition, type MethodDirection, type MostraInitializeParams, type MostraInitializeResult, type MostraShutdownParams, type MostraShutdownResult, MutationId, MutationResult, type NetworkDiagnosticCode, type NotificationDefinition, OPEN_LINK_SCHEMES, OriginString, OrphanedField, PUBLIC_SHARE_DEFAULT_TTL, PUBLIC_SHARE_MAX_TTL_MS, type PlatformDiagnosticCode, PollResult, type PortAddressingExternalBaseParams, type PortAddressingExternalBaseResult, type PortIdentityResolveParams, type PortIdentityResolveResult, PortName, type PortSecretsGetParams, type PortSecretsGetResult, type PortTrustedControlsActivatedParams, type PortTrustedControlsActivatedResult, type PortTrustedControlsPolicyParams, type PortTrustedControlsPolicyResult, type ProbedField, type PublishDiagnosticCode, PublishReceipt, REVIEW_SET_ID_PATTERN, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, type Rect, type Refusal, type RegressionDiagnosticCode, RemoteError, type RenderRequest, type RenderResult, type RequestFacts, type RequestIntent, type RequestPolicy, ResultComment, Results, type ResultsGetParams, type ResultsGetResult, ResultsMarkdown, Revision, type RevisionNegotiation, RpcError, RpcPeer, type RpcPeerOptions, type RpcRequestContext, type RpcRequestOptions, RunAttachRequest, RunCancelRequest, type RunDelta, RunId, RunProgress, type RunReason, RunRequest, RunState, type RunStatus, type RuntimeDiagnosticCode, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, SIGNAL_NAME_PATTERN, SIGNAL_PAYLOAD_MAX_BYTES, type SaveState, ScreenshotPolicy, type SecretDeleteParams, type SecretDeleteResult, type SecretDiagnosticCode, SecretEntry, type SecretListParams, type SecretListResult, type SecretSetParams, type SecretSetResult, SerializationError, type SerializeMode, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, type ServerStatePatchResult, Share, type ShareDiagnosticCode, ShareId, type ShareListParams, type ShareListResult, type ShareStartParams, type ShareStartResult, type ShareStopParams, type ShareStopResult, ShareVia, ShellSubmitRequest, SignalRequest, type SmokeDiagnosticCode, SourceRef, type StateGetParams, type StateGetResult, type StatePatchParams, type StatePatchResult, StreamSnapshot, StreamTicket, StreamTicketRequest, SubmissionEnvelope, SubmissionId, SubmissionPolicy, SubmissionSummary, type SubmissionsDeliverResult, type SubmitBlocker, SubmitChannel, type SubmitDiagnosticCode, SubmitRequest, type TargetDiagnosticCode, type TerminalSpec, ThreadId, type TokenEstimate, TokenId, TrustedControl, type TypeDiagnosticCode, UNSERIALIZABLE_CODE, type UiInitializeParams, type UiInitializeResult, VERIFY_PROBE, VERIFY_REPORT, VERIFY_RUNNER_METHODS, ValueReader, type ValueReaderOptions, ValueWriter, type ValueWriterOptions, type VerdictAria, type VerdictScreenshot, type VerifyDiagnosticCode, VerifyVerdict, type VerifyViewport, type VersionAvailableParams, VersionId, type VersionIdKind, VersionRef, VersionSummary, ViewContext, ViewContextWire, type ViewDefaultParams, type ViewDefaultResult, ViewId, type ViewLaunchParams, type ViewLaunchResult, type ViewRevokeParams, type ViewRevokeResult, type ViewRotateParams, type ViewRotateResult, type ViewUrlParams, type ViewUrlResult, Viewer, ViewerId, type ViewerKind, ViewerSpec, type Viewport, WAIT_MAX_MS, WORKER_CHANNEL_REVISION, WORKER_METHODS, WaitCondition, type WaitParams, type WaitResult, type WireError, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, type WorkerCancelParams, type WorkerLimits, type WorkerLiveParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerStatus, WorkerVersionRef, a11yDiagnosticCodes, actionDiagnosticCodes, ariaSummary, artifactCreateMethod, artifactDiagnosticCodes, artifactGetMethod, artifactListMethod, artifactPublishMethod, artifactVerifyMethod, buildDiagnosticCodes, bundleAssetName, canonicalJson, checkArgumentFrames, checkRequest, classifyMessage, cliDiagnosticCodes, connectBridge, consoleDiagnosticCodes, createDiagnostic, defineMethod, depDiagnosticCodes, depsAddMethod, deserializeAll, devStartMethod, devStopMethod, diagnosticCatalog, docsUrl, durationMs, encodeLine, envDiagnosticCodes, estimateImageTokens, eventsAckMethod, eventsReadMethod, eventsSubscribeMethod, eventsUnsubscribeMethod, fieldDiagnosticCodes, fromBase64, gcRunMethod, headerValue, homeDiagnosticCodes, hostDiagnosticCodes, hostMethods, hostNotifications, hygieneDiagnosticCodes, instanceCheckMethod, instanceStatusMethod, isFieldId, isFinalRunStatus, isJsonContentType, isWindowsBundle, liveDiagnosticCodes, livePushMethod, manifestDiagnosticCodes, mostraControlsRequest, mostraFieldFocus, mostraFields, mostraFlush, mostraFrameSessionEntered, mostraFrameSessionFailed, mostraInitializeMethod, mostraPage, mostraReady, mostraShutdownMethod, mostraVersionAvailable, negotiateRevision, networkDiagnosticCodes, normalizeScopes, parseParams, platformDiagnosticCodes, portAddressingExternalBaseMethod, portDraftsMirrorMethod, portIdentityResolveMethod, portSecretsGetMethod, portSubmissionsDeliverMethod, portTrustedControlsActivatedMethod, portTrustedControlsPolicyMethod, publishDiagnosticCodes, readViewContext, receivable, refusal, regressionDiagnosticCodes, resultsGetMethod, runtimeDiagnosticCodes, safeEqual, safePath, scopeAllows, secretDeleteMethod, secretDiagnosticCodes, secretListMethod, secretSetMethod, serializeAll, shareDiagnosticCodes, shareListMethod, shareStartMethod, shareStopMethod, smokeDiagnosticCodes, stateGetMethod, statePatchMethod, submitDiagnosticCodes, targetDiagnosticCodes, toBase64, typeDiagnosticCodes, uiInitialize, uiInitialized, uiOpenLink, uiSizeChanged, verifyDiagnosticCodes, viewDefaultMethod, viewLaunchMethod, viewRevokeMethod, viewRotateMethod, viewUrlMethod, viewportsFor, waitMethod, wireError };
115
+ export { type A11yDiagnosticCode, ACTION_ARGS_MAX, ACTION_RESULT_MAX, ALL_SCOPES, ARGUMENT_BIGINT_DIGITS_MAX, ARTIFACT_MANIFEST_KEYS, ARTIFACT_PROGRESS, AccountId, type ActionDiagnosticCode, ActionError, Actor, AddedPackage, type AnyBridgeMessage, type AnyFunction, type AnyMethod, type AnyNotification, type AreaCatalog, type ArtifactCreateParams, type ArtifactCreateResult, ArtifactDetail, type ArtifactDiagnosticCode, type ArtifactExportParams, type ArtifactExportResult, type ArtifactFamily, type ArtifactGetParams, type ArtifactGetResult, ArtifactId, type ArtifactImportParams, type ArtifactImportResult, ArtifactLink, type ArtifactListFilter, type ArtifactListParams, type ArtifactListResult, ArtifactManifest, ArtifactProgressParams, type ArtifactPublishParams, type ArtifactPublishResult, ArtifactRef, ArtifactSummary, type ArtifactVerifyParams, type ArtifactVerifyResult, BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX, BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, Batches, type Bridge, type BridgeEvent, type BridgeHostContext, type BridgeImplementation, type BridgeMessage, type BridgeOptions, type BridgePeer, type BridgeReceiver, type BridgeRejection, type BridgeSide, type BuildDiagnosticCode, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, type BundlePlatform, BundlePlatformSchema, BundleSetup, CLI_CLIENT_NAME, CONTROL_LABEL_MAX, CSRF_HEADER, type CallContext, type CallLine, CallRequest, CapabilityLink, CapabilityScope, CarryOver, ChildProcessStatus, ChooseRequest, type ClassifiedMessage, type CliDiagnosticCode, ClientCapabilities, ClientInfo, CommentId, type CompareRequest, type CompareResult, type ConsoleDiagnosticCode, type ControlRequest, ControlsPolicy, type CreateDiagnosticOptions, Cursor, DEFAULT_DOCS_BASE, DEFAULT_VIEWPORTS, DEFAULT_WORKER_LIMITS, DEV_NOTIFY, DIAGNOSTIC_AREAS, DeliveryCounts, DeliveryId, type DeliveryState, DeliveryStatus, type DeliveryTarget, type DemoSpec, type DepDiagnosticCode, DependencyPolicy, type DepsAddParams, type DepsAddResult, type DevEventKind, DevNotifyParams, type DevStartParams, type DevStartResult, type DevStopParams, type DevStopResult, Diagnostic, type DiagnosticArea, type DiagnosticCode, type DiagnosticDetails, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity, type DiagnosticSpec, DocumentRevision, DocumentSnapshot, DraftMirror, type DraftsMirrorResult, Duration, EVENTS_NOTIFY, EVENTS_READ_MAX, EnterRequest, EnterResult, type EnvDiagnosticCode, type EphemeralMessage, EventFilter, EventOrigin, EventRecord, EventTypePattern, type EventsAckParams, type EventsAckResult, EventsNotifyParams, type EventsReadParams, type EventsReadResult, type EventsSubscribeParams, type EventsSubscribeResult, type EventsUnsubscribeParams, type EventsUnsubscribeResult, ExportClass, ExternalBase, FIELD_ID_MAX_LENGTH, FRAME_SESSION_HEADER, type FaceStatus, FieldConflict, type FieldDiagnosticCode, FieldOp, type FieldRegistration, type FieldScope, FieldState, type FieldsParams, FieldsRequest, type FlushResult, FollowRequest, type Frame, FrameSessionFacts, type FrameSessionFailedParams, FrameTicket, GatewayStatus, type GcCompactEvents, type GcCompacted, type GcCount, type GcRunParams, type GcRunResult, type GcVersion, type GeneratedIdKind, HOSTED_OFFLINE_LIMIT_DEFAULT, HOSTED_OFFLINE_LIMIT_MAX_MS, HOST_PROTOCOL_REVISIONS, HomeConfig, type HomeDiagnosticCode, HomeId, type HostDiagnosticCode, type HostedPushParams, type HostedPushResult, HostedRoute, HostedSettings, type HostedSubmissionParams, type HostedSubmissionResult, type HygieneDiagnosticCode, type Id, type IdBody, type IdKind, type IdPrefix, type IdentityVia, InstanceCapabilities, type InstanceCheck, type InstanceCheckParams, type InstanceCheckResult, InstanceInfo, type InstanceStatusParams, type InstanceStatusResult, JSON_RPC_ERROR_CODES, JsonRpcErrorObject, JsonRpcFailure, type JsonRpcId, type JsonRpcMessage, JsonRpcNotification, type JsonRpcParams, JsonRpcRequest, type JsonRpcResponse, JsonRpcSuccess, type KnownDiagnosticCode, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LineSplitter, LinkId, type ListingEntry, type LiveDiagnosticCode, type LivePushParams, type LivePushResult, LiveRequest, type LiveSourceInfo, type LiveState, type LiveUpdate, MAX_LINE_LENGTH, MCP_APPS_PROTOCOL_VERSION, type ManifestDiagnosticCode, type MethodDefinition, type MethodDirection, type MostraInitializeParams, type MostraInitializeResult, type MostraShutdownParams, type MostraShutdownResult, MutationId, MutationResult, type NetworkDiagnosticCode, type NotificationDefinition, OPEN_LINK_SCHEMES, OriginString, OrphanedField, OwnerLinkInfo, PUBLIC_SHARE_DEFAULT_TTL, PUBLIC_SHARE_MAX_TTL_MS, type PlatformDiagnosticCode, PollResult, type PortAddressingExternalBaseParams, type PortAddressingExternalBaseResult, type PortIdentityResolveParams, type PortIdentityResolveResult, PortName, type PortRelayCallParams, type PortRelayCallResult, type PortRelayCancelParams, type PortRelayCancelResult, type PortRelayLiveParams, type PortRelayLiveResult, type PortRelayReconcileParams, type PortRelayReconcileResult, type PortRelayRunParams, type PortRelayRunResult, type PortSecretsGetParams, type PortSecretsGetResult, type PortTrustedControlsActivatedParams, type PortTrustedControlsActivatedResult, type PortTrustedControlsPolicyParams, type PortTrustedControlsPolicyResult, type ProbedField, type PublishDiagnosticCode, PublishReceipt, READABLE_LIVE_KEY_PATTERN, REVIEW_SET_ID_PATTERN, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, type Rect, type Refusal, type RegressionDiagnosticCode, type RelayCallBatchParams, type RelayCallBatchResult, type RelayEffectParams, type RelayEffectResult, type RelayHeld, type RelayLiveValueParams, type RelayLiveValueResult, type RelayReconciled, type RelayRunEnd, type RelayRunUpdateParams, type RelayRunUpdateResult, RelayViewer, type RemoteDiagnosticCode, RemoteError, RemoteLink, type RemoteLinkState, type RemoteLoginParams, type RemoteLoginResult, type RemoteLoginWaitParams, type RemoteLoginWaitResult, type RemoteLogoutParams, type RemoteLogoutResult, type RemoteStatusParams, type RemoteStatusResult, type RemoteTokenParams, type RemoteTokenResult, type RenderRequest, type RenderResult, type RequestFacts, type RequestIntent, type RequestPolicy, ResultComment, Results, type ResultsGetParams, type ResultsGetResult, ResultsMarkdown, Revision, type RevisionNegotiation, RouteId, RpcError, RpcPeer, type RpcPeerOptions, type RpcRequestContext, type RpcRequestOptions, RunAttachRequest, RunCancelRequest, type RunDelta, RunId, RunProgress, type RunReason, RunRequest, RunState, type RunStatus, type RuntimeDiagnosticCode, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, SHELL_SESSION_HEADER, SIGNAL_NAME_PATTERN, SIGNAL_PAYLOAD_MAX_BYTES, type SaveState, ScreenshotPolicy, type SecretDeleteParams, type SecretDeleteResult, type SecretDiagnosticCode, SecretEntry, type SecretListParams, type SecretListResult, type SecretSetParams, type SecretSetResult, SerializationError, type SerializeMode, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerOrigin, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, type ServerStatePatchResult, Share, type ShareDiagnosticCode, ShareId, type ShareListParams, type ShareListResult, type ShareStartParams, type ShareStartResult, type ShareStopParams, type ShareStopResult, ShareVia, ShellSubmitRequest, SignalRequest, type SmokeDiagnosticCode, SourceRef, type StateGetParams, type StateGetResult, type StatePatchParams, type StatePatchResult, StreamSnapshot, StreamTicket, StreamTicketRequest, SubmissionEnvelope, SubmissionId, SubmissionPolicy, SubmissionSummary, type SubmissionsDeliverResult, type SubmitBlocker, SubmitChannel, type SubmitDiagnosticCode, SubmitRequest, TALLY_CHOICES_MAX, TALLY_CHOICES_MIN, TALLY_LIVE_PREFIX, TallySpec, type TallyValue, type TargetDiagnosticCode, type TerminalSpec, ThreadId, type TokenEstimate, TokenId, TrustedControl, type TypeDiagnosticCode, UNSERIALIZABLE_CODE, type UiInitializeParams, type UiInitializeResult, VERIFY_PROBE, VERIFY_REPORT, VERIFY_RUNNER_METHODS, ValueReader, type ValueReaderOptions, ValueWriter, type ValueWriterOptions, type VerdictAria, type VerdictScreenshot, type VerifyDiagnosticCode, VerifyVerdict, type VerifyViewport, type VersionAvailableParams, VersionId, type VersionIdKind, VersionPush, VersionRef, VersionSummary, ViewContext, ViewContextWire, type ViewDefaultParams, type ViewDefaultResult, ViewId, type ViewLaunchParams, type ViewLaunchResult, type ViewRevokeParams, type ViewRevokeResult, type ViewRotateParams, type ViewRotateResult, type ViewUrlParams, type ViewUrlResult, Viewer, ViewerId, type ViewerKind, ViewerSpec, type Viewport, WAIT_MAX_MS, WORKER_CHANNEL_REVISION, WORKER_METHODS, WaitCondition, type WaitParams, type WaitResult, type WireError, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, type WorkerCancelParams, type WorkerLimits, type WorkerLiveParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerStatus, WorkerVersionRef, a11yDiagnosticCodes, actionDiagnosticCodes, ariaSummary, artifactCreateMethod, artifactDiagnosticCodes, artifactExportMethod, artifactGetMethod, artifactImportMethod, artifactListMethod, artifactPublishMethod, artifactVerifyMethod, buildDiagnosticCodes, bundleAssetName, canonicalJson, checkArgumentFrames, checkRequest, classifyMessage, cliDiagnosticCodes, connectBridge, consoleDiagnosticCodes, createDiagnostic, defineMethod, depDiagnosticCodes, depsAddMethod, deserializeAll, devStartMethod, devStopMethod, diagnosticCatalog, docsUrl, durationMs, encodeLine, envDiagnosticCodes, estimateImageTokens, eventsAckMethod, eventsReadMethod, eventsSubscribeMethod, eventsUnsubscribeMethod, fieldDiagnosticCodes, fromBase64, gcRunMethod, headerValue, homeDiagnosticCodes, hostDiagnosticCodes, hostMethods, hostNotifications, hostedPushMethod, hostedSubmissionMethod, hygieneDiagnosticCodes, instanceCheckMethod, instanceStatusMethod, isFieldId, isFinalRunStatus, isJsonContentType, isWindowsBundle, liveDiagnosticCodes, livePushMethod, manifestDiagnosticCodes, manifestProblem, mostraControlsRequest, mostraFieldFocus, mostraFields, mostraFlush, mostraFrameSessionEntered, mostraFrameSessionFailed, mostraInitializeMethod, mostraPage, mostraReady, mostraShutdownMethod, mostraVersionAvailable, negotiateRevision, networkDiagnosticCodes, normalizeScopes, parseParams, platformDiagnosticCodes, portAddressingExternalBaseMethod, portDraftsMirrorMethod, portIdentityResolveMethod, portRelayCallMethod, portRelayCancelMethod, portRelayLiveMethod, portRelayReconcileMethod, portRelayRunMethod, portSecretsGetMethod, portSubmissionsDeliverMethod, portTrustedControlsActivatedMethod, portTrustedControlsPolicyMethod, publishDiagnosticCodes, readViewContext, receivable, refusal, regressionDiagnosticCodes, relayCallBatchMethod, relayEffectMethod, relayLiveValueMethod, relayRunUpdateMethod, remoteDiagnosticCodes, remoteLoginMethod, remoteLoginWaitMethod, remoteLogoutMethod, remoteStatusMethod, remoteTokenMethod, resultsGetMethod, runtimeDiagnosticCodes, safeEqual, safePath, scopeAllows, secretDeleteMethod, secretDiagnosticCodes, secretListMethod, secretSetMethod, serializeAll, shareDiagnosticCodes, shareListMethod, shareStartMethod, shareStopMethod, smokeDiagnosticCodes, stateGetMethod, statePatchMethod, submitDiagnosticCodes, targetDiagnosticCodes, toBase64, typeDiagnosticCodes, uiInitialize, uiInitialized, uiOpenLink, uiSizeChanged, verifyDiagnosticCodes, viewDefaultMethod, viewLaunchMethod, viewRevokeMethod, viewRotateMethod, viewUrlMethod, viewportsFor, waitMethod, wireError };
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
- import { ArtifactId, CommentId, Cursor, DeliveryId, MutationId, RunId, ShareId, SubmissionId, ThreadId, TokenId, VersionId, ViewId, ViewerId } from "./ids.js";
2
- import { ACTION_ARGS_MAX, ACTION_RESULT_MAX, ActionError, Batches, CallRequest, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LiveRequest, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, RunAttachRequest, RunCancelRequest, RunProgress, RunRequest, RunState, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, isFinalRunStatus } from "./actions.js";
3
- import { ARTIFACT_MANIFEST_KEYS, ArtifactLink, ArtifactManifest, SubmissionPolicy } from "./manifest.js";
1
+ import { AccountId, ArtifactId, CommentId, Cursor, DeliveryId, HomeId, LinkId, MutationId, RouteId, RunId, ShareId, SubmissionId, ThreadId, TokenId, VersionId, ViewId, ViewerId } from "./ids.js";
2
+ import { ACTION_ARGS_MAX, ACTION_RESULT_MAX, ActionError, Batches, CallRequest, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LiveRequest, READABLE_LIVE_KEY_PATTERN, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, RunAttachRequest, RunCancelRequest, RunProgress, RunRequest, RunState, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, TALLY_LIVE_PREFIX, isFinalRunStatus } from "./actions.js";
3
+ import { Duration, durationMs } from "./duration.js";
4
+ import { SubmissionPolicy } from "./policy.js";
5
+ import { ARTIFACT_MANIFEST_KEYS, ArtifactLink, ArtifactManifest, HOSTED_OFFLINE_LIMIT_DEFAULT, HOSTED_OFFLINE_LIMIT_MAX_MS, HostedSettings, TALLY_CHOICES_MAX, TALLY_CHOICES_MIN, TallySpec, manifestProblem } from "./manifest.js";
4
6
  import { ArtifactDetail, ArtifactRef, ArtifactSummary, PublishReceipt, SourceRef, VersionSummary } from "./artifact.js";
5
7
  import { DIAGNOSTIC_AREAS, Diagnostic, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity } from "./diagnostics/diagnostic.js";
6
8
  import { DEFAULT_DOCS_BASE, docsUrl } from "./diagnostics/spec.js";
@@ -10,11 +12,11 @@ import { receivable } from "./receive.js";
10
12
  import { RpcPeer, parseParams } from "./rpc/peer.js";
11
13
  import { ControlsPolicy, REVIEW_SET_ID_PATTERN, SubmitChannel, TrustedControl, VersionRef, ViewContext, ViewContextWire, readViewContext } from "./view.js";
12
14
  import { BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX, CONTROL_LABEL_MAX, MCP_APPS_PROTOCOL_VERSION, OPEN_LINK_SCHEMES, connectBridge, mostraControlsRequest, mostraFieldFocus, mostraFields, mostraFlush, mostraFrameSessionEntered, mostraFrameSessionFailed, mostraPage, mostraReady, mostraVersionAvailable, uiInitialize, uiInitialized, uiOpenLink, uiSizeChanged } from "./bridge.js";
13
- import { Actor, DeliveryStatus, DocumentRevision, EventFilter, EventRecord, EventTypePattern, FIELD_ID_MAX_LENGTH, FieldConflict, FieldOp, FieldState, MutationResult, ResultComment, Results, SIGNAL_NAME_PATTERN, SubmissionSummary, Viewer, ViewerSpec, WaitCondition, isFieldId } from "./interaction.js";
14
- import { BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, CarryOver, ChooseRequest, DocumentSnapshot, EnterRequest, EnterResult, FRAME_SESSION_HEADER, FieldsRequest, FollowRequest, FrameSessionFacts, FrameTicket, OrphanedField, PollResult, SIGNAL_PAYLOAD_MAX_BYTES, ShellSubmitRequest, SignalRequest, StreamSnapshot, StreamTicket, StreamTicketRequest, SubmitRequest } from "./browser.js";
15
+ import { Actor, DeliveryStatus, DocumentRevision, EventFilter, EventOrigin, EventRecord, EventTypePattern, FIELD_ID_MAX_LENGTH, FieldConflict, FieldOp, FieldState, MutationResult, ResultComment, Results, SIGNAL_NAME_PATTERN, SubmissionSummary, Viewer, ViewerSpec, WaitCondition, isFieldId } from "./interaction.js";
16
+ import { BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, CarryOver, ChooseRequest, DocumentSnapshot, EnterRequest, EnterResult, FRAME_SESSION_HEADER, FieldsRequest, FollowRequest, FrameSessionFacts, FrameTicket, OrphanedField, PollResult, SHELL_SESSION_HEADER, SIGNAL_PAYLOAD_MAX_BYTES, ShellSubmitRequest, SignalRequest, StreamSnapshot, StreamTicket, StreamTicketRequest, SubmitRequest } from "./browser.js";
15
17
  import { BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, BundlePlatformSchema, BundleSetup, bundleAssetName, isWindowsBundle } from "./bundle.js";
16
18
  import { canonicalJson } from "./canonical.js";
17
- import { ALL_SCOPES, CapabilityScope, Duration, durationMs, normalizeScopes, scopeAllows } from "./capability.js";
19
+ import { ALL_SCOPES, CapabilityScope, normalizeScopes, scopeAllows } from "./capability.js";
18
20
  import { a11yDiagnosticCodes } from "./diagnostics/codes/a11y.js";
19
21
  import { actionDiagnosticCodes } from "./diagnostics/codes/action.js";
20
22
  import { artifactDiagnosticCodes } from "./diagnostics/codes/artifact.js";
@@ -33,6 +35,7 @@ import { networkDiagnosticCodes } from "./diagnostics/codes/network.js";
33
35
  import { platformDiagnosticCodes } from "./diagnostics/codes/platform.js";
34
36
  import { publishDiagnosticCodes } from "./diagnostics/codes/publish.js";
35
37
  import { regressionDiagnosticCodes } from "./diagnostics/codes/regression.js";
38
+ import { remoteDiagnosticCodes } from "./diagnostics/codes/remote.js";
36
39
  import { runtimeDiagnosticCodes } from "./diagnostics/codes/runtime.js";
37
40
  import { secretDiagnosticCodes } from "./diagnostics/codes/secret.js";
38
41
  import { shareDiagnosticCodes } from "./diagnostics/codes/share.js";
@@ -45,7 +48,9 @@ import { createDiagnostic, diagnosticCatalog } from "./diagnostics/codes/index.j
45
48
  import { CSRF_HEADER, checkRequest, headerValue, isJsonContentType, refusal, safeEqual, safePath } from "./hygiene.js";
46
49
  import { defineMethod } from "./method.js";
47
50
  import { artifactCreateMethod } from "./methods/artifact/create.js";
51
+ import { ExportClass, artifactExportMethod } from "./methods/artifact/export.js";
48
52
  import { artifactGetMethod } from "./methods/artifact/get.js";
53
+ import { artifactImportMethod } from "./methods/artifact/import.js";
49
54
  import { artifactListMethod } from "./methods/artifact/list.js";
50
55
  import { artifactPublishMethod } from "./methods/artifact/publish.js";
51
56
  import { ARTIFACT_PROGRESS, ArtifactProgressParams, DEFAULT_VIEWPORTS, ScreenshotPolicy, VERIFY_PROBE, VERIFY_REPORT, VERIFY_RUNNER_METHODS, VerifyVerdict, ariaSummary, estimateImageTokens, viewportsFor } from "./verify.js";
@@ -58,7 +63,11 @@ import { EVENTS_READ_MAX, eventsReadMethod } from "./methods/events/read.js";
58
63
  import { EVENTS_NOTIFY, EventsNotifyParams, eventsSubscribeMethod } from "./methods/events/subscribe.js";
59
64
  import { eventsUnsubscribeMethod } from "./methods/events/unsubscribe.js";
60
65
  import { gcRunMethod } from "./methods/gc/run.js";
66
+ import { HostedRoute, VersionPush, hostedPushMethod } from "./methods/hosted/push.js";
67
+ import { SubmissionEnvelope, portSubmissionsDeliverMethod } from "./methods/port/submissions-deliver.js";
68
+ import { hostedSubmissionMethod } from "./methods/hosted/submission.js";
61
69
  import { instanceCheckMethod } from "./methods/instance/check.js";
70
+ import { OwnerLinkInfo, RemoteLink, ServerOrigin } from "./remote.js";
62
71
  import { HOST_PROTOCOL_REVISIONS, Revision, negotiateRevision } from "./revision.js";
63
72
  import { CLI_CLIENT_NAME, ClientCapabilities, ClientInfo, DependencyPolicy, HomeConfig, InstanceCapabilities, InstanceInfo, PortName, mostraInitializeMethod } from "./methods/mostra/initialize.js";
64
73
  import { PUBLIC_SHARE_DEFAULT_TTL, PUBLIC_SHARE_MAX_TTL_MS, Share, ShareVia, shareStartMethod } from "./methods/share/start.js";
@@ -68,10 +77,23 @@ import { mostraShutdownMethod } from "./methods/mostra/shutdown.js";
68
77
  import { ExternalBase, OriginString, portAddressingExternalBaseMethod } from "./methods/port/addressing-external-base.js";
69
78
  import { DraftMirror, portDraftsMirrorMethod } from "./methods/port/drafts-mirror.js";
70
79
  import { portIdentityResolveMethod } from "./methods/port/identity-resolve.js";
80
+ import { RelayViewer, portRelayRunMethod } from "./methods/port/relay-run.js";
81
+ import { portRelayCallMethod } from "./methods/port/relay-call.js";
82
+ import { portRelayCancelMethod } from "./methods/port/relay-cancel.js";
83
+ import { portRelayLiveMethod } from "./methods/port/relay-live.js";
84
+ import { portRelayReconcileMethod } from "./methods/port/relay-reconcile.js";
71
85
  import { portSecretsGetMethod } from "./methods/port/secrets-get.js";
72
- import { SubmissionEnvelope, portSubmissionsDeliverMethod } from "./methods/port/submissions-deliver.js";
73
86
  import { portTrustedControlsActivatedMethod } from "./methods/port/trusted-controls-activated.js";
74
87
  import { portTrustedControlsPolicyMethod } from "./methods/port/trusted-controls-policy.js";
88
+ import { relayCallBatchMethod } from "./methods/relay/call-batch.js";
89
+ import { relayEffectMethod } from "./methods/relay/effect.js";
90
+ import { relayLiveValueMethod } from "./methods/relay/live-value.js";
91
+ import { relayRunUpdateMethod } from "./methods/relay/run-update.js";
92
+ import { remoteLoginMethod } from "./methods/remote/login.js";
93
+ import { remoteLoginWaitMethod } from "./methods/remote/login-wait.js";
94
+ import { remoteLogoutMethod } from "./methods/remote/logout.js";
95
+ import { remoteStatusMethod } from "./methods/remote/status.js";
96
+ import { remoteTokenMethod } from "./methods/remote/token.js";
75
97
  import { ResultsMarkdown, resultsGetMethod } from "./methods/results/get.js";
76
98
  import { secretDeleteMethod } from "./methods/secret/delete.js";
77
99
  import { SecretEntry, secretSetMethod } from "./methods/secret/set.js";
@@ -90,4 +112,4 @@ import { hostMethods, hostNotifications } from "./methods/index.js";
90
112
  import { LineSplitter, MAX_LINE_LENGTH, encodeLine } from "./rpc/lines.js";
91
113
  import { ARGUMENT_BIGINT_DIGITS_MAX, RemoteError, SerializationError, UNSERIALIZABLE_CODE, ValueReader, ValueWriter, checkArgumentFrames, deserializeAll, fromBase64, serializeAll, toBase64, wireError } from "./serializer.js";
92
114
  import { DEFAULT_WORKER_LIMITS, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, WORKER_CHANNEL_REVISION, WORKER_METHODS, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerVersionRef } from "./worker.js";
93
- export { ACTION_ARGS_MAX, ACTION_RESULT_MAX, ALL_SCOPES, ARGUMENT_BIGINT_DIGITS_MAX, ARTIFACT_MANIFEST_KEYS, ARTIFACT_PROGRESS, ActionError, Actor, AddedPackage, ArtifactDetail, ArtifactId, ArtifactLink, ArtifactManifest, ArtifactProgressParams, ArtifactRef, ArtifactSummary, BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX, BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, Batches, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, BundlePlatformSchema, BundleSetup, CLI_CLIENT_NAME, CONTROL_LABEL_MAX, CSRF_HEADER, CallRequest, CapabilityLink, CapabilityScope, CarryOver, ChildProcessStatus, ChooseRequest, ClientCapabilities, ClientInfo, CommentId, ControlsPolicy, Cursor, DEFAULT_DOCS_BASE, DEFAULT_VIEWPORTS, DEFAULT_WORKER_LIMITS, DEV_NOTIFY, DIAGNOSTIC_AREAS, DeliveryCounts, DeliveryId, DeliveryStatus, DependencyPolicy, DevNotifyParams, Diagnostic, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity, DocumentRevision, DocumentSnapshot, DraftMirror, Duration, EVENTS_NOTIFY, EVENTS_READ_MAX, EnterRequest, EnterResult, EventFilter, EventRecord, EventTypePattern, EventsNotifyParams, ExternalBase, FIELD_ID_MAX_LENGTH, FRAME_SESSION_HEADER, FieldConflict, FieldOp, FieldState, FieldsRequest, FollowRequest, FrameSessionFacts, FrameTicket, GatewayStatus, HOST_PROTOCOL_REVISIONS, HomeConfig, InstanceCapabilities, InstanceInfo, JSON_RPC_ERROR_CODES, JsonRpcErrorObject, JsonRpcFailure, JsonRpcNotification, JsonRpcRequest, JsonRpcSuccess, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LineSplitter, LiveRequest, MAX_LINE_LENGTH, MCP_APPS_PROTOCOL_VERSION, MutationId, MutationResult, OPEN_LINK_SCHEMES, OriginString, OrphanedField, PUBLIC_SHARE_DEFAULT_TTL, PUBLIC_SHARE_MAX_TTL_MS, PollResult, PortName, PublishReceipt, REVIEW_SET_ID_PATTERN, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, RemoteError, ResultComment, Results, ResultsMarkdown, Revision, RpcError, RpcPeer, RunAttachRequest, RunCancelRequest, RunId, RunProgress, RunRequest, RunState, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, SIGNAL_NAME_PATTERN, SIGNAL_PAYLOAD_MAX_BYTES, ScreenshotPolicy, SecretEntry, SerializationError, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, Share, ShareId, ShareVia, ShellSubmitRequest, SignalRequest, SourceRef, StreamSnapshot, StreamTicket, StreamTicketRequest, SubmissionEnvelope, SubmissionId, SubmissionPolicy, SubmissionSummary, SubmitChannel, SubmitRequest, ThreadId, TokenId, TrustedControl, UNSERIALIZABLE_CODE, VERIFY_PROBE, VERIFY_REPORT, VERIFY_RUNNER_METHODS, ValueReader, ValueWriter, VerifyVerdict, VersionId, VersionRef, VersionSummary, ViewContext, ViewContextWire, ViewId, Viewer, ViewerId, ViewerSpec, WAIT_MAX_MS, WORKER_CHANNEL_REVISION, WORKER_METHODS, WaitCondition, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerStatus, WorkerVersionRef, a11yDiagnosticCodes, actionDiagnosticCodes, ariaSummary, artifactCreateMethod, artifactDiagnosticCodes, artifactGetMethod, artifactListMethod, artifactPublishMethod, artifactVerifyMethod, buildDiagnosticCodes, bundleAssetName, canonicalJson, checkArgumentFrames, checkRequest, classifyMessage, cliDiagnosticCodes, connectBridge, consoleDiagnosticCodes, createDiagnostic, defineMethod, depDiagnosticCodes, depsAddMethod, deserializeAll, devStartMethod, devStopMethod, diagnosticCatalog, docsUrl, durationMs, encodeLine, envDiagnosticCodes, estimateImageTokens, eventsAckMethod, eventsReadMethod, eventsSubscribeMethod, eventsUnsubscribeMethod, fieldDiagnosticCodes, fromBase64, gcRunMethod, headerValue, homeDiagnosticCodes, hostDiagnosticCodes, hostMethods, hostNotifications, hygieneDiagnosticCodes, instanceCheckMethod, instanceStatusMethod, isFieldId, isFinalRunStatus, isJsonContentType, isWindowsBundle, liveDiagnosticCodes, livePushMethod, manifestDiagnosticCodes, mostraControlsRequest, mostraFieldFocus, mostraFields, mostraFlush, mostraFrameSessionEntered, mostraFrameSessionFailed, mostraInitializeMethod, mostraPage, mostraReady, mostraShutdownMethod, mostraVersionAvailable, negotiateRevision, networkDiagnosticCodes, normalizeScopes, parseParams, platformDiagnosticCodes, portAddressingExternalBaseMethod, portDraftsMirrorMethod, portIdentityResolveMethod, portSecretsGetMethod, portSubmissionsDeliverMethod, portTrustedControlsActivatedMethod, portTrustedControlsPolicyMethod, publishDiagnosticCodes, readViewContext, receivable, refusal, regressionDiagnosticCodes, resultsGetMethod, runtimeDiagnosticCodes, safeEqual, safePath, scopeAllows, secretDeleteMethod, secretDiagnosticCodes, secretListMethod, secretSetMethod, serializeAll, shareDiagnosticCodes, shareListMethod, shareStartMethod, shareStopMethod, smokeDiagnosticCodes, stateGetMethod, statePatchMethod, submitDiagnosticCodes, targetDiagnosticCodes, toBase64, typeDiagnosticCodes, uiInitialize, uiInitialized, uiOpenLink, uiSizeChanged, verifyDiagnosticCodes, viewDefaultMethod, viewLaunchMethod, viewRevokeMethod, viewRotateMethod, viewUrlMethod, viewportsFor, waitMethod, wireError };
115
+ export { ACTION_ARGS_MAX, ACTION_RESULT_MAX, ALL_SCOPES, ARGUMENT_BIGINT_DIGITS_MAX, ARTIFACT_MANIFEST_KEYS, ARTIFACT_PROGRESS, AccountId, ActionError, Actor, AddedPackage, ArtifactDetail, ArtifactId, ArtifactLink, ArtifactManifest, ArtifactProgressParams, ArtifactRef, ArtifactSummary, BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX, BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, Batches, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, BundlePlatformSchema, BundleSetup, CLI_CLIENT_NAME, CONTROL_LABEL_MAX, CSRF_HEADER, CallRequest, CapabilityLink, CapabilityScope, CarryOver, ChildProcessStatus, ChooseRequest, ClientCapabilities, ClientInfo, CommentId, ControlsPolicy, Cursor, DEFAULT_DOCS_BASE, DEFAULT_VIEWPORTS, DEFAULT_WORKER_LIMITS, DEV_NOTIFY, DIAGNOSTIC_AREAS, DeliveryCounts, DeliveryId, DeliveryStatus, DependencyPolicy, DevNotifyParams, Diagnostic, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity, DocumentRevision, DocumentSnapshot, DraftMirror, Duration, EVENTS_NOTIFY, EVENTS_READ_MAX, EnterRequest, EnterResult, EventFilter, EventOrigin, EventRecord, EventTypePattern, EventsNotifyParams, ExportClass, ExternalBase, FIELD_ID_MAX_LENGTH, FRAME_SESSION_HEADER, FieldConflict, FieldOp, FieldState, FieldsRequest, FollowRequest, FrameSessionFacts, FrameTicket, GatewayStatus, HOSTED_OFFLINE_LIMIT_DEFAULT, HOSTED_OFFLINE_LIMIT_MAX_MS, HOST_PROTOCOL_REVISIONS, HomeConfig, HomeId, HostedRoute, HostedSettings, InstanceCapabilities, InstanceInfo, JSON_RPC_ERROR_CODES, JsonRpcErrorObject, JsonRpcFailure, JsonRpcNotification, JsonRpcRequest, JsonRpcSuccess, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LineSplitter, LinkId, LiveRequest, MAX_LINE_LENGTH, MCP_APPS_PROTOCOL_VERSION, MutationId, MutationResult, OPEN_LINK_SCHEMES, OriginString, OrphanedField, OwnerLinkInfo, PUBLIC_SHARE_DEFAULT_TTL, PUBLIC_SHARE_MAX_TTL_MS, PollResult, PortName, PublishReceipt, READABLE_LIVE_KEY_PATTERN, REVIEW_SET_ID_PATTERN, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, RelayViewer, RemoteError, RemoteLink, ResultComment, Results, ResultsMarkdown, Revision, RouteId, RpcError, RpcPeer, RunAttachRequest, RunCancelRequest, RunId, RunProgress, RunRequest, RunState, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, SHELL_SESSION_HEADER, SIGNAL_NAME_PATTERN, SIGNAL_PAYLOAD_MAX_BYTES, ScreenshotPolicy, SecretEntry, SerializationError, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerOrigin, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, Share, ShareId, ShareVia, ShellSubmitRequest, SignalRequest, SourceRef, StreamSnapshot, StreamTicket, StreamTicketRequest, SubmissionEnvelope, SubmissionId, SubmissionPolicy, SubmissionSummary, SubmitChannel, SubmitRequest, TALLY_CHOICES_MAX, TALLY_CHOICES_MIN, TALLY_LIVE_PREFIX, TallySpec, ThreadId, TokenId, TrustedControl, UNSERIALIZABLE_CODE, VERIFY_PROBE, VERIFY_REPORT, VERIFY_RUNNER_METHODS, ValueReader, ValueWriter, VerifyVerdict, VersionId, VersionPush, VersionRef, VersionSummary, ViewContext, ViewContextWire, ViewId, Viewer, ViewerId, ViewerSpec, WAIT_MAX_MS, WORKER_CHANNEL_REVISION, WORKER_METHODS, WaitCondition, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerStatus, WorkerVersionRef, a11yDiagnosticCodes, actionDiagnosticCodes, ariaSummary, artifactCreateMethod, artifactDiagnosticCodes, artifactExportMethod, artifactGetMethod, artifactImportMethod, artifactListMethod, artifactPublishMethod, artifactVerifyMethod, buildDiagnosticCodes, bundleAssetName, canonicalJson, checkArgumentFrames, checkRequest, classifyMessage, cliDiagnosticCodes, connectBridge, consoleDiagnosticCodes, createDiagnostic, defineMethod, depDiagnosticCodes, depsAddMethod, deserializeAll, devStartMethod, devStopMethod, diagnosticCatalog, docsUrl, durationMs, encodeLine, envDiagnosticCodes, estimateImageTokens, eventsAckMethod, eventsReadMethod, eventsSubscribeMethod, eventsUnsubscribeMethod, fieldDiagnosticCodes, fromBase64, gcRunMethod, headerValue, homeDiagnosticCodes, hostDiagnosticCodes, hostMethods, hostNotifications, hostedPushMethod, hostedSubmissionMethod, hygieneDiagnosticCodes, instanceCheckMethod, instanceStatusMethod, isFieldId, isFinalRunStatus, isJsonContentType, isWindowsBundle, liveDiagnosticCodes, livePushMethod, manifestDiagnosticCodes, manifestProblem, mostraControlsRequest, mostraFieldFocus, mostraFields, mostraFlush, mostraFrameSessionEntered, mostraFrameSessionFailed, mostraInitializeMethod, mostraPage, mostraReady, mostraShutdownMethod, mostraVersionAvailable, negotiateRevision, networkDiagnosticCodes, normalizeScopes, parseParams, platformDiagnosticCodes, portAddressingExternalBaseMethod, portDraftsMirrorMethod, portIdentityResolveMethod, portRelayCallMethod, portRelayCancelMethod, portRelayLiveMethod, portRelayReconcileMethod, portRelayRunMethod, portSecretsGetMethod, portSubmissionsDeliverMethod, portTrustedControlsActivatedMethod, portTrustedControlsPolicyMethod, publishDiagnosticCodes, readViewContext, receivable, refusal, regressionDiagnosticCodes, relayCallBatchMethod, relayEffectMethod, relayLiveValueMethod, relayRunUpdateMethod, remoteDiagnosticCodes, remoteLoginMethod, remoteLoginWaitMethod, remoteLogoutMethod, remoteStatusMethod, remoteTokenMethod, resultsGetMethod, runtimeDiagnosticCodes, safeEqual, safePath, scopeAllows, secretDeleteMethod, secretDiagnosticCodes, secretListMethod, secretSetMethod, serializeAll, shareDiagnosticCodes, shareListMethod, shareStartMethod, shareStopMethod, smokeDiagnosticCodes, stateGetMethod, statePatchMethod, submitDiagnosticCodes, targetDiagnosticCodes, toBase64, typeDiagnosticCodes, uiInitialize, uiInitialized, uiOpenLink, uiSizeChanged, verifyDiagnosticCodes, viewDefaultMethod, viewLaunchMethod, viewRevokeMethod, viewRotateMethod, viewUrlMethod, viewportsFor, waitMethod, wireError };
@@ -1,10 +1,15 @@
1
- import { ArtifactLink, SubmissionPolicy } from "./manifest.js";
1
+ import { SubmissionPolicy } from "./policy.js";
2
+ import { ArtifactLink } from "./manifest.js";
2
3
  import { ControlsPolicy, SubmitChannel, TrustedControl } from "./view.js";
3
4
  import { Cursor } from "./ids.js";
4
5
  import * as z from "zod";
5
6
  //#region src/interaction.d.ts
6
7
  /** How Mostra knows a viewer (DATA_MODEL §3 `viewer.kind`). */
7
- export type ViewerKind = "local" | "tailnet" | "token" | "host";
8
+ /**
9
+ * How Mostra knows a viewer: `account` and `anonymous` are hosted links' (a signed-in person, and
10
+ * one per browser who isn't signed in, D165 item 8).
11
+ */
12
+ export type ViewerKind = "local" | "tailnet" | "token" | "host" | "account" | "anonymous";
8
13
  /**
9
14
  * A person who views an artifact (PRODUCT vocabulary). The home's local user is one viewer of kind
10
15
  * `local`; a link minted with `viewer` acts as a viewer of kind `token` (D104).
@@ -130,6 +135,23 @@ export interface MutationResult {
130
135
  }
131
136
  /** The Zod schema of the `MutationResult` type. */
132
137
  export declare const MutationResult: z.ZodType<MutationResult>;
138
+ /**
139
+ * Where an owner instance's copy of a hosted record came from (INTERFACES §18.2, D165 item 1): the
140
+ * server, the hosted home, its incarnation and the record's cursor there (a submission's is the
141
+ * cursor of its `submission.created`).
142
+ */
143
+ export interface EventOrigin {
144
+ /** The server's API origin. */
145
+ readonly server: string;
146
+ /** The hosted home's `hom_` ID. */
147
+ readonly home: string;
148
+ /** The hosted home's incarnation when the record was copied. */
149
+ readonly incarnation: string;
150
+ /** The record's cursor in the hosted home. */
151
+ readonly cursor: Cursor;
152
+ }
153
+ /** The Zod schema of the `EventOrigin` type. */
154
+ export declare const EventOrigin: z.ZodType<EventOrigin>;
133
155
  /**
134
156
  * One durable event (DATA_MODEL §4). Its cursor is its stable ID and its place in the home-wide
135
157
  * order; `seq` orders an artifact's own events without gaps.
@@ -151,6 +173,8 @@ export interface EventRecord {
151
173
  readonly causation?: Readonly<Record<string, string>>;
152
174
  /** The event's data; sensitive field values are redacted (D52). */
153
175
  readonly payload: Readonly<Record<string, unknown>>;
176
+ /** For an event an owner instance copied from its hosted home: where it came from. */
177
+ readonly origin?: EventOrigin;
154
178
  }
155
179
  /** The Zod schema of the `EventRecord` type. */
156
180
  export declare const EventRecord: z.ZodType<EventRecord>;
@@ -336,6 +360,8 @@ export interface Results {
336
360
  readonly digest: string;
337
361
  readonly delivery: DeliveryState;
338
362
  readonly deliveries: readonly DeliveryStatus[];
363
+ /** For a submission imported from a hosted home: where it came from (D165 item 1). */
364
+ readonly origin?: EventOrigin;
339
365
  };
340
366
  /** The draft's fields by ID, dotted IDs nested (D52). */
341
367
  readonly answers: Readonly<Record<string, unknown>>;
@@ -1 +1 @@
1
- {"version":3,"file":"interaction.d.ts","names":[],"sources":["../src/interaction.ts"],"mappings":";;;;;;YAyBY;;;;;iBAMK;;WAEN;;WAEA,MAAM;;WAEN;;WAEA;;;qBAIE,QAAQ,EAAE,QAAQ;;;;;iBAgBd;;WAEN;;WAEA;;;qBAIE,YAAY,EAAE,QAAQ;;iBAWlB;;WAEN;;WAEA;;WAEA;;;qBAIE,OAAO,EAAE,QAAQ;;qBAcjB;;;;;wBAMG,UAAU,cAAc;;YAY5B;;;;;YAMA;;qBAGC,kBAAkB,EAAE,QAAQ;;;;;iBAYxB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;qBAIE,SAAS,EAAE,QAAQ;;iBAgBf;;WAEN;;WAEA,UAAU;;WAEV,YAAY;;WAEZ;;WAEA;;WAEA;;WAEA;;;qBAIE,YAAY,EAAE,QAAQ;;;;;iBAmBlB;;WAEN;;WAEA,UAAU;;WAEV;;WAEA;;WAEA,YAAY;;WAEZ;;;qBAIE,eAAe,EAAE,QAAQ;;iBAerB;;WAEN,UAAU;;WAEV;;WAEA,oBAAoB;;;qBAIlB,gBAAgB,EAAE,QAAQ;;;;;iBAkBtB;;WAEN,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;WAEA,OAAO;;WAEP,YAAY,SAAS;;WAErB,SAAS,SAAS;;;qBAIhB,aAAa,EAAE,QAAQ;;;;;YAqBxB;;qBAGC,kBAAkB,EAAE,QAAQ;;;;;;i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AEV,sBAAsB;;WAEtB;;;qBAIE,mBAAmB,EAAE,QAAQ;;iBAuBzB;;WAEN;;WAEA;;WAEA;;WAEA;;;iBAIM;;WAEN;;WAEA;;WAEA;;;iBAIM;;WAEN;;WAEA;;WAEA;aACE,QAAQ;aACR;aACA;;;WAGF;aACE;;aAEA;aACA,OAAO;aACP,WAAW;aACX;aACA;aACA;eACE;eACA;eACA;;aAEF;aACA;eAAmB;eAAwB;;;;WAG7C;aAAiB;aAAuB;aAAwB;;;;;;;;iBAQ1D;;WAEN;aACE;aACA;aACA;aACA;aACA,gBAAgB;;;WAGlB;aACE;aACA;aACA;;aAEA;aACA,QAAQ;aACR,SAAS;aACT,QAAQ;aACR;aACA;aACA;;aAEA;;aAEA;aACA,eAAe;aACf,gBAAgB;aAChB;aACA,UAAU;aACV,qBAAqB;;aAErB,SAAS;;;WAGX,SAAS,SAAS;;WAElB;aACE;aACA;aACA;aACA;aACA,OAAO;;;WAGT,QAAQ,SAAS;;WAEjB;aACE;aACA;aACA;;;WAGF,mBAAmB;;WAEnB;aACE;aACA;aACA;aACA;;;WAGF;aACE;aACA;aACA;aACA;;;WAGF;aACE;aACA;aACA;;;WAGF;;WAEA;;;qBAWE,eAAe,EAAE,QAAQ;;qBAkCzB,SAAS,EAAE,QAAQ"}
@@ -1,6 +1,7 @@
1
1
  import { wireRegistry } from "./wire-registry.js";
2
2
  import { ArtifactId, Cursor, DeliveryId, SubmissionId, VersionId, ViewId, ViewerId } from "./ids.js";
3
- import { ArtifactLink, SubmissionPolicy } from "./manifest.js";
3
+ import { SubmissionPolicy } from "./policy.js";
4
+ import { ArtifactLink } from "./manifest.js";
4
5
  import { ControlsPolicy, SubmitChannel, TrustedControl } from "./view.js";
5
6
  import * as z from "zod";
6
7
  //#region src/interaction.ts
@@ -17,7 +18,9 @@ const Viewer = z.object({
17
18
  "local",
18
19
  "tailnet",
19
20
  "token",
20
- "host"
21
+ "host",
22
+ "account",
23
+ "anonymous"
21
24
  ]),
22
25
  name: z.string().exactOptional(),
23
26
  ref: z.string().exactOptional()
@@ -107,6 +110,16 @@ const MutationResult = z.object({
107
110
  id: "MutationResult",
108
111
  description: "A mutation's outcome: the revision after it, the applied field IDs, the conflicts."
109
112
  });
113
+ /** The Zod schema of the `EventOrigin` type. */
114
+ const EventOrigin = z.object({
115
+ server: z.string().min(1),
116
+ home: z.string().min(1),
117
+ incarnation: z.string().min(1),
118
+ cursor: Cursor.schema
119
+ }).register(wireRegistry, {
120
+ id: "EventOrigin",
121
+ description: "Where an owner's copy of a hosted record came from: server, home, incarnation, cursor."
122
+ });
110
123
  /** The Zod schema of the `EventRecord` type. */
111
124
  const EventRecord = z.object({
112
125
  cursor: Cursor.schema,
@@ -116,7 +129,8 @@ const EventRecord = z.object({
116
129
  at: z.iso.datetime(),
117
130
  actor: Actor,
118
131
  causation: z.record(z.string(), z.string()).exactOptional(),
119
- payload: z.record(z.string(), z.unknown())
132
+ payload: z.record(z.string(), z.unknown()),
133
+ origin: EventOrigin.exactOptional()
120
134
  }).register(wireRegistry, {
121
135
  id: "EventRecord",
122
136
  description: "One durable event: cursor, artifact, per-artifact sequence, type, time, actor, payload."
@@ -260,7 +274,8 @@ const Results = z.object({
260
274
  "rejected",
261
275
  "undeliverable"
262
276
  ]),
263
- deliveries: z.array(DeliveryStatus).readonly()
277
+ deliveries: z.array(DeliveryStatus).readonly(),
278
+ origin: EventOrigin.exactOptional()
264
279
  }),
265
280
  answers: z.record(z.string(), z.unknown()),
266
281
  fields: z.array(z.object({
@@ -301,6 +316,6 @@ const Results = z.object({
301
316
  description: "The complete submission: artifact, submission facts, answers, fields, state, choices, comments, orphans, actions, signals."
302
317
  });
303
318
  //#endregion
304
- export { Actor, ControlsPolicy, DeliveryStatus, DocumentRevision, EventFilter, EventRecord, EventTypePattern, FIELD_ID_MAX_LENGTH, FieldConflict, FieldOp, FieldState, MutationResult, ResultComment, Results, SIGNAL_NAME_PATTERN, SubmissionSummary, SubmitChannel, TrustedControl, Viewer, ViewerSpec, WaitCondition, isFieldId };
319
+ export { Actor, ControlsPolicy, DeliveryStatus, DocumentRevision, EventFilter, EventOrigin, EventRecord, EventTypePattern, FIELD_ID_MAX_LENGTH, FieldConflict, FieldOp, FieldState, MutationResult, ResultComment, Results, SIGNAL_NAME_PATTERN, SubmissionSummary, SubmitChannel, TrustedControl, Viewer, ViewerSpec, WaitCondition, isFieldId };
305
320
 
306
321
  //# sourceMappingURL=interaction.js.map