@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.
- package/dist/apiContracts.cjs +16 -40
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.mjs +16 -40
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/headlessHub.cjs +2 -2
- package/dist/headlessHub.cjs.map +1 -1
- package/dist/headlessHub.mjs +2 -2
- package/dist/headlessHub.mjs.map +1 -1
- package/dist/headlessServer.cjs +7 -0
- package/dist/headlessServer.cjs.map +1 -1
- package/dist/headlessServer.mjs +7 -0
- package/dist/headlessServer.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/native.cjs +3 -5
- package/dist/native.d.mts +7 -7
- package/dist/native.mjs +5 -5
- package/dist/serverPlugin.cjs +13 -18
- package/dist/serverPlugin.d.mts +3 -5
- package/dist/serverPlugin.mjs +3 -4
- package/dist/src/extensions/serverPlugin.cjs +9 -10
- package/dist/src/extensions/serverPlugin.cjs.map +1 -1
- package/dist/src/extensions/serverPlugin.d.mts.map +1 -1
- package/dist/src/extensions/serverPlugin.mjs +9 -10
- package/dist/src/extensions/serverPlugin.mjs.map +1 -1
- package/dist/src/extensions/webPlugin.cjs +6 -4
- package/dist/src/extensions/webPlugin.cjs.map +1 -1
- package/dist/src/extensions/webPlugin.d.mts +3 -3
- package/dist/src/extensions/webPlugin.d.mts.map +1 -1
- package/dist/src/extensions/webPlugin.mjs +6 -4
- package/dist/src/extensions/webPlugin.mjs.map +1 -1
- package/dist/src/schemas/federation.cjs +5 -9
- package/dist/src/schemas/federation.cjs.map +1 -1
- package/dist/src/schemas/federation.d.mts +18 -5
- package/dist/src/schemas/federation.d.mts.map +1 -1
- package/dist/src/schemas/federation.mjs +5 -9
- package/dist/src/schemas/federation.mjs.map +1 -1
- package/dist/src/schemas/hostServices.cjs +14 -0
- package/dist/src/schemas/hostServices.cjs.map +1 -0
- package/dist/src/schemas/hostServices.d.mts +45 -0
- package/dist/src/schemas/hostServices.d.mts.map +1 -0
- package/dist/src/schemas/hostServices.mjs +12 -0
- package/dist/src/schemas/hostServices.mjs.map +1 -0
- package/dist/src/schemas/httpApiContracts.cjs +2 -2
- package/dist/src/schemas/httpApiContracts.cjs.map +1 -1
- package/dist/src/schemas/httpApiContracts.mjs +2 -2
- package/dist/src/schemas/httpApiContracts.mjs.map +1 -1
- package/dist/src/schemas/pluginProtocol.cjs +21 -23
- package/dist/src/schemas/pluginProtocol.cjs.map +1 -1
- package/dist/src/schemas/pluginProtocol.d.mts +27 -34
- package/dist/src/schemas/pluginProtocol.d.mts.map +1 -1
- package/dist/src/schemas/pluginProtocol.mjs +21 -23
- package/dist/src/schemas/pluginProtocol.mjs.map +1 -1
- package/dist/src/schemas/protocolHubContract.d.mts +7 -7
- package/dist/src/schemas/serverPlugin.cjs +2 -2
- package/dist/src/schemas/serverPlugin.cjs.map +1 -1
- package/dist/src/schemas/serverPlugin.mjs +2 -2
- package/dist/src/schemas/serverPlugin.mjs.map +1 -1
- package/dist/src/schemas/serverScope.cjs +2 -2
- package/dist/src/schemas/serverScope.cjs.map +1 -1
- package/dist/src/schemas/serverScope.mjs +2 -2
- package/dist/src/schemas/serverScope.mjs.map +1 -1
- package/dist/src/server/serverScope.cjs +6 -21
- package/dist/src/server/serverScope.cjs.map +1 -1
- package/dist/src/server/serverScope.d.mts.map +1 -1
- package/dist/src/server/serverScope.mjs +6 -21
- package/dist/src/server/serverScope.mjs.map +1 -1
- package/dist/src/services/federationAccess/type.d.mts +1 -0
- package/dist/src/services/federationAccess/type.d.mts.map +1 -1
- package/dist/src/services/{globalServices → hostServices}/index.cjs +10 -10
- package/dist/src/services/hostServices/index.cjs.map +1 -0
- package/dist/src/services/{globalServices → hostServices}/index.d.mts +9 -9
- package/dist/src/services/hostServices/index.d.mts.map +1 -0
- package/dist/src/services/{globalServices → hostServices}/index.mjs +10 -10
- package/dist/src/services/hostServices/index.mjs.map +1 -0
- package/dist/src/services/hubFederation/index.cjs +50 -2
- package/dist/src/services/hubFederation/index.cjs.map +1 -1
- package/dist/src/services/hubFederation/index.d.mts.map +1 -1
- package/dist/src/services/hubFederation/index.mjs +50 -2
- package/dist/src/services/hubFederation/index.mjs.map +1 -1
- package/dist/src/services/scopeInput/index.cjs +15 -0
- package/dist/src/services/scopeInput/index.cjs.map +1 -0
- package/dist/src/services/scopeInput/index.mjs +14 -0
- package/dist/src/services/scopeInput/index.mjs.map +1 -0
- package/dist/src/web/models/globalStore.cjs +0 -3
- package/dist/src/web/models/globalStore.cjs.map +1 -1
- package/dist/src/web/models/globalStore.d.mts +2 -4
- package/dist/src/web/models/globalStore.d.mts.map +1 -1
- package/dist/src/web/models/globalStore.mjs +1 -3
- package/dist/src/web/models/globalStore.mjs.map +1 -1
- package/dist/src/web/services/apiRoutes/index.cjs +3 -3
- package/dist/src/web/services/apiRoutes/index.cjs.map +1 -1
- package/dist/src/web/services/apiRoutes/index.d.mts +2 -2
- package/dist/src/web/services/apiRoutes/index.mjs +3 -3
- package/dist/src/web/services/apiRoutes/index.mjs.map +1 -1
- package/dist/src/web/services/hubRevisions/index.cjs +3 -6
- package/dist/src/web/services/hubRevisions/index.cjs.map +1 -1
- package/dist/src/web/services/hubRevisions/index.d.mts +0 -2
- package/dist/src/web/services/hubRevisions/index.d.mts.map +1 -1
- package/dist/src/web/services/hubRevisions/index.mjs +4 -6
- package/dist/src/web/services/hubRevisions/index.mjs.map +1 -1
- package/dist/src/web/types/extensionFile.d.mts +1 -1
- package/dist/src/web/types/template.d.mts +10 -1
- package/dist/src/web/types/template.d.mts.map +1 -1
- package/dist/src/web/types/webPlugin.d.mts +2 -2
- package/dist/src/web/types/webPlugin.d.mts.map +1 -1
- package/dist/web.cjs +37 -41
- package/dist/web.d.mts +9 -10
- package/dist/web.mjs +5 -6
- package/package.json +4 -4
- package/dist/src/schemas/globalServices.cjs +0 -32
- package/dist/src/schemas/globalServices.cjs.map +0 -1
- package/dist/src/schemas/globalServices.d.mts +0 -55
- package/dist/src/schemas/globalServices.d.mts.map +0 -1
- package/dist/src/schemas/globalServices.mjs +0 -26
- package/dist/src/schemas/globalServices.mjs.map +0 -1
- package/dist/src/services/globalServices/index.cjs.map +0 -1
- package/dist/src/services/globalServices/index.d.mts.map +0 -1
- package/dist/src/services/globalServices/index.mjs.map +0 -1
- package/dist/src/services/legacyScope/index.cjs +0 -57
- package/dist/src/services/legacyScope/index.cjs.map +0 -1
- package/dist/src/services/legacyScope/index.d.mts +0 -17
- package/dist/src/services/legacyScope/index.d.mts.map +0 -1
- package/dist/src/services/legacyScope/index.mjs +0 -54
- package/dist/src/services/legacyScope/index.mjs.map +0 -1
- package/dist/src/services/legacyScope/type.d.mts +0 -5
- package/dist/src/services/legacyScope/type.d.mts.map +0 -1
package/dist/apiContracts.cjs
CHANGED
|
@@ -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/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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`
|
|
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 =
|
|
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
|
|
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
|
|
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) =>
|
|
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
|
-
|
|
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 = "
|
|
518
|
-
/** The mount as the po.hub@1 wire carries it.
|
|
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.
|
|
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
|
-
|
|
828
|
-
|
|
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,
|