@agimon-ai/po-core 0.0.0-alpha.160 → 0.0.0-alpha.162

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 (128) hide show
  1. package/README.md +27 -66
  2. package/dist/apiContracts.cjs +17 -5106
  3. package/dist/apiContracts.cjs.map +1 -1
  4. package/dist/apiContracts.d.mts +20 -2108
  5. package/dist/apiContracts.d.mts.map +1 -1
  6. package/dist/apiContracts.mjs +17 -5106
  7. package/dist/apiContracts.mjs.map +1 -1
  8. package/dist/headlessHub.cjs +5 -2
  9. package/dist/headlessHub.cjs.map +1 -1
  10. package/dist/headlessHub.mjs +5 -2
  11. package/dist/headlessHub.mjs.map +1 -1
  12. package/dist/src/schemas/extensionFile.d.mts +1 -1
  13. package/dist/src/schemas/hubChannel.cjs.map +1 -1
  14. package/dist/src/schemas/hubChannel.d.mts +4 -0
  15. package/dist/src/schemas/hubChannel.d.mts.map +1 -1
  16. package/dist/src/schemas/hubChannel.mjs.map +1 -1
  17. package/dist/src/schemas/packageApi.cjs.map +1 -1
  18. package/dist/src/schemas/packageApi.d.mts +2 -0
  19. package/dist/src/schemas/packageApi.d.mts.map +1 -1
  20. package/dist/src/schemas/packageApi.mjs.map +1 -1
  21. package/dist/src/schemas/pluginCatalog.cjs +17 -17
  22. package/dist/src/schemas/pluginCatalog.cjs.map +1 -1
  23. package/dist/src/schemas/pluginCatalog.d.mts +37 -39
  24. package/dist/src/schemas/pluginCatalog.d.mts.map +1 -1
  25. package/dist/src/schemas/pluginCatalog.mjs +17 -17
  26. package/dist/src/schemas/pluginCatalog.mjs.map +1 -1
  27. package/dist/src/web/types/extensionFile.d.mts +2 -2
  28. package/package.json +8 -6
  29. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/errors.cjs +0 -56
  30. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/errors.cjs.map +0 -1
  31. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/errors.d.mts +0 -21
  32. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/errors.d.mts.map +0 -1
  33. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/errors.mjs +0 -56
  34. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/errors.mjs.map +0 -1
  35. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/parse.cjs +0 -30
  36. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/parse.cjs.map +0 -1
  37. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/parse.d.mts +0 -15
  38. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/parse.d.mts.map +0 -1
  39. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/parse.mjs +0 -19
  40. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/parse.mjs.map +0 -1
  41. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/schemas.cjs +0 -849
  42. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/schemas.cjs.map +0 -1
  43. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/schemas.d.mts +0 -301
  44. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/schemas.d.mts.map +0 -1
  45. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/schemas.mjs +0 -783
  46. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/schemas.mjs.map +0 -1
  47. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/api.cjs +0 -492
  48. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/api.cjs.map +0 -1
  49. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/api.d.mts +0 -74
  50. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/api.d.mts.map +0 -1
  51. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/api.mjs +0 -445
  52. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/api.mjs.map +0 -1
  53. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/checks.cjs +0 -197
  54. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/checks.cjs.map +0 -1
  55. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/checks.d.mts +0 -136
  56. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/checks.d.mts.map +0 -1
  57. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/checks.mjs +0 -186
  58. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/checks.mjs.map +0 -1
  59. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/core.cjs +0 -115
  60. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/core.cjs.map +0 -1
  61. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/core.d.mts +0 -50
  62. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/core.d.mts.map +0 -1
  63. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/core.mjs +0 -111
  64. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/core.mjs.map +0 -1
  65. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/doc.cjs +0 -37
  66. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/doc.cjs.map +0 -1
  67. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/doc.mjs +0 -37
  68. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/doc.mjs.map +0 -1
  69. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/errors.cjs +0 -122
  70. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/errors.cjs.map +0 -1
  71. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/errors.d.mts +0 -135
  72. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/errors.d.mts.map +0 -1
  73. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/errors.mjs +0 -120
  74. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/errors.mjs.map +0 -1
  75. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.cjs +0 -418
  76. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.cjs.map +0 -1
  77. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.mjs +0 -399
  78. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.mjs.map +0 -1
  79. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/json-schema.d.mts +0 -70
  80. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/json-schema.d.mts.map +0 -1
  81. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/memoizer.cjs +0 -259
  82. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/memoizer.cjs.map +0 -1
  83. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/memoizer.mjs +0 -257
  84. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/memoizer.mjs.map +0 -1
  85. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/parse.cjs +0 -221
  86. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/parse.cjs.map +0 -1
  87. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/parse.mjs +0 -208
  88. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/parse.mjs.map +0 -1
  89. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/regexes.cjs +0 -101
  90. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/regexes.cjs.map +0 -1
  91. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/regexes.mjs +0 -74
  92. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/regexes.mjs.map +0 -1
  93. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/registries.cjs +0 -52
  94. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/registries.cjs.map +0 -1
  95. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/registries.d.mts +0 -31
  96. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/registries.d.mts.map +0 -1
  97. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/registries.mjs +0 -50
  98. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/registries.mjs.map +0 -1
  99. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/schemas.cjs +0 -1399
  100. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/schemas.cjs.map +0 -1
  101. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/schemas.d.mts +0 -1018
  102. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/schemas.d.mts.map +0 -1
  103. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/schemas.mjs +0 -1338
  104. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/schemas.mjs.map +0 -1
  105. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/standard-schema.d.mts +0 -120
  106. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/standard-schema.d.mts.map +0 -1
  107. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.cjs +0 -457
  108. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.cjs.map +0 -1
  109. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.d.mts +0 -128
  110. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.d.mts.map +0 -1
  111. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.mjs +0 -450
  112. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.mjs.map +0 -1
  113. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/util.cjs +0 -581
  114. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/util.cjs.map +0 -1
  115. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/util.d.mts +0 -44
  116. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/util.d.mts.map +0 -1
  117. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/util.mjs +0 -532
  118. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/util.mjs.map +0 -1
  119. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/versions.cjs +0 -10
  120. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/versions.cjs.map +0 -1
  121. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/versions.d.mts +0 -8
  122. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/versions.d.mts.map +0 -1
  123. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/versions.mjs +0 -10
  124. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/versions.mjs.map +0 -1
  125. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/locales/en.cjs +0 -112
  126. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/locales/en.cjs.map +0 -1
  127. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/locales/en.mjs +0 -112
  128. package/dist/node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/locales/en.mjs.map +0 -1
package/README.md CHANGED
@@ -1,78 +1,39 @@
1
1
  # Po core
2
2
 
3
- Reusable runtime logic for Po packages. Main and child systems own session lifecycles; the kernel owns contribution selection. `extensions` defines native server and web plugins, `pi` retains harness integration, `server` hosts APIs and transports, and `web` contains browser capabilities. Shared test hosts and scenarios live under `testing`.
3
+ Shared runtime systems and contracts for Po hosts and extensions. The distribution composes them; feature packages own policy. Importing a contract must not activate its provider.
4
4
 
5
- The `po` package composes these capabilities into the CLI and distribution. Feature packages own their policies and depend on core.
5
+ Main/child systems own agent lifetimes, the kernel owns contribution selection, server adapters own APIs/transports, and browser contracts live under `web`. Public `src/exports` files forward symbols from their owners. The retained Pi compatibility host supports third-party packages/providers; it is not a Po terminal-UI authoring surface.
6
6
 
7
- ## Workflow allocation contracts
7
+ ## Extension and host contracts
8
8
 
9
- `@agimon-ai/po-core/workflow` exports strict schemas for per-launch role assignments, effective-graph requirements, safe profile candidates, versioned allocation snapshots and expected provider identity. `validatePoWorkflowAssignments` checks exact role coverage and same-profile role groups; `parsePoWorkflowAllocation` verifies and detaches saved evidence. Neither function grants authorization or proves remote freshness.
9
+ Use [Plugin lifecycle](docs/plugins.md) for the low-level generated-host contract and [Architecture](https://github.com/AgiFlow/po/blob/main/docs/architecture.md#extensions) for normal routed authoring.
10
10
 
11
- Allocation-aware runtimes require the workspace-bound identity service's `discover`, `allocate` and `revalidateAllocation` capabilities. These are optional only for compatibility with older providers: missing capabilities must block allocation-aware launches, not fall back to teams, default mailboxes or the launcher's profile. Core contracts alone do not implement runtime enforcement.
11
+ Hosts supply explicit platform, environment, home, storage, and scope capabilities. Feature runtime code uses injected `po/*` services rather than ambient process configuration or host-only filesystem APIs. A service provider owns initialization and cleanup; consumers declare their dependencies rather than importing a selectable implementation.
12
12
 
13
13
  ## Workspace registry
14
14
 
15
- Hosts bind the read-only `po/workspace-registry` Cordis service before serving plugins. Its public
16
- contract and helpers are exported from `@agimon-ai/po-core/workspaceRegistry`:
17
-
18
- ```ts
19
- import { PO_WORKSPACE_REGISTRY_SERVICE, readPoWorkspaceRegistry } from '@agimon-ai/po-core/workspaceRegistry';
20
-
21
- context.inject([PO_WORKSPACE_REGISTRY_SERVICE], async (context) => {
22
- const registry = readPoWorkspaceRegistry(context)!;
23
- const result = await registry.resolve({ id: host.context.workspaceId });
24
- if (result.status === 'found') {
25
- const metadata = result.workspace.metadata;
26
- // Validate the plugin's own metadata and choose its defaults or scope policy here.
27
- }
28
- });
29
- ```
30
-
31
- `list()` returns detached workspace records. `resolve()` requires exactly one non-empty selector:
32
- `{ id }`, `{ name }`, `{ path }` (the canonical root), or `{ alias }`. Results are `found` (with
33
- `workspace`), `missing`, or `ambiguous` (with `candidates`). Duplicate names, paths or aliases
34
- never silently select the first match. Ids are local to this host; UI routes retain their existing
35
- host-qualified ids. Returned metadata cannot mutate the inventory.
36
-
37
- Node composition loads repository `.po/workspaces.yaml` and associates entries by the saved
38
- declaration name. Aliases and metadata are not persisted in the server's workspace membership
39
- file. They refresh when the host composes a workspace or session, not on every registry call.
40
- Workspaces without a matching declaration have empty metadata. Invalid policy is reported and
41
- that root is omitted from the lookup inventory until a successful composition refresh; a broken
42
- remembered root never blocks unrelated startup. Host-side sandbox records expose identity only,
43
- without reading their folders. Renaming a declaration unlinks its metadata from an existing workspace.
44
- The edge implementation exposes only its current tenant id/root with empty metadata until admission
45
- carries a declaration association.
46
-
47
- Plugins validate their own free-form metadata and decide whether it supplies defaults or enforced
48
- scope. Core never interprets product schemas, picks credentials, or exposes sibling Cordis services.
49
- A host that does not bind the service returns `undefined` from `readPoWorkspaceRegistry`; consumers
50
- still need a core version that exports this entry point. See
51
- [Po Config](../../foundations/po-config/README.md#workspace-declarations) for declaration syntax.
15
+ `@agimon-ai/po-core/workspaceRegistry` exports the read-only `po/workspace-registry` contract. A host binds it before serving plugins. `readPoWorkspaceRegistry(context)` returns `undefined` when absent; required consumers must declare that dependency.
16
+
17
+ - `list()` returns detached records.
18
+ - `resolve()` accepts exactly one nonempty `{ id }`, `{ name }`, `{ path }`, or `{ alias }` selector.
19
+ - Results are `found`, `missing`, or `ambiguous`; duplicate selectors never silently choose the first match.
20
+
21
+ IDs are local to one host. Cross-host UI identity remains host-qualified. Free-form metadata belongs to the consuming package, which decides whether it supplies defaults or enforced scope; the registry does not choose credentials or expose sibling services.
22
+
23
+ Node composition associates `.po/workspaces.yaml` declarations by saved name. Aliases/metadata refresh at composition boundaries and are not duplicated in membership storage. Invalid declarations are reported and omitted without blocking unrelated roots. Renaming a declaration unlinks its previous metadata association. Sandbox records expose identity without reading their folders; edge admission has its own available inventory.
24
+
25
+ See [Po Config](https://github.com/AgiFlow/po/blob/main/packages/foundations/po-config/README.md#workspace-declarations) for declaration syntax.
26
+
27
+ ## Workflow allocation
28
+
29
+ `@agimon-ai/po-core/workflow` defines role assignments, effective-graph requirements, profile candidates, versioned allocation evidence, and expected provider identity. Validation checks exact role coverage and same-profile groups; parsing detaches saved evidence. Neither step authorizes execution or proves remote freshness.
30
+
31
+ Allocation-aware launches require the workspace-bound identity provider's discovery, allocation, and revalidation capabilities. Missing capabilities must block that launch rather than substitute teams, mailboxes, or the launcher's profile. Runtime enforcement belongs to the composition using these contracts.
52
32
 
53
33
  ## Federation destination boundary
54
34
 
55
- The portable `packageApi` entry exports verified caller stamp types, SQLite replay/feed
56
- stores, home-host workspace sharing and provider-consent records, and the calling-host
57
- grant store. SQLite is supplied through `po/sqlite`. Replay admission never evicts live
58
- nonces. Grant refresh refusal durably pauses that work's token admission and emits
59
- `FederationWorkPaused`; new consent is required to resume it.
60
-
61
- The Node `remoteRuntime` entry composes the CLI's existing QR-pinned publication signer,
62
- hub trust store and injected HTTP/SQLite capabilities. Signed-in proofs ride inside the
63
- existing sealed HTTP channel. Only a claimed hub with a pinned issuer is enabled;
64
- other signed-in proof requests return 401. Trusted plugin dispatch preserves principal,
65
- org, account device and calling-host/grant stamps, while legacy callers stay unchanged.
66
-
67
- A sealed, fresh QR pairing can submit an account-key-signed enrollment at
68
- `/api/remote/federation/enroll` before reconnect-key registration. The host re-attests it
69
- and durably pins the account key and current epoch. `/api/remote/federation/claim` checks
70
- the pinned account signature and persists the issuer JWKS and owner network. Account
71
- keys and host-scoped reconnect/biometric keys remain separate.
72
-
73
- The default CLI accepts the claim's owner personal org only. Multi-network roster host
74
- keys and plugin-owned cross-host operation dispatch belong to later phases, so default
75
- C4 work is refused until those authorities are composed. Native enrollment transport,
76
- real-issuer deployment and production propagation remain separate verification items.
77
-
78
- 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.
35
+ The portable `packageApi` entry supplies verified caller stamps and SQLite-backed replay/feed, workspace-sharing, provider-consent, and calling-host grant stores. Inject SQLite through `po/sqlite`. Preserve live nonces and durable pause state; refreshing refused work requires renewed authority, not an automatic fallback.
36
+
37
+ The Node remote runtime composes pinned issuer/host/device authority and sealed transport. Enrollment and claim bind account keys separately from host-scoped reconnect/biometric keys. Dispatch uses verified principal, org, device, and calling-host/grant stamps, never caller-provided headers. Workspace authorization, roster trust, current revocation, and durable replay admission remain destination responsibilities.
38
+
39
+ A contract or successful signature check alone does not prove a host composed the required authorization boundary. See [Security](https://github.com/AgiFlow/po/blob/main/docs/security.md).