@mostra/protocol 0.11.0 → 0.12.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 (94) hide show
  1. package/dist/actions.d.ts +11 -3
  2. package/dist/actions.d.ts.map +1 -1
  3. package/dist/actions.js.map +1 -1
  4. package/dist/browser.d.ts +1 -1
  5. package/dist/diagnostics/codes/index.d.ts +3 -2
  6. package/dist/diagnostics/codes/index.d.ts.map +1 -1
  7. package/dist/diagnostics/codes/index.js +3 -1
  8. package/dist/diagnostics/codes/index.js.map +1 -1
  9. package/dist/diagnostics/codes/team.d.ts +8 -0
  10. package/dist/diagnostics/codes/team.d.ts.map +1 -0
  11. package/dist/diagnostics/codes/team.js +44 -0
  12. package/dist/diagnostics/codes/team.js.map +1 -0
  13. package/dist/diagnostics/diagnostic.d.ts +1 -1
  14. package/dist/diagnostics/diagnostic.d.ts.map +1 -1
  15. package/dist/diagnostics/diagnostic.js +2 -1
  16. package/dist/diagnostics/diagnostic.js.map +1 -1
  17. package/dist/index.d.ts +13 -6
  18. package/dist/index.js +11 -4
  19. package/dist/interaction.d.ts +12 -3
  20. package/dist/interaction.d.ts.map +1 -1
  21. package/dist/interaction.js +15 -12
  22. package/dist/interaction.js.map +1 -1
  23. package/dist/manifest.d.ts +3 -0
  24. package/dist/manifest.d.ts.map +1 -1
  25. package/dist/manifest.js +5 -2
  26. package/dist/manifest.js.map +1 -1
  27. package/dist/methods/index.d.ts.map +1 -1
  28. package/dist/methods/index.js +10 -2
  29. package/dist/methods/index.js.map +1 -1
  30. package/dist/methods/port/trusted-controls-policy.d.ts +1 -1
  31. package/dist/methods/results/get.d.ts +3 -1
  32. package/dist/methods/results/get.d.ts.map +1 -1
  33. package/dist/methods/results/get.js +4 -3
  34. package/dist/methods/results/get.js.map +1 -1
  35. package/dist/methods/results/list.d.ts +33 -0
  36. package/dist/methods/results/list.d.ts.map +1 -0
  37. package/dist/methods/results/list.js +35 -0
  38. package/dist/methods/results/list.js.map +1 -0
  39. package/dist/methods/roster/add.d.ts +47 -0
  40. package/dist/methods/roster/add.d.ts.map +1 -0
  41. package/dist/methods/roster/add.js +46 -0
  42. package/dist/methods/roster/add.js.map +1 -0
  43. package/dist/methods/roster/get.d.ts +18 -0
  44. package/dist/methods/roster/get.d.ts.map +1 -0
  45. package/dist/methods/roster/get.js +22 -0
  46. package/dist/methods/roster/get.js.map +1 -0
  47. package/dist/methods/roster/remove.d.ts +28 -0
  48. package/dist/methods/roster/remove.d.ts.map +1 -0
  49. package/dist/methods/roster/remove.js +31 -0
  50. package/dist/methods/roster/remove.js.map +1 -0
  51. package/dist/methods/share/start.d.ts +15 -2
  52. package/dist/methods/share/start.d.ts.map +1 -1
  53. package/dist/methods/share/start.js +5 -1
  54. package/dist/methods/share/start.js.map +1 -1
  55. package/dist/methods/state/get.d.ts +1 -1
  56. package/dist/methods/state/patch.d.ts +1 -1
  57. package/dist/methods/view/url.d.ts +1 -1
  58. package/dist/methods/wait/wait.d.ts +1 -1
  59. package/dist/operator.d.ts +50 -3
  60. package/dist/operator.d.ts.map +1 -1
  61. package/dist/operator.js.map +1 -1
  62. package/dist/team-settings.d.ts +21 -0
  63. package/dist/team-settings.d.ts.map +1 -0
  64. package/dist/team-settings.js +27 -0
  65. package/dist/team-settings.js.map +1 -0
  66. package/dist/team.d.ts +221 -0
  67. package/dist/team.d.ts.map +1 -0
  68. package/dist/team.js +162 -0
  69. package/dist/team.js.map +1 -0
  70. package/dist/verify.d.ts +7 -0
  71. package/dist/verify.d.ts.map +1 -1
  72. package/dist/verify.js.map +1 -1
  73. package/dist/worker.d.ts +1 -1
  74. package/package.json +1 -1
  75. package/schemas/protocol.draft-07.json +802 -79
  76. package/schemas/protocol.schema.json +782 -91
  77. package/src/actions.ts +8 -4
  78. package/src/diagnostics/codes/index.ts +6 -2
  79. package/src/diagnostics/codes/team.ts +53 -0
  80. package/src/diagnostics/diagnostic.ts +3 -1
  81. package/src/index.ts +47 -2
  82. package/src/interaction.ts +24 -5
  83. package/src/manifest.ts +5 -0
  84. package/src/methods/index.ts +8 -0
  85. package/src/methods/results/get.ts +3 -2
  86. package/src/methods/results/list.ts +61 -0
  87. package/src/methods/roster/add.ts +77 -0
  88. package/src/methods/roster/get.ts +30 -0
  89. package/src/methods/roster/remove.ts +49 -0
  90. package/src/methods/share/start.ts +23 -3
  91. package/src/operator.ts +42 -3
  92. package/src/team-settings.ts +38 -0
  93. package/src/team.ts +398 -0
  94. package/src/verify.ts +7 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/methods/index.ts"],"sourcesContent":["/**\n * Every host protocol method this package defines. `pnpm gen protocol-method` adds entries at the\n * markers; the method itself lives in its own module under `methods/<group>/`.\n */\nimport type { AnyMethod, AnyNotification } from \"../method.ts\";\nimport { ARTIFACT_PROGRESS, ArtifactProgressParams } from \"../verify.ts\";\nimport { artifactCreateMethod } from \"./artifact/create.ts\";\nimport { artifactExportMethod } from \"./artifact/export.ts\";\nimport { artifactGetMethod } from \"./artifact/get.ts\";\nimport { artifactImportMethod } from \"./artifact/import.ts\";\nimport { artifactListMethod } from \"./artifact/list.ts\";\nimport { artifactPauseMethod } from \"./artifact/pause.ts\";\nimport { artifactPublishMethod } from \"./artifact/publish.ts\";\nimport { artifactVerifyMethod } from \"./artifact/verify.ts\";\nimport { depsAddMethod } from \"./deps/add.ts\";\nimport { DEV_NOTIFY, DevNotifyParams, devStartMethod } from \"./dev/start.ts\";\nimport { devStopMethod } from \"./dev/stop.ts\";\nimport { eventsAckMethod } from \"./events/ack.ts\";\nimport { eventsReadMethod } from \"./events/read.ts\";\nimport { EVENTS_NOTIFY, EventsNotifyParams, eventsSubscribeMethod } from \"./events/subscribe.ts\";\nimport { eventsUnsubscribeMethod } from \"./events/unsubscribe.ts\";\nimport { gcRunMethod } from \"./gc/run.ts\";\nimport { hostedPushMethod } from \"./hosted/push.ts\";\nimport { hostedSubmissionMethod } from \"./hosted/submission.ts\";\nimport { instanceCheckMethod } from \"./instance/check.ts\";\nimport { instanceStatusMethod } from \"./instance/status.ts\";\nimport { livePushMethod } from \"./live/push.ts\";\nimport { mostraInitializeMethod } from \"./mostra/initialize.ts\";\nimport { mostraShutdownMethod } from \"./mostra/shutdown.ts\";\nimport { portAddressingExternalBaseMethod } from \"./port/addressing-external-base.ts\";\nimport { portDraftsMirrorMethod } from \"./port/drafts-mirror.ts\";\nimport { portIdentityResolveMethod } from \"./port/identity-resolve.ts\";\nimport { portRelayAuthorMethod } from \"./port/relay-author.ts\";\nimport { portRelayCallMethod } from \"./port/relay-call.ts\";\nimport { portRelayCancelMethod } from \"./port/relay-cancel.ts\";\nimport { portRelayLiveMethod } from \"./port/relay-live.ts\";\nimport { portRelayReconcileMethod } from \"./port/relay-reconcile.ts\";\nimport { portRelayRunMethod } from \"./port/relay-run.ts\";\nimport { portSecretsGetMethod } from \"./port/secrets-get.ts\";\nimport { portSubmissionsDeliverMethod } from \"./port/submissions-deliver.ts\";\nimport { portTrustedControlsActivatedMethod } from \"./port/trusted-controls-activated.ts\";\nimport { portTrustedControlsPolicyMethod } from \"./port/trusted-controls-policy.ts\";\nimport { relayCallBatchMethod } from \"./relay/call-batch.ts\";\nimport { relayEffectMethod } from \"./relay/effect.ts\";\nimport { relayLiveValueMethod } from \"./relay/live-value.ts\";\nimport { relayRunUpdateMethod } from \"./relay/run-update.ts\";\nimport { remoteLinkMethod } from \"./remote/link.ts\";\nimport { remoteLoginMethod } from \"./remote/login.ts\";\nimport { remoteLoginWaitMethod } from \"./remote/login-wait.ts\";\nimport { remoteLogoutMethod } from \"./remote/logout.ts\";\nimport { remoteStatusMethod } from \"./remote/status.ts\";\nimport { remoteTokenMethod } from \"./remote/token.ts\";\nimport { resultsGetMethod } from \"./results/get.ts\";\nimport { secretDeleteMethod } from \"./secret/delete.ts\";\nimport { secretListMethod } from \"./secret/list.ts\";\nimport { secretSetMethod } from \"./secret/set.ts\";\nimport { shareListMethod } from \"./share/list.ts\";\nimport { shareStartMethod } from \"./share/start.ts\";\nimport { shareStopMethod } from \"./share/stop.ts\";\nimport { stateGetMethod } from \"./state/get.ts\";\nimport { statePatchMethod } from \"./state/patch.ts\";\nimport { viewDefaultMethod } from \"./view/default.ts\";\nimport { viewLaunchMethod } from \"./view/launch.ts\";\nimport { viewRevokeMethod } from \"./view/revoke.ts\";\nimport { viewRotateMethod } from \"./view/rotate.ts\";\nimport { viewUrlMethod } from \"./view/url.ts\";\nimport { waitMethod } from \"./wait/wait.ts\";\n// gen:method-imports\n\n/** Every host protocol method, in the order they were added. */\nexport const hostMethods: readonly AnyMethod[] = [\n mostraInitializeMethod,\n mostraShutdownMethod,\n instanceStatusMethod,\n artifactCreateMethod,\n artifactPublishMethod,\n artifactListMethod,\n artifactGetMethod,\n depsAddMethod,\n viewUrlMethod,\n viewRevokeMethod,\n viewRotateMethod,\n stateGetMethod,\n resultsGetMethod,\n waitMethod,\n eventsReadMethod,\n eventsSubscribeMethod,\n eventsUnsubscribeMethod,\n statePatchMethod,\n eventsAckMethod,\n portSubmissionsDeliverMethod,\n portDraftsMirrorMethod,\n portTrustedControlsPolicyMethod,\n portTrustedControlsActivatedMethod,\n secretSetMethod,\n secretListMethod,\n secretDeleteMethod,\n livePushMethod,\n portSecretsGetMethod,\n artifactVerifyMethod,\n viewDefaultMethod,\n viewLaunchMethod,\n gcRunMethod,\n instanceCheckMethod,\n devStartMethod,\n devStopMethod,\n portIdentityResolveMethod,\n shareStartMethod,\n shareStopMethod,\n shareListMethod,\n portAddressingExternalBaseMethod,\n artifactExportMethod,\n artifactImportMethod,\n remoteLoginMethod,\n remoteLoginWaitMethod,\n remoteLogoutMethod,\n remoteStatusMethod,\n remoteTokenMethod,\n hostedPushMethod,\n portRelayRunMethod,\n portRelayCancelMethod,\n portRelayReconcileMethod,\n portRelayCallMethod,\n relayRunUpdateMethod,\n relayCallBatchMethod,\n relayEffectMethod,\n portRelayLiveMethod,\n relayLiveValueMethod,\n hostedSubmissionMethod,\n artifactPauseMethod,\n portRelayAuthorMethod,\n remoteLinkMethod,\n // gen:methods\n];\n\n/** Every notification the instance sends to its clients (INTERFACES §6). */\nexport const hostNotifications: readonly AnyNotification[] = [\n { method: EVENTS_NOTIFY, params: EventsNotifyParams as AnyNotification[\"params\"] },\n { method: ARTIFACT_PROGRESS, params: ArtifactProgressParams as AnyNotification[\"params\"] },\n { method: DEV_NOTIFY, params: DevNotifyParams as AnyNotification[\"params\"] },\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,MAAa,cAAoC;CAC/C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAGA,MAAa,oBAAgD;CAC3D;EAAE,QAAQ;EAAe,QAAQ;CAAgD;CACjF;EAAE,QAAQ;EAAmB,QAAQ;CAAoD;CACzF;EAAE,QAAQ;EAAY,QAAQ;CAA6C;AAC7E"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/methods/index.ts"],"sourcesContent":["/**\n * Every host protocol method this package defines. `pnpm gen protocol-method` adds entries at the\n * markers; the method itself lives in its own module under `methods/<group>/`.\n */\nimport type { AnyMethod, AnyNotification } from \"../method.ts\";\nimport { ARTIFACT_PROGRESS, ArtifactProgressParams } from \"../verify.ts\";\nimport { artifactCreateMethod } from \"./artifact/create.ts\";\nimport { artifactExportMethod } from \"./artifact/export.ts\";\nimport { artifactGetMethod } from \"./artifact/get.ts\";\nimport { artifactImportMethod } from \"./artifact/import.ts\";\nimport { artifactListMethod } from \"./artifact/list.ts\";\nimport { artifactPauseMethod } from \"./artifact/pause.ts\";\nimport { artifactPublishMethod } from \"./artifact/publish.ts\";\nimport { artifactVerifyMethod } from \"./artifact/verify.ts\";\nimport { depsAddMethod } from \"./deps/add.ts\";\nimport { DEV_NOTIFY, DevNotifyParams, devStartMethod } from \"./dev/start.ts\";\nimport { devStopMethod } from \"./dev/stop.ts\";\nimport { eventsAckMethod } from \"./events/ack.ts\";\nimport { eventsReadMethod } from \"./events/read.ts\";\nimport { EVENTS_NOTIFY, EventsNotifyParams, eventsSubscribeMethod } from \"./events/subscribe.ts\";\nimport { eventsUnsubscribeMethod } from \"./events/unsubscribe.ts\";\nimport { gcRunMethod } from \"./gc/run.ts\";\nimport { hostedPushMethod } from \"./hosted/push.ts\";\nimport { hostedSubmissionMethod } from \"./hosted/submission.ts\";\nimport { instanceCheckMethod } from \"./instance/check.ts\";\nimport { instanceStatusMethod } from \"./instance/status.ts\";\nimport { livePushMethod } from \"./live/push.ts\";\nimport { mostraInitializeMethod } from \"./mostra/initialize.ts\";\nimport { mostraShutdownMethod } from \"./mostra/shutdown.ts\";\nimport { portAddressingExternalBaseMethod } from \"./port/addressing-external-base.ts\";\nimport { portDraftsMirrorMethod } from \"./port/drafts-mirror.ts\";\nimport { portIdentityResolveMethod } from \"./port/identity-resolve.ts\";\nimport { portRelayAuthorMethod } from \"./port/relay-author.ts\";\nimport { portRelayCallMethod } from \"./port/relay-call.ts\";\nimport { portRelayCancelMethod } from \"./port/relay-cancel.ts\";\nimport { portRelayLiveMethod } from \"./port/relay-live.ts\";\nimport { portRelayReconcileMethod } from \"./port/relay-reconcile.ts\";\nimport { portRelayRunMethod } from \"./port/relay-run.ts\";\nimport { portSecretsGetMethod } from \"./port/secrets-get.ts\";\nimport { portSubmissionsDeliverMethod } from \"./port/submissions-deliver.ts\";\nimport { portTrustedControlsActivatedMethod } from \"./port/trusted-controls-activated.ts\";\nimport { portTrustedControlsPolicyMethod } from \"./port/trusted-controls-policy.ts\";\nimport { relayCallBatchMethod } from \"./relay/call-batch.ts\";\nimport { relayEffectMethod } from \"./relay/effect.ts\";\nimport { relayLiveValueMethod } from \"./relay/live-value.ts\";\nimport { relayRunUpdateMethod } from \"./relay/run-update.ts\";\nimport { remoteLinkMethod } from \"./remote/link.ts\";\nimport { remoteLoginMethod } from \"./remote/login.ts\";\nimport { remoteLoginWaitMethod } from \"./remote/login-wait.ts\";\nimport { remoteLogoutMethod } from \"./remote/logout.ts\";\nimport { remoteStatusMethod } from \"./remote/status.ts\";\nimport { remoteTokenMethod } from \"./remote/token.ts\";\nimport { resultsGetMethod } from \"./results/get.ts\";\nimport { resultsListMethod } from \"./results/list.ts\";\nimport { rosterAddMethod } from \"./roster/add.ts\";\nimport { rosterGetMethod } from \"./roster/get.ts\";\nimport { rosterRemoveMethod } from \"./roster/remove.ts\";\nimport { secretDeleteMethod } from \"./secret/delete.ts\";\nimport { secretListMethod } from \"./secret/list.ts\";\nimport { secretSetMethod } from \"./secret/set.ts\";\nimport { shareListMethod } from \"./share/list.ts\";\nimport { shareStartMethod } from \"./share/start.ts\";\nimport { shareStopMethod } from \"./share/stop.ts\";\nimport { stateGetMethod } from \"./state/get.ts\";\nimport { statePatchMethod } from \"./state/patch.ts\";\nimport { viewDefaultMethod } from \"./view/default.ts\";\nimport { viewLaunchMethod } from \"./view/launch.ts\";\nimport { viewRevokeMethod } from \"./view/revoke.ts\";\nimport { viewRotateMethod } from \"./view/rotate.ts\";\nimport { viewUrlMethod } from \"./view/url.ts\";\nimport { waitMethod } from \"./wait/wait.ts\";\n// gen:method-imports\n\n/** Every host protocol method, in the order they were added. */\nexport const hostMethods: readonly AnyMethod[] = [\n mostraInitializeMethod,\n mostraShutdownMethod,\n instanceStatusMethod,\n artifactCreateMethod,\n artifactPublishMethod,\n artifactListMethod,\n artifactGetMethod,\n depsAddMethod,\n viewUrlMethod,\n viewRevokeMethod,\n viewRotateMethod,\n stateGetMethod,\n resultsGetMethod,\n waitMethod,\n eventsReadMethod,\n eventsSubscribeMethod,\n eventsUnsubscribeMethod,\n statePatchMethod,\n eventsAckMethod,\n portSubmissionsDeliverMethod,\n portDraftsMirrorMethod,\n portTrustedControlsPolicyMethod,\n portTrustedControlsActivatedMethod,\n secretSetMethod,\n secretListMethod,\n secretDeleteMethod,\n livePushMethod,\n portSecretsGetMethod,\n artifactVerifyMethod,\n viewDefaultMethod,\n viewLaunchMethod,\n gcRunMethod,\n instanceCheckMethod,\n devStartMethod,\n devStopMethod,\n portIdentityResolveMethod,\n shareStartMethod,\n shareStopMethod,\n shareListMethod,\n portAddressingExternalBaseMethod,\n artifactExportMethod,\n artifactImportMethod,\n remoteLoginMethod,\n remoteLoginWaitMethod,\n remoteLogoutMethod,\n remoteStatusMethod,\n remoteTokenMethod,\n hostedPushMethod,\n portRelayRunMethod,\n portRelayCancelMethod,\n portRelayReconcileMethod,\n portRelayCallMethod,\n relayRunUpdateMethod,\n relayCallBatchMethod,\n relayEffectMethod,\n portRelayLiveMethod,\n relayLiveValueMethod,\n hostedSubmissionMethod,\n artifactPauseMethod,\n portRelayAuthorMethod,\n remoteLinkMethod,\n rosterAddMethod,\n rosterRemoveMethod,\n rosterGetMethod,\n resultsListMethod,\n // gen:methods\n];\n\n/** Every notification the instance sends to its clients (INTERFACES §6). */\nexport const hostNotifications: readonly AnyNotification[] = [\n { method: EVENTS_NOTIFY, params: EventsNotifyParams as AnyNotification[\"params\"] },\n { method: ARTIFACT_PROGRESS, params: ArtifactProgressParams as AnyNotification[\"params\"] },\n { method: DEV_NOTIFY, params: DevNotifyParams as AnyNotification[\"params\"] },\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAa,cAAoC;CAC/C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAGA,MAAa,oBAAgD;CAC3D;EAAE,QAAQ;EAAe,QAAQ;CAAgD;CACjF;EAAE,QAAQ;EAAmB,QAAQ;CAAoD;CACzF;EAAE,QAAQ;EAAY,QAAQ;CAA6C;AAC7E"}
