@claudexor/cli 3.1.2 → 3.2.1
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/about-command.d.ts.map +1 -1
- package/dist/accounts-projection.d.ts +8 -1
- package/dist/accounts-projection.d.ts.map +1 -1
- package/dist/accounts-projection.js +34 -20
- package/dist/accounts-projection.js.map +1 -1
- package/dist/accounts-services.d.ts +207 -0
- package/dist/accounts-services.d.ts.map +1 -0
- package/dist/accounts-services.js +71 -0
- package/dist/accounts-services.js.map +1 -0
- package/dist/acp-surface-runner.d.ts +39 -0
- package/dist/acp-surface-runner.d.ts.map +1 -1
- package/dist/acp-surface-runner.js +104 -30
- package/dist/acp-surface-runner.js.map +1 -1
- package/dist/attachment-upload.d.ts +5 -0
- package/dist/attachment-upload.d.ts.map +1 -0
- package/dist/attachment-upload.js +64 -0
- package/dist/attachment-upload.js.map +1 -0
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +6 -1
- package/dist/capabilities.js.map +1 -1
- package/dist/choice-input.d.ts +7 -0
- package/dist/choice-input.d.ts.map +1 -0
- package/dist/choice-input.js +17 -0
- package/dist/choice-input.js.map +1 -0
- package/dist/claude-oauth-usage.d.ts.map +1 -1
- package/dist/claude-oauth-usage.js +5 -2
- package/dist/claude-oauth-usage.js.map +1 -1
- package/dist/claudexord-entry.js.map +1 -1
- package/dist/claudexord.d.ts +1 -13
- package/dist/claudexord.d.ts.map +1 -1
- package/dist/claudexord.js +45 -69
- package/dist/claudexord.js.map +1 -1
- package/dist/cli-error.d.ts.map +1 -1
- package/dist/cli-error.js +21 -11
- package/dist/cli-error.js.map +1 -1
- package/dist/cli.js +143 -163
- package/dist/cli.js.map +1 -1
- package/dist/codex-device-login.js.map +1 -1
- package/dist/codex-quota-source.js.map +1 -1
- package/dist/command-flags.d.ts +16 -1
- package/dist/command-flags.d.ts.map +1 -1
- package/dist/command-flags.js +41 -19
- package/dist/command-flags.js.map +1 -1
- package/dist/command-registry.d.ts +21 -8
- package/dist/command-registry.d.ts.map +1 -1
- package/dist/command-registry.js +59 -116
- package/dist/command-registry.js.map +1 -1
- package/dist/command-scope.d.ts +13 -0
- package/dist/command-scope.d.ts.map +1 -0
- package/dist/command-scope.js +61 -0
- package/dist/command-scope.js.map +1 -0
- package/dist/control-services.d.ts +1637 -1003
- package/dist/control-services.d.ts.map +1 -1
- package/dist/control-services.js +38 -65
- package/dist/control-services.js.map +1 -1
- package/dist/credential-commands.d.ts.map +1 -1
- package/dist/credential-commands.js +13 -3
- package/dist/credential-commands.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-outcome.d.ts +3 -5
- package/dist/daemon-outcome.d.ts.map +1 -1
- package/dist/daemon-outcome.js +7 -19
- package/dist/daemon-outcome.js.map +1 -1
- package/dist/daemon-run.d.ts +21 -12
- package/dist/daemon-run.d.ts.map +1 -1
- package/dist/daemon-run.js +59 -40
- package/dist/daemon-run.js.map +1 -1
- package/dist/daemon-runtime-shutdown.d.ts +7 -0
- package/dist/daemon-runtime-shutdown.d.ts.map +1 -1
- package/dist/daemon-runtime-shutdown.js +29 -0
- package/dist/daemon-runtime-shutdown.js.map +1 -1
- package/dist/delegation-belt-descriptor.js.map +1 -1
- package/dist/delegation-output.d.ts +2 -0
- package/dist/delegation-output.d.ts.map +1 -1
- package/dist/delegation-output.js +3 -1
- package/dist/delegation-output.js.map +1 -1
- package/dist/harness-command.d.ts +13 -0
- package/dist/harness-command.d.ts.map +1 -0
- package/dist/harness-command.js +35 -0
- package/dist/harness-command.js.map +1 -0
- package/dist/harness-installer.d.ts +79 -0
- package/dist/harness-installer.d.ts.map +1 -0
- package/dist/harness-installer.js +256 -0
- package/dist/harness-installer.js.map +1 -0
- package/dist/interaction-prompt.d.ts +19 -0
- package/dist/interaction-prompt.d.ts.map +1 -0
- package/dist/interaction-prompt.js +114 -0
- package/dist/interaction-prompt.js.map +1 -0
- package/dist/live.d.ts +2 -6
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +88 -75
- package/dist/live.js.map +1 -1
- package/dist/mcp-daemon-unavailable.d.ts +6 -0
- package/dist/mcp-daemon-unavailable.d.ts.map +1 -0
- package/dist/mcp-daemon-unavailable.js +16 -0
- package/dist/mcp-daemon-unavailable.js.map +1 -0
- package/dist/mcp-run-projections.d.ts +29 -0
- package/dist/mcp-run-projections.d.ts.map +1 -1
- package/dist/mcp-run-projections.js +17 -17
- package/dist/mcp-run-projections.js.map +1 -1
- package/dist/mcp-runner.d.ts.map +1 -1
- package/dist/mcp-runner.js +81 -39
- package/dist/mcp-runner.js.map +1 -1
- package/dist/native-login.js.map +1 -1
- package/dist/ops-command-specs.d.ts +64 -0
- package/dist/ops-command-specs.d.ts.map +1 -0
- package/dist/ops-command-specs.js +146 -0
- package/dist/ops-command-specs.js.map +1 -0
- package/dist/ops-commands.d.ts.map +1 -1
- package/dist/ops-commands.js +23 -5
- package/dist/ops-commands.js.map +1 -1
- package/dist/orphan-reaper.js.map +1 -1
- package/dist/output-mode.d.ts +11 -0
- package/dist/output-mode.d.ts.map +1 -0
- package/dist/output-mode.js +28 -0
- package/dist/output-mode.js.map +1 -0
- package/dist/plan-question-loop.d.ts.map +1 -1
- package/dist/plan-question-loop.js +17 -13
- package/dist/plan-question-loop.js.map +1 -1
- package/dist/plugins.js +1 -1
- package/dist/plugins.js.map +1 -1
- package/dist/primary-output.d.ts +9 -4
- package/dist/primary-output.d.ts.map +1 -1
- package/dist/primary-output.js +50 -2
- package/dist/primary-output.js.map +1 -1
- package/dist/quota-subject-universe.d.ts +6 -0
- package/dist/quota-subject-universe.d.ts.map +1 -0
- package/dist/quota-subject-universe.js +31 -0
- package/dist/quota-subject-universe.js.map +1 -0
- package/dist/registry.d.ts +1 -1
- package/dist/registry.js +1 -1
- package/dist/registry.js.map +1 -1
- package/dist/release-command.d.ts +1 -1
- package/dist/release-command.js +2 -2
- package/dist/remote-command-specs.d.ts +45 -0
- package/dist/remote-command-specs.d.ts.map +1 -0
- package/dist/remote-command-specs.js +29 -0
- package/dist/remote-command-specs.js.map +1 -0
- package/dist/remote-command.d.ts +11 -0
- package/dist/remote-command.d.ts.map +1 -0
- package/dist/remote-command.js +262 -0
- package/dist/remote-command.js.map +1 -0
- package/dist/remote-filesystem.d.ts +33 -0
- package/dist/remote-filesystem.d.ts.map +1 -0
- package/dist/remote-filesystem.js +280 -0
- package/dist/remote-filesystem.js.map +1 -0
- package/dist/repo-asset-authority.js.map +1 -1
- package/dist/request-preflight.d.ts +11 -2
- package/dist/request-preflight.d.ts.map +1 -1
- package/dist/request-preflight.js +36 -13
- package/dist/request-preflight.js.map +1 -1
- package/dist/retention-service.d.ts.map +1 -1
- package/dist/retention-service.js +6 -1
- package/dist/retention-service.js.map +1 -1
- package/dist/retry-command-specs.d.ts.map +1 -1
- package/dist/retry-command-specs.js +2 -0
- package/dist/retry-command-specs.js.map +1 -1
- package/dist/run-applicability.d.ts +74 -0
- package/dist/run-applicability.d.ts.map +1 -0
- package/dist/run-applicability.js +72 -0
- package/dist/run-applicability.js.map +1 -0
- package/dist/run-detail-projections.d.ts +23 -0
- package/dist/run-detail-projections.d.ts.map +1 -1
- package/dist/run-detail-projections.js +32 -1
- package/dist/run-detail-projections.js.map +1 -1
- package/dist/run-detail-response.d.ts +7 -0
- package/dist/run-detail-response.d.ts.map +1 -0
- package/dist/run-detail-response.js +23 -0
- package/dist/run-detail-response.js.map +1 -0
- package/dist/run-facts-projection.d.ts +22 -0
- package/dist/run-facts-projection.d.ts.map +1 -0
- package/dist/run-facts-projection.js +86 -0
- package/dist/run-facts-projection.js.map +1 -0
- package/dist/runtime-replacement-stop.d.ts +25 -0
- package/dist/runtime-replacement-stop.d.ts.map +1 -0
- package/dist/runtime-replacement-stop.js +145 -0
- package/dist/runtime-replacement-stop.js.map +1 -0
- package/dist/settings-command.d.ts +1 -0
- package/dist/settings-command.d.ts.map +1 -1
- package/dist/settings-command.js +27 -21
- package/dist/settings-command.js.map +1 -1
- package/dist/settings-service.d.ts +7 -7
- package/dist/settings-service.d.ts.map +1 -1
- package/dist/settings-service.js +3 -3
- package/dist/settings-service.js.map +1 -1
- package/dist/setup-client-pty.d.ts +14 -0
- package/dist/setup-client-pty.d.ts.map +1 -0
- package/dist/setup-client-pty.js +61 -0
- package/dist/setup-client-pty.js.map +1 -0
- package/dist/setup-device-code-disclosure.d.ts +15 -0
- package/dist/setup-device-code-disclosure.d.ts.map +1 -0
- package/dist/setup-device-code-disclosure.js +52 -0
- package/dist/setup-device-code-disclosure.js.map +1 -0
- package/dist/setup-job-reducer.d.ts.map +1 -1
- package/dist/setup-job-reducer.js +1 -0
- package/dist/setup-job-reducer.js.map +1 -1
- package/dist/setup-job-store.d.ts +275 -75
- package/dist/setup-job-store.d.ts.map +1 -1
- package/dist/setup-job-store.js.map +1 -1
- package/dist/setup-job-support.js.map +1 -1
- package/dist/setup-jobs.d.ts +517 -137
- package/dist/setup-jobs.d.ts.map +1 -1
- package/dist/setup-jobs.js +68 -118
- package/dist/setup-jobs.js.map +1 -1
- package/dist/setup-lifecycle-binding.d.ts +7 -0
- package/dist/setup-lifecycle-binding.d.ts.map +1 -1
- package/dist/setup-lifecycle-binding.js +6 -0
- package/dist/setup-lifecycle-binding.js.map +1 -1
- package/dist/setup-login-child-lifecycle.d.ts +13 -0
- package/dist/setup-login-child-lifecycle.d.ts.map +1 -0
- package/dist/setup-login-child-lifecycle.js +45 -0
- package/dist/setup-login-child-lifecycle.js.map +1 -0
- package/dist/setup-login-inline.d.ts +11 -12
- package/dist/setup-login-inline.d.ts.map +1 -1
- package/dist/setup-login-inline.js +26 -15
- package/dist/setup-login-inline.js.map +1 -1
- package/dist/setup-login-permit.d.ts +10 -0
- package/dist/setup-login-permit.d.ts.map +1 -0
- package/dist/setup-login-permit.js +52 -0
- package/dist/setup-login-permit.js.map +1 -0
- package/dist/setup-login-protocol.d.ts.map +1 -1
- package/dist/setup-login-protocol.js +9 -2
- package/dist/setup-login-protocol.js.map +1 -1
- package/dist/setup-login-runner.d.ts +1 -0
- package/dist/setup-login-runner.d.ts.map +1 -1
- package/dist/setup-login-runner.js +20 -31
- package/dist/setup-login-runner.js.map +1 -1
- package/dist/setup-supervisor.d.ts.map +1 -1
- package/dist/setup-supervisor.js.map +1 -1
- package/dist/terminal-run-output.d.ts +12 -0
- package/dist/terminal-run-output.d.ts.map +1 -0
- package/dist/terminal-run-output.js +33 -0
- package/dist/terminal-run-output.js.map +1 -0
- package/dist/thread-execution-workspace.d.ts +15 -0
- package/dist/thread-execution-workspace.d.ts.map +1 -1
- package/dist/thread-execution-workspace.js +39 -5
- package/dist/thread-execution-workspace.js.map +1 -1
- package/dist/thread-turn-services.d.ts +107 -0
- package/dist/thread-turn-services.d.ts.map +1 -0
- package/dist/thread-turn-services.js +28 -0
- package/dist/thread-turn-services.js.map +1 -0
- package/package.json +23 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"about-command.d.ts","sourceRoot":"","sources":["../src/about-command.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qEAAqE;AACrE,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAC9C,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,aAAa,QAAQ,CAAC;AACnC,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"about-command.d.ts","sourceRoot":"","sources":["../src/about-command.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qEAAqE;AACrE,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAC9C,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,aAAa,QAAQ,CAAC;AACnC,eAAO,MAAM,WAAW;aACtB,QAAQ,EAAE,yBAAyB;aACnC,CAAC,EAAE,0BAA0B;aAC7B,UAAU,EAAE,sCAAsC;CAC1C,CAAC;AAEX,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;KAC7B,CAAC;CACH;AAED,qEAAqE;AACrE,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CASpD;AAED,6CAA6C;AAC7C,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAWnD"}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* + quota, so it can never disagree with run-time admission.
|
|
10
10
|
*/
|
|
11
11
|
import type { AccountIdentity, ControlHarnessAccounts, CredentialProfile, CredentialProfileStatus, QuotaSnapshot } from "@claudexor/schema";
|
|
12
|
+
import type { HarnessStatus } from "@claudexor/gateway";
|
|
12
13
|
/**
|
|
13
14
|
* Non-secret {email, plan} of a config_dir_login PROFILE, read daemon-side from
|
|
14
15
|
* the profile's OWN isolation-locator store (INV-067) — never the ordinary
|
|
@@ -22,5 +23,11 @@ export declare function profileAccountIdentity(profile: CredentialProfile): Acco
|
|
|
22
23
|
* Adapters without profile support report an honest unknown.
|
|
23
24
|
*/
|
|
24
25
|
export declare function profileDoctorStatus(profile: CredentialProfile): Promise<CredentialProfileStatus>;
|
|
25
|
-
export declare function harnessAccountsProjection(repoRoot: string, quotaSnapshots?: readonly QuotaSnapshot[]
|
|
26
|
+
export declare function harnessAccountsProjection(repoRoot: string, quotaSnapshots?: readonly QuotaSnapshot[], snapshot?: {
|
|
27
|
+
statuses?: readonly HarnessStatus[];
|
|
28
|
+
profiles?: readonly {
|
|
29
|
+
profile: CredentialProfile;
|
|
30
|
+
status: CredentialProfileStatus;
|
|
31
|
+
}[];
|
|
32
|
+
}): Promise<ControlHarnessAccounts[]>;
|
|
26
33
|
//# sourceMappingURL=accounts-projection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts-projection.d.ts","sourceRoot":"","sources":["../src/accounts-projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACvB,aAAa,EACd,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"accounts-projection.d.ts","sourceRoot":"","sources":["../src/accounts-projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACvB,aAAa,EACd,MAAM,mBAAmB,CAAC;AAS3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAiBxD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,eAAe,GAAG,IAAI,CAKzF;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,uBAAuB,CAAC,CAGlC;AAED,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,MAAM,EAChB,cAAc,GAAE,SAAS,aAAa,EAAO,EAC7C,QAAQ,CAAC,EAAE;IACT,QAAQ,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,SAAS;QAAE,OAAO,EAAE,iBAAiB,CAAC;QAAC,MAAM,EAAE,uBAAuB,CAAA;KAAE,EAAE,CAAC;CACvF,GACA,OAAO,CAAC,sBAAsB,EAAE,CAAC,CA+DnC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { loadConfig } from "@claudexor/config";
|
|
2
|
-
import { nextUpIdentity } from "@claudexor/orchestrator";
|
|
2
|
+
import { defaultCredentialRoute, effectiveAuthPreference, nextUpIdentity, probeCredentialProfileStatus, profileStatusAdmits, } from "@claudexor/orchestrator";
|
|
3
3
|
import { codexAccountIdentity, defaultNativeCodexHome } from "@claudexor/harness-codex";
|
|
4
4
|
import { claudeAccountIdentity, defaultNativeClaudeConfigDir } from "@claudexor/harness-claude";
|
|
5
5
|
import { buildGateway, buildRegistry } from "./registry.js";
|
|
@@ -38,34 +38,44 @@ export function profileAccountIdentity(profile) {
|
|
|
38
38
|
*/
|
|
39
39
|
export async function profileDoctorStatus(profile) {
|
|
40
40
|
const adapter = buildRegistry().get(profile.harness_id);
|
|
41
|
-
return adapter?.probeCredentialProfile
|
|
42
|
-
? adapter.probeCredentialProfile(profile)
|
|
43
|
-
: {
|
|
44
|
-
profile_id: profile.profile_id,
|
|
45
|
-
harness_id: profile.harness_id,
|
|
46
|
-
availability: "unknown",
|
|
47
|
-
verification: "not_run",
|
|
48
|
-
detail: `harness "${profile.harness_id}" has no profile probe`,
|
|
49
|
-
last_verified_at: null,
|
|
50
|
-
};
|
|
41
|
+
return probeCredentialProfileStatus(profile, adapter?.probeCredentialProfile?.bind(adapter));
|
|
51
42
|
}
|
|
52
|
-
export async function harnessAccountsProjection(repoRoot, quotaSnapshots = []) {
|
|
43
|
+
export async function harnessAccountsProjection(repoRoot, quotaSnapshots = [], snapshot) {
|
|
53
44
|
const cfg = loadConfig(repoRoot).global;
|
|
54
45
|
const harnessIds = [...buildRegistry({ includeFakes: false }).keys()].sort();
|
|
55
46
|
const nativeDetected = new Map();
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
let statuses = snapshot?.statuses ?? [];
|
|
48
|
+
if (!snapshot?.statuses) {
|
|
49
|
+
try {
|
|
50
|
+
statuses = await buildGateway({ includeFakes: false }).statusAll({ cwd: repoRoot, fresh: true }, harnessIds);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
statuses = [];
|
|
60
54
|
}
|
|
61
55
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
const defaultRoutes = new Map();
|
|
57
|
+
for (const s of statuses) {
|
|
58
|
+
const native = s.authSources.find((source) => source.source === "native_session");
|
|
59
|
+
const detected = native?.availability === "available";
|
|
60
|
+
nativeDetected.set(s.id, detected);
|
|
61
|
+
const harness = cfg.harnesses[s.id];
|
|
62
|
+
const route = defaultCredentialRoute(s, effectiveAuthPreference(harness?.auth_preference, cfg.routing.auth_preference));
|
|
63
|
+
if (route)
|
|
64
|
+
defaultRoutes.set(s.id, route);
|
|
65
|
+
}
|
|
66
|
+
const readyProfiles = new Map();
|
|
67
|
+
for (const entry of snapshot?.profiles ?? []) {
|
|
68
|
+
if (!entry.profile.enabled || !profileStatusAdmits(entry.profile, entry.status))
|
|
69
|
+
continue;
|
|
70
|
+
const ready = readyProfiles.get(entry.profile.harness_id) ?? new Set();
|
|
71
|
+
ready.add(entry.profile.profile_id);
|
|
72
|
+
readyProfiles.set(entry.profile.harness_id, ready);
|
|
65
73
|
}
|
|
66
74
|
return harnessIds.map((harnessId) => {
|
|
67
75
|
const h = cfg.harnesses[harnessId];
|
|
68
76
|
const nativeEnabled = h?.native_credentials_enabled ?? true;
|
|
77
|
+
const defaultEnabled = (h?.enabled ?? true) && nativeEnabled;
|
|
78
|
+
const defaultRoute = defaultRoutes.get(harnessId) ?? null;
|
|
69
79
|
return {
|
|
70
80
|
harness_id: harnessId,
|
|
71
81
|
native_credentials_enabled: nativeEnabled,
|
|
@@ -82,7 +92,11 @@ export async function harnessAccountsProjection(repoRoot, quotaSnapshots = []) {
|
|
|
82
92
|
headroom_threshold: 0.9,
|
|
83
93
|
},
|
|
84
94
|
snapshots: quotaSnapshots,
|
|
85
|
-
|
|
95
|
+
defaultEnabled,
|
|
96
|
+
defaultReady: defaultRoute !== null,
|
|
97
|
+
defaultRoute,
|
|
98
|
+
readyProfileIds: readyProfiles.get(harnessId) ?? new Set(),
|
|
99
|
+
model: h?.default_model ?? null,
|
|
86
100
|
}),
|
|
87
101
|
};
|
|
88
102
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts-projection.js","sourceRoot":"","sources":["../src/accounts-projection.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"accounts-projection.js","sourceRoot":"","sources":["../src/accounts-projection.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACd,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE5D;;;;;GAKG;AACH,SAAS,qBAAqB,CAAC,SAAiB;IAC9C,IAAI,SAAS,KAAK,OAAO;QAAE,OAAO,oBAAoB,CAAC,sBAAsB,EAAE,CAAC,CAAC;IACjF,IAAI,SAAS,KAAK,QAAQ;QAAE,OAAO,qBAAqB,CAAC,4BAA4B,EAAE,CAAC,CAAC;IACzF,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAA0B;IAC/D,IAAI,CAAC,OAAO,CAAC,iBAAiB;QAAE,OAAO,IAAI,CAAC;IAC5C,IAAI,OAAO,CAAC,UAAU,KAAK,OAAO;QAAE,OAAO,oBAAoB,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC3F,IAAI,OAAO,CAAC,UAAU,KAAK,QAAQ;QAAE,OAAO,qBAA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AA0B,IAAI,IAAI,CAAC;QAC5D,MAAM,cAAc,GAAG,CAAC,CAAC,EAAE,OAAO,IAAI,IAAI,CAAC,IAAI,aAAa,CAAC;QAC7D,MAAM,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC;QAC1D,OAAO;YACL,UAAU,EAAE,SAAS;YACrB,0BAA0B,EAAE,aAAa;YACzC,qBAAqB,EAAE,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,KAAK;YAC7D,QAAQ,EAAE,qBAAqB,CAAC,SAAS,CAAC;YAC1C,sEAAsE;YACtE,qDAAqD;YACrD,OAAO,EAAE,cAAc,CAAC;gBACtB,QAAQ,EAAE,GAAG,CAAC,mBAAmB;gBACjC,SAAS;gBACT,MAAM,EAAE,CAAC,EAAE,cAAc,IAAI;oBAC3B,YAAY,EAAE,MAAM;oBACpB,iBAAiB,EAAE,EAAE;oBACrB,kBAAkB,EAAE,GAAG;iBACxB;gBACD,SAAS,EAAE,cAAc;gBACzB,cAAc;gBACd,YAAY,EAAE,YAAY,KAAK,IAAI;gBACnC,YAAY;gBACZ,eAAe,EAAE,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,IAAI,GAAG,EAAE;gBAC1D,KAAK,EAAE,CAAC,EAAE,aAAa,IAAI,IAAI;aAChC,CAAC;SACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import type { QuotaRegistry } from "@claudexor/daemon";
|
|
2
|
+
import { type HarnessStatus } from "@claudexor/gateway";
|
|
3
|
+
export type HarnessListInput = {
|
|
4
|
+
fresh?: boolean;
|
|
5
|
+
includeFakes?: boolean;
|
|
6
|
+
harnessIds?: string[];
|
|
7
|
+
};
|
|
8
|
+
export declare function projectHarnessStatuses(statuses: readonly HarnessStatus[]): Promise<{
|
|
9
|
+
id: string;
|
|
10
|
+
available: boolean;
|
|
11
|
+
status: "ok" | "degraded" | "unavailable";
|
|
12
|
+
manifest: import("@claudexor/schema").HarnessManifest | null;
|
|
13
|
+
enabledIntents: import("@claudexor/schema").Intent[];
|
|
14
|
+
routableIntents: import("@claudexor/schema").Intent[];
|
|
15
|
+
disabledIntents: import("@claudexor/schema").Intent[];
|
|
16
|
+
checks: import("@claudexor/schema").ConformanceCheck[];
|
|
17
|
+
reasons: string[];
|
|
18
|
+
authSources: import("@claudexor/schema").AuthSourceReadiness[];
|
|
19
|
+
configuredModel: string | null;
|
|
20
|
+
configuredModelCheck: {
|
|
21
|
+
status: "ok" | "rejected";
|
|
22
|
+
message?: string | null;
|
|
23
|
+
} | null;
|
|
24
|
+
delegation: {
|
|
25
|
+
available: boolean;
|
|
26
|
+
reason: "manifest_unsupported" | "ready" | "runtime_unavailable";
|
|
27
|
+
remediation: string | null;
|
|
28
|
+
requiresFullAccess: boolean;
|
|
29
|
+
};
|
|
30
|
+
readiness: {
|
|
31
|
+
id: string;
|
|
32
|
+
kind: "auth" | "binary" | "model" | "probe" | "smoke";
|
|
33
|
+
title: string;
|
|
34
|
+
status: "fail" | "pass" | "skip";
|
|
35
|
+
detail: string | null;
|
|
36
|
+
}[];
|
|
37
|
+
}[]>;
|
|
38
|
+
/** One server-owned Accounts response builder. The opt-in form refreshes quota
|
|
39
|
+
* first and then derives next_up from that exact returned response; no client
|
|
40
|
+
* can accidentally pair a newer quota card with an older routing identity. */
|
|
41
|
+
export declare function createCredentialProfilesService(quotaRegistry: () => QuotaRegistry): (input?: {
|
|
42
|
+
snapshot?: boolean;
|
|
43
|
+
}) => Promise<{
|
|
44
|
+
profiles: {
|
|
45
|
+
profile: {
|
|
46
|
+
profile_id: string;
|
|
47
|
+
harness_id: string;
|
|
48
|
+
display_name: string;
|
|
49
|
+
credential_kind: "api_key" | "config_dir_login" | "oauth_token";
|
|
50
|
+
isolation_locator: string | null;
|
|
51
|
+
secret_ref: string | null;
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
created_at: string | null;
|
|
54
|
+
};
|
|
55
|
+
status: {
|
|
56
|
+
profile_id: string;
|
|
57
|
+
harness_id: string;
|
|
58
|
+
availability: "available" | "unavailable" | "unknown";
|
|
59
|
+
verification: "failed" | "not_run" | "passed";
|
|
60
|
+
detail?: string | undefined;
|
|
61
|
+
last_verified_at: string | null;
|
|
62
|
+
};
|
|
63
|
+
identity: {
|
|
64
|
+
email?: string | undefined;
|
|
65
|
+
plan?: string | undefined;
|
|
66
|
+
} | null;
|
|
67
|
+
}[];
|
|
68
|
+
harnessAccounts: {
|
|
69
|
+
harness_id: string;
|
|
70
|
+
native_credentials_enabled: boolean;
|
|
71
|
+
native_login_detected: boolean;
|
|
72
|
+
identity: {
|
|
73
|
+
email?: string | undefined;
|
|
74
|
+
plan?: string | undefined;
|
|
75
|
+
} | null;
|
|
76
|
+
next_up: {
|
|
77
|
+
kind: "profile";
|
|
78
|
+
profileId: string;
|
|
79
|
+
} | {
|
|
80
|
+
kind: "native";
|
|
81
|
+
route?: "api_key" | "local_session" | undefined;
|
|
82
|
+
} | {
|
|
83
|
+
kind: "none";
|
|
84
|
+
reason: string;
|
|
85
|
+
};
|
|
86
|
+
}[];
|
|
87
|
+
harnesses: {
|
|
88
|
+
id: string;
|
|
89
|
+
available: boolean;
|
|
90
|
+
status: "ok" | "degraded" | "unavailable";
|
|
91
|
+
manifest: import("@claudexor/schema").HarnessManifest | null;
|
|
92
|
+
enabledIntents: import("@claudexor/schema").Intent[];
|
|
93
|
+
routableIntents: import("@claudexor/schema").Intent[];
|
|
94
|
+
disabledIntents: import("@claudexor/schema").Intent[];
|
|
95
|
+
checks: import("@claudexor/schema").ConformanceCheck[];
|
|
96
|
+
reasons: string[];
|
|
97
|
+
authSources: import("@claudexor/schema").AuthSourceReadiness[];
|
|
98
|
+
configuredModel: string | null;
|
|
99
|
+
configuredModelCheck: {
|
|
100
|
+
status: "ok" | "rejected";
|
|
101
|
+
message?: string | null;
|
|
102
|
+
} | null;
|
|
103
|
+
delegation: {
|
|
104
|
+
available: boolean;
|
|
105
|
+
reason: "manifest_unsupported" | "ready" | "runtime_unavailable";
|
|
106
|
+
remediation: string | null;
|
|
107
|
+
requiresFullAccess: boolean;
|
|
108
|
+
};
|
|
109
|
+
readiness: {
|
|
110
|
+
id: string;
|
|
111
|
+
kind: "auth" | "binary" | "model" | "probe" | "smoke";
|
|
112
|
+
title: string;
|
|
113
|
+
status: "fail" | "pass" | "skip";
|
|
114
|
+
detail: string | null;
|
|
115
|
+
}[];
|
|
116
|
+
}[];
|
|
117
|
+
git: {
|
|
118
|
+
status: "available" | "developer_tools_stub" | "failed" | "missing";
|
|
119
|
+
version: string | null;
|
|
120
|
+
detail: string | null;
|
|
121
|
+
remediation: string | null;
|
|
122
|
+
};
|
|
123
|
+
quota: {
|
|
124
|
+
snapshots: {
|
|
125
|
+
subject: {
|
|
126
|
+
harness: string;
|
|
127
|
+
credential_route: "local" | "managed_api_key" | "vendor_native";
|
|
128
|
+
plan_label: string | null;
|
|
129
|
+
subject_id: string | null;
|
|
130
|
+
};
|
|
131
|
+
constraints: {
|
|
132
|
+
id: string;
|
|
133
|
+
label: string;
|
|
134
|
+
applies_to_models?: string[] | null | undefined;
|
|
135
|
+
used_ratio: number | null;
|
|
136
|
+
window_seconds: number | null;
|
|
137
|
+
resets_at: string | null;
|
|
138
|
+
cooldown_until: string | null;
|
|
139
|
+
}[];
|
|
140
|
+
source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
|
|
141
|
+
observed_at: string;
|
|
142
|
+
freshness: "fresh" | "stale" | "unknown";
|
|
143
|
+
}[];
|
|
144
|
+
absences: {
|
|
145
|
+
subject: {
|
|
146
|
+
harness: string;
|
|
147
|
+
credential_route: "local" | "managed_api_key" | "vendor_native";
|
|
148
|
+
plan_label: string | null;
|
|
149
|
+
subject_id: string | null;
|
|
150
|
+
};
|
|
151
|
+
reason: "no_source" | "not_logged_in" | "platform_unsupported" | "refresh_failed" | "transport_unavailable";
|
|
152
|
+
detail: string | null;
|
|
153
|
+
observed_at: string;
|
|
154
|
+
}[];
|
|
155
|
+
refreshed_at: string | null;
|
|
156
|
+
};
|
|
157
|
+
quotaEventCursor: string;
|
|
158
|
+
} | {
|
|
159
|
+
harnesses?: undefined;
|
|
160
|
+
git?: undefined;
|
|
161
|
+
quota?: undefined;
|
|
162
|
+
quotaEventCursor?: undefined;
|
|
163
|
+
profiles: {
|
|
164
|
+
profile: {
|
|
165
|
+
profile_id: string;
|
|
166
|
+
harness_id: string;
|
|
167
|
+
display_name: string;
|
|
168
|
+
credential_kind: "api_key" | "config_dir_login" | "oauth_token";
|
|
169
|
+
isolation_locator: string | null;
|
|
170
|
+
secret_ref: string | null;
|
|
171
|
+
enabled: boolean;
|
|
172
|
+
created_at: string | null;
|
|
173
|
+
};
|
|
174
|
+
status: {
|
|
175
|
+
profile_id: string;
|
|
176
|
+
harness_id: string;
|
|
177
|
+
availability: "available" | "unavailable" | "unknown";
|
|
178
|
+
verification: "failed" | "not_run" | "passed";
|
|
179
|
+
detail?: string | undefined;
|
|
180
|
+
last_verified_at: string | null;
|
|
181
|
+
};
|
|
182
|
+
identity: {
|
|
183
|
+
email?: string | undefined;
|
|
184
|
+
plan?: string | undefined;
|
|
185
|
+
} | null;
|
|
186
|
+
}[];
|
|
187
|
+
harnessAccounts: {
|
|
188
|
+
harness_id: string;
|
|
189
|
+
native_credentials_enabled: boolean;
|
|
190
|
+
native_login_detected: boolean;
|
|
191
|
+
identity: {
|
|
192
|
+
email?: string | undefined;
|
|
193
|
+
plan?: string | undefined;
|
|
194
|
+
} | null;
|
|
195
|
+
next_up: {
|
|
196
|
+
kind: "profile";
|
|
197
|
+
profileId: string;
|
|
198
|
+
} | {
|
|
199
|
+
kind: "native";
|
|
200
|
+
route?: "api_key" | "local_session" | undefined;
|
|
201
|
+
} | {
|
|
202
|
+
kind: "none";
|
|
203
|
+
reason: string;
|
|
204
|
+
};
|
|
205
|
+
}[];
|
|
206
|
+
}>;
|
|
207
|
+
//# sourceMappingURL=accounts-services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts-services.d.ts","sourceRoot":"","sources":["../src/accounts-services.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAc5E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,wBAAsB,sBAAsB,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE;;;;;;;;;;;;;gBAKpD,IAAI,GAAG,UAAU;kBAAY,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;KAuBpE;AAED;;8EAE8E;AAC9E,wBAAgB,+BAA+B,CAAC,aAAa,EAAE,MAAM,aAAa,YAC1D;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA7BnB,IAAI,GAAG,UAAU;sBAAY,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEpE"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { loadConfig } from "@claudexor/config";
|
|
2
|
+
import { normalizeReadiness } from "@claudexor/gateway";
|
|
3
|
+
import { probeGitCapability } from "@claudexor/workspace";
|
|
4
|
+
import { noProjectRepoRoot } from "@claudexor/util";
|
|
5
|
+
import { validateModel } from "@claudexor/core";
|
|
6
|
+
import { harnessAccountsProjection, profileAccountIdentity, profileDoctorStatus, } from "./accounts-projection.js";
|
|
7
|
+
import { buildGateway, harnessModels } from "./registry.js";
|
|
8
|
+
import { delegationCapabilityFor } from "./delegation-capability.js";
|
|
9
|
+
const NO_PROJECT_ROOT = noProjectRepoRoot();
|
|
10
|
+
export async function projectHarnessStatuses(statuses) {
|
|
11
|
+
const cfg = loadConfig(NO_PROJECT_ROOT);
|
|
12
|
+
return Promise.all(statuses.map(async (status) => {
|
|
13
|
+
const configured = cfg.global.harnesses[status.id]?.default_model ?? null;
|
|
14
|
+
let check = null;
|
|
15
|
+
if (configured) {
|
|
16
|
+
const truth = await harnessModels(status.id, NO_PROJECT_ROOT, true);
|
|
17
|
+
check = validateModel(configured, truth.models.map((model) => model.id), truth.source === "api" ? "api" : "manifest");
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
...status,
|
|
21
|
+
configuredModel: configured,
|
|
22
|
+
configuredModelCheck: check,
|
|
23
|
+
delegation: delegationCapabilityFor(status.manifest),
|
|
24
|
+
readiness: normalizeReadiness({
|
|
25
|
+
checks: status.checks,
|
|
26
|
+
authSources: status.authSources,
|
|
27
|
+
configuredModel: configured,
|
|
28
|
+
configuredModelCheck: check,
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
/** One server-owned Accounts response builder. The opt-in form refreshes quota
|
|
34
|
+
* first and then derives next_up from that exact returned response; no client
|
|
35
|
+
* can accidentally pair a newer quota card with an older routing identity. */
|
|
36
|
+
export function createCredentialProfilesService(quotaRegistry) {
|
|
37
|
+
return async (input) => {
|
|
38
|
+
const profiles = loadConfig(NO_PROJECT_ROOT).global.credential_profiles;
|
|
39
|
+
const projectedProfiles = Promise.all(profiles.map(async (profile) => ({
|
|
40
|
+
profile,
|
|
41
|
+
status: await profileDoctorStatus(profile),
|
|
42
|
+
identity: profileAccountIdentity(profile),
|
|
43
|
+
})));
|
|
44
|
+
if (input?.snapshot === true) {
|
|
45
|
+
const [out, statuses, git, fencedQuota] = await Promise.all([
|
|
46
|
+
projectedProfiles,
|
|
47
|
+
buildGateway({ includeFakes: false }).statusAll({ cwd: NO_PROJECT_ROOT, fresh: true }),
|
|
48
|
+
probeGitCapability(),
|
|
49
|
+
quotaRegistry().refreshWithCursor(),
|
|
50
|
+
]);
|
|
51
|
+
const quota = fencedQuota.response;
|
|
52
|
+
return {
|
|
53
|
+
profiles: out,
|
|
54
|
+
harnessAccounts: await harnessAccountsProjection(NO_PROJECT_ROOT, quota.snapshots, {
|
|
55
|
+
profiles: out,
|
|
56
|
+
statuses,
|
|
57
|
+
}),
|
|
58
|
+
harnesses: await projectHarnessStatuses(statuses),
|
|
59
|
+
git,
|
|
60
|
+
quota,
|
|
61
|
+
quotaEventCursor: fencedQuota.quotaEventCursor,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const out = await projectedProfiles;
|
|
65
|
+
return {
|
|
66
|
+
profiles: out,
|
|
67
|
+
harnessAccounts: await harnessAccountsProjection(NO_PROJECT_ROOT, quotaRegistry().read().snapshots, { profiles: out }),
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=accounts-services.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts-services.js","sourceRoot":"","sources":["../src/accounts-services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAsB,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO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yB,CAC9C,eAAe,EACf,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,SAAS,EAChC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAClB;SACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type ControlPrimaryOutput, type ModeKind, type RunFailure, type RunOutcomeFacts } from "@claudexor/schema";
|
|
1
2
|
import { type ControlApiAddress } from "./live.js";
|
|
3
|
+
import { type RunDetailProblem } from "./run-detail-projections.js";
|
|
2
4
|
export declare const ACP_MAX_REPLAY_TURNS = 50;
|
|
3
5
|
/** Bound the load-replay to the most recent ACP_MAX_REPLAY_TURNS turns, and
|
|
4
6
|
* report how many older turns were omitted (disclosed to the client, never
|
|
@@ -7,10 +9,47 @@ export declare function selectReplayTurns<T>(rawTurns: readonly T[]): {
|
|
|
7
9
|
replayTurns: T[];
|
|
8
10
|
omittedTurnCount: number;
|
|
9
11
|
};
|
|
12
|
+
/** One post-terminal GET /runs/:id for the ACP turn result (INV-120), DEGRADING
|
|
13
|
+
* on failure: a finished turn must never become a JSON-RPC error that loses
|
|
14
|
+
* the runId. Missing/legacy detail projects null fields; a raised typed
|
|
15
|
+
* problem (e.g. 500 run_facts_invalid) rides the result as `detailProblem`
|
|
16
|
+
* so the client still receives the terminal answer plus the typed reason its
|
|
17
|
+
* detail projections are absent. Exported for test. */
|
|
18
|
+
export declare function projectTerminalTurnDetail(addr: ControlApiAddress, runId: string): Promise<{
|
|
19
|
+
applyEligibility: unknown;
|
|
20
|
+
planReadiness: unknown;
|
|
21
|
+
planQuestions: unknown[];
|
|
22
|
+
failure: RunFailure | null;
|
|
23
|
+
primaryOutput: ControlPrimaryOutput | null;
|
|
24
|
+
outcomeFacts: RunOutcomeFacts | null;
|
|
25
|
+
outcomeBanner: string | null;
|
|
26
|
+
detailProblem?: RunDetailProblem;
|
|
27
|
+
}>;
|
|
28
|
+
type AcpTerminalRecord = {
|
|
29
|
+
state: string;
|
|
30
|
+
error?: string;
|
|
31
|
+
params?: unknown;
|
|
32
|
+
};
|
|
33
|
+
/** Effective mode persisted on the daemon job after the thread-turn funnel. */
|
|
34
|
+
export declare function acpTerminalRecordMode(record: Pick<AcpTerminalRecord, "params">): ModeKind | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* ACP terminal text consumes the Control API's canonical bounded/redacted
|
|
37
|
+
* primaryOutput. Local artifact discovery exists only as a degrading fallback
|
|
38
|
+
* when that one detail read failed; its mode comes from the durable daemon job,
|
|
39
|
+
* never from an ACP default or a hard-coded Agent assumption.
|
|
40
|
+
*/
|
|
41
|
+
export declare function acpTerminalSummary(input: {
|
|
42
|
+
runId: string;
|
|
43
|
+
runDir: string;
|
|
44
|
+
record: AcpTerminalRecord;
|
|
45
|
+
detail: Awaited<ReturnType<typeof projectTerminalTurnDetail>>;
|
|
46
|
+
}): string;
|
|
10
47
|
/** A machine-ish reason for a failed per-turn run-detail fetch: prefer the
|
|
11
48
|
* typed control-API `code` (e.g. run_expired_by_retention), then the HTTP
|
|
12
49
|
* status, then a generic marker — never the raw English message. */
|
|
13
50
|
export declare function typedFetchReason(error: unknown): string;
|
|
51
|
+
/** Translate ACP aliases into the strict Control API run-start vocabulary. */
|
|
52
|
+
export declare function projectAcpRunControls(input: Record<string, unknown>): Record<string, unknown>;
|
|
14
53
|
type Hooks = {
|
|
15
54
|
onInteraction?: (ctx: any) => Promise<any | null>;
|
|
16
55
|
signal?: AbortSignal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acp-surface-runner.d.ts","sourceRoot":"","sources":["../src/acp-surface-runner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"acp-surface-runner.d.ts","sourceRoot":"","sources":["../src/acp-surface-runner.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAC;AAG3B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