@mostra/protocol 0.10.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.
- package/dist/actions.d.ts +11 -3
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js.map +1 -1
- package/dist/browser.d.ts +43 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +29 -1
- package/dist/browser.js.map +1 -1
- package/dist/diagnostics/codes/action.d.ts +1 -1
- package/dist/diagnostics/codes/action.d.ts.map +1 -1
- package/dist/diagnostics/codes/action.js +12 -1
- package/dist/diagnostics/codes/action.js.map +1 -1
- package/dist/diagnostics/codes/index.d.ts +3 -2
- package/dist/diagnostics/codes/index.d.ts.map +1 -1
- package/dist/diagnostics/codes/index.js +3 -1
- package/dist/diagnostics/codes/index.js.map +1 -1
- package/dist/diagnostics/codes/remote.d.ts +1 -1
- package/dist/diagnostics/codes/remote.d.ts.map +1 -1
- package/dist/diagnostics/codes/remote.js +78 -1
- package/dist/diagnostics/codes/remote.js.map +1 -1
- package/dist/diagnostics/codes/submit.d.ts +1 -1
- package/dist/diagnostics/codes/submit.d.ts.map +1 -1
- package/dist/diagnostics/codes/submit.js +12 -1
- package/dist/diagnostics/codes/submit.js.map +1 -1
- package/dist/diagnostics/codes/team.d.ts +8 -0
- package/dist/diagnostics/codes/team.d.ts.map +1 -0
- package/dist/diagnostics/codes/team.js +44 -0
- package/dist/diagnostics/codes/team.js.map +1 -0
- package/dist/diagnostics/diagnostic.d.ts +1 -1
- package/dist/diagnostics/diagnostic.d.ts.map +1 -1
- package/dist/diagnostics/diagnostic.js +2 -1
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/index.d.ts +17 -7
- package/dist/index.js +14 -4
- package/dist/interaction.d.ts +17 -3
- package/dist/interaction.d.ts.map +1 -1
- package/dist/interaction.js +17 -13
- package/dist/interaction.js.map +1 -1
- package/dist/manifest.d.ts +3 -0
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +5 -2
- package/dist/manifest.js.map +1 -1
- package/dist/methods/artifact/pause.d.ts +33 -0
- package/dist/methods/artifact/pause.d.ts.map +1 -0
- package/dist/methods/artifact/pause.js +33 -0
- package/dist/methods/artifact/pause.js.map +1 -0
- package/dist/methods/index.d.ts.map +1 -1
- package/dist/methods/index.js +16 -2
- package/dist/methods/index.js.map +1 -1
- package/dist/methods/port/relay-author.d.ts +28 -0
- package/dist/methods/port/relay-author.d.ts.map +1 -0
- package/dist/methods/port/relay-author.js +42 -0
- package/dist/methods/port/relay-author.js.map +1 -0
- package/dist/methods/port/trusted-controls-policy.d.ts +1 -1
- package/dist/methods/remote/link.d.ts +40 -0
- package/dist/methods/remote/link.d.ts.map +1 -0
- package/dist/methods/remote/link.js +40 -0
- package/dist/methods/remote/link.js.map +1 -0
- package/dist/methods/results/get.d.ts +3 -1
- package/dist/methods/results/get.d.ts.map +1 -1
- package/dist/methods/results/get.js +4 -3
- package/dist/methods/results/get.js.map +1 -1
- package/dist/methods/results/list.d.ts +33 -0
- package/dist/methods/results/list.d.ts.map +1 -0
- package/dist/methods/results/list.js +35 -0
- package/dist/methods/results/list.js.map +1 -0
- package/dist/methods/roster/add.d.ts +47 -0
- package/dist/methods/roster/add.d.ts.map +1 -0
- package/dist/methods/roster/add.js +46 -0
- package/dist/methods/roster/add.js.map +1 -0
- package/dist/methods/roster/get.d.ts +18 -0
- package/dist/methods/roster/get.d.ts.map +1 -0
- package/dist/methods/roster/get.js +22 -0
- package/dist/methods/roster/get.js.map +1 -0
- package/dist/methods/roster/remove.d.ts +28 -0
- package/dist/methods/roster/remove.d.ts.map +1 -0
- package/dist/methods/roster/remove.js +31 -0
- package/dist/methods/roster/remove.js.map +1 -0
- package/dist/methods/share/start.d.ts +15 -2
- package/dist/methods/share/start.d.ts.map +1 -1
- package/dist/methods/share/start.js +5 -1
- package/dist/methods/share/start.js.map +1 -1
- package/dist/methods/state/get.d.ts +1 -1
- package/dist/methods/state/patch.d.ts +1 -1
- package/dist/methods/view/url.d.ts +1 -1
- package/dist/methods/wait/wait.d.ts +1 -1
- package/dist/operator.d.ts +511 -0
- package/dist/operator.d.ts.map +1 -0
- package/dist/operator.js +134 -0
- package/dist/operator.js.map +1 -0
- package/dist/team-settings.d.ts +21 -0
- package/dist/team-settings.d.ts.map +1 -0
- package/dist/team-settings.js +27 -0
- package/dist/team-settings.js.map +1 -0
- package/dist/team.d.ts +221 -0
- package/dist/team.d.ts.map +1 -0
- package/dist/team.js +162 -0
- package/dist/team.js.map +1 -0
- package/dist/verify.d.ts +7 -0
- package/dist/verify.d.ts.map +1 -1
- package/dist/verify.js.map +1 -1
- package/dist/worker.d.ts +1 -1
- package/package.json +11 -1
- package/schemas/protocol.draft-07.json +1027 -45
- package/schemas/protocol.schema.json +996 -46
- package/src/actions.ts +8 -4
- package/src/browser.ts +64 -0
- package/src/diagnostics/codes/action.ts +12 -0
- package/src/diagnostics/codes/index.ts +6 -2
- package/src/diagnostics/codes/remote.ts +84 -0
- package/src/diagnostics/codes/submit.ts +12 -0
- package/src/diagnostics/codes/team.ts +53 -0
- package/src/diagnostics/diagnostic.ts +3 -1
- package/src/index.ts +66 -2
- package/src/interaction.ts +30 -5
- package/src/manifest.ts +5 -0
- package/src/methods/artifact/pause.ts +59 -0
- package/src/methods/index.ts +14 -0
- package/src/methods/port/relay-author.ts +57 -0
- package/src/methods/remote/link.ts +65 -0
- package/src/methods/results/get.ts +3 -2
- package/src/methods/results/list.ts +61 -0
- package/src/methods/roster/add.ts +77 -0
- package/src/methods/roster/get.ts +30 -0
- package/src/methods/roster/remove.ts +49 -0
- package/src/methods/share/start.ts +23 -3
- package/src/operator.ts +660 -0
- package/src/team-settings.ts +38 -0
- package/src/team.ts +398 -0
- package/src/verify.ts +7 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { ArtifactRef } from "../../artifact.js";
|
|
3
|
+
import { defineMethod } from "../../method.js";
|
|
4
|
+
import * as z from "zod";
|
|
5
|
+
//#region src/methods/artifact/pause.ts
|
|
6
|
+
const params = z.object({
|
|
7
|
+
artifact: ArtifactRef,
|
|
8
|
+
paused: z.boolean(),
|
|
9
|
+
reason: z.string().max(500).exactOptional(),
|
|
10
|
+
requestId: z.string().min(1).exactOptional()
|
|
11
|
+
}).register(wireRegistry, { id: "ArtifactPauseParams" });
|
|
12
|
+
const result = z.object({
|
|
13
|
+
paused: z.boolean(),
|
|
14
|
+
by: z.enum(["owner", "operator"]).exactOptional()
|
|
15
|
+
}).register(wireRegistry, { id: "ArtifactPauseResult" });
|
|
16
|
+
/**
|
|
17
|
+
* `artifact/pause`: pauses or resumes an artifact. While paused it stays viewable and its shell
|
|
18
|
+
* says so; submissions answer 423 `MOSTRA_SUBMIT_PAUSED` and actions 423 `MOSTRA_ACTION_PAUSED`,
|
|
19
|
+
* each keeping the draft; links stay valid. On an owner instance it acts on the local artifact and,
|
|
20
|
+
* for a hosted one, on every server it is hosted on. An operator's pause can't be resumed by the
|
|
21
|
+
* owner (`MOSTRA_REMOTE_PAUSED_BY_OPERATOR`).
|
|
22
|
+
*/
|
|
23
|
+
const artifactPauseMethod = defineMethod({
|
|
24
|
+
method: "artifact/pause",
|
|
25
|
+
direction: "client-to-instance",
|
|
26
|
+
mutating: true,
|
|
27
|
+
params,
|
|
28
|
+
result
|
|
29
|
+
});
|
|
30
|
+
//#endregion
|
|
31
|
+
export { artifactPauseMethod };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=pause.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pause.js","names":[],"sources":["../../../src/methods/artifact/pause.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** Who paused an artifact (D165 item 14). */\nexport type PausedBy = \"owner\" | \"operator\";\n\n/** The params of `artifact/pause` (INTERFACES §18.2, D165 item 14). */\nexport interface ArtifactPauseParams {\n /** The artifact to pause or resume. */\n readonly artifact: ArtifactRef;\n /** `true` pauses it, `false` resumes it. */\n readonly paused: boolean;\n /** Why, shown to viewers as text while it is paused. */\n readonly reason?: string;\n /** Makes retries idempotent: a repeated `requestId` returns the recorded result (H-03). */\n readonly requestId?: string;\n}\n\n/** The result of `artifact/pause`: whether the artifact is paused now, and by whom. */\nexport interface ArtifactPauseResult {\n /** Whether it is paused after the call. */\n readonly paused: boolean;\n /** Who paused it, while it is paused. */\n readonly by?: PausedBy;\n}\n\nconst params: z.ZodType<ArtifactPauseParams> = z\n .object({\n artifact: ArtifactRef,\n paused: z.boolean(),\n reason: z.string().max(500).exactOptional(),\n requestId: z.string().min(1).exactOptional(),\n })\n .register(wireRegistry, { id: \"ArtifactPauseParams\" });\n\nconst result: z.ZodType<ArtifactPauseResult> = z\n .object({\n paused: z.boolean(),\n by: z.enum([\"owner\", \"operator\"]).exactOptional(),\n })\n .register(wireRegistry, { id: \"ArtifactPauseResult\" });\n\n/**\n * `artifact/pause`: pauses or resumes an artifact. While paused it stays viewable and its shell\n * says so; submissions answer 423 `MOSTRA_SUBMIT_PAUSED` and actions 423 `MOSTRA_ACTION_PAUSED`,\n * each keeping the draft; links stay valid. On an owner instance it acts on the local artifact and,\n * for a hosted one, on every server it is hosted on. An operator's pause can't be resumed by the\n * owner (`MOSTRA_REMOTE_PAUSED_BY_OPERATOR`).\n */\nexport const artifactPauseMethod: MethodDefinition<ArtifactPauseParams, ArtifactPauseResult> =\n defineMethod({\n method: \"artifact/pause\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result,\n });\n"],"mappings":";;;;;AA4BA,MAAM,SAAyC,EAC5C,OAAO;CACN,UAAU;CACV,QAAQ,EAAE,QAAQ;CAClB,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,cAAc;CAC1C,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;AAC7C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,sBAAsB,CAAC;AAEvD,MAAM,SAAyC,EAC5C,OAAO;CACN,QAAQ,EAAE,QAAQ;CAClB,IAAI,EAAE,KAAK,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,cAAc;AAClD,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,sBAAsB,CAAC;;;;;;;;AASvD,MAAa,sBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/methods/index.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/methods/index.ts"],"mappings":";;;qBA0Ea,sBAAsB;;qBAsEtB,4BAA4B"}
|
package/dist/methods/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { artifactExportMethod } from "./artifact/export.js";
|
|
|
3
3
|
import { artifactGetMethod } from "./artifact/get.js";
|
|
4
4
|
import { artifactImportMethod } from "./artifact/import.js";
|
|
5
5
|
import { artifactListMethod } from "./artifact/list.js";
|
|
6
|
+
import { artifactPauseMethod } from "./artifact/pause.js";
|
|
6
7
|
import { artifactPublishMethod } from "./artifact/publish.js";
|
|
7
8
|
import { ARTIFACT_PROGRESS, ArtifactProgressParams } from "../verify.js";
|
|
8
9
|
import { artifactVerifyMethod } from "./artifact/verify.js";
|
|
@@ -19,6 +20,8 @@ import { portSubmissionsDeliverMethod } from "./port/submissions-deliver.js";
|
|
|
19
20
|
import { hostedSubmissionMethod } from "./hosted/submission.js";
|
|
20
21
|
import { instanceCheckMethod } from "./instance/check.js";
|
|
21
22
|
import { mostraInitializeMethod } from "./mostra/initialize.js";
|
|
23
|
+
import { viewUrlMethod } from "./view/url.js";
|
|
24
|
+
import { rosterAddMethod } from "./roster/add.js";
|
|
22
25
|
import { shareStartMethod } from "./share/start.js";
|
|
23
26
|
import { instanceStatusMethod } from "./instance/status.js";
|
|
24
27
|
import { livePushMethod } from "./live/push.js";
|
|
@@ -26,6 +29,7 @@ import { mostraShutdownMethod } from "./mostra/shutdown.js";
|
|
|
26
29
|
import { portAddressingExternalBaseMethod } from "./port/addressing-external-base.js";
|
|
27
30
|
import { portDraftsMirrorMethod } from "./port/drafts-mirror.js";
|
|
28
31
|
import { portIdentityResolveMethod } from "./port/identity-resolve.js";
|
|
32
|
+
import { portRelayAuthorMethod } from "./port/relay-author.js";
|
|
29
33
|
import { portRelayRunMethod } from "./port/relay-run.js";
|
|
30
34
|
import { portRelayCallMethod } from "./port/relay-call.js";
|
|
31
35
|
import { portRelayCancelMethod } from "./port/relay-cancel.js";
|
|
@@ -38,12 +42,16 @@ import { relayCallBatchMethod } from "./relay/call-batch.js";
|
|
|
38
42
|
import { relayEffectMethod } from "./relay/effect.js";
|
|
39
43
|
import { relayLiveValueMethod } from "./relay/live-value.js";
|
|
40
44
|
import { relayRunUpdateMethod } from "./relay/run-update.js";
|
|
45
|
+
import { remoteLinkMethod } from "./remote/link.js";
|
|
41
46
|
import { remoteLoginMethod } from "./remote/login.js";
|
|
42
47
|
import { remoteLoginWaitMethod } from "./remote/login-wait.js";
|
|
43
48
|
import { remoteLogoutMethod } from "./remote/logout.js";
|
|
44
49
|
import { remoteStatusMethod } from "./remote/status.js";
|
|
45
50
|
import { remoteTokenMethod } from "./remote/token.js";
|
|
46
51
|
import { resultsGetMethod } from "./results/get.js";
|
|
52
|
+
import { resultsListMethod } from "./results/list.js";
|
|
53
|
+
import { rosterGetMethod } from "./roster/get.js";
|
|
54
|
+
import { rosterRemoveMethod } from "./roster/remove.js";
|
|
47
55
|
import { secretDeleteMethod } from "./secret/delete.js";
|
|
48
56
|
import { secretSetMethod } from "./secret/set.js";
|
|
49
57
|
import { secretListMethod } from "./secret/list.js";
|
|
@@ -51,7 +59,6 @@ import { shareListMethod } from "./share/list.js";
|
|
|
51
59
|
import { shareStopMethod } from "./share/stop.js";
|
|
52
60
|
import { stateGetMethod } from "./state/get.js";
|
|
53
61
|
import { statePatchMethod } from "./state/patch.js";
|
|
54
|
-
import { viewUrlMethod } from "./view/url.js";
|
|
55
62
|
import { viewDefaultMethod } from "./view/default.js";
|
|
56
63
|
import { viewLaunchMethod } from "./view/launch.js";
|
|
57
64
|
import { viewRevokeMethod } from "./view/revoke.js";
|
|
@@ -117,7 +124,14 @@ const hostMethods = [
|
|
|
117
124
|
relayEffectMethod,
|
|
118
125
|
portRelayLiveMethod,
|
|
119
126
|
relayLiveValueMethod,
|
|
120
|
-
hostedSubmissionMethod
|
|
127
|
+
hostedSubmissionMethod,
|
|
128
|
+
artifactPauseMethod,
|
|
129
|
+
portRelayAuthorMethod,
|
|
130
|
+
remoteLinkMethod,
|
|
131
|
+
rosterAddMethod,
|
|
132
|
+
rosterRemoveMethod,
|
|
133
|
+
rosterGetMethod,
|
|
134
|
+
resultsListMethod
|
|
121
135
|
];
|
|
122
136
|
/** Every notification the instance sends to its clients (INTERFACES §6). */
|
|
123
137
|
const hostNotifications = [
|
|
@@ -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 { 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 { 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 { 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 // 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":"
|
|
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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MethodDefinition } from "../../method.js";
|
|
2
|
+
//#region src/methods/port/relay-author.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* What remote MCP may ask an owner instance to do for it (INTERFACES §18.8, D165 item 5): the
|
|
5
|
+
* authoring methods of the host protocol, and the owner's workspace (`McpWorkspace`, its root and
|
|
6
|
+
* its artifacts' files) and verify's screenshots, which only that machine holds.
|
|
7
|
+
*/
|
|
8
|
+
export declare const RELAY_AUTHOR_METHODS: readonly ["artifact/create", "artifact/verify", "artifact/publish", "artifact/get", "workspace/root", "workspace/allocate", "workspace/read", "workspace/apply", "verify/screenshot"];
|
|
9
|
+
/** One of {@link RELAY_AUTHOR_METHODS}. */
|
|
10
|
+
export type RelayAuthorMethod = (typeof RELAY_AUTHOR_METHODS)[number];
|
|
11
|
+
/** The params of `port/relay.author` (INTERFACES §18.3). */
|
|
12
|
+
export interface PortRelayAuthorParams {
|
|
13
|
+
/** What to do on the owner instance. */
|
|
14
|
+
readonly method: RelayAuthorMethod;
|
|
15
|
+
/** Its params: the host protocol method's, or the workspace operation's. */
|
|
16
|
+
readonly params: unknown;
|
|
17
|
+
}
|
|
18
|
+
/** The result of `port/relay.author`: the method's own result. */
|
|
19
|
+
export type PortRelayAuthorResult = unknown;
|
|
20
|
+
/**
|
|
21
|
+
* `port/relay.author`: the remote MCP server relays an authoring step to the account's default
|
|
22
|
+
* owner instance (D165 item 5), which runs it in its own workspace, builder and `verify`, and
|
|
23
|
+
* answers its result or its diagnostic. A publish through it also hosts the version on the server
|
|
24
|
+
* that asked and answers the hosted link. Workspace paths stay inside the owner's workspace.
|
|
25
|
+
*/
|
|
26
|
+
export declare const portRelayAuthorMethod: MethodDefinition<PortRelayAuthorParams, PortRelayAuthorResult>;
|
|
27
|
+
//#endregion
|
|
28
|
+
//# sourceMappingURL=relay-author.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-author.d.ts","names":[],"sources":["../../../src/methods/port/relay-author.ts"],"mappings":";;;;;;;qBASa;;YAaD,4BAA4B;;iBAGvB;;WAEN,QAAQ;;WAER;;;YAIC;;;;;;;qBAgBC,uBAAuB,iBAAiB,uBAAuB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { defineMethod } from "../../method.js";
|
|
3
|
+
import * as z from "zod";
|
|
4
|
+
//#region src/methods/port/relay-author.ts
|
|
5
|
+
/**
|
|
6
|
+
* What remote MCP may ask an owner instance to do for it (INTERFACES §18.8, D165 item 5): the
|
|
7
|
+
* authoring methods of the host protocol, and the owner's workspace (`McpWorkspace`, its root and
|
|
8
|
+
* its artifacts' files) and verify's screenshots, which only that machine holds.
|
|
9
|
+
*/
|
|
10
|
+
const RELAY_AUTHOR_METHODS = [
|
|
11
|
+
"artifact/create",
|
|
12
|
+
"artifact/verify",
|
|
13
|
+
"artifact/publish",
|
|
14
|
+
"artifact/get",
|
|
15
|
+
"workspace/root",
|
|
16
|
+
"workspace/allocate",
|
|
17
|
+
"workspace/read",
|
|
18
|
+
"workspace/apply",
|
|
19
|
+
"verify/screenshot"
|
|
20
|
+
];
|
|
21
|
+
const params = z.object({
|
|
22
|
+
method: z.enum(RELAY_AUTHOR_METHODS),
|
|
23
|
+
params: z.unknown()
|
|
24
|
+
}).register(wireRegistry, { id: "PortRelayAuthorParams" });
|
|
25
|
+
const result = z.unknown().register(wireRegistry, { id: "PortRelayAuthorResult" });
|
|
26
|
+
/**
|
|
27
|
+
* `port/relay.author`: the remote MCP server relays an authoring step to the account's default
|
|
28
|
+
* owner instance (D165 item 5), which runs it in its own workspace, builder and `verify`, and
|
|
29
|
+
* answers its result or its diagnostic. A publish through it also hosts the version on the server
|
|
30
|
+
* that asked and answers the hosted link. Workspace paths stay inside the owner's workspace.
|
|
31
|
+
*/
|
|
32
|
+
const portRelayAuthorMethod = defineMethod({
|
|
33
|
+
method: "port/relay.author",
|
|
34
|
+
direction: "instance-to-host",
|
|
35
|
+
mutating: true,
|
|
36
|
+
params,
|
|
37
|
+
result
|
|
38
|
+
});
|
|
39
|
+
//#endregion
|
|
40
|
+
export { RELAY_AUTHOR_METHODS, portRelayAuthorMethod };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=relay-author.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-author.js","names":[],"sources":["../../../src/methods/port/relay-author.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/**\n * What remote MCP may ask an owner instance to do for it (INTERFACES §18.8, D165 item 5): the\n * authoring methods of the host protocol, and the owner's workspace (`McpWorkspace`, its root and\n * its artifacts' files) and verify's screenshots, which only that machine holds.\n */\nexport const RELAY_AUTHOR_METHODS = [\n \"artifact/create\",\n \"artifact/verify\",\n \"artifact/publish\",\n \"artifact/get\",\n \"workspace/root\",\n \"workspace/allocate\",\n \"workspace/read\",\n \"workspace/apply\",\n \"verify/screenshot\",\n] as const;\n\n/** One of {@link RELAY_AUTHOR_METHODS}. */\nexport type RelayAuthorMethod = (typeof RELAY_AUTHOR_METHODS)[number];\n\n/** The params of `port/relay.author` (INTERFACES §18.3). */\nexport interface PortRelayAuthorParams {\n /** What to do on the owner instance. */\n readonly method: RelayAuthorMethod;\n /** Its params: the host protocol method's, or the workspace operation's. */\n readonly params: unknown;\n}\n\n/** The result of `port/relay.author`: the method's own result. */\nexport type PortRelayAuthorResult = unknown;\n\nconst params: z.ZodType<PortRelayAuthorParams> = z\n .object({ method: z.enum(RELAY_AUTHOR_METHODS), params: z.unknown() })\n .register(wireRegistry, { id: \"PortRelayAuthorParams\" });\n\nconst result: z.ZodType<PortRelayAuthorResult> = z\n .unknown()\n .register(wireRegistry, { id: \"PortRelayAuthorResult\" });\n\n/**\n * `port/relay.author`: the remote MCP server relays an authoring step to the account's default\n * owner instance (D165 item 5), which runs it in its own workspace, builder and `verify`, and\n * answers its result or its diagnostic. A publish through it also hosts the version on the server\n * that asked and answers the hosted link. Workspace paths stay inside the owner's workspace.\n */\nexport const portRelayAuthorMethod: MethodDefinition<PortRelayAuthorParams, PortRelayAuthorResult> =\n defineMethod({\n method: \"port/relay.author\",\n direction: \"instance-to-host\",\n mutating: true,\n params,\n result,\n });\n"],"mappings":";;;;;;;;;AASA,MAAa,uBAAuB;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAgBA,MAAM,SAA2C,EAC9C,OAAO;CAAE,QAAQ,EAAE,KAAK,oBAAoB;CAAG,QAAQ,EAAE,QAAQ;AAAE,CAAC,CAAC,CACrE,SAAS,cAAc,EAAE,IAAI,wBAAwB,CAAC;AAEzD,MAAM,SAA2C,EAC9C,QAAQ,CAAC,CACT,SAAS,cAAc,EAAE,IAAI,wBAAwB,CAAC;;;;;;;AAQzD,MAAa,wBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
|
|
@@ -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). */
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { MethodDefinition } from "../../method.js";
|
|
2
|
+
import { ServerOrigin } from "../../remote.js";
|
|
3
|
+
//#region src/methods/remote/link.d.ts
|
|
4
|
+
/** The params of `remote/link` (INTERFACES §18.2). */
|
|
5
|
+
export interface RemoteLinkParams {
|
|
6
|
+
/** The server's API origin. */
|
|
7
|
+
readonly server: ServerOrigin;
|
|
8
|
+
/**
|
|
9
|
+
* A credential the server's operator issued for an account (`accounts.authenticate`, §18.6), in
|
|
10
|
+
* place of a person's sign-in: a program runs an always-on owner instance with it. Kept in the
|
|
11
|
+
* home, owner-only, like a refresh token; never logged.
|
|
12
|
+
*/
|
|
13
|
+
readonly key: string;
|
|
14
|
+
/** Makes this instance the account's default: the one chat-host authoring goes to (D165 item 1b). */
|
|
15
|
+
readonly default?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** The result of `remote/link`: this home is linked to the server for the key's account. */
|
|
18
|
+
export interface RemoteLinkResult {
|
|
19
|
+
/** The server linked to. */
|
|
20
|
+
readonly server: ServerOrigin;
|
|
21
|
+
/** The account the key is the operator's credential for. */
|
|
22
|
+
readonly account: {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly name?: string;
|
|
25
|
+
};
|
|
26
|
+
/** This home's instance link on that server (`lnk_…`), one per key's subject. */
|
|
27
|
+
readonly instanceId: string;
|
|
28
|
+
/** Whether this instance is the account's default. */
|
|
29
|
+
readonly default: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* `remote/link`: links this home to a remote server with a key its operator issued for an account,
|
|
33
|
+
* in place of `remote/login`'s device grant, so a program can run an always-on owner instance
|
|
34
|
+
* (WP-30, D167). Linking again with a key is idempotent by nature, so it takes no `requestId`: the
|
|
35
|
+
* ledger never records the key's digest. A key the server doesn't admit is
|
|
36
|
+
* `MOSTRA_REMOTE_LOGIN_FAILED`.
|
|
37
|
+
*/
|
|
38
|
+
export declare const remoteLinkMethod: MethodDefinition<RemoteLinkParams, RemoteLinkResult>;
|
|
39
|
+
//#endregion
|
|
40
|
+
//# sourceMappingURL=link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.d.ts","names":[],"sources":["../../../src/methods/remote/link.ts"],"mappings":";;;;iBAMiB;;WAEN,QAAQ;;;;;;WAMR;;WAEA;;;iBAIM;;WAEN,QAAQ;;WAER;aAAoB;aAAqB;;;WAEzC;;WAEA;;;;;;;;;qBA8BE,kBAAkB,iBAAiB,kBAAkB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { defineMethod } from "../../method.js";
|
|
3
|
+
import { ServerOrigin } from "../../remote.js";
|
|
4
|
+
import * as z from "zod";
|
|
5
|
+
//#region src/methods/remote/link.ts
|
|
6
|
+
const params = z.object({
|
|
7
|
+
server: ServerOrigin,
|
|
8
|
+
key: z.string().min(20).max(512),
|
|
9
|
+
default: z.boolean().exactOptional()
|
|
10
|
+
}).register(wireRegistry, { id: "RemoteLinkParams" });
|
|
11
|
+
const result = z.object({
|
|
12
|
+
server: ServerOrigin,
|
|
13
|
+
account: z.object({
|
|
14
|
+
id: z.string(),
|
|
15
|
+
name: z.string().exactOptional()
|
|
16
|
+
}),
|
|
17
|
+
instanceId: z.string(),
|
|
18
|
+
default: z.boolean()
|
|
19
|
+
}).register(wireRegistry, {
|
|
20
|
+
id: "RemoteLinkResult",
|
|
21
|
+
description: "A home linked to a remote server with an operator-issued key."
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* `remote/link`: links this home to a remote server with a key its operator issued for an account,
|
|
25
|
+
* in place of `remote/login`'s device grant, so a program can run an always-on owner instance
|
|
26
|
+
* (WP-30, D167). Linking again with a key is idempotent by nature, so it takes no `requestId`: the
|
|
27
|
+
* ledger never records the key's digest. A key the server doesn't admit is
|
|
28
|
+
* `MOSTRA_REMOTE_LOGIN_FAILED`.
|
|
29
|
+
*/
|
|
30
|
+
const remoteLinkMethod = defineMethod({
|
|
31
|
+
method: "remote/link",
|
|
32
|
+
direction: "client-to-instance",
|
|
33
|
+
mutating: false,
|
|
34
|
+
params,
|
|
35
|
+
result
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { remoteLinkMethod };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","names":[],"sources":["../../../src/methods/remote/link.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { ServerOrigin } from \"../../remote.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `remote/link` (INTERFACES §18.2). */\nexport interface RemoteLinkParams {\n /** The server's API origin. */\n readonly server: ServerOrigin;\n /**\n * A credential the server's operator issued for an account (`accounts.authenticate`, §18.6), in\n * place of a person's sign-in: a program runs an always-on owner instance with it. Kept in the\n * home, owner-only, like a refresh token; never logged.\n */\n readonly key: string;\n /** Makes this instance the account's default: the one chat-host authoring goes to (D165 item 1b). */\n readonly default?: boolean;\n}\n\n/** The result of `remote/link`: this home is linked to the server for the key's account. */\nexport interface RemoteLinkResult {\n /** The server linked to. */\n readonly server: ServerOrigin;\n /** The account the key is the operator's credential for. */\n readonly account: { readonly id: string; readonly name?: string };\n /** This home's instance link on that server (`lnk_…`), one per key's subject. */\n readonly instanceId: string;\n /** Whether this instance is the account's default. */\n readonly default: boolean;\n}\n\nconst params: z.ZodType<RemoteLinkParams> = z\n .object({\n server: ServerOrigin,\n key: z.string().min(20).max(512),\n default: z.boolean().exactOptional(),\n })\n .register(wireRegistry, { id: \"RemoteLinkParams\" });\n\nconst result: z.ZodType<RemoteLinkResult> = z\n .object({\n server: ServerOrigin,\n account: z.object({ id: z.string(), name: z.string().exactOptional() }),\n instanceId: z.string(),\n default: z.boolean(),\n })\n .register(wireRegistry, {\n id: \"RemoteLinkResult\",\n description: \"A home linked to a remote server with an operator-issued key.\",\n });\n\n/**\n * `remote/link`: links this home to a remote server with a key its operator issued for an account,\n * in place of `remote/login`'s device grant, so a program can run an always-on owner instance\n * (WP-30, D167). Linking again with a key is idempotent by nature, so it takes no `requestId`: the\n * ledger never records the key's digest. A key the server doesn't admit is\n * `MOSTRA_REMOTE_LOGIN_FAILED`.\n */\nexport const remoteLinkMethod: MethodDefinition<RemoteLinkParams, RemoteLinkResult> = defineMethod({\n method: \"remote/link\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n});\n"],"mappings":";;;;;AA+BA,MAAM,SAAsC,EACzC,OAAO;CACN,QAAQ;CACR,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,GAAG;CAC/B,SAAS,EAAE,QAAQ,CAAC,CAAC,cAAc;AACrC,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;AAEpD,MAAM,SAAsC,EACzC,OAAO;CACN,QAAQ;CACR,SAAS,EAAE,OAAO;EAAE,IAAI,EAAE,OAAO;EAAG,MAAM,EAAE,OAAO,CAAC,CAAC,cAAc;CAAE,CAAC;CACtE,YAAY,EAAE,OAAO;CACrB,SAAS,EAAE,QAAQ;AACrB,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;;;;;;;AASH,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 { 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;;;;;
|
|
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
|
-
|
|
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\
|
|
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"}
|