@@ -1,6 +1,6 @@
1
- import { ArtifactSummary } from "../../artifact.js";
2
1
  import { ControlsPolicy } from "../../view.js";
3
2
  import "../../interaction.js";
3
+ import { ArtifactSummary } from "../../artifact.js";
4
4
  import { MethodDefinition } from "../../method.js";
5
5
  //#region src/methods/port/trusted-controls-policy.d.ts
6
6
  /** The params of `port/trustedControls.policy` (INTERFACES §7). */
@@ -1,5 +1,5 @@
1
- import { ArtifactRef } from "../../artifact.js";
2
1
  import { Results } from "../../interaction.js";
2
+ import { ArtifactRef } from "../../artifact.js";
3
3
  import { MethodDefinition } from "../../method.js";
4
4
  import * as z from "zod";
5
5
  //#region src/methods/results/get.d.ts
@@ -23,6 +23,8 @@ export interface ResultsMarkdown {
23
23
  export type ResultsGetResult = Results | ResultsMarkdown;
24
24
  /** The Zod schema of the `ResultsMarkdown` type. */
25
25
  export declare const ResultsMarkdown: z.ZodType<ResultsMarkdown>;
26
+ /** The Zod schema of the `ResultsGetResult` type. */
27
+ export declare const ResultsGetResult: z.ZodType<ResultsGetResult>;
26
28
  /**
27
29
  * `results/get`: the complete submission (INTERFACES §8), as JSON or as Markdown. Fails with
28
30
  * `MOSTRA_SUBMIT_NOT_FOUND` when the artifact has no such submission yet.
@@ -1 +1 @@
1
- {"version":3,"file":"get.d.ts","names":[],"sources":["../../../src/methods/results/get.ts"],"mappings":";;;;;;iBAQiB;;WAEN,UAAU;;WAEV;;WAEA;;;iBAIM;;WAEN;;WAEA;;;YAIC,mBAAmB,UAAU;;qBAW5B,iBAAiB,EAAE,QAAQ;;;;;qBAe3B,kBAAkB,iBAAiB,kBAAkB"}
1
+ {"version":3,"file":"get.d.ts","names":[],"sources":["../../../src/methods/results/get.ts"],"mappings":";;;;;;iBAQiB;;WAEN,UAAU;;WAEV;;WAEA;;;iBAIM;;WAEN;;WAEA;;;YAIC,mBAAmB,UAAU;;qBAW5B,iBAAiB,EAAE,QAAQ;;qBAQ3B,kBAAkB,EAAE,QAAQ;;;;;qBAQ5B,kBAAkB,iBAAiB,kBAAkB"}
@@ -18,7 +18,8 @@ const ResultsMarkdown = z.object({
18
18
  id: "ResultsMarkdown",
19
19
  description: "A submission's results as Markdown for agents."
20
20
  });
21
- const result = z.union([Results, ResultsMarkdown]).register(wireRegistry, { id: "ResultsGetResult" });
21
+ /** The Zod schema of the `ResultsGetResult` type. */
22
+ const ResultsGetResult = z.union([Results, ResultsMarkdown]).register(wireRegistry, { id: "ResultsGetResult" });
22
23
  /**
23
24
  * `results/get`: the complete submission (INTERFACES §8), as JSON or as Markdown. Fails with
24
25
  * `MOSTRA_SUBMIT_NOT_FOUND` when the artifact has no such submission yet.
@@ -28,9 +29,9 @@ const resultsGetMethod = defineMethod({
28
29
  direction: "client-to-instance",
29
30
  mutating: false,
30
31
  params,
31
- result
32
+ result: ResultsGetResult
32
33
  });
33
34
  //#endregion
34
- export { ResultsMarkdown, resultsGetMethod };
35
+ export { ResultsGetResult, ResultsMarkdown, resultsGetMethod };
35
36
 
36
37
  //# sourceMappingURL=get.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get.js","names":[],"sources":["../../../src/methods/results/get.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { SubmissionId } from \"../../ids.ts\";\nimport { Results } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `results/get` (INTERFACES §6, §8). */\nexport interface ResultsGetParams {\n /** The artifact whose submission to read. */\n readonly artifact: ArtifactRef;\n /** The submission to read; absent: the artifact's latest. */\n readonly submission?: string;\n /** `json` (the default): the Results structure; `md`: Markdown for agents to read. */\n readonly format?: \"json\" | \"md\";\n}\n\n/** Results rendered as Markdown (ROUND-2 §1.1). */\nexport interface ResultsMarkdown {\n /** The submission rendered. */\n readonly submissionId: string;\n /** The Markdown: a header with IDs, answers by label, choices, comments, actions, signals, orphans. */\n readonly markdown: string;\n}\n\n/** The result of `results/get`: the Results structure, or its Markdown for `format: \"md\"`. */\nexport type ResultsGetResult = Results | ResultsMarkdown;\n\nconst params: z.ZodType<ResultsGetParams> = z\n .object({\n artifact: ArtifactRef,\n submission: SubmissionId.schema.exactOptional(),\n format: z.enum([\"json\", \"md\"]).exactOptional(),\n })\n .register(wireRegistry, { id: \"ResultsGetParams\" });\n\n/** The Zod schema of the `ResultsMarkdown` type. */\nexport const ResultsMarkdown: z.ZodType<ResultsMarkdown> = z\n .object({ submissionId: SubmissionId.schema, markdown: z.string() })\n .register(wireRegistry, {\n id: \"ResultsMarkdown\",\n description: \"A submission's results as Markdown for agents.\",\n });\n\nconst result: z.ZodType<ResultsGetResult> = z\n .union([Results, ResultsMarkdown])\n .register(wireRegistry, { id: \"ResultsGetResult\" });\n\n/**\n * `results/get`: the complete submission (INTERFACES §8), as JSON or as Markdown. Fails with\n * `MOSTRA_SUBMIT_NOT_FOUND` when the artifact has no such submission yet.\n */\nexport const resultsGetMethod: MethodDefinition<ResultsGetParams, ResultsGetResult> = defineMethod({\n method: \"results/get\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n});\n"],"mappings":";;;;;;;AA4BA,MAAM,SAAsC,EACzC,OAAO;CACN,UAAU;CACV,YAAY,aAAa,OAAO,cAAc;CAC9C,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,cAAc;AAC/C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;;AAGpD,MAAa,kBAA8C,EACxD,OAAO;CAAE,cAAc,aAAa;CAAQ,UAAU,EAAE,OAAO;AAAE,CAAC,CAAC,CACnE,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;AAEH,MAAM,SAAsC,EACzC,MAAM,CAAC,SAAS,eAAe,CAAC,CAAC,CACjC,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;;;;;AAMpD,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
1
+ {"version":3,"file":"get.js","names":[],"sources":["../../../src/methods/results/get.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { SubmissionId } from \"../../ids.ts\";\nimport { Results } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `results/get` (INTERFACES §6, §8). */\nexport interface ResultsGetParams {\n /** The artifact whose submission to read. */\n readonly artifact: ArtifactRef;\n /** The submission to read; absent: the artifact's latest. */\n readonly submission?: string;\n /** `json` (the default): the Results structure; `md`: Markdown for agents to read. */\n readonly format?: \"json\" | \"md\";\n}\n\n/** Results rendered as Markdown (ROUND-2 §1.1). */\nexport interface ResultsMarkdown {\n /** The submission rendered. */\n readonly submissionId: string;\n /** The Markdown: a header with IDs, answers by label, choices, comments, actions, signals, orphans. */\n readonly markdown: string;\n}\n\n/** The result of `results/get`: the Results structure, or its Markdown for `format: \"md\"`. */\nexport type ResultsGetResult = Results | ResultsMarkdown;\n\nconst params: z.ZodType<ResultsGetParams> = z\n .object({\n artifact: ArtifactRef,\n submission: SubmissionId.schema.exactOptional(),\n format: z.enum([\"json\", \"md\"]).exactOptional(),\n })\n .register(wireRegistry, { id: \"ResultsGetParams\" });\n\n/** The Zod schema of the `ResultsMarkdown` type. */\nexport const ResultsMarkdown: z.ZodType<ResultsMarkdown> = z\n .object({ submissionId: SubmissionId.schema, markdown: z.string() })\n .register(wireRegistry, {\n id: \"ResultsMarkdown\",\n description: \"A submission's results as Markdown for agents.\",\n });\n\n/** The Zod schema of the `ResultsGetResult` type. */\nexport const ResultsGetResult: z.ZodType<ResultsGetResult> = z\n .union([Results, ResultsMarkdown])\n .register(wireRegistry, { id: \"ResultsGetResult\" });\n\n/**\n * `results/get`: the complete submission (INTERFACES §8), as JSON or as Markdown. Fails with\n * `MOSTRA_SUBMIT_NOT_FOUND` when the artifact has no such submission yet.\n */\nexport const resultsGetMethod: MethodDefinition<ResultsGetParams, ResultsGetResult> = defineMethod({\n method: \"results/get\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result: ResultsGetResult,\n});\n"],"mappings":";;;;;;;AA4BA,MAAM,SAAsC,EACzC,OAAO;CACN,UAAU;CACV,YAAY,aAAa,OAAO,cAAc;CAC9C,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,cAAc;AAC/C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;;AAGpD,MAAa,kBAA8C,EACxD,OAAO;CAAE,cAAc,aAAa;CAAQ,UAAU,EAAE,OAAO;AAAE,CAAC,CAAC,CACnE,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;AAGH,MAAa,mBAAgD,EAC1D,MAAM,CAAC,SAAS,eAAe,CAAC,CAAC,CACjC,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;;;;;AAMpD,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA,QAAQ;AACV,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { ArtifactRef } from "../../artifact.js";
2
+ import { MethodDefinition } from "../../method.js";
3
+ import { ResultsGetResult } from "./get.js";
4
+ //#region src/methods/results/list.d.ts
5
+ /** The most submissions one `results/list` answer carries. */
6
+ export declare const RESULTS_LIST_MAX = 100;
7
+ /** The params of `results/list` (INTERFACES §6, §8, D168). */
8
+ export interface ResultsListParams {
9
+ /** The artifact whose submissions to read. */
10
+ readonly artifact: ArtifactRef;
11
+ /** Only submissions made after this cursor; absent: from the first. */
12
+ readonly after?: string;
13
+ /** At most this many, oldest first (1 to 100, default 100). */
14
+ readonly limit?: number;
15
+ /** `json` (the default): the Results structure of each; `md`: each as Markdown. */
16
+ readonly format?: "json" | "md";
17
+ }
18
+ /** The result of `results/list`. */
19
+ export interface ResultsListResult {
20
+ /** The submissions, oldest first, each as `results/get` gives it. */
21
+ readonly results: readonly ResultsGetResult[];
22
+ /** The cursor to read on from: the last submission's, or `after` when none came. */
23
+ readonly cursor: string;
24
+ /** Whether more submissions follow the cursor. */
25
+ readonly more: boolean;
26
+ }
27
+ /**
28
+ * `results/list`: every submission of an artifact after a cursor, oldest first, as `results/get`
29
+ * gives each (J14: all five answers once the roster completed). Page on with `cursor` while `more`.
30
+ */
31
+ export declare const resultsListMethod: MethodDefinition<ResultsListParams, ResultsListResult>;
32
+ //#endregion
33
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","names":[],"sources":["../../../src/methods/results/list.ts"],"mappings":";;;;;qBAQa;;iBAGI;;WAEN,UAAU;;WAEV;;WAEA;;WAEA;;;iBAIM;;WAEN,kBAAkB;;WAElB;;WAEA;;;;;;qBAwBE,mBAAmB,iBAAiB,mBAAmB"}
@@ -0,0 +1,35 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { Cursor } from "../../ids.js";
3
+ import { ArtifactRef } from "../../artifact.js";
4
+ import { defineMethod } from "../../method.js";
5
+ import { ResultsGetResult } from "./get.js";
6
+ import * as z from "zod";
7
+ //#region src/methods/results/list.ts
8
+ /** The most submissions one `results/list` answer carries. */
9
+ const RESULTS_LIST_MAX = 100;
10
+ const params = z.object({
11
+ artifact: ArtifactRef,
12
+ after: Cursor.schema.exactOptional(),
13
+ limit: z.int().min(1).max(100).exactOptional(),
14
+ format: z.enum(["json", "md"]).exactOptional()
15
+ }).register(wireRegistry, { id: "ResultsListParams" });
16
+ const result = z.object({
17
+ results: z.array(ResultsGetResult).readonly(),
18
+ cursor: Cursor.schema,
19
+ more: z.boolean()
20
+ }).register(wireRegistry, { id: "ResultsListResult" });
21
+ /**
22
+ * `results/list`: every submission of an artifact after a cursor, oldest first, as `results/get`
23
+ * gives each (J14: all five answers once the roster completed). Page on with `cursor` while `more`.
24
+ */
25
+ const resultsListMethod = defineMethod({
26
+ method: "results/list",
27
+ direction: "client-to-instance",
28
+ mutating: false,
29
+ params,
30
+ result
31
+ });
32
+ //#endregion
33
+ export { RESULTS_LIST_MAX, resultsListMethod };
34
+
35
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","names":["ResultsGetResultSchema"],"sources":["../../../src/methods/results/list.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { Cursor } from \"../../ids.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\nimport { type ResultsGetResult, ResultsGetResult as ResultsGetResultSchema } from \"./get.ts\";\n\n/** The most submissions one `results/list` answer carries. */\nexport const RESULTS_LIST_MAX = 100;\n\n/** The params of `results/list` (INTERFACES §6, §8, D168). */\nexport interface ResultsListParams {\n /** The artifact whose submissions to read. */\n readonly artifact: ArtifactRef;\n /** Only submissions made after this cursor; absent: from the first. */\n readonly after?: string;\n /** At most this many, oldest first (1 to 100, default 100). */\n readonly limit?: number;\n /** `json` (the default): the Results structure of each; `md`: each as Markdown. */\n readonly format?: \"json\" | \"md\";\n}\n\n/** The result of `results/list`. */\nexport interface ResultsListResult {\n /** The submissions, oldest first, each as `results/get` gives it. */\n readonly results: readonly ResultsGetResult[];\n /** The cursor to read on from: the last submission's, or `after` when none came. */\n readonly cursor: string;\n /** Whether more submissions follow the cursor. */\n readonly more: boolean;\n}\n\nconst params: z.ZodType<ResultsListParams> = z\n .object({\n artifact: ArtifactRef,\n after: Cursor.schema.exactOptional(),\n limit: z.int().min(1).max(RESULTS_LIST_MAX).exactOptional(),\n format: z.enum([\"json\", \"md\"]).exactOptional(),\n })\n .register(wireRegistry, { id: \"ResultsListParams\" });\n\nconst result: z.ZodType<ResultsListResult> = z\n .object({\n results: z.array(ResultsGetResultSchema).readonly(),\n cursor: Cursor.schema,\n more: z.boolean(),\n })\n .register(wireRegistry, { id: \"ResultsListResult\" });\n\n/**\n * `results/list`: every submission of an artifact after a cursor, oldest first, as `results/get`\n * gives each (J14: all five answers once the roster completed). Page on with `cursor` while `more`.\n */\nexport const resultsListMethod: MethodDefinition<ResultsListParams, ResultsListResult> =\n defineMethod({\n method: \"results/list\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n });\n"],"mappings":";;;;;;;;AAQA,MAAa,mBAAmB;AAwBhC,MAAM,SAAuC,EAC1C,OAAO;CACN,UAAU;CACV,OAAO,OAAO,OAAO,cAAc;CACnC,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,GAAoB,CAAC,CAAC,cAAc;CAC1D,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,cAAc;AAC/C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,oBAAoB,CAAC;AAErD,MAAM,SAAuC,EAC1C,OAAO;CACN,SAAS,EAAE,MAAMA,gBAAsB,CAAC,CAAC,SAAS;CAClD,QAAQ,OAAO;CACf,MAAM,EAAE,QAAQ;AAClB,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,oBAAoB,CAAC;;;;;AAMrD,MAAa,oBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { Duration } from "../../duration.js";
2
+ import { RespondentSpec, Roster } from "../../team.js";
3
+ import { ArtifactRef } from "../../artifact.js";
4
+ import { CapabilityScope } from "../../capability.js";
5
+ import { MethodDefinition } from "../../method.js";
6
+ import { CapabilityLink } from "../view/url.js";
7
+ import * as z from "zod";
8
+ //#region src/methods/roster/add.d.ts
9
+ /** The params of `roster/add` (INTERFACES §6, D121, D168). */
10
+ export interface RosterAddParams {
11
+ /** The artifact the people are expected to answer. */
12
+ readonly artifact: ArtifactRef;
13
+ /** The people expected to answer, by the host's stable key (D104); one already there is kept. */
14
+ readonly respondents: readonly RespondentSpec[];
15
+ /** What a new personal link allows (D97). Default: every scope. */
16
+ readonly scopes?: readonly CapabilityScope[];
17
+ /** How long a new personal link works. Default: until it is revoked (D63). */
18
+ readonly ttl?: Duration;
19
+ /** The version a new personal link opens, by number or ID; absent: the latest, always. */
20
+ readonly version?: number | string;
21
+ /** Makes retries idempotent (H-03). */
22
+ readonly requestId?: string;
23
+ }
24
+ /** A respondent's personal link (CO-01). */
25
+ export interface RespondentLink {
26
+ /** The respondent it is for. */
27
+ readonly ref: string;
28
+ /** Their link: it acts as their viewer (D104). Holding it is the authorization (D06). */
29
+ readonly link: CapabilityLink;
30
+ }
31
+ /** The Zod schema of the `RespondentLink` type. */
32
+ export declare const RespondentLink: z.ZodType<RespondentLink>;
33
+ /** The result of `roster/add`. */
34
+ export interface RosterAddResult {
35
+ /** The roster after the change. */
36
+ readonly roster: Roster;
37
+ /** The personal link of every respondent named, in the order given. */
38
+ readonly links: readonly RespondentLink[];
39
+ }
40
+ /**
41
+ * `roster/add`: names people an artifact expects answers from and gives each a personal link that
42
+ * acts as their viewer (CO-01). Idempotent by `ref`: a respondent already there keeps their link
43
+ * (a revoked one is replaced), and a name given again replaces theirs. Appends `roster.changed`.
44
+ */
45
+ export declare const rosterAddMethod: MethodDefinition<RosterAddParams, RosterAddResult>;
46
+ //#endregion
47
+ //# sourceMappingURL=add.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.d.ts","names":[],"sources":["../../../src/methods/roster/add.ts"],"mappings":";;;;;;;;;iBAWiB;;WAEN,UAAU;;WAEV,sBAAsB;;WAEtB,kBAAkB;;WAElB,MAAM;;WAEN;;WAEA;;;iBAIM;;WAEN;;WAEA,MAAM;;;qBAIJ,gBAAgB,EAAE,QAAQ;;iBAQtB;;WAEN,QAAQ;;WAER,gBAAgB;;;;;;;qBAuBd,iBAAiB,iBAAiB,iBAAiB"}
@@ -0,0 +1,46 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { VersionId } from "../../ids.js";
3
+ import { Duration } from "../../duration.js";
4
+ import { ArtifactRef } from "../../artifact.js";
5
+ import { CapabilityScope } from "../../capability.js";
6
+ import { defineMethod } from "../../method.js";
7
+ import { ROSTER_MAX, RespondentSpec, Roster } from "../../team.js";
8
+ import { CapabilityLink } from "../view/url.js";
9
+ import * as z from "zod";
10
+ //#region src/methods/roster/add.ts
11
+ /** The Zod schema of the `RespondentLink` type. */
12
+ const RespondentLink = z.object({
13
+ ref: z.string(),
14
+ link: CapabilityLink
15
+ }).register(wireRegistry, {
16
+ id: "RespondentLink",
17
+ description: "An expected respondent's personal link, acting as their viewer."
18
+ });
19
+ const params = z.object({
20
+ artifact: ArtifactRef,
21
+ respondents: z.array(RespondentSpec).min(1).max(ROSTER_MAX).readonly(),
22
+ scopes: z.array(CapabilityScope).min(1).readonly().exactOptional(),
23
+ ttl: Duration.exactOptional(),
24
+ version: z.union([z.int().min(1), VersionId.schema]).exactOptional(),
25
+ requestId: z.string().min(1).exactOptional()
26
+ }).register(wireRegistry, { id: "RosterAddParams" });
27
+ const result = z.object({
28
+ roster: Roster,
29
+ links: z.array(RespondentLink).readonly()
30
+ }).register(wireRegistry, { id: "RosterAddResult" });
31
+ /**
32
+ * `roster/add`: names people an artifact expects answers from and gives each a personal link that
33
+ * acts as their viewer (CO-01). Idempotent by `ref`: a respondent already there keeps their link
34
+ * (a revoked one is replaced), and a name given again replaces theirs. Appends `roster.changed`.
35
+ */
36
+ const rosterAddMethod = defineMethod({
37
+ method: "roster/add",
38
+ direction: "client-to-instance",
39
+ mutating: true,
40
+ params,
41
+ result
42
+ });
43
+ //#endregion
44
+ export { RespondentLink, rosterAddMethod };
45
+
46
+ //# sourceMappingURL=add.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.js","names":[],"sources":["../../../src/methods/roster/add.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { CapabilityScope } from \"../../capability.ts\";\nimport { Duration } from \"../../duration.ts\";\nimport { VersionId } from \"../../ids.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { RespondentSpec, ROSTER_MAX, Roster } from \"../../team.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\nimport { CapabilityLink } from \"../view/url.ts\";\n\n/** The params of `roster/add` (INTERFACES §6, D121, D168). */\nexport interface RosterAddParams {\n /** The artifact the people are expected to answer. */\n readonly artifact: ArtifactRef;\n /** The people expected to answer, by the host's stable key (D104); one already there is kept. */\n readonly respondents: readonly RespondentSpec[];\n /** What a new personal link allows (D97). Default: every scope. */\n readonly scopes?: readonly CapabilityScope[];\n /** How long a new personal link works. Default: until it is revoked (D63). */\n readonly ttl?: Duration;\n /** The version a new personal link opens, by number or ID; absent: the latest, always. */\n readonly version?: number | string;\n /** Makes retries idempotent (H-03). */\n readonly requestId?: string;\n}\n\n/** A respondent's personal link (CO-01). */\nexport interface RespondentLink {\n /** The respondent it is for. */\n readonly ref: string;\n /** Their link: it acts as their viewer (D104). Holding it is the authorization (D06). */\n readonly link: CapabilityLink;\n}\n\n/** The Zod schema of the `RespondentLink` type. */\nexport const RespondentLink: z.ZodType<RespondentLink> = z\n .object({ ref: z.string(), link: CapabilityLink })\n .register(wireRegistry, {\n id: \"RespondentLink\",\n description: \"An expected respondent's personal link, acting as their viewer.\",\n });\n\n/** The result of `roster/add`. */\nexport interface RosterAddResult {\n /** The roster after the change. */\n readonly roster: Roster;\n /** The personal link of every respondent named, in the order given. */\n readonly links: readonly RespondentLink[];\n}\n\nconst params: z.ZodType<RosterAddParams> = z\n .object({\n artifact: ArtifactRef,\n respondents: z.array(RespondentSpec).min(1).max(ROSTER_MAX).readonly(),\n scopes: z.array(CapabilityScope).min(1).readonly().exactOptional(),\n ttl: Duration.exactOptional(),\n version: z.union([z.int().min(1), VersionId.schema]).exactOptional(),\n requestId: z.string().min(1).exactOptional(),\n })\n .register(wireRegistry, { id: \"RosterAddParams\" });\n\nconst result: z.ZodType<RosterAddResult> = z\n .object({ roster: Roster, links: z.array(RespondentLink).readonly() })\n .register(wireRegistry, { id: \"RosterAddResult\" });\n\n/**\n * `roster/add`: names people an artifact expects answers from and gives each a personal link that\n * acts as their viewer (CO-01). Idempotent by `ref`: a respondent already there keeps their link\n * (a revoked one is replaced), and a name given again replaces theirs. Appends `roster.changed`.\n */\nexport const rosterAddMethod: MethodDefinition<RosterAddParams, RosterAddResult> = defineMethod({\n method: \"roster/add\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result,\n});\n"],"mappings":";;;;;;;;;;;AAmCA,MAAa,iBAA4C,EACtD,OAAO;CAAE,KAAK,EAAE,OAAO;CAAG,MAAM;AAAe,CAAC,CAAC,CACjD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;AAUH,MAAM,SAAqC,EACxC,OAAO;CACN,UAAU;CACV,aAAa,EAAE,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,SAAS;CACrE,QAAQ,EAAE,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc;CACjE,KAAK,SAAS,cAAc;CAC5B,SAAS,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,UAAU,MAAM,CAAC,CAAC,CAAC,cAAc;CACnE,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;AAC7C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,kBAAkB,CAAC;AAEnD,MAAM,SAAqC,EACxC,OAAO;CAAE,QAAQ;CAAQ,OAAO,EAAE,MAAM,cAAc,CAAC,CAAC,SAAS;AAAE,CAAC,CAAC,CACrE,SAAS,cAAc,EAAE,IAAI,kBAAkB,CAAC;;;;;;AAOnD,MAAa,kBAAsE,aAAa;CAC9F,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { Roster } from "../../team.js";
2
+ import { ArtifactRef } from "../../artifact.js";
3
+ import { MethodDefinition } from "../../method.js";
4
+ //#region src/methods/roster/get.d.ts
5
+ /** The params of `roster/get` (INTERFACES §6, D168). */
6
+ export interface RosterGetParams {
7
+ /** The artifact. */
8
+ readonly artifact: ArtifactRef;
9
+ }
10
+ /** The result of `roster/get`: the whole roster, whatever the visibility policy (CO-07). */
11
+ export type RosterGetResult = Roster;
12
+ /**
13
+ * `roster/get`: every expected respondent with their status in the current round (CO-03), the
14
+ * round, whether it is complete and its counts. Agents and hosts always read all of it (CO-07).
15
+ */
16
+ export declare const rosterGetMethod: MethodDefinition<RosterGetParams, RosterGetResult>;
17
+ //#endregion
18
+ //# sourceMappingURL=get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.d.ts","names":[],"sources":["../../../src/methods/roster/get.ts"],"mappings":";;;;;iBAOiB;;WAEN,UAAU;;;YAIT,kBAAkB;;;;;qBAUjB,iBAAiB,iBAAiB,iBAAiB"}
@@ -0,0 +1,22 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { ArtifactRef } from "../../artifact.js";
3
+ import { defineMethod } from "../../method.js";
4
+ import { Roster } from "../../team.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/roster/get.ts
7
+ const params = z.object({ artifact: ArtifactRef }).register(wireRegistry, { id: "RosterGetParams" });
8
+ /**
9
+ * `roster/get`: every expected respondent with their status in the current round (CO-03), the
10
+ * round, whether it is complete and its counts. Agents and hosts always read all of it (CO-07).
11
+ */
12
+ const rosterGetMethod = defineMethod({
13
+ method: "roster/get",
14
+ direction: "client-to-instance",
15
+ mutating: false,
16
+ params,
17
+ result: Roster
18
+ });
19
+ //#endregion
20
+ export { rosterGetMethod };
21
+
22
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","names":[],"sources":["../../../src/methods/roster/get.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { Roster } from \"../../team.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `roster/get` (INTERFACES §6, D168). */\nexport interface RosterGetParams {\n /** The artifact. */\n readonly artifact: ArtifactRef;\n}\n\n/** The result of `roster/get`: the whole roster, whatever the visibility policy (CO-07). */\nexport type RosterGetResult = Roster;\n\nconst params: z.ZodType<RosterGetParams> = z\n .object({ artifact: ArtifactRef })\n .register(wireRegistry, { id: \"RosterGetParams\" });\n\n/**\n * `roster/get`: every expected respondent with their status in the current round (CO-03), the\n * round, whether it is complete and its counts. Agents and hosts always read all of it (CO-07).\n */\nexport const rosterGetMethod: MethodDefinition<RosterGetParams, RosterGetResult> = defineMethod({\n method: \"roster/get\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result: Roster,\n});\n"],"mappings":";;;;;;AAeA,MAAM,SAAqC,EACxC,OAAO,EAAE,UAAU,YAAY,CAAC,CAAC,CACjC,SAAS,cAAc,EAAE,IAAI,kBAAkB,CAAC;;;;;AAMnD,MAAa,kBAAsE,aAAa;CAC9F,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA,QAAQ;AACV,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { Roster } from "../../team.js";
2
+ import { ArtifactRef } from "../../artifact.js";
3
+ import { MethodDefinition } from "../../method.js";
4
+ //#region src/methods/roster/remove.d.ts
5
+ /** The params of `roster/remove` (INTERFACES §6, D168). */
6
+ export interface RosterRemoveParams {
7
+ /** The artifact. */
8
+ readonly artifact: ArtifactRef;
9
+ /** The respondents no longer expected, by `ref`; unknown ones are ignored. */
10
+ readonly refs: readonly string[];
11
+ /** Makes retries idempotent (H-03). */
12
+ readonly requestId?: string;
13
+ }
14
+ /** The result of `roster/remove`. */
15
+ export interface RosterRemoveResult {
16
+ /** The roster after the change. */
17
+ readonly roster: Roster;
18
+ /** The refs that were on the roster and left it. */
19
+ readonly removed: readonly string[];
20
+ }
21
+ /**
22
+ * `roster/remove`: stops expecting answers from people (D168). Their personal links keep working
23
+ * until revoked (`view/revoke`), and their drafts and submissions stay. Appends `roster.changed`,
24
+ * and `roster.completed` when everyone still expected has answered.
25
+ */
26
+ export declare const rosterRemoveMethod: MethodDefinition<RosterRemoveParams, RosterRemoveResult>;
27
+ //#endregion
28
+ //# sourceMappingURL=remove.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.d.ts","names":[],"sources":["../../../src/methods/roster/remove.ts"],"mappings":";;;;;iBAOiB;;WAEN,UAAU;;WAEV;;WAEA;;;iBAIM;;WAEN,QAAQ;;WAER;;;;;;;qBAoBE,oBAAoB,iBAAiB,oBAAoB"}
@@ -0,0 +1,31 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { ArtifactRef } from "../../artifact.js";
3
+ import { defineMethod } from "../../method.js";
4
+ import { ROSTER_MAX, Roster } from "../../team.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/roster/remove.ts
7
+ const params = z.object({
8
+ artifact: ArtifactRef,
9
+ refs: z.array(z.string().min(1).max(256)).min(1).max(ROSTER_MAX).readonly(),
10
+ requestId: z.string().min(1).exactOptional()
11
+ }).register(wireRegistry, { id: "RosterRemoveParams" });
12
+ const result = z.object({
13
+ roster: Roster,
14
+ removed: z.array(z.string()).readonly()
15
+ }).register(wireRegistry, { id: "RosterRemoveResult" });
16
+ /**
17
+ * `roster/remove`: stops expecting answers from people (D168). Their personal links keep working
18
+ * until revoked (`view/revoke`), and their drafts and submissions stay. Appends `roster.changed`,
19
+ * and `roster.completed` when everyone still expected has answered.
20
+ */
21
+ const rosterRemoveMethod = defineMethod({
22
+ method: "roster/remove",
23
+ direction: "client-to-instance",
24
+ mutating: true,
25
+ params,
26
+ result
27
+ });
28
+ //#endregion
29
+ export { rosterRemoveMethod };
30
+
31
+ //# sourceMappingURL=remove.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.js","names":[],"sources":["../../../src/methods/roster/remove.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { ROSTER_MAX, Roster } from \"../../team.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `roster/remove` (INTERFACES §6, D168). */\nexport interface RosterRemoveParams {\n /** The artifact. */\n readonly artifact: ArtifactRef;\n /** The respondents no longer expected, by `ref`; unknown ones are ignored. */\n readonly refs: readonly string[];\n /** Makes retries idempotent (H-03). */\n readonly requestId?: string;\n}\n\n/** The result of `roster/remove`. */\nexport interface RosterRemoveResult {\n /** The roster after the change. */\n readonly roster: Roster;\n /** The refs that were on the roster and left it. */\n readonly removed: readonly string[];\n}\n\nconst params: z.ZodType<RosterRemoveParams> = z\n .object({\n artifact: ArtifactRef,\n refs: z.array(z.string().min(1).max(256)).min(1).max(ROSTER_MAX).readonly(),\n requestId: z.string().min(1).exactOptional(),\n })\n .register(wireRegistry, { id: \"RosterRemoveParams\" });\n\nconst result: z.ZodType<RosterRemoveResult> = z\n .object({ roster: Roster, removed: z.array(z.string()).readonly() })\n .register(wireRegistry, { id: \"RosterRemoveResult\" });\n\n/**\n * `roster/remove`: stops expecting answers from people (D168). Their personal links keep working\n * until revoked (`view/revoke`), and their drafts and submissions stay. Appends `roster.changed`,\n * and `roster.completed` when everyone still expected has answered.\n */\nexport const rosterRemoveMethod: MethodDefinition<RosterRemoveParams, RosterRemoveResult> =\n defineMethod({\n method: \"roster/remove\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result,\n });\n"],"mappings":";;;;;;AAwBA,MAAM,SAAwC,EAC3C,OAAO;CACN,UAAU;CACV,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,SAAS;CAC1E,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;AAC7C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,qBAAqB,CAAC;AAEtD,MAAM,SAAwC,EAC3C,OAAO;CAAE,QAAQ;CAAQ,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS;AAAE,CAAC,CAAC,CACnE,SAAS,cAAc,EAAE,IAAI,qBAAqB,CAAC;;;;;;AAOtD,MAAa,qBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -1,8 +1,10 @@
1
1
  import { Duration } from "../../duration.js";
