@hearsay-tools/squawk 0.18.0-dev.8063 → 0.18.0-dev.8071
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/contract/conversations.d.ts +2 -0
- package/dist/contract/delegation.d.ts +57 -0
- package/dist/contract/index.js +187 -144
- package/dist/contract/run-predicates.d.ts +9 -0
- package/dist/contract/usage-limit-hold.d.ts +7 -0
- package/dist/contract/waits.d.ts +2 -2
- package/dist/delegation/cli.js +8 -4
- package/dist/delegation/cli.js.map +1 -1
- package/dist/delegation/conversation-send.js +15 -4
- package/dist/delegation/conversation-send.js.map +1 -1
- package/dist/delegation/conversations.js +6 -0
- package/dist/delegation/conversations.js.map +1 -1
- package/dist/delegation/execution-identity.d.ts +53 -9
- package/dist/delegation/execution-identity.js +165 -9
- package/dist/delegation/execution-identity.js.map +1 -1
- package/dist/delegation/park-notice.d.ts +29 -3
- package/dist/delegation/park-notice.js +32 -4
- package/dist/delegation/park-notice.js.map +1 -1
- package/dist/delegation/provision.js +3 -3
- package/dist/delegation/provision.js.map +1 -1
- package/dist/delegation/routes.d.ts +19 -0
- package/dist/delegation/service.d.ts +5 -0
- package/dist/delegation/service.js +93 -14
- package/dist/delegation/service.js.map +1 -1
- package/dist/delegation/transport.d.ts +23 -4
- package/dist/delegation/worker-executions.d.ts +2 -0
- package/dist/delegation/worker-executions.js +5 -1
- package/dist/delegation/worker-executions.js.map +1 -1
- package/dist/runs/ports.d.ts +2 -0
- package/dist/server/provider-action-gate.d.ts +8 -0
- package/dist/server/provider-action-gate.js +19 -2
- package/dist/server/provider-action-gate.js.map +1 -1
- package/dist/server/run-accounts.d.ts +4 -3
- package/dist/server/run-accounts.js +20 -5
- package/dist/server/run-accounts.js.map +1 -1
- package/dist/server/server.d.ts +14 -0
- package/dist/server/server.js +3 -9
- package/dist/server/server.js.map +1 -1
- package/dist/workflows/continuation-admission.d.ts +7 -0
- package/dist/workflows/continuation-admission.js +21 -8
- package/dist/workflows/continuation-admission.js.map +1 -1
- package/dist/workflows/input-acknowledgement.d.ts +24 -24
- package/dist/workflows/run/continuation-acceptance.d.ts +5 -1
- package/dist/workflows/run/continuation-acceptance.js +94 -29
- package/dist/workflows/run/continuation-acceptance.js.map +1 -1
- package/dist/workflows/run/launch-read-resolver.d.ts +6 -0
- package/dist/workflows/run/launch-read-resolver.js +13 -2
- package/dist/workflows/run/launch-read-resolver.js.map +1 -1
- package/dist/workflows/run/run-settlement.js +6 -0
- package/dist/workflows/run/run-settlement.js.map +1 -1
- package/dist/workflows/run/worker-questions.d.ts +4 -0
- package/dist/workflows/run/worker-questions.js +42 -8
- package/dist/workflows/run/worker-questions.js.map +1 -1
- package/package.json +4 -4
- package/web/dist/assets/{accounts-section-D3P_Z-Nu.js → accounts-section-BkKQ8sVH.js} +1 -1
- package/web/dist/assets/{activity-motion-BW-0k8s7.js → activity-motion-D80Uv4-Z.js} +1 -1
- package/web/dist/assets/{activity-route-Bpgblioe.js → activity-route-DVT8IWTR.js} +1 -1
- package/web/dist/assets/{agent-config-section-Cj3w7UIn.js → agent-config-section-BbwkJunW.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-BJ4poe9c.js → agent-defaults-section-BLNTIZT_.js} +1 -1
- package/web/dist/assets/{appearance-BUsUTPF0.js → appearance-B6YBsmTo.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-D_kgBFNv.js → archive-on-merge-field-Bx1bEmI8.js} +1 -1
- package/web/dist/assets/attention-otQlgfRj.js +1 -0
- package/web/dist/assets/{automation-format-1lHzRTbq.js → automation-format-BsnXeUET.js} +1 -1
- package/web/dist/assets/automations-route-BOcGwfd4.js +1 -0
- package/web/dist/assets/{cez-idle-BY3rjM_y.js → cez-idle-Crszm9Ts.js} +1 -1
- package/web/dist/assets/{commit-diff-panel-xwLW6Ydr.js → commit-diff-panel-DKUnniap.js} +1 -1
- package/web/dist/assets/{diff-BB8SoL-s.js → diff-DUbLBjbg.js} +2 -2
- package/web/dist/assets/{diff-view-O8lx1ztb.js → diff-view-D_bjQyDl.js} +1 -1
- package/web/dist/assets/{file-preview-BS6M2tBo.js → file-preview-glEH09z8.js} +1 -1
- package/web/dist/assets/{folder-browser-Dsqz0Z1z.js → folder-browser-G_9ZgDjg.js} +1 -1
- package/web/dist/assets/{git-toolbar-DoPFA36c.js → git-toolbar-CTsmGICA.js} +1 -1
- package/web/dist/assets/{github-Bjy3WBvf.js → github-BqW9PaQO.js} +1 -1
- package/web/dist/assets/{global-activity-route-BXBZKz_9.js → global-activity-route-BP_Z7HNc.js} +1 -1
- package/web/dist/assets/index-DXIRYobS.js +21 -0
- package/web/dist/assets/{label-CZp8t0zE.js → label-BWld23ke.js} +1 -1
- package/web/dist/assets/live-protocol-BXzu6cSE.js +64 -0
- package/web/dist/assets/{markdown-KHcncamw.js → markdown-CT65TA_B.js} +1 -1
- package/web/dist/assets/{notifications-section-DD21Sd79.js → notifications-section-DuSzYLwP.js} +1 -1
- package/web/dist/assets/{open-in-menu-DdKs6X5r.js → open-in-menu-D03osLGE.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-BvTZv2SQ.js → preview-pane-connected-DHmgDHId.js} +1 -1
- package/web/dist/assets/{project-location-B3LBvkz2.js → project-location-BM-6wMI3.js} +1 -1
- package/web/dist/assets/{project-router-CIKODSHW.js → project-router-DtTvMbeA.js} +1 -1
- package/web/dist/assets/project-scope-context-Dgq8_2JZ.js +4 -0
- package/web/dist/assets/{projects-section-C0k8kyb-.js → projects-section-Dr0xJWTm.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-DNkosCni.js → prompt-templates-section-COKMgKMw.js} +1 -1
- package/web/dist/assets/queries-yuG-mM6_.js +1 -0
- package/web/dist/assets/{reference-chip-BWViAFIN.js → reference-chip-DTKtEtWv.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-DPCENbhz.js → remote-settings-notice-BV_sPAXc.js} +1 -1
- package/web/dist/assets/{repo-git-jKOnO3ba.js → repo-git-BgXC4opq.js} +1 -1
- package/web/dist/assets/{report-reader-DXYiKNcg.js → report-reader-CtHvvSln.js} +1 -1
- package/web/dist/assets/{reports-DEE0bHNv.js → reports-CdbDUzkK.js} +1 -1
- package/web/dist/assets/{resources-section-lqXgYTrv.js → resources-section-C8KZ4hre.js} +1 -1
- package/web/dist/assets/{run-header-CXlUbvDO.js → run-header-RQYKdIMw.js} +1 -1
- package/web/dist/assets/runners-CDw7wLfd.js +1 -0
- package/web/dist/assets/{settings-agent-picker-BRvZn4kM.js → settings-agent-picker-3uuSf9LK.js} +1 -1
- package/web/dist/assets/{settings-shell-DTtd-vIa.js → settings-shell-DnYRfclU.js} +1 -1
- package/web/dist/assets/{sidebar-section-BFW4ZfBR.js → sidebar-section-CCg4QGtg.js} +1 -1
- package/web/dist/assets/{skills-AImMlT1T.js → skills-L01dfEnP.js} +1 -1
- package/web/dist/assets/{tab-link-CM6SDBtV.js → tab-link-Dl5Mmavw.js} +1 -1
- package/web/dist/assets/{task-changes-01Z_ppIw.js → task-changes-DWPWp6ZV.js} +1 -1
- package/web/dist/assets/{task-commits-DRNIum3J.js → task-commits-D576LERH.js} +1 -1
- package/web/dist/assets/{task-files-Crz7Fo3C.js → task-files-1EjplVVb.js} +1 -1
- package/web/dist/assets/{task-github-item-psG2V47c.js → task-github-item-BubKlTej.js} +1 -1
- package/web/dist/assets/task-groups-D4RYW5I_.js +1 -0
- package/web/dist/assets/task-thread-yWACZZAo.js +9 -0
- package/web/dist/assets/{tasks-table-DHTEGteC.js → tasks-table-DTNcYbbN.js} +1 -1
- package/web/dist/assets/{thread-state-BWJ2YyXo.js → thread-state-BiS8rKQ-.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-DNROQerR.js → use-hand-to-agent-state-BFx3SZia.js} +1 -1
- package/web/dist/assets/{useInfiniteQuery-qJeCNhM7.js → useInfiniteQuery-BnyaEFle.js} +1 -1
- package/web/dist/assets/useQuery-BUslvRIM.js +1 -0
- package/web/dist/assets/{workflows-Cx9lgrEo.js → workflows-DbuTPPz7.js} +1 -1
- package/web/dist/assets/{workspace-tools-CVitt3kE.js → workspace-tools-DPnEZoDL.js} +1 -1
- package/web/dist/assets/{worktrees-section-DxUg4l9n.js → worktrees-section-Vr8s9cio.js} +1 -1
- package/web/dist/assets/{ws-BisMp6U5.js → ws-Bal5BUy2.js} +1 -1
- package/web/dist/index.html +17 -17
- package/web/dist/live-worker.js +1 -1
- package/web/dist/assets/attention-lvUYNNvV.js +0 -1
- package/web/dist/assets/automations-route-CZaUrmDs.js +0 -1
- package/web/dist/assets/index-CmadQXcg.js +0 -21
- package/web/dist/assets/live-protocol-D9ji1YCl.js +0 -64
- package/web/dist/assets/project-scope-context-D1bpJixc.js +0 -4
- package/web/dist/assets/queries-dHXhD3Hc.js +0 -1
- package/web/dist/assets/runners-CGQjSsir.js +0 -1
- package/web/dist/assets/task-groups-DF0XoB6U.js +0 -1
- package/web/dist/assets/task-thread-Bqg91ZVZ.js +0 -9
- package/web/dist/assets/useQuery-C3CQhXsT.js +0 -1
package/dist/runs/ports.d.ts
CHANGED
|
@@ -181,6 +181,8 @@ export interface WorkerExecutions {
|
|
|
181
181
|
export interface WorkerExecutionRecords {
|
|
182
182
|
/** `identity` is checked against the worker identity schema before it is written. */
|
|
183
183
|
writeWorkerIdentity(id: string, identity: unknown): void;
|
|
184
|
+
/** Atomically update an existing worker identity (same-runner model/effort override). */
|
|
185
|
+
updateWorkerIdentity(id: string, identity: unknown): void;
|
|
184
186
|
writeWorkerExecution(id: string, proof: WorkerExecution, fresh?: boolean): void;
|
|
185
187
|
/** A deleted child's receipt replaces the private proof only after the deletion checkpoint. */
|
|
186
188
|
workerDeletionEvidence(id: string): boolean;
|
|
@@ -5,6 +5,14 @@ import type { WorkflowDef } from '../contract/index.js';
|
|
|
5
5
|
/** The registered runners an original workflow executes, in registration order. */
|
|
6
6
|
export declare function providersRequiredByWorkflow(workflow: WorkflowDef, fallback: ProviderId): ProviderId[];
|
|
7
7
|
export declare function providerForExistingRun(run: RunRecord, override?: ProviderId): ProviderId;
|
|
8
|
+
/** The provider an untouched cancelled run continues on: a worker's first agent step, else the run's runner, else config default. */
|
|
9
|
+
export declare function providerForUntouchedRun(run: RunRecord, defaultRunner: () => Promise<ProviderId>): Promise<ProviderId>;
|
|
10
|
+
/** Resolve the original, target, and required providers for `POST /runs/:id/continue`. */
|
|
11
|
+
export declare function continueRunProviders(run: RunRecord, requestedRunner: string | undefined, untouched: boolean, defaultRunner: () => Promise<ProviderId>): Promise<{
|
|
12
|
+
original: ProviderId;
|
|
13
|
+
target: ProviderId;
|
|
14
|
+
required: ProviderId[];
|
|
15
|
+
}>;
|
|
8
16
|
/**
|
|
9
17
|
* The named (non-default) account a start will run on, per provider, and its probed sign-in state.
|
|
10
18
|
* A provider absent here runs on its DEFAULT account, whose state is the provider-status row.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { controlLocation } from '../contract/index.js';
|
|
2
|
-
import { registeredRunners, runnerDefinition, resolveRunnerId } from '../core/runner-registry.js';
|
|
2
|
+
import { registeredRunnerId, registeredRunners, runnerDefinition, resolveRunnerId } from '../core/runner-registry.js';
|
|
3
3
|
import { providersRequiredByWorkflow as requiredByWorkflow } from '../contract/index.js';
|
|
4
|
+
import { workerContinuationStep } from '../contract/index.js';
|
|
4
5
|
/** The registered runners an original workflow executes, in registration order. */
|
|
5
6
|
export function providersRequiredByWorkflow(workflow, fallback) {
|
|
6
7
|
return requiredByWorkflow(workflow, fallback, registeredRunners().map(({ id }) => id));
|
|
@@ -8,7 +9,23 @@ export function providersRequiredByWorkflow(workflow, fallback) {
|
|
|
8
9
|
export function providerForExistingRun(run, override) {
|
|
9
10
|
if (override)
|
|
10
11
|
return override;
|
|
11
|
-
return resolveRunnerId(run.runner);
|
|
12
|
+
return resolveRunnerId(workerContinuationStep(run)?.runner ?? run.runner);
|
|
13
|
+
}
|
|
14
|
+
/** The provider an untouched cancelled run continues on: a worker's first agent step, else the run's runner, else config default. */
|
|
15
|
+
export async function providerForUntouchedRun(run, defaultRunner) {
|
|
16
|
+
const stepRunner = workerContinuationStep(run, true)?.runner;
|
|
17
|
+
if (stepRunner !== undefined)
|
|
18
|
+
return resolveRunnerId(stepRunner);
|
|
19
|
+
return run.runner === undefined ? defaultRunner() : resolveRunnerId(run.runner);
|
|
20
|
+
}
|
|
21
|
+
/** Resolve the original, target, and required providers for `POST /runs/:id/continue`. */
|
|
22
|
+
export async function continueRunProviders(run, requestedRunner, untouched, defaultRunner) {
|
|
23
|
+
const original = untouched
|
|
24
|
+
? await providerForUntouchedRun(run, defaultRunner)
|
|
25
|
+
: providerForExistingRun(run);
|
|
26
|
+
const target = requestedRunner === undefined ? original : registeredRunnerId(requestedRunner);
|
|
27
|
+
const required = untouched ? providersRequiredByWorkflow(run.workflowDef, target) : [target];
|
|
28
|
+
return { original, target, required };
|
|
12
29
|
}
|
|
13
30
|
export function unavailableProviderMessage(required, response, accounts = new Map()) {
|
|
14
31
|
for (const provider of required) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-action-gate.js","sourceRoot":"","sources":["../../src/server/provider-action-gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAIjF,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"provider-action-gate.js","sourceRoot":"","sources":["../../src/server/provider-action-gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAIjF,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACtH,OAAO,EAAE,2BAA2B,IAAI,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC3G,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAGrF,mFAAmF;AACnF,MAAM,UAAU,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G,CAAC;IACnG,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { Home } from '../home/home.ts';
|
|
|
2
2
|
import type { ProviderAuthService, ProviderId } from '../core/provider-auth.ts';
|
|
3
3
|
import type { RunRecord } from '../runs/store.ts';
|
|
4
4
|
import { type ResolvedAgentProfile } from '../workspace/agent-profiles.ts';
|
|
5
|
-
import type
|
|
5
|
+
import { type GateAccount } from './provider-action-gate.ts';
|
|
6
6
|
/**
|
|
7
7
|
* The NAMED (non-default) account each provider of a start will run on (hearsay-tools/squawk#4116).
|
|
8
8
|
*
|
|
@@ -21,11 +21,12 @@ export interface AccountScope {
|
|
|
21
21
|
repoRoot: string;
|
|
22
22
|
run?: RunRecord | undefined;
|
|
23
23
|
live?: boolean | undefined;
|
|
24
|
+
untouched?: boolean | undefined;
|
|
24
25
|
runners?: ContinueRunners | undefined;
|
|
25
26
|
picks?: Partial<Record<ProviderId, string | undefined>> | undefined;
|
|
26
27
|
}
|
|
27
28
|
/** {@link namedRunAccounts} for an {@link AccountScope}. */
|
|
28
|
-
export declare function scopeRunAccounts(home: Home, required: readonly ProviderId[], { repoRoot, run, live, runners, picks }: AccountScope): Promise<Map<ProviderId, ResolvedAgentProfile>>;
|
|
29
|
+
export declare function scopeRunAccounts(home: Home, required: readonly ProviderId[], { repoRoot, run, live, untouched, runners, picks }: AccountScope): Promise<Map<ProviderId, ResolvedAgentProfile>>;
|
|
29
30
|
/** The account a message to a live run's session on `provider` reaches: the latest session's. */
|
|
30
31
|
export declare function liveAccountFor(run: RunRecord, provider: ProviderId): string | undefined;
|
|
31
32
|
/** A continuation's runners: the run's own (`original`) and the one it continues on (`target`). */
|
|
@@ -40,7 +41,7 @@ export interface ContinueRunners {
|
|
|
40
41
|
* recorded). Otherwise the target runner starts fresh on the run's account, which a runner switch
|
|
41
42
|
* clears first; every other runner uses the project's selection (absent).
|
|
42
43
|
*/
|
|
43
|
-
export declare function runAccountFor(run: RunRecord, provider: ProviderId, runners?: ContinueRunners): string | undefined;
|
|
44
|
+
export declare function runAccountFor(run: RunRecord, provider: ProviderId, runners?: ContinueRunners, untouched?: boolean): string | undefined;
|
|
44
45
|
/** The probed sign-in state of each named account in `accounts`. `refresh` drops the cached answer
|
|
45
46
|
* first, so a refusal is confirmed by a fresh probe, as the default rows are. */
|
|
46
47
|
export declare function probeNamedAccounts(providerAuth: Pick<ProviderAuthService, 'profileStatus' | 'forgetProfileStatus'>, accounts: ReadonlyMap<ProviderId, ResolvedAgentProfile>, refresh?: boolean): Promise<Map<ProviderId, GateAccount>>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { resolveRunnerId } from '../core/runner-registry.js';
|
|
2
2
|
import { DEFAULT_RUNNER_ID } from '../core/runner-ids.js';
|
|
3
3
|
import { executionAccount } from '../workflows/execution-account.js';
|
|
4
|
-
import { latestSession } from '../contract/index.js';
|
|
4
|
+
import { latestSession, workerContinuationStep } from '../contract/index.js';
|
|
5
5
|
import { DEFAULT_AGENT_ACCOUNT_ID } from '../contract/index.js';
|
|
6
6
|
import { loadAgentAccounts } from '../workspace/agent-accounts.js';
|
|
7
7
|
import { selectProfile } from '../workspace/agent-profiles.js';
|
|
8
|
+
import { providerForExistingRun } from './provider-action-gate.js';
|
|
8
9
|
/**
|
|
9
10
|
* The NAMED (non-default) account each provider of a start will run on (hearsay-tools/squawk#4116).
|
|
10
11
|
*
|
|
@@ -29,9 +30,9 @@ export async function namedRunAccounts(home, repoRoot, providers, picks = {}) {
|
|
|
29
30
|
return named;
|
|
30
31
|
}
|
|
31
32
|
/** {@link namedRunAccounts} for an {@link AccountScope}. */
|
|
32
|
-
export function scopeRunAccounts(home, required, { repoRoot, run, live, runners, picks = {} }) {
|
|
33
|
+
export function scopeRunAccounts(home, required, { repoRoot, run, live, untouched, runners, picks = {} }) {
|
|
33
34
|
const fromRun = (provider) => run === undefined ? undefined
|
|
34
|
-
: live ? liveAccountFor(run, provider) : runAccountFor(run, provider, runners);
|
|
35
|
+
: live ? liveAccountFor(run, provider) : runAccountFor(run, provider, runners, untouched);
|
|
35
36
|
const chosen = Object.fromEntries(required.map((provider) => [provider, picks[provider] ?? fromRun(provider)]));
|
|
36
37
|
return namedRunAccounts(home, repoRoot, required, chosen);
|
|
37
38
|
}
|
|
@@ -40,6 +41,15 @@ export function liveAccountFor(run, provider) {
|
|
|
40
41
|
const live = executionAccount(run);
|
|
41
42
|
return resolveRunnerId(live.runner ?? DEFAULT_RUNNER_ID) === provider ? live.agentProfile : undefined;
|
|
42
43
|
}
|
|
44
|
+
function workerAccountFor(run, provider, original, target, untouched) {
|
|
45
|
+
if (untouched) {
|
|
46
|
+
const match = run.workflowDef?.steps.find(step => step.command === undefined && step.kind !== 'plugin' && resolveRunnerId(step.runner ?? run.runner) === provider);
|
|
47
|
+
return match?.agentProfile ?? (provider === original ? run.agentProfile : undefined);
|
|
48
|
+
}
|
|
49
|
+
if (provider !== target)
|
|
50
|
+
return undefined;
|
|
51
|
+
return workerContinuationStep(run)?.agentProfile;
|
|
52
|
+
}
|
|
43
53
|
/**
|
|
44
54
|
* The account a continuation's turn on `provider` uses, as the engine picks it (`sessionAffinity`,
|
|
45
55
|
* `overridePatch`, `agentEnvForStep`). The target runner resumes the latest session when that session
|
|
@@ -47,9 +57,14 @@ export function liveAccountFor(run, provider) {
|
|
|
47
57
|
* recorded). Otherwise the target runner starts fresh on the run's account, which a runner switch
|
|
48
58
|
* clears first; every other runner uses the project's selection (absent).
|
|
49
59
|
*/
|
|
50
|
-
export function runAccountFor(run, provider, runners) {
|
|
51
|
-
const original = runners?.original ??
|
|
60
|
+
export function runAccountFor(run, provider, runners, untouched = false) {
|
|
61
|
+
const original = runners?.original ?? providerForExistingRun(run);
|
|
52
62
|
const target = runners?.target ?? original;
|
|
63
|
+
if (run.delegation?.role === 'worker') {
|
|
64
|
+
const pinned = workerAccountFor(run, provider, original, target, untouched);
|
|
65
|
+
if (pinned !== undefined || untouched)
|
|
66
|
+
return pinned;
|
|
67
|
+
}
|
|
53
68
|
if (provider !== target)
|
|
54
69
|
return undefined;
|
|
55
70
|
const session = latestSession(run);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-accounts.js","sourceRoot":"","sources":["../../src/server/run-accounts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"run-accounts.js","sourceRoot":"","sources":["../../src/server/run-accounts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACpG,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,aAAa,EAA6B,MAAM,gCAAgC,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAoB,MAAM,2BAA2B,CAAC;AAErF;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,IAAU,EACV,QAAgB,EAChB,SAAgC,EAChC,KAAK,GAAoD,EAAE;IAE3D,MAAM,KAAK,GAAG,IAAI,GAAG,EAAoC,CAAC;IAC1D,MAAM,KAAK,GAAG,MAAM,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAC9D,IAAI,KAAK,KAAK,IAAI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EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAU,CAAC;IAC9E,CAAC,CAAC,CAAC,CAAC;IACJ,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC"}
|
package/dist/server/server.d.ts
CHANGED
|
@@ -8523,6 +8523,13 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
8523
8523
|
};
|
|
8524
8524
|
backend?: string | undefined;
|
|
8525
8525
|
model?: string | undefined;
|
|
8526
|
+
effort?: string | undefined;
|
|
8527
|
+
hold?: {
|
|
8528
|
+
reason: "provider-error" | "usage-limit";
|
|
8529
|
+
resumeAt: string;
|
|
8530
|
+
attempts?: number | undefined;
|
|
8531
|
+
error?: string | undefined;
|
|
8532
|
+
} | undefined;
|
|
8526
8533
|
inputs?: {
|
|
8527
8534
|
source: {
|
|
8528
8535
|
kind: "parent-file";
|
|
@@ -25170,6 +25177,13 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
25170
25177
|
};
|
|
25171
25178
|
backend?: string | undefined;
|
|
25172
25179
|
model?: string | undefined;
|
|
25180
|
+
effort?: string | undefined;
|
|
25181
|
+
hold?: {
|
|
25182
|
+
reason: "provider-error" | "usage-limit";
|
|
25183
|
+
resumeAt: string;
|
|
25184
|
+
attempts?: number | undefined;
|
|
25185
|
+
error?: string | undefined;
|
|
25186
|
+
} | undefined;
|
|
25173
25187
|
inputs?: {
|
|
25174
25188
|
source: {
|
|
25175
25189
|
kind: "parent-file";
|
package/dist/server/server.js
CHANGED
|
@@ -152,7 +152,7 @@ import { prepareProjects } from '../project-migration/auto.js';
|
|
|
152
152
|
import { freshCliHandoff, openRunApp, openRunCli, openRunDefaultApp } from './open-in-targets.js';
|
|
153
153
|
import { agentCliRunner, detectOpenTargets } from './open-in-app.js';
|
|
154
154
|
import { ProviderRuntimeAuthObserver } from './provider-auth-runtime.js';
|
|
155
|
-
import {
|
|
155
|
+
import { continueRunProviders } from './provider-action-gate.js';
|
|
156
156
|
import { attachProjectWebhooks, createBootContext, createProviderStatus, emitProviderRow, resolveServerDeps, watchProviderRuntimeAuth, } from './server-deps.js';
|
|
157
157
|
import { NO_WEBHOOK_ERROR, agentProfileRefusal, clientRequestOf, launchRun, modelLockRefusal, notifyRefusal, providerGateRefusal, replayedRun, resolveStartWorkflow, startRunInput, } from './start-run-options.js';
|
|
158
158
|
import { ASSET_CACHE_CONTROL, BUILD_HINT_HTML, assetContentType, isSafeAssetFilename, resolveGetRequest, } from './static-ui.js';
|
|
@@ -2756,14 +2756,8 @@ export function createApp(deps) {
|
|
|
2756
2756
|
return c.json({ error: removedRunnerMessage(run.removedRunner) }, 409);
|
|
2757
2757
|
}
|
|
2758
2758
|
const untouched = isUntouchedCancelledRun(run);
|
|
2759
|
-
const originalProvider = untouched
|
|
2760
|
-
|
|
2761
|
-
: providerForExistingRun(run);
|
|
2762
|
-
const provider = parsed.data.runner === undefined ? originalProvider : registeredRunnerId(parsed.data.runner);
|
|
2763
|
-
const required = untouched
|
|
2764
|
-
? providersRequiredByWorkflow(run.workflowDef, provider)
|
|
2765
|
-
: [provider];
|
|
2766
|
-
const blocked = await providerActionError(required, { repoRoot, run, runners: { original: originalProvider, target: provider } });
|
|
2759
|
+
const { original: originalProvider, target: provider, required } = await continueRunProviders(run, parsed.data.runner, untouched, async () => (await loadConfig(repoRoot, deps.home)).defaultRunner);
|
|
2760
|
+
const blocked = await providerActionError(required, { repoRoot, run, untouched, runners: { original: originalProvider, target: provider } });
|
|
2767
2761
|
if (blocked)
|
|
2768
2762
|
return c.json({ error: blocked }, 409);
|
|
2769
2763
|
const result = manager.continueRun(id, {
|