@akagilnc/pi-workflow-roles 0.1.3749 → 0.1.3771
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/CLAUDE.md +4 -0
- package/README.md +3 -2
- package/README.zh-CN.md +3 -2
- package/dist/acp-host/production-host.js +1389 -751
- package/dist/collector-config.js +0 -1
- package/dist/collector-github.js +199 -2
- package/dist/collector-identity.js +128 -41
- package/dist/collector-ledger.js +38 -9
- package/dist/collector-receipt.js +19 -7
- package/dist/collector-role.js +330 -369
- package/dist/collector-target.js +169 -0
- package/dist/collector-tool-schemas.js +51 -14
- package/dist/package-contracts/collector-output.js +32 -0
- package/dist/package-contracts/terminating-infrastructure.js +13 -12
- package/dist/pi/role-turn-host.js +1 -2
- package/dist/public-cli/github-remote.js +45 -0
- package/dist/public-cli/invocation.js +53 -54
- package/dist/public-cli/main.js +615 -148
- package/dist/public-cli/option-definitions.js +6 -4
- package/dist/public-cli/run-lifecycle.js +3 -3
- package/dist/public-cli/settlement.js +83 -6
- package/dist/role-runtime.js +137 -7
- package/dist/submission-correctable-error.js +24 -0
- package/extensions/role-runtime.ts +0 -1
- package/package.json +1 -1
- package/souls/coder.md +11 -6
- package/souls/fixer.md +10 -9
- package/src/acp-host/role-envelope.ts +8 -22
- package/src/collector-config.ts +0 -1
- package/src/collector-github.ts +236 -2
- package/src/collector-identity.ts +148 -40
- package/src/collector-ledger.ts +48 -10
- package/src/collector-receipt.ts +33 -14
- package/src/collector-role.ts +376 -450
- package/src/collector-target.ts +207 -0
- package/src/collector-tool-schemas.ts +62 -15
- package/src/host-contracts.ts +2 -1
- package/src/package-contracts/collector-output.ts +72 -0
- package/src/package-contracts/terminating-infrastructure.ts +24 -13
- package/src/pi/role-turn-host.ts +1 -2
- package/src/public-cli/cli.ts +10 -1
- package/src/public-cli/collector-run.ts +3 -2
- package/src/public-cli/github-remote.ts +45 -0
- package/src/public-cli/invocation.ts +60 -59
- package/src/public-cli/option-definitions.ts +6 -4
- package/src/public-cli/run-lifecycle.ts +2 -2
- package/src/public-cli/settlement.ts +82 -6
- package/src/role-runtime.ts +166 -13
- package/src/submission-correctable-error.ts +38 -0
|
@@ -32,3 +32,41 @@ export function isCorrectableExecuteError(error: unknown): boolean {
|
|
|
32
32
|
|| error instanceof WorkerUnfinishedReasonReminderError
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Durable projection for ACP envelope tool catches only.
|
|
38
|
+
* Pi path keeps native throw → isError toolResult (no shared projection consumer).
|
|
39
|
+
*/
|
|
40
|
+
export type CorrectableExecuteRejectionProjection = {
|
|
41
|
+
readonly diagnostic: string;
|
|
42
|
+
readonly details: Record<string, unknown>;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* One authority for correctable execute → diagnostic text + structured details.
|
|
47
|
+
* Consumed by the ACP envelope tool catch; host adapters wrap transport shape only.
|
|
48
|
+
*/
|
|
49
|
+
export function projectCorrectableExecuteRejection(
|
|
50
|
+
error: unknown,
|
|
51
|
+
): CorrectableExecuteRejectionProjection {
|
|
52
|
+
const diagnostic = error instanceof Error ? error.message : String(error);
|
|
53
|
+
if (error instanceof GatekeeperDecisionError) {
|
|
54
|
+
return { diagnostic, details: { ...(error.result as Record<string, unknown>) } };
|
|
55
|
+
}
|
|
56
|
+
if (
|
|
57
|
+
error instanceof WorkerCommitReminderError
|
|
58
|
+
|| error instanceof WorkerPrefixReminderError
|
|
59
|
+
|| error instanceof WorkerUnfinishedReasonReminderError
|
|
60
|
+
) {
|
|
61
|
+
return { diagnostic, details: { code: error.code } };
|
|
62
|
+
}
|
|
63
|
+
if (typeof (error as { code?: unknown }).code === "string") {
|
|
64
|
+
return { diagnostic, details: { code: (error as { code: string }).code } };
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
diagnostic,
|
|
68
|
+
details: {
|
|
69
|
+
code: error instanceof Error && error.name ? error.name : "correctable-submission-error",
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|