@akagilnc/pi-workflow-roles 0.1.4745 → 0.1.4772
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/acp-host/production-host.js +278 -590
- package/dist/headless-host/production-host.js +284 -596
- package/dist/migrate-book-topology.js +1255 -1087
- package/dist/notary-source-run.js +12 -2
- package/dist/public-cli/invocation.js +11 -8
- package/dist/public-cli/main.js +250 -563
- package/dist/public-cli/post-admission.js +96 -131
- package/dist/public-cli/run-lifecycle.js +25 -4
- package/dist/role-run-relocation.js +19 -18
- package/package.json +1 -1
- package/src/book-topology-migration-placement.ts +9 -1
- package/src/book-topology-runs-migrator.ts +156 -4
- package/src/notary-source-run.ts +18 -2
- package/src/public-cli/cli.ts +0 -5
- package/src/public-cli/config.ts +0 -1
- package/src/public-cli/countersign-run.ts +1 -1
- package/src/public-cli/diarist-run.ts +1 -1
- package/src/public-cli/invocation.ts +13 -9
- package/src/public-cli/post-admission.ts +124 -187
- package/src/public-cli/run-lifecycle.ts +42 -4
- package/src/role-run-relocation.ts +27 -30
- package/dist/public-cli/public-run-credentials.js +0 -49
- package/src/public-cli/public-run-credentials.ts +0 -71
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared public-run credential seam: one owner for missing selected-provider
|
|
3
|
-
* detection, typed failure construction, pre-dispatch fail-closed payload, and
|
|
4
|
-
* post-run credential annotation. Role runners supply model/credential facts only.
|
|
5
|
-
*/
|
|
6
|
-
import { missingPublicProviderCredential, } from "./config.js";
|
|
7
|
-
/**
|
|
8
|
-
* Production-owned provider failure when the selected public seat provider has
|
|
9
|
-
* no configured credential. Cause/identity come from CredentialProviders, not
|
|
10
|
-
* stderr wording. Runner-supplied knownFailure still wins over this annotation.
|
|
11
|
-
*/
|
|
12
|
-
export function knownFailureForMissingProviderCredential(model, credentials) {
|
|
13
|
-
if (model === undefined || credentials === undefined)
|
|
14
|
-
return undefined;
|
|
15
|
-
// Only the public credential catalog is fail-closed here; offline/test providers
|
|
16
|
-
// are not represented in auth.json shape and must not be washed into MissingProviderCredential.
|
|
17
|
-
if (model.provider !== "openai-codex" && model.provider !== "xai")
|
|
18
|
-
return undefined;
|
|
19
|
-
if (!missingPublicProviderCredential(model.provider, credentials)) {
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
return {
|
|
23
|
-
cause: "provider",
|
|
24
|
-
identity: {
|
|
25
|
-
name: "MissingProviderCredential",
|
|
26
|
-
code: model.provider,
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export function missingCredentialPreDispatchFailure(model, credentials) {
|
|
31
|
-
const knownFailure = knownFailureForMissingProviderCredential(model, credentials);
|
|
32
|
-
if (knownFailure === undefined)
|
|
33
|
-
return undefined;
|
|
34
|
-
return {
|
|
35
|
-
timedOut: false,
|
|
36
|
-
code: 1,
|
|
37
|
-
stderr: `Missing credential for provider ${String(knownFailure.identity?.code ?? "unknown")}`,
|
|
38
|
-
knownFailure,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Post-run credential annotation for the shared evidence-priority chain.
|
|
43
|
-
* Only annotates nonzero/timeout exits; never invents a credential failure on success.
|
|
44
|
-
*/
|
|
45
|
-
export function postRunMissingCredentialFailure(result, model, credentials) {
|
|
46
|
-
if (!(result.timedOut || result.code !== 0))
|
|
47
|
-
return undefined;
|
|
48
|
-
return knownFailureForMissingProviderCredential(model, credentials);
|
|
49
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared public-run credential seam: one owner for missing selected-provider
|
|
3
|
-
* detection, typed failure construction, pre-dispatch fail-closed payload, and
|
|
4
|
-
* post-run credential annotation. Role runners supply model/credential facts only.
|
|
5
|
-
*/
|
|
6
|
-
import {
|
|
7
|
-
missingPublicProviderCredential,
|
|
8
|
-
type CredentialProviders,
|
|
9
|
-
type SeatModelConfig,
|
|
10
|
-
} from "./config.ts";
|
|
11
|
-
import type { RoleTurnKnownFailure } from "../host-contracts.ts";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Production-owned provider failure when the selected public seat provider has
|
|
15
|
-
* no configured credential. Cause/identity come from CredentialProviders, not
|
|
16
|
-
* stderr wording. Runner-supplied knownFailure still wins over this annotation.
|
|
17
|
-
*/
|
|
18
|
-
export function knownFailureForMissingProviderCredential(
|
|
19
|
-
model: SeatModelConfig | undefined,
|
|
20
|
-
credentials: CredentialProviders | undefined,
|
|
21
|
-
): RoleTurnKnownFailure | undefined {
|
|
22
|
-
if (model === undefined || credentials === undefined) return undefined;
|
|
23
|
-
// Only the public credential catalog is fail-closed here; offline/test providers
|
|
24
|
-
// are not represented in auth.json shape and must not be washed into MissingProviderCredential.
|
|
25
|
-
if (model.provider !== "openai-codex" && model.provider !== "xai") return undefined;
|
|
26
|
-
if (!missingPublicProviderCredential(model.provider, credentials)) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
cause: "provider",
|
|
31
|
-
identity: {
|
|
32
|
-
name: "MissingProviderCredential",
|
|
33
|
-
code: model.provider,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** Pre-dispatch fail-closed payload when selected public provider lacks credentials. */
|
|
39
|
-
export type MissingCredentialPreDispatchFailure = Readonly<{
|
|
40
|
-
timedOut: false;
|
|
41
|
-
code: 1;
|
|
42
|
-
stderr: string;
|
|
43
|
-
knownFailure: RoleTurnKnownFailure;
|
|
44
|
-
}>;
|
|
45
|
-
|
|
46
|
-
export function missingCredentialPreDispatchFailure(
|
|
47
|
-
model: SeatModelConfig | undefined,
|
|
48
|
-
credentials: CredentialProviders | undefined,
|
|
49
|
-
): MissingCredentialPreDispatchFailure | undefined {
|
|
50
|
-
const knownFailure = knownFailureForMissingProviderCredential(model, credentials);
|
|
51
|
-
if (knownFailure === undefined) return undefined;
|
|
52
|
-
return {
|
|
53
|
-
timedOut: false,
|
|
54
|
-
code: 1,
|
|
55
|
-
stderr: `Missing credential for provider ${String(knownFailure.identity?.code ?? "unknown")}`,
|
|
56
|
-
knownFailure,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Post-run credential annotation for the shared evidence-priority chain.
|
|
62
|
-
* Only annotates nonzero/timeout exits; never invents a credential failure on success.
|
|
63
|
-
*/
|
|
64
|
-
export function postRunMissingCredentialFailure(
|
|
65
|
-
result: Readonly<{ timedOut: boolean; code: number | null }>,
|
|
66
|
-
model: SeatModelConfig | undefined,
|
|
67
|
-
credentials: CredentialProviders | undefined,
|
|
68
|
-
): RoleTurnKnownFailure | undefined {
|
|
69
|
-
if (!(result.timedOut || result.code !== 0)) return undefined;
|
|
70
|
-
return knownFailureForMissingProviderCredential(model, credentials);
|
|
71
|
-
}
|