@agimon-ai/po-core 0.0.0-alpha.52 → 0.0.0-alpha.53
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/README.md +25 -0
- package/dist/apiContracts.cjs +139 -1
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.d.mts +24 -0
- package/dist/apiContracts.d.mts.map +1 -1
- package/dist/apiContracts.mjs +139 -1
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/headlessHub.cjs +3 -0
- package/dist/headlessHub.cjs.map +1 -1
- package/dist/headlessHub.d.mts +1 -0
- package/dist/headlessHub.d.mts.map +1 -1
- package/dist/headlessHub.mjs +3 -0
- package/dist/headlessHub.mjs.map +1 -1
- package/dist/headlessServer.cjs +27 -2
- package/dist/headlessServer.cjs.map +1 -1
- package/dist/headlessServer.d.mts +5 -0
- package/dist/headlessServer.d.mts.map +1 -1
- package/dist/headlessServer.mjs +27 -2
- package/dist/headlessServer.mjs.map +1 -1
- package/dist/index.cjs +5 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +2 -1
- package/dist/native.cjs +25 -18
- package/dist/native.d.mts +4 -2
- package/dist/native.mjs +3 -1
- package/dist/packageApi.cjs +7 -0
- package/dist/packageApi.d.mts +5 -2
- package/dist/packageApi.mjs +3 -2
- package/dist/packageApiServer.cjs +1 -0
- package/dist/packageApiServer.cjs.map +1 -1
- package/dist/packageApiServer.d.mts +1 -0
- package/dist/packageApiServer.d.mts.map +1 -1
- package/dist/packageApiServer.mjs +1 -0
- package/dist/packageApiServer.mjs.map +1 -1
- package/dist/platform.cjs +2 -0
- package/dist/platform.d.mts +2 -2
- package/dist/platform.mjs +2 -2
- package/dist/remoteRuntime.cjs +132 -21
- package/dist/remoteRuntime.cjs.map +1 -1
- package/dist/remoteRuntime.d.mts +37 -3
- package/dist/remoteRuntime.d.mts.map +1 -1
- package/dist/remoteRuntime.mjs +118 -8
- package/dist/remoteRuntime.mjs.map +1 -1
- package/dist/serverPlugin.cjs +11 -5
- package/dist/serverPlugin.d.mts +3 -1
- package/dist/serverPlugin.mjs +3 -1
- package/dist/src/schemas/federation.cjs +28 -0
- package/dist/src/schemas/federation.cjs.map +1 -0
- package/dist/src/schemas/federation.d.mts +327 -0
- package/dist/src/schemas/federation.d.mts.map +1 -0
- package/dist/src/schemas/federation.mjs +25 -0
- package/dist/src/schemas/federation.mjs.map +1 -0
- package/dist/src/schemas/globalServices.cjs +14 -0
- package/dist/src/schemas/globalServices.cjs.map +1 -0
- package/dist/src/schemas/globalServices.d.mts +45 -0
- package/dist/src/schemas/globalServices.d.mts.map +1 -0
- package/dist/src/schemas/globalServices.mjs +12 -0
- package/dist/src/schemas/globalServices.mjs.map +1 -0
- package/dist/src/schemas/httpApiContracts.cjs +136 -2
- package/dist/src/schemas/httpApiContracts.cjs.map +1 -1
- package/dist/src/schemas/httpApiContracts.mjs +136 -2
- package/dist/src/schemas/httpApiContracts.mjs.map +1 -1
- package/dist/src/schemas/packageApi.cjs +29 -3
- package/dist/src/schemas/packageApi.cjs.map +1 -1
- package/dist/src/schemas/packageApi.d.mts +7 -3
- package/dist/src/schemas/packageApi.d.mts.map +1 -1
- package/dist/src/schemas/packageApi.mjs +29 -4
- package/dist/src/schemas/packageApi.mjs.map +1 -1
- package/dist/src/schemas/platform.cjs +6 -0
- package/dist/src/schemas/platform.cjs.map +1 -1
- package/dist/src/schemas/platform.d.mts +27 -0
- package/dist/src/schemas/platform.d.mts.map +1 -1
- package/dist/src/schemas/platform.mjs +5 -1
- package/dist/src/schemas/platform.mjs.map +1 -1
- package/dist/src/schemas/serverBundle.d.mts +3 -0
- package/dist/src/schemas/serverBundle.d.mts.map +1 -1
- package/dist/src/server/remoteRoutes.cjs +44 -2
- package/dist/src/server/remoteRoutes.cjs.map +1 -1
- package/dist/src/server/remoteRoutes.d.mts +21 -0
- package/dist/src/server/remoteRoutes.d.mts.map +1 -0
- package/dist/src/server/remoteRoutes.mjs +44 -2
- package/dist/src/server/remoteRoutes.mjs.map +1 -1
- package/dist/src/server/serverScope.cjs +12 -0
- package/dist/src/server/serverScope.cjs.map +1 -1
- package/dist/src/server/serverScope.d.mts +2 -0
- package/dist/src/server/serverScope.d.mts.map +1 -1
- package/dist/src/server/serverScope.mjs +13 -1
- package/dist/src/server/serverScope.mjs.map +1 -1
- package/dist/src/services/deviceAuth/index.d.mts +1 -0
- package/dist/src/services/deviceAuth/index.d.mts.map +1 -1
- package/dist/src/services/deviceTrust/index.cjs +4 -4
- package/dist/src/services/deviceTrust/index.cjs.map +1 -1
- package/dist/src/services/deviceTrust/index.mjs +1 -1
- package/dist/src/services/deviceTrust/index.mjs.map +1 -1
- package/dist/src/services/federationAccess/index.cjs +280 -0
- package/dist/src/services/federationAccess/index.cjs.map +1 -0
- package/dist/src/services/federationAccess/index.d.mts +27 -0
- package/dist/src/services/federationAccess/index.d.mts.map +1 -0
- package/dist/src/services/federationAccess/index.mjs +274 -0
- package/dist/src/services/federationAccess/index.mjs.map +1 -0
- package/dist/src/services/federationAccess/type.d.mts +99 -0
- package/dist/src/services/federationAccess/type.d.mts.map +1 -0
- package/dist/src/services/globalServices/index.cjs +134 -0
- package/dist/src/services/globalServices/index.cjs.map +1 -0
- package/dist/src/services/globalServices/index.d.mts +33 -0
- package/dist/src/services/globalServices/index.d.mts.map +1 -0
- package/dist/src/services/globalServices/index.mjs +134 -0
- package/dist/src/services/globalServices/index.mjs.map +1 -0
- package/dist/src/services/hubDeviceTrust/index.cjs +196 -0
- package/dist/src/services/hubDeviceTrust/index.cjs.map +1 -0
- package/dist/src/services/hubDeviceTrust/index.d.mts +44 -0
- package/dist/src/services/hubDeviceTrust/index.d.mts.map +1 -0
- package/dist/src/services/hubDeviceTrust/index.mjs +195 -0
- package/dist/src/services/hubDeviceTrust/index.mjs.map +1 -0
- package/dist/src/services/hubFederation/index.cjs +627 -0
- package/dist/src/services/hubFederation/index.cjs.map +1 -0
- package/dist/src/services/hubFederation/index.d.mts +56 -0
- package/dist/src/services/hubFederation/index.d.mts.map +1 -0
- package/dist/src/services/hubFederation/index.mjs +627 -0
- package/dist/src/services/hubFederation/index.mjs.map +1 -0
- package/dist/src/services/remoteAccess/index.cjs +31 -13
- package/dist/src/services/remoteAccess/index.cjs.map +1 -1
- package/dist/src/services/remoteAccess/index.d.mts +1 -1
- package/dist/src/services/remoteAccess/index.d.mts.map +1 -1
- package/dist/src/services/remoteAccess/index.mjs +22 -4
- package/dist/src/services/remoteAccess/index.mjs.map +1 -1
- package/dist/src/services/remoteAccessSettings/index.d.mts +1 -0
- package/dist/src/services/remoteAccessStore/index.cjs +1 -0
- package/dist/src/services/remoteAccessStore/index.cjs.map +1 -1
- package/dist/src/services/remoteAccessStore/index.d.mts +4 -0
- package/dist/src/services/remoteAccessStore/index.mjs +1 -0
- package/dist/src/services/remoteAccessStore/index.mjs.map +1 -1
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.cjs +40 -2
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.cjs.map +1 -1
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.d.mts +33 -0
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.d.mts.map +1 -0
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.mjs +38 -3
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.mjs.map +1 -1
- package/dist/src/services/remoteAccessStore/sync.cjs +18 -0
- package/dist/src/services/remoteAccessStore/sync.cjs.map +1 -1
- package/dist/src/services/remoteAccessStore/sync.d.mts +1 -0
- package/dist/src/services/remoteAccessStore/sync.mjs +19 -1
- package/dist/src/services/remoteAccessStore/sync.mjs.map +1 -1
- package/dist/src/services/remoteGuardPolicy/index.d.mts +10 -0
- package/dist/src/services/remoteGuardPolicy/index.d.mts.map +1 -1
- package/dist/src/types/remote.d.mts +1 -0
- package/dist/src/types/remote.d.mts.map +1 -1
- package/dist/src/web/types/nativeTemplate.d.mts +14 -0
- package/dist/src/web/types/nativeTemplate.d.mts.map +1 -1
- package/dist/src/web/types/webPlugin.d.mts +4 -0
- package/dist/src/web/types/webPlugin.d.mts.map +1 -1
- package/dist/web.d.mts +2 -1
- package/dist/webCompositions.cjs +9 -2
- package/dist/webCompositions.cjs.map +1 -1
- package/dist/webCompositions.d.mts +2 -0
- package/dist/webCompositions.d.mts.map +1 -1
- package/dist/webCompositions.mjs +9 -2
- package/dist/webCompositions.mjs.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -4,4 +4,29 @@ Reusable runtime logic for Po packages. Main and child systems own session lifec
|
|
|
4
4
|
|
|
5
5
|
The `po` package composes these capabilities into the CLI and distribution. Feature packages own their policies and depend on core.
|
|
6
6
|
|
|
7
|
+
## Federation destination boundary
|
|
8
|
+
|
|
9
|
+
The portable `packageApi` entry exports verified caller stamp types, SQLite replay/feed
|
|
10
|
+
stores, home-host workspace sharing and provider-consent records, and the calling-host
|
|
11
|
+
grant store. SQLite is supplied through `po/sqlite`. Replay admission never evicts live
|
|
12
|
+
nonces. Grant refresh refusal durably pauses that work's token admission and emits
|
|
13
|
+
`FederationWorkPaused`; new consent is required to resume it.
|
|
14
|
+
|
|
15
|
+
The Node `remoteRuntime` entry composes the CLI's existing QR-pinned publication signer,
|
|
16
|
+
hub trust store and injected HTTP/SQLite capabilities. Signed-in proofs ride inside the
|
|
17
|
+
existing sealed HTTP channel. Only a claimed hub with a pinned issuer is enabled;
|
|
18
|
+
other signed-in proof requests return 401. Trusted plugin dispatch preserves principal,
|
|
19
|
+
org, account device and calling-host/grant stamps, while legacy callers stay unchanged.
|
|
20
|
+
|
|
21
|
+
A sealed, fresh QR pairing can submit an account-key-signed enrollment at
|
|
22
|
+
`/api/remote/federation/enroll` before reconnect-key registration. The host re-attests it
|
|
23
|
+
and durably pins the account key and current epoch. `/api/remote/federation/claim` checks
|
|
24
|
+
the pinned account signature and persists the issuer JWKS and owner network. Account
|
|
25
|
+
keys and host-scoped reconnect/biometric keys remain separate.
|
|
26
|
+
|
|
27
|
+
The default CLI accepts the claim's owner personal org only. Multi-network roster host
|
|
28
|
+
keys and plugin-owned cross-host operation dispatch belong to later phases, so default
|
|
29
|
+
C4 work is refused until those authorities are composed. Native enrollment transport,
|
|
30
|
+
real-issuer deployment and production propagation remain separate verification items.
|
|
31
|
+
|
|
7
32
|
Public `src/exports` files only forward symbols from their owners. Po-owned Pi authoring and terminal UI exports are retired. The retained agent runtime and `services/piExtensionHost` preserve third-party `@earendil-works/pi-coding-agent` settings, package, and provider compatibility.
|
package/dist/apiContracts.cjs
CHANGED
|
@@ -638,6 +638,61 @@ const host = (id, path, method, result, extra = {}) => ({
|
|
|
638
638
|
responses: jsonApiResponses(result),
|
|
639
639
|
...extra
|
|
640
640
|
});
|
|
641
|
+
const Principal = typebox.Type.Object({
|
|
642
|
+
issuer: Text$3,
|
|
643
|
+
subject: Text$3
|
|
644
|
+
});
|
|
645
|
+
const ProviderGrant = typebox.Type.Object({
|
|
646
|
+
tag: typebox.Type.Literal("po/grant/v1"),
|
|
647
|
+
signature: Text$3,
|
|
648
|
+
payload: typebox.Type.Object({
|
|
649
|
+
issuer: Text$3,
|
|
650
|
+
subject: Text$3,
|
|
651
|
+
grantId: Text$3,
|
|
652
|
+
deviceKeyId: Text$3,
|
|
653
|
+
networkId: Text$3,
|
|
654
|
+
workspaceId: Text$3,
|
|
655
|
+
callingHostId: Text$3,
|
|
656
|
+
targetHostId: Text$3,
|
|
657
|
+
operations: Strings$1,
|
|
658
|
+
constraints: typebox.Type.Record(Text$3, typebox.Type.Union([
|
|
659
|
+
Text$3,
|
|
660
|
+
NumberValue$2,
|
|
661
|
+
Flag$2,
|
|
662
|
+
typebox.Type.Null()
|
|
663
|
+
])),
|
|
664
|
+
issuedAt: NumberValue$2,
|
|
665
|
+
notBefore: NumberValue$2,
|
|
666
|
+
expiresAt: NumberValue$2,
|
|
667
|
+
redelegable: typebox.Type.Literal(false),
|
|
668
|
+
revocationEpoch: Optional$2(NumberValue$2)
|
|
669
|
+
})
|
|
670
|
+
});
|
|
671
|
+
const ProviderConsent = typebox.Type.Object({
|
|
672
|
+
workspaceId: Text$3,
|
|
673
|
+
providerHostId: Text$3,
|
|
674
|
+
packageName: Text$3,
|
|
675
|
+
owner: Principal,
|
|
676
|
+
grants: typebox.Type.Array(ProviderGrant, {
|
|
677
|
+
minItems: 2,
|
|
678
|
+
maxItems: 2
|
|
679
|
+
}),
|
|
680
|
+
createdAt: NumberValue$2,
|
|
681
|
+
expiresAt: NumberValue$2
|
|
682
|
+
});
|
|
683
|
+
const ConsentCandidate = typebox.Type.Object({
|
|
684
|
+
hostId: Text$3,
|
|
685
|
+
packageName: Text$3,
|
|
686
|
+
version: Text$3,
|
|
687
|
+
operations: Strings$1,
|
|
688
|
+
manifestExpiresAt: NumberValue$2
|
|
689
|
+
});
|
|
690
|
+
const ConsentWorkspaceParameter = {
|
|
691
|
+
name: "workspaceId",
|
|
692
|
+
in: "path",
|
|
693
|
+
required: true,
|
|
694
|
+
schema: Text$3
|
|
695
|
+
};
|
|
641
696
|
const Binary = typebox.Type.String({ contentEncoding: "binary" });
|
|
642
697
|
const headlessHttpContracts = [
|
|
643
698
|
host("health", "/api/health", "GET", typebox.Type.Object({
|
|
@@ -657,6 +712,13 @@ const headlessHttpContracts = [
|
|
|
657
712
|
}), { maxItems: 10 })
|
|
658
713
|
})) }),
|
|
659
714
|
host("compositions", "/api/compositions", "GET", typebox.Type.Object({
|
|
715
|
+
network: Optional$2(typebox.Type.Object({
|
|
716
|
+
hostId: Text$3,
|
|
717
|
+
networkId: Text$3,
|
|
718
|
+
enrollmentGeneration: Optional$2(NumberValue$2)
|
|
719
|
+
})),
|
|
720
|
+
/** The computer's own name, which phones show instead of a tunnel address. */
|
|
721
|
+
displayName: Optional$2(Text$3),
|
|
660
722
|
global: Optional$2(WebCompositionSchema),
|
|
661
723
|
nativeGlobal: Optional$2(NativeCompositionSchema),
|
|
662
724
|
/** App bundles by platform, which a phone loads only when its own fingerprint matches. */
|
|
@@ -674,9 +736,85 @@ const headlessHttpContracts = [
|
|
|
674
736
|
root: Text$3,
|
|
675
737
|
/** `null` for a sandboxed workspace: its plugins run in its sandbox, the host has none for it. */
|
|
676
738
|
webComposition: Optional$2(typebox.Type.Union([WebCompositionSchema, typebox.Type.Null()])),
|
|
677
|
-
nativeComposition: Optional$2(typebox.Type.Union([NativeCompositionSchema, typebox.Type.Null()]))
|
|
739
|
+
nativeComposition: Optional$2(typebox.Type.Union([NativeCompositionSchema, typebox.Type.Null()])),
|
|
740
|
+
providers: Optional$2(typebox.Type.Array(typebox.Type.Object({
|
|
741
|
+
hostId: Text$3,
|
|
742
|
+
packageName: Text$3,
|
|
743
|
+
version: Text$3,
|
|
744
|
+
operations: typebox.Type.Array(typebox.Type.Object({
|
|
745
|
+
scope: typebox.Type.Union([
|
|
746
|
+
typebox.Type.Literal("global"),
|
|
747
|
+
typebox.Type.Literal("workspace"),
|
|
748
|
+
typebox.Type.Literal("session")
|
|
749
|
+
]),
|
|
750
|
+
names: Strings$1
|
|
751
|
+
})),
|
|
752
|
+
provenance: typebox.Type.Union([
|
|
753
|
+
typebox.Type.Literal("local"),
|
|
754
|
+
typebox.Type.Literal("own"),
|
|
755
|
+
typebox.Type.Literal("consented")
|
|
756
|
+
]),
|
|
757
|
+
status: typebox.Type.Union([typebox.Type.Literal("available"), typebox.Type.Literal("unavailable")]),
|
|
758
|
+
reason: Optional$2(typebox.Type.Union([
|
|
759
|
+
typebox.Type.Literal("manifest-missing"),
|
|
760
|
+
typebox.Type.Literal("manifest-expired"),
|
|
761
|
+
typebox.Type.Literal("roster-stale"),
|
|
762
|
+
typebox.Type.Literal("host-removed"),
|
|
763
|
+
typebox.Type.Literal("consent-expired")
|
|
764
|
+
])),
|
|
765
|
+
expiresAt: Optional$2(NumberValue$2)
|
|
766
|
+
})))
|
|
678
767
|
}))
|
|
679
768
|
})),
|
|
769
|
+
host("network.voters.propose", "/api/network/voters", "POST", Json$4, { body: body(typebox.Type.Object({
|
|
770
|
+
change: typebox.Type.Union([typebox.Type.Object({
|
|
771
|
+
network: Text$3,
|
|
772
|
+
epoch: NumberValue$2,
|
|
773
|
+
kind: typebox.Type.Literal("add"),
|
|
774
|
+
added: Text$3,
|
|
775
|
+
addedKey: Text$3
|
|
776
|
+
}), typebox.Type.Object({
|
|
777
|
+
network: Text$3,
|
|
778
|
+
epoch: NumberValue$2,
|
|
779
|
+
kind: typebox.Type.Literal("evict"),
|
|
780
|
+
removed: Text$3
|
|
781
|
+
})]),
|
|
782
|
+
authorization: Text$3
|
|
783
|
+
})) }),
|
|
784
|
+
host("network.consents.list", "/api/network/workspaces/{workspaceId}/consents", "GET", typebox.Type.Object({
|
|
785
|
+
consents: typebox.Type.Array(ProviderConsent),
|
|
786
|
+
candidates: typebox.Type.Array(ConsentCandidate)
|
|
787
|
+
}), { parameters: [ConsentWorkspaceParameter] }),
|
|
788
|
+
host("network.consents.approve", "/api/network/workspaces/{workspaceId}/consents", "POST", ProviderConsent, {
|
|
789
|
+
parameters: [ConsentWorkspaceParameter],
|
|
790
|
+
body: body(typebox.Type.Object({
|
|
791
|
+
providerHostId: Text$3,
|
|
792
|
+
packageName: Text$3,
|
|
793
|
+
grants: typebox.Type.Array(ProviderGrant, {
|
|
794
|
+
minItems: 2,
|
|
795
|
+
maxItems: 2
|
|
796
|
+
})
|
|
797
|
+
})),
|
|
798
|
+
responses: jsonApiResponses(ProviderConsent, 201)
|
|
799
|
+
}),
|
|
800
|
+
host("network.consents.revoke", "/api/network/workspaces/{workspaceId}/consents/{providerHostId}/{packageName}", "DELETE", typebox.Type.Null(), {
|
|
801
|
+
parameters: [
|
|
802
|
+
ConsentWorkspaceParameter,
|
|
803
|
+
{
|
|
804
|
+
name: "providerHostId",
|
|
805
|
+
in: "path",
|
|
806
|
+
required: true,
|
|
807
|
+
schema: Text$3
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
name: "packageName",
|
|
811
|
+
in: "path",
|
|
812
|
+
required: true,
|
|
813
|
+
schema: Text$3
|
|
814
|
+
}
|
|
815
|
+
],
|
|
816
|
+
responses: { "204": { description: "Provider consent revoked" } }
|
|
817
|
+
}),
|
|
680
818
|
host("directories", "/api/directories", "GET", typebox.Type.Object({ directories: Strings$1 }), { parameters: [query("q")] }),
|
|
681
819
|
host("directories.children", "/api/directories/children", "GET", typebox.Type.Object({
|
|
682
820
|
path: Text$3,
|