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
package/dist/cron/fanout.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cron fan-out: when a cron job context contains a `repos` array, dispatch
|
|
3
|
-
* one workflow run per repo instead of passing the array through to a single
|
|
4
|
-
* dispatch that expects `context.repo` (singular).
|
|
5
|
-
*
|
|
6
|
-
* Each per-repo run gets its own workflow_runs row, taskId, sandbox, and
|
|
7
|
-
* trigger id, so failures are isolated and the existing per-run resume
|
|
8
|
-
* machinery works unchanged.
|
|
9
|
-
*
|
|
10
|
-
* Concurrency is bounded so 100 repo scans don't spin 100 concurrent
|
|
11
|
-
* sandboxes — default is 3, tunable per call.
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Dispatch a cron-scheduled workflow, fanning out over `context.repos` when
|
|
15
|
-
* present. When absent, behaves like a single dispatch. Always stamps
|
|
16
|
-
* `_triggerType: "cron"` on the outgoing context.
|
|
17
|
-
*/
|
|
18
|
-
export async function dispatchCronWorkflow(workflowName, context, dispatch, options = {}) {
|
|
19
|
-
const base = { ...context, _triggerType: "cron" };
|
|
20
|
-
const rawRepos = base.repos;
|
|
21
|
-
if (!Array.isArray(rawRepos)) {
|
|
22
|
-
const result = await runOne(dispatch, workflowName, base);
|
|
23
|
-
return { dispatched: 1, failures: result ? 0 : 1 };
|
|
24
|
-
}
|
|
25
|
-
const { repos: _drop, ...rest } = base;
|
|
26
|
-
const repos = rawRepos.filter((r) => typeof r === "string" && r.length > 0);
|
|
27
|
-
if (repos.length === 0) {
|
|
28
|
-
return { dispatched: 0, failures: 0 };
|
|
29
|
-
}
|
|
30
|
-
const concurrency = Math.max(1, options.concurrency ?? 3);
|
|
31
|
-
let dispatched = 0;
|
|
32
|
-
let failures = 0;
|
|
33
|
-
for (let i = 0; i < repos.length; i += concurrency) {
|
|
34
|
-
const batch = repos.slice(i, i + concurrency);
|
|
35
|
-
const results = await Promise.allSettled(batch.map((repo) => runOne(dispatch, workflowName, { ...rest, repo })));
|
|
36
|
-
for (const r of results) {
|
|
37
|
-
dispatched++;
|
|
38
|
-
const ok = r.status === "fulfilled" && r.value === true;
|
|
39
|
-
if (!ok)
|
|
40
|
-
failures++;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return { dispatched, failures };
|
|
44
|
-
}
|
|
45
|
-
async function runOne(dispatch, workflowName, context) {
|
|
46
|
-
try {
|
|
47
|
-
const result = await dispatch(workflowName, context);
|
|
48
|
-
return !!(result.success || result.paused);
|
|
49
|
-
}
|
|
50
|
-
catch (err) {
|
|
51
|
-
console.error(`[cron-fanout] ${workflowName} dispatch threw for ${String(context.repo ?? "<no repo>")}:`, err);
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=fanout.js.map
|
package/dist/cron/fanout.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fanout.js","sourceRoot":"","sources":["../../src/cron/fanout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAmBH;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,YAAoB,EACpB,OAAgC,EAChC,QAAwB,EACxB,UAAyB,EAAE;IAE3B,MAAM,IAAI,GAA4B,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;IAC3E,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC;IAE5B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;QAC1D,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACrD,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IACvC,MAAM,KAAK,GAAI,QAAsB,CAAC,MAAM,CAC1C,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAC1D,CAAC;IAEF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,WAAW,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,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/cron/jobs.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { CronJob } from "./scheduler.js";
|
|
2
|
-
import type { StateDb } from "../state/db.js";
|
|
3
|
-
/**
|
|
4
|
-
* Get cron jobs based on configuration.
|
|
5
|
-
*
|
|
6
|
-
* Cron job definitions are loaded from workflows/cron-*.yaml files. Each
|
|
7
|
-
* cron YAML references an agent workflow by name (workflows/<name>.yaml)
|
|
8
|
-
* which is invoked on each tick. When webhooks are enabled
|
|
9
|
-
* (WEBHOOK_SECRET is set), jobs with `condition.unless: webhooksEnabled`
|
|
10
|
-
* are filtered out — those are handled in real-time via webhook events.
|
|
11
|
-
*
|
|
12
|
-
* When `db` is supplied, cron_overrides rows applied: disabled jobs are
|
|
13
|
-
* dropped and schedule overrides replace the YAML schedule.
|
|
14
|
-
*/
|
|
15
|
-
export declare function getJobs(opts?: {
|
|
16
|
-
webhooksEnabled?: boolean;
|
|
17
|
-
db?: StateDb;
|
|
18
|
-
}): CronJob[];
|
package/dist/cron/jobs.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { getManagedRepos } from "../managed-repos.js";
|
|
2
|
-
import { getCronWorkflows } from "../workflows/loader.js";
|
|
3
|
-
/**
|
|
4
|
-
* Get cron jobs based on configuration.
|
|
5
|
-
*
|
|
6
|
-
* Cron job definitions are loaded from workflows/cron-*.yaml files. Each
|
|
7
|
-
* cron YAML references an agent workflow by name (workflows/<name>.yaml)
|
|
8
|
-
* which is invoked on each tick. When webhooks are enabled
|
|
9
|
-
* (WEBHOOK_SECRET is set), jobs with `condition.unless: webhooksEnabled`
|
|
10
|
-
* are filtered out — those are handled in real-time via webhook events.
|
|
11
|
-
*
|
|
12
|
-
* When `db` is supplied, cron_overrides rows applied: disabled jobs are
|
|
13
|
-
* dropped and schedule overrides replace the YAML schedule.
|
|
14
|
-
*/
|
|
15
|
-
export function getJobs(opts) {
|
|
16
|
-
const jobs = [];
|
|
17
|
-
let cronDefs = getCronWorkflows();
|
|
18
|
-
// Apply conditions
|
|
19
|
-
if (opts?.webhooksEnabled) {
|
|
20
|
-
cronDefs = cronDefs.filter((def) => def.condition?.unless !== "webhooksEnabled");
|
|
21
|
-
}
|
|
22
|
-
const overrides = opts?.db?.getAllCronOverrides() ?? new Map();
|
|
23
|
-
for (const def of cronDefs) {
|
|
24
|
-
const override = overrides.get(def.name);
|
|
25
|
-
if (override && !override.enabled)
|
|
26
|
-
continue;
|
|
27
|
-
jobs.push({
|
|
28
|
-
name: def.name,
|
|
29
|
-
schedule: override?.schedule || def.schedule,
|
|
30
|
-
workflow: def.workflow,
|
|
31
|
-
// Merge managed repos into the context the workflow receives
|
|
32
|
-
context: { repos: getManagedRepos(), ...def.context },
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
return jobs;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=jobs.js.map
|
package/dist/cron/jobs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../src/cron/jobs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,OAAO,CAAC,IAAkD;IACxE,MAAM,IAAI,GAAc,EAAE,CAAC;IAE3B,IAAI,QAAQ,GAAG,gBAAgB,EAAE,CAAC;IAElC,mBAAmB;IACnB,IAAI,IAAI,EAAE,eAAe,EAAE,CAAC;QAC1B,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,iBAAiB,CAAC,CAAC;IACnF,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,EAAE,EAAE,EAAE,mBAAmB,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC;IAE/D,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,QAAQ,IAAI,CAAC,QAAQ,CAAC,OAAO;YAAE,SAAS;QAC5C,IAAI,CAAC,IAAI,CAAC;YACR,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,QAAQ,EAAE,QAAQ,EAAE,QAAQ,IAAI,GAAG,CAAC,QAAQ;YAC5C,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,6DAA6D;YAC7D,OAAO,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE;SACtD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/cron/scheduler.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { StateDb } from "../state/db.js";
|
|
2
|
-
export interface CronJob {
|
|
3
|
-
name: string;
|
|
4
|
-
schedule: string;
|
|
5
|
-
/** Name of an agent workflow (workflows/<name>.yaml) to invoke on each tick */
|
|
6
|
-
workflow: string;
|
|
7
|
-
context: Record<string, unknown>;
|
|
8
|
-
/** Maximum consecutive failures before alerting */
|
|
9
|
-
maxFailures?: number;
|
|
10
|
-
}
|
|
11
|
-
/** A lightweight direct job — runs a function, not a workflow */
|
|
12
|
-
export interface DirectCronJob {
|
|
13
|
-
name: string;
|
|
14
|
-
schedule: string;
|
|
15
|
-
handler: () => Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
export type WorkflowRunner = (workflow: string, context: Record<string, unknown>) => Promise<void>;
|
|
18
|
-
/**
|
|
19
|
-
* Cron scheduler with overlap protection and failure tracking.
|
|
20
|
-
* Each job runs a workflow via the agent runner, tracked in SQLite.
|
|
21
|
-
*/
|
|
22
|
-
export declare class CronScheduler {
|
|
23
|
-
private jobs;
|
|
24
|
-
private running;
|
|
25
|
-
private db;
|
|
26
|
-
private runner;
|
|
27
|
-
constructor(db: StateDb, runner: WorkflowRunner);
|
|
28
|
-
register(job: CronJob): void;
|
|
29
|
-
/** Register a lightweight direct handler (no skill/sandbox overhead) */
|
|
30
|
-
registerDirect(job: DirectCronJob): void;
|
|
31
|
-
/** Whether a cron with this name is currently registered. */
|
|
32
|
-
has(name: string): boolean;
|
|
33
|
-
/** Stop and remove a single cron. No-op if not registered. */
|
|
34
|
-
unregister(name: string): void;
|
|
35
|
-
/** Replace an existing cron with a new schedule/context. Equivalent to unregister + register. */
|
|
36
|
-
update(job: CronJob): void;
|
|
37
|
-
/** Snapshot of registered jobs with the croner-computed next-run timestamp. */
|
|
38
|
-
list(): Array<{
|
|
39
|
-
name: string;
|
|
40
|
-
schedule: string;
|
|
41
|
-
nextRun: Date | null;
|
|
42
|
-
}>;
|
|
43
|
-
/** Stop all cron jobs */
|
|
44
|
-
stopAll(): void;
|
|
45
|
-
}
|
package/dist/cron/scheduler.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { Cron } from "croner";
|
|
2
|
-
/**
|
|
3
|
-
* Cron scheduler with overlap protection and failure tracking.
|
|
4
|
-
* Each job runs a workflow via the agent runner, tracked in SQLite.
|
|
5
|
-
*/
|
|
6
|
-
export class CronScheduler {
|
|
7
|
-
jobs = new Map();
|
|
8
|
-
running = new Set();
|
|
9
|
-
db;
|
|
10
|
-
runner;
|
|
11
|
-
constructor(db, runner) {
|
|
12
|
-
this.db = db;
|
|
13
|
-
this.runner = runner;
|
|
14
|
-
}
|
|
15
|
-
register(job) {
|
|
16
|
-
if (this.jobs.has(job.name)) {
|
|
17
|
-
throw new Error(`Cron job "${job.name}" already registered`);
|
|
18
|
-
}
|
|
19
|
-
const cronJob = new Cron(job.schedule, async () => {
|
|
20
|
-
// Overlap protection — skip if still running
|
|
21
|
-
if (this.running.has(job.name)) {
|
|
22
|
-
console.log(`[cron] Skipping ${job.name} — still running from previous tick`);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
this.running.add(job.name);
|
|
26
|
-
console.log(`[cron] Running: ${job.name}`);
|
|
27
|
-
try {
|
|
28
|
-
await this.runner(job.workflow, job.context);
|
|
29
|
-
}
|
|
30
|
-
catch (err) {
|
|
31
|
-
console.error(`[cron] ${job.name} failed:`, err.message);
|
|
32
|
-
// Check consecutive failures (tracked under the workflow name)
|
|
33
|
-
const failures = this.db.executions.consecutiveFailures(job.workflow);
|
|
34
|
-
const max = job.maxFailures || 3;
|
|
35
|
-
if (failures >= max) {
|
|
36
|
-
console.error(`[cron] ALERT: ${job.name} has failed ${failures} times consecutively`);
|
|
37
|
-
// TODO: send alert (Slack webhook, email, etc.)
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
finally {
|
|
41
|
-
this.running.delete(job.name);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
this.jobs.set(job.name, cronJob);
|
|
45
|
-
console.log(`[cron] Registered: ${job.name} (${job.schedule})`);
|
|
46
|
-
}
|
|
47
|
-
/** Register a lightweight direct handler (no skill/sandbox overhead) */
|
|
48
|
-
registerDirect(job) {
|
|
49
|
-
if (this.jobs.has(job.name)) {
|
|
50
|
-
throw new Error(`Cron job "${job.name}" already registered`);
|
|
51
|
-
}
|
|
52
|
-
const cronJob = new Cron(job.schedule, async () => {
|
|
53
|
-
if (this.running.has(job.name)) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
this.running.add(job.name);
|
|
57
|
-
try {
|
|
58
|
-
await job.handler();
|
|
59
|
-
}
|
|
60
|
-
catch (err) {
|
|
61
|
-
console.error(`[cron] ${job.name} failed:`, err.message);
|
|
62
|
-
}
|
|
63
|
-
finally {
|
|
64
|
-
this.running.delete(job.name);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
this.jobs.set(job.name, cronJob);
|
|
68
|
-
console.log(`[cron] Registered: ${job.name} (${job.schedule})`);
|
|
69
|
-
}
|
|
70
|
-
/** Whether a cron with this name is currently registered. */
|
|
71
|
-
has(name) {
|
|
72
|
-
return this.jobs.has(name);
|
|
73
|
-
}
|
|
74
|
-
/** Stop and remove a single cron. No-op if not registered. */
|
|
75
|
-
unregister(name) {
|
|
76
|
-
const job = this.jobs.get(name);
|
|
77
|
-
if (!job)
|
|
78
|
-
return;
|
|
79
|
-
job.stop();
|
|
80
|
-
this.jobs.delete(name);
|
|
81
|
-
console.log(`[cron] Stopped: ${name}`);
|
|
82
|
-
}
|
|
83
|
-
/** Replace an existing cron with a new schedule/context. Equivalent to unregister + register. */
|
|
84
|
-
update(job) {
|
|
85
|
-
this.unregister(job.name);
|
|
86
|
-
this.register(job);
|
|
87
|
-
}
|
|
88
|
-
/** Snapshot of registered jobs with the croner-computed next-run timestamp. */
|
|
89
|
-
list() {
|
|
90
|
-
return Array.from(this.jobs.entries()).map(([name, cronJob]) => ({
|
|
91
|
-
name,
|
|
92
|
-
schedule: cronJob.getPattern() ?? "",
|
|
93
|
-
nextRun: cronJob.nextRun(),
|
|
94
|
-
}));
|
|
95
|
-
}
|
|
96
|
-
/** Stop all cron jobs */
|
|
97
|
-
stopAll() {
|
|
98
|
-
for (const [name, job] of this.jobs) {
|
|
99
|
-
job.stop();
|
|
100
|
-
console.log(`[cron] Stopped: ${name}`);
|
|
101
|
-
}
|
|
102
|
-
this.jobs.clear();
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=scheduler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler.js","sourceRoot":"","sources":["../../src/cron/scheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAsB9B;;;GAGG;AACH,MAAM,OAAO,aAAa;IAChB,IAAI,GAAsB,IAAI,GAAG,EAAE,CAAC;IACpC,OAAO,GAAgB,IAAI,GAAG,EAAE,CAAC;IACjC,EAAE,CAAU;IAC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IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACpC,GAAG,CAAC,IAAI,EAAE,CAAC;YACX,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { type ExecutorConfig, type ExecutionResult, type GitSandboxAccess } from "./github/profiles.js";
|
|
2
|
-
import type { SandboxFactory } from "../sandbox/sandbox.js";
|
|
3
|
-
import { type CommandSpec } from "./executors/orchestrator.js";
|
|
4
|
-
export { RunResultAccumulator, stageSkillBundle, excludeFromGit, detectAccountError } from "./executors/shared.js";
|
|
5
|
-
export type { CommandSpec } from "./executors/orchestrator.js";
|
|
6
|
-
export declare function executeAgent(prompt: string, config: ExecutorConfig, opts?: {
|
|
7
|
-
taskId?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Fired as soon as the run gets a session id. Used to persist the id
|
|
10
|
-
* onto the in-flight executions row so the dashboard can deep-link
|
|
11
|
-
* the running phase to its live JSONL.
|
|
12
|
-
*/
|
|
13
|
-
onSessionId?: (sessionId: string) => void;
|
|
14
|
-
githubAccess?: GitSandboxAccess;
|
|
15
|
-
/** Test seam — substitute a FakeSandbox. Defaults to the real factory. */
|
|
16
|
-
sandboxFactory?: SandboxFactory;
|
|
17
|
-
}): Promise<ExecutionResult>;
|
|
18
|
-
export declare function executeCommand(spec: CommandSpec, config: ExecutorConfig, opts?: {
|
|
19
|
-
taskId?: string;
|
|
20
|
-
githubAccess?: GitSandboxAccess;
|
|
21
|
-
/** Per-step timeout in seconds. */
|
|
22
|
-
timeoutSeconds?: number;
|
|
23
|
-
/** Extra env forwarded into the command (e.g. upstream phase outputs). */
|
|
24
|
-
sandboxEnv?: Record<string, string>;
|
|
25
|
-
onSessionId?: (sessionId: string) => void;
|
|
26
|
-
/**
|
|
27
|
-
* Mirror the command output to a session jsonl (visible in the dashboard +
|
|
28
|
-
* CLI). Default true. Set false for internal checks like `until_bash` that
|
|
29
|
-
* shouldn't create a user-facing session log.
|
|
30
|
-
*/
|
|
31
|
-
writeSession?: boolean;
|
|
32
|
-
/** Test seam — substitute a FakeSandbox. Defaults to the real factory. */
|
|
33
|
-
sandboxFactory?: SandboxFactory;
|
|
34
|
-
}): Promise<ExecutionResult>;
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import { resolve } from "path";
|
|
2
|
-
import { randomUUID } from "crypto";
|
|
3
|
-
import { refreshGitAuth } from "./github/git-auth.js";
|
|
4
|
-
import { GITHUB_PERMISSION_PROFILES, } from "./github/profiles.js";
|
|
5
|
-
import { getDockerSandboxOtelEnv, getOtelEnvForSandbox, safeSpanAttributes, withSpan } from "../telemetry/index.js";
|
|
6
|
-
import { DEFAULT_MODEL } from "./executors/shared.js";
|
|
7
|
-
import { PROVIDER_ENV_KEYS } from "../providers.js";
|
|
8
|
-
import { oauthEnvVarForProvider, oauthProviderIdForModel, resolveOAuthApiKey } from "./oauth.js";
|
|
9
|
-
import { runSandboxedAgent, runSandboxedCommand, } from "./executors/orchestrator.js";
|
|
10
|
-
// Re-exported for back-compat with existing importers (tests, dashboards,
|
|
11
|
-
// workflow phase executor).
|
|
12
|
-
export { RunResultAccumulator, stageSkillBundle, excludeFromGit, detectAccountError } from "./executors/shared.js";
|
|
13
|
-
/**
|
|
14
|
-
* Shared run preparation for {@link executeAgent} and {@link executeCommand}:
|
|
15
|
-
* resolve the taskId / state dir / backend, mint the scoped GitHub token,
|
|
16
|
-
* assemble the sandbox env (git token, provider keys, OTEL), and compute the
|
|
17
|
-
* pre-populate descriptor. Both the agent and the deterministic command paths
|
|
18
|
-
* run in the same sandbox/workspace with the same git access, so they share
|
|
19
|
-
* this setup verbatim.
|
|
20
|
-
*/
|
|
21
|
-
async function prepareRun(config, opts) {
|
|
22
|
-
const taskId = opts?.taskId || `task-${randomUUID().slice(0, 8)}`;
|
|
23
|
-
const stateDir = config.stateDir || resolve("data");
|
|
24
|
-
const backend = config.sandbox ?? "gondolin";
|
|
25
|
-
// Mint a scoped GitHub App token. Same flow as the legacy executor —
|
|
26
|
-
// defense in depth so a downstream tool gating regression can't burn
|
|
27
|
-
// more access than the profile allowed.
|
|
28
|
-
//
|
|
29
|
-
// GITHUB_APP_* env vars are forwarded to agentic-pi *only* when the access
|
|
30
|
-
// profile opts into App PEM access via `allowMcpAppAuth`. That is currently
|
|
31
|
-
// never set (see gitSandboxAccessForWorkflow): the github extension can't
|
|
32
|
-
// read the PEM in the sandbox and skips rather than falling back, so we keep
|
|
33
|
-
// the App key out entirely and every run uses just the minted `GITHUB_TOKEN`
|
|
34
|
-
// below — which also stops agents minting elevated tokens themselves. The
|
|
35
|
-
// branch is retained so per-profile App auth can be re-enabled if the
|
|
36
|
-
// sandbox-side PEM is ever materialized.
|
|
37
|
-
const ghEnv = {};
|
|
38
|
-
let mintedToken;
|
|
39
|
-
const access = opts?.githubAccess;
|
|
40
|
-
const allowAppAuth = access?.allowMcpAppAuth === true;
|
|
41
|
-
if (process.env.GITHUB_APP_ID && allowAppAuth) {
|
|
42
|
-
ghEnv.GITHUB_APP_ID = process.env.GITHUB_APP_ID;
|
|
43
|
-
if (process.env.GITHUB_APP_INSTALLATION_ID) {
|
|
44
|
-
ghEnv.GITHUB_APP_INSTALLATION_ID = process.env.GITHUB_APP_INSTALLATION_ID;
|
|
45
|
-
}
|
|
46
|
-
if (process.env.GITHUB_APP_PRIVATE_KEY_PATH) {
|
|
47
|
-
ghEnv.GITHUB_APP_PRIVATE_KEY_PATH = process.env.GITHUB_APP_PRIVATE_KEY_PATH;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
// Suppress for in-process runs that inherit our env. Empty strings
|
|
52
|
-
// override the inherited value via `applyEnv()`.
|
|
53
|
-
ghEnv.GITHUB_APP_ID = "";
|
|
54
|
-
ghEnv.GITHUB_APP_INSTALLATION_ID = "";
|
|
55
|
-
ghEnv.GITHUB_APP_PRIVATE_KEY_PATH = "";
|
|
56
|
-
}
|
|
57
|
-
if (process.env.GITHUB_APP_ID && access) {
|
|
58
|
-
try {
|
|
59
|
-
const permissions = GITHUB_PERMISSION_PROFILES[access.profile];
|
|
60
|
-
const repositories = access.repo ? [access.repo] : undefined;
|
|
61
|
-
console.log(`[executor] Minting git token: profile=${access.profile}, ` +
|
|
62
|
-
`repo=${access.repo || "(unscoped)"}, permissions=${permissions ? Object.keys(permissions).join(",") : "all"}`);
|
|
63
|
-
const { token } = await refreshGitAuth({
|
|
64
|
-
appId: process.env.GITHUB_APP_ID,
|
|
65
|
-
privateKeyPath: process.env.GITHUB_APP_PRIVATE_KEY_PATH || "",
|
|
66
|
-
installationId: process.env.GITHUB_APP_INSTALLATION_ID || "",
|
|
67
|
-
permissions,
|
|
68
|
-
repositories,
|
|
69
|
-
});
|
|
70
|
-
mintedToken = token;
|
|
71
|
-
ghEnv.GITHUB_TOKEN = token;
|
|
72
|
-
ghEnv.GIT_TOKEN = token;
|
|
73
|
-
}
|
|
74
|
-
catch (err) {
|
|
75
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
76
|
-
console.warn(`[executor] Could not mint git token (repo=${access.repo || "none"}, ` +
|
|
77
|
-
`profile=${access.profile}): ${msg}`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
else if (process.env.GITHUB_TOKEN && access) {
|
|
81
|
-
// PAT fallback: no GitHub App, but a static Personal Access Token is set.
|
|
82
|
-
// Forward it directly — a PAT can't be per-run downscoped like an App
|
|
83
|
-
// installation token, so it carries whatever scopes GitHub granted. A
|
|
84
|
-
// read-only fine-grained PAT is the safe default; warn on repo-write
|
|
85
|
-
// profiles so an operator running build/pr-fix under a PAT knows the
|
|
86
|
-
// requested downscope isn't being applied.
|
|
87
|
-
if (GITHUB_PERMISSION_PROFILES[access.profile]?.contents === "write") {
|
|
88
|
-
console.warn(`[executor] Using a static GITHUB_TOKEN for a repo-write workflow ` +
|
|
89
|
-
`(profile=${access.profile}, repo=${access.repo || "none"}) — the PAT's ` +
|
|
90
|
-
`own scopes apply (no per-run downscoping).`);
|
|
91
|
-
}
|
|
92
|
-
mintedToken = process.env.GITHUB_TOKEN;
|
|
93
|
-
ghEnv.GITHUB_TOKEN = process.env.GITHUB_TOKEN;
|
|
94
|
-
ghEnv.GIT_TOKEN = process.env.GITHUB_TOKEN;
|
|
95
|
-
}
|
|
96
|
-
// Provider API keys. Forwarded in registry order — see `src/providers.ts`
|
|
97
|
-
// (the single source of truth for wizard-able providers). Every entry a
|
|
98
|
-
// user can pick in the setup wizard is reachable from the sandbox because
|
|
99
|
-
// the egress firewall list is also derived from the same registry's hosts.
|
|
100
|
-
for (const envKey of PROVIDER_ENV_KEYS) {
|
|
101
|
-
const v = process.env[envKey];
|
|
102
|
-
if (v)
|
|
103
|
-
ghEnv[envKey] = v;
|
|
104
|
-
}
|
|
105
|
-
// OAuth-backed providers (subscription logins: Codex / Claude Pro / Copilot).
|
|
106
|
-
//
|
|
107
|
-
// In-process backends (none/gondolin) run the model call host-side, so the
|
|
108
|
-
// orchestrator hands agentic-pi `authFile` = our credential store and Pi's
|
|
109
|
-
// AuthStorage resolves EVERY OAuth provider (Codex included) from it. Nothing
|
|
110
|
-
// to do here for those backends.
|
|
111
|
-
//
|
|
112
|
-
// Container backends (docker/smol) run the model call inside the guest, where
|
|
113
|
-
// that host path can't be read — so we inject the refreshed token via the env
|
|
114
|
-
// var pi reads in-guest (ANTHROPIC_OAUTH_TOKEN / COPILOT_GITHUB_TOKEN). Codex
|
|
115
|
-
// has no in-guest env route (chatgpt.com backend), so it can't authenticate
|
|
116
|
-
// there — warn rather than 401 mid-run, and point at a host-side backend.
|
|
117
|
-
const inProcessBackend = backend === "none" || backend === "gondolin";
|
|
118
|
-
const modelSpec = config.model || DEFAULT_MODEL;
|
|
119
|
-
const oauthId = oauthProviderIdForModel(modelSpec);
|
|
120
|
-
if (oauthId && !inProcessBackend) {
|
|
121
|
-
const oauthEnvVar = oauthEnvVarForProvider(oauthId);
|
|
122
|
-
if (!oauthEnvVar) {
|
|
123
|
-
console.warn(`[executor] Model '${modelSpec}' uses OAuth provider '${oauthId}', which has no ` +
|
|
124
|
-
`in-guest env route — the '${backend}' sandbox can't authenticate it. Use the ` +
|
|
125
|
-
`gondolin/none backend (host-side auth via the credential store) or an API-key provider.`);
|
|
126
|
-
}
|
|
127
|
-
else if (!ghEnv[oauthEnvVar] && !process.env[oauthEnvVar]) {
|
|
128
|
-
// Only mint from stored creds when an explicit token isn't already set.
|
|
129
|
-
try {
|
|
130
|
-
const res = await resolveOAuthApiKey(oauthId, undefined, stateDir);
|
|
131
|
-
if (res) {
|
|
132
|
-
ghEnv[oauthEnvVar] = res.apiKey;
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
console.warn(`[executor] Model '${modelSpec}' needs an OAuth login for '${oauthId}' but none is ` +
|
|
136
|
-
`stored. Run: lastlight oauth login ${oauthId}`);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
catch (err) {
|
|
140
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
141
|
-
console.warn(`[executor] OAuth token refresh failed for '${oauthId}': ${msg}`);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
// Web-search provider keys. Forwarded only when the workflow opted into
|
|
146
|
-
// web search (scoped to explore today; see webSearchEnabledForWorkflow
|
|
147
|
-
// in workflows/runner.ts). agentic-pi auto-detects the provider from
|
|
148
|
-
// whichever key is present (Tavily > Exa > Brave by default).
|
|
149
|
-
if (config.webSearch) {
|
|
150
|
-
if (process.env.TAVILY_API_KEY)
|
|
151
|
-
ghEnv.TAVILY_API_KEY = process.env.TAVILY_API_KEY;
|
|
152
|
-
if (process.env.BRAVE_SEARCH_API_KEY)
|
|
153
|
-
ghEnv.BRAVE_SEARCH_API_KEY = process.env.BRAVE_SEARCH_API_KEY;
|
|
154
|
-
if (process.env.EXA_API_KEY)
|
|
155
|
-
ghEnv.EXA_API_KEY = process.env.EXA_API_KEY;
|
|
156
|
-
}
|
|
157
|
-
// OTEL config for the agent runtime itself. On docker the agent runs
|
|
158
|
-
// inside the container, so it reads this (the container env) and is
|
|
159
|
-
// pointed at the in-network collector — never the real backend or its
|
|
160
|
-
// auth headers. On gondolin/none the agent runs in the harness process
|
|
161
|
-
// and inherits the harness SDK; forwarding the host's OTEL_* here just
|
|
162
|
-
// re-affirms that config for any child processes.
|
|
163
|
-
if (config.otel?.enabled && config.otel.forwardToSandbox) {
|
|
164
|
-
Object.assign(ghEnv, backend === "docker" ? getDockerSandboxOtelEnv() : getOtelEnvForSandbox());
|
|
165
|
-
}
|
|
166
|
-
const prePopulate = access?.prePopulateBranch && mintedToken
|
|
167
|
-
? {
|
|
168
|
-
owner: access.owner,
|
|
169
|
-
repo: access.repo,
|
|
170
|
-
branch: access.prePopulateBranch,
|
|
171
|
-
token: mintedToken,
|
|
172
|
-
runId: access.runId,
|
|
173
|
-
shallow: access.shallow,
|
|
174
|
-
recreateFromBase: access.recreateFromBase,
|
|
175
|
-
}
|
|
176
|
-
: undefined;
|
|
177
|
-
return { taskId, stateDir, backend, ghEnv, mintedToken, prePopulate };
|
|
178
|
-
}
|
|
179
|
-
export async function executeAgent(prompt, config, opts) {
|
|
180
|
-
const { taskId, stateDir, backend, ghEnv, prePopulate } = await prepareRun(config, opts);
|
|
181
|
-
const access = opts?.githubAccess;
|
|
182
|
-
const spanAttrs = safeSpanAttributes({
|
|
183
|
-
"agent.runtime": "agentic-pi",
|
|
184
|
-
"sandbox.backend": backend,
|
|
185
|
-
"task.id": taskId,
|
|
186
|
-
repo: access?.repo,
|
|
187
|
-
"github.profile": access?.profile,
|
|
188
|
-
model: config.model || DEFAULT_MODEL,
|
|
189
|
-
variant: config.variant,
|
|
190
|
-
"web_search.enabled": config.webSearch === true,
|
|
191
|
-
unrestricted_egress: config.unrestrictedEgress === true,
|
|
192
|
-
"workflow.name": config.telemetry?.workflowName,
|
|
193
|
-
"phase.name": config.telemetry?.phaseName,
|
|
194
|
-
});
|
|
195
|
-
const ctx = {
|
|
196
|
-
config,
|
|
197
|
-
taskId,
|
|
198
|
-
stateDir,
|
|
199
|
-
backend,
|
|
200
|
-
env: ghEnv,
|
|
201
|
-
prePopulate,
|
|
202
|
-
access,
|
|
203
|
-
onSessionId: opts?.onSessionId,
|
|
204
|
-
sandboxFactory: opts?.sandboxFactory,
|
|
205
|
-
};
|
|
206
|
-
return withSpan("lastlight.agent.execute", spanAttrs, () => runSandboxedAgent(prompt, ctx));
|
|
207
|
-
}
|
|
208
|
-
// ── Deterministic command path (type: bash / type: script) ───────────
|
|
209
|
-
//
|
|
210
|
-
// Runs a deterministic shell command (or inline script) inside the SAME
|
|
211
|
-
// sandbox/workspace an agent phase would use — no LLM. The command's output is
|
|
212
|
-
// mirrored to a Claude-SDK-style session jsonl via the AgenticShim (the same
|
|
213
|
-
// shim agent phases use), so a bash/script phase shows up in the admin console
|
|
214
|
-
// and `lastlight session log` exactly like an agent turn: the command renders
|
|
215
|
-
// as a `bash` tool_use and its stdout/stderr as the tool_result.
|
|
216
|
-
export async function executeCommand(spec, config, opts) {
|
|
217
|
-
const { taskId, stateDir, backend, ghEnv, prePopulate } = await prepareRun(config, opts);
|
|
218
|
-
const access = opts?.githubAccess;
|
|
219
|
-
const spanAttrs = safeSpanAttributes({
|
|
220
|
-
"agent.runtime": spec.kind,
|
|
221
|
-
"sandbox.backend": backend,
|
|
222
|
-
"task.id": taskId,
|
|
223
|
-
repo: access?.repo,
|
|
224
|
-
"github.profile": access?.profile,
|
|
225
|
-
unrestricted_egress: config.unrestrictedEgress === true,
|
|
226
|
-
"workflow.name": config.telemetry?.workflowName,
|
|
227
|
-
"phase.name": config.telemetry?.phaseName,
|
|
228
|
-
});
|
|
229
|
-
const ctx = {
|
|
230
|
-
config,
|
|
231
|
-
taskId,
|
|
232
|
-
stateDir,
|
|
233
|
-
backend,
|
|
234
|
-
env: ghEnv,
|
|
235
|
-
prePopulate,
|
|
236
|
-
access,
|
|
237
|
-
onSessionId: opts?.onSessionId,
|
|
238
|
-
sandboxFactory: opts?.sandboxFactory,
|
|
239
|
-
};
|
|
240
|
-
return withSpan("lastlight.command.execute", spanAttrs, () => runSandboxedCommand(spec, ctx, {
|
|
241
|
-
timeoutSeconds: opts?.timeoutSeconds,
|
|
242
|
-
sandboxEnv: opts?.sandboxEnv,
|
|
243
|
-
writeSession: opts?.writeSession,
|
|
244
|
-
}));
|
|
245
|
-
}
|
|
246
|
-
//# sourceMappingURL=agent-executor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-executor.js","sourceRoot":"","sources":["../../src/engine/agent-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,0BAA0B,GAI3B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACpH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACjG,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GAGpB,MAAM,6BAA6B,CAAC;AACrC,0EAA0E;AAC1E,4BAA4B;AAC5B,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAGnH;;;;;;;GAOG;AACH,KAAK,UAAU,UAAU,CACvB,MAAsB,EACtB,IAA2D;IAS3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