2
- import { ArtifactRef } from "../../artifact.js";
3
2
  import { ViewerSpec } from "../../interaction.js";
3
+ import { RespondentSpec } from "../../team.js";
4
+ import { ArtifactRef } from "../../artifact.js";
4
5
  import { CapabilityScope } from "../../capability.js";
5
6
  import { MethodDefinition } from "../../method.js";
7
+ import { RespondentLink } from "../roster/add.js";
6
8
  import * as z from "zod";
7
9
  //#region src/methods/share/start.d.ts
8
10
  /**
@@ -37,6 +39,13 @@ export interface ShareStartParams {
37
39
  * port names, else the link's own viewer, never the home's local user (D158).
38
40
  */
39
41
  readonly viewer?: ViewerSpec;
42
+ /**
43
+ * People the artifact expects answers from through this share (D121, D168): they join the
44
+ * roster of the home that holds the artifact's viewers (a remote share's hosted home), and each
45
+ * gets a personal link at the share's address. On a remote server, `email` reaches the operator's
46
+ * `invitations` port. Not with `viewer`.
47
+ */
48
+ readonly respondents?: readonly RespondentSpec[];
40
49
  /** Makes retries idempotent: a repeated `requestId` returns the same share (H-03). */
41
50
  readonly requestId?: string;
