@mostra/protocol 0.14.0 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/artifact-path.d.ts +22 -0
  2. package/dist/artifact-path.d.ts.map +1 -0
  3. package/dist/artifact-path.js +39 -0
  4. package/dist/artifact-path.js.map +1 -0
  5. package/dist/diagnostics/codes/index.d.ts +5 -2
  6. package/dist/diagnostics/codes/index.d.ts.map +1 -1
  7. package/dist/diagnostics/codes/index.js +7 -1
  8. package/dist/diagnostics/codes/index.js.map +1 -1
  9. package/dist/diagnostics/codes/license.d.ts +8 -0
  10. package/dist/diagnostics/codes/license.d.ts.map +1 -0
  11. package/dist/diagnostics/codes/license.js +55 -0
  12. package/dist/diagnostics/codes/license.js.map +1 -0
  13. package/dist/diagnostics/codes/pack.d.ts +8 -0
  14. package/dist/diagnostics/codes/pack.d.ts.map +1 -0
  15. package/dist/diagnostics/codes/pack.js +110 -0
  16. package/dist/diagnostics/codes/pack.js.map +1 -0
  17. package/dist/diagnostics/codes/plugin.d.ts +8 -0
  18. package/dist/diagnostics/codes/plugin.d.ts.map +1 -0
  19. package/dist/diagnostics/codes/plugin.js +154 -0
  20. package/dist/diagnostics/codes/plugin.js.map +1 -0
  21. package/dist/diagnostics/diagnostic.d.ts +1 -1
  22. package/dist/diagnostics/diagnostic.d.ts.map +1 -1
  23. package/dist/diagnostics/diagnostic.js +4 -1
  24. package/dist/diagnostics/diagnostic.js.map +1 -1
  25. package/dist/index.d.ts +13 -1
  26. package/dist/index.js +13 -1
  27. package/dist/methods/deps/add.d.ts +6 -0
  28. package/dist/methods/deps/add.d.ts.map +1 -1
  29. package/dist/methods/deps/add.js +1 -0
  30. package/dist/methods/deps/add.js.map +1 -1
  31. package/dist/methods/index.d.ts.map +1 -1
  32. package/dist/methods/index.js +15 -1
  33. package/dist/methods/index.js.map +1 -1
  34. package/dist/methods/mostra/initialize.d.ts +7 -0
  35. package/dist/methods/mostra/initialize.d.ts.map +1 -1
  36. package/dist/methods/mostra/initialize.js +4 -2
  37. package/dist/methods/mostra/initialize.js.map +1 -1
  38. package/dist/methods/pack/add.d.ts +80 -0
  39. package/dist/methods/pack/add.d.ts.map +1 -0
  40. package/dist/methods/pack/add.js +59 -0
  41. package/dist/methods/pack/add.js.map +1 -0
  42. package/dist/methods/plugin/add.d.ts +43 -0
  43. package/dist/methods/plugin/add.d.ts.map +1 -0
  44. package/dist/methods/plugin/add.js +39 -0
  45. package/dist/methods/plugin/add.js.map +1 -0
  46. package/dist/methods/plugin/commands.d.ts +38 -0
  47. package/dist/methods/plugin/commands.d.ts.map +1 -0
  48. package/dist/methods/plugin/commands.js +33 -0
  49. package/dist/methods/plugin/commands.js.map +1 -0
  50. package/dist/methods/plugin/export.d.ts +58 -0
  51. package/dist/methods/plugin/export.d.ts.map +1 -0
  52. package/dist/methods/plugin/export.js +57 -0
  53. package/dist/methods/plugin/export.js.map +1 -0
  54. package/dist/methods/plugin/list.d.ts +26 -0
  55. package/dist/methods/plugin/list.d.ts.map +1 -0
  56. package/dist/methods/plugin/list.js +30 -0
  57. package/dist/methods/plugin/list.js.map +1 -0
  58. package/dist/methods/plugin/remove.d.ts +32 -0
  59. package/dist/methods/plugin/remove.d.ts.map +1 -0
  60. package/dist/methods/plugin/remove.js +33 -0
  61. package/dist/methods/plugin/remove.js.map +1 -0
  62. package/dist/methods/plugin/validate.d.ts +35 -0
  63. package/dist/methods/plugin/validate.d.ts.map +1 -0
  64. package/dist/methods/plugin/validate.js +33 -0
  65. package/dist/methods/plugin/validate.js.map +1 -0
  66. package/dist/plugin/contract-versions.generated.js +14 -0
  67. package/dist/plugin/contract-versions.generated.js.map +1 -0
  68. package/dist/plugin/contracts.d.ts +51 -0
  69. package/dist/plugin/contracts.d.ts.map +1 -0
  70. package/dist/plugin/contracts.js +129 -0
  71. package/dist/plugin/contracts.js.map +1 -0
  72. package/dist/plugin/license.d.ts +87 -0
  73. package/dist/plugin/license.d.ts.map +1 -0
  74. package/dist/plugin/license.js +243 -0
  75. package/dist/plugin/license.js.map +1 -0
  76. package/dist/plugin/manifest.d.ts +141 -0
  77. package/dist/plugin/manifest.d.ts.map +1 -0
  78. package/dist/plugin/manifest.js +281 -0
  79. package/dist/plugin/manifest.js.map +1 -0
  80. package/dist/plugin/registry-item.d.ts +171 -0
  81. package/dist/plugin/registry-item.d.ts.map +1 -0
  82. package/dist/plugin/registry-item.js +162 -0
  83. package/dist/plugin/registry-item.js.map +1 -0
  84. package/dist/plugin/spdx.generated.d.ts +9 -0
  85. package/dist/plugin/spdx.generated.d.ts.map +1 -0
  86. package/dist/plugin/spdx.generated.js +846 -0
  87. package/dist/plugin/spdx.generated.js.map +1 -0
  88. package/dist/plugin.d.ts +7 -0
  89. package/dist/plugin.js +6 -0
  90. package/dist/plugins.d.ts +118 -0
  91. package/dist/plugins.d.ts.map +1 -0
  92. package/dist/plugins.js +109 -0
  93. package/dist/plugins.js.map +1 -0
  94. package/package.json +19 -4
  95. package/schemas/plugin-manifest.draft-07.json +611 -0
  96. package/schemas/plugin-manifest.schema.json +607 -0
  97. package/schemas/protocol.draft-07.json +899 -1
  98. package/schemas/protocol.schema.json +875 -1
  99. package/src/artifact-path.ts +46 -0
  100. package/src/diagnostics/codes/index.ts +14 -2
  101. package/src/diagnostics/codes/license.ts +65 -0
  102. package/src/diagnostics/codes/pack.ts +125 -0
  103. package/src/diagnostics/codes/plugin.ts +173 -0
  104. package/src/diagnostics/diagnostic.ts +7 -1
  105. package/src/index.ts +57 -0
  106. package/src/methods/deps/add.ts +7 -0
  107. package/src/methods/index.ts +14 -0
  108. package/src/methods/mostra/initialize.ts +9 -1
  109. package/src/methods/pack/add.ts +133 -0
  110. package/src/methods/plugin/add.ts +70 -0
  111. package/src/methods/plugin/commands.ts +67 -0
  112. package/src/methods/plugin/export.ts +100 -0
  113. package/src/methods/plugin/list.ts +45 -0
  114. package/src/methods/plugin/remove.ts +58 -0
  115. package/src/methods/plugin/validate.ts +60 -0
  116. package/src/plugin/contract-versions.generated.ts +15 -0
  117. package/src/plugin/contracts.ts +171 -0
  118. package/src/plugin/license.ts +320 -0
  119. package/src/plugin/manifest.ts +546 -0
  120. package/src/plugin/registry-item.ts +330 -0
  121. package/src/plugin/spdx-tables.ts +74 -0
  122. package/src/plugin/spdx.generated.ts +844 -0
  123. package/src/plugin.ts +77 -0
  124. package/src/plugins.ts +239 -0
  125. package/LICENSE +0 -202
@@ -0,0 +1,80 @@
1
+ import { SourceRef } from "../../artifact.js";
2
+ import { Diagnostic } from "../../diagnostics/diagnostic.js";
3
+ import { MethodDefinition } from "../../method.js";
4
+ import { AddedPackage } from "../deps/add.js";
5
+ import { LicenseDisclosure } from "../../plugins.js";
6
+ //#region src/methods/pack/add.d.ts
7
+ /** The params of `pack/add` (INTERFACES §14). */
8
+ export interface PackAddParams {
9
+ /** The artifact the items' files are copied into. */
10
+ readonly artifact: SourceRef;
11
+ /**
12
+ * What to add, in shadcn's address forms: an item's URL, a local `.json` item, a GitHub item
13
+ * (`owner/repo/item[#ref]`), or `@namespace/item` from the artifact's `components.json`
14
+ * `registries`. Anything else is an npm spec, added as `deps/add` adds it.
15
+ */
16
+ readonly specs: readonly string[];
17
+ /** Replace files the artifact already has with other content (shadcn's `--overwrite`). */
18
+ readonly overwrite?: boolean;
19
+ /** Licenses acknowledged for the items and the npm packages they bring (D31). */
20
+ readonly acceptLicenses?: readonly string[];
21
+ /**
22
+ * The caller's values of the variables reading the items needs, which win over the instance's
23
+ * own environment (a daemon started before they were set): those `components.json` names as
24
+ * `${VAR}`, `GH_TOKEN`, `GITHUB_TOKEN`, `REGISTRY_URL` and the proxy variables
25
+ * (`packVariables` in `@mostra/protocol/plugin` lists them).
26
+ */
27
+ readonly environment?: Readonly<Record<string, string>>;
28
+ /** Makes retries idempotent: a repeated `requestId` returns the recorded result (H-03). */
29
+ readonly requestId?: string;
30
+ }
31
+ /** One item `pack/add` installed. */
32
+ export interface PackItemSummary {
33
+ /** The item's `name`. */
34
+ readonly name: string;
35
+ /** Its `type` (`registry:ui` …). */
36
+ readonly type: string;
37
+ /** The address it was asked for by, or a dependency's. */
38
+ readonly address: string;
39
+ /** Where it was read: a URL, or a file. */
40
+ readonly source: string;
41
+ /** The item that needed it, for a registry dependency. */
42
+ readonly requiredBy?: string;
43
+ /** The field IDs its components introduce, from its `mostra` block. */
44
+ readonly fields?: readonly string[];
45
+ }
46
+ /** One file `pack/add` wrote. */
47
+ export interface PackFileChange {
48
+ /** Its path in the artifact, `/`-separated. */
49
+ readonly path: string;
50
+ /** `created`, `overwritten` (with `overwrite`), `unchanged` (it already held this content), or `updated` (a stylesheet the items' CSS joined). */
51
+ readonly action: "created" | "overwritten" | "unchanged" | "updated";
52
+ }
53
+ /** The result of `pack/add`. */
54
+ export interface PackAddResult {
55
+ /** The items installed, registry dependencies included, in install order. */
56
+ readonly items: readonly PackItemSummary[];
57
+ /** Every file written. */
58
+ readonly files: readonly PackFileChange[];
59
+ /** The npm packages added, the items' and the plain specs', as `deps/add` answers them. */
60
+ readonly packages: readonly AddedPackage[];
61
+ /** The licenses of those packages, with their classes (D31). */
62
+ readonly licenses: readonly LicenseDisclosure[];
63
+ /** The lockfile's digest after the change, when packages were added. */
64
+ readonly lockDigest?: string;
65
+ /**
66
+ * What the items asked for that Mostra applied otherwise or not at all (environment variables,
67
+ * Tailwind 3 configuration, a stylesheet the entry doesn't import), as warnings and hints.
68
+ */
69
+ readonly notes: readonly Diagnostic[];
70
+ }
71
+ /**
72
+ * `pack/add`: copies source-pack items (shadcn registry items, with or without a `mostra` block,
73
+ * EX-03) into an artifact's source, with their registry dependencies, merges their CSS into its
74
+ * stylesheet, and adds their npm dependencies, and any plain npm specs, as `deps/add` does. Every
75
+ * file is checked before any is written, and none is replaced without `overwrite`. The method
76
+ * behind `mostra add`.
77
+ */
78
+ export declare const packAddMethod: MethodDefinition<PackAddParams, PackAddResult>;
79
+ //#endregion
80
+ //# sourceMappingURL=add.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.d.ts","names":[],"sources":["../../../src/methods/pack/add.ts"],"mappings":";;;;;;;iBASiB;;WAEN,UAAU;;;;;;WAMV;;WAEA;;WAEA;;;;;;;WAOA,cAAc,SAAS;;WAEvB;;;iBAIM;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;iBAIM;;WAEN;;WAEA;;;iBAIM;;WAEN,gBAAgB;;WAEhB,gBAAgB;;WAEhB,mBAAmB;;WAEnB,mBAAmB;;WAEnB;;;;;WAKA,gBAAgB;;;;;;;;;qBAqDd,eAAe,iBAAiB,eAAe"}
@@ -0,0 +1,59 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { SourceRef } from "../../artifact.js";
3
+ import { Diagnostic } from "../../diagnostics/diagnostic.js";
4
+ import { defineMethod } from "../../method.js";
5
+ import { AddedPackage } from "../deps/add.js";
6
+ import { LicenseDisclosure } from "../../plugins.js";
7
+ import * as z from "zod";
8
+ //#region src/methods/pack/add.ts
9
+ const PackItemSummary = z.object({
10
+ name: z.string(),
11
+ type: z.string(),
12
+ address: z.string(),
13
+ source: z.string(),
14
+ requiredBy: z.string().exactOptional(),
15
+ fields: z.array(z.string()).readonly().exactOptional()
16
+ }).register(wireRegistry, { id: "PackItemSummary" });
17
+ const PackFileChange = z.object({
18
+ path: z.string().min(1),
19
+ action: z.enum([
20
+ "created",
21
+ "overwritten",
22
+ "unchanged",
23
+ "updated"
24
+ ])
25
+ }).register(wireRegistry, { id: "PackFileChange" });
26
+ const params = z.object({
27
+ artifact: SourceRef,
28
+ specs: z.array(z.string().min(1)).min(1).readonly(),
29
+ overwrite: z.boolean().exactOptional(),
30
+ acceptLicenses: z.array(z.string().min(1).max(256)).readonly().exactOptional(),
31
+ environment: z.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/), z.string()).exactOptional(),
32
+ requestId: z.string().min(1).exactOptional()
33
+ }).register(wireRegistry, { id: "PackAddParams" });
34
+ const result = z.object({
35
+ items: z.array(PackItemSummary).readonly(),
36
+ files: z.array(PackFileChange).readonly(),
37
+ packages: z.array(AddedPackage).readonly(),
38
+ licenses: z.array(LicenseDisclosure).readonly(),
39
+ lockDigest: z.string().regex(/^[0-9a-f]{64}$/).exactOptional(),
40
+ notes: z.array(Diagnostic).readonly()
41
+ }).register(wireRegistry, { id: "PackAddResult" });
42
+ /**
43
+ * `pack/add`: copies source-pack items (shadcn registry items, with or without a `mostra` block,
44
+ * EX-03) into an artifact's source, with their registry dependencies, merges their CSS into its
45
+ * stylesheet, and adds their npm dependencies, and any plain npm specs, as `deps/add` does. Every
46
+ * file is checked before any is written, and none is replaced without `overwrite`. The method
47
+ * behind `mostra add`.
48
+ */
49
+ const packAddMethod = defineMethod({
50
+ method: "pack/add",
51
+ direction: "client-to-instance",
52
+ mutating: true,
53
+ params,
54
+ result
55
+ });
56
+ //#endregion
57
+ export { packAddMethod };
58
+
59
+ //# sourceMappingURL=add.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.js","names":[],"sources":["../../../src/methods/pack/add.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { SourceRef } from \"../../artifact.ts\";\nimport { Diagnostic } from \"../../diagnostics/diagnostic.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { LicenseDisclosure } from \"../../plugins.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\nimport { AddedPackage } from \"../deps/add.ts\";\n\n/** The params of `pack/add` (INTERFACES §14). */\nexport interface PackAddParams {\n /** The artifact the items' files are copied into. */\n readonly artifact: SourceRef;\n /**\n * What to add, in shadcn's address forms: an item's URL, a local `.json` item, a GitHub item\n * (`owner/repo/item[#ref]`), or `@namespace/item` from the artifact's `components.json`\n * `registries`. Anything else is an npm spec, added as `deps/add` adds it.\n */\n readonly specs: readonly string[];\n /** Replace files the artifact already has with other content (shadcn's `--overwrite`). */\n readonly overwrite?: boolean;\n /** Licenses acknowledged for the items and the npm packages they bring (D31). */\n readonly acceptLicenses?: readonly string[];\n /**\n * The caller's values of the variables reading the items needs, which win over the instance's\n * own environment (a daemon started before they were set): those `components.json` names as\n * `${VAR}`, `GH_TOKEN`, `GITHUB_TOKEN`, `REGISTRY_URL` and the proxy variables\n * (`packVariables` in `@mostra/protocol/plugin` lists them).\n */\n readonly environment?: Readonly<Record<string, string>>;\n /** Makes retries idempotent: a repeated `requestId` returns the recorded result (H-03). */\n readonly requestId?: string;\n}\n\n/** One item `pack/add` installed. */\nexport interface PackItemSummary {\n /** The item's `name`. */\n readonly name: string;\n /** Its `type` (`registry:ui` …). */\n readonly type: string;\n /** The address it was asked for by, or a dependency's. */\n readonly address: string;\n /** Where it was read: a URL, or a file. */\n readonly source: string;\n /** The item that needed it, for a registry dependency. */\n readonly requiredBy?: string;\n /** The field IDs its components introduce, from its `mostra` block. */\n readonly fields?: readonly string[];\n}\n\n/** One file `pack/add` wrote. */\nexport interface PackFileChange {\n /** Its path in the artifact, `/`-separated. */\n readonly path: string;\n /** `created`, `overwritten` (with `overwrite`), `unchanged` (it already held this content), or `updated` (a stylesheet the items' CSS joined). */\n readonly action: \"created\" | \"overwritten\" | \"unchanged\" | \"updated\";\n}\n\n/** The result of `pack/add`. */\nexport interface PackAddResult {\n /** The items installed, registry dependencies included, in install order. */\n readonly items: readonly PackItemSummary[];\n /** Every file written. */\n readonly files: readonly PackFileChange[];\n /** The npm packages added, the items' and the plain specs', as `deps/add` answers them. */\n readonly packages: readonly AddedPackage[];\n /** The licenses of those packages, with their classes (D31). */\n readonly licenses: readonly LicenseDisclosure[];\n /** The lockfile's digest after the change, when packages were added. */\n readonly lockDigest?: string;\n /**\n * What the items asked for that Mostra applied otherwise or not at all (environment variables,\n * Tailwind 3 configuration, a stylesheet the entry doesn't import), as warnings and hints.\n */\n readonly notes: readonly Diagnostic[];\n}\n\nconst PackItemSummary: z.ZodType<PackItemSummary> = z\n .object({\n name: z.string(),\n type: z.string(),\n address: z.string(),\n source: z.string(),\n requiredBy: z.string().exactOptional(),\n fields: z.array(z.string()).readonly().exactOptional(),\n })\n .register(wireRegistry, { id: \"PackItemSummary\" });\n\nconst PackFileChange: z.ZodType<PackFileChange> = z\n .object({\n path: z.string().min(1),\n action: z.enum([\"created\", \"overwritten\", \"unchanged\", \"updated\"]),\n })\n .register(wireRegistry, { id: \"PackFileChange\" });\n\nconst params: z.ZodType<PackAddParams> = z\n .object({\n artifact: SourceRef,\n specs: z.array(z.string().min(1)).min(1).readonly(),\n overwrite: z.boolean().exactOptional(),\n acceptLicenses: z.array(z.string().min(1).max(256)).readonly().exactOptional(),\n environment: z.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/), z.string()).exactOptional(),\n requestId: z.string().min(1).exactOptional(),\n })\n .register(wireRegistry, { id: \"PackAddParams\" });\n\nconst result: z.ZodType<PackAddResult> = z\n .object({\n items: z.array(PackItemSummary).readonly(),\n files: z.array(PackFileChange).readonly(),\n packages: z.array(AddedPackage).readonly(),\n licenses: z.array(LicenseDisclosure).readonly(),\n lockDigest: z\n .string()\n .regex(/^[0-9a-f]{64}$/)\n .exactOptional(),\n notes: z.array(Diagnostic).readonly(),\n })\n .register(wireRegistry, { id: \"PackAddResult\" });\n\n/**\n * `pack/add`: copies source-pack items (shadcn registry items, with or without a `mostra` block,\n * EX-03) into an artifact's source, with their registry dependencies, merges their CSS into its\n * stylesheet, and adds their npm dependencies, and any plain npm specs, as `deps/add` does. Every\n * file is checked before any is written, and none is replaced without `overwrite`. The method\n * behind `mostra add`.\n */\nexport const packAddMethod: MethodDefinition<PackAddParams, PackAddResult> = defineMethod({\n method: \"pack/add\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result,\n});\n"],"mappings":";;;;;;;;AA4EA,MAAM,kBAA8C,EACjD,OAAO;CACN,MAAM,EAAE,OAAO;CACf,MAAM,EAAE,OAAO;CACf,SAAS,EAAE,OAAO;CAClB,QAAQ,EAAE,OAAO;CACjB,YAAY,EAAE,OAAO,CAAC,CAAC,cAAc;CACrC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc;AACvD,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,kBAAkB,CAAC;AAEnD,MAAM,iBAA4C,EAC/C,OAAO;CACN,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACtB,QAAQ,EAAE,KAAK;EAAC;EAAW;EAAe;EAAa;CAAS,CAAC;AACnE,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,iBAAiB,CAAC;AAElD,MAAM,SAAmC,EACtC,OAAO;CACN,UAAU;CACV,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;CAClD,WAAW,EAAE,QAAQ,CAAC,CAAC,cAAc;CACrC,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc;CAC7E,aAAa,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,0BAA0B,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,cAAc;CAC9F,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;AAC7C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,gBAAgB,CAAC;AAEjD,MAAM,SAAmC,EACtC,OAAO;CACN,OAAO,EAAE,MAAM,eAAe,CAAC,CAAC,SAAS;CACzC,OAAO,EAAE,MAAM,cAAc,CAAC,CAAC,SAAS;CACxC,UAAU,EAAE,MAAM,YAAY,CAAC,CAAC,SAAS;CACzC,UAAU,EAAE,MAAM,iBAAiB,CAAC,CAAC,SAAS;CAC9C,YAAY,EACT,OAAO,CAAC,CACR,MAAM,gBAAgB,CAAC,CACvB,cAAc;CACjB,OAAO,EAAE,MAAM,UAAU,CAAC,CAAC,SAAS;AACtC,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,gBAAgB,CAAC;;;;;;;;AASjD,MAAa,gBAAgE,aAAa;CACxF,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { SourceRef } from "../../artifact.js";
2
+ import { MethodDefinition } from "../../method.js";
3
+ import { LicenseDisclosure, PluginSummary } from "../../plugins.js";
4
+ //#region src/methods/plugin/add.d.ts
5
+ /** The params of `plugin/add` (INTERFACES §14). */
6
+ export interface PluginAddParams {
7
+ /** The artifact whose lockfile records the plugins; exactly one of `artifact` and `home`. */
8
+ readonly artifact?: SourceRef;
9
+ /** Install for the whole home instead (exporters and CLI commands only, ROUND-3 §6.4). */
10
+ readonly home?: boolean;
11
+ /** npm specs of the plugins: `name`, `name@version`, `name@range` or `name@tag`. */
12
+ readonly packages: readonly string[];
13
+ /**
14
+ * Licenses acknowledged for this install (`LicenseRef-Remotion`), as `--accept-license` gives
15
+ * them (D31): recorded in the lockfile with when.
16
+ */
17
+ readonly acceptLicenses?: readonly string[];
18
+ /** Makes retries idempotent: a repeated `requestId` returns the recorded result (H-03). */
19
+ readonly requestId?: string;
20
+ }
21
+ /** The result of `plugin/add`. */
22
+ export interface PluginAddResult {
23
+ /** The scope's plugins after the change, in load order (the order they were added). */
24
+ readonly plugins: readonly PluginSummary[];
25
+ /** The packages this call added or moved to another version. */
26
+ readonly added: readonly string[];
27
+ /** Every license the added plugins bring, with its class, shown before anything was recorded. */
28
+ readonly licenses: readonly LicenseDisclosure[];
29
+ /** The SHA-256 of the scope's lockfile after the change: an artifact's next publish uses it. */
30
+ readonly lockDigest: string;
31
+ }
32
+ /**
33
+ * `plugin/add`: installs plugins (npm packages with a `"mostra"` manifest) for an artifact or the
34
+ * home (EX-01, EX-04, ROUND-3 §6.4). Each must implement contract ranges this release serves,
35
+ * contribute IDs no other plugin of the scope has, and export stamped definitions; every license
36
+ * its installed dependencies bring is classed, and one that needs an acknowledgment refuses the
37
+ * install (`MOSTRA_LICENSE_UNACCEPTED`) unless `acceptLicenses` or the home's policy accepts it.
38
+ * Nothing is recorded until all of that holds; then the plugins, in load order, and the
39
+ * acknowledgments join the lockfile in one step. The method behind `mostra plugin add`.
40
+ */
41
+ export declare const pluginAddMethod: MethodDefinition<PluginAddParams, PluginAddResult>;
42
+ //#endregion
43
+ //# sourceMappingURL=add.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.d.ts","names":[],"sources":["../../../src/methods/plugin/add.ts"],"mappings":";;;;;iBAOiB;;WAEN,WAAW;;WAEX;;WAEA;;;;;WAKA;;WAEA;;;iBAIM;;WAEN,kBAAkB;;WAElB;;WAEA,mBAAmB;;WAEnB;;;;;;;;;;;qBA+BE,iBAAiB,iBAAiB,iBAAiB"}
@@ -0,0 +1,39 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { SourceRef } from "../../artifact.js";
3
+ import { defineMethod } from "../../method.js";
4
+ import { LicenseDisclosure, PluginSummary } from "../../plugins.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/plugin/add.ts
7
+ const params = z.object({
8
+ artifact: SourceRef.exactOptional(),
9
+ home: z.boolean().exactOptional(),
10
+ packages: z.array(z.string().min(1)).min(1).readonly(),
11
+ acceptLicenses: z.array(z.string().min(1).max(256)).readonly().exactOptional(),
12
+ requestId: z.string().min(1).exactOptional()
13
+ }).register(wireRegistry, { id: "PluginAddParams" });
14
+ const result = z.object({
15
+ plugins: z.array(PluginSummary).readonly(),
16
+ added: z.array(z.string()).readonly(),
17
+ licenses: z.array(LicenseDisclosure).readonly(),
18
+ lockDigest: z.string().regex(/^[0-9a-f]{64}$/)
19
+ }).register(wireRegistry, { id: "PluginAddResult" });
20
+ /**
21
+ * `plugin/add`: installs plugins (npm packages with a `"mostra"` manifest) for an artifact or the
22
+ * home (EX-01, EX-04, ROUND-3 §6.4). Each must implement contract ranges this release serves,
23
+ * contribute IDs no other plugin of the scope has, and export stamped definitions; every license
24
+ * its installed dependencies bring is classed, and one that needs an acknowledgment refuses the
25
+ * install (`MOSTRA_LICENSE_UNACCEPTED`) unless `acceptLicenses` or the home's policy accepts it.
26
+ * Nothing is recorded until all of that holds; then the plugins, in load order, and the
27
+ * acknowledgments join the lockfile in one step. The method behind `mostra plugin add`.
28
+ */
29
+ const pluginAddMethod = defineMethod({
30
+ method: "plugin/add",
31
+ direction: "client-to-instance",
32
+ mutating: true,
33
+ params,
34
+ result
35
+ });
36
+ //#endregion
37
+ export { pluginAddMethod };
38
+
39
+ //# sourceMappingURL=add.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.js","names":[],"sources":["../../../src/methods/plugin/add.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { SourceRef } from \"../../artifact.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { LicenseDisclosure, PluginSummary } from \"../../plugins.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `plugin/add` (INTERFACES §14). */\nexport interface PluginAddParams {\n /** The artifact whose lockfile records the plugins; exactly one of `artifact` and `home`. */\n readonly artifact?: SourceRef;\n /** Install for the whole home instead (exporters and CLI commands only, ROUND-3 §6.4). */\n readonly home?: boolean;\n /** npm specs of the plugins: `name`, `name@version`, `name@range` or `name@tag`. */\n readonly packages: readonly string[];\n /**\n * Licenses acknowledged for this install (`LicenseRef-Remotion`), as `--accept-license` gives\n * them (D31): recorded in the lockfile with when.\n */\n readonly acceptLicenses?: readonly string[];\n /** Makes retries idempotent: a repeated `requestId` returns the recorded result (H-03). */\n readonly requestId?: string;\n}\n\n/** The result of `plugin/add`. */\nexport interface PluginAddResult {\n /** The scope's plugins after the change, in load order (the order they were added). */\n readonly plugins: readonly PluginSummary[];\n /** The packages this call added or moved to another version. */\n readonly added: readonly string[];\n /** Every license the added plugins bring, with its class, shown before anything was recorded. */\n readonly licenses: readonly LicenseDisclosure[];\n /** The SHA-256 of the scope's lockfile after the change: an artifact's next publish uses it. */\n readonly lockDigest: string;\n}\n\nconst params: z.ZodType<PluginAddParams> = z\n .object({\n artifact: SourceRef.exactOptional(),\n home: z.boolean().exactOptional(),\n packages: z.array(z.string().min(1)).min(1).readonly(),\n acceptLicenses: z.array(z.string().min(1).max(256)).readonly().exactOptional(),\n requestId: z.string().min(1).exactOptional(),\n })\n .register(wireRegistry, { id: \"PluginAddParams\" });\n\nconst result: z.ZodType<PluginAddResult> = z\n .object({\n plugins: z.array(PluginSummary).readonly(),\n added: z.array(z.string()).readonly(),\n licenses: z.array(LicenseDisclosure).readonly(),\n lockDigest: z.string().regex(/^[0-9a-f]{64}$/),\n })\n .register(wireRegistry, { id: \"PluginAddResult\" });\n\n/**\n * `plugin/add`: installs plugins (npm packages with a `\"mostra\"` manifest) for an artifact or the\n * home (EX-01, EX-04, ROUND-3 §6.4). Each must implement contract ranges this release serves,\n * contribute IDs no other plugin of the scope has, and export stamped definitions; every license\n * its installed dependencies bring is classed, and one that needs an acknowledgment refuses the\n * install (`MOSTRA_LICENSE_UNACCEPTED`) unless `acceptLicenses` or the home's policy accepts it.\n * Nothing is recorded until all of that holds; then the plugins, in load order, and the\n * acknowledgments join the lockfile in one step. The method behind `mostra plugin add`.\n */\nexport const pluginAddMethod: MethodDefinition<PluginAddParams, PluginAddResult> = defineMethod({\n method: \"plugin/add\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result,\n});\n"],"mappings":";;;;;;AAmCA,MAAM,SAAqC,EACxC,OAAO;CACN,UAAU,UAAU,cAAc;CAClC,MAAM,EAAE,QAAQ,CAAC,CAAC,cAAc;CAChC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;CACrD,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc;CAC7E,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;CACN,SAAS,EAAE,MAAM,aAAa,CAAC,CAAC,SAAS;CACzC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS;CACpC,UAAU,EAAE,MAAM,iBAAiB,CAAC,CAAC,SAAS;CAC9C,YAAY,EAAE,OAAO,CAAC,CAAC,MAAM,gBAAgB;AAC/C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,kBAAkB,CAAC;;;;;;;;;;AAWnD,MAAa,kBAAsE,aAAa;CAC9F,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { SourceRef } from "../../artifact.js";
2
+ import { MethodDefinition } from "../../method.js";
3
+ import { PluginScope } from "../../plugins.js";
4
+ //#region src/methods/plugin/commands.d.ts
5
+ /** The params of `plugin/commands` (INTERFACES §14). */
6
+ export interface PluginCommandsParams {
7
+ /** The artifact whose plugins' commands count too, besides the home's. */
8
+ readonly artifact?: SourceRef;
9
+ }
10
+ /** One CLI command a plugin contributes, where its definition loads from. */
11
+ export interface PluginCommandInfo {
12
+ /** Its words after `mostra`, joined by spaces: `term record`. */
13
+ readonly command: string;
14
+ /** The plugin's npm package. */
15
+ readonly package: string;
16
+ /** Its installed version. */
17
+ readonly version: string;
18
+ /** Whether the artifact's lockfile or the home's records it. */
19
+ readonly scope: PluginScope;
20
+ /** The module that exports its definition (absolute). */
21
+ readonly file: string;
22
+ /** The export that holds it. */
23
+ readonly export: string;
24
+ }
25
+ /** The result of `plugin/commands`. */
26
+ export interface PluginCommandsResult {
27
+ /** Every command the home's plugins and the artifact's contribute, those that load. */
28
+ readonly commands: readonly PluginCommandInfo[];
29
+ }
30
+ /**
31
+ * `plugin/commands`: the CLI commands plugins contribute (`@mostra/contract-cli-command`), the
32
+ * home's and an artifact's, with the module each loads from. The CLI runs a command it doesn't
33
+ * know as one of them, in its own process, as a git subcommand runs: the command talks to the
34
+ * instance through the CLI's own session.
35
+ */
36
+ export declare const pluginCommandsMethod: MethodDefinition<PluginCommandsParams, PluginCommandsResult>;
37
+ //#endregion
38
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.ts","names":[],"sources":["../../../src/methods/plugin/commands.ts"],"mappings":";;;;;iBAOiB;;WAEN,WAAW;;;iBAIL;;WAEN;;WAEA;;WAEA;;WAEA,OAAO;;WAEP;;WAEA;;;iBAIM;;WAEN,mBAAmB;;;;;;;;qBA4BjB,sBAAsB,iBAAiB,sBAAsB"}
@@ -0,0 +1,33 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { AbsolutePath, SourceRef } from "../../artifact.js";
3
+ import { defineMethod } from "../../method.js";
4
+ import { PluginScope } from "../../plugins.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/plugin/commands.ts
7
+ const params = z.object({ artifact: SourceRef.exactOptional() }).register(wireRegistry, { id: "PluginCommandsParams" });
8
+ const PluginCommandInfo = z.object({
9
+ command: z.string().min(1),
10
+ package: z.string().min(1),
11
+ version: z.string().min(1),
12
+ scope: PluginScope,
13
+ file: AbsolutePath,
14
+ export: z.string().min(1)
15
+ }).register(wireRegistry, { id: "PluginCommandInfo" });
16
+ const result = z.object({ commands: z.array(PluginCommandInfo).readonly() }).register(wireRegistry, { id: "PluginCommandsResult" });
17
+ /**
18
+ * `plugin/commands`: the CLI commands plugins contribute (`@mostra/contract-cli-command`), the
19
+ * home's and an artifact's, with the module each loads from. The CLI runs a command it doesn't
20
+ * know as one of them, in its own process, as a git subcommand runs: the command talks to the
21
+ * instance through the CLI's own session.
22
+ */
23
+ const pluginCommandsMethod = defineMethod({
24
+ method: "plugin/commands",
25
+ direction: "client-to-instance",
26
+ mutating: false,
27
+ params,
28
+ result
29
+ });
30
+ //#endregion
31
+ export { pluginCommandsMethod };
32
+
33
+ //# sourceMappingURL=commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.js","names":[],"sources":["../../../src/methods/plugin/commands.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { AbsolutePath, SourceRef } from \"../../artifact.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { PluginScope } from \"../../plugins.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `plugin/commands` (INTERFACES §14). */\nexport interface PluginCommandsParams {\n /** The artifact whose plugins' commands count too, besides the home's. */\n readonly artifact?: SourceRef;\n}\n\n/** One CLI command a plugin contributes, where its definition loads from. */\nexport interface PluginCommandInfo {\n /** Its words after `mostra`, joined by spaces: `term record`. */\n readonly command: string;\n /** The plugin's npm package. */\n readonly package: string;\n /** Its installed version. */\n readonly version: string;\n /** Whether the artifact's lockfile or the home's records it. */\n readonly scope: PluginScope;\n /** The module that exports its definition (absolute). */\n readonly file: string;\n /** The export that holds it. */\n readonly export: string;\n}\n\n/** The result of `plugin/commands`. */\nexport interface PluginCommandsResult {\n /** Every command the home's plugins and the artifact's contribute, those that load. */\n readonly commands: readonly PluginCommandInfo[];\n}\n\nconst params: z.ZodType<PluginCommandsParams> = z\n .object({ artifact: SourceRef.exactOptional() })\n .register(wireRegistry, { id: \"PluginCommandsParams\" });\n\nconst PluginCommandInfo: z.ZodType<PluginCommandInfo> = z\n .object({\n command: z.string().min(1),\n package: z.string().min(1),\n version: z.string().min(1),\n scope: PluginScope,\n file: AbsolutePath,\n export: z.string().min(1),\n })\n .register(wireRegistry, { id: \"PluginCommandInfo\" });\n\nconst result: z.ZodType<PluginCommandsResult> = z\n .object({ commands: z.array(PluginCommandInfo).readonly() })\n .register(wireRegistry, { id: \"PluginCommandsResult\" });\n\n/**\n * `plugin/commands`: the CLI commands plugins contribute (`@mostra/contract-cli-command`), the\n * home's and an artifact's, with the module each loads from. The CLI runs a command it doesn't\n * know as one of them, in its own process, as a git subcommand runs: the command talks to the\n * instance through the CLI's own session.\n */\nexport const pluginCommandsMethod: MethodDefinition<PluginCommandsParams, PluginCommandsResult> =\n defineMethod({\n method: \"plugin/commands\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n });\n"],"mappings":";;;;;;AAkCA,MAAM,SAA0C,EAC7C,OAAO,EAAE,UAAU,UAAU,cAAc,EAAE,CAAC,CAAC,CAC/C,SAAS,cAAc,EAAE,IAAI,uBAAuB,CAAC;AAExD,MAAM,oBAAkD,EACrD,OAAO;CACN,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACzB,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACzB,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACzB,OAAO;CACP,MAAM;CACN,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;AAC1B,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,oBAAoB,CAAC;AAErD,MAAM,SAA0C,EAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAC3D,SAAS,cAAc,EAAE,IAAI,uBAAuB,CAAC;;;;;;;AAQxD,MAAa,uBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { ArtifactRef } from "../../artifact.js";
2
+ import { MethodDefinition } from "../../method.js";
3
+ //#region src/methods/plugin/export.d.ts
4
+ /** The params of `plugin/export` (INTERFACES §14). */
5
+ export interface PluginExportParams {
6
+ /** The artifact: its ID, or a source path it was published from. */
7
+ readonly artifact: ArtifactRef;
8
+ /** The version: a number or a version ID; the latest when absent. */
9
+ readonly version?: number | string;
10
+ /** The exporter's ID: one the artifact's plugins or the home's contribute. */
11
+ readonly exporter: string;
12
+ /** Where: an absolute path, which must not exist yet, or be an empty directory. */
13
+ readonly out: string;
14
+ /** The exporter's options, as JSON its `options` schema describes. */
15
+ readonly options?: Readonly<Record<string, unknown>>;
16
+ }
17
+ /** The result of `plugin/export`. */
18
+ export interface PluginExportResult {
19
+ /** What it wrote, as absolute paths. */
20
+ readonly files: readonly string[];
21
+ /** The file to open first, when the exporter names one. */
22
+ readonly entry?: string;
23
+ /** The version exported. */
24
+ readonly versionId: string;
25
+ /** The exporter, and the plugin that contributes it. */
26
+ readonly exporter: {
27
+ readonly id: string;
28
+ readonly package: string;
29
+ };
30
+ /** What the exporter reported, in its own codes (`@mostra/contract-exporter`'s `Finding`). */
31
+ readonly findings: readonly PluginFinding[];
32
+ }
33
+ /** Something a plugin's contribution reported, in the plugin's own code. */
34
+ export interface PluginFinding {
35
+ /** The plugin's code: upper-case letters, digits and `_`. */
36
+ readonly code: string;
37
+ /** How serious it is: `error` means the export is wrong, `warning` and `hint` inform. */
38
+ readonly severity: "error" | "warning" | "hint";
39
+ /** What it found. */
40
+ readonly message: string;
41
+ /** What to do, in one sentence. */
42
+ readonly hint?: string;
43
+ /** Where, in the version's files. */
44
+ readonly location?: {
45
+ readonly file: string;
46
+ readonly line?: number;
47
+ readonly column?: number;
48
+ };
49
+ }
50
+ /**
51
+ * `plugin/export`: runs an exporter a plugin contributes (`@mostra/contract-exporter`) on a
52
+ * published version's client build, in a plugin child of the instance, and writes the files it
53
+ * returns under `out`. `mostra export --as <id>` calls it for every exporter Mostra doesn't build
54
+ * in.
55
+ */
56
+ export declare const pluginExportMethod: MethodDefinition<PluginExportParams, PluginExportResult>;
57
+ //#endregion
58
+ //# sourceMappingURL=export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.d.ts","names":[],"sources":["../../../src/methods/plugin/export.ts"],"mappings":";;;;iBAMiB;;WAEN,UAAU;;WAEV;;WAEA;;WAEA;;WAEA,UAAU,SAAS;;;iBAIb;;WAEN;;WAEA;;WAEA;;WAEA;aAAqB;aAAqB;;;WAE1C,mBAAmB;;;iBAIb;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;aAAsB;aAAuB;aAAwB;;;;;;;;;qBAgDnE,oBAAoB,iBAAiB,oBAAoB"}
@@ -0,0 +1,57 @@
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/plugin/export.ts
6
+ const PluginFinding = z.object({
7
+ code: z.string().min(1).max(64),
8
+ severity: z.enum([
9
+ "error",
10
+ "warning",
11
+ "hint"
12
+ ]),
13
+ message: z.string(),
14
+ hint: z.string().exactOptional(),
15
+ location: z.object({
16
+ file: z.string(),
17
+ line: z.int().min(1).exactOptional(),
18
+ column: z.int().min(1).exactOptional()
19
+ }).exactOptional()
20
+ }).register(wireRegistry, {
21
+ id: "PluginFinding",
22
+ description: "Something a plugin's contribution reported, in the plugin's own code."
23
+ });
24
+ const params = z.object({
25
+ artifact: ArtifactRef,
26
+ version: z.union([z.int().min(1), z.string().min(1)]).exactOptional(),
27
+ exporter: z.string().regex(/^[a-z0-9][a-z0-9._-]{0,63}$/),
28
+ out: z.string().min(1),
29
+ options: z.record(z.string(), z.unknown()).exactOptional()
30
+ }).register(wireRegistry, { id: "PluginExportParams" });
31
+ const result = z.object({
32
+ files: z.array(z.string()).readonly(),
33
+ entry: z.string().exactOptional(),
34
+ versionId: z.string(),
35
+ exporter: z.object({
36
+ id: z.string(),
37
+ package: z.string()
38
+ }),
39
+ findings: z.array(PluginFinding).readonly()
40
+ }).register(wireRegistry, { id: "PluginExportResult" });
41
+ /**
42
+ * `plugin/export`: runs an exporter a plugin contributes (`@mostra/contract-exporter`) on a
43
+ * published version's client build, in a plugin child of the instance, and writes the files it
44
+ * returns under `out`. `mostra export --as <id>` calls it for every exporter Mostra doesn't build
45
+ * in.
46
+ */
47
+ const pluginExportMethod = defineMethod({
48
+ method: "plugin/export",
49
+ direction: "client-to-instance",
50
+ mutating: false,
51
+ params,
52
+ result
53
+ });
54
+ //#endregion
55
+ export { pluginExportMethod };
56
+
57
+ //# sourceMappingURL=export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.js","names":[],"sources":["../../../src/methods/plugin/export.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/** The params of `plugin/export` (INTERFACES §14). */\nexport interface PluginExportParams {\n /** The artifact: its ID, or a source path it was published from. */\n readonly artifact: ArtifactRef;\n /** The version: a number or a version ID; the latest when absent. */\n readonly version?: number | string;\n /** The exporter's ID: one the artifact's plugins or the home's contribute. */\n readonly exporter: string;\n /** Where: an absolute path, which must not exist yet, or be an empty directory. */\n readonly out: string;\n /** The exporter's options, as JSON its `options` schema describes. */\n readonly options?: Readonly<Record<string, unknown>>;\n}\n\n/** The result of `plugin/export`. */\nexport interface PluginExportResult {\n /** What it wrote, as absolute paths. */\n readonly files: readonly string[];\n /** The file to open first, when the exporter names one. */\n readonly entry?: string;\n /** The version exported. */\n readonly versionId: string;\n /** The exporter, and the plugin that contributes it. */\n readonly exporter: { readonly id: string; readonly package: string };\n /** What the exporter reported, in its own codes (`@mostra/contract-exporter`'s `Finding`). */\n readonly findings: readonly PluginFinding[];\n}\n\n/** Something a plugin's contribution reported, in the plugin's own code. */\nexport interface PluginFinding {\n /** The plugin's code: upper-case letters, digits and `_`. */\n readonly code: string;\n /** How serious it is: `error` means the export is wrong, `warning` and `hint` inform. */\n readonly severity: \"error\" | \"warning\" | \"hint\";\n /** What it found. */\n readonly message: string;\n /** What to do, in one sentence. */\n readonly hint?: string;\n /** Where, in the version's files. */\n readonly location?: { readonly file: string; readonly line?: number; readonly column?: number };\n}\n\nconst PluginFinding: z.ZodType<PluginFinding> = z\n .object({\n code: z.string().min(1).max(64),\n severity: z.enum([\"error\", \"warning\", \"hint\"]),\n message: z.string(),\n hint: z.string().exactOptional(),\n location: z\n .object({\n file: z.string(),\n line: z.int().min(1).exactOptional(),\n column: z.int().min(1).exactOptional(),\n })\n .exactOptional(),\n })\n .register(wireRegistry, {\n id: \"PluginFinding\",\n description: \"Something a plugin's contribution reported, in the plugin's own code.\",\n });\n\nconst params: z.ZodType<PluginExportParams> = z\n .object({\n artifact: ArtifactRef,\n version: z.union([z.int().min(1), z.string().min(1)]).exactOptional(),\n exporter: z.string().regex(/^[a-z0-9][a-z0-9._-]{0,63}$/),\n out: z.string().min(1),\n options: z.record(z.string(), z.unknown()).exactOptional(),\n })\n .register(wireRegistry, { id: \"PluginExportParams\" });\n\nconst result: z.ZodType<PluginExportResult> = z\n .object({\n files: z.array(z.string()).readonly(),\n entry: z.string().exactOptional(),\n versionId: z.string(),\n exporter: z.object({ id: z.string(), package: z.string() }),\n findings: z.array(PluginFinding).readonly(),\n })\n .register(wireRegistry, { id: \"PluginExportResult\" });\n\n/**\n * `plugin/export`: runs an exporter a plugin contributes (`@mostra/contract-exporter`) on a\n * published version's client build, in a plugin child of the instance, and writes the files it\n * returns under `out`. `mostra export --as <id>` calls it for every exporter Mostra doesn't build\n * in.\n */\nexport const pluginExportMethod: MethodDefinition<PluginExportParams, PluginExportResult> =\n defineMethod({\n method: \"plugin/export\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n });\n"],"mappings":";;;;;AA+CA,MAAM,gBAA0C,EAC7C,OAAO;CACN,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;CAC9B,UAAU,EAAE,KAAK;EAAC;EAAS;EAAW;CAAM,CAAC;CAC7C,SAAS,EAAE,OAAO;CAClB,MAAM,EAAE,OAAO,CAAC,CAAC,cAAc;CAC/B,UAAU,EACP,OAAO;EACN,MAAM,EAAE,OAAO;EACf,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;EACnC,QAAQ,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;CACvC,CAAC,CAAC,CACD,cAAc;AACnB,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;AAEH,MAAM,SAAwC,EAC3C,OAAO;CACN,UAAU;CACV,SAAS,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc;CACpE,UAAU,EAAE,OAAO,CAAC,CAAC,MAAM,6BAA6B;CACxD,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACrB,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,cAAc;AAC3D,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,qBAAqB,CAAC;AAEtD,MAAM,SAAwC,EAC3C,OAAO;CACN,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS;CACpC,OAAO,EAAE,OAAO,CAAC,CAAC,cAAc;CAChC,WAAW,EAAE,OAAO;CACpB,UAAU,EAAE,OAAO;EAAE,IAAI,EAAE,OAAO;EAAG,SAAS,EAAE,OAAO;CAAE,CAAC;CAC1D,UAAU,EAAE,MAAM,aAAa,CAAC,CAAC,SAAS;AAC5C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,qBAAqB,CAAC;;;;;;;AAQtD,MAAa,qBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { SourceRef } from "../../artifact.js";
2
+ import { MethodDefinition } from "../../method.js";
3
+ import { LicenseDisclosure, PluginSummary } from "../../plugins.js";
4
+ //#region src/methods/plugin/list.d.ts
5
+ /** The params of `plugin/list` (INTERFACES §14). */
6
+ export interface PluginListParams {
7
+ /** The artifact whose plugins to list; exactly one of `artifact` and `home`. */
8
+ readonly artifact?: SourceRef;
9
+ /** List the home's own plugins instead. */
10
+ readonly home?: boolean;
11
+ }
12
+ /** The result of `plugin/list`. */
13
+ export interface PluginListResult {
14
+ /** The scope's plugins in load order, each checked against this release as it is now. */
15
+ readonly plugins: readonly PluginSummary[];
16
+ /** Every license they bring, and where its acknowledgment stands. */
17
+ readonly licenses: readonly LicenseDisclosure[];
18
+ }
19
+ /**
20
+ * `plugin/list`: an artifact's plugins, or the home's, in load order, each loaded as `verify`
21
+ * and `publish` would load it now, with the licenses they bring. The method behind
22
+ * `mostra plugin list`.
23
+ */
24
+ export declare const pluginListMethod: MethodDefinition<PluginListParams, PluginListResult>;
25
+ //#endregion
26
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","names":[],"sources":["../../../src/methods/plugin/list.ts"],"mappings":";;;;;iBAOiB;;WAEN,WAAW;;WAEX;;;iBAIM;;WAEN,kBAAkB;;WAElB,mBAAmB;;;;;;;qBAmBjB,kBAAkB,iBAAiB,kBAAkB"}
@@ -0,0 +1,30 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { SourceRef } from "../../artifact.js";
3
+ import { defineMethod } from "../../method.js";
4
+ import { LicenseDisclosure, PluginSummary } from "../../plugins.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/plugin/list.ts
7
+ const params = z.object({
8
+ artifact: SourceRef.exactOptional(),
9
+ home: z.boolean().exactOptional()
10
+ }).register(wireRegistry, { id: "PluginListParams" });
11
+ const result = z.object({
12
+ plugins: z.array(PluginSummary).readonly(),
13
+ licenses: z.array(LicenseDisclosure).readonly()
14
+ }).register(wireRegistry, { id: "PluginListResult" });
15
+ /**
16
+ * `plugin/list`: an artifact's plugins, or the home's, in load order, each loaded as `verify`
17
+ * and `publish` would load it now, with the licenses they bring. The method behind
18
+ * `mostra plugin list`.
19
+ */
20
+ const pluginListMethod = defineMethod({
21
+ method: "plugin/list",
22
+ direction: "client-to-instance",
23
+ mutating: false,
24
+ params,
25
+ result
26
+ });
27
+ //#endregion
28
+ export { pluginListMethod };
29
+
30
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","names":[],"sources":["../../../src/methods/plugin/list.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { SourceRef } from \"../../artifact.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { LicenseDisclosure, PluginSummary } from \"../../plugins.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `plugin/list` (INTERFACES §14). */\nexport interface PluginListParams {\n /** The artifact whose plugins to list; exactly one of `artifact` and `home`. */\n readonly artifact?: SourceRef;\n /** List the home's own plugins instead. */\n readonly home?: boolean;\n}\n\n/** The result of `plugin/list`. */\nexport interface PluginListResult {\n /** The scope's plugins in load order, each checked against this release as it is now. */\n readonly plugins: readonly PluginSummary[];\n /** Every license they bring, and where its acknowledgment stands. */\n readonly licenses: readonly LicenseDisclosure[];\n}\n\nconst params: z.ZodType<PluginListParams> = z\n .object({ artifact: SourceRef.exactOptional(), home: z.boolean().exactOptional() })\n .register(wireRegistry, { id: \"PluginListParams\" });\n\nconst result: z.ZodType<PluginListResult> = z\n .object({\n plugins: z.array(PluginSummary).readonly(),\n licenses: z.array(LicenseDisclosure).readonly(),\n })\n .register(wireRegistry, { id: \"PluginListResult\" });\n\n/**\n * `plugin/list`: an artifact's plugins, or the home's, in load order, each loaded as `verify`\n * and `publish` would load it now, with the licenses they bring. The method behind\n * `mostra plugin list`.\n */\nexport const pluginListMethod: MethodDefinition<PluginListParams, PluginListResult> = defineMethod({\n method: \"plugin/list\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n});\n"],"mappings":";;;;;;AAsBA,MAAM,SAAsC,EACzC,OAAO;CAAE,UAAU,UAAU,cAAc;CAAG,MAAM,EAAE,QAAQ,CAAC,CAAC,cAAc;AAAE,CAAC,CAAC,CAClF,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;AAEpD,MAAM,SAAsC,EACzC,OAAO;CACN,SAAS,EAAE,MAAM,aAAa,CAAC,CAAC,SAAS;CACzC,UAAU,EAAE,MAAM,iBAAiB,CAAC,CAAC,SAAS;AAChD,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;;;;;;AAOpD,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { SourceRef } from "../../artifact.js";
2
+ import { MethodDefinition } from "../../method.js";
3
+ import { PluginSummary } from "../../plugins.js";
4
+ //#region src/methods/plugin/remove.d.ts
5
+ /** The params of `plugin/remove` (INTERFACES §14). */
6
+ export interface PluginRemoveParams {
7
+ /** The artifact whose plugins to remove; exactly one of `artifact` and `home`. */
8
+ readonly artifact?: SourceRef;
9
+ /** Remove from the home's own plugins instead. */
10
+ readonly home?: boolean;
11
+ /** The plugins' package names. */
12
+ readonly packages: readonly string[];
13
+ /** Makes retries idempotent: a repeated `requestId` returns the recorded result (H-03). */
14
+ readonly requestId?: string;
15
+ }
16
+ /** The result of `plugin/remove`. */
17
+ export interface PluginRemoveResult {
18
+ /** The packages removed. */
19
+ readonly removed: readonly string[];
20
+ /** The scope's plugins after the change, in load order. */
21
+ readonly plugins: readonly PluginSummary[];
22
+ /** The SHA-256 of the scope's lockfile after the change. */
23
+ readonly lockDigest: string;
24
+ }
25
+ /**
26
+ * `plugin/remove`: takes plugins out of an artifact's lockfile (or the home's), with the license
27
+ * acknowledgments no remaining plugin needs; a package the artifact's source still imports stays
28
+ * in its lockfile as an ordinary package. The method behind `mostra plugin remove`.
29
+ */
30
+ export declare const pluginRemoveMethod: MethodDefinition<PluginRemoveParams, PluginRemoveResult>;
31
+ //#endregion
32
+ //# sourceMappingURL=remove.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.d.ts","names":[],"sources":["../../../src/methods/plugin/remove.ts"],"mappings":";;;;;iBAOiB;;WAEN,WAAW;;WAEX;;WAEA;;WAEA;;;iBAIM;;WAEN;;WAEA,kBAAkB;;WAElB;;;;;;;qBAyBE,oBAAoB,iBAAiB,oBAAoB"}
@@ -0,0 +1,33 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { SourceRef } from "../../artifact.js";
3
+ import { defineMethod } from "../../method.js";
4
+ import { PluginSummary } from "../../plugins.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/plugin/remove.ts
7
+ const params = z.object({
8
+ artifact: SourceRef.exactOptional(),
9
+ home: z.boolean().exactOptional(),
10
+ packages: z.array(z.string().min(1)).min(1).readonly(),
11
+ requestId: z.string().min(1).exactOptional()
12
+ }).register(wireRegistry, { id: "PluginRemoveParams" });
13
+ const result = z.object({
14
+ removed: z.array(z.string()).readonly(),
15
+ plugins: z.array(PluginSummary).readonly(),
16
+ lockDigest: z.string().regex(/^[0-9a-f]{64}$/)
17
+ }).register(wireRegistry, { id: "PluginRemoveResult" });
18
+ /**
19
+ * `plugin/remove`: takes plugins out of an artifact's lockfile (or the home's), with the license
20
+ * acknowledgments no remaining plugin needs; a package the artifact's source still imports stays
21
+ * in its lockfile as an ordinary package. The method behind `mostra plugin remove`.
22
+ */
23
+ const pluginRemoveMethod = defineMethod({
24
+ method: "plugin/remove",
25
+ direction: "client-to-instance",
26
+ mutating: true,
27
+ params,
28
+ result
29
+ });
30
+ //#endregion
31
+ export { pluginRemoveMethod };
32
+
33
+ //# sourceMappingURL=remove.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.js","names":[],"sources":["../../../src/methods/plugin/remove.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { SourceRef } from \"../../artifact.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { PluginSummary } from \"../../plugins.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `plugin/remove` (INTERFACES §14). */\nexport interface PluginRemoveParams {\n /** The artifact whose plugins to remove; exactly one of `artifact` and `home`. */\n readonly artifact?: SourceRef;\n /** Remove from the home's own plugins instead. */\n readonly home?: boolean;\n /** The plugins' package names. */\n readonly packages: readonly string[];\n /** Makes retries idempotent: a repeated `requestId` returns the recorded result (H-03). */\n readonly requestId?: string;\n}\n\n/** The result of `plugin/remove`. */\nexport interface PluginRemoveResult {\n /** The packages removed. */\n readonly removed: readonly string[];\n /** The scope's plugins after the change, in load order. */\n readonly plugins: readonly PluginSummary[];\n /** The SHA-256 of the scope's lockfile after the change. */\n readonly lockDigest: string;\n}\n\nconst params: z.ZodType<PluginRemoveParams> = z\n .object({\n artifact: SourceRef.exactOptional(),\n home: z.boolean().exactOptional(),\n packages: z.array(z.string().min(1)).min(1).readonly(),\n requestId: z.string().min(1).exactOptional(),\n })\n .register(wireRegistry, { id: \"PluginRemoveParams\" });\n\nconst result: z.ZodType<PluginRemoveResult> = z\n .object({\n removed: z.array(z.string()).readonly(),\n plugins: z.array(PluginSummary).readonly(),\n lockDigest: z.string().regex(/^[0-9a-f]{64}$/),\n })\n .register(wireRegistry, { id: \"PluginRemoveResult\" });\n\n/**\n * `plugin/remove`: takes plugins out of an artifact's lockfile (or the home's), with the license\n * acknowledgments no remaining plugin needs; a package the artifact's source still imports stays\n * in its lockfile as an ordinary package. The method behind `mostra plugin remove`.\n */\nexport const pluginRemoveMethod: MethodDefinition<PluginRemoveParams, PluginRemoveResult> =\n defineMethod({\n method: \"plugin/remove\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result,\n });\n"],"mappings":";;;;;;AA4BA,MAAM,SAAwC,EAC3C,OAAO;CACN,UAAU,UAAU,cAAc;CAClC,MAAM,EAAE,QAAQ,CAAC,CAAC,cAAc;CAChC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;CACrD,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;CACN,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS;CACtC,SAAS,EAAE,MAAM,aAAa,CAAC,CAAC,SAAS;CACzC,YAAY,EAAE,OAAO,CAAC,CAAC,MAAM,gBAAgB;AAC/C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,qBAAqB,CAAC;;;;;;AAOtD,MAAa,qBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}