lastlight 0.15.0 → 0.16.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/README.md +71 -692
- package/dist/cli-config.js.map +1 -0
- package/dist/cli-format.js.map +1 -0
- package/dist/{cli/cli-server.d.ts → cli-server.d.ts} +26 -1
- package/dist/{cli/cli-server.js → cli-server.js} +40 -5
- package/dist/cli-server.js.map +1 -0
- package/dist/cli-timeline.js.map +1 -0
- package/dist/{cli/cli.js → cli.js} +4 -3
- package/dist/cli.js.map +1 -0
- package/dist/{cli/fork-cli.d.ts → fork-cli.d.ts} +3 -3
- package/dist/{cli/fork-cli.js → fork-cli.js} +28 -27
- package/dist/fork-cli.js.map +1 -0
- package/dist/{cli/oauth-cli.js → oauth-cli.js} +1 -1
- package/dist/oauth-cli.js.map +1 -0
- package/dist/{cli/setup.js → setup.js} +10 -4
- package/dist/setup.js.map +1 -0
- package/dist/{cli/skills-install.d.ts → skills-install.d.ts} +6 -0
- package/dist/{cli/skills-install.js → skills-install.js} +6 -2
- package/dist/skills-install.js.map +1 -0
- package/package.json +20 -65
- package/plugins/lastlight/.claude-plugin/plugin.json +1 -1
- package/agent-context/rules.md +0 -80
- package/agent-context/security.md +0 -69
- package/agent-context/soul.md +0 -21
- package/config/default.yaml +0 -119
- package/deploy/.env.production.example +0 -100
- package/deploy/entrypoint.sh +0 -82
- package/deploy/native/README.md +0 -160
- package/deploy/native/install.sh +0 -110
- package/deploy/native/lastlight.env.example +0 -95
- package/deploy/native/lastlight.service +0 -50
- package/deploy/sandbox-entrypoint.sh +0 -93
- package/dist/admin/auth.d.ts +0 -51
- package/dist/admin/auth.js +0 -121
- package/dist/admin/auth.js.map +0 -1
- package/dist/admin/chat-session-reader.d.ts +0 -39
- package/dist/admin/chat-session-reader.js +0 -84
- package/dist/admin/chat-session-reader.js.map +0 -1
- package/dist/admin/docker.d.ts +0 -61
- package/dist/admin/docker.js +0 -187
- package/dist/admin/docker.js.map +0 -1
- package/dist/admin/index.d.ts +0 -9
- package/dist/admin/index.js +0 -59
- package/dist/admin/index.js.map +0 -1
- package/dist/admin/routes.d.ts +0 -81
- package/dist/admin/routes.js +0 -1381
- package/dist/admin/routes.js.map +0 -1
- package/dist/admin/sessions.d.ts +0 -89
- package/dist/admin/sessions.js +0 -204
- package/dist/admin/sessions.js.map +0 -1
- package/dist/admin/tail.d.ts +0 -12
- package/dist/admin/tail.js +0 -145
- package/dist/admin/tail.js.map +0 -1
- package/dist/admin/version.d.ts +0 -22
- package/dist/admin/version.js +0 -92
- package/dist/admin/version.js.map +0 -1
- package/dist/cli/cli-config.js.map +0 -1
- package/dist/cli/cli-format.js.map +0 -1
- package/dist/cli/cli-server.js.map +0 -1
- package/dist/cli/cli-timeline.js.map +0 -1
- package/dist/cli/cli.js.map +0 -1
- package/dist/cli/fork-cli.js.map +0 -1
- package/dist/cli/oauth-cli.js.map +0 -1
- package/dist/cli/setup.js.map +0 -1
- package/dist/cli/skills-install.js.map +0 -1
- package/dist/config/config-resolve.d.ts +0 -28
- package/dist/config/config-resolve.js +0 -47
- package/dist/config/config-resolve.js.map +0 -1
- package/dist/config/config.d.ts +0 -157
- package/dist/config/config.js +0 -581
- package/dist/config/config.js.map +0 -1
- package/dist/config/core-pin.d.ts +0 -16
- package/dist/config/core-pin.js +0 -85
- package/dist/config/core-pin.js.map +0 -1
- package/dist/config/overlay-assets.d.ts +0 -20
- package/dist/config/overlay-assets.js +0 -114
- package/dist/config/overlay-assets.js.map +0 -1
- package/dist/config/overlay-bootstrap.d.ts +0 -44
- package/dist/config/overlay-bootstrap.js +0 -304
- package/dist/config/overlay-bootstrap.js.map +0 -1
- package/dist/connectors/github-webhook.d.ts +0 -45
- package/dist/connectors/github-webhook.js +0 -321
- package/dist/connectors/github-webhook.js.map +0 -1
- package/dist/connectors/index.d.ts +0 -18
- package/dist/connectors/index.js +0 -41
- package/dist/connectors/index.js.map +0 -1
- package/dist/connectors/messaging/base.d.ts +0 -42
- package/dist/connectors/messaging/base.js +0 -139
- package/dist/connectors/messaging/base.js.map +0 -1
- package/dist/connectors/messaging/delivery.d.ts +0 -14
- package/dist/connectors/messaging/delivery.js +0 -38
- package/dist/connectors/messaging/delivery.js.map +0 -1
- package/dist/connectors/messaging/index.d.ts +0 -4
- package/dist/connectors/messaging/index.js +0 -4
- package/dist/connectors/messaging/index.js.map +0 -1
- package/dist/connectors/messaging/session-manager.d.ts +0 -53
- package/dist/connectors/messaging/session-manager.js +0 -255
- package/dist/connectors/messaging/session-manager.js.map +0 -1
- package/dist/connectors/messaging/types.d.ts +0 -58
- package/dist/connectors/messaging/types.js +0 -7
- package/dist/connectors/messaging/types.js.map +0 -1
- package/dist/connectors/slack/connector.d.ts +0 -100
- package/dist/connectors/slack/connector.js +0 -341
- package/dist/connectors/slack/connector.js.map +0 -1
- package/dist/connectors/slack/index.d.ts +0 -2
- package/dist/connectors/slack/index.js +0 -3
- package/dist/connectors/slack/index.js.map +0 -1
- package/dist/connectors/slack/mrkdwn.d.ts +0 -8
- package/dist/connectors/slack/mrkdwn.js +0 -123
- package/dist/connectors/slack/mrkdwn.js.map +0 -1
- package/dist/connectors/types.d.ts +0 -61
- package/dist/connectors/types.js +0 -2
- package/dist/connectors/types.js.map +0 -1
- package/dist/cron/fanout.d.ts +0 -33
- package/dist/cron/fanout.js +0 -55
- package/dist/cron/fanout.js.map +0 -1
- package/dist/cron/jobs.d.ts +0 -18
- package/dist/cron/jobs.js +0 -37
- package/dist/cron/jobs.js.map +0 -1
- package/dist/cron/scheduler.d.ts +0 -45
- package/dist/cron/scheduler.js +0 -105
- package/dist/cron/scheduler.js.map +0 -1
- package/dist/engine/agent-executor.d.ts +0 -34
- package/dist/engine/agent-executor.js +0 -246
- package/dist/engine/agent-executor.js.map +0 -1
- package/dist/engine/chat/chat-runner.d.ts +0 -132
- package/dist/engine/chat/chat-runner.js +0 -424
- package/dist/engine/chat/chat-runner.js.map +0 -1
- package/dist/engine/chat/chat-skills.d.ts +0 -45
- package/dist/engine/chat/chat-skills.js +0 -184
- package/dist/engine/chat/chat-skills.js.map +0 -1
- package/dist/engine/chat/chat.d.ts +0 -54
- package/dist/engine/chat/chat.js +0 -316
- package/dist/engine/chat/chat.js.map +0 -1
- package/dist/engine/chat/message-batcher.d.ts +0 -32
- package/dist/engine/chat/message-batcher.js +0 -109
- package/dist/engine/chat/message-batcher.js.map +0 -1
- package/dist/engine/dispatcher.d.ts +0 -73
- package/dist/engine/dispatcher.js +0 -663
- package/dist/engine/dispatcher.js.map +0 -1
- package/dist/engine/event-shim.d.ts +0 -117
- package/dist/engine/event-shim.js +0 -435
- package/dist/engine/event-shim.js.map +0 -1
- package/dist/engine/executors/orchestrator.d.ts +0 -81
- package/dist/engine/executors/orchestrator.js +0 -365
- package/dist/engine/executors/orchestrator.js.map +0 -1
- package/dist/engine/executors/shared.d.ts +0 -189
- package/dist/engine/executors/shared.js +0 -616
- package/dist/engine/executors/shared.js.map +0 -1
- package/dist/engine/github/git-auth.d.ts +0 -62
- package/dist/engine/github/git-auth.js +0 -161
- package/dist/engine/github/git-auth.js.map +0 -1
- package/dist/engine/github/github-app-client.d.ts +0 -23
- package/dist/engine/github/github-app-client.js +0 -33
- package/dist/engine/github/github-app-client.js.map +0 -1
- package/dist/engine/github/github-tools.d.ts +0 -18
- package/dist/engine/github/github-tools.js +0 -263
- package/dist/engine/github/github-tools.js.map +0 -1
- package/dist/engine/github/github.d.ts +0 -1193
- package/dist/engine/github/github.js +0 -357
- package/dist/engine/github/github.js.map +0 -1
- package/dist/engine/github/profiles.d.ts +0 -279
- package/dist/engine/github/profiles.js +0 -42
- package/dist/engine/github/profiles.js.map +0 -1
- package/dist/engine/github/review-poster.d.ts +0 -98
- package/dist/engine/github/review-poster.js +0 -177
- package/dist/engine/github/review-poster.js.map +0 -1
- package/dist/engine/llm.d.ts +0 -79
- package/dist/engine/llm.js +0 -269
- package/dist/engine/llm.js.map +0 -1
- package/dist/engine/oauth.d.ts +0 -43
- package/dist/engine/oauth.js +0 -103
- package/dist/engine/oauth.js.map +0 -1
- package/dist/engine/router.d.ts +0 -29
- package/dist/engine/router.js +0 -680
- package/dist/engine/router.js.map +0 -1
- package/dist/engine/screen/classifier.d.ts +0 -93
- package/dist/engine/screen/classifier.js +0 -215
- package/dist/engine/screen/classifier.js.map +0 -1
- package/dist/engine/screen/screen.d.ts +0 -41
- package/dist/engine/screen/screen.js +0 -93
- package/dist/engine/screen/screen.js.map +0 -1
- package/dist/evals-api.d.ts +0 -24
- package/dist/evals-api.js +0 -22
- package/dist/evals-api.js.map +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -923
- package/dist/index.js.map +0 -1
- package/dist/managed-repos.d.ts +0 -30
- package/dist/managed-repos.js +0 -72
- package/dist/managed-repos.js.map +0 -1
- package/dist/notify/index.d.ts +0 -15
- package/dist/notify/index.js +0 -6
- package/dist/notify/index.js.map +0 -1
- package/dist/notify/model.d.ts +0 -57
- package/dist/notify/model.js +0 -89
- package/dist/notify/model.js.map +0 -1
- package/dist/notify/notifier.d.ts +0 -17
- package/dist/notify/notifier.js +0 -87
- package/dist/notify/notifier.js.map +0 -1
- package/dist/notify/render.d.ts +0 -21
- package/dist/notify/render.js +0 -59
- package/dist/notify/render.js.map +0 -1
- package/dist/notify/transports/github.d.ts +0 -26
- package/dist/notify/transports/github.js +0 -26
- package/dist/notify/transports/github.js.map +0 -1
- package/dist/notify/transports/slack.d.ts +0 -26
- package/dist/notify/transports/slack.js +0 -28
- package/dist/notify/transports/slack.js.map +0 -1
- package/dist/notify/types.d.ts +0 -95
- package/dist/notify/types.js +0 -16
- package/dist/notify/types.js.map +0 -1
- package/dist/providers.d.ts +0 -125
- package/dist/providers.js +0 -279
- package/dist/providers.js.map +0 -1
- package/dist/sandbox/docker.d.ts +0 -180
- package/dist/sandbox/docker.js +0 -517
- package/dist/sandbox/docker.js.map +0 -1
- package/dist/sandbox/egress-allowlist.d.ts +0 -74
- package/dist/sandbox/egress-allowlist.js +0 -164
- package/dist/sandbox/egress-allowlist.js.map +0 -1
- package/dist/sandbox/egress-firewall-config.d.ts +0 -127
- package/dist/sandbox/egress-firewall-config.js +0 -434
- package/dist/sandbox/egress-firewall-config.js.map +0 -1
- package/dist/sandbox/images.d.ts +0 -23
- package/dist/sandbox/images.js +0 -55
- package/dist/sandbox/images.js.map +0 -1
- package/dist/sandbox/index.d.ts +0 -112
- package/dist/sandbox/index.js +0 -332
- package/dist/sandbox/index.js.map +0 -1
- package/dist/sandbox/sandbox.d.ts +0 -214
- package/dist/sandbox/sandbox.js +0 -453
- package/dist/sandbox/sandbox.js.map +0 -1
- package/dist/sandbox/smol.d.ts +0 -162
- package/dist/sandbox/smol.js +0 -485
- package/dist/sandbox/smol.js.map +0 -1
- package/dist/session-log.d.ts +0 -63
- package/dist/session-log.js +0 -290
- package/dist/session-log.js.map +0 -1
- package/dist/state/approval-store.d.ts +0 -88
- package/dist/state/approval-store.js +0 -149
- package/dist/state/approval-store.js.map +0 -1
- package/dist/state/build-assets.d.ts +0 -50
- package/dist/state/build-assets.js +0 -154
- package/dist/state/build-assets.js.map +0 -1
- package/dist/state/db.d.ts +0 -81
- package/dist/state/db.js +0 -155
- package/dist/state/db.js.map +0 -1
- package/dist/state/execution-store.d.ts +0 -257
- package/dist/state/execution-store.js +0 -527
- package/dist/state/execution-store.js.map +0 -1
- package/dist/state/migrate.d.ts +0 -15
- package/dist/state/migrate.js +0 -175
- package/dist/state/migrate.js.map +0 -1
- package/dist/state/workflow-run-store.d.ts +0 -216
- package/dist/state/workflow-run-store.js +0 -403
- package/dist/state/workflow-run-store.js.map +0 -1
- package/dist/telemetry/index.d.ts +0 -38
- package/dist/telemetry/index.js +0 -253
- package/dist/telemetry/index.js.map +0 -1
- package/dist/telemetry/pi-events.d.ts +0 -12
- package/dist/telemetry/pi-events.js +0 -134
- package/dist/telemetry/pi-events.js.map +0 -1
- package/dist/workflows/dag.d.ts +0 -37
- package/dist/workflows/dag.js +0 -118
- package/dist/workflows/dag.js.map +0 -1
- package/dist/workflows/loader.d.ts +0 -53
- package/dist/workflows/loader.js +0 -421
- package/dist/workflows/loader.js.map +0 -1
- package/dist/workflows/loop-eval.d.ts +0 -28
- package/dist/workflows/loop-eval.js +0 -74
- package/dist/workflows/loop-eval.js.map +0 -1
- package/dist/workflows/phase-executor.d.ts +0 -215
- package/dist/workflows/phase-executor.js +0 -1144
- package/dist/workflows/phase-executor.js.map +0 -1
- package/dist/workflows/phase-ref.d.ts +0 -50
- package/dist/workflows/phase-ref.js +0 -91
- package/dist/workflows/phase-ref.js.map +0 -1
- package/dist/workflows/resume.d.ts +0 -58
- package/dist/workflows/resume.js +0 -313
- package/dist/workflows/resume.js.map +0 -1
- package/dist/workflows/runner.d.ts +0 -63
- package/dist/workflows/runner.js +0 -364
- package/dist/workflows/runner.js.map +0 -1
- package/dist/workflows/schema.d.ts +0 -344
- package/dist/workflows/schema.js +0 -460
- package/dist/workflows/schema.js.map +0 -1
- package/dist/workflows/simple.d.ts +0 -90
- package/dist/workflows/simple.js +0 -393
- package/dist/workflows/simple.js.map +0 -1
- package/dist/workflows/target-policy.d.ts +0 -74
- package/dist/workflows/target-policy.js +0 -80
- package/dist/workflows/target-policy.js.map +0 -1
- package/dist/workflows/templates.d.ts +0 -88
- package/dist/workflows/templates.js +0 -127
- package/dist/workflows/templates.js.map +0 -1
- package/dist/workflows/triggers.d.ts +0 -21
- package/dist/workflows/triggers.js +0 -45
- package/dist/workflows/triggers.js.map +0 -1
- package/dist/workflows/verdict.d.ts +0 -19
- package/dist/workflows/verdict.js +0 -30
- package/dist/workflows/verdict.js.map +0 -1
- package/dist/worktree/manager.d.ts +0 -43
- package/dist/worktree/manager.js +0 -127
- package/dist/worktree/manager.js.map +0 -1
- package/docker-compose.yml +0 -274
- package/sandbox.Dockerfile +0 -68
- package/skills/README.md +0 -42
- package/skills/browser-qa/SKILL.md +0 -208
- package/skills/browser-qa/scripts/agent-browser.mjs +0 -531
- package/skills/building/SKILL.md +0 -95
- package/skills/chat/SKILL.md +0 -36
- package/skills/code-review/SKILL.md +0 -82
- package/skills/debug-production/SKILL.md +0 -108
- package/skills/demo/SKILL.md +0 -228
- package/skills/demo/scripts/compose-demo.sh +0 -243
- package/skills/issue-answer/SKILL.md +0 -91
- package/skills/issue-comment/SKILL.md +0 -49
- package/skills/issue-triage/SKILL.md +0 -149
- package/skills/issue-triage/references/AGENT-BRIEF.md +0 -65
- package/skills/pr-comment/SKILL.md +0 -64
- package/skills/pr-review/SKILL.md +0 -148
- package/skills/pr-review/references/findings-schema.md +0 -89
- package/skills/qa-test/SKILL.md +0 -97
- package/skills/repo-health/SKILL.md +0 -67
- package/skills/security-feedback/SKILL.md +0 -173
- package/skills/security-feedback/references/templates.md +0 -77
- package/skills/security-review/SKILL.md +0 -215
- package/skills/security-review/references/issue-format.md +0 -302
- package/skills/verify/SKILL.md +0 -118
- package/workflows/answer.yaml +0 -44
- package/workflows/build.yaml +0 -129
- package/workflows/cron-health.yaml +0 -6
- package/workflows/cron-review.yaml +0 -8
- package/workflows/cron-security.yaml +0 -6
- package/workflows/cron-triage.yaml +0 -8
- package/workflows/demo.yaml +0 -62
- package/workflows/examples/bash-smoke.yaml +0 -41
- package/workflows/examples/parallel-review.yaml +0 -36
- package/workflows/examples/tdd-loop.yaml +0 -17
- package/workflows/explore.yaml +0 -80
- package/workflows/issue-comment.yaml +0 -15
- package/workflows/issue-triage.yaml +0 -22
- package/workflows/pr-comment.yaml +0 -16
- package/workflows/pr-fix.yaml +0 -17
- package/workflows/pr-review.yaml +0 -50
- package/workflows/prompts/answer.md +0 -68
- package/workflows/prompts/architect.md +0 -44
- package/workflows/prompts/classifier.md +0 -60
- package/workflows/prompts/classify-adds-info.md +0 -17
- package/workflows/prompts/demo.md +0 -125
- package/workflows/prompts/executor.md +0 -42
- package/workflows/prompts/explore-ask.md +0 -99
- package/workflows/prompts/explore-publish.md +0 -31
- package/workflows/prompts/explore-read.md +0 -120
- package/workflows/prompts/explore-synthesize.md +0 -88
- package/workflows/prompts/fix.md +0 -18
- package/workflows/prompts/guardrails.md +0 -96
- package/workflows/prompts/pr-fix.md +0 -26
- package/workflows/prompts/pr.md +0 -39
- package/workflows/prompts/qa-browser.md +0 -95
- package/workflows/prompts/qa-synth.md +0 -44
- package/workflows/prompts/qa-test.md +0 -60
- package/workflows/prompts/re-reviewer.md +0 -33
- package/workflows/prompts/reviewer.md +0 -60
- package/workflows/prompts/verify-browser.md +0 -93
- package/workflows/prompts/verify-synth.md +0 -44
- package/workflows/prompts/verify.md +0 -63
- package/workflows/qa-test.yaml +0 -94
- package/workflows/repo-health.yaml +0 -15
- package/workflows/security-feedback.yaml +0 -25
- package/workflows/security-review.yaml +0 -37
- package/workflows/verify.yaml +0 -93
- /package/dist/{cli/cli-config.d.ts → cli-config.d.ts} +0 -0
- /package/dist/{cli/cli-config.js → cli-config.js} +0 -0
- /package/dist/{cli/cli-format.d.ts → cli-format.d.ts} +0 -0
- /package/dist/{cli/cli-format.js → cli-format.js} +0 -0
- /package/dist/{cli/cli-timeline.d.ts → cli-timeline.d.ts} +0 -0
- /package/dist/{cli/cli-timeline.js → cli-timeline.js} +0 -0
- /package/dist/{cli/cli.d.ts → cli.d.ts} +0 -0
- /package/dist/{cli/oauth-cli.d.ts → oauth-cli.d.ts} +0 -0
- /package/dist/{cli/setup.d.ts → setup.d.ts} +0 -0
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import type { ExecutorConfig, ExecutionResult, GitSandboxAccess } from "../engine/github/profiles.js";
|
|
2
|
-
import { type CommandSpec } from "../engine/agent-executor.js";
|
|
3
|
-
import type { StateDb } from "../state/db.js";
|
|
4
|
-
import type { AgentWorkflowDefinition, PhaseDefinition } from "./schema.js";
|
|
5
|
-
import { type TemplateContext } from "./templates.js";
|
|
6
|
-
import type { DagNode } from "./dag.js";
|
|
7
|
-
import type { PhaseResult } from "./runner.js";
|
|
8
|
-
import type { StepStatus, ProgressStep } from "../notify/types.js";
|
|
9
|
-
/**
|
|
10
|
-
* The single per-phase executor. Constructed once per workflow run, it owns
|
|
11
|
-
* every per-phase body — context / standard agent / reviewer-loop /
|
|
12
|
-
* generic-loop — behind one `execute(node, outputs)` entry point. The
|
|
13
|
-
* scheduler (`runner.ts`) owns the DAG, the `phases[]`/`outputs{}`
|
|
14
|
-
* accumulation, and the in-memory node status; `execute` reads the current
|
|
15
|
-
* outputs and returns its delta.
|
|
16
|
-
*
|
|
17
|
-
* Dependencies are grouped into three cohesive collaborators:
|
|
18
|
-
* - {@link PhaseRunContext} run-scoped immutable data
|
|
19
|
-
* - {@link PhaseReporter} progress / notification surface
|
|
20
|
-
* - {@link PhaseResolver} model / variant / prompt / gate resolution
|
|
21
|
-
*
|
|
22
|
-
* This makes the executor unit-testable with fakes (see
|
|
23
|
-
* `phase-executor.test.ts`), and — because both chain and explicit-DAG nodes
|
|
24
|
-
* now route through the same code — loop nodes finally support the approval /
|
|
25
|
-
* reply gates that the old DAG fork dropped.
|
|
26
|
-
*/
|
|
27
|
-
/** Run-scoped immutable data shared by every phase execution. */
|
|
28
|
-
export interface PhaseRunContext {
|
|
29
|
-
definition: AgentWorkflowDefinition;
|
|
30
|
-
ctx: TemplateContext;
|
|
31
|
-
config: ExecutorConfig;
|
|
32
|
-
/** Single workspace shared by every phase + loop iteration of the run. */
|
|
33
|
-
taskId: string;
|
|
34
|
-
triggerId: string;
|
|
35
|
-
githubAccess: GitSandboxAccess;
|
|
36
|
-
/** Mutable scratch bag (generic-loop resume state). */
|
|
37
|
-
scratch: Record<string, unknown>;
|
|
38
|
-
db?: StateDb;
|
|
39
|
-
workflowId?: string;
|
|
40
|
-
}
|
|
41
|
-
export interface ReportStepOpts {
|
|
42
|
-
label?: string;
|
|
43
|
-
insertBefore?: string;
|
|
44
|
-
insert?: boolean;
|
|
45
|
-
alsoNote?: boolean;
|
|
46
|
-
}
|
|
47
|
-
/** Progress / notification surface — the reporting collaborator. */
|
|
48
|
-
export interface PhaseReporter {
|
|
49
|
-
onStart(phase: string): Promise<void>;
|
|
50
|
-
onEnd(phase: string, result: PhaseResult): Promise<void>;
|
|
51
|
-
/** Transition a checklist step (and optionally render a YAML message detail). */
|
|
52
|
-
step(key: string, status: StepStatus, template?: string, extraCtx?: Partial<TemplateContext>, opts?: ReportStepOpts): Promise<void>;
|
|
53
|
-
/** Render a YAML message template and post it as a standalone note. */
|
|
54
|
-
message(template: string | undefined, extraCtx?: Partial<TemplateContext>): Promise<void>;
|
|
55
|
-
/** Post a pre-rendered standalone message. */
|
|
56
|
-
postNote(text: string): Promise<void>;
|
|
57
|
-
/** Persist a phase-history entry on the workflow run. */
|
|
58
|
-
persistPhase(phase: string, summary?: string): void;
|
|
59
|
-
/** Mark the workflow run failed. */
|
|
60
|
-
failWorkflow(errorMsg?: string): void;
|
|
61
|
-
}
|
|
62
|
-
/** Model / variant / prompt / gate resolution — the resolution collaborator. */
|
|
63
|
-
export interface PhaseResolver {
|
|
64
|
-
modelFor(taskType: string): string | undefined;
|
|
65
|
-
variantFor(taskType: string): string | undefined;
|
|
66
|
-
renderPrompt(promptPath: string, extraCtx?: Partial<TemplateContext>): string;
|
|
67
|
-
gateEnabled(gateName: string | undefined): boolean;
|
|
68
|
-
}
|
|
69
|
-
/** The delta a single `execute(node, outputs)` returns to the scheduler. */
|
|
70
|
-
export interface PhaseOutcome {
|
|
71
|
-
results: PhaseResult[];
|
|
72
|
-
status: "succeeded" | "failed" | "skipped";
|
|
73
|
-
/** Approval / reply gate hit — scheduler returns `{ success: true, paused: true }`. */
|
|
74
|
-
paused?: boolean;
|
|
75
|
-
/**
|
|
76
|
-
* Dedup running-skip — another instance is mid-flight on this exact phase.
|
|
77
|
-
* Scheduler stops the whole run immediately with `success: false` and does
|
|
78
|
-
* NOT cascade skips (it isn't a phase failure).
|
|
79
|
-
*/
|
|
80
|
-
aborted?: boolean;
|
|
81
|
-
/** Output map additions to merge into the scheduler's accumulated outputs. */
|
|
82
|
-
outputVars?: Record<string, unknown>;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Build the agent prompt for a phase, handling both `prompt:` (template file)
|
|
86
|
-
* and `skill:`/`skills:` (skill references) phase definitions.
|
|
87
|
-
*/
|
|
88
|
-
export declare function buildPhasePrompt(phase: PhaseDefinition, ctx: TemplateContext, extraCtx?: Partial<TemplateContext>): string;
|
|
89
|
-
/**
|
|
90
|
-
* Overlay per-phase executor config fields (`unrestricted_egress`,
|
|
91
|
-
* `web_search`, `sandbox_image`, resolved skill paths) onto the run-level
|
|
92
|
-
* config.
|
|
93
|
-
*/
|
|
94
|
-
export declare function phaseConfigFor(config: ExecutorConfig, phase: PhaseDefinition): ExecutorConfig;
|
|
95
|
-
/** Check if an error was caused by manual termination (OOM/cancel/kill). */
|
|
96
|
-
export declare function isTerminated(error?: string): boolean;
|
|
97
|
-
/**
|
|
98
|
-
* Classify an execution outcome as *soft* — a clean exit that produced no
|
|
99
|
-
* usable output — versus *hard* (a real crash). Generic and phase-agnostic:
|
|
100
|
-
* it reads only the result fields, with no notion of reviewer/socratic. Both
|
|
101
|
-
* the reviewer loop and the generic loop consume it so their recovery logic
|
|
102
|
-
* stays in lockstep. A soft outcome is recoverable (retry / trust an on-disk
|
|
103
|
-
* artifact / advance); a hard one — terminated, fatal, tool error, non-zero
|
|
104
|
-
* exit — is not. See `mapStopReason` in the executors for the stop-reason
|
|
105
|
-
* vocabulary this keys off (`unknown` / `error_truncated` are the soft ones).
|
|
106
|
-
*/
|
|
107
|
-
export declare function isSoftOutcome(r: Pick<ExecutionResult, "success" | "error" | "stopReason">): boolean;
|
|
108
|
-
type RunPhaseResult = {
|
|
109
|
-
result: ExecutionResult;
|
|
110
|
-
executionId: string;
|
|
111
|
-
skipped: false;
|
|
112
|
-
} | {
|
|
113
|
-
result: ExecutionResult;
|
|
114
|
-
skipped: false;
|
|
115
|
-
} | {
|
|
116
|
-
skipped: true;
|
|
117
|
-
reason: "running" | "done";
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* Run a single agent phase with DB-tracked deduplication. The dedup ledger
|
|
121
|
-
* (`shouldRunPhase`) is the single source of truth for resume, so re-running
|
|
122
|
-
* from the top skips completed phases here.
|
|
123
|
-
*/
|
|
124
|
-
export declare function runPhase(workflowName: string, phaseName: string, taskId: string, triggerId: string, prompt: string, config: ExecutorConfig, db?: StateDb, modelOverride?: string, workflowRunId?: string, githubAccess?: GitSandboxAccess, variantOverride?: string): Promise<RunPhaseResult>;
|
|
125
|
-
/**
|
|
126
|
-
* Run a single deterministic `bash`/`script` phase, sharing the agent phase's
|
|
127
|
-
* dedup ledger + executions row so it appears (and dedups on resume) exactly
|
|
128
|
-
* like an agent phase — just with `turns: 0` and no model cost.
|
|
129
|
-
*/
|
|
130
|
-
export declare function runCommandPhase(workflowName: string, phaseName: string, taskId: string, triggerId: string, spec: CommandSpec, config: ExecutorConfig, db?: StateDb, workflowRunId?: string, githubAccess?: GitSandboxAccess, timeoutSeconds?: number, sandboxEnv?: Record<string, string>): Promise<RunPhaseResult>;
|
|
131
|
-
export declare class PhaseExecutor {
|
|
132
|
-
private readonly run;
|
|
133
|
-
private readonly reporter;
|
|
134
|
-
private readonly resolver;
|
|
135
|
-
constructor(run: PhaseRunContext, reporter: PhaseReporter, resolver: PhaseResolver);
|
|
136
|
-
/**
|
|
137
|
-
* Execute one DAG node and return its delta. The scheduler accumulates
|
|
138
|
-
* `results` into `phases[]`, merges `outputVars` into the shared outputs
|
|
139
|
-
* map, and maps `status`/`paused`/`aborted` onto node state + run control.
|
|
140
|
-
*/
|
|
141
|
-
execute(node: DagNode, outputs: Readonly<Record<string, unknown>>): Promise<PhaseOutcome>;
|
|
142
|
-
private runContext;
|
|
143
|
-
/**
|
|
144
|
-
* First-class, in-process PR-review submission (`type: post-review`). The
|
|
145
|
-
* reviewer agent writes only *content* to `.lastlight/pr-review/findings.json`
|
|
146
|
-
* (`{ skip?, summary, event, findings[] }`); THIS action supplies every fact
|
|
147
|
-
* the harness already knows — the PR number (from the run context), the base
|
|
148
|
-
* ref, the head SHA and the diff (from the pre-cloned checkout) — anchors each
|
|
149
|
-
* finding to a changed line, and posts one formal review via `GitHubClient`.
|
|
150
|
-
*
|
|
151
|
-
* This replaces the ~150-line in-sandbox `type: script` blob that depended on
|
|
152
|
-
* the AI hand-copying `pr_number`/`base_ref`/`head_sha` into the JSON and
|
|
153
|
-
* silently `exit 0`'d on any mismatch (the "ran but posted nothing" bug).
|
|
154
|
-
* Here a genuine failure — missing findings after a real review, or a GitHub
|
|
155
|
-
* error that survives the body-only retry — FAILS the phase visibly; only a
|
|
156
|
-
* legitimate `skip` succeeds without posting. Idempotent on resume: it no-ops
|
|
157
|
-
* when a bot review already exists on the current head SHA.
|
|
158
|
-
*/
|
|
159
|
-
private runPostReview;
|
|
160
|
-
/** Host path of the run's repo checkout — mirrors sandbox/index.ts layout. */
|
|
161
|
-
/**
|
|
162
|
-
* The reviewer's authoritative verdict lives in reviewer-verdict.md (its
|
|
163
|
-
* OUTPUT CONTRACT), so recover it when the stdout marker is missing. Server
|
|
164
|
-
* mode reads the harvested doc from the build-asset store; repo mode reads the
|
|
165
|
-
* committed doc from the host checkout under issueDir. Returns the parsed
|
|
166
|
-
* verdict only when the file actually carries a `VERDICT:` marker (else
|
|
167
|
-
* undefined — we don't want to launder the same fragile fallback through a
|
|
168
|
-
* different source).
|
|
169
|
-
*/
|
|
170
|
-
private readReviewerVerdictFromFile;
|
|
171
|
-
private resolveHostRepoDir;
|
|
172
|
-
/** Build the GitHub client for the post: token+baseUrl in evals, App auth in prod. */
|
|
173
|
-
private buildReviewClient;
|
|
174
|
-
private gitHeadSha;
|
|
175
|
-
/** Compute the base…head diff locally and parse it into a commentable set. */
|
|
176
|
-
private gitCommentableDiff;
|
|
177
|
-
/** Resolve model + variant for a phase/task, honouring YAML templates first. */
|
|
178
|
-
private resolveModelVariant;
|
|
179
|
-
private runPhaseCall;
|
|
180
|
-
private runStandard;
|
|
181
|
-
/**
|
|
182
|
-
* Body for `type: bash` / `type: script` phases. Runs a deterministic command
|
|
183
|
-
* in the sandbox (no LLM), then mirrors the agent-phase lifecycle: report
|
|
184
|
-
* progress, expose stdout downstream via `output_var` →
|
|
185
|
-
* `{{phaseOutputs.<name>.output}}`, fail the workflow on a non-zero exit, and
|
|
186
|
-
* honour an optional `approval_gate`.
|
|
187
|
-
*/
|
|
188
|
-
private runCommandBody;
|
|
189
|
-
/** Render a command/script phase's template fields into a {@link CommandSpec}. */
|
|
190
|
-
private buildCommandSpec;
|
|
191
|
-
private runCommandPhaseCall;
|
|
192
|
-
/**
|
|
193
|
-
* Evaluate a `generic_loop.until_bash` condition INSIDE the sandbox (against
|
|
194
|
-
* the persisted workspace), replacing the old harness-host `execSync`. Exit 0
|
|
195
|
-
* ⇒ loop complete. The check inherits the phase's egress; no session log is
|
|
196
|
-
* written (it's an internal loop condition, not a user-facing phase).
|
|
197
|
-
*/
|
|
198
|
-
private runUntilBash;
|
|
199
|
-
/**
|
|
200
|
-
* Evaluate the `contains_BLOCKED` rule. Returns "fail" when the workflow
|
|
201
|
-
* should fail, or "continue" when the marker is absent or bypassed.
|
|
202
|
-
*/
|
|
203
|
-
private evaluateBlocked;
|
|
204
|
-
/**
|
|
205
|
-
* Persist + pause for an approval/reply gate, atomically. The approval
|
|
206
|
-
* insert, the `waiting_approval` phase marker, the optional scratch persist
|
|
207
|
-
* (loops record their iteration/cycle state here), and the run pause all
|
|
208
|
-
* happen in one transaction via `db.runs.pauseForApproval` — a partial
|
|
209
|
-
* failure can't leave the run paused without its gate, or vice versa.
|
|
210
|
-
*/
|
|
211
|
-
private pauseForApproval;
|
|
212
|
-
private runReviewerLoop;
|
|
213
|
-
private runGenericLoop;
|
|
214
|
-
}
|
|
215
|
-
export type { ProgressStep };
|