42
51
  }
@@ -84,9 +93,13 @@ export interface Share {
84
93
  }
85
94
  /** The Zod schema of the `Share` type. */
86
95
  export declare const Share: z.ZodType<Share>;
87
- /** The result of `share/start`: the share, with its link. */
96
+ /**
97
+ * The result of `share/start`: the share, with its link, and the personal link of every respondent
98
+ * it named (D168).
99
+ */
88
100
  export type ShareStartResult = Share & {
89
101
  readonly url: string;
102
+ readonly respondents?: readonly RespondentLink[];
90
103
  };
91
104
  /**
92
105
  * `share/start`: shares an artifact through a tunnel the instance drives (D158): Tailscale Serve
@@ -1 +1 @@
1
- {"version":3,"file":"start.d.ts","names":[],"sources":["../../../src/methods/share/start.ts"],"mappings":";;;;;;;;;;;;YAcY;;qBAGC,UAAU,EAAE,QAAQ;;qBASpB;;qBAGA,0BAA0B;;iBAGtB;;WAEN,UAAU;;WAEV,KAAK;;WAEL;;;;;WAKA,MAAM;;WAEN,kBAAkB;;;;;WAKlB,SAAS;;WAET;;;iBAIM;;WAEN;;WAEA;;WAEA,KAAK;;;;;WAKL;;WAEA;;;;;WAKA;;;;;WAKA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;;;;WAMA;;;qBAoBE,OAAO,EAAE,QAAQ;;YAMlB,mBAAmB;WAAmB;;;;;;;;qBA8BrC,kBAAkB,iBAAiB,kBAAkB"}
1
+ {"version":3,"file":"start.d.ts","names":[],"sources":["../../../src/methods/share/start.ts"],"mappings":";;;;;;;;;;;;;;YAgBY;;qBAGC,UAAU,EAAE,QAAQ;;qBASpB;;qBAGA,0BAA0B;;iBAGtB;;WAEN,UAAU;;WAEV,KAAK;;WAEL;;;;;WAKA,MAAM;;WAEN,kBAAkB;;;;;WAKlB,SAAS;;;;;;;WAOT,uBAAuB;;WAEvB;;;iBAIM;;WAEN;;WAEA;;WAEA,KAAK;;;;;WAKL;;WAEA;;;;;WAKA;;;;;WAKA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;;;;WAMA;;;qBAoBE,OAAO,EAAE,QAAQ;;;;;YASlB,mBAAmB;WACpB;WACA,uBAAuB;;;;;;;;qBAoCrB,kBAAkB,iBAAiB,kBAAkB"}
@@ -5,6 +5,8 @@ import { ArtifactRef } from "../../artifact.js";
5
5
  import { ViewerSpec } from "../../interaction.js";
6
6
  import { CapabilityScope } from "../../capability.js";
7
7
  import { defineMethod } from "../../method.js";
8
+ import { ROSTER_MAX, RespondentSpec } from "../../team.js";
9
+ import { RespondentLink } from "../roster/add.js";
8
10
  import * as z from "zod";
9
11
  //#region src/methods/share/start.ts
10
12
  /** The Zod schema of the `ShareVia` type. */
