@hearsay-tools/squawk 0.18.0-pr3964.7506 → 0.18.0-pr3965.7507
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/core/runner-definition.d.ts +35 -0
- package/dist/core/runner-definition.js.map +1 -1
- package/dist/core/skill-probe.js +2 -5
- package/dist/core/skill-probe.js.map +1 -1
- package/dist/delegation/transport.d.ts +65 -65
- package/dist/runners/claude/definition.js +2 -0
- package/dist/runners/claude/definition.js.map +1 -1
- package/dist/runners/claude/mock.d.ts +57 -0
- package/dist/runners/claude/mock.js +23 -0
- package/dist/runners/claude/mock.js.map +1 -0
- package/dist/runners/codex/definition.js +2 -0
- package/dist/runners/codex/definition.js.map +1 -1
- package/dist/runners/codex/mock.d.ts +71 -0
- package/dist/runners/codex/mock.js +29 -0
- package/dist/runners/codex/mock.js.map +1 -0
- package/dist/runners/mock-prompts.d.ts +63 -0
- package/dist/runners/mock-prompts.js +64 -0
- package/dist/runners/mock-prompts.js.map +1 -0
- package/dist/runners/omp/definition.js +2 -0
- package/dist/runners/omp/definition.js.map +1 -1
- package/dist/runners/omp/mock.d.ts +57 -0
- package/dist/runners/omp/mock.js +18 -0
- package/dist/runners/omp/mock.js.map +1 -0
- package/dist/runners/opencode/definition.js +2 -0
- package/dist/runners/opencode/definition.js.map +1 -1
- package/dist/runners/opencode/mock.d.ts +75 -0
- package/dist/runners/opencode/mock.js +33 -0
- package/dist/runners/opencode/mock.js.map +1 -0
- package/dist/runners/pi/definition.js +2 -0
- package/dist/runners/pi/definition.js.map +1 -1
- package/dist/runners/pi/mock.d.ts +53 -0
- package/dist/runners/pi/mock.js +15 -0
- package/dist/runners/pi/mock.js.map +1 -0
- package/dist/server/activity-routes.d.ts +23 -23
- package/dist/server/server.d.ts +1559 -1559
- package/dist/workflows/run-states.js +1 -1
- package/dist/workflows/run-states.js.map +1 -1
- package/package.json +4 -4
|
@@ -47,6 +47,41 @@ export interface RunnerDefinition {
|
|
|
47
47
|
readonly accounts: RunnerAccounts;
|
|
48
48
|
/** The environment allow-list prefixes (the `env` part). */
|
|
49
49
|
readonly env: RunnerEnv;
|
|
50
|
+
/** The runner's native mock script and the prompts that drive it, for tests and lint (the `mock` part). */
|
|
51
|
+
readonly mock: RunnerMock;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A runner's native mock (the `mock` part): the script in `packages/cezar/scripts/`, the variable
|
|
55
|
+
* that points the runner at it, and the prompt each shared parity scenario sends it. Plain data in
|
|
56
|
+
* `runners/<id>/mock.ts`. `core/skill-probe.ts` and the parity kit read it from the registry, and
|
|
57
|
+
* `lint/mock-scenario-boundary.ts` reads it from the built-in list.
|
|
58
|
+
*/
|
|
59
|
+
export interface RunnerMock {
|
|
60
|
+
/** The mock script's file name in `packages/cezar/scripts/`. */
|
|
61
|
+
readonly script: string;
|
|
62
|
+
/** The env var the runner reads to locate its binary; a test points it at the mock script. */
|
|
63
|
+
readonly binEnv: string;
|
|
64
|
+
/** Every human ask wire this runner exposes; cezar_ask when it has no native one. */
|
|
65
|
+
readonly askResumeCases: readonly {
|
|
66
|
+
kind: string;
|
|
67
|
+
scenario: 'ask-resume';
|
|
68
|
+
answer: string;
|
|
69
|
+
}[];
|
|
70
|
+
/**
|
|
71
|
+
* Scenario name -> the prompt text this runner's mock answers it with. The names are the parity
|
|
72
|
+
* kit's `ScenarioName`s; `parity-classes.test.ts` checks each. The kit adds the `cezar-ask` and
|
|
73
|
+
* `cezar-wait` prompts, which every mock answers the same way.
|
|
74
|
+
*/
|
|
75
|
+
readonly scenarios: Readonly<Record<string, string>>;
|
|
76
|
+
/** P1: the option to pick (matched case-insensitively against its label) and the text the
|
|
77
|
+
* mock echoes once that native reply arrives. Required with `scenarios.approval`. */
|
|
78
|
+
readonly approvalDecisions?: readonly {
|
|
79
|
+
pick: string;
|
|
80
|
+
echo: string;
|
|
81
|
+
}[];
|
|
82
|
+
/** P6: the text the mock echoes once Squawk refuses its malformed request. Required with
|
|
83
|
+
* `scenarios['approval-malformed']`. */
|
|
84
|
+
readonly malformedApprovalEcho?: string;
|
|
50
85
|
}
|
|
51
86
|
/** A runner's model data: plain data in `runners/<id>/models.ts`. */
|
|
52
87
|
export interface RunnerModelData {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner-definition.js","sourceRoot":"","sources":["../../src/core/runner-definition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runner-definition.js","sourceRoot":"","sources":["../../src/core/runner-definition.ts"],"names":[],"mappings":"AAoNA,0BAA0B;AAC1B,MAAM,UAAU,YAAY,CAAC,UAA4B;IACvD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
package/dist/core/skill-probe.js
CHANGED
|
@@ -3,16 +3,13 @@ import { setTimeout as delay } from 'node:timers/promises';
|
|
|
3
3
|
import { buildChildEnv } from './agent-env.js';
|
|
4
4
|
import { profileEnv } from './agent-profiles.js';
|
|
5
5
|
import { productEnv } from './product-env.js';
|
|
6
|
+
import { runnerDefinition } from './runner-registry.js';
|
|
6
7
|
import { processGroupAlive, sessionGroupOf, signalOwnedSessionGroup, signalSession, spawnSessionLeader } from './session-process.js';
|
|
7
8
|
export function skillExecutable(runner, bin) {
|
|
8
9
|
return bin ?? { claude: productEnv('CLAUDE_BIN'), codex: productEnv('CODEX_BIN'),
|
|
9
10
|
opencode: productEnv('OPENCODE_BIN'), pi: productEnv('PI_BIN'), omp: productEnv('OMP_BIN') }[runner] ?? (productEnv('DRY_RUN') === '1'
|
|
10
|
-
? fileURLToPath(new URL(`../../scripts/${
|
|
11
|
+
? fileURLToPath(new URL(`../../scripts/${runnerDefinition(runner).mock.script}`, import.meta.url)) : runner);
|
|
11
12
|
}
|
|
12
|
-
const MOCKS = {
|
|
13
|
-
claude: 'mock-claude.mjs', codex: 'mock-codex-app-server.mjs', opencode: 'mock-opencode-serve.mjs',
|
|
14
|
-
pi: 'mock-pi-rpc.mjs', omp: 'mock-omp-rpc.mjs',
|
|
15
|
-
};
|
|
16
13
|
/** A no-turn probe owns a process group. Kill it and observe exit before releasing its caller. */
|
|
17
14
|
export async function skillProbe(runner, args, options, read) {
|
|
18
15
|
options.signal?.throwIfAborted();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-probe.js","sourceRoot":"","sources":["../../src/core/skill-probe.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,uBAAuB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAWrI,MAAM,UAAU,eAAe,CAAC,MAAgB,EAAE,GAAY;IAC5D,OAAO,GAAG,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC;QAC9E,QAAQ,EAAE,UAAU,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,GAAG;QACtI,CAAC,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"skill-probe.js","sourceRoot":"","sources":["../../src/core/skill-probe.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO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;IACrE,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAChC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,UAAU,CAAC,KAAK,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7D,IAAI,MAAM,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACrE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,SAAS,CAAC,KAAqC;IACtD,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI,IAAI,KAAK,CAAC,UAAU,KAAK,IAAI;QAAE,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACjG,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC5B,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS;YAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -2,6 +2,18 @@ import type { DelegationRoutes } from './routes.ts';
|
|
|
2
2
|
export declare function createDelegationApp(routes: DelegationRoutes): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
|
|
3
3
|
"/list": {
|
|
4
4
|
$get: {
|
|
5
|
+
output: {
|
|
6
|
+
error: string;
|
|
7
|
+
code?: "invalid_input" | undefined;
|
|
8
|
+
};
|
|
9
|
+
outputFormat: "json";
|
|
10
|
+
status: 400;
|
|
11
|
+
input: {
|
|
12
|
+
query: {
|
|
13
|
+
offset?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
} | {
|
|
5
17
|
output: {
|
|
6
18
|
workers: {
|
|
7
19
|
workerId: string;
|
|
@@ -48,18 +60,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
48
60
|
offset?: string | undefined;
|
|
49
61
|
};
|
|
50
62
|
};
|
|
51
|
-
} | {
|
|
52
|
-
output: {
|
|
53
|
-
error: string;
|
|
54
|
-
code?: "invalid_input" | undefined;
|
|
55
|
-
};
|
|
56
|
-
outputFormat: "json";
|
|
57
|
-
status: 400;
|
|
58
|
-
input: {
|
|
59
|
-
query: {
|
|
60
|
-
offset?: string | undefined;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
} & {
|
|
@@ -598,6 +598,18 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
598
598
|
} & {
|
|
599
599
|
"/:workerId": {
|
|
600
600
|
$get: {
|
|
601
|
+
output: {
|
|
602
|
+
error: string;
|
|
603
|
+
code?: "invalid_input" | undefined;
|
|
604
|
+
};
|
|
605
|
+
outputFormat: "json";
|
|
606
|
+
status: 400;
|
|
607
|
+
input: {
|
|
608
|
+
param: {
|
|
609
|
+
workerId: string;
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
} | {
|
|
601
613
|
output: {
|
|
602
614
|
workerId: string;
|
|
603
615
|
settled: boolean;
|
|
@@ -715,7 +727,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
715
727
|
workerId: string;
|
|
716
728
|
};
|
|
717
729
|
};
|
|
718
|
-
}
|
|
730
|
+
};
|
|
731
|
+
};
|
|
732
|
+
} & {
|
|
733
|
+
"/:workerId/collect": {
|
|
734
|
+
$post: {
|
|
719
735
|
output: {
|
|
720
736
|
error: string;
|
|
721
737
|
code?: "invalid_input" | undefined;
|
|
@@ -726,12 +742,10 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
726
742
|
param: {
|
|
727
743
|
workerId: string;
|
|
728
744
|
};
|
|
745
|
+
} & {
|
|
746
|
+
json: Record<string, never>;
|
|
729
747
|
};
|
|
730
|
-
}
|
|
731
|
-
};
|
|
732
|
-
} & {
|
|
733
|
-
"/:workerId/collect": {
|
|
734
|
-
$post: {
|
|
748
|
+
} | {
|
|
735
749
|
output: {
|
|
736
750
|
workerId: string;
|
|
737
751
|
parentRunId: string;
|
|
@@ -854,7 +868,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
854
868
|
} & {
|
|
855
869
|
json: Record<string, never>;
|
|
856
870
|
};
|
|
857
|
-
}
|
|
871
|
+
};
|
|
872
|
+
};
|
|
873
|
+
} & {
|
|
874
|
+
"/:workerId/steer": {
|
|
875
|
+
$post: {
|
|
858
876
|
output: {
|
|
859
877
|
error: string;
|
|
860
878
|
code?: "invalid_input" | undefined;
|
|
@@ -866,13 +884,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
866
884
|
workerId: string;
|
|
867
885
|
};
|
|
868
886
|
} & {
|
|
869
|
-
json:
|
|
887
|
+
json: {
|
|
888
|
+
text: string;
|
|
889
|
+
};
|
|
870
890
|
};
|
|
871
|
-
}
|
|
872
|
-
};
|
|
873
|
-
} & {
|
|
874
|
-
"/:workerId/steer": {
|
|
875
|
-
$post: {
|
|
891
|
+
} | {
|
|
876
892
|
output: {
|
|
877
893
|
workerId: string;
|
|
878
894
|
state: "delivered" | "queued";
|
|
@@ -888,7 +904,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
888
904
|
text: string;
|
|
889
905
|
};
|
|
890
906
|
};
|
|
891
|
-
}
|
|
907
|
+
};
|
|
908
|
+
};
|
|
909
|
+
} & {
|
|
910
|
+
"/:workerId/stop": {
|
|
911
|
+
$post: {
|
|
892
912
|
output: {
|
|
893
913
|
error: string;
|
|
894
914
|
code?: "invalid_input" | undefined;
|
|
@@ -900,15 +920,9 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
900
920
|
workerId: string;
|
|
901
921
|
};
|
|
902
922
|
} & {
|
|
903
|
-
json:
|
|
904
|
-
text: string;
|
|
905
|
-
};
|
|
923
|
+
json: Record<string, never>;
|
|
906
924
|
};
|
|
907
|
-
}
|
|
908
|
-
};
|
|
909
|
-
} & {
|
|
910
|
-
"/:workerId/stop": {
|
|
911
|
-
$post: {
|
|
925
|
+
} | {
|
|
912
926
|
output: {
|
|
913
927
|
workerId: string;
|
|
914
928
|
state: "stopping" | "terminated";
|
|
@@ -922,7 +936,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
922
936
|
} & {
|
|
923
937
|
json: Record<string, never>;
|
|
924
938
|
};
|
|
925
|
-
}
|
|
939
|
+
};
|
|
940
|
+
};
|
|
941
|
+
} & {
|
|
942
|
+
"/:workerId/destroy": {
|
|
943
|
+
$post: {
|
|
926
944
|
output: {
|
|
927
945
|
error: string;
|
|
928
946
|
code?: "invalid_input" | undefined;
|
|
@@ -934,13 +952,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
934
952
|
workerId: string;
|
|
935
953
|
};
|
|
936
954
|
} & {
|
|
937
|
-
json:
|
|
955
|
+
json: {
|
|
956
|
+
discardWork?: true | undefined;
|
|
957
|
+
};
|
|
938
958
|
};
|
|
939
|
-
}
|
|
940
|
-
};
|
|
941
|
-
} & {
|
|
942
|
-
"/:workerId/destroy": {
|
|
943
|
-
$post: {
|
|
959
|
+
} | {
|
|
944
960
|
output: {
|
|
945
961
|
workerId: string;
|
|
946
962
|
state: "complete" | "incomplete";
|
|
@@ -969,22 +985,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
969
985
|
discardWork?: true | undefined;
|
|
970
986
|
};
|
|
971
987
|
};
|
|
972
|
-
} | {
|
|
973
|
-
output: {
|
|
974
|
-
error: string;
|
|
975
|
-
code?: "invalid_input" | undefined;
|
|
976
|
-
};
|
|
977
|
-
outputFormat: "json";
|
|
978
|
-
status: 400;
|
|
979
|
-
input: {
|
|
980
|
-
param: {
|
|
981
|
-
workerId: string;
|
|
982
|
-
};
|
|
983
|
-
} & {
|
|
984
|
-
json: {
|
|
985
|
-
discardWork?: true | undefined;
|
|
986
|
-
};
|
|
987
|
-
};
|
|
988
988
|
} | {
|
|
989
989
|
output: {
|
|
990
990
|
workerId: string;
|
|
@@ -1020,13 +1020,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
1020
1020
|
"/:workerId/diff": {
|
|
1021
1021
|
$get: {
|
|
1022
1022
|
output: {
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
diff: string;
|
|
1026
|
-
truncated: boolean;
|
|
1023
|
+
error: string;
|
|
1024
|
+
code?: "invalid_input" | undefined;
|
|
1027
1025
|
};
|
|
1028
1026
|
outputFormat: "json";
|
|
1029
|
-
status:
|
|
1027
|
+
status: 400;
|
|
1030
1028
|
input: {
|
|
1031
1029
|
param: {
|
|
1032
1030
|
workerId: string;
|
|
@@ -1034,11 +1032,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
1034
1032
|
};
|
|
1035
1033
|
} | {
|
|
1036
1034
|
output: {
|
|
1037
|
-
|
|
1038
|
-
|
|
1035
|
+
workerId: string;
|
|
1036
|
+
baselineSha: string;
|
|
1037
|
+
diff: string;
|
|
1038
|
+
truncated: boolean;
|
|
1039
1039
|
};
|
|
1040
1040
|
outputFormat: "json";
|
|
1041
|
-
status:
|
|
1041
|
+
status: 200;
|
|
1042
1042
|
input: {
|
|
1043
1043
|
param: {
|
|
1044
1044
|
workerId: string;
|
|
@@ -10,6 +10,7 @@ import { CLAUDE_CLI } from './cli.js';
|
|
|
10
10
|
import { CLAUDE_LOGIN } from './login.js';
|
|
11
11
|
import { CLAUDE_ACCOUNTS } from './accounts.js';
|
|
12
12
|
import { CLAUDE_ENV } from './env.js';
|
|
13
|
+
import { CLAUDE_MOCK } from './mock.js';
|
|
13
14
|
/** The Claude runner. */
|
|
14
15
|
export const claudeRunner = defineRunner({
|
|
15
16
|
id: 'claude',
|
|
@@ -29,6 +30,7 @@ export const claudeRunner = defineRunner({
|
|
|
29
30
|
login: { ...CLAUDE_LOGIN, executable: () => productEnv('CLAUDE_BIN') ?? 'claude' },
|
|
30
31
|
accounts: CLAUDE_ACCOUNTS,
|
|
31
32
|
env: CLAUDE_ENV,
|
|
33
|
+
mock: CLAUDE_MOCK,
|
|
32
34
|
loadLogin: async () => ({ parse: (await import('./login-probe.js')).parseClaudeStatus }),
|
|
33
35
|
});
|
|
34
36
|
//# sourceMappingURL=definition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../src/runners/claude/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../src/runners/claude/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC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,CAAC,CAAC,CAAC,oBAAoB;IAC9F,WAAW,EAAE,mBAAmB;IAChC,UAAU,EAAE,kBAAkB;IAC9B,KAAK,EAAE,EAAE,GAAG,YAAY,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,QAAQ,EAAE;IAClF,QAAQ,EAAE,eAAe;IACzB,GAAG,EAAE,UAAU;IACf,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;CACzF,CAAC,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** The claude runner's native mock and its scenario adapter (the `mock` part). Data only. */
|
|
2
|
+
export declare const CLAUDE_MOCK: {
|
|
3
|
+
readonly askResumeCases: readonly [{
|
|
4
|
+
readonly kind: 'cezar_ask';
|
|
5
|
+
readonly scenario: 'ask-resume';
|
|
6
|
+
readonly answer: 'Library: Vitest';
|
|
7
|
+
}];
|
|
8
|
+
readonly binEnv: 'CEZ_CLAUDE_BIN';
|
|
9
|
+
readonly script: 'mock-claude.mjs';
|
|
10
|
+
readonly scenarios: {
|
|
11
|
+
readonly 'input-closed-live': 'mock:no-progress-input-closed';
|
|
12
|
+
readonly 'multi-pr-refs': 'mock:multi-pr-refs';
|
|
13
|
+
readonly 'turn-messages': 'mock:turn-messages';
|
|
14
|
+
readonly 'missing-binary': "inspect the working tree";
|
|
15
|
+
readonly autonomous: 'mock:autonomous';
|
|
16
|
+
readonly 'autonomous-cap': 'mock:autonomous-cap';
|
|
17
|
+
readonly 'autonomous-silent': 'mock:autonomous-silent';
|
|
18
|
+
readonly 'autonomous-cezar-ask-cap': 'mock:autonomous-cezar-ask-cap';
|
|
19
|
+
readonly 'silent-tail': 'mock:silent-tail';
|
|
20
|
+
readonly 'silent-tail-no-reply': 'mock:silent-tail-no-reply';
|
|
21
|
+
readonly 'silent-tail-late-reply': 'mock:silent-tail-late-reply';
|
|
22
|
+
readonly 'silent-tail-slow-done': 'mock:silent-tail-slow-done';
|
|
23
|
+
readonly baseline: "inspect the working tree";
|
|
24
|
+
readonly 'no-progress-ack-only': "inspect the working tree";
|
|
25
|
+
readonly 'crash-stderr-pre-ack': 'mock:crash-stderr-pre-ack';
|
|
26
|
+
readonly 'crash-stderr-held-pipe': 'mock:crash-stderr-held-pipe';
|
|
27
|
+
readonly 'shutdown-stderr': 'mock:crash-stderr-clean';
|
|
28
|
+
readonly 'crash-stderr': 'mock:crash-stderr';
|
|
29
|
+
readonly 'crash-stderr-single': 'mock:crash-stderr-single';
|
|
30
|
+
readonly 'cezar-done': 'mock:cezar-done';
|
|
31
|
+
readonly hold: 'mock:hold';
|
|
32
|
+
readonly 'hold-gated': 'mock:hold-gated';
|
|
33
|
+
readonly 'hold-cezar-done': 'mock:hold-cezar-done';
|
|
34
|
+
readonly 'hold-cezar-ask': 'mock:hold-cezar-ask';
|
|
35
|
+
readonly 'no-progress': 'mock:no-progress';
|
|
36
|
+
readonly 'no-progress-ignore-term': 'mock:no-progress-ignore-term';
|
|
37
|
+
readonly 'no-progress-held-pipe': 'mock:no-progress-held-pipe';
|
|
38
|
+
readonly 'no-progress-leftover': 'mock:no-progress-leftover';
|
|
39
|
+
readonly 'busy-progress': 'mock:busy-progress';
|
|
40
|
+
readonly 'provider-rate-limit': 'mock:provider-rate-limit';
|
|
41
|
+
readonly 'provider-not-found': 'mock:provider-not-found';
|
|
42
|
+
readonly 'provider-credit': 'mock:provider-credit';
|
|
43
|
+
readonly 'steer-tool': 'mock:steer-tool';
|
|
44
|
+
readonly ask: 'mock:cezar-ask';
|
|
45
|
+
readonly 'ask-resume': 'mock:cezar-ask mock:resume-cezar-done';
|
|
46
|
+
readonly 'ask-reply-late': 'mock:cezar-ask';
|
|
47
|
+
readonly 'provider-error': 'mock:request-error';
|
|
48
|
+
readonly 'provider-error-controlled': 'mock:auth-error';
|
|
49
|
+
readonly 'provider-unavailable': 'mock:provider-unavailable';
|
|
50
|
+
readonly 'post-success-refusal': 'mock:model-refusal:always';
|
|
51
|
+
readonly subagent: 'mock:subagents';
|
|
52
|
+
readonly 'subagent-after-park': 'mock:subagent-after-park';
|
|
53
|
+
readonly 'forked-skill': 'mock:forked-skill';
|
|
54
|
+
readonly 'hook-after-park': 'mock:hook-after-park';
|
|
55
|
+
readonly 'steer-late': 'mock:hold';
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { COMMON_MOCK_SCENARIOS, STDIO_ASK_MOCK_SCENARIOS } from '../mock-prompts.js';
|
|
2
|
+
/** The claude runner's native mock and its scenario adapter (the `mock` part). Data only. */
|
|
3
|
+
export const CLAUDE_MOCK = {
|
|
4
|
+
askResumeCases: [{ kind: 'cezar_ask', scenario: 'ask-resume', answer: 'Library: Vitest' }],
|
|
5
|
+
binEnv: 'CEZ_CLAUDE_BIN',
|
|
6
|
+
script: 'mock-claude.mjs',
|
|
7
|
+
scenarios: {
|
|
8
|
+
...COMMON_MOCK_SCENARIOS,
|
|
9
|
+
...STDIO_ASK_MOCK_SCENARIOS,
|
|
10
|
+
// `mock:auth-error` is a gated failure-control prompt; the control's provider failure is a 400.
|
|
11
|
+
'provider-error': 'mock:request-error',
|
|
12
|
+
'provider-error-controlled': 'mock:auth-error',
|
|
13
|
+
'provider-unavailable': 'mock:provider-unavailable',
|
|
14
|
+
'post-success-refusal': 'mock:model-refusal:always',
|
|
15
|
+
subagent: 'mock:subagents',
|
|
16
|
+
'subagent-after-park': 'mock:subagent-after-park',
|
|
17
|
+
'forked-skill': 'mock:forked-skill',
|
|
18
|
+
'hook-after-park': 'mock:hook-after-park',
|
|
19
|
+
// A line written after the last model call runs as the CLI's next queued turn.
|
|
20
|
+
'steer-late': 'mock:hold',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=mock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock.js","sourceRoot":"","sources":["../../../src/runners/claude/mock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAErF,6FAA6F;AAC7F,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,cAAc,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC1F,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,iBAAiB;IACzB,SAAS,EAAE;QACT,GAAG,qBAAqB;QACxB,GAAG,wBAAwB;QAC3B,gGAAgG;QAChG,gBAAgB,EAAE,oBAAoB;QACtC,2BAA2B,EAAE,iBAAiB;QAC9C,sBAAsB,EAAE,2BAA2B;QACnD,sBAAsB,EAAE,2BAA2B;QACnD,QAAQ,EAAE,gBAAgB;QAC1B,qBAAqB,EAAE,0BAA0B;QACjD,cAAc,EAAE,mBAAmB;QACnC,iBAAiB,EAAE,sBAAsB;QACzC,+EAA+E;QAC/E,YAAY,EAAE,WAAW;KAC1B;CAC4B,CAAC"}
|
|
@@ -10,6 +10,7 @@ import { CODEX_CLI } from './cli.js';
|
|
|
10
10
|
import { CODEX_LOGIN } from './login.js';
|
|
11
11
|
import { CODEX_ACCOUNTS } from './accounts.js';
|
|
12
12
|
import { CODEX_ENV } from './env.js';
|
|
13
|
+
import { CODEX_MOCK } from './mock.js';
|
|
13
14
|
/** The Codex runner. */
|
|
14
15
|
export const codexRunner = defineRunner({
|
|
15
16
|
id: 'codex',
|
|
@@ -29,6 +30,7 @@ export const codexRunner = defineRunner({
|
|
|
29
30
|
login: { ...CODEX_LOGIN, executable: () => productEnv('CODEX_BIN') ?? 'codex' },
|
|
30
31
|
accounts: CODEX_ACCOUNTS,
|
|
31
32
|
env: CODEX_ENV,
|
|
33
|
+
mock: CODEX_MOCK,
|
|
32
34
|
loadLogin: async () => ({ parse: (await import('./login-probe.js')).parseCodexStatus }),
|
|
33
35
|
});
|
|
34
36
|
//# sourceMappingURL=definition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../src/runners/codex/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../src/runners/codex/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAA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AC,CAAC,EAAE,KAAK,EAAE,CAAC,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;CACxF,CAAC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** The codex runner's native mock and its scenario adapter (the `mock` part). Data only. */
|
|
2
|
+
export declare const CODEX_MOCK: {
|
|
3
|
+
readonly askResumeCases: readonly [{
|
|
4
|
+
readonly kind: 'item/tool/requestUserInput';
|
|
5
|
+
readonly scenario: 'ask-resume';
|
|
6
|
+
readonly answer: 'Library: Vitest';
|
|
7
|
+
}];
|
|
8
|
+
readonly binEnv: 'CEZ_CODEX_BIN';
|
|
9
|
+
readonly script: 'mock-codex-app-server.mjs';
|
|
10
|
+
readonly approvalDecisions: readonly [{
|
|
11
|
+
readonly pick: 'decline';
|
|
12
|
+
readonly echo: 'Approval response: {"decision":"decline"}';
|
|
13
|
+
}, {
|
|
14
|
+
readonly pick: 'cancel';
|
|
15
|
+
readonly echo: 'Approval response: {"decision":"cancel"}';
|
|
16
|
+
}];
|
|
17
|
+
readonly malformedApprovalEcho: 'Approval error: -32602';
|
|
18
|
+
readonly scenarios: {
|
|
19
|
+
readonly 'input-closed-live': 'mock:no-progress-input-closed';
|
|
20
|
+
readonly 'multi-pr-refs': 'mock:multi-pr-refs';
|
|
21
|
+
readonly 'turn-messages': 'mock:turn-messages';
|
|
22
|
+
readonly 'missing-binary': "inspect the working tree";
|
|
23
|
+
readonly autonomous: 'mock:autonomous';
|
|
24
|
+
readonly 'autonomous-cap': 'mock:autonomous-cap';
|
|
25
|
+
readonly 'autonomous-silent': 'mock:autonomous-silent';
|
|
26
|
+
readonly 'autonomous-cezar-ask-cap': 'mock:autonomous-cezar-ask-cap';
|
|
27
|
+
readonly 'silent-tail': 'mock:silent-tail';
|
|
28
|
+
readonly 'silent-tail-no-reply': 'mock:silent-tail-no-reply';
|
|
29
|
+
readonly 'silent-tail-late-reply': 'mock:silent-tail-late-reply';
|
|
30
|
+
readonly 'silent-tail-slow-done': 'mock:silent-tail-slow-done';
|
|
31
|
+
readonly baseline: "inspect the working tree";
|
|
32
|
+
readonly 'no-progress-ack-only': "inspect the working tree";
|
|
33
|
+
readonly 'crash-stderr-pre-ack': 'mock:crash-stderr-pre-ack';
|
|
34
|
+
readonly 'crash-stderr-held-pipe': 'mock:crash-stderr-held-pipe';
|
|
35
|
+
readonly 'shutdown-stderr': 'mock:crash-stderr-clean';
|
|
36
|
+
readonly 'crash-stderr': 'mock:crash-stderr';
|
|
37
|
+
readonly 'crash-stderr-single': 'mock:crash-stderr-single';
|
|
38
|
+
readonly 'cezar-done': 'mock:cezar-done';
|
|
39
|
+
readonly hold: 'mock:hold';
|
|
40
|
+
readonly 'hold-gated': 'mock:hold-gated';
|
|
41
|
+
readonly 'hold-cezar-done': 'mock:hold-cezar-done';
|
|
42
|
+
readonly 'hold-cezar-ask': 'mock:hold-cezar-ask';
|
|
43
|
+
readonly 'no-progress': 'mock:no-progress';
|
|
44
|
+
readonly 'no-progress-ignore-term': 'mock:no-progress-ignore-term';
|
|
45
|
+
readonly 'no-progress-held-pipe': 'mock:no-progress-held-pipe';
|
|
46
|
+
readonly 'no-progress-leftover': 'mock:no-progress-leftover';
|
|
47
|
+
readonly 'busy-progress': 'mock:busy-progress';
|
|
48
|
+
readonly 'provider-rate-limit': 'mock:provider-rate-limit';
|
|
49
|
+
readonly 'provider-not-found': 'mock:provider-not-found';
|
|
50
|
+
readonly 'provider-credit': 'mock:provider-credit';
|
|
51
|
+
readonly 'steer-tool': 'mock:steer-tool';
|
|
52
|
+
readonly 'provider-error': 'mock:provider-error';
|
|
53
|
+
readonly 'provider-error-controlled': 'mock:provider-error';
|
|
54
|
+
readonly 'post-success-refusal': 'mock:provider-error';
|
|
55
|
+
readonly 'steer-late': 'mock:steer-late';
|
|
56
|
+
readonly approval: 'mock:approval';
|
|
57
|
+
readonly 'approval-resolved': 'mock:approval-resolved';
|
|
58
|
+
readonly 'approval-turn-end': 'mock:approval-turn-end';
|
|
59
|
+
readonly 'ask-bad': 'mock:ask-bad';
|
|
60
|
+
readonly 'approval-malformed': 'mock:approval-malformed';
|
|
61
|
+
readonly 'mcp-approval': 'mock:mcp-approval';
|
|
62
|
+
readonly 'silent-tail-late-turn-start': 'mock:silent-tail-late-turn-start';
|
|
63
|
+
readonly 'provider-unavailable': 'mock:stream-retry';
|
|
64
|
+
readonly ask: 'mock:native-codex-ask';
|
|
65
|
+
readonly 'ask-resume': 'mock:native-codex-ask mock:resume-cezar-done';
|
|
66
|
+
readonly 'ask-reply-late': 'mock:native-codex-ask';
|
|
67
|
+
readonly subagent: 'mock:child-turn';
|
|
68
|
+
readonly 'subagent-after-park': 'mock:subagent-after-park';
|
|
69
|
+
readonly 'hook-after-park': 'mock:hook-after-park';
|
|
70
|
+
};
|
|
71
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { COMMON_MOCK_SCENARIOS, PROVIDER_ERROR_MOCK_SCENARIOS, NATIVE_APPROVAL_MOCK_SCENARIOS } from '../mock-prompts.js';
|
|
2
|
+
/** The codex runner's native mock and its scenario adapter (the `mock` part). Data only. */
|
|
3
|
+
export const CODEX_MOCK = {
|
|
4
|
+
askResumeCases: [{ kind: 'item/tool/requestUserInput', scenario: 'ask-resume', answer: 'Library: Vitest' }],
|
|
5
|
+
binEnv: 'CEZ_CODEX_BIN',
|
|
6
|
+
script: 'mock-codex-app-server.mjs',
|
|
7
|
+
approvalDecisions: [
|
|
8
|
+
{ pick: 'decline', echo: 'Approval response: {"decision":"decline"}' },
|
|
9
|
+
{ pick: 'cancel', echo: 'Approval response: {"decision":"cancel"}' },
|
|
10
|
+
],
|
|
11
|
+
malformedApprovalEcho: 'Approval error: -32602',
|
|
12
|
+
scenarios: {
|
|
13
|
+
...COMMON_MOCK_SCENARIOS,
|
|
14
|
+
...PROVIDER_ERROR_MOCK_SCENARIOS,
|
|
15
|
+
...NATIVE_APPROVAL_MOCK_SCENARIOS,
|
|
16
|
+
'approval-malformed': 'mock:approval-malformed',
|
|
17
|
+
'mcp-approval': 'mock:mcp-approval',
|
|
18
|
+
'silent-tail-late-turn-start': 'mock:silent-tail-late-turn-start',
|
|
19
|
+
'provider-unavailable': 'mock:stream-retry',
|
|
20
|
+
ask: 'mock:native-codex-ask',
|
|
21
|
+
'ask-resume': 'mock:native-codex-ask mock:resume-cezar-done',
|
|
22
|
+
'ask-reply-late': 'mock:native-codex-ask',
|
|
23
|
+
// #600's repro: a child thread's own turn/completed must not end the parent.
|
|
24
|
+
subagent: 'mock:child-turn',
|
|
25
|
+
'subagent-after-park': 'mock:subagent-after-park',
|
|
26
|
+
'hook-after-park': 'mock:hook-after-park',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=mock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock.js","sourceRoot":"","sources":["../../../src/runners/codex/mock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAE1H,4FAA4F;AAC5F,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,cAAc,EAAE,CAAC,EAAE,IAAI,EAAE,4BAA4B,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC3G,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,2BAA2B;IACnC,iBAAiB,EAAE;QACjB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,2CAA2C,EAAE;QACtE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,0CAA0C,EAAE;KACrE;IACD,qBAAqB,EAAE,wBAAwB;IAC/C,SAAS,EAAE;QACT,GAAG,qBAAqB;QACxB,GAAG,6BAA6B;QAChC,GAAG,8BAA8B;QACjC,oBAAoB,EAAE,yBAAyB;QAC/C,cAAc,EAAE,mBAAmB;QACnC,6BAA6B,EAAE,kCAAkC;QACjE,sBAAsB,EAAE,mBAAmB;QAC3C,GAAG,EAAE,uBAAuB;QAC5B,YAAY,EAAE,8CAA8C;QAC5D,gBAAgB,EAAE,uBAAuB;QACzC,6EAA6E;QAC7E,QAAQ,EAAE,iBAAiB;QAC3B,qBAAqB,EAAE,0BAA0B;QACjD,iBAAiB,EAAE,sBAAsB;KAC1C;CAC4B,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt text shared by the runners' `mock.ts` files (the `mock` part of a definition). Data only:
|
|
3
|
+
* a definition module imports no test code. Each table holds the scenarios that exactly the named
|
|
4
|
+
* runners answer with the same prompt; a runner's own `mock.ts` lists the rest.
|
|
5
|
+
*/
|
|
6
|
+
/** No marker: every mock's default branch answers this with its scripted turn. */
|
|
7
|
+
export declare const MOCK_BASELINE_PROMPT = "inspect the working tree";
|
|
8
|
+
/** Every runner answers these scenarios with the same prompt. */
|
|
9
|
+
export declare const COMMON_MOCK_SCENARIOS: {
|
|
10
|
+
readonly 'input-closed-live': 'mock:no-progress-input-closed';
|
|
11
|
+
readonly 'multi-pr-refs': 'mock:multi-pr-refs';
|
|
12
|
+
readonly 'turn-messages': 'mock:turn-messages';
|
|
13
|
+
readonly 'missing-binary': "inspect the working tree";
|
|
14
|
+
readonly autonomous: 'mock:autonomous';
|
|
15
|
+
readonly 'autonomous-cap': 'mock:autonomous-cap';
|
|
16
|
+
readonly 'autonomous-silent': 'mock:autonomous-silent';
|
|
17
|
+
readonly 'autonomous-cezar-ask-cap': 'mock:autonomous-cezar-ask-cap';
|
|
18
|
+
readonly 'silent-tail': 'mock:silent-tail';
|
|
19
|
+
readonly 'silent-tail-no-reply': 'mock:silent-tail-no-reply';
|
|
20
|
+
readonly 'silent-tail-late-reply': 'mock:silent-tail-late-reply';
|
|
21
|
+
readonly 'silent-tail-slow-done': 'mock:silent-tail-slow-done';
|
|
22
|
+
readonly baseline: "inspect the working tree";
|
|
23
|
+
readonly 'no-progress-ack-only': "inspect the working tree";
|
|
24
|
+
readonly 'crash-stderr-pre-ack': 'mock:crash-stderr-pre-ack';
|
|
25
|
+
readonly 'crash-stderr-held-pipe': 'mock:crash-stderr-held-pipe';
|
|
26
|
+
readonly 'shutdown-stderr': 'mock:crash-stderr-clean';
|
|
27
|
+
readonly 'crash-stderr': 'mock:crash-stderr';
|
|
28
|
+
readonly 'crash-stderr-single': 'mock:crash-stderr-single';
|
|
29
|
+
readonly 'cezar-done': 'mock:cezar-done';
|
|
30
|
+
readonly hold: 'mock:hold';
|
|
31
|
+
readonly 'hold-gated': 'mock:hold-gated';
|
|
32
|
+
readonly 'hold-cezar-done': 'mock:hold-cezar-done';
|
|
33
|
+
readonly 'hold-cezar-ask': 'mock:hold-cezar-ask';
|
|
34
|
+
readonly 'no-progress': 'mock:no-progress';
|
|
35
|
+
readonly 'no-progress-ignore-term': 'mock:no-progress-ignore-term';
|
|
36
|
+
readonly 'no-progress-held-pipe': 'mock:no-progress-held-pipe';
|
|
37
|
+
readonly 'no-progress-leftover': 'mock:no-progress-leftover';
|
|
38
|
+
readonly 'busy-progress': 'mock:busy-progress';
|
|
39
|
+
readonly 'provider-rate-limit': 'mock:provider-rate-limit';
|
|
40
|
+
readonly 'provider-not-found': 'mock:provider-not-found';
|
|
41
|
+
readonly 'provider-credit': 'mock:provider-credit';
|
|
42
|
+
readonly 'steer-tool': 'mock:steer-tool';
|
|
43
|
+
};
|
|
44
|
+
/** The runners whose ask crosses the `cezar_ask` tool on a stdio wire. */
|
|
45
|
+
export declare const STDIO_ASK_MOCK_SCENARIOS: {
|
|
46
|
+
readonly ask: 'mock:cezar-ask';
|
|
47
|
+
readonly 'ask-resume': 'mock:cezar-ask mock:resume-cezar-done';
|
|
48
|
+
readonly 'ask-reply-late': 'mock:cezar-ask';
|
|
49
|
+
};
|
|
50
|
+
/** The runners that reject a request with a provider error frame. */
|
|
51
|
+
export declare const PROVIDER_ERROR_MOCK_SCENARIOS: {
|
|
52
|
+
readonly 'provider-error': 'mock:provider-error';
|
|
53
|
+
readonly 'provider-error-controlled': 'mock:provider-error';
|
|
54
|
+
readonly 'post-success-refusal': 'mock:provider-error';
|
|
55
|
+
readonly 'steer-late': 'mock:steer-late';
|
|
56
|
+
};
|
|
57
|
+
/** The runners with a native approval wire. */
|
|
58
|
+
export declare const NATIVE_APPROVAL_MOCK_SCENARIOS: {
|
|
59
|
+
readonly approval: 'mock:approval';
|
|
60
|
+
readonly 'approval-resolved': 'mock:approval-resolved';
|
|
61
|
+
readonly 'approval-turn-end': 'mock:approval-turn-end';
|
|
62
|
+
readonly 'ask-bad': 'mock:ask-bad';
|
|
63
|
+
};
|