@mostra/protocol 0.11.0 → 0.13.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 +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.js +2 -2
- package/dist/diagnostics/codes/remote.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 +13 -6
- package/dist/index.js +11 -4
- package/dist/interaction.d.ts +12 -3
- package/dist/interaction.d.ts.map +1 -1
- package/dist/interaction.js +15 -12
- 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/index.d.ts.map +1 -1
- package/dist/methods/index.js +10 -2
- package/dist/methods/index.js.map +1 -1
- package/dist/methods/port/trusted-controls-policy.d.ts +1 -1
- 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 +93 -11
- package/dist/operator.d.ts.map +1 -1
- package/dist/operator.js.map +1 -1
- 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 +1 -1
- package/schemas/protocol.draft-07.json +802 -79
- package/schemas/protocol.schema.json +782 -91
- package/src/actions.ts +8 -4
- package/src/diagnostics/codes/index.ts +6 -2
- package/src/diagnostics/codes/remote.ts +2 -2
- package/src/diagnostics/codes/team.ts +53 -0
- package/src/diagnostics/diagnostic.ts +3 -1
- package/src/index.ts +47 -2
- package/src/interaction.ts +24 -5
- package/src/manifest.ts +5 -0
- package/src/methods/index.ts +8 -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 +83 -10
- package/src/team-settings.ts +38 -0
- package/src/team.ts +398 -0
- package/src/verify.ts +7 -0
package/dist/manifest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","names":[],"sources":["../src/manifest.ts"],"sourcesContent":["/**\n * The artifact manifest (INTERFACES §2.2, D51): the metadata an artifact declares in its entry, as\n * `export const artifact = defineArtifact({...})` in TSX or as YAML frontmatter in MDX. Mostra reads\n * it statically, so every value is a literal. The same type checks `defineArtifact` for authors,\n * validates the extracted literal in the supervisor and travels on the wire in `artifact/get`.\n *\n * ```ts\n * const checked = ArtifactManifest.safeParse(extracted);\n * ```\n */\nimport * as z from \"zod\";\nimport { Duration, durationMs } from \"./duration.ts\";\nimport { SubmissionPolicy } from \"./policy.ts\";\n\nexport { SubmissionPolicy };\n\nimport { ArtifactId } from \"./ids.ts\";\nimport { wireRegistry } from \"./wire-registry.ts\";\n\n/** The families Mostra's templates and gallery know; any other string is allowed too. */\nexport type ArtifactFamily =\n | \"questionnaire\"\n | \"proposal\"\n | \"prototype\"\n | \"review\"\n | \"dashboard\"\n | \"deck\"\n | \"demo\"\n | \"inbox\"\n | \"tasks\"\n | (string & {});\n\n/** A related artifact (PRODUCT J6): a later round, a follow-up, a replacement. */\nexport interface ArtifactLink {\n /** How this artifact relates to the other one. */\n readonly rel: \"round-of\" | \"follows\" | \"replaces\" | (string & {});\n /** The other artifact's ID. */\n readonly artifact: string;\n}\n\n/** A live terminal session the artifact declares (ROUND-3 §5.1, D65). */\nexport interface TerminalSpec {\n /** The program and its arguments. */\n readonly command: readonly string[];\n /** Its working directory, relative to the artifact's source. */\n readonly cwd?: string;\n /** Extra environment variables. */\n readonly env?: Readonly<Record<string, string>>;\n /** The terminal's width in cells. */\n readonly cols?: number;\n /** The terminal's height in cells. */\n readonly rows?: number;\n /** Whether viewers may type into it. Sessions are read-only by default. */\n readonly input?: boolean;\n}\n\n/** A web demo the artifact declares (ROUND-3 §5.4, TM-08): a command to run, or a port to attach to. */\nexport type DemoSpec =\n | {\n readonly command: readonly string[];\n readonly cwd?: string;\n readonly ready?: string;\n readonly bridge?: boolean;\n }\n | { readonly attach: number; readonly bridge?: boolean };\n\n/**\n * A count by choice the artifact opts into (D165 item 12, RM-07): every accepted submission adds\n * one to the choice its viewer-scoped `field` holds, counted in the submit transaction, and viewers\n * read the counts with `useLive(\"$tally/<field>\")`. A value outside `choices`, or none, counts\n * nothing, so free text is never shown.\n */\nexport interface TallySpec {\n /** The viewer-scoped field whose value is counted. */\n readonly field: string;\n /** The values counted: 2 to 50 distinct strings. */\n readonly choices: readonly string[];\n /** Below this many answers (default 0), viewers see only the total, never the counts. */\n readonly minTotal?: number;\n}\n\n/** How the artifact behaves on a remote server (D165, INTERFACES §18). */\nexport interface HostedSettings {\n /**\n * Relayed action runs while the owner instance is away (D165 item 4): `queue` (the default)\n * waits up to `limit` (default `24h`, at most `7d`), `fail` ends a run at once.\n */\n readonly offline?: { readonly actions?: \"queue\" | \"fail\"; readonly limit?: Duration };\n /** Who may trigger relayed actions (D159): `signed-in` (the default) or anyone with the `link`. */\n readonly actions?: \"signed-in\" | \"link\";\n /** Who may submit (D165 item 13): anyone with the `link` (the default), or `signed-in` viewers. */\n readonly submissions?: \"link\" | \"signed-in\";\n /** Link previews (D161): `generic` (the default) or the artifact's `title`. */\n readonly preview?: \"generic\" | \"title\";\n}\n\n/** The longest offline limit a hosted artifact may set: 7 days (D165 item 4). */\nexport const HOSTED_OFFLINE_LIMIT_MAX_MS: number = 7 * 24 * 60 * 60 * 1000;\n\n/** The offline limit of a hosted artifact that sets none: 24 hours (D165 item 4). */\nexport const HOSTED_OFFLINE_LIMIT_DEFAULT: Duration = \"24h\";\n\n/** The fewest and most choices a tally counts (INTERFACES §18.4). */\nexport const TALLY_CHOICES_MIN = 2;\n/** The most choices a tally counts. */\nexport const TALLY_CHOICES_MAX = 50;\n\n/** The artifact manifest (INTERFACES §2.2). Every field except `title` is optional. */\nexport interface ArtifactManifest {\n /** The artifact's ID. Written by `mostra new`; without one, the artifact is bound to its source path at first publish (D51). */\n readonly id?: string;\n /** The title people see. */\n readonly title: string;\n /** One or two sentences on what the artifact is for. */\n readonly description?: string;\n /** What kind of artifact it is; templates and the gallery group by it. */\n readonly family?: ArtifactFamily;\n /** Related artifacts. */\n readonly links?: readonly ArtifactLink[];\n /** How the artifact is built and served: `spa`, the default and the only mode in v1 (D19). */\n readonly mode?: \"spa\";\n /** The submission policy the artifact requests; the host decides (D39, D63). */\n readonly submission?: SubmissionPolicy;\n /** The kit's shadcn base (default `base`, D72) and theme. */\n readonly kit?: { readonly base?: \"base\" | \"radix\"; readonly theme?: string };\n /** Live terminal sessions by name (D65). */\n readonly terminals?: Readonly<Record<string, TerminalSpec>>;\n /** Web demos by name (D65). */\n readonly demos?: Readonly<Record<string, DemoSpec>>;\n /** Stability limits for the artifact's worker (D62). */\n readonly limits?: {\n readonly heapMb?: number;\n readonly watchdogMs?: number;\n readonly idleMinutes?: number;\n };\n /** `verify` settings (D65). */\n readonly verify?: {\n readonly viewports?: readonly string[];\n readonly frames?: readonly string[];\n readonly extraChecks?: readonly string[];\n readonly smoke?: boolean;\n };\n /** Counts by choice of fixed-choice fields (D165 item 12). */\n readonly tally?: readonly TallySpec[];\n /** How the artifact behaves on a remote server (D165). */\n readonly hosted?: HostedSettings;\n}\n\n/** The keys of the artifact manifest, in INTERFACES §2.2 order. Other keys are warnings (FAILURE_MODEL §10). */\nexport const ARTIFACT_MANIFEST_KEYS: readonly (keyof ArtifactManifest)[] = [\n \"id\",\n \"title\",\n \"description\",\n \"family\",\n \"links\",\n \"mode\",\n \"submission\",\n \"kit\",\n \"terminals\",\n \"demos\",\n \"limits\",\n \"verify\",\n \"tally\",\n \"hosted\",\n];\n\nconst strings = z.array(z.string()).readonly();\n\n/** The Zod schema of the `ArtifactLink` type. */\nexport const ArtifactLink: z.ZodType<ArtifactLink> = z\n .object({ rel: z.string().min(1), artifact: z.string().min(1) })\n .register(wireRegistry, {\n id: \"ArtifactLink\",\n description: \"A related artifact: how this one relates (rel) and the other artifact's ID.\",\n });\n\nconst TerminalSpec: z.ZodType<TerminalSpec> = z.object({\n command: z.array(z.string()).min(1).readonly(),\n cwd: z.string().exactOptional(),\n env: z.record(z.string(), z.string()).readonly().exactOptional(),\n cols: z.int().min(1).exactOptional(),\n rows: z.int().min(1).exactOptional(),\n input: z.boolean().exactOptional(),\n});\n\nconst DemoSpec: z.ZodType<DemoSpec> = z.union([\n z.object({\n command: z.array(z.string()).min(1).readonly(),\n cwd: z.string().exactOptional(),\n ready: z.string().exactOptional(),\n bridge: z.boolean().exactOptional(),\n }),\n z.object({ attach: z.int().min(1).max(65535), bridge: z.boolean().exactOptional() }),\n]);\n\n/** The Zod schema of the `TallySpec` type. */\nexport const TallySpec: z.ZodType<TallySpec> = z\n .object({\n field: z.string().min(1).max(256),\n choices: z\n .array(z.string().min(1).max(256))\n .min(TALLY_CHOICES_MIN)\n .max(TALLY_CHOICES_MAX)\n .readonly(),\n minTotal: z.int().min(0).exactOptional(),\n })\n .register(wireRegistry, {\n id: \"TallySpec\",\n description:\n \"A count by choice of a viewer-scoped field: its field, 2 to 50 distinct choices and minTotal.\",\n });\n\n/** The Zod schema of the `HostedSettings` type. */\nexport const HostedSettings: z.ZodType<HostedSettings> = z\n .object({\n offline: z\n .object({\n actions: z.enum([\"queue\", \"fail\"]).exactOptional(),\n limit: Duration.exactOptional(),\n })\n .exactOptional(),\n actions: z.enum([\"signed-in\", \"link\"]).exactOptional(),\n submissions: z.enum([\"link\", \"signed-in\"]).exactOptional(),\n preview: z.enum([\"generic\", \"title\"]).exactOptional(),\n })\n .register(wireRegistry, {\n id: \"HostedSettings\",\n description:\n \"How an artifact behaves on a remote server: offline actions, who may act and submit, previews.\",\n });\n\n/** The Zod schema of the `ArtifactManifest` type. Objects stay open, so newer keys pass through. */\nexport const ArtifactManifest: z.ZodType<ArtifactManifest> = z\n .object({\n id: ArtifactId.schema.exactOptional(),\n title: z.string().min(1),\n description: z.string().exactOptional(),\n family: z.string().min(1).exactOptional(),\n links: z.array(ArtifactLink).readonly().exactOptional(),\n mode: z.literal(\"spa\").exactOptional(),\n submission: SubmissionPolicy.exactOptional(),\n kit: z\n .object({\n base: z.enum([\"base\", \"radix\"]).exactOptional(),\n theme: z.string().exactOptional(),\n })\n .exactOptional(),\n terminals: z.record(z.string(), TerminalSpec).readonly().exactOptional(),\n demos: z.record(z.string(), DemoSpec).readonly().exactOptional(),\n limits: z\n .object({\n heapMb: z.int().min(1).exactOptional(),\n watchdogMs: z.int().min(1).exactOptional(),\n idleMinutes: z.number().min(0).exactOptional(),\n })\n .exactOptional(),\n verify: z\n .object({\n viewports: strings.exactOptional(),\n frames: strings.exactOptional(),\n extraChecks: strings.exactOptional(),\n smoke: z.boolean().exactOptional(),\n })\n .exactOptional(),\n tally: z.array(TallySpec).readonly().exactOptional(),\n hosted: HostedSettings.exactOptional(),\n })\n .register(wireRegistry, {\n id: \"ArtifactManifest\",\n description:\n \"The artifact manifest (INTERFACES §2.2): literal metadata from the entry's defineArtifact call or MDX frontmatter.\",\n });\n\n/**\n * The rules of a manifest that JSON Schema can't state, checked after its schema by everything\n * that reads a manifest (D165 items 4, 12): a tally's choices are distinct, each field is tallied\n * once, and an offline limit is at most 7 days. Answers the first problem, with its field's path.\n */\nexport function manifestProblem(\n manifest: ArtifactManifest,\n): { readonly path: string; readonly message: string } | undefined {\n const fields = new Set<string>();\n for (const [index, tally] of (manifest.tally ?? []).entries()) {\n if (new Set(tally.choices).size !== tally.choices.length) {\n return { path: `tally.${index}.choices`, message: \"a tally's choices must be distinct\" };\n }\n if (fields.has(tally.field)) {\n return { path: `tally.${index}.field`, message: `\\`${tally.field}\\` is tallied twice` };\n }\n fields.add(tally.field);\n }\n const limit = manifest.hosted?.offline?.limit;\n if (limit !== undefined && durationMs(limit) > HOSTED_OFFLINE_LIMIT_MAX_MS) {\n return { path: \"hosted.offline.limit\", message: \"an offline limit is at most 7d\" };\n }\n return undefined;\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"manifest.js","names":[],"sources":["../src/manifest.ts"],"sourcesContent":["/**\n * The artifact manifest (INTERFACES §2.2, D51): the metadata an artifact declares in its entry, as\n * `export const artifact = defineArtifact({...})` in TSX or as YAML frontmatter in MDX. Mostra reads\n * it statically, so every value is a literal. The same type checks `defineArtifact` for authors,\n * validates the extracted literal in the supervisor and travels on the wire in `artifact/get`.\n *\n * ```ts\n * const checked = ArtifactManifest.safeParse(extracted);\n * ```\n */\nimport * as z from \"zod\";\nimport { Duration, durationMs } from \"./duration.ts\";\nimport { SubmissionPolicy } from \"./policy.ts\";\n\nexport { SubmissionPolicy };\n\nimport { ArtifactId } from \"./ids.ts\";\nimport { TeamSettings } from \"./team-settings.ts\";\nimport { wireRegistry } from \"./wire-registry.ts\";\n\n/** The families Mostra's templates and gallery know; any other string is allowed too. */\nexport type ArtifactFamily =\n | \"questionnaire\"\n | \"proposal\"\n | \"prototype\"\n | \"review\"\n | \"dashboard\"\n | \"deck\"\n | \"demo\"\n | \"inbox\"\n | \"tasks\"\n | (string & {});\n\n/** A related artifact (PRODUCT J6): a later round, a follow-up, a replacement. */\nexport interface ArtifactLink {\n /** How this artifact relates to the other one. */\n readonly rel: \"round-of\" | \"follows\" | \"replaces\" | (string & {});\n /** The other artifact's ID. */\n readonly artifact: string;\n}\n\n/** A live terminal session the artifact declares (ROUND-3 §5.1, D65). */\nexport interface TerminalSpec {\n /** The program and its arguments. */\n readonly command: readonly string[];\n /** Its working directory, relative to the artifact's source. */\n readonly cwd?: string;\n /** Extra environment variables. */\n readonly env?: Readonly<Record<string, string>>;\n /** The terminal's width in cells. */\n readonly cols?: number;\n /** The terminal's height in cells. */\n readonly rows?: number;\n /** Whether viewers may type into it. Sessions are read-only by default. */\n readonly input?: boolean;\n}\n\n/** A web demo the artifact declares (ROUND-3 §5.4, TM-08): a command to run, or a port to attach to. */\nexport type DemoSpec =\n | {\n readonly command: readonly string[];\n readonly cwd?: string;\n readonly ready?: string;\n readonly bridge?: boolean;\n }\n | { readonly attach: number; readonly bridge?: boolean };\n\n/**\n * A count by choice the artifact opts into (D165 item 12, RM-07): every accepted submission adds\n * one to the choice its viewer-scoped `field` holds, counted in the submit transaction, and viewers\n * read the counts with `useLive(\"$tally/<field>\")`. A value outside `choices`, or none, counts\n * nothing, so free text is never shown.\n */\nexport interface TallySpec {\n /** The viewer-scoped field whose value is counted. */\n readonly field: string;\n /** The values counted: 2 to 50 distinct strings. */\n readonly choices: readonly string[];\n /** Below this many answers (default 0), viewers see only the total, never the counts. */\n readonly minTotal?: number;\n}\n\n/** How the artifact behaves on a remote server (D165, INTERFACES §18). */\nexport interface HostedSettings {\n /**\n * Relayed action runs while the owner instance is away (D165 item 4): `queue` (the default)\n * waits up to `limit` (default `24h`, at most `7d`), `fail` ends a run at once.\n */\n readonly offline?: { readonly actions?: \"queue\" | \"fail\"; readonly limit?: Duration };\n /** Who may trigger relayed actions (D159): `signed-in` (the default) or anyone with the `link`. */\n readonly actions?: \"signed-in\" | \"link\";\n /** Who may submit (D165 item 13): anyone with the `link` (the default), or `signed-in` viewers. */\n readonly submissions?: \"link\" | \"signed-in\";\n /** Link previews (D161): `generic` (the default) or the artifact's `title`. */\n readonly preview?: \"generic\" | \"title\";\n}\n\n/** The longest offline limit a hosted artifact may set: 7 days (D165 item 4). */\nexport const HOSTED_OFFLINE_LIMIT_MAX_MS: number = 7 * 24 * 60 * 60 * 1000;\n\n/** The offline limit of a hosted artifact that sets none: 24 hours (D165 item 4). */\nexport const HOSTED_OFFLINE_LIMIT_DEFAULT: Duration = \"24h\";\n\n/** The fewest and most choices a tally counts (INTERFACES §18.4). */\nexport const TALLY_CHOICES_MIN = 2;\n/** The most choices a tally counts. */\nexport const TALLY_CHOICES_MAX = 50;\n\n/** The artifact manifest (INTERFACES §2.2). Every field except `title` is optional. */\nexport interface ArtifactManifest {\n /** The artifact's ID. Written by `mostra new`; without one, the artifact is bound to its source path at first publish (D51). */\n readonly id?: string;\n /** The title people see. */\n readonly title: string;\n /** One or two sentences on what the artifact is for. */\n readonly description?: string;\n /** What kind of artifact it is; templates and the gallery group by it. */\n readonly family?: ArtifactFamily;\n /** Related artifacts. */\n readonly links?: readonly ArtifactLink[];\n /** How the artifact is built and served: `spa`, the default and the only mode in v1 (D19). */\n readonly mode?: \"spa\";\n /** The submission policy the artifact requests; the host decides (D39, D63). */\n readonly submission?: SubmissionPolicy;\n /** The kit's shadcn base (default `base`, D72) and theme. */\n readonly kit?: { readonly base?: \"base\" | \"radix\"; readonly theme?: string };\n /** Live terminal sessions by name (D65). */\n readonly terminals?: Readonly<Record<string, TerminalSpec>>;\n /** Web demos by name (D65). */\n readonly demos?: Readonly<Record<string, DemoSpec>>;\n /** Stability limits for the artifact's worker (D62). */\n readonly limits?: {\n readonly heapMb?: number;\n readonly watchdogMs?: number;\n readonly idleMinutes?: number;\n };\n /** `verify` settings (D65). */\n readonly verify?: {\n readonly viewports?: readonly string[];\n readonly frames?: readonly string[];\n readonly extraChecks?: readonly string[];\n readonly smoke?: boolean;\n };\n /** Counts by choice of fixed-choice fields (D165 item 12). */\n readonly tally?: readonly TallySpec[];\n /** How the artifact behaves on a remote server (D165). */\n readonly hosted?: HostedSettings;\n /** Team settings: what viewers see of each other's status and presence (D168). */\n readonly team?: TeamSettings;\n}\n\n/** The keys of the artifact manifest, in INTERFACES §2.2 order. Other keys are warnings (FAILURE_MODEL §10). */\nexport const ARTIFACT_MANIFEST_KEYS: readonly (keyof ArtifactManifest)[] = [\n \"id\",\n \"title\",\n \"description\",\n \"family\",\n \"links\",\n \"mode\",\n \"submission\",\n \"kit\",\n \"terminals\",\n \"demos\",\n \"limits\",\n \"verify\",\n \"tally\",\n \"hosted\",\n \"team\",\n];\n\nconst strings = z.array(z.string()).readonly();\n\n/** The Zod schema of the `ArtifactLink` type. */\nexport const ArtifactLink: z.ZodType<ArtifactLink> = z\n .object({ rel: z.string().min(1), artifact: z.string().min(1) })\n .register(wireRegistry, {\n id: \"ArtifactLink\",\n description: \"A related artifact: how this one relates (rel) and the other artifact's ID.\",\n });\n\nconst TerminalSpec: z.ZodType<TerminalSpec> = z.object({\n command: z.array(z.string()).min(1).readonly(),\n cwd: z.string().exactOptional(),\n env: z.record(z.string(), z.string()).readonly().exactOptional(),\n cols: z.int().min(1).exactOptional(),\n rows: z.int().min(1).exactOptional(),\n input: z.boolean().exactOptional(),\n});\n\nconst DemoSpec: z.ZodType<DemoSpec> = z.union([\n z.object({\n command: z.array(z.string()).min(1).readonly(),\n cwd: z.string().exactOptional(),\n ready: z.string().exactOptional(),\n bridge: z.boolean().exactOptional(),\n }),\n z.object({ attach: z.int().min(1).max(65535), bridge: z.boolean().exactOptional() }),\n]);\n\n/** The Zod schema of the `TallySpec` type. */\nexport const TallySpec: z.ZodType<TallySpec> = z\n .object({\n field: z.string().min(1).max(256),\n choices: z\n .array(z.string().min(1).max(256))\n .min(TALLY_CHOICES_MIN)\n .max(TALLY_CHOICES_MAX)\n .readonly(),\n minTotal: z.int().min(0).exactOptional(),\n })\n .register(wireRegistry, {\n id: \"TallySpec\",\n description:\n \"A count by choice of a viewer-scoped field: its field, 2 to 50 distinct choices and minTotal.\",\n });\n\n/** The Zod schema of the `HostedSettings` type. */\nexport const HostedSettings: z.ZodType<HostedSettings> = z\n .object({\n offline: z\n .object({\n actions: z.enum([\"queue\", \"fail\"]).exactOptional(),\n limit: Duration.exactOptional(),\n })\n .exactOptional(),\n actions: z.enum([\"signed-in\", \"link\"]).exactOptional(),\n submissions: z.enum([\"link\", \"signed-in\"]).exactOptional(),\n preview: z.enum([\"generic\", \"title\"]).exactOptional(),\n })\n .register(wireRegistry, {\n id: \"HostedSettings\",\n description:\n \"How an artifact behaves on a remote server: offline actions, who may act and submit, previews.\",\n });\n\n/** The Zod schema of the `ArtifactManifest` type. Objects stay open, so newer keys pass through. */\nexport const ArtifactManifest: z.ZodType<ArtifactManifest> = z\n .object({\n id: ArtifactId.schema.exactOptional(),\n title: z.string().min(1),\n description: z.string().exactOptional(),\n family: z.string().min(1).exactOptional(),\n links: z.array(ArtifactLink).readonly().exactOptional(),\n mode: z.literal(\"spa\").exactOptional(),\n submission: SubmissionPolicy.exactOptional(),\n kit: z\n .object({\n base: z.enum([\"base\", \"radix\"]).exactOptional(),\n theme: z.string().exactOptional(),\n })\n .exactOptional(),\n terminals: z.record(z.string(), TerminalSpec).readonly().exactOptional(),\n demos: z.record(z.string(), DemoSpec).readonly().exactOptional(),\n limits: z\n .object({\n heapMb: z.int().min(1).exactOptional(),\n watchdogMs: z.int().min(1).exactOptional(),\n idleMinutes: z.number().min(0).exactOptional(),\n })\n .exactOptional(),\n verify: z\n .object({\n viewports: strings.exactOptional(),\n frames: strings.exactOptional(),\n extraChecks: strings.exactOptional(),\n smoke: z.boolean().exactOptional(),\n })\n .exactOptional(),\n tally: z.array(TallySpec).readonly().exactOptional(),\n hosted: HostedSettings.exactOptional(),\n team: TeamSettings.exactOptional(),\n })\n .register(wireRegistry, {\n id: \"ArtifactManifest\",\n description:\n \"The artifact manifest (INTERFACES §2.2): literal metadata from the entry's defineArtifact call or MDX frontmatter.\",\n });\n\n/**\n * The rules of a manifest that JSON Schema can't state, checked after its schema by everything\n * that reads a manifest (D165 items 4, 12): a tally's choices are distinct, each field is tallied\n * once, and an offline limit is at most 7 days. Answers the first problem, with its field's path.\n */\nexport function manifestProblem(\n manifest: ArtifactManifest,\n): { readonly path: string; readonly message: string } | undefined {\n const fields = new Set<string>();\n for (const [index, tally] of (manifest.tally ?? []).entries()) {\n if (new Set(tally.choices).size !== tally.choices.length) {\n return { path: `tally.${index}.choices`, message: \"a tally's choices must be distinct\" };\n }\n if (fields.has(tally.field)) {\n return { path: `tally.${index}.field`, message: `\\`${tally.field}\\` is tallied twice` };\n }\n fields.add(tally.field);\n }\n const limit = manifest.hosted?.offline?.limit;\n if (limit !== undefined && durationMs(limit) > HOSTED_OFFLINE_LIMIT_MAX_MS) {\n return { path: \"hosted.offline.limit\", message: \"an offline limit is at most 7d\" };\n }\n return undefined;\n}\n"],"mappings":"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"}
|
|
@@ -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
|
@@ -20,6 +20,8 @@ import { portSubmissionsDeliverMethod } from "./port/submissions-deliver.js";
|
|
|
20
20
|
import { hostedSubmissionMethod } from "./hosted/submission.js";
|
|
21
21
|
import { instanceCheckMethod } from "./instance/check.js";
|
|
22
22
|
import { mostraInitializeMethod } from "./mostra/initialize.js";
|
|
23
|
+
import { viewUrlMethod } from "./view/url.js";
|
|
24
|
+
import { rosterAddMethod } from "./roster/add.js";
|
|
23
25
|
import { shareStartMethod } from "./share/start.js";
|
|
24
26
|
import { instanceStatusMethod } from "./instance/status.js";
|
|
25
27
|
import { livePushMethod } from "./live/push.js";
|
|
@@ -47,6 +49,9 @@ import { remoteLogoutMethod } from "./remote/logout.js";
|
|
|
47
49
|
import { remoteStatusMethod } from "./remote/status.js";
|
|
48
50
|
import { remoteTokenMethod } from "./remote/token.js";
|
|
49
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";
|
|
50
55
|
import { secretDeleteMethod } from "./secret/delete.js";
|
|
51
56
|
import { secretSetMethod } from "./secret/set.js";
|
|
52
57
|
import { secretListMethod } from "./secret/list.js";
|
|
@@ -54,7 +59,6 @@ import { shareListMethod } from "./share/list.js";
|
|
|
54
59
|
import { shareStopMethod } from "./share/stop.js";
|
|
55
60
|
import { stateGetMethod } from "./state/get.js";
|
|
56
61
|
import { statePatchMethod } from "./state/patch.js";
|
|
57
|
-
import { viewUrlMethod } from "./view/url.js";
|
|
58
62
|
import { viewDefaultMethod } from "./view/default.js";
|
|
59
63
|
import { viewLaunchMethod } from "./view/launch.js";
|
|
60
64
|
import { viewRevokeMethod } from "./view/revoke.js";
|
|
@@ -123,7 +127,11 @@ const hostMethods = [
|
|
|
123
127
|
hostedSubmissionMethod,
|
|
124
128
|
artifactPauseMethod,
|
|
125
129
|
portRelayAuthorMethod,
|
|
126
|
-
remoteLinkMethod
|
|
130
|
+
remoteLinkMethod,
|
|
131
|
+
rosterAddMethod,
|
|
132
|
+
rosterRemoveMethod,
|
|
133
|
+
rosterGetMethod,
|
|
134
|
+
resultsListMethod
|
|
127
135
|
];
|
|
128
136
|
/** Every notification the instance sends to its clients (INTERFACES §6). */
|
|
129
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 { 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":"
|
|
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;;;;;
|
|
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"}
|
|
@@ -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
|
-
/**
|
|
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":"
|
|
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"}
|