@@ -48,11 +50,13 @@ const params = z.object({
48
50
  ttl: Duration.exactOptional(),
49
51
  scopes: z.array(CapabilityScope).min(1).readonly().exactOptional(),
50
52
  viewer: ViewerSpec.exactOptional(),
53
+ respondents: z.array(RespondentSpec).min(1).max(ROSTER_MAX).readonly().exactOptional(),
51
54
  requestId: z.string().min(1).exactOptional()
52
55
  }).register(wireRegistry, { id: "ShareStartParams" });
53
56
  const result = z.object({
54
57
  ...shareShape,
55
- url: z.string().min(1)
58
+ url: z.string().min(1),
59
+ respondents: z.array(RespondentLink).readonly().exactOptional()
56
60
  }).register(wireRegistry, {
57
61
  id: "ShareStartResult",
58
62
  description: "The share that started, with its capability URL."
@@ -1 +1 @@
1
- {"version":3,"file":"start.js","names":[],"sources":["../../../src/methods/share/start.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { CapabilityScope } from \"../../capability.ts\";\nimport { Duration } from \"../../duration.ts\";\nimport { ArtifactId, ShareId, TokenId } from \"../../ids.ts\";\nimport { ViewerSpec } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/**\n * How a share reaches its viewers (D158): `tailnet` through Tailscale Serve, to the people of the\n * user's tailnet, who are known by name; `funnel` through Tailscale Funnel and `cloudflare`\n * through a Cloudflare quick tunnel, both public, where the link is all that admits a viewer.\n */\nexport type ShareVia = \"tailnet\" | \"funnel\" | \"cloudflare\" | \"remote\";\n\n/** The Zod schema of the `ShareVia` type. */\nexport const ShareVia: z.ZodType<ShareVia> = z\n .enum([\"tailnet\", \"funnel\", \"cloudflare\", \"remote\"])\n .register(wireRegistry, {\n id: \"ShareVia\",\n description:\n \"How a share reaches its viewers: tailnet, funnel or cloudflare, or remote: hosted on a remote server (D165).\",\n });\n\n/** The longest a public share (Funnel or Cloudflare) may last: 7 days (D158). */\nexport const PUBLIC_SHARE_MAX_TTL_MS: number = 7 * 24 * 60 * 60 * 1000;\n\n/** How long a public share lasts when its `ttl` isn't given: 1 hour (D63 item 5, D158). */\nexport const PUBLIC_SHARE_DEFAULT_TTL: Duration = \"1h\";\n\n/** The params of `share/start` (INTERFACES §6, D158). */\nexport interface ShareStartParams {\n /** The artifact to share; the link opens its latest version. */\n readonly artifact: ArtifactRef;\n /** The tunnel. A public one (`funnel`, `cloudflare`) is explicit: never a fallback. */\n readonly via: ShareVia;\n /** For `remote`: the server's API origin. Default: the home's default server (D165 item 15). */\n readonly server?: string;\n /**\n * How long the share and its link last, such as `30m` or `24h`. Public shares: 1 hour by\n * default, at most 7 days. Tailnet shares: until stopped, unless given.\n */\n readonly ttl?: Duration;\n /** What the share's link allows (D97). Default: every scope. */\n readonly scopes?: readonly CapabilityScope[];\n /**\n * The person the share's link acts for (D104). Absent: whoever the tailnet or a host's identity\n * port names, else the link's own viewer, never the home's local user (D158).\n */\n readonly viewer?: ViewerSpec;\n /** Makes retries idempotent: a repeated `requestId` returns the same share (H-03). */\n readonly requestId?: string;\n}\n\n/** A share, as `share/start` and `share/list` report it. */\nexport interface Share {\n /** The share's ID, for `share/stop`. */\n readonly shareId: string;\n /** The artifact shared. */\n readonly artifactId: string;\n /** The tunnel. */\n readonly via: ShareVia;\n /**\n * The share's capability URL, at the tunnel's address. Holding it is the authorization (D06);\n * absent once the share ended, and in `share/list` when the home's key can no longer show it.\n */\n readonly url?: string;\n /** The tunnel's host name: the tailnet device's, or the quick tunnel's random one. */\n readonly hostname: string;\n /**\n * The address the artifact's frame is served at over the tunnel, while the share is active:\n * on a tailnet, the second port of this device that viewers must be allowed to reach.\n */\n readonly artifactOrigin?: string;\n /**\n * How the artifact's frame authenticates over this tunnel (D70): `cookie` where the shell and\n * the artifact are one site (Tailscale), `worker` where they are two (Cloudflare).\n */\n readonly mode: \"cookie\" | \"worker\";\n /** The share's link, for `view/rotate` and `view/revoke`. */\n readonly tokenId: string;\n /** When the share started (RFC 3339, UTC). */\n readonly startedAt: string;\n /** When the share and its link end, if they do. */\n readonly expiresAt?: string;\n /** `active` while it serves; `stopped` once it ended. */\n readonly state: \"active\" | \"stopped\";\n /** When it ended. */\n readonly stoppedAt?: string;\n /**\n * Why it ended: `stopped` (`share/stop`), `expired` (its TTL), `tunnel` (its tunnel ended and\n * couldn't be set up again), `restart` (a quick tunnel can't outlive its instance), or\n * `revoked` (its link was revoked).\n */\n readonly stopReason?: \"stopped\" | \"expired\" | \"tunnel\" | \"restart\" | \"revoked\" | (string & {});\n}\n\nconst shareShape = {\n shareId: ShareId.schema,\n artifactId: ArtifactId.schema,\n via: ShareVia,\n url: z.string().min(1).exactOptional(),\n hostname: z.string().min(1),\n artifactOrigin: z.string().min(1).exactOptional(),\n mode: z.enum([\"cookie\", \"worker\"]),\n tokenId: TokenId.schema,\n startedAt: z.iso.datetime(),\n expiresAt: z.iso.datetime().exactOptional(),\n state: z.enum([\"active\", \"stopped\"]),\n stoppedAt: z.iso.datetime().exactOptional(),\n stopReason: z.string().min(1).exactOptional(),\n};\n\n/** The Zod schema of the `Share` type. */\nexport const Share: z.ZodType<Share> = z.object(shareShape).register(wireRegistry, {\n id: \"Share\",\n description: \"A share: its tunnel, link, address, frame mode and lifetime.\",\n});\n\n/** The result of `share/start`: the share, with its link. */\nexport type ShareStartResult = Share & { readonly url: string };\n\nconst params: z.ZodType<ShareStartParams> = z\n .object({\n artifact: ArtifactRef,\n via: ShareVia,\n server: z\n .string()\n .regex(/^https?:\\/\\/[^/?#\\s]+$/)\n .exactOptional(),\n ttl: Duration.exactOptional(),\n scopes: z.array(CapabilityScope).min(1).readonly().exactOptional(),\n viewer: ViewerSpec.exactOptional(),\n requestId: z.string().min(1).exactOptional(),\n })\n .register(wireRegistry, { id: \"ShareStartParams\" });\n\nconst result: z.ZodType<ShareStartResult> = z\n .object({ ...shareShape, url: z.string().min(1) })\n .register(wireRegistry, {\n id: \"ShareStartResult\",\n description: \"The share that started, with its capability URL.\",\n });\n\n/**\n * `share/start`: shares an artifact through a tunnel the instance drives (D158): Tailscale Serve\n * for the tailnet, or Tailscale Funnel or a Cloudflare quick tunnel for anyone with the link. It\n * answers once the tunnel serves, with a new link at the tunnel's address that works there only.\n * A missing or unready tool is a `MOSTRA_SHARE_*` diagnostic saying what to do.\n */\nexport const shareStartMethod: MethodDefinition<ShareStartParams, ShareStartResult> = defineMethod({\n method: \"share/start\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result,\n});\n"],"mappings":";;;;;;;;;;AAiBA,MAAa,WAAgC,EAC1C,KAAK;CAAC;CAAW;CAAU;CAAc;AAAQ,CAAC,CAAC,CACnD,SAAS,cAAc;CACtB,IAAI;CACJ,aACE;AACJ,CAAC;;AAGH,MAAa,0BAAkC;;AAG/C,MAAa,2BAAqC;AAqElD,MAAM,aAAa;CACjB,SAAS,QAAQ;CACjB,YAAY,WAAW;CACvB,KAAK;CACL,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;CACrC,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAC1B,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;CAChD,MAAM,EAAE,KAAK,CAAC,UAAU,QAAQ,CAAC;CACjC,SAAS,QAAQ;CACjB,WAAW,EAAE,IAAI,SAAS;CAC1B,WAAW,EAAE,IAAI,SAAS,CAAC,CAAC,cAAc;CAC1C,OAAO,EAAE,KAAK,CAAC,UAAU,SAAS,CAAC;CACnC,WAAW,EAAE,IAAI,SAAS,CAAC,CAAC,cAAc;CAC1C,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;AAC9C;;AAGA,MAAa,QAA0B,EAAE,OAAO,UAAU,CAAC,CAAC,SAAS,cAAc;CACjF,IAAI;CACJ,aAAa;AACf,CAAC;AAKD,MAAM,SAAsC,EACzC,OAAO;CACN,UAAU;CACV,KAAK;CACL,QAAQ,EACL,OAAO,CAAC,CACR,MAAM,wBAAwB,CAAC,CAC/B,cAAc;CACjB,KAAK,SAAS,cAAc;CAC5B,QAAQ,EAAE,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc;CACjE,QAAQ,WAAW,cAAc;CACjC,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;AAC7C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;AAEpD,MAAM,SAAsC,EACzC,OAAO;CAAE,GAAG;CAAY,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;AAAE,CAAC,CAAC,CACjD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;;;;;;AAQH,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
1
+ {"version":3,"file":"start.js","names":[],"sources":["../../../src/methods/share/start.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { CapabilityScope } from \"../../capability.ts\";\nimport { Duration } from \"../../duration.ts\";\nimport { ArtifactId, ShareId, TokenId } from \"../../ids.ts\";\nimport { ViewerSpec } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { RespondentSpec, ROSTER_MAX } from \"../../team.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\nimport { RespondentLink } from \"../roster/add.ts\";\n\n/**\n * How a share reaches its viewers (D158): `tailnet` through Tailscale Serve, to the people of the\n * user's tailnet, who are known by name; `funnel` through Tailscale Funnel and `cloudflare`\n * through a Cloudflare quick tunnel, both public, where the link is all that admits a viewer.\n */\nexport type ShareVia = \"tailnet\" | \"funnel\" | \"cloudflare\" | \"remote\";\n\n/** The Zod schema of the `ShareVia` type. */\nexport const ShareVia: z.ZodType<ShareVia> = z\n .enum([\"tailnet\", \"funnel\", \"cloudflare\", \"remote\"])\n .register(wireRegistry, {\n id: \"ShareVia\",\n description:\n \"How a share reaches its viewers: tailnet, funnel or cloudflare, or remote: hosted on a remote server (D165).\",\n });\n\n/** The longest a public share (Funnel or Cloudflare) may last: 7 days (D158). */\nexport const PUBLIC_SHARE_MAX_TTL_MS: number = 7 * 24 * 60 * 60 * 1000;\n\n/** How long a public share lasts when its `ttl` isn't given: 1 hour (D63 item 5, D158). */\nexport const PUBLIC_SHARE_DEFAULT_TTL: Duration = \"1h\";\n\n/** The params of `share/start` (INTERFACES §6, D158). */\nexport interface ShareStartParams {\n /** The artifact to share; the link opens its latest version. */\n readonly artifact: ArtifactRef;\n /** The tunnel. A public one (`funnel`, `cloudflare`) is explicit: never a fallback. */\n readonly via: ShareVia;\n /** For `remote`: the server's API origin. Default: the home's default server (D165 item 15). */\n readonly server?: string;\n /**\n * How long the share and its link last, such as `30m` or `24h`. Public shares: 1 hour by\n * default, at most 7 days. Tailnet shares: until stopped, unless given.\n */\n readonly ttl?: Duration;\n /** What the share's link allows (D97). Default: every scope. */\n readonly scopes?: readonly CapabilityScope[];\n /**\n * The person the share's link acts for (D104). Absent: whoever the tailnet or a host's identity\n * port names, else the link's own viewer, never the home's local user (D158).\n */\n readonly viewer?: ViewerSpec;\n /**\n * People the artifact expects answers from through this share (D121, D168): they join the\n * roster of the home that holds the artifact's viewers (a remote share's hosted home), and each\n * gets a personal link at the share's address. On a remote server, `email` reaches the operator's\n * `invitations` port. Not with `viewer`.\n */\n readonly respondents?: readonly RespondentSpec[];\n /** Makes retries idempotent: a repeated `requestId` returns the same share (H-03). */\n readonly requestId?: string;\n}\n\n/** A share, as `share/start` and `share/list` report it. */\nexport interface Share {\n /** The share's ID, for `share/stop`. */\n readonly shareId: string;\n /** The artifact shared. */\n readonly artifactId: string;\n /** The tunnel. */\n readonly via: ShareVia;\n /**\n * The share's capability URL, at the tunnel's address. Holding it is the authorization (D06);\n * absent once the share ended, and in `share/list` when the home's key can no longer show it.\n */\n readonly url?: string;\n /** The tunnel's host name: the tailnet device's, or the quick tunnel's random one. */\n readonly hostname: string;\n /**\n * The address the artifact's frame is served at over the tunnel, while the share is active:\n * on a tailnet, the second port of this device that viewers must be allowed to reach.\n */\n readonly artifactOrigin?: string;\n /**\n * How the artifact's frame authenticates over this tunnel (D70): `cookie` where the shell and\n * the artifact are one site (Tailscale), `worker` where they are two (Cloudflare).\n */\n readonly mode: \"cookie\" | \"worker\";\n /** The share's link, for `view/rotate` and `view/revoke`. */\n readonly tokenId: string;\n /** When the share started (RFC 3339, UTC). */\n readonly startedAt: string;\n /** When the share and its link end, if they do. */\n readonly expiresAt?: string;\n /** `active` while it serves; `stopped` once it ended. */\n readonly state: \"active\" | \"stopped\";\n /** When it ended. */\n readonly stoppedAt?: string;\n /**\n * Why it ended: `stopped` (`share/stop`), `expired` (its TTL), `tunnel` (its tunnel ended and\n * couldn't be set up again), `restart` (a quick tunnel can't outlive its instance), or\n * `revoked` (its link was revoked).\n */\n readonly stopReason?: \"stopped\" | \"expired\" | \"tunnel\" | \"restart\" | \"revoked\" | (string & {});\n}\n\nconst shareShape = {\n shareId: ShareId.schema,\n artifactId: ArtifactId.schema,\n via: ShareVia,\n url: z.string().min(1).exactOptional(),\n hostname: z.string().min(1),\n artifactOrigin: z.string().min(1).exactOptional(),\n mode: z.enum([\"cookie\", \"worker\"]),\n tokenId: TokenId.schema,\n startedAt: z.iso.datetime(),\n expiresAt: z.iso.datetime().exactOptional(),\n state: z.enum([\"active\", \"stopped\"]),\n stoppedAt: z.iso.datetime().exactOptional(),\n stopReason: z.string().min(1).exactOptional(),\n};\n\n/** The Zod schema of the `Share` type. */\nexport const Share: z.ZodType<Share> = z.object(shareShape).register(wireRegistry, {\n id: \"Share\",\n description: \"A share: its tunnel, link, address, frame mode and lifetime.\",\n});\n\n/**\n * The result of `share/start`: the share, with its link, and the personal link of every respondent\n * it named (D168).\n */\nexport type ShareStartResult = Share & {\n readonly url: string;\n readonly respondents?: readonly RespondentLink[];\n};\n\nconst params: z.ZodType<ShareStartParams> = z\n .object({\n artifact: ArtifactRef,\n via: ShareVia,\n server: z\n .string()\n .regex(/^https?:\\/\\/[^/?#\\s]+$/)\n .exactOptional(),\n ttl: Duration.exactOptional(),\n scopes: z.array(CapabilityScope).min(1).readonly().exactOptional(),\n viewer: ViewerSpec.exactOptional(),\n respondents: z.array(RespondentSpec).min(1).max(ROSTER_MAX).readonly().exactOptional(),\n requestId: z.string().min(1).exactOptional(),\n })\n .register(wireRegistry, { id: \"ShareStartParams\" });\n\nconst result: z.ZodType<ShareStartResult> = z\n .object({\n ...shareShape,\n url: z.string().min(1),\n respondents: z.array(RespondentLink).readonly().exactOptional(),\n })\n .register(wireRegistry, {\n id: \"ShareStartResult\",\n description: \"The share that started, with its capability URL.\",\n });\n\n/**\n * `share/start`: shares an artifact through a tunnel the instance drives (D158): Tailscale Serve\n * for the tailnet, or Tailscale Funnel or a Cloudflare quick tunnel for anyone with the link. It\n * answers once the tunnel serves, with a new link at the tunnel's address that works there only.\n * A missing or unready tool is a `MOSTRA_SHARE_*` diagnostic saying what to do.\n */\nexport const shareStartMethod: MethodDefinition<ShareStartParams, ShareStartResult> = defineMethod({\n method: \"share/start\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result,\n});\n"],"mappings":";;;;;;;;;;;;AAmBA,MAAa,WAAgC,EAC1C,KAAK;CAAC;CAAW;CAAU;CAAc;AAAQ,CAAC,CAAC,CACnD,SAAS,cAAc;CACtB,IAAI;CACJ,aACE;AACJ,CAAC;;AAGH,MAAa,0BAAkC;;AAG/C,MAAa,2BAAqC;AA4ElD,MAAM,aAAa;CACjB,SAAS,QAAQ;CACjB,YAAY,WAAW;CACvB,KAAK;CACL,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;CACrC,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAC1B,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;CAChD,MAAM,EAAE,KAAK,CAAC,UAAU,QAAQ,CAAC;CACjC,SAAS,QAAQ;CACjB,WAAW,EAAE,IAAI,SAAS;CAC1B,WAAW,EAAE,IAAI,SAAS,CAAC,CAAC,cAAc;CAC1C,OAAO,EAAE,KAAK,CAAC,UAAU,SAAS,CAAC;CACnC,WAAW,EAAE,IAAI,SAAS,CAAC,CAAC,cAAc;CAC1C,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;AAC9C;;AAGA,MAAa,QAA0B,EAAE,OAAO,UAAU,CAAC,CAAC,SAAS,cAAc;CACjF,IAAI;CACJ,aAAa;AACf,CAAC;AAWD,MAAM,SAAsC,EACzC,OAAO;CACN,UAAU;CACV,KAAK;CACL,QAAQ,EACL,OAAO,CAAC,CACR,MAAM,wBAAwB,CAAC,CAC/B,cAAc;CACjB,KAAK,SAAS,cAAc;CAC5B,QAAQ,EAAE,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc;CACjE,QAAQ,WAAW,cAAc;CACjC,aAAa,EAAE,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc;CACrF,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;AAC7C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;AAEpD,MAAM,SAAsC,EACzC,OAAO;CACN,GAAG;CACH,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACrB,aAAa,EAAE,MAAM,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc;AAChE,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;;;;;;AAQH,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -1,5 +1,5 @@
1
- import { ArtifactRef } from "../../artifact.js";
2
1
  import { DocumentRevision, FieldState } from "../../interaction.js";
2
+ import { ArtifactRef } from "../../artifact.js";
3
3
  import { MethodDefinition } from "../../method.js";
4
4
  //#region src/methods/state/get.d.ts
5
5
  /** The params of `state/get` (INTERFACES §6, D63). */
@@ -1,5 +1,5 @@
1
- import { ArtifactRef } from "../../artifact.js";
2
1
  import { DocumentRevision, FieldOp, MutationResult } from "../../interaction.js";
2
+ import { ArtifactRef } from "../../artifact.js";
3
3
  import { MethodDefinition } from "../../method.js";
4
4
  //#region src/methods/state/patch.d.ts
5
5
  /** The params of `state/patch` (INTERFACES §6, D63, D106). */
@@ -1,6 +1,6 @@
1
1
  import { Duration } from "../../duration.js";
2
- import { ArtifactRef } from "../../artifact.js";
3
2
  import { Viewer, ViewerSpec } from "../../interaction.js";
3
+ import { ArtifactRef } from "../../artifact.js";
4
4
  import { CapabilityScope } from "../../capability.js";
5
5
  import { MethodDefinition } from "../../method.js";
6
6
  import * as z from "zod";
@@ -1,5 +1,5 @@
1
- import { ArtifactRef } from "../../artifact.js";
2
1
  import { EventRecord, WaitCondition } from "../../interaction.js";
2
+ import { ArtifactRef } from "../../artifact.js";
3
3
  import { MethodDefinition } from "../../method.js";
4
4
  //#region src/methods/wait/wait.d.ts
5
5
  /** The longest `wait`, in milliseconds: the longest timer JavaScript keeps (about 24.8 days). */