lastlight 0.16.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 -142
- package/dist/connectors/slack/connector.js +0 -494
- 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 -19
- package/dist/connectors/slack/mrkdwn.js +0 -240
- 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 -940
- 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/blocks.d.ts +0 -23
- package/dist/notify/blocks.js +0 -118
- package/dist/notify/blocks.js.map +0 -1
- package/dist/notify/index.d.ts +0 -17
- package/dist/notify/index.js +0 -7
- 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 -18
- package/dist/notify/notifier.js +0 -100
- 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 -27
- package/dist/notify/transports/github.js.map +0 -1
- package/dist/notify/transports/slack.d.ts +0 -27
- package/dist/notify/transports/slack.js +0 -37
- package/dist/notify/transports/slack.js.map +0 -1
- package/dist/notify/types.d.ts +0 -119
- 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 -222
- package/dist/workflows/phase-executor.js +0 -1153
- 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 -381
- 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
package/dist/workflows/schema.js
DELETED
|
@@ -1,460 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
// ── Output rules ──────────────────────────────────────────────────────
|
|
3
|
-
const OutputRuleSchema = z.object({
|
|
4
|
-
action: z.enum(["fail", "continue", "pause"]),
|
|
5
|
-
message: z.string().optional(),
|
|
6
|
-
/** Skip the action if the request has this label */
|
|
7
|
-
unless_label: z.string().optional(),
|
|
8
|
-
/** Skip the action if ctx.issueTitle matches this case-insensitive regex */
|
|
9
|
-
unless_title_matches: z.string().optional(),
|
|
10
|
-
/** Template rendered when an `unless_*` clause fires and the rule is bypassed */
|
|
11
|
-
bypass_message: z.string().optional(),
|
|
12
|
-
});
|
|
13
|
-
const PhaseOnOutputSchema = z.object({
|
|
14
|
-
contains_BLOCKED: OutputRuleSchema.optional(),
|
|
15
|
-
contains_READY: OutputRuleSchema.optional(),
|
|
16
|
-
});
|
|
17
|
-
// ── Loop configuration ────────────────────────────────────────────────
|
|
18
|
-
const PhaseLoopMessagesSchema = z.object({
|
|
19
|
-
on_cycle_start: z.string().optional(),
|
|
20
|
-
on_approved: z.string().optional(),
|
|
21
|
-
on_request_changes: z.string().optional(),
|
|
22
|
-
on_max_cycles: z.string().optional(),
|
|
23
|
-
on_fix_start: z.string().optional(),
|
|
24
|
-
on_fix_failed: z.string().optional(),
|
|
25
|
-
on_pause_for_approval: z.string().optional(),
|
|
26
|
-
});
|
|
27
|
-
const PhaseLoopSchema = z.object({
|
|
28
|
-
max_cycles: z.number().int().positive(),
|
|
29
|
-
on_request_changes: z.object({
|
|
30
|
-
fix_prompt: z.string(),
|
|
31
|
-
fix_model: z.string().optional(),
|
|
32
|
-
/** Reasoning-effort override for the fix cycle (e.g. {{variants.fix}}). */
|
|
33
|
-
fix_variant: z.string().optional(),
|
|
34
|
-
re_review_prompt: z.string(),
|
|
35
|
-
}),
|
|
36
|
-
/** Gate to pause at before running the fix (optional) */
|
|
37
|
-
approval_gate: z.string().optional(),
|
|
38
|
-
/**
|
|
39
|
-
* Artifact (handoff doc) filename this gate is asking the reviewer to
|
|
40
|
-
* approve, e.g. `reviewer-verdict.md`. Surfaced by the focused approval
|
|
41
|
-
* view so the reviewer reads/edits the right doc before approving.
|
|
42
|
-
*/
|
|
43
|
-
approval_artifact: z.string().optional(),
|
|
44
|
-
/** Optional per-event notification templates rendered through the template engine. */
|
|
45
|
-
messages: PhaseLoopMessagesSchema.optional(),
|
|
46
|
-
});
|
|
47
|
-
const GenericLoopSchema = z
|
|
48
|
-
.object({
|
|
49
|
-
max_iterations: z.number().int().positive(),
|
|
50
|
-
/** Expression to evaluate for completion: "output.contains('PASS')" or "verdict == 'APPROVED'" */
|
|
51
|
-
until: z.string().optional(),
|
|
52
|
-
/** Shell command: exit 0 = loop complete, non-zero = continue */
|
|
53
|
-
until_bash: z.string().optional(),
|
|
54
|
-
/** Pause for human approval between iterations */
|
|
55
|
-
interactive: z.boolean().default(false),
|
|
56
|
-
/** Message shown at the interactive gate */
|
|
57
|
-
gate_message: z.string().optional(),
|
|
58
|
-
/**
|
|
59
|
-
* Gate flavor for interactive loops. `approve` (default when absent)
|
|
60
|
-
* pauses until the user sends an explicit approve/reject command;
|
|
61
|
-
* `reply` pauses until the user sends *any* free-form message in the
|
|
62
|
-
* same thread — the reply body is merged into `scratch` and passed
|
|
63
|
-
* into the next iteration. Used by the socratic explore loop.
|
|
64
|
-
*/
|
|
65
|
-
gate_kind: z.enum(["approve", "reply"]).optional(),
|
|
66
|
-
/**
|
|
67
|
-
* Dotted key into `scratch` that the loop writes the current
|
|
68
|
-
* iteration state under (e.g. `socratic`). Only meaningful when
|
|
69
|
-
* `gate_kind: reply` — the runner reads it back on resume to continue
|
|
70
|
-
* from the right iteration instead of restarting from 1.
|
|
71
|
-
*/
|
|
72
|
-
scratch_key: z.string().optional(),
|
|
73
|
-
/** Reset agent context each iteration (don't pass previousOutput) */
|
|
74
|
-
fresh_context: z.boolean().default(false),
|
|
75
|
-
/**
|
|
76
|
-
* Policy for a *soft* iteration outcome — the agent exited cleanly but
|
|
77
|
-
* produced no usable output (stop reason `unknown` / `error_truncated`),
|
|
78
|
-
* as opposed to a real crash (fatal / tool error / non-zero exit /
|
|
79
|
-
* terminated), which always fails the run. Absent ⇒ `{ retries: 0, then:
|
|
80
|
-
* "fail" }`, i.e. any non-success iteration hard-fails the workflow (the
|
|
81
|
-
* historical behavior). Opt in to make a loop resilient to a degenerate
|
|
82
|
-
* turn — e.g. the socratic explore loop retries once, then advances to
|
|
83
|
-
* synthesis with the Q&A gathered so far instead of discarding the run.
|
|
84
|
-
*/
|
|
85
|
-
on_soft_failure: z
|
|
86
|
-
.object({
|
|
87
|
-
/** Re-run the same iteration up to N times on a soft outcome. */
|
|
88
|
-
retries: z.number().int().min(0).default(0),
|
|
89
|
-
/**
|
|
90
|
-
* What to do when an iteration is still soft after `retries`:
|
|
91
|
-
* `fail` (default) hard-fails the workflow; `complete` treats the
|
|
92
|
-
* loop as finished (as if the `until` condition matched) and lets
|
|
93
|
-
* downstream phases run.
|
|
94
|
-
*/
|
|
95
|
-
then: z.enum(["fail", "complete"]).default("fail"),
|
|
96
|
-
})
|
|
97
|
-
.optional(),
|
|
98
|
-
})
|
|
99
|
-
.refine((v) => v.until !== undefined || v.until_bash !== undefined, {
|
|
100
|
-
message: "generic_loop requires at least one of: until, until_bash",
|
|
101
|
-
});
|
|
102
|
-
// ── Phase definition ──────────────────────────────────────────────────
|
|
103
|
-
const PhaseDefinitionSchema = z
|
|
104
|
-
.object({
|
|
105
|
-
name: z.string(),
|
|
106
|
-
/**
|
|
107
|
-
* Optional human-readable label for dashboards and notifications.
|
|
108
|
-
* Defaults to the phase `name` if not set. Source of truth for any
|
|
109
|
-
* UI element that wants to display this phase.
|
|
110
|
-
*/
|
|
111
|
-
label: z.string().optional(),
|
|
112
|
-
/**
|
|
113
|
-
* Phase kind:
|
|
114
|
-
* - `context`: no execution (just a dashboard checkpoint marker).
|
|
115
|
-
* - `agent` (default): run an LLM agent session.
|
|
116
|
-
* - `bash`: run a deterministic shell command inside the sandbox
|
|
117
|
-
* container (no LLM). Requires `command:`.
|
|
118
|
-
* - `script`: run an inline JS/TS (via `node`) or Python (via `uv run`)
|
|
119
|
-
* program inside the sandbox container. Requires `script:`.
|
|
120
|
-
* - `post-review`: first-class, in-process PR-review submission. Reads the
|
|
121
|
-
* reviewer agent's `.lastlight/pr-review/findings.json` (content only:
|
|
122
|
-
* `{ skip?, summary, event, findings[] }`), supplies the PR number / base
|
|
123
|
-
* ref / head SHA / diff from the harness's own run context + checkout,
|
|
124
|
-
* anchors each finding to a changed line, and posts ONE formal review via
|
|
125
|
-
* `GitHubClient`. Runs on the harness (no sandbox); a genuine failure
|
|
126
|
-
* fails the phase, a legitimate `skip` succeeds without posting. See
|
|
127
|
-
* `PhaseExecutor.runPostReview`.
|
|
128
|
-
*
|
|
129
|
-
* `bash`/`script` phases run in the SAME sandbox/workspace as agent
|
|
130
|
-
* phases (the host workDir persists across phases keyed by taskId), honour
|
|
131
|
-
* `unrestricted_egress`/`sandbox_image`/`timeout_seconds`, and expose
|
|
132
|
-
* their stdout downstream exactly like an agent phase (`output_var` →
|
|
133
|
-
* `{{phaseOutputs.<name>.output}}`). A non-zero exit fails the phase.
|
|
134
|
-
*/
|
|
135
|
-
type: z.enum(["context", "agent", "bash", "script", "post-review"]).default("agent"),
|
|
136
|
-
/**
|
|
137
|
-
* Shell command for `type: bash`. Rendered through the template engine
|
|
138
|
-
* first (so it may reference `{{phaseOutputs.*}}`, `{{branch}}`, etc.),
|
|
139
|
-
* then executed via `sh -c` inside the sandbox container. Exit 0 = success.
|
|
140
|
-
*/
|
|
141
|
-
command: z.string().optional(),
|
|
142
|
-
/**
|
|
143
|
-
* Inline program source for `type: script`. Rendered through the template
|
|
144
|
-
* engine, written to a temp file in the workspace, and executed with the
|
|
145
|
-
* runtime selected by `runtime`. Python sources may carry a PEP 723
|
|
146
|
-
* `# /// script` inline-dependency block (resolved by `uv run`).
|
|
147
|
-
*/
|
|
148
|
-
script: z.string().optional(),
|
|
149
|
-
/**
|
|
150
|
-
* Runtime for `type: script` (default `js`):
|
|
151
|
-
* - `js` → `node <file>`
|
|
152
|
-
* - `ts` → `node --experimental-strip-types <file>` (sandbox Node 22)
|
|
153
|
-
* - `python` → `uv run <file>`
|
|
154
|
-
*/
|
|
155
|
-
runtime: z.enum(["js", "ts", "python"]).optional(),
|
|
156
|
-
/**
|
|
157
|
-
* Per-step timeout in seconds for `bash`/`script` phases. Defaults to the
|
|
158
|
-
* sandbox's configured timeout (fallback 300s for deterministic steps).
|
|
159
|
-
*/
|
|
160
|
-
timeout_seconds: z.number().int().positive().optional(),
|
|
161
|
-
/**
|
|
162
|
-
* Path to a prompt template file (relative to workflowDir).
|
|
163
|
-
* Mutually exclusive with `skill`.
|
|
164
|
-
*/
|
|
165
|
-
prompt: z.string().optional(),
|
|
166
|
-
/**
|
|
167
|
-
* Single skill to make available to the phase. Sugar for
|
|
168
|
-
* `skills: [<name>]`. Mutually exclusive with `skills` (use one or
|
|
169
|
-
* the other), but may coexist with `prompt`.
|
|
170
|
-
*/
|
|
171
|
-
skill: z.string().optional(),
|
|
172
|
-
/**
|
|
173
|
-
* Skills to make available to the phase. Each entry names a directory
|
|
174
|
-
* under `skills/<name>/` (containing SKILL.md plus optional scripts/,
|
|
175
|
-
* references/, assets/). The first entry is the "primary" skill the
|
|
176
|
-
* runner directs the agent to use; the rest are available for the
|
|
177
|
-
* agent to read on demand via pi's progressive-disclosure model.
|
|
178
|
-
*
|
|
179
|
-
* Each named skill is staged into a per-phase bundle at
|
|
180
|
-
* `.lastlight-skills/<phaseName>/<name>/` before the agent runs (symlink
|
|
181
|
-
* in none, copy in docker/gondolin — a symlink's target would be outside
|
|
182
|
-
* the guest's mounted cwd and dangle) and mapped to the agent explicitly via
|
|
183
|
-
* pi's `--skill`/`skillPaths` (absolute paths). cwd stays the repo; the
|
|
184
|
-
* bundle is staged at the workspace root — a sibling of the repo, outside
|
|
185
|
-
* its git tree — for docker/none (gondolin, which mounts only cwd, stages
|
|
186
|
-
* it under the repo + local `.git/info/exclude` so it's never committed).
|
|
187
|
-
* Keyed per phase so concurrent phases can't clobber each other. Phases
|
|
188
|
-
* with no `skills:`/`skill:` field get no bundle — `prompt:`-only phases
|
|
189
|
-
* are unaffected.
|
|
190
|
-
*
|
|
191
|
-
* May coexist with `prompt`: when both are set, the prompt template
|
|
192
|
-
* is the user prompt and `skills:` just stages the catalogue. The
|
|
193
|
-
* prompt can then reference skills by name ("see the `pr-review`
|
|
194
|
-
* skill for the structured-feedback format") and the agent can
|
|
195
|
-
* read them via its built-in `read` tool.
|
|
196
|
-
*
|
|
197
|
-
* Mutually exclusive with the singular `skill:` field.
|
|
198
|
-
*/
|
|
199
|
-
skills: z.array(z.string()).min(1).optional(),
|
|
200
|
-
/** Model override — can reference template vars like {{models.architect}} */
|
|
201
|
-
model: z.string().optional(),
|
|
202
|
-
/**
|
|
203
|
-
* Reasoning-effort override — can reference template vars like
|
|
204
|
-
* `{{variants.architect}}`. Maps to agentic-pi's thinking level
|
|
205
|
-
* (`off | minimal | low | medium | high | xhigh`). pi-ai translates
|
|
206
|
-
* this into each provider's reasoning-effort API.
|
|
207
|
-
*/
|
|
208
|
-
variant: z.string().optional(),
|
|
209
|
-
/**
|
|
210
|
-
* Bypass the sandbox HTTP egress allowlist for this phase.
|
|
211
|
-
*
|
|
212
|
-
* Default: the phase runs with the standard allowlist (GitHub, LLM
|
|
213
|
-
* providers, public package registries — see
|
|
214
|
-
* `src/sandbox/egress-allowlist.ts`). Set `unrestricted_egress: true`
|
|
215
|
-
* for phases that need broad web access, e.g. an `explore` phase that
|
|
216
|
-
* searches third-party documentation. Use sparingly — this is the
|
|
217
|
-
* exfil control the allowlist exists to enforce.
|
|
218
|
-
*/
|
|
219
|
-
unrestricted_egress: z.boolean().optional(),
|
|
220
|
-
/**
|
|
221
|
-
* Enable agentic-pi's web-search extension (`web_search` /
|
|
222
|
-
* `web_fetch` tools) for this phase. Default: undefined → false.
|
|
223
|
-
*
|
|
224
|
-
* Set `true` on phases that should be able to search the web — e.g.
|
|
225
|
-
* the research phases of the `explore` workflow. The opt-out
|
|
226
|
-
* default is load-bearing: agentic-pi auto-enables web search
|
|
227
|
-
* whenever a provider env var (`TAVILY_API_KEY`,
|
|
228
|
-
* `BRAVE_SEARCH_API_KEY`, `EXA_API_KEY`) is present in
|
|
229
|
-
* process.env, so we need an explicit `false` for every phase
|
|
230
|
-
* that should not see the tools.
|
|
231
|
-
*
|
|
232
|
-
* Phases that opt in usually also want `unrestricted_egress: true`
|
|
233
|
-
* so `web_fetch` calls can reach arbitrary docs sites through the
|
|
234
|
-
* open-mode firewall — `web_search` itself only needs the provider
|
|
235
|
-
* host (api.tavily.com / api.search.brave.com / api.exa.ai) which
|
|
236
|
-
* is also covered by the open-mode tunnel.
|
|
237
|
-
*/
|
|
238
|
-
web_search: z.boolean().optional(),
|
|
239
|
-
/**
|
|
240
|
-
* Capability gate: the sandbox backend this phase needs to run on.
|
|
241
|
-
*
|
|
242
|
-
* Default (absent): the phase runs on whatever backend the harness is
|
|
243
|
-
* configured for. When set, the phase runs only if the **active** backend
|
|
244
|
-
* matches; otherwise it is **silently skipped** — recorded as a
|
|
245
|
-
* non-failing skip (like a trigger-rule skip), never a failure. This is
|
|
246
|
-
* safe-by-default graceful degradation: a phase that depends on tooling
|
|
247
|
-
* baked only into a specific sandbox image (a `/demo` video render, a
|
|
248
|
-
* headless-browser QA step) just no-ops on a host that can't provide it
|
|
249
|
-
* instead of breaking the workflow. E.g. the demo step in `build` declares
|
|
250
|
-
* `requires_sandbox: docker` so it skips (rather than fails the build) on a
|
|
251
|
-
* gondolin-only host.
|
|
252
|
-
*
|
|
253
|
-
* A skipped node is not `succeeded`, so a downstream phase that depends on
|
|
254
|
-
* a gated phase via the default `all_success` rule would itself skip. Keep
|
|
255
|
-
* gated phases **terminal** (nothing depends on them) or give their
|
|
256
|
-
* dependants `trigger_rule: all_done`. Pair with `messages.on_skipped_done`
|
|
257
|
-
* to surface why the phase was skipped.
|
|
258
|
-
*/
|
|
259
|
-
requires_sandbox: z.enum(["docker", "gondolin", "none"]).optional(),
|
|
260
|
-
/**
|
|
261
|
-
* Which docker sandbox image this phase runs in. `default` (or omitted) uses
|
|
262
|
-
* the lean `lastlight-sandbox:latest`; `qa` uses the heavier
|
|
263
|
-
* `lastlight-sandbox-qa:latest` (Playwright + Chromium baked in) for the
|
|
264
|
-
* browser-QA path. Only meaningful on the docker backend — pair it with
|
|
265
|
-
* `requires_sandbox: docker` so the phase skips on gondolin. When `qa` is
|
|
266
|
-
* requested but that image isn't built on the host, the scheduler skips the
|
|
267
|
-
* phase too (graceful degradation), so keep such phases terminal.
|
|
268
|
-
*/
|
|
269
|
-
sandbox_image: z.enum(["default", "qa"]).optional(),
|
|
270
|
-
/** Named approval gate to pause at after this phase */
|
|
271
|
-
approval_gate: z.string().optional(),
|
|
272
|
-
/**
|
|
273
|
-
* Artifact (handoff doc) filename this gate is asking the reviewer to
|
|
274
|
-
* approve, e.g. `architect-plan.md`. Surfaced by the focused approval
|
|
275
|
-
* view so the reviewer reads/edits the right doc before approving.
|
|
276
|
-
*/
|
|
277
|
-
approval_artifact: z.string().optional(),
|
|
278
|
-
/** Message template rendered when pausing at this phase's approval gate. */
|
|
279
|
-
approval_gate_message: z.string().optional(),
|
|
280
|
-
/** Optional per-event notification templates rendered through the template engine. */
|
|
281
|
-
messages: z
|
|
282
|
-
.object({
|
|
283
|
-
on_start: z.string().optional(),
|
|
284
|
-
on_success: z.string().optional(),
|
|
285
|
-
on_failure: z.string().optional(),
|
|
286
|
-
on_skipped_done: z.string().optional(),
|
|
287
|
-
on_blocked: z.string().optional(),
|
|
288
|
-
on_blocked_bypassed: z.string().optional(),
|
|
289
|
-
})
|
|
290
|
-
.optional(),
|
|
291
|
-
/** Loop configuration for reviewer-style looping phases */
|
|
292
|
-
loop: PhaseLoopSchema.optional(),
|
|
293
|
-
/** Generic loop configuration — expression/bash-based completion conditions */
|
|
294
|
-
generic_loop: GenericLoopSchema.optional(),
|
|
295
|
-
/** Rules applied to agent output */
|
|
296
|
-
on_output: PhaseOnOutputSchema.optional(),
|
|
297
|
-
/** Actions taken on successful completion */
|
|
298
|
-
on_success: z
|
|
299
|
-
.object({
|
|
300
|
-
set_phase: z.string().optional(),
|
|
301
|
-
})
|
|
302
|
-
.optional(),
|
|
303
|
-
/** DAG: list of phase names this phase depends on */
|
|
304
|
-
depends_on: z.array(z.string()).optional(),
|
|
305
|
-
/** DAG: trigger rule for this phase — when to run based on dependency outcomes */
|
|
306
|
-
trigger_rule: z.enum(["all_success", "one_success", "none_failed_min_one_success", "all_done"]).optional(),
|
|
307
|
-
/** DAG: variable name to store the output of this phase for use in downstream phases */
|
|
308
|
-
output_var: z.string().optional(),
|
|
309
|
-
})
|
|
310
|
-
.refine((p) => !(p.skill && p.skills), {
|
|
311
|
-
message: "phase cannot specify both `skill` and `skills` — use `skills` for multiple",
|
|
312
|
-
})
|
|
313
|
-
.superRefine((p, ctx) => {
|
|
314
|
-
const type = p.type ?? "agent";
|
|
315
|
-
if (type === "bash") {
|
|
316
|
-
if (!p.command) {
|
|
317
|
-
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "phase type `bash` requires `command:`" });
|
|
318
|
-
}
|
|
319
|
-
if (p.script !== undefined) {
|
|
320
|
-
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "`script:` is only valid on type `script`" });
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
else if (type === "script") {
|
|
324
|
-
if (!p.script) {
|
|
325
|
-
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "phase type `script` requires `script:`" });
|
|
326
|
-
}
|
|
327
|
-
if (p.command !== undefined) {
|
|
328
|
-
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "`command:` is only valid on type `bash`" });
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
else {
|
|
332
|
-
// context / agent
|
|
333
|
-
if (p.command !== undefined) {
|
|
334
|
-
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "`command:` is only valid on type `bash`" });
|
|
335
|
-
}
|
|
336
|
-
if (p.script !== undefined) {
|
|
337
|
-
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "`script:` is only valid on type `script`" });
|
|
338
|
-
}
|
|
339
|
-
if (p.runtime !== undefined) {
|
|
340
|
-
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "`runtime:` is only valid on type `script`" });
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
});
|
|
344
|
-
/**
|
|
345
|
-
* Normalize a phase's skill declaration to a single list of names.
|
|
346
|
-
* Returns `[]` for phases that have neither `skill` nor `skills`
|
|
347
|
-
* (e.g. `prompt:`-only or `context:` phases).
|
|
348
|
-
*/
|
|
349
|
-
export function phaseSkillNames(phase) {
|
|
350
|
-
if (phase.skills?.length)
|
|
351
|
-
return phase.skills;
|
|
352
|
-
if (phase.skill)
|
|
353
|
-
return [phase.skill];
|
|
354
|
-
return [];
|
|
355
|
-
}
|
|
356
|
-
// ── Agent workflow ────────────────────────────────────────────────────
|
|
357
|
-
//
|
|
358
|
-
// "Agent workflows" are the unified definition for everything Last Light does
|
|
359
|
-
// that involves running an agent — whether it's a multi-phase build cycle, a
|
|
360
|
-
// single-shot triage, a PR review, a health report, or a custom user-defined
|
|
361
|
-
// workflow. Each is a list of phases that the runner executes; simple
|
|
362
|
-
// workflows have a single phase, complex ones have many with optional loops,
|
|
363
|
-
// approval gates, DAG dependencies, etc.
|
|
364
|
-
//
|
|
365
|
-
// The `kind` field is purely a categorization label used by the dashboard
|
|
366
|
-
// (e.g. to group runs by purpose). The runner ignores it.
|
|
367
|
-
/**
|
|
368
|
-
* Intents owned by the harness itself (workflow gates / session control), not by
|
|
369
|
-
* any workflow. A workflow's `classification.intent` may not claim one of these.
|
|
370
|
-
* The classifier keeps their category text + examples in its base prompt template.
|
|
371
|
-
*/
|
|
372
|
-
export const RESERVED_CONTROL_INTENTS = [
|
|
373
|
-
"approve",
|
|
374
|
-
"reject",
|
|
375
|
-
"status",
|
|
376
|
-
"reset",
|
|
377
|
-
"chat",
|
|
378
|
-
];
|
|
379
|
-
/**
|
|
380
|
-
* Uppercase prompt token for an intent — the string the classifier emits on its
|
|
381
|
-
* `INTENT:` line and parses back. `qa-test` → `QATEST`, `incident` → `INCIDENT`.
|
|
382
|
-
* Kept here (workflows layer) so the loader's validation and the classifier's
|
|
383
|
-
* prompt/parser derive tokens the same way.
|
|
384
|
-
*/
|
|
385
|
-
export function intentToken(intent) {
|
|
386
|
-
return intent.toUpperCase().replace(/-/g, "");
|
|
387
|
-
}
|
|
388
|
-
export const AgentWorkflowSchema = z.object({
|
|
389
|
-
/** Categorization label — e.g. "build", "triage", "review", "health". Free string. */
|
|
390
|
-
kind: z.string().default("agent"),
|
|
391
|
-
name: z.string(),
|
|
392
|
-
description: z.string().optional(),
|
|
393
|
-
/** What can trigger this workflow (informational; routing is in code). */
|
|
394
|
-
trigger: z.string().optional(),
|
|
395
|
-
/**
|
|
396
|
-
* Render progress as a single in-place "task list" comment/message that is
|
|
397
|
-
* edited as phases run, instead of posting a new comment per phase. When
|
|
398
|
-
* true, the runner drives `callbacks.reporter` (see `src/notify/`) and the
|
|
399
|
-
* per-phase `messages.on_*` strings become the one-line detail on each
|
|
400
|
-
* checklist step. Default (absent/false) keeps the legacy one-comment-per-
|
|
401
|
-
* phase behavior. Opt in on chatty multi-phase workflows (build, explore,
|
|
402
|
-
* pr-fix); leave off for single-deliverable workflows (triage, pr-review,
|
|
403
|
-
* health) that post their own result.
|
|
404
|
-
*/
|
|
405
|
-
status_checklist: z.boolean().optional(),
|
|
406
|
-
/**
|
|
407
|
-
* Template rendered once at workflow wrap-up (against the accumulated
|
|
408
|
-
* `output_var`s) and delivered as the single final update: set as the
|
|
409
|
-
* footer of the in-place checklist comment when `status_checklist` is on, or
|
|
410
|
-
* posted as one standalone comment otherwise. Renders empty ⇒ no-op. Lets a
|
|
411
|
-
* workflow end with one synthesized result (e.g. verify/qa-test fold their
|
|
412
|
-
* text + browser passes into a single verdict via a final `synthesize` phase
|
|
413
|
-
* whose `output_var` this references) instead of a comment per phase.
|
|
414
|
-
*/
|
|
415
|
-
final_message: z.string().optional(),
|
|
416
|
-
variables: z.record(z.string(), z.string()).optional(),
|
|
417
|
-
/**
|
|
418
|
-
* How the free-text intent classifier should route to this workflow. When
|
|
419
|
-
* present, this workflow contributes one category to the composed classifier
|
|
420
|
-
* prompt (`src/engine/screen/classifier.ts`) AND claims the `intent` token:
|
|
421
|
-
* a comment/message the classifier tags with this intent routes here (via the
|
|
422
|
-
* router's `getWorkflowByIntent` fallback) unless a bespoke router branch
|
|
423
|
-
* already handles that intent. The prompt token is derived from `intent`
|
|
424
|
-
* (`intent.toUpperCase().replace(/-/g, "")` — e.g. `qa-test` → `QATEST`).
|
|
425
|
-
* Validated in the loader: `intent` must be unique across workflows and must
|
|
426
|
-
* not collide with a reserved control intent (approve/reject/status/reset/chat).
|
|
427
|
-
*/
|
|
428
|
-
classification: z
|
|
429
|
-
.object({
|
|
430
|
-
/** Intent token this workflow owns (e.g. "build", "qa-test", "incident"). */
|
|
431
|
-
intent: z.string(),
|
|
432
|
-
/** The category paragraph, conventionally prefixed with its UPPER token. */
|
|
433
|
-
description: z.string(),
|
|
434
|
-
/** Optional one-line classifier examples (verbatim lines for the prompt). */
|
|
435
|
-
examples: z.array(z.string()).optional(),
|
|
436
|
-
})
|
|
437
|
-
.optional(),
|
|
438
|
-
phases: z.array(PhaseDefinitionSchema),
|
|
439
|
-
});
|
|
440
|
-
// ── Cron workflow ─────────────────────────────────────────────────────
|
|
441
|
-
//
|
|
442
|
-
// Cron workflows are NOT runnable themselves — they describe a schedule that
|
|
443
|
-
// triggers another workflow. The `workflow` field is the name of an
|
|
444
|
-
// AgentWorkflow to invoke on each tick. (Previously this carried a `skill`
|
|
445
|
-
// field referencing the legacy executeSkill path; that path no longer exists.)
|
|
446
|
-
export const CronWorkflowSchema = z.object({
|
|
447
|
-
kind: z.literal("cron"),
|
|
448
|
-
name: z.string(),
|
|
449
|
-
schedule: z.string(),
|
|
450
|
-
/** Name of the AgentWorkflow to run on each tick */
|
|
451
|
-
workflow: z.string(),
|
|
452
|
-
/** Static context to merge into the workflow's input on each tick */
|
|
453
|
-
context: z.record(z.string(), z.unknown()).default({}),
|
|
454
|
-
condition: z
|
|
455
|
-
.object({
|
|
456
|
-
unless: z.string().optional(),
|
|
457
|
-
})
|
|
458
|
-
.optional(),
|
|
459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AAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,oDAAoD;IACpD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,qEAAqE;IACrE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACtD,SAAS,EAAE,CAAC;SACT,MAAM,CAAC;QACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC9B,CAAC;SACD,QAAQ,EAAE;CACd,CAAC,CAAC"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { ExecutorConfig } from "../engine/github/profiles.js";
|
|
2
|
-
import type { StateDb } from "../state/db.js";
|
|
3
|
-
import { type ModelConfig, type VariantConfig } from "../config/config.js";
|
|
4
|
-
import { type ApprovalGateConfig, type RunnerCallbacks, type WorkflowResult } from "./runner.js";
|
|
5
|
-
import { PER_TARGET_REUSE_WORKFLOWS, PER_TARGET_RECREATE_WORKFLOWS, PREPOPULATE_SYNTH_WORKFLOWS, PR_HEADREF_PREPOPULATE_WORKFLOWS } from "./target-policy.js";
|
|
6
|
-
/**
|
|
7
|
-
* Lightweight invocation request for any agent workflow. The runner handles
|
|
8
|
-
* all phase-level logic generically, so this single entry point covers
|
|
9
|
-
* everything from single-phase triage skills to the full multi-phase build
|
|
10
|
-
* cycle — including resume, approval gates, and the paused/approved/rejected
|
|
11
|
-
* dance after a human responds to an approval.
|
|
12
|
-
*/
|
|
13
|
-
export interface SimpleWorkflowRequest {
|
|
14
|
-
owner: string;
|
|
15
|
-
repo: string;
|
|
16
|
-
/** Optional — populated for issue-scoped workflows */
|
|
17
|
-
issueNumber?: number;
|
|
18
|
-
/** Optional — populated for PR-scoped workflows */
|
|
19
|
-
prNumber?: number;
|
|
20
|
-
/** Issue title (best-effort, may be empty for repo-scoped workflows) */
|
|
21
|
-
issueTitle?: string;
|
|
22
|
-
/** Issue body (best-effort) */
|
|
23
|
-
issueBody?: string;
|
|
24
|
-
/** Labels currently on the issue/PR */
|
|
25
|
-
issueLabels?: string[];
|
|
26
|
-
/** The triggering comment body, if applicable */
|
|
27
|
-
commentBody?: string;
|
|
28
|
-
/** Originating user (or "cli" / "cron" etc.) */
|
|
29
|
-
sender: string;
|
|
30
|
-
/**
|
|
31
|
-
* Explicit trigger id override. Slack-initiated workflows pass a
|
|
32
|
-
* `slack:{teamId}:{channel}:{threadTs}` string here so pause/resume uses
|
|
33
|
-
* the Slack thread as the stable key. When unset, the trigger id is
|
|
34
|
-
* derived from owner/repo/issueNumber as usual.
|
|
35
|
-
*/
|
|
36
|
-
triggerId?: string;
|
|
37
|
-
/**
|
|
38
|
-
* Extra context to merge into the template context. Use this for
|
|
39
|
-
* workflow-specific args like { mode: "scan" } from cron jobs, or the
|
|
40
|
-
* pr-fix workflow's failedChecks/branch/prNumber payload.
|
|
41
|
-
*/
|
|
42
|
-
extra?: Record<string, unknown>;
|
|
43
|
-
/**
|
|
44
|
-
* When set, the harness pre-clones the repo at this branch into the
|
|
45
|
-
* sandbox workspace before the agent starts. Used by pr-review /
|
|
46
|
-
* pr-fix so the agent enters a workspace already checked out at the
|
|
47
|
-
* PR's head ref — saves a redundant `clone_repo` call inside the
|
|
48
|
-
* session.
|
|
49
|
-
*/
|
|
50
|
-
prePopulateBranch?: string;
|
|
51
|
-
}
|
|
52
|
-
export { PER_TARGET_REUSE_WORKFLOWS, PER_TARGET_RECREATE_WORKFLOWS, PREPOPULATE_SYNTH_WORKFLOWS, PR_HEADREF_PREPOPULATE_WORKFLOWS, };
|
|
53
|
-
export declare function workflowScopedTaskId(repo: string, number: number | undefined, workflowName: string, workflowId: string): string;
|
|
54
|
-
/**
|
|
55
|
-
* Resolve the `{{branch}}` template var (and the matching sandbox
|
|
56
|
-
* `prePopulateBranch`) for a dispatch.
|
|
57
|
-
*
|
|
58
|
-
* The branch a build-style run creates and pushes is `lastlight/N-<title-slug>`,
|
|
59
|
-
* derived from the issue title at **first** dispatch. Every later re-entry of the
|
|
60
|
-
* same run — an approval-gate resume, a retry — comes through `runSimpleWorkflow`
|
|
61
|
-
* again, but the resume event carries an **empty** issue title, so a naive
|
|
62
|
-
* recompute collapses to the `lastlight/N-issue-N` fallback. That drifted name
|
|
63
|
-
* is harmless for phases that `git push origin HEAD` (the persisted workspace is
|
|
64
|
-
* still on the real branch) but fatal for the PR phase, whose prompt feeds
|
|
65
|
-
* `{{branch}}` straight into `github_create_pull_request`'s `head` — GitHub 422s
|
|
66
|
-
* because the fallback ref was never pushed.
|
|
67
|
-
*
|
|
68
|
-
* So when reusing an existing run we pin to the branch stored on the run row at
|
|
69
|
-
* creation, mirroring `resume.ts`'s `stored.branch ?? …` precedence. `stored`
|
|
70
|
-
* is `undefined` for a fresh run (no row yet).
|
|
71
|
-
*/
|
|
72
|
-
export declare function resolveRunBranch(args: {
|
|
73
|
-
stored?: Record<string, unknown>;
|
|
74
|
-
requestPrePopulateBranch?: string;
|
|
75
|
-
issueNumber?: number;
|
|
76
|
-
issueTitle?: string;
|
|
77
|
-
workflowName: string;
|
|
78
|
-
}): {
|
|
79
|
-
branch: string;
|
|
80
|
-
prePopulateBranch: string | undefined;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Run a named agent workflow against a target.
|
|
84
|
-
*
|
|
85
|
-
* If a workflow_run row already exists for this trigger, we reuse it and let
|
|
86
|
-
* the runner's definition-driven resume pick up after the last completed
|
|
87
|
-
* phase — including the paused/approved/rejected paths. Otherwise we create a
|
|
88
|
-
* fresh row so the dashboard sees it immediately.
|
|
89
|
-
*/
|
|
90
|
-
export declare function runSimpleWorkflow(workflowName: string, request: SimpleWorkflowRequest, config: ExecutorConfig, callbacks: RunnerCallbacks, db: StateDb, models?: ModelConfig, approvalConfig?: ApprovalGateConfig, bootstrapLabel?: string, variants?: VariantConfig): Promise<WorkflowResult>;
|