@agimon-ai/po-core 0.0.0-alpha.123 → 0.0.0-alpha.124
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 +6 -0
- package/dist/apiContracts.d.mts +128 -4
- package/dist/apiContracts.d.mts.map +1 -1
- package/dist/mcp.cjs +2 -0
- package/dist/mcp.d.mts +2 -2
- package/dist/mcp.mjs +1 -1
- package/dist/src/schemas/mcp.cjs +4 -0
- package/dist/src/schemas/mcp.cjs.map +1 -1
- package/dist/src/schemas/mcp.d.mts +46 -0
- package/dist/src/schemas/mcp.d.mts.map +1 -1
- package/dist/src/schemas/mcp.mjs +3 -1
- package/dist/src/schemas/mcp.mjs.map +1 -1
- package/dist/src/schemas/workflow.cjs +153 -0
- package/dist/src/schemas/workflow.cjs.map +1 -1
- package/dist/src/schemas/workflow.d.mts +182 -4
- package/dist/src/schemas/workflow.d.mts.map +1 -1
- package/dist/src/schemas/workflow.mjs +140 -1
- package/dist/src/schemas/workflow.mjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.cjs +15 -0
- package/dist/src/systems/main/adapters/headlessSessionHost.cjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.d.mts.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.mjs +16 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.mjs.map +1 -1
- package/dist/src/web/types/webPlugin.d.mts +5 -0
- package/dist/src/web/types/webPlugin.d.mts.map +1 -1
- package/dist/workflow.cjs +14 -0
- package/dist/workflow.d.mts +2 -2
- package/dist/workflow.mjs +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -4,6 +4,12 @@ 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
|
+
## Workflow allocation contracts
|
|
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.
|
|
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.
|
|
12
|
+
|
|
7
13
|
## Workspace registry
|
|
8
14
|
|
|
9
15
|
Hosts bind the read-only `po/workspace-registry` Cordis service before serving plugins. Its public
|
package/dist/apiContracts.d.mts
CHANGED
|
@@ -546,6 +546,106 @@ declare const PoWorkflowRunRefSchema: Type.TObject<{
|
|
|
546
546
|
registryWorkspace: Type.TString;
|
|
547
547
|
}>;
|
|
548
548
|
type PoWorkflowRunRef = Static<typeof PoWorkflowRunRefSchema>;
|
|
549
|
+
/** Derived from the effective graph. revision identifies the parsed definition, never a mutable path alone. */
|
|
550
|
+
declare const PoWorkflowIdentityRequirementsSchema: Type.TObject<{
|
|
551
|
+
definition: Type.TObject<{
|
|
552
|
+
source: Type.TString;
|
|
553
|
+
key: Type.TString;
|
|
554
|
+
}>;
|
|
555
|
+
revision: Type.TString;
|
|
556
|
+
roles: Type.TArray<Type.TString>;
|
|
557
|
+
groups: Type.TArray<Type.TObject<{
|
|
558
|
+
kind: Type.TUnion<[Type.TLiteral<"job">, Type.TLiteral<"child">, Type.TLiteral<"repair">]>;
|
|
559
|
+
job: Type.TString;
|
|
560
|
+
roles: Type.TArray<Type.TString>;
|
|
561
|
+
}>>;
|
|
562
|
+
}>;
|
|
563
|
+
type PoWorkflowIdentityRequirements = Static<typeof PoWorkflowIdentityRequirementsSchema>;
|
|
564
|
+
declare const PoWorkflowAssignmentsSchema: Type.TRecord<"^.*$", Type.TString>;
|
|
565
|
+
type PoWorkflowAssignments = Static<typeof PoWorkflowAssignmentsSchema>;
|
|
566
|
+
declare const PoWorkflowIdentityDiscoverySchema: Type.TObject<{
|
|
567
|
+
scope: Type.TObject<{
|
|
568
|
+
workspaceId: Type.TString;
|
|
569
|
+
product: Type.TString;
|
|
570
|
+
revision: Type.TString;
|
|
571
|
+
}>;
|
|
572
|
+
candidates: Type.TArray<Type.TObject<{
|
|
573
|
+
ref: Type.TString;
|
|
574
|
+
label: Type.TString;
|
|
575
|
+
roles: Type.TArray<Type.TString>;
|
|
576
|
+
voiceConfigured: Type.TBoolean;
|
|
577
|
+
}>>;
|
|
578
|
+
}>;
|
|
579
|
+
type PoWorkflowIdentityDiscovery = Static<typeof PoWorkflowIdentityDiscoverySchema>;
|
|
580
|
+
/** Persisted before effects. Profiles contain exact admitted evidence, never secrets or an implicit team selection. */
|
|
581
|
+
declare const PoWorkflowAllocationSchema: Type.TObject<{
|
|
582
|
+
version: Type.TLiteral<1>;
|
|
583
|
+
requirements: Type.TObject<{
|
|
584
|
+
definition: Type.TObject<{
|
|
585
|
+
source: Type.TString;
|
|
586
|
+
key: Type.TString;
|
|
587
|
+
}>;
|
|
588
|
+
revision: Type.TString;
|
|
589
|
+
roles: Type.TArray<Type.TString>;
|
|
590
|
+
groups: Type.TArray<Type.TObject<{
|
|
591
|
+
kind: Type.TUnion<[Type.TLiteral<"job">, Type.TLiteral<"child">, Type.TLiteral<"repair">]>;
|
|
592
|
+
job: Type.TString;
|
|
593
|
+
roles: Type.TArray<Type.TString>;
|
|
594
|
+
}>>;
|
|
595
|
+
}>;
|
|
596
|
+
scope: Type.TObject<{
|
|
597
|
+
workspaceId: Type.TString;
|
|
598
|
+
product: Type.TString;
|
|
599
|
+
revision: Type.TString;
|
|
600
|
+
}>;
|
|
601
|
+
assignments: Type.TRecord<"^.*$", Type.TString>;
|
|
602
|
+
profiles: Type.TArray<Type.TObject<{
|
|
603
|
+
ref: Type.TString;
|
|
604
|
+
profile: Type.TString;
|
|
605
|
+
contentDigest: Type.TString;
|
|
606
|
+
policyDigest: Type.TString;
|
|
607
|
+
provider: Type.TObject<{
|
|
608
|
+
provider: Type.TString;
|
|
609
|
+
organizationId: Type.TString;
|
|
610
|
+
mailboxId: Type.TString;
|
|
611
|
+
credentialRef: Type.TString;
|
|
612
|
+
}>;
|
|
613
|
+
}>>;
|
|
614
|
+
}>;
|
|
615
|
+
type PoWorkflowAllocation = Static<typeof PoWorkflowAllocationSchema>;
|
|
616
|
+
/** Step bootstrap only. An allocation-owned role-less session explicitly has no profile. */
|
|
617
|
+
declare const PoWorkflowExpectedIdentitySchema: Type.TUnion<[Type.TObject<{
|
|
618
|
+
kind: Type.TLiteral<"none">;
|
|
619
|
+
}>, Type.TObject<{
|
|
620
|
+
ref: Type.TString;
|
|
621
|
+
profile: Type.TString;
|
|
622
|
+
contentDigest: Type.TString;
|
|
623
|
+
policyDigest: Type.TString;
|
|
624
|
+
provider: Type.TObject<{
|
|
625
|
+
provider: Type.TString;
|
|
626
|
+
organizationId: Type.TString;
|
|
627
|
+
mailboxId: Type.TString;
|
|
628
|
+
credentialRef: Type.TString;
|
|
629
|
+
}>;
|
|
630
|
+
kind: Type.TLiteral<"profile">;
|
|
631
|
+
scope: Type.TObject<{
|
|
632
|
+
workspaceId: Type.TString;
|
|
633
|
+
product: Type.TString;
|
|
634
|
+
revision: Type.TString;
|
|
635
|
+
}>;
|
|
636
|
+
definitionRevision: Type.TString;
|
|
637
|
+
roles: Type.TArray<Type.TString>;
|
|
638
|
+
}>]>;
|
|
639
|
+
type PoWorkflowExpectedIdentity = Static<typeof PoWorkflowExpectedIdentitySchema>;
|
|
640
|
+
/** Read-only effective-graph requirements and provider discovery. identity is absent only for role-less graphs. */
|
|
641
|
+
interface PoWorkflowRequirementsReport {
|
|
642
|
+
readonly requirements: PoWorkflowIdentityRequirements;
|
|
643
|
+
readonly identity?: PoWorkflowIdentityDiscovery;
|
|
644
|
+
}
|
|
645
|
+
interface PoWorkflowAllocationRequest {
|
|
646
|
+
readonly requirements: PoWorkflowIdentityRequirements;
|
|
647
|
+
readonly assignments: Readonly<PoWorkflowAssignments>;
|
|
648
|
+
}
|
|
549
649
|
interface PoWorkflowLaunchOverrides {
|
|
550
650
|
readonly runner?: string;
|
|
551
651
|
readonly command?: string;
|
|
@@ -557,7 +657,9 @@ interface PoWorkflowLaunchOverrides {
|
|
|
557
657
|
readonly name?: string;
|
|
558
658
|
/** Name for a newly created workflow session, not the run or an existing owner session. */
|
|
559
659
|
readonly sessionName?: string;
|
|
560
|
-
/**
|
|
660
|
+
/** Exact per-launch role assignments. Teams, defaults and local profile names cannot fill missing assignments. */
|
|
661
|
+
readonly assignments?: Readonly<PoWorkflowAssignments>;
|
|
662
|
+
/** Legacy team override only. Never a substitute for explicit allocation. */
|
|
561
663
|
readonly team?: string;
|
|
562
664
|
}
|
|
563
665
|
/** Session-owned. Rejection means no observable registration was accepted. */
|
|
@@ -620,6 +722,8 @@ interface PoWorkflowPolicyOptions {
|
|
|
620
722
|
}
|
|
621
723
|
interface PoWorkflowAdmissionOverrides extends PoWorkflowLaunchOverrides {
|
|
622
724
|
readonly policy?: PoWorkflowPolicyAssociation;
|
|
725
|
+
/** Frozen preparation evidence. The destination revalidates it exactly, never treats it as authorization. */
|
|
726
|
+
readonly allocation?: PoWorkflowAllocation;
|
|
623
727
|
/**
|
|
624
728
|
* Run the workflow as this same-workspace session instead of the caller, for example a session in an
|
|
625
729
|
* isolated checkout. Trusted in-process launchers only: never accepted from tools, code mode or HTTP.
|
|
@@ -656,6 +760,8 @@ interface PoWorkflowValidationReport {
|
|
|
656
760
|
}[];
|
|
657
761
|
/** Declared by the definition and reported only: the engine never provisions a checkout itself. */
|
|
658
762
|
readonly isolation?: 'checkout';
|
|
763
|
+
/** Trusted preparation evidence only. Ordinary namespace reports omit provider bindings. */
|
|
764
|
+
readonly allocation?: PoWorkflowAllocation;
|
|
659
765
|
}
|
|
660
766
|
type PoWorkflowAdmission = {
|
|
661
767
|
readonly attemptId: string;
|
|
@@ -676,6 +782,8 @@ type PoWorkflowAdmission = {
|
|
|
676
782
|
};
|
|
677
783
|
/** Trusted, session-bound opt-in capability, never exposed as a tool or code-mode namespace. */
|
|
678
784
|
interface PoWorkflowAdmissionsService {
|
|
785
|
+
/** Discovery precedes assignment and creates no admission journal, claims or workflow effects. */
|
|
786
|
+
requirements?(definition: PoWorkflowDefinitionRef, options?: Pick<PoWorkflowLaunchOverrides, 'job'>): Promise<PoWorkflowRequirementsReport>;
|
|
679
787
|
validate(request: PoWorkflowAdmissionRequest): Promise<PoWorkflowValidationReport>;
|
|
680
788
|
launch(attemptId: string, definition: PoWorkflowDefinitionRef, overrides?: PoWorkflowAdmissionOverrides): Promise<PoWorkflowAdmission>;
|
|
681
789
|
recover(attemptId: string, previousRun: PoWorkflowRunRef, options?: PoWorkflowRecoveryOptions): Promise<PoWorkflowAdmission>;
|
|
@@ -817,6 +925,10 @@ interface PoWorkflowContextService {
|
|
|
817
925
|
readonly instructions?: string;
|
|
818
926
|
readonly state: PoWorkflowRunsService;
|
|
819
927
|
readonly children?: PoWorkflowChildrenSession;
|
|
928
|
+
/** Trusted startup evidence, not a remote session-create field. */
|
|
929
|
+
readonly identity?: PoWorkflowExpectedIdentity;
|
|
930
|
+
/** Frozen run evidence for trusted child admission. Never read from environment or public config views. */
|
|
931
|
+
readonly allocation?: PoWorkflowAllocation;
|
|
820
932
|
}
|
|
821
933
|
interface PoWorkflowIdentityRequest {
|
|
822
934
|
readonly team: string;
|
|
@@ -836,15 +948,26 @@ interface PoWorkflowIdentityBinding {
|
|
|
836
948
|
readonly policyDigest: string;
|
|
837
949
|
}
|
|
838
950
|
/**
|
|
839
|
-
*
|
|
840
|
-
*
|
|
841
|
-
*
|
|
951
|
+
* Workspace-bound identity capability. New role-bound launches require the allocation methods;
|
|
952
|
+
* an older provider missing them must fail closed rather than falling back to legacy teams.
|
|
953
|
+
* Fresh admission narrows existing authorization and never grants credentials or changes the caller's profile.
|
|
842
954
|
*/
|
|
843
955
|
interface PoWorkflowIdentityService {
|
|
956
|
+
/** Ordinary read-only discovery, available without Help or a selected profile. */
|
|
957
|
+
discover?(requirements: PoWorkflowIdentityRequirements): Promise<PoWorkflowIdentityDiscovery>;
|
|
958
|
+
/** Refreshes eligibility and admits exactly the requested references in the provider's trusted product scope. */
|
|
959
|
+
allocate?(request: PoWorkflowAllocationRequest): Promise<PoWorkflowAllocation>;
|
|
960
|
+
/** Revalidates exact persisted evidence; any change blocks instead of substituting profiles or digests. */
|
|
961
|
+
revalidateAllocation?(allocation: PoWorkflowAllocation): Promise<PoWorkflowAllocation>;
|
|
962
|
+
/** Legacy team-based admission, not used by allocation-aware launches. */
|
|
844
963
|
resolve(request: PoWorkflowIdentityRequest): Promise<PoWorkflowIdentityBinding>;
|
|
845
964
|
/** Rechecks a saved binding against the current team and authorization, returning it as it stands now. */
|
|
846
965
|
revalidate(binding: PoWorkflowIdentityBinding): Promise<PoWorkflowIdentityBinding>;
|
|
847
966
|
}
|
|
967
|
+
/** Required profile-version admission for allocation-owned prompts. Only the profile package supplies it. */
|
|
968
|
+
interface PoWorkflowProfileAdmissionService {
|
|
969
|
+
assertReady(expected: PoWorkflowExpectedIdentity): Promise<void>;
|
|
970
|
+
}
|
|
848
971
|
declare module '@deepseek-ai/cordis' {
|
|
849
972
|
interface Context {
|
|
850
973
|
'po/workflow-launch': PoWorkflowLaunchService;
|
|
@@ -853,6 +976,7 @@ declare module '@deepseek-ai/cordis' {
|
|
|
853
976
|
'po/workflow-context': PoWorkflowContextService;
|
|
854
977
|
'po/workflow-admissions': PoWorkflowAdmissionsService;
|
|
855
978
|
'po/workflow-identity': PoWorkflowIdentityService;
|
|
979
|
+
'po/workflow-profile-admission': PoWorkflowProfileAdmissionService;
|
|
856
980
|
}
|
|
857
981
|
}
|
|
858
982
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.d.mts","names":["_0","_0","_0","_0","IoContext","_0","_$__hubChannel0.PoHubSessionUsage","_0","_$__protocolContracts0.ChordMethods"],"sources":["../src/schemas/serverBundle.ts","../src/schemas/brain.ts","../src/schemas/serverScope.ts","../src/schemas/approvalPrompt.ts","../src/schemas/approval.ts","../src/schemas/backgroundWork.ts","../src/schemas/notification.ts","../src/schemas/platform.ts","../src/schemas/workflow.ts","../src/schemas/hubChannel.ts","../src/schemas/packageApi.ts","../src/schemas/apiContracts.ts","../src/services/apiContracts/index.ts","../src/schemas/builtinApiContracts.ts","../src/schemas/httpApiContracts.ts","../src/schemas/protocolContracts.ts","../src/schemas/sessionProtocol.ts","../src/schemas/sessionApiContracts.ts","../src/schemas/transportApiContracts.ts"],"mappings":";;;;;;;;;;;;UAKiB;WACN;WACA;;UAGM;WACN;;WAEA;;WAEA,cAAc;;WAEd,iBAAiB;;WAEjB,cAAc;;WAEd;;WAEA;WACA,iBAAiB;WACjB,iBAAiB;WACjB;;;;;UCtBM;EACf;EACA,OAAO;;UAGQ;EACf;EACA;EACA,QAAQ,YAAY;;UAGL;EACf;EACA;EACA,OAAO;EACP,aAAa;EACb,OAAO;EACP;EACA;;UAGe;EACf;EACA;EACA,OAAO;EACP,OAAO;;;UAIQ;EACf;EACA;EACA;EACA;;UAGe;EACf,OAAO;EACP,OAAO;EACP,KAAK;;EAEL,SAAS;;UAGM;EACf,OAAO;EACP,QAAQ;EACR,UAAU;;EAEV,iBAAiB;EACjB,UAAU;EACV,WAAW;EACX,OAAO;EACP;;;UA+Be;EACf;EACA;IACE;IACA,OAAO;IACP;IACA;IACA;;EAEF;IACE;IACA;IACA,OAAO;IACP;;EAEF;;;;;UCrFe,kBAAkB;WACxB;WACA,OAAO;;WAEP;;WAEA,QAAQ;;;KAeP;;UAoBK,sBAAsB;WAC5B,OAAO;EAChB,WAAW;;;UAII,oBAAoB;EACnC,QAAQ,GACN,KAAK,qBACL,cAAc,IAAI,QAAQ,IAC1B,WAAW,OAAO,aAAa,gBAC9B,QAAQ,sBAAsB;;EAEjC,IAAI,OAAO;;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QAAQ;aACG;MACP;aAAmB;aAA0B,QAAQ,SAAS;;;;YA0BxD;IACR,SAAS;IACT,YAAY;IACZ,aAAa;IACb,sBAAsB;IACtB,cAAc;IACd,UAAU;IACV,eAAe;IACf,cAAc;IACd,oBAAoB;IACpB;eAA+B;;;;;;;
|
|
1
|
+
{"version":3,"file":"apiContracts.d.mts","names":["_0","_0","_0","_0","IoContext","_0","_$__hubChannel0.PoHubSessionUsage","_0","_$__protocolContracts0.ChordMethods"],"sources":["../src/schemas/serverBundle.ts","../src/schemas/brain.ts","../src/schemas/serverScope.ts","../src/schemas/approvalPrompt.ts","../src/schemas/approval.ts","../src/schemas/backgroundWork.ts","../src/schemas/notification.ts","../src/schemas/platform.ts","../src/schemas/workflow.ts","../src/schemas/hubChannel.ts","../src/schemas/packageApi.ts","../src/schemas/apiContracts.ts","../src/services/apiContracts/index.ts","../src/schemas/builtinApiContracts.ts","../src/schemas/httpApiContracts.ts","../src/schemas/protocolContracts.ts","../src/schemas/sessionProtocol.ts","../src/schemas/sessionApiContracts.ts","../src/schemas/transportApiContracts.ts"],"mappings":";;;;;;;;;;;;UAKiB;WACN;WACA;;UAGM;WACN;;WAEA;;WAEA,cAAc;;WAEd,iBAAiB;;WAEjB,cAAc;;WAEd;;WAEA;WACA,iBAAiB;WACjB,iBAAiB;WACjB;;;;;UCtBM;EACf;EACA,OAAO;;UAGQ;EACf;EACA;EACA,QAAQ,YAAY;;UAGL;EACf;EACA;EACA,OAAO;EACP,aAAa;EACb,OAAO;EACP;EACA;;UAGe;EACf;EACA;EACA,OAAO;EACP,OAAO;;;UAIQ;EACf;EACA;EACA;EACA;;UAGe;EACf,OAAO;EACP,OAAO;EACP,KAAK;;EAEL,SAAS;;UAGM;EACf,OAAO;EACP,QAAQ;EACR,UAAU;;EAEV,iBAAiB;EACjB,UAAU;EACV,WAAW;EACX,OAAO;EACP;;;UA+Be;EACf;EACA;IACE;IACA,OAAO;IACP;IACA;IACA;;EAEF;IACE;IACA;IACA,OA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StringTag, { value: "Module" });
|
|
2
2
|
const require_mcp = require("./src/schemas/mcp.cjs");
|
|
3
|
+
exports.PO_MCP_CONNECTIONS_CONTRACT = require_mcp.PO_MCP_CONNECTIONS_CONTRACT;
|
|
4
|
+
exports.PO_MCP_CONNECTIONS_SERVICE = require_mcp.PO_MCP_CONNECTIONS_SERVICE;
|
|
3
5
|
exports.PO_MCP_CONTRACT = require_mcp.PO_MCP_CONTRACT;
|
|
4
6
|
exports.PO_MCP_SERVICE = require_mcp.PO_MCP_SERVICE;
|
|
5
7
|
exports.readPoMcp = require_mcp.readPoMcp;
|
package/dist/mcp.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { McpSessionApiKey, McpSessionServerResult, PO_MCP_CONTRACT, PO_MCP_SERVICE, PoMcpRegistration, PoMcpRegistrationInput, PoMcpService, readPoMcp } from "./src/schemas/mcp.mjs";
|
|
2
|
-
export { type McpSessionApiKey, type McpSessionServerResult, PO_MCP_CONTRACT, PO_MCP_SERVICE, type PoMcpRegistration, type PoMcpRegistrationInput, type PoMcpService, readPoMcp };
|
|
1
|
+
import { McpSessionApiKey, McpSessionServerResult, PO_MCP_CONNECTIONS_CONTRACT, PO_MCP_CONNECTIONS_SERVICE, PO_MCP_CONTRACT, PO_MCP_SERVICE, PoMcpAppInvocation, PoMcpConnectInput, PoMcpConnection, PoMcpConnectionsService, PoMcpCredential, PoMcpRegistration, PoMcpRegistrationInput, PoMcpService, readPoMcp } from "./src/schemas/mcp.mjs";
|
|
2
|
+
export { type McpSessionApiKey, type McpSessionServerResult, PO_MCP_CONNECTIONS_CONTRACT, PO_MCP_CONNECTIONS_SERVICE, PO_MCP_CONTRACT, PO_MCP_SERVICE, type PoMcpAppInvocation, type PoMcpConnectInput, type PoMcpConnection, type PoMcpConnectionsService, type PoMcpCredential, type PoMcpRegistration, type PoMcpRegistrationInput, type PoMcpService, readPoMcp };
|
package/dist/mcp.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { PO_MCP_CONTRACT, PO_MCP_SERVICE, readPoMcp } from "./src/schemas/mcp.mjs";
|
|
1
|
+
export { PO_MCP_CONNECTIONS_CONTRACT, PO_MCP_CONNECTIONS_SERVICE, PO_MCP_CONTRACT, PO_MCP_SERVICE, readPoMcp } from "./src/schemas/mcp.mjs";
|
package/dist/src/schemas/mcp.cjs
CHANGED
|
@@ -2,10 +2,14 @@ const require_serverScope = require("./serverScope.cjs");
|
|
|
2
2
|
//#region src/schemas/mcp.ts
|
|
3
3
|
const PO_MCP_SERVICE = "po/mcp";
|
|
4
4
|
const PO_MCP_CONTRACT = require_serverScope.defineServiceContract(PO_MCP_SERVICE, { scope: "session" });
|
|
5
|
+
const PO_MCP_CONNECTIONS_SERVICE = "po/mcp-connections";
|
|
6
|
+
const PO_MCP_CONNECTIONS_CONTRACT = require_serverScope.defineServiceContract(PO_MCP_CONNECTIONS_SERVICE, { scope: "session" });
|
|
5
7
|
function readPoMcp(context) {
|
|
6
8
|
return context.get(PO_MCP_SERVICE);
|
|
7
9
|
}
|
|
8
10
|
//#endregion
|
|
11
|
+
exports.PO_MCP_CONNECTIONS_CONTRACT = PO_MCP_CONNECTIONS_CONTRACT;
|
|
12
|
+
exports.PO_MCP_CONNECTIONS_SERVICE = PO_MCP_CONNECTIONS_SERVICE;
|
|
9
13
|
exports.PO_MCP_CONTRACT = PO_MCP_CONTRACT;
|
|
10
14
|
exports.PO_MCP_SERVICE = PO_MCP_SERVICE;
|
|
11
15
|
exports.readPoMcp = readPoMcp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.cjs","names":["defineServiceContract"],"sources":["../../../src/schemas/mcp.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis';\n\nimport type { PoHeadlessToolResult } from './headless';\nimport { defineServiceContract } from './serverScope';\n\nexport const PO_MCP_SERVICE = 'po/mcp';\n\nexport type McpSessionApiKey = ({ value: string } | { environmentVariable: string }) &\n ({ mode: 'bearer' } | { mode: 'header'; name: string });\n\nexport interface PoMcpRegistrationInput {\n name: string;\n url: string;\n type?: 'http' | 'sse';\n apiKey?: McpSessionApiKey;\n}\n\nexport interface McpSessionServerResult {\n name: string;\n status: string;\n tools: string[];\n}\n\n/** An identity-owned temporary connection. It survives the establishing call's completion. */\nexport interface PoMcpRegistration {\n readonly name: string;\n /** Detached live state. Retired registrations cannot observe a replacement. */\n snapshot(): McpSessionServerResult;\n /** Uses the session's validated, visible tool invocation path. */\n invoke(tool: string, args?: Record<string, unknown>, signal?: AbortSignal): Promise<PoHeadlessToolResult>;\n /** Idempotent cleanup, including after cancellation or provider withdrawal. */\n dispose(): Promise<void>;\n}\n\n/** Trusted session capability. The consumer owns permission and connection lifetime. */\nexport interface PoMcpService {\n /** Cancellation rolls back establishment only. Credentials are never persisted by this service. */\n register(input: PoMcpRegistrationInput, signal?: AbortSignal): Promise<PoMcpRegistration>;\n}\n\nexport const PO_MCP_CONTRACT = defineServiceContract<PoMcpService>(PO_MCP_SERVICE, { scope: 'session' });\n\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n 'po/mcp': PoMcpService;\n }\n}\n\nexport function readPoMcp(context: Context): PoMcpService | undefined {\n return context.get(PO_MCP_SERVICE) as PoMcpService | undefined;\n}\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"mcp.cjs","names":["defineServiceContract"],"sources":["../../../src/schemas/mcp.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis';\nimport type { ReadResourceResult, Tool } from '@modelcontextprotocol/server';\n\nimport type { PoHeadlessToolResult } from './headless';\nimport { defineServiceContract } from './serverScope';\n\nexport const PO_MCP_SERVICE = 'po/mcp';\n\nexport type McpSessionApiKey = ({ value: string } | { environmentVariable: string }) &\n ({ mode: 'bearer' } | { mode: 'header'; name: string });\n\nexport interface PoMcpRegistrationInput {\n name: string;\n url: string;\n type?: 'http' | 'sse';\n apiKey?: McpSessionApiKey;\n}\n\nexport interface McpSessionServerResult {\n name: string;\n status: string;\n tools: string[];\n}\n\n/** An identity-owned temporary connection. It survives the establishing call's completion. */\nexport interface PoMcpRegistration {\n readonly name: string;\n /** Detached live state. Retired registrations cannot observe a replacement. */\n snapshot(): McpSessionServerResult;\n /** Uses the session's validated, visible tool invocation path. */\n invoke(tool: string, args?: Record<string, unknown>, signal?: AbortSignal): Promise<PoHeadlessToolResult>;\n /** Idempotent cleanup, including after cancellation or provider withdrawal. */\n dispose(): Promise<void>;\n}\n\n/** Trusted session capability. The consumer owns permission and connection lifetime. */\nexport interface PoMcpService {\n /** Cancellation rolls back establishment only. Credentials are never persisted by this service. */\n register(input: PoMcpRegistrationInput, signal?: AbortSignal): Promise<PoMcpRegistration>;\n}\n\nexport const PO_MCP_CONTRACT = defineServiceContract<PoMcpService>(PO_MCP_SERVICE, { scope: 'session' });\n\nexport const PO_MCP_CONNECTIONS_SERVICE = 'po/mcp-connections';\n\nexport type PoMcpCredential = { kind: 'bearer'; token: string } | { kind: 'header'; name: string; value: string };\n\nexport interface PoMcpConnectInput {\n /** The consuming plugin's package name. */\n owner: string;\n url: string;\n auth?: { credential: PoMcpCredential; saveAs?: string } | { credentialId: string };\n /** Upstream tools an App may request, each requiring confirmation. */\n appTools?: readonly string[];\n lifetime: AbortSignal;\n}\n\nexport interface PoMcpAppInvocation {\n toolCallId: string;\n toolName: string;\n}\n\n/** Private upstream client. Its tools never enter the session catalog. */\nexport interface PoMcpConnection {\n readonly id: string;\n listTools(signal?: AbortSignal): Promise<readonly Tool[]>;\n callTool(\n name: string,\n args: Record<string, unknown>,\n options?: { invocation?: PoMcpAppInvocation; signal?: AbortSignal },\n ): Promise<PoHeadlessToolResult>;\n readAppResource(tool: string, signal?: AbortSignal): Promise<ReadResourceResult>;\n dispose(): Promise<void>;\n}\n\nexport interface PoMcpConnectionsService {\n connect(input: PoMcpConnectInput, signal?: AbortSignal): Promise<PoMcpConnection>;\n /** Deleting a connection does not delete its saved credential. */\n forgetCredential(owner: string, credentialId: string): Promise<void>;\n}\n\nexport const PO_MCP_CONNECTIONS_CONTRACT = defineServiceContract<PoMcpConnectionsService>(PO_MCP_CONNECTIONS_SERVICE, {\n scope: 'session',\n});\n\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n 'po/mcp': PoMcpService;\n 'po/mcp-connections': PoMcpConnectionsService;\n }\n}\n\nexport function readPoMcp(context: Context): PoMcpService | undefined {\n return context.get(PO_MCP_SERVICE) as PoMcpService | undefined;\n}\n"],"mappings":";;AAMA,MAAa,iBAAiB;AAmC9B,MAAa,kBAAkBA,oBAAAA,sBAAoC,gBAAgB,EAAE,OAAO,UAAU,CAAC;AAEvG,MAAa,6BAA6B;AAsC1C,MAAa,8BAA8BA,oBAAAA,sBAA+C,4BAA4B,EACpH,OAAO,UACT,CAAC;AASD,SAAgB,UAAU,SAA4C;CACpE,OAAO,QAAQ,IAAI,cAAc;AACnC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PoServiceContract } from "./serverScope.mjs";
|
|
2
2
|
import { PoHeadlessToolResult } from "./headless.mjs";
|
|
3
3
|
import { Context } from "@deepseek-ai/cordis";
|
|
4
|
+
import { ReadResourceResult, Tool } from "@modelcontextprotocol/server";
|
|
4
5
|
//#region src/schemas/mcp.d.ts
|
|
5
6
|
export declare const PO_MCP_SERVICE = "po/mcp";
|
|
6
7
|
export type McpSessionApiKey = ({
|
|
@@ -40,9 +41,54 @@ export interface PoMcpService {
|
|
|
40
41
|
register(input: PoMcpRegistrationInput, signal?: AbortSignal): Promise<PoMcpRegistration>;
|
|
41
42
|
}
|
|
42
43
|
export declare const PO_MCP_CONTRACT: PoServiceContract<PoMcpService>;
|
|
44
|
+
export declare const PO_MCP_CONNECTIONS_SERVICE = "po/mcp-connections";
|
|
45
|
+
export type PoMcpCredential = {
|
|
46
|
+
kind: 'bearer';
|
|
47
|
+
token: string;
|
|
48
|
+
} | {
|
|
49
|
+
kind: 'header';
|
|
50
|
+
name: string;
|
|
51
|
+
value: string;
|
|
52
|
+
};
|
|
53
|
+
export interface PoMcpConnectInput {
|
|
54
|
+
/** The consuming plugin's package name. */
|
|
55
|
+
owner: string;
|
|
56
|
+
url: string;
|
|
57
|
+
auth?: {
|
|
58
|
+
credential: PoMcpCredential;
|
|
59
|
+
saveAs?: string;
|
|
60
|
+
} | {
|
|
61
|
+
credentialId: string;
|
|
62
|
+
};
|
|
63
|
+
/** Upstream tools an App may request, each requiring confirmation. */
|
|
64
|
+
appTools?: readonly string[];
|
|
65
|
+
lifetime: AbortSignal;
|
|
66
|
+
}
|
|
67
|
+
export interface PoMcpAppInvocation {
|
|
68
|
+
toolCallId: string;
|
|
69
|
+
toolName: string;
|
|
70
|
+
}
|
|
71
|
+
/** Private upstream client. Its tools never enter the session catalog. */
|
|
72
|
+
export interface PoMcpConnection {
|
|
73
|
+
readonly id: string;
|
|
74
|
+
listTools(signal?: AbortSignal): Promise<readonly Tool[]>;
|
|
75
|
+
callTool(name: string, args: Record<string, unknown>, options?: {
|
|
76
|
+
invocation?: PoMcpAppInvocation;
|
|
77
|
+
signal?: AbortSignal;
|
|
78
|
+
}): Promise<PoHeadlessToolResult>;
|
|
79
|
+
readAppResource(tool: string, signal?: AbortSignal): Promise<ReadResourceResult>;
|
|
80
|
+
dispose(): Promise<void>;
|
|
81
|
+
}
|
|
82
|
+
export interface PoMcpConnectionsService {
|
|
83
|
+
connect(input: PoMcpConnectInput, signal?: AbortSignal): Promise<PoMcpConnection>;
|
|
84
|
+
/** Deleting a connection does not delete its saved credential. */
|
|
85
|
+
forgetCredential(owner: string, credentialId: string): Promise<void>;
|
|
86
|
+
}
|
|
87
|
+
export declare const PO_MCP_CONNECTIONS_CONTRACT: PoServiceContract<PoMcpConnectionsService>;
|
|
43
88
|
declare module '@deepseek-ai/cordis' {
|
|
44
89
|
interface Context {
|
|
45
90
|
'po/mcp': PoMcpService;
|
|
91
|
+
'po/mcp-connections': PoMcpConnectionsService;
|
|
46
92
|
}
|
|
47
93
|
}
|
|
48
94
|
export declare function readPoMcp(context: Context): PoMcpService | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.mts","names":["_$__serverScope0.PoServiceContract"],"sources":["../../../src/schemas/mcp.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp.d.mts","names":["_$__serverScope0.PoServiceContract"],"sources":["../../../src/schemas/mcp.ts"],"mappings":";;;;;qBAMa;YAED;EAAsB;;EAAoB;;EACjD;;EAAqB;EAAgB;;iBAEzB;EACf;EACA;EACA;EACA,SAAS;;iBAGM;EACf;EACA;EACA;;;iBAIe;WACN;;EAET,YAAY;;EAEZ,OAAO,cAAc,OAAO,yBAAyB,SAAS,cAAc,QAAQ;;EAEpF,WAAW;;;iBAII;;EAEf,SAAS,OAAO,wBAAwB,SAAS,cAAc,QAAQ;;qBAG5D,iBAAeA,kBAAA;qBAEf;YAED;EAAoB;EAAgB;;EAAoB;EAAgB;EAAc;;iBAEjF;;EAEf;EACA;EACA;IAAS,YAAY;IAAiB;;IAAsB;;;EAE5D;EACA,UAAU;;iBAGK;EACf;EACA;;;iBAIe;WACN;EACT,UAAU,SAAS,cAAc,iBAAiB;EAClD,SACE,cACA,MAAM,yBACN;IAAY,aAAa;IAAoB,SAAS;MACrD,QAAQ;EACX,gBAAgB,cAAc,SAAS,cAAc,QAAQ;EAC7D,WAAW;;iBAGI;EACf,QAAQ,OAAO,mBAAmB,SAAS,cAAc,QAAQ;;EAEjE,iBAAiB,eAAe,uBAAuB;;qBAG5C,6BAA2BA,kBAAA;;YAK5B;IACR,UAAU;IACV,sBAAsB;;;wBAIV,UAAU,SAAS,UAAU"}
|
package/dist/src/schemas/mcp.mjs
CHANGED
|
@@ -2,10 +2,12 @@ import { defineServiceContract } from "./serverScope.mjs";
|
|
|
2
2
|
//#region src/schemas/mcp.ts
|
|
3
3
|
const PO_MCP_SERVICE = "po/mcp";
|
|
4
4
|
const PO_MCP_CONTRACT = defineServiceContract(PO_MCP_SERVICE, { scope: "session" });
|
|
5
|
+
const PO_MCP_CONNECTIONS_SERVICE = "po/mcp-connections";
|
|
6
|
+
const PO_MCP_CONNECTIONS_CONTRACT = defineServiceContract(PO_MCP_CONNECTIONS_SERVICE, { scope: "session" });
|
|
5
7
|
function readPoMcp(context) {
|
|
6
8
|
return context.get(PO_MCP_SERVICE);
|
|
7
9
|
}
|
|
8
10
|
//#endregion
|
|
9
|
-
export { PO_MCP_CONTRACT, PO_MCP_SERVICE, readPoMcp };
|
|
11
|
+
export { PO_MCP_CONNECTIONS_CONTRACT, PO_MCP_CONNECTIONS_SERVICE, PO_MCP_CONTRACT, PO_MCP_SERVICE, readPoMcp };
|
|
10
12
|
|
|
11
13
|
//# sourceMappingURL=mcp.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.mjs","names":[],"sources":["../../../src/schemas/mcp.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis';\n\nimport type { PoHeadlessToolResult } from './headless';\nimport { defineServiceContract } from './serverScope';\n\nexport const PO_MCP_SERVICE = 'po/mcp';\n\nexport type McpSessionApiKey = ({ value: string } | { environmentVariable: string }) &\n ({ mode: 'bearer' } | { mode: 'header'; name: string });\n\nexport interface PoMcpRegistrationInput {\n name: string;\n url: string;\n type?: 'http' | 'sse';\n apiKey?: McpSessionApiKey;\n}\n\nexport interface McpSessionServerResult {\n name: string;\n status: string;\n tools: string[];\n}\n\n/** An identity-owned temporary connection. It survives the establishing call's completion. */\nexport interface PoMcpRegistration {\n readonly name: string;\n /** Detached live state. Retired registrations cannot observe a replacement. */\n snapshot(): McpSessionServerResult;\n /** Uses the session's validated, visible tool invocation path. */\n invoke(tool: string, args?: Record<string, unknown>, signal?: AbortSignal): Promise<PoHeadlessToolResult>;\n /** Idempotent cleanup, including after cancellation or provider withdrawal. */\n dispose(): Promise<void>;\n}\n\n/** Trusted session capability. The consumer owns permission and connection lifetime. */\nexport interface PoMcpService {\n /** Cancellation rolls back establishment only. Credentials are never persisted by this service. */\n register(input: PoMcpRegistrationInput, signal?: AbortSignal): Promise<PoMcpRegistration>;\n}\n\nexport const PO_MCP_CONTRACT = defineServiceContract<PoMcpService>(PO_MCP_SERVICE, { scope: 'session' });\n\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n 'po/mcp': PoMcpService;\n }\n}\n\nexport function readPoMcp(context: Context): PoMcpService | undefined {\n return context.get(PO_MCP_SERVICE) as PoMcpService | undefined;\n}\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"mcp.mjs","names":[],"sources":["../../../src/schemas/mcp.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis';\nimport type { ReadResourceResult, Tool } from '@modelcontextprotocol/server';\n\nimport type { PoHeadlessToolResult } from './headless';\nimport { defineServiceContract } from './serverScope';\n\nexport const PO_MCP_SERVICE = 'po/mcp';\n\nexport type McpSessionApiKey = ({ value: string } | { environmentVariable: string }) &\n ({ mode: 'bearer' } | { mode: 'header'; name: string });\n\nexport interface PoMcpRegistrationInput {\n name: string;\n url: string;\n type?: 'http' | 'sse';\n apiKey?: McpSessionApiKey;\n}\n\nexport interface McpSessionServerResult {\n name: string;\n status: string;\n tools: string[];\n}\n\n/** An identity-owned temporary connection. It survives the establishing call's completion. */\nexport interface PoMcpRegistration {\n readonly name: string;\n /** Detached live state. Retired registrations cannot observe a replacement. */\n snapshot(): McpSessionServerResult;\n /** Uses the session's validated, visible tool invocation path. */\n invoke(tool: string, args?: Record<string, unknown>, signal?: AbortSignal): Promise<PoHeadlessToolResult>;\n /** Idempotent cleanup, including after cancellation or provider withdrawal. */\n dispose(): Promise<void>;\n}\n\n/** Trusted session capability. The consumer owns permission and connection lifetime. */\nexport interface PoMcpService {\n /** Cancellation rolls back establishment only. Credentials are never persisted by this service. */\n register(input: PoMcpRegistrationInput, signal?: AbortSignal): Promise<PoMcpRegistration>;\n}\n\nexport const PO_MCP_CONTRACT = defineServiceContract<PoMcpService>(PO_MCP_SERVICE, { scope: 'session' });\n\nexport const PO_MCP_CONNECTIONS_SERVICE = 'po/mcp-connections';\n\nexport type PoMcpCredential = { kind: 'bearer'; token: string } | { kind: 'header'; name: string; value: string };\n\nexport interface PoMcpConnectInput {\n /** The consuming plugin's package name. */\n owner: string;\n url: string;\n auth?: { credential: PoMcpCredential; saveAs?: string } | { credentialId: string };\n /** Upstream tools an App may request, each requiring confirmation. */\n appTools?: readonly string[];\n lifetime: AbortSignal;\n}\n\nexport interface PoMcpAppInvocation {\n toolCallId: string;\n toolName: string;\n}\n\n/** Private upstream client. Its tools never enter the session catalog. */\nexport interface PoMcpConnection {\n readonly id: string;\n listTools(signal?: AbortSignal): Promise<readonly Tool[]>;\n callTool(\n name: string,\n args: Record<string, unknown>,\n options?: { invocation?: PoMcpAppInvocation; signal?: AbortSignal },\n ): Promise<PoHeadlessToolResult>;\n readAppResource(tool: string, signal?: AbortSignal): Promise<ReadResourceResult>;\n dispose(): Promise<void>;\n}\n\nexport interface PoMcpConnectionsService {\n connect(input: PoMcpConnectInput, signal?: AbortSignal): Promise<PoMcpConnection>;\n /** Deleting a connection does not delete its saved credential. */\n forgetCredential(owner: string, credentialId: string): Promise<void>;\n}\n\nexport const PO_MCP_CONNECTIONS_CONTRACT = defineServiceContract<PoMcpConnectionsService>(PO_MCP_CONNECTIONS_SERVICE, {\n scope: 'session',\n});\n\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n 'po/mcp': PoMcpService;\n 'po/mcp-connections': PoMcpConnectionsService;\n }\n}\n\nexport function readPoMcp(context: Context): PoMcpService | undefined {\n return context.get(PO_MCP_SERVICE) as PoMcpService | undefined;\n}\n"],"mappings":";;AAMA,MAAa,iBAAiB;AAmC9B,MAAa,kBAAkB,sBAAoC,gBAAgB,EAAE,OAAO,UAAU,CAAC;AAEvG,MAAa,6BAA6B;AAsC1C,MAAa,8BAA8B,sBAA+C,4BAA4B,EACpH,OAAO,UACT,CAAC;AASD,SAAgB,UAAU,SAA4C;CACpE,OAAO,QAAQ,IAAI,cAAc;AACnC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
let typebox = require("typebox");
|
|
2
|
+
let typebox_value = require("typebox/value");
|
|
2
3
|
//#region src/schemas/workflow.ts
|
|
3
4
|
const PO_WORKFLOW_LAUNCH_SERVICE = "po/workflow-launch";
|
|
4
5
|
const PO_WORKFLOW_DEFINITION_SOURCES_SERVICE = "po/workflow-definition-sources";
|
|
@@ -6,6 +7,7 @@ const PO_WORKFLOW_RUNS_SERVICE = "po/workflow-runs";
|
|
|
6
7
|
const PO_WORKFLOW_CONTEXT_SERVICE = "po/workflow-context";
|
|
7
8
|
const PO_WORKFLOW_ADMISSIONS_SERVICE = "po/workflow-admissions";
|
|
8
9
|
const PO_WORKFLOW_IDENTITY_SERVICE = "po/workflow-identity";
|
|
10
|
+
const PO_WORKFLOW_PROFILE_ADMISSION_SERVICE = "po/workflow-profile-admission";
|
|
9
11
|
/** A source-relative definition, never an arbitrary host path. */
|
|
10
12
|
const PoWorkflowDefinitionRefSchema = typebox.Type.Object({
|
|
11
13
|
source: typebox.Type.String({ minLength: 1 }),
|
|
@@ -21,6 +23,140 @@ const PoWorkflowRunRefSchema = typebox.Type.Object({
|
|
|
21
23
|
runKey: typebox.Type.String({ minLength: 1 }),
|
|
22
24
|
registryWorkspace: typebox.Type.String({ minLength: 1 })
|
|
23
25
|
}, { additionalProperties: false });
|
|
26
|
+
const IdentityText = typebox.Type.String({
|
|
27
|
+
minLength: 1,
|
|
28
|
+
maxLength: 512,
|
|
29
|
+
pattern: "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$"
|
|
30
|
+
});
|
|
31
|
+
const IdentitySlug = typebox.Type.String({
|
|
32
|
+
minLength: 1,
|
|
33
|
+
maxLength: 64,
|
|
34
|
+
pattern: "^(?!(?:constructor|prototype|__proto__)$)[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
|
|
35
|
+
});
|
|
36
|
+
/** Opaque provider reference. Only the scoped provider can establish whether it identifies an eligible profile. */
|
|
37
|
+
const StableProfileRef = typebox.Type.String({
|
|
38
|
+
minLength: 1,
|
|
39
|
+
maxLength: 512,
|
|
40
|
+
pattern: "^[^\\s\\u0000-\\u001f\\u007f]+$"
|
|
41
|
+
});
|
|
42
|
+
const IdentityDigest = typebox.Type.String({ pattern: "^[a-f0-9]{64}$" });
|
|
43
|
+
const IdentityRoles = typebox.Type.Array(IdentitySlug, { uniqueItems: true });
|
|
44
|
+
const PoWorkflowRoleGroupSchema = typebox.Type.Object({
|
|
45
|
+
kind: typebox.Type.Union([
|
|
46
|
+
typebox.Type.Literal("job"),
|
|
47
|
+
typebox.Type.Literal("child"),
|
|
48
|
+
typebox.Type.Literal("repair")
|
|
49
|
+
]),
|
|
50
|
+
job: IdentityText,
|
|
51
|
+
roles: typebox.Type.Array(IdentitySlug, {
|
|
52
|
+
minItems: 1,
|
|
53
|
+
uniqueItems: true
|
|
54
|
+
})
|
|
55
|
+
}, { additionalProperties: false });
|
|
56
|
+
/** Derived from the effective graph. revision identifies the parsed definition, never a mutable path alone. */
|
|
57
|
+
const PoWorkflowIdentityRequirementsSchema = typebox.Type.Object({
|
|
58
|
+
definition: PoWorkflowDefinitionRefSchema,
|
|
59
|
+
revision: IdentityText,
|
|
60
|
+
roles: IdentityRoles,
|
|
61
|
+
groups: typebox.Type.Array(PoWorkflowRoleGroupSchema, { uniqueItems: true })
|
|
62
|
+
}, { additionalProperties: false });
|
|
63
|
+
const PoWorkflowAssignmentsSchema = typebox.Type.Record(IdentitySlug, StableProfileRef, { additionalProperties: false });
|
|
64
|
+
/** Safe picker projection. voiceConfigured is metadata, not provider readiness, entitlement or quota. */
|
|
65
|
+
const PoWorkflowIdentityCandidateSchema = typebox.Type.Object({
|
|
66
|
+
ref: StableProfileRef,
|
|
67
|
+
label: IdentityText,
|
|
68
|
+
roles: IdentityRoles,
|
|
69
|
+
voiceConfigured: typebox.Type.Boolean()
|
|
70
|
+
}, { additionalProperties: false });
|
|
71
|
+
/** Supplied by the admitted provider scope, never chosen by launch arguments or inferred from team/default names. */
|
|
72
|
+
const PoWorkflowProductScopeSchema = typebox.Type.Object({
|
|
73
|
+
workspaceId: IdentityText,
|
|
74
|
+
product: IdentitySlug,
|
|
75
|
+
revision: IdentityText
|
|
76
|
+
}, { additionalProperties: false });
|
|
77
|
+
const PoWorkflowIdentityDiscoverySchema = typebox.Type.Object({
|
|
78
|
+
scope: PoWorkflowProductScopeSchema,
|
|
79
|
+
candidates: typebox.Type.Array(PoWorkflowIdentityCandidateSchema)
|
|
80
|
+
}, { additionalProperties: false });
|
|
81
|
+
/** Value-free evidence matching the initialized provider. credentialRef is not assumed equal to the stable ref. */
|
|
82
|
+
const PoWorkflowExpectedProviderSchema = typebox.Type.Object({
|
|
83
|
+
provider: IdentityText,
|
|
84
|
+
organizationId: IdentityText,
|
|
85
|
+
mailboxId: IdentityText,
|
|
86
|
+
credentialRef: IdentityText
|
|
87
|
+
}, { additionalProperties: false });
|
|
88
|
+
const PoWorkflowAllocatedProfileSchema = typebox.Type.Object({
|
|
89
|
+
ref: StableProfileRef,
|
|
90
|
+
profile: IdentityText,
|
|
91
|
+
contentDigest: IdentityDigest,
|
|
92
|
+
policyDigest: IdentityDigest,
|
|
93
|
+
provider: PoWorkflowExpectedProviderSchema
|
|
94
|
+
}, { additionalProperties: false });
|
|
95
|
+
/** Persisted before effects. Profiles contain exact admitted evidence, never secrets or an implicit team selection. */
|
|
96
|
+
const PoWorkflowAllocationSchema = typebox.Type.Object({
|
|
97
|
+
version: typebox.Type.Literal(1),
|
|
98
|
+
requirements: PoWorkflowIdentityRequirementsSchema,
|
|
99
|
+
scope: PoWorkflowProductScopeSchema,
|
|
100
|
+
assignments: PoWorkflowAssignmentsSchema,
|
|
101
|
+
profiles: typebox.Type.Array(PoWorkflowAllocatedProfileSchema)
|
|
102
|
+
}, { additionalProperties: false });
|
|
103
|
+
/** Step bootstrap only. An allocation-owned role-less session explicitly has no profile. */
|
|
104
|
+
const PoWorkflowExpectedIdentitySchema = typebox.Type.Union([typebox.Type.Object({ kind: typebox.Type.Literal("none") }, { additionalProperties: false }), typebox.Type.Object({
|
|
105
|
+
kind: typebox.Type.Literal("profile"),
|
|
106
|
+
scope: PoWorkflowProductScopeSchema,
|
|
107
|
+
definitionRevision: IdentityText,
|
|
108
|
+
roles: typebox.Type.Array(IdentitySlug, {
|
|
109
|
+
minItems: 1,
|
|
110
|
+
uniqueItems: true
|
|
111
|
+
}),
|
|
112
|
+
...PoWorkflowAllocatedProfileSchema.properties
|
|
113
|
+
}, { additionalProperties: false })]);
|
|
114
|
+
/** Shared structural checks only. Eligibility, product scope and authorization require fresh provider admission. */
|
|
115
|
+
function validatePoWorkflowAssignments(requirements, assignments) {
|
|
116
|
+
const invalidRequirements = [{
|
|
117
|
+
code: "invalid_requirements",
|
|
118
|
+
message: "Workflow allocation requirements are invalid."
|
|
119
|
+
}];
|
|
120
|
+
if (!(0, typebox_value.Check)(PoWorkflowIdentityRequirementsSchema, requirements)) return invalidRequirements;
|
|
121
|
+
const roles = new Set(requirements.groups.flatMap((group) => group.roles));
|
|
122
|
+
if (new Set(requirements.groups.map((group) => JSON.stringify([group.kind, group.job]))).size !== requirements.groups.length || roles.size !== requirements.roles.length || requirements.roles.some((role) => !roles.has(role))) return invalidRequirements;
|
|
123
|
+
if (assignments === void 0) return requirements.roles.map((role) => ({
|
|
124
|
+
code: "missing_assignment",
|
|
125
|
+
role,
|
|
126
|
+
message: `Assign a stable profile reference to role ${role}.`
|
|
127
|
+
}));
|
|
128
|
+
if (!(0, typebox_value.Check)(PoWorkflowAssignmentsSchema, assignments)) return [{
|
|
129
|
+
code: "invalid_assignments",
|
|
130
|
+
message: "Workflow assignments must map role slugs to nonempty stable profile references."
|
|
131
|
+
}];
|
|
132
|
+
const issues = [];
|
|
133
|
+
for (const role of requirements.roles) if (!Object.hasOwn(assignments, role)) issues.push({
|
|
134
|
+
code: "missing_assignment",
|
|
135
|
+
role,
|
|
136
|
+
message: `Assign a stable profile reference to role ${role}.`
|
|
137
|
+
});
|
|
138
|
+
for (const role of Object.keys(assignments)) if (!roles.has(role)) issues.push({
|
|
139
|
+
code: "unknown_role",
|
|
140
|
+
role,
|
|
141
|
+
message: `Role ${role} is not required by this workflow.`
|
|
142
|
+
});
|
|
143
|
+
for (const group of requirements.groups) if (new Set(group.roles.filter((role) => Object.hasOwn(assignments, role)).map((role) => assignments[role])).size > 1) issues.push({
|
|
144
|
+
code: "conflicting_roles",
|
|
145
|
+
job: group.job,
|
|
146
|
+
message: `Roles for job ${group.job} must use the same profile reference.`
|
|
147
|
+
});
|
|
148
|
+
return issues;
|
|
149
|
+
}
|
|
150
|
+
/** Validates shape and cross-field consistency, then detaches persisted evidence from caller-owned objects. */
|
|
151
|
+
function parsePoWorkflowAllocation(value) {
|
|
152
|
+
if (!(0, typebox_value.Check)(PoWorkflowAllocationSchema, value)) throw new Error("Invalid or missing explicit workflow allocation snapshot.");
|
|
153
|
+
const issues = validatePoWorkflowAssignments(value.requirements, value.assignments);
|
|
154
|
+
if (issues.length) throw new Error(`Invalid workflow allocation: ${issues.map((issue) => issue.message).join(" ")}`);
|
|
155
|
+
const assigned = new Set(Object.values(value.assignments));
|
|
156
|
+
const profiles = new Set(value.profiles.map((profile) => profile.ref));
|
|
157
|
+
if (profiles.size !== value.profiles.length || profiles.size !== assigned.size || [...assigned].some((ref) => !profiles.has(ref))) throw new Error("Invalid workflow allocation: profile bindings must cover exactly the assigned references.");
|
|
158
|
+
return structuredClone(value);
|
|
159
|
+
}
|
|
24
160
|
function readPoWorkflowLaunchService(context) {
|
|
25
161
|
return context.get(PO_WORKFLOW_LAUNCH_SERVICE);
|
|
26
162
|
}
|
|
@@ -39,20 +175,37 @@ function readPoWorkflowAdmissionsService(context) {
|
|
|
39
175
|
function readPoWorkflowIdentityService(context) {
|
|
40
176
|
return context.get(PO_WORKFLOW_IDENTITY_SERVICE);
|
|
41
177
|
}
|
|
178
|
+
function readPoWorkflowProfileAdmission(context) {
|
|
179
|
+
return context.get(PO_WORKFLOW_PROFILE_ADMISSION_SERVICE);
|
|
180
|
+
}
|
|
42
181
|
//#endregion
|
|
43
182
|
exports.PO_WORKFLOW_ADMISSIONS_SERVICE = PO_WORKFLOW_ADMISSIONS_SERVICE;
|
|
44
183
|
exports.PO_WORKFLOW_CONTEXT_SERVICE = PO_WORKFLOW_CONTEXT_SERVICE;
|
|
45
184
|
exports.PO_WORKFLOW_DEFINITION_SOURCES_SERVICE = PO_WORKFLOW_DEFINITION_SOURCES_SERVICE;
|
|
46
185
|
exports.PO_WORKFLOW_IDENTITY_SERVICE = PO_WORKFLOW_IDENTITY_SERVICE;
|
|
47
186
|
exports.PO_WORKFLOW_LAUNCH_SERVICE = PO_WORKFLOW_LAUNCH_SERVICE;
|
|
187
|
+
exports.PO_WORKFLOW_PROFILE_ADMISSION_SERVICE = PO_WORKFLOW_PROFILE_ADMISSION_SERVICE;
|
|
48
188
|
exports.PO_WORKFLOW_RUNS_SERVICE = PO_WORKFLOW_RUNS_SERVICE;
|
|
189
|
+
exports.PoWorkflowAllocatedProfileSchema = PoWorkflowAllocatedProfileSchema;
|
|
190
|
+
exports.PoWorkflowAllocationSchema = PoWorkflowAllocationSchema;
|
|
191
|
+
exports.PoWorkflowAssignmentsSchema = PoWorkflowAssignmentsSchema;
|
|
49
192
|
exports.PoWorkflowDefinitionRefSchema = PoWorkflowDefinitionRefSchema;
|
|
193
|
+
exports.PoWorkflowExpectedIdentitySchema = PoWorkflowExpectedIdentitySchema;
|
|
194
|
+
exports.PoWorkflowExpectedProviderSchema = PoWorkflowExpectedProviderSchema;
|
|
195
|
+
exports.PoWorkflowIdentityCandidateSchema = PoWorkflowIdentityCandidateSchema;
|
|
196
|
+
exports.PoWorkflowIdentityDiscoverySchema = PoWorkflowIdentityDiscoverySchema;
|
|
197
|
+
exports.PoWorkflowIdentityRequirementsSchema = PoWorkflowIdentityRequirementsSchema;
|
|
198
|
+
exports.PoWorkflowProductScopeSchema = PoWorkflowProductScopeSchema;
|
|
199
|
+
exports.PoWorkflowRoleGroupSchema = PoWorkflowRoleGroupSchema;
|
|
50
200
|
exports.PoWorkflowRunRefSchema = PoWorkflowRunRefSchema;
|
|
201
|
+
exports.parsePoWorkflowAllocation = parsePoWorkflowAllocation;
|
|
51
202
|
exports.readPoWorkflowAdmissionsService = readPoWorkflowAdmissionsService;
|
|
52
203
|
exports.readPoWorkflowContextService = readPoWorkflowContextService;
|
|
53
204
|
exports.readPoWorkflowDefinitionSourcesService = readPoWorkflowDefinitionSourcesService;
|
|
54
205
|
exports.readPoWorkflowIdentityService = readPoWorkflowIdentityService;
|
|
55
206
|
exports.readPoWorkflowLaunchService = readPoWorkflowLaunchService;
|
|
207
|
+
exports.readPoWorkflowProfileAdmission = readPoWorkflowProfileAdmission;
|
|
56
208
|
exports.readPoWorkflowRunsService = readPoWorkflowRunsService;
|
|
209
|
+
exports.validatePoWorkflowAssignments = validatePoWorkflowAssignments;
|
|
57
210
|
|
|
58
211
|
//# sourceMappingURL=workflow.cjs.map
|