@mostra/runtime 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 (61) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/child-protocol-CPXR6pMu.js +13 -0
  3. package/dist/child-protocol-CPXR6pMu.js.map +1 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/{instance-CFTw3g-c.js → instance-Bw1BxctF.js} +2581 -189
  7. package/dist/instance-Bw1BxctF.js.map +1 -0
  8. package/dist/plugins/child/host.d.ts +1 -0
  9. package/dist/plugins/child/host.js +165 -0
  10. package/dist/plugins/child/host.js.map +1 -0
  11. package/dist/reference/cli.md +147 -5
  12. package/dist/reference/diagnostics.json +234 -0
  13. package/dist/reference/errors/MOSTRA_LICENSE_ACCEPT_INVALID.md +23 -0
  14. package/dist/reference/errors/MOSTRA_LICENSE_MISMATCH.md +23 -0
  15. package/dist/reference/errors/MOSTRA_LICENSE_UNACCEPTED.md +23 -0
  16. package/dist/reference/errors/MOSTRA_LICENSE_UNDECLARED.md +23 -0
  17. package/dist/reference/errors/MOSTRA_PACK_ADDRESS_INVALID.md +23 -0
  18. package/dist/reference/errors/MOSTRA_PACK_CSS_UNIMPORTED.md +23 -0
  19. package/dist/reference/errors/MOSTRA_PACK_FETCH_FAILED.md +23 -0
  20. package/dist/reference/errors/MOSTRA_PACK_FILE_EXISTS.md +23 -0
  21. package/dist/reference/errors/MOSTRA_PACK_ITEM_INVALID.md +23 -0
  22. package/dist/reference/errors/MOSTRA_PACK_ITEM_NOT_FOUND.md +23 -0
  23. package/dist/reference/errors/MOSTRA_PACK_NOT_APPLIED.md +23 -0
  24. package/dist/reference/errors/MOSTRA_PACK_OFFLINE.md +23 -0
  25. package/dist/reference/errors/MOSTRA_PACK_TARGET_INVALID.md +23 -0
  26. package/dist/reference/errors/MOSTRA_PLUGIN_CONFLICT.md +23 -0
  27. package/dist/reference/errors/MOSTRA_PLUGIN_CONTRACT_UNSUPPORTED.md +23 -0
  28. package/dist/reference/errors/MOSTRA_PLUGIN_ENTRY_INVALID.md +23 -0
  29. package/dist/reference/errors/MOSTRA_PLUGIN_EXPORTER_UNKNOWN.md +23 -0
  30. package/dist/reference/errors/MOSTRA_PLUGIN_FAILED.md +23 -0
  31. package/dist/reference/errors/MOSTRA_PLUGIN_MANIFEST_INVALID.md +23 -0
  32. package/dist/reference/errors/MOSTRA_PLUGIN_MANIFEST_WARNING.md +23 -0
  33. package/dist/reference/errors/MOSTRA_PLUGIN_NOT_A_PLUGIN.md +23 -0
  34. package/dist/reference/errors/MOSTRA_PLUGIN_NOT_INSTALLED.md +23 -0
  35. package/dist/reference/errors/MOSTRA_PLUGIN_OPTIONS_INVALID.md +23 -0
  36. package/dist/reference/errors/MOSTRA_PLUGIN_PLATFORM_UNSUPPORTED.md +23 -0
  37. package/dist/reference/errors/MOSTRA_PLUGIN_SCOPE_INVALID.md +23 -0
  38. package/dist/reference/errors/MOSTRA_PLUGIN_SHADOWED.md +23 -0
  39. package/dist/skill/SKILL.md +4 -2
  40. package/dist/skill/references/mcp.md +2 -2
  41. package/dist/skill/references/plugins.md +51 -0
  42. package/package.json +10 -7
  43. package/src/deps/index.ts +407 -90
  44. package/src/deps/installer.ts +53 -10
  45. package/src/deps/lock.ts +74 -2
  46. package/src/home/settings.ts +3 -0
  47. package/src/instance/index.ts +57 -0
  48. package/src/packs/index.ts +7 -0
  49. package/src/packs/methods.ts +49 -0
  50. package/src/packs/packs.ts +706 -0
  51. package/src/packs/read.ts +759 -0
  52. package/src/platform/index.ts +1 -0
  53. package/src/platform/shell.ts +14 -0
  54. package/src/plugins/child/host.ts +231 -0
  55. package/src/plugins/child-protocol.ts +68 -0
  56. package/src/plugins/index.ts +7 -0
  57. package/src/plugins/location.ts +109 -0
  58. package/src/plugins/methods.ts +269 -0
  59. package/src/plugins/plugins.ts +1396 -0
  60. package/src/publish/publisher.ts +71 -3
  61. package/dist/instance-CFTw3g-c.js.map +0 -1
package/dist/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { $ as readProcess, A as themePageCsp, B as appendEvent, C as jsonResponse, D as defaultPages, E as THEME_BASE, F as finishRun, G as ProtocolServer, H as MAX_FRAME_BYTES, I as markRunning, J as openLedger, K as handler, L as markUnknown, M as createInteraction, N as createEphemeralBus, O as refusalDocument, P as appendRunOutput, Q as readServerFunctions, R as markWaiting, S as isRefusal, T as MADE_WITH_HREF, U as serveWebSocket, V as BINDING_SUBPROTOCOL, W as attachInProcess, X as noFaults, Y as faultsFrom, Z as readFieldCoverage, _ as resetOnClose, a as uninstallService, b as BASE_HEADERS$1, c as resolveHomePath, d as versionIdFor, et as coverageMatcher, f as createLive, g as shellAssetResponse, h as locateShell, i as serviceStatus, j as openRegistry, k as serverPages, l as canonicalRef, m as createGateway, n as startInstance, o as checkPlatform, p as liveMethods, q as holdLock, r as installService, s as platformName, t as runtimeVersion, tt as openFileLog, u as listingDigest, v as Capabilities, w as readJsonObject, x as documentHeaders, y as capabilityKey, z as runState } from "./instance-CFTw3g-c.js";
2
+ import { $ as readProcess, A as themePageCsp, B as appendEvent, C as jsonResponse, D as defaultPages, E as THEME_BASE, F as finishRun, G as ProtocolServer, H as MAX_FRAME_BYTES, I as markRunning, J as openLedger, K as handler, L as markUnknown, M as createInteraction, N as createEphemeralBus, O as refusalDocument, P as appendRunOutput, Q as readServerFunctions, R as markWaiting, S as isRefusal, T as MADE_WITH_HREF, U as serveWebSocket, V as BINDING_SUBPROTOCOL, W as attachInProcess, X as noFaults, Y as faultsFrom, Z as readFieldCoverage, _ as resetOnClose, a as uninstallService, b as BASE_HEADERS$1, c as resolveHomePath, d as versionIdFor, et as coverageMatcher, f as createLive, g as shellAssetResponse, h as locateShell, i as serviceStatus, j as openRegistry, k as serverPages, l as canonicalRef, m as createGateway, n as startInstance, o as checkPlatform, p as liveMethods, q as holdLock, r as installService, s as platformName, t as runtimeVersion, tt as openFileLog, u as listingDigest, v as Capabilities, w as readJsonObject, x as documentHeaders, y as capabilityKey, z as runState } from "./instance-Bw1BxctF.js";
3
3
  import { c as removeTree, s as realPath } from "./files-DGeWuE4I.js";
4
4
  import { d as runtimeRoot, i as ownedDirectory } from "./directories-BLJjeSPD.js";
5
5
  import { createWriteStream, existsSync, linkSync, mkdirSync, readFileSync, renameSync, statSync, statfsSync, writeFileSync } from "node:fs";
@@ -0,0 +1,13 @@
1
+ //#region src/plugins/child-protocol.ts
2
+ /**
3
+ * The messages between the supervisor and the plugin child (`child/host.ts`), over Node IPC.
4
+ * Internal: the child and the supervisor always come from the same runtime.
5
+ */
6
+ /** Loads entries and reports what each exports. */
7
+ const INSPECT_METHOD = "plugin/inspect";
8
+ /** Runs an exporter. */
9
+ const EXPORT_METHOD = "plugin/export";
10
+ //#endregion
11
+ export { INSPECT_METHOD as n, EXPORT_METHOD as t };
12
+
13
+ //# sourceMappingURL=child-protocol-CPXR6pMu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-protocol-CPXR6pMu.js","names":[],"sources":["../src/plugins/child-protocol.ts"],"sourcesContent":["/**\n * The messages between the supervisor and the plugin child (`child/host.ts`), over Node IPC.\n * Internal: the child and the supervisor always come from the same runtime.\n */\n\n/** Loads entries and reports what each exports. */\nexport const INSPECT_METHOD = \"plugin/inspect\";\n\n/** Runs an exporter. */\nexport const EXPORT_METHOD = \"plugin/export\";\n\n/** `plugin/inspect`'s request. */\nexport interface InspectRequest {\n readonly entries: readonly { readonly file: string; readonly export: string }[];\n}\n\n/** What one entry exports. */\nexport type InspectedEntry =\n | {\n readonly ok: true;\n /** The value's `contract` property: the stamp its `define*` put on it, or `null`. */\n readonly stamp: unknown;\n readonly id?: string;\n /** A CLI command's words. */\n readonly path?: readonly string[];\n /** The names of its function-valued properties. */\n readonly functions: readonly string[];\n }\n | { readonly ok: false; readonly error: string };\n\n/** `plugin/export`'s request. */\nexport interface ExportRequest {\n readonly file: string;\n readonly export: string;\n /** The exporter's ID, as the manifest names it: the loaded definition must say the same. */\n readonly id: string;\n /** The exporter contract's versions this runtime serves: the stamp must be of their line. */\n readonly implemented: readonly string[];\n /** The version's directory in the home: its files are the export's input. */\n readonly versionDir: string;\n readonly version: Readonly<Record<string, unknown>>;\n readonly options: Readonly<Record<string, unknown>>;\n readonly mostraVersion: string;\n}\n\n/** `plugin/export`'s answer: the export, or why the child refused to run it. */\nexport type ExportResponse =\n | {\n readonly files: readonly (\n | { readonly path: string; readonly text: string }\n | { readonly path: string; readonly base64: string }\n )[];\n readonly entry?: string;\n /** What the definition says it writes. */\n readonly output: { readonly layout: \"file\" | \"directory\"; readonly extension?: string };\n readonly findings: readonly unknown[];\n readonly log: readonly string[];\n }\n | {\n /** Refused before `export` ran: not a definition this runtime serves, or bad options. */\n readonly refused: {\n readonly code:\n | \"MOSTRA_PLUGIN_ENTRY_INVALID\"\n | \"MOSTRA_PLUGIN_CONTRACT_UNSUPPORTED\"\n | \"MOSTRA_PLUGIN_OPTIONS_INVALID\";\n readonly message: string;\n };\n };\n"],"mappings":";;;;;;AAMA,MAAa,iBAAiB;;AAG9B,MAAa,gBAAgB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/log.ts","../src/home/record.ts","../src/processes/child.ts","../src/processes/manager.ts","../src/instance/index.ts"],"mappings":";;;;;;KAmLY,cAAc,SAAS;;;;UCpKlB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;;;UCdM;;WAEN,aAAa,gBAAgB;;WAE7B,kBAAkB,gBAAgB;;;UAI5B;;EAEf,QAAQ,gBAAgB,SAAS,gBAAgB;;EAEjD,OAAO,gBAAgB,SAAS;;;;;;;wBAQlB,oBACd,UAAS,8BACR;;;;UCfc;;WAEN;;WAEA;;WAEA;;;UAIM;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA,MAAM;;;;;WAKN;;;;;;WAMA,YAAY;;;;;;WAMZ,YAAY;;;;;WAKZ;aACE,aAAa,gBAAgB;aAC7B,kBAAkB,gBAAgB;;;;;;;WAOpC;;;UAIM;;WAEN;;WAEA;;WAEA;;WAEA;;EAET,QACE,gBACA,SAAS,eACT;IAAY;MACX;;WAEM,UAAU;;WAEV,QAAQ,QAAQ;;EAEzB,KAAK,mBAAmB,QAAQ;;;UAIjB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;;UAgBM;;EAEf,MAAM,MAAM,YAAY,QAAQ;;EAEhC;IAAmB;IAAa;IAAc;IAAkB;;;EAEhE,QAAQ,mBAAmB;;EAE3B;;;;;UCJe;;WAEN;;WAEA;;WAEA,MAAM;;WAEN;aAAmB,OAAO;aAAmB,QAAQ;;;WAErD;;WAEA;;WAEA,UAAU;;WAEV;;WAEA;;;;;WAKA;;;UAIM;;WAEN;;WAEA;;WAEA,aAAa;;;UAIP;;WAEN,MAAM;;WAEN;;WAEA,WAAW;;WAEX,iBAAiB;;WAEjB,SAAS,QAAQ;;EAE1B,KAAK,gBAAgB,mBAAmB,aAAa,aAAa,QAAQ;;;KAIhE;WACG;WAAwB,UAAU;;WAElC;;WAEA,QAAQ;WACR,QAAQ;;;wBAKP;;;;;;wBA0CM,cAAc,SAAS,uBAAuB,QAAQ"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/log.ts","../src/home/record.ts","../src/processes/child.ts","../src/processes/manager.ts","../src/instance/index.ts"],"mappings":";;;;;;KAmLY,cAAc,SAAS;;;;UCpKlB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;;;UCdM;;WAEN,aAAa,gBAAgB;;WAE7B,kBAAkB,gBAAgB;;;UAI5B;;EAEf,QAAQ,gBAAgB,SAAS,gBAAgB;;EAEjD,OAAO,gBAAgB,SAAS;;;;;;;wBAQlB,oBACd,UAAS,8BACR;;;;UCfc;;WAEN;;WAEA;;WAEA;;;UAIM;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA,MAAM;;;;;WAKN;;;;;;WAMA,YAAY;;;;;;WAMZ,YAAY;;;;;WAKZ;aACE,aAAa,gBAAgB;aAC7B,kBAAkB,gBAAgB;;;;;;;WAOpC;;;UAIM;;WAEN;;WAEA;;WAEA;;WAEA;;EAET,QACE,gBACA,SAAS,eACT;IAAY;MACX;;WAEM,UAAU;;WAEV,QAAQ,QAAQ;;EAEzB,KAAK,mBAAmB,QAAQ;;;UAIjB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;;UAgBM;;EAEf,MAAM,MAAM,YAAY,QAAQ;;EAEhC;IAAmB;IAAa;IAAc;IAAkB;;;EAEhE,QAAQ,mBAAmB;;EAE3B;;;;;UCGe;;WAEN;;WAEA;;WAEA,MAAM;;WAEN;aAAmB,OAAO;aAAmB,QAAQ;;;WAErD;;WAEA;;WAEA,UAAU;;WAEV;;WAEA;;;;;WAKA;;;UAIM;;WAEN;;WAEA;;WAEA,aAAa;;;UAIP;;WAEN,MAAM;;WAEN;;WAEA,WAAW;;WAEX,iBAAiB;;WAEjB,SAAS,QAAQ;;EAE1B,KAAK,gBAAgB,mBAAmB,aAAa,aAAa,QAAQ;;;KAIhE;WACG;WAAwB,UAAU;;WAElC;;WAEA,QAAQ;WACR,QAAQ;;;wBAKP;;;;;;wBA0CM,cAAc,SAAS,uBAAuB,QAAQ"}
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as startInstance, t as runtimeVersion } from "./instance-CFTw3g-c.js";
1
+ import { n as startInstance, t as runtimeVersion } from "./instance-Bw1BxctF.js";
2
2
  import { t as connectToSupervisor } from "./child-BmNZ4a70.js";
3
3
  export { connectToSupervisor, runtimeVersion, startInstance };