@agimon-ai/po-core 0.0.0-alpha.145 → 0.0.0-alpha.147

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 (126) hide show
  1. package/dist/apiContracts.cjs +16 -40
  2. package/dist/apiContracts.cjs.map +1 -1
  3. package/dist/apiContracts.mjs +16 -40
  4. package/dist/apiContracts.mjs.map +1 -1
  5. package/dist/headlessHub.cjs +2 -2
  6. package/dist/headlessHub.cjs.map +1 -1
  7. package/dist/headlessHub.mjs +2 -2
  8. package/dist/headlessHub.mjs.map +1 -1
  9. package/dist/headlessServer.cjs +7 -0
  10. package/dist/headlessServer.cjs.map +1 -1
  11. package/dist/headlessServer.mjs +7 -0
  12. package/dist/headlessServer.mjs.map +1 -1
  13. package/dist/index.d.mts +2 -2
  14. package/dist/native.cjs +3 -5
  15. package/dist/native.d.mts +7 -7
  16. package/dist/native.mjs +5 -5
  17. package/dist/serverPlugin.cjs +13 -18
  18. package/dist/serverPlugin.d.mts +3 -5
  19. package/dist/serverPlugin.mjs +3 -4
  20. package/dist/src/extensions/serverPlugin.cjs +9 -10
  21. package/dist/src/extensions/serverPlugin.cjs.map +1 -1
  22. package/dist/src/extensions/serverPlugin.d.mts.map +1 -1
  23. package/dist/src/extensions/serverPlugin.mjs +9 -10
  24. package/dist/src/extensions/serverPlugin.mjs.map +1 -1
  25. package/dist/src/extensions/webPlugin.cjs +6 -4
  26. package/dist/src/extensions/webPlugin.cjs.map +1 -1
  27. package/dist/src/extensions/webPlugin.d.mts +3 -3
  28. package/dist/src/extensions/webPlugin.d.mts.map +1 -1
  29. package/dist/src/extensions/webPlugin.mjs +6 -4
  30. package/dist/src/extensions/webPlugin.mjs.map +1 -1
  31. package/dist/src/schemas/federation.cjs +5 -9
  32. package/dist/src/schemas/federation.cjs.map +1 -1
  33. package/dist/src/schemas/federation.d.mts +18 -5
  34. package/dist/src/schemas/federation.d.mts.map +1 -1
  35. package/dist/src/schemas/federation.mjs +5 -9
  36. package/dist/src/schemas/federation.mjs.map +1 -1
  37. package/dist/src/schemas/hostServices.cjs +14 -0
  38. package/dist/src/schemas/hostServices.cjs.map +1 -0
  39. package/dist/src/schemas/hostServices.d.mts +45 -0
  40. package/dist/src/schemas/hostServices.d.mts.map +1 -0
  41. package/dist/src/schemas/hostServices.mjs +12 -0
  42. package/dist/src/schemas/hostServices.mjs.map +1 -0
  43. package/dist/src/schemas/httpApiContracts.cjs +2 -2
  44. package/dist/src/schemas/httpApiContracts.cjs.map +1 -1
  45. package/dist/src/schemas/httpApiContracts.mjs +2 -2
  46. package/dist/src/schemas/httpApiContracts.mjs.map +1 -1
  47. package/dist/src/schemas/pluginProtocol.cjs +21 -23
  48. package/dist/src/schemas/pluginProtocol.cjs.map +1 -1
  49. package/dist/src/schemas/pluginProtocol.d.mts +27 -34
  50. package/dist/src/schemas/pluginProtocol.d.mts.map +1 -1
  51. package/dist/src/schemas/pluginProtocol.mjs +21 -23
  52. package/dist/src/schemas/pluginProtocol.mjs.map +1 -1
  53. package/dist/src/schemas/protocolHubContract.d.mts +7 -7
  54. package/dist/src/schemas/serverPlugin.cjs +2 -2
  55. package/dist/src/schemas/serverPlugin.cjs.map +1 -1
  56. package/dist/src/schemas/serverPlugin.mjs +2 -2
  57. package/dist/src/schemas/serverPlugin.mjs.map +1 -1
  58. package/dist/src/schemas/serverScope.cjs +2 -2
  59. package/dist/src/schemas/serverScope.cjs.map +1 -1
  60. package/dist/src/schemas/serverScope.mjs +2 -2
  61. package/dist/src/schemas/serverScope.mjs.map +1 -1
  62. package/dist/src/server/serverScope.cjs +6 -21
  63. package/dist/src/server/serverScope.cjs.map +1 -1
  64. package/dist/src/server/serverScope.d.mts.map +1 -1
  65. package/dist/src/server/serverScope.mjs +6 -21
  66. package/dist/src/server/serverScope.mjs.map +1 -1
  67. package/dist/src/services/federationAccess/type.d.mts +1 -0
  68. package/dist/src/services/federationAccess/type.d.mts.map +1 -1
  69. package/dist/src/services/{globalServices → hostServices}/index.cjs +10 -10
  70. package/dist/src/services/hostServices/index.cjs.map +1 -0
  71. package/dist/src/services/{globalServices → hostServices}/index.d.mts +9 -9
  72. package/dist/src/services/hostServices/index.d.mts.map +1 -0
  73. package/dist/src/services/{globalServices → hostServices}/index.mjs +10 -10
  74. package/dist/src/services/hostServices/index.mjs.map +1 -0
  75. package/dist/src/services/hubFederation/index.cjs +50 -2
  76. package/dist/src/services/hubFederation/index.cjs.map +1 -1
  77. package/dist/src/services/hubFederation/index.d.mts.map +1 -1
  78. package/dist/src/services/hubFederation/index.mjs +50 -2
  79. package/dist/src/services/hubFederation/index.mjs.map +1 -1
  80. package/dist/src/services/scopeInput/index.cjs +15 -0
  81. package/dist/src/services/scopeInput/index.cjs.map +1 -0
  82. package/dist/src/services/scopeInput/index.mjs +14 -0
  83. package/dist/src/services/scopeInput/index.mjs.map +1 -0
  84. package/dist/src/web/models/globalStore.cjs +0 -3
  85. package/dist/src/web/models/globalStore.cjs.map +1 -1
  86. package/dist/src/web/models/globalStore.d.mts +2 -4
  87. package/dist/src/web/models/globalStore.d.mts.map +1 -1
  88. package/dist/src/web/models/globalStore.mjs +1 -3
  89. package/dist/src/web/models/globalStore.mjs.map +1 -1
  90. package/dist/src/web/services/apiRoutes/index.cjs +3 -3
  91. package/dist/src/web/services/apiRoutes/index.cjs.map +1 -1
  92. package/dist/src/web/services/apiRoutes/index.d.mts +2 -2
  93. package/dist/src/web/services/apiRoutes/index.mjs +3 -3
  94. package/dist/src/web/services/apiRoutes/index.mjs.map +1 -1
  95. package/dist/src/web/services/hubRevisions/index.cjs +3 -6
  96. package/dist/src/web/services/hubRevisions/index.cjs.map +1 -1
  97. package/dist/src/web/services/hubRevisions/index.d.mts +0 -2
  98. package/dist/src/web/services/hubRevisions/index.d.mts.map +1 -1
  99. package/dist/src/web/services/hubRevisions/index.mjs +4 -6
  100. package/dist/src/web/services/hubRevisions/index.mjs.map +1 -1
  101. package/dist/src/web/types/extensionFile.d.mts +1 -1
  102. package/dist/src/web/types/template.d.mts +10 -1
  103. package/dist/src/web/types/template.d.mts.map +1 -1
  104. package/dist/src/web/types/webPlugin.d.mts +2 -2
  105. package/dist/src/web/types/webPlugin.d.mts.map +1 -1
  106. package/dist/web.cjs +37 -41
  107. package/dist/web.d.mts +9 -10
  108. package/dist/web.mjs +5 -6
  109. package/package.json +4 -4
  110. package/dist/src/schemas/globalServices.cjs +0 -32
  111. package/dist/src/schemas/globalServices.cjs.map +0 -1
  112. package/dist/src/schemas/globalServices.d.mts +0 -55
  113. package/dist/src/schemas/globalServices.d.mts.map +0 -1
  114. package/dist/src/schemas/globalServices.mjs +0 -26
  115. package/dist/src/schemas/globalServices.mjs.map +0 -1
  116. package/dist/src/services/globalServices/index.cjs.map +0 -1
  117. package/dist/src/services/globalServices/index.d.mts.map +0 -1
  118. package/dist/src/services/globalServices/index.mjs.map +0 -1
  119. package/dist/src/services/legacyScope/index.cjs +0 -57
  120. package/dist/src/services/legacyScope/index.cjs.map +0 -1
  121. package/dist/src/services/legacyScope/index.d.mts +0 -17
  122. package/dist/src/services/legacyScope/index.d.mts.map +0 -1
  123. package/dist/src/services/legacyScope/index.mjs +0 -54
  124. package/dist/src/services/legacyScope/index.mjs.map +0 -1
  125. package/dist/src/services/legacyScope/type.d.mts +0 -5
  126. package/dist/src/services/legacyScope/type.d.mts.map +0 -1
@@ -1,27 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let typebox = require("typebox");
3
3
  let typebox_value = require("typebox/value");
4
- //#region src/services/legacyScope/index.ts
5
- const warned = /* @__PURE__ */ new Set();
6
- const MESSAGES = {
7
- manifest: "a poServer manifest lists scope 'global'",
8
- definition: "a server, web or native plugin definition declares a 'global' level or contract",
9
- mount: "a plugin call addresses mount { scope: 'global' }",
10
- revision: "a revision key starts with 'global:'",
11
- federation: "a federation operation names scope 'global'",
12
- contract: "an API contract names scope 'global'"
13
- };
14
- /** Warns once per alias kind that a retired `global` scope was read as `host`. */
15
- function warnLegacyScope(alias) {
16
- if (warned.has(alias)) return;
17
- warned.add(alias);
18
- console.warn(`[po] Deprecated: ${MESSAGES[alias]}. Scope 'global' was renamed to 'host'; run po sync.`);
19
- }
20
- /** `host` for the retired `global`, warning once for `alias`; any other value is returned unchanged. */
21
- function normalizeLegacyScope(value, alias) {
22
- if (value !== "global") return value;
23
- warnLegacyScope(alias);
24
- return "host";
4
+ //#region src/services/scopeInput/index.ts
5
+ /** Refuses retired host-scope vocabulary at version boundaries. */
6
+ function requireCurrentScope(value, _boundary) {
7
+ if (value === "global") throw new Error("The 'global' scope was renamed to 'host'. Update this client.");
8
+ return value;
25
9
  }
26
10
  //#endregion
27
11
  //#region src/schemas/apiContracts.ts
@@ -109,19 +93,19 @@ const PoApiContractSchema = typebox.Type.Object({
109
93
  function defineApiContract(contract) {
110
94
  return contract;
111
95
  }
112
- /** Each `{ scope }` entry of `list` with the retired `global` read as `host`, warning once; anything else as is. */
96
+ /** Each `{ scope }` entry of `list` with the retired `global` refused; anything else as is. */
113
97
  function hostScoped(list) {
114
98
  if (!Array.isArray(list)) return list;
115
99
  return list.map((entry) => {
116
100
  if (typeof entry !== "object" || entry === null || !("scope" in entry)) return entry;
117
- const scope = normalizeLegacyScope(entry.scope, "contract");
101
+ const scope = requireCurrentScope(entry.scope, "contract");
118
102
  return scope === entry.scope ? entry : {
119
103
  ...entry,
120
104
  scope
121
105
  };
122
106
  });
123
107
  }
124
- /** A contract built before the rename, with its operations' `global` scope read as `host`. */
108
+ /** A contract built before the rename, with its operations' `global` scope refused. */
125
109
  function withHostContract(value) {
126
110
  if (typeof value !== "object" || value === null || Array.isArray(value)) return value;
127
111
  const record = value;
@@ -182,7 +166,7 @@ function parseCompiledContracts(value) {
182
166
  }
183
167
  return data;
184
168
  }
185
- /** Compiled contracts written before the rename, with `global` package scopes and contract scopes read as `host`. */
169
+ /** Compiled contracts written before the rename, with `global` package scopes and contract scopes refused. */
186
170
  function withHostCompiled(value) {
187
171
  if (typeof value !== "object" || value === null || !Array.isArray(value.packages)) return value;
188
172
  const packages = value.packages.map((entry) => {
@@ -190,7 +174,7 @@ function withHostCompiled(value) {
190
174
  const record = entry;
191
175
  return {
192
176
  ...entry,
193
- ...Array.isArray(record.scopes) ? { scopes: record.scopes.map((scope) => normalizeLegacyScope(scope, "contract")) } : {},
177
+ ...Array.isArray(record.scopes) ? { scopes: record.scopes.map((scope) => requireCurrentScope(scope, "contract")) } : {},
194
178
  ...record.contract === void 0 ? {} : { contract: withHostContract(record.contract) }
195
179
  };
196
180
  });
@@ -488,9 +472,7 @@ function asyncApiSchemas(schemas) {
488
472
  const API_BASE_PATH = "context";
489
473
  const ITEM_ROUTE = "/item";
490
474
  const CURRENT_ROUTE = "/current";
491
- //#endregion
492
- //#region src/schemas/pluginProtocol.ts
493
- const PoPluginHostMountSchema = typebox.Type.Union([
475
+ const PoPluginMountSchema = typebox.Type.Union([
494
476
  typebox.Type.Object({ scope: typebox.Type.Literal("host") }, { additionalProperties: false }),
495
477
  typebox.Type.Object({
496
478
  scope: typebox.Type.Literal("workspace"),
@@ -501,12 +483,6 @@ const PoPluginHostMountSchema = typebox.Type.Union([
501
483
  sessionId: typebox.Type.String({ minLength: 1 })
502
484
  }, { additionalProperties: false })
503
485
  ]);
504
- /**
505
- * The address is always exact. A workspace call never resolves to a host service.
506
- * The wire still admits the retired `{ scope: 'global' }` from older clients; read it with
507
- * `normalizePoPluginMount`. The static type names `host` only.
508
- */
509
- const PoPluginMountSchema = typebox.Type.Unsafe(typebox.Type.Union([...PoPluginHostMountSchema.anyOf, typebox.Type.Object({ scope: typebox.Type.Literal("global") }, { additionalProperties: false })]));
510
486
  typebox.Type.Object({
511
487
  mount: PoPluginMountSchema,
512
488
  service: typebox.Type.String({ minLength: 1 }),
@@ -514,8 +490,8 @@ typebox.Type.Object({
514
490
  input: typebox.Type.Unknown()
515
491
  }, { additionalProperties: false });
516
492
  /** The host scope as the po.hub@1 wire spells it. */
517
- const PO_WIRE_HOST_SCOPE = "global";
518
- /** The mount as the po.hub@1 wire carries it. Byte-identical to the pre-rename schema. */
493
+ const PO_WIRE_HOST_SCOPE = "host";
494
+ /** The mount as the po.hub@1 wire carries it. */
519
495
  const PoPluginWireMountSchema = typebox.Type.Union([
520
496
  typebox.Type.Object({ scope: typebox.Type.Literal(PO_WIRE_HOST_SCOPE) }, { additionalProperties: false }),
521
497
  typebox.Type.Object({
@@ -527,7 +503,7 @@ const PoPluginWireMountSchema = typebox.Type.Union([
527
503
  sessionId: typebox.Type.String({ minLength: 1 })
528
504
  }, { additionalProperties: false })
529
505
  ]);
530
- /** A plugin call as the po.hub@1 wire carries it. Byte-identical to the pre-rename schema. */
506
+ /** A plugin call as the po.hub@1 wire carries it. */
531
507
  const PoPluginWireCallSchema = typebox.Type.Object({
532
508
  mount: PoPluginWireMountSchema,
533
509
  service: typebox.Type.String({ minLength: 1 }),
@@ -824,8 +800,8 @@ const headlessHttpContracts = [
824
800
  })),
825
801
  /** The computer's own name, which phones show instead of a tunnel address. */
826
802
  displayName: Optional$2(Text$3),
827
- global: Optional$2(WebCompositionSchema),
828
- nativeGlobal: Optional$2(NativeCompositionSchema),
803
+ host: Optional$2(WebCompositionSchema),
804
+ nativeHost: Optional$2(NativeCompositionSchema),
829
805
  publicKey: Optional$2(Text$3),
830
806
  shell: Optional$2(typebox.Type.Object({
831
807
  publicKey: Text$3,