lastlight 0.16.0 → 0.16.2
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} +39 -1
- package/dist/{cli/cli-server.js → cli-server.js} +105 -5
- package/dist/cli-server.js.map +1 -0
- package/dist/cli-timeline.js.map +1 -0
- package/dist/{cli/cli.js → cli.js} +9 -7
- 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/notify/notifier.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `ProgressNotifier` — the concrete {@link ProgressReporter} the runner drives.
|
|
3
|
-
*
|
|
4
|
-
* It owns the current {@link ProgressModel}, re-renders once per mutation, and
|
|
5
|
-
* fans the rendered markdown out to every wired transport's `publish()`. It
|
|
6
|
-
* knows nothing about GitHub or Slack — that lives behind
|
|
7
|
-
* {@link NotifierTransport}. Multiple transports can be attached (e.g. a
|
|
8
|
-
* GitHub-triggered build that also mirrors to a Slack thread); each owns its
|
|
9
|
-
* own in-place-update handle.
|
|
10
|
-
*
|
|
11
|
-
* Mutations are serialized through an in-flight chain so two quick transitions
|
|
12
|
-
* can't race on `publish()` and post out of order (or double-create the
|
|
13
|
-
* surface before the first create's handle is stored).
|
|
14
|
-
*/
|
|
15
|
-
import { renderProgress } from "./render.js";
|
|
16
|
-
import { setStep, upsertBefore } from "./model.js";
|
|
17
|
-
export class ProgressNotifier {
|
|
18
|
-
model = null;
|
|
19
|
-
transports;
|
|
20
|
-
chain = Promise.resolve();
|
|
21
|
-
constructor(transports) {
|
|
22
|
-
this.transports = transports.filter(Boolean);
|
|
23
|
-
}
|
|
24
|
-
/** Serialize a mutation + publish so transitions can't interleave. */
|
|
25
|
-
enqueue(fn) {
|
|
26
|
-
this.chain = this.chain.then(fn, fn);
|
|
27
|
-
return this.chain;
|
|
28
|
-
}
|
|
29
|
-
async publish() {
|
|
30
|
-
if (!this.model)
|
|
31
|
-
return;
|
|
32
|
-
const model = this.model;
|
|
33
|
-
const body = renderProgress(model);
|
|
34
|
-
// Best-effort per transport — one platform failing must not block the other.
|
|
35
|
-
await Promise.all(this.transports.map((t) => t.publish(body, model).catch((err) => {
|
|
36
|
-
const m = err instanceof Error ? err.message : String(err);
|
|
37
|
-
console.warn(`[notifier] publish failed: ${m}`);
|
|
38
|
-
})));
|
|
39
|
-
}
|
|
40
|
-
start(model) {
|
|
41
|
-
return this.enqueue(async () => {
|
|
42
|
-
this.model = model;
|
|
43
|
-
await this.publish();
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
step(key, status, detail) {
|
|
47
|
-
return this.enqueue(async () => {
|
|
48
|
-
if (!this.model)
|
|
49
|
-
return;
|
|
50
|
-
this.model = { ...this.model, steps: setStep(this.model.steps, key, status, detail) };
|
|
51
|
-
await this.publish();
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
insertStep(step, beforeKey) {
|
|
55
|
-
return this.enqueue(async () => {
|
|
56
|
-
if (!this.model)
|
|
57
|
-
return;
|
|
58
|
-
this.model = { ...this.model, steps: upsertBefore(this.model.steps, step, beforeKey) };
|
|
59
|
-
await this.publish();
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
footer(markdown) {
|
|
63
|
-
return this.enqueue(async () => {
|
|
64
|
-
if (!this.model)
|
|
65
|
-
return;
|
|
66
|
-
const footer = markdown.trim() || undefined;
|
|
67
|
-
this.model = { ...this.model, footer };
|
|
68
|
-
await this.publish();
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
note(markdown) {
|
|
72
|
-
return this.noteTo(this.transports, markdown);
|
|
73
|
-
}
|
|
74
|
-
noteApproval(markdown, meta) {
|
|
75
|
-
return this.enqueue(async () => {
|
|
76
|
-
if (!markdown.trim() || this.transports.length === 0)
|
|
77
|
-
return;
|
|
78
|
-
await Promise.all(this.transports.map((t) =>
|
|
79
|
-
// Rich surfaces render interactive controls; the rest post plain text.
|
|
80
|
-
(t.noteApproval ? t.noteApproval(markdown, meta) : t.note(markdown)).catch((err) => {
|
|
81
|
-
const m = err instanceof Error ? err.message : String(err);
|
|
82
|
-
console.warn(`[notifier] noteApproval failed: ${m}`);
|
|
83
|
-
})));
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
noteTerminal(markdown) {
|
|
87
|
-
return this.noteTo(this.transports.filter((t) => t.terminalPing), markdown);
|
|
88
|
-
}
|
|
89
|
-
noteTo(transports, markdown) {
|
|
90
|
-
return this.enqueue(async () => {
|
|
91
|
-
if (!markdown.trim() || transports.length === 0)
|
|
92
|
-
return;
|
|
93
|
-
await Promise.all(transports.map((t) => t.note(markdown).catch((err) => {
|
|
94
|
-
const m = err instanceof Error ? err.message : String(err);
|
|
95
|
-
console.warn(`[notifier] note failed: ${m}`);
|
|
96
|
-
})));
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
//# sourceMappingURL=notifier.js.map
|
|
@@ -1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C,UAA+B,EAAE,QAAgB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE;YAC7B,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO;YACxD,MAAM,OAAO,CAAC,GAAG,CACf,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACnB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;gBACtC,MAAM,CAAC,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC3D,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;YAC/C,CAAC,CAAC,CACH,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/notify/render.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The single shared renderer. Turns a {@link ProgressModel} into markdown.
|
|
3
|
-
* GitHub posts the output as-is; the Slack transport converts it via
|
|
4
|
-
* `markdownToSlackMrkdwn` first. There is exactly one renderer so the two
|
|
5
|
-
* platforms can never drift in content.
|
|
6
|
-
*/
|
|
7
|
-
import type { ProgressModel, StepStatus } from "./types.js";
|
|
8
|
-
/** Status → leading emoji. Ported from the Mastra rebuild's EMOJI map. */
|
|
9
|
-
export declare const STATUS_EMOJI: Record<StepStatus, string>;
|
|
10
|
-
/** Render the model to a single markdown body. */
|
|
11
|
-
export declare function renderProgress(model: ProgressModel): string;
|
|
12
|
-
/**
|
|
13
|
-
* Collapse a rendered multi-line message into a compact one-line checklist
|
|
14
|
-
* detail: the first non-empty line, capped on *visible* length. The cap
|
|
15
|
-
* measures the rendered length (a markdown link counts as just its link
|
|
16
|
-
* text, not its URL) so a short label backed by a long URL is kept whole —
|
|
17
|
-
* truncating the raw string would slice through the URL and break the link.
|
|
18
|
-
* When a detail is genuinely too long, the link-stripped form is truncated,
|
|
19
|
-
* which can never produce a broken link.
|
|
20
|
-
*/
|
|
21
|
-
export declare function collapseDetail(s: string): string | undefined;
|
package/dist/notify/render.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/** Status → leading emoji. Ported from the Mastra rebuild's EMOJI map. */
|
|
2
|
-
export const STATUS_EMOJI = {
|
|
3
|
-
pending: "⬜",
|
|
4
|
-
running: "🔄",
|
|
5
|
-
done: "✅",
|
|
6
|
-
blocked: "⛔",
|
|
7
|
-
awaiting: "⏸️",
|
|
8
|
-
failed: "❌",
|
|
9
|
-
skipped: "➖",
|
|
10
|
-
};
|
|
11
|
-
/** Render the model to a single markdown body. */
|
|
12
|
-
export function renderProgress(model) {
|
|
13
|
-
const lines = [];
|
|
14
|
-
lines.push(`### 🤖 ${model.title}`);
|
|
15
|
-
if (model.subtitle) {
|
|
16
|
-
lines.push("");
|
|
17
|
-
lines.push(`**${model.subtitle}**`);
|
|
18
|
-
}
|
|
19
|
-
if (model.meta && model.meta.length > 0) {
|
|
20
|
-
lines.push("");
|
|
21
|
-
for (const m of model.meta)
|
|
22
|
-
if (m.trim())
|
|
23
|
-
lines.push(m);
|
|
24
|
-
}
|
|
25
|
-
lines.push("");
|
|
26
|
-
for (const step of model.steps) {
|
|
27
|
-
const emoji = STATUS_EMOJI[step.status] ?? STATUS_EMOJI.pending;
|
|
28
|
-
const detail = step.detail ? ` — ${step.detail}` : "";
|
|
29
|
-
lines.push(`- ${emoji} **${step.label}**${detail}`);
|
|
30
|
-
}
|
|
31
|
-
if (model.footer && model.footer.trim()) {
|
|
32
|
-
lines.push("");
|
|
33
|
-
lines.push(model.footer);
|
|
34
|
-
}
|
|
35
|
-
return lines.join("\n");
|
|
36
|
-
}
|
|
37
|
-
/** Markdown link `[text](url)` → its visible text, for length measurement. */
|
|
38
|
-
const visibleText = (s) => s.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1");
|
|
39
|
-
/**
|
|
40
|
-
* Collapse a rendered multi-line message into a compact one-line checklist
|
|
41
|
-
* detail: the first non-empty line, capped on *visible* length. The cap
|
|
42
|
-
* measures the rendered length (a markdown link counts as just its link
|
|
43
|
-
* text, not its URL) so a short label backed by a long URL is kept whole —
|
|
44
|
-
* truncating the raw string would slice through the URL and break the link.
|
|
45
|
-
* When a detail is genuinely too long, the link-stripped form is truncated,
|
|
46
|
-
* which can never produce a broken link.
|
|
47
|
-
*/
|
|
48
|
-
export function collapseDetail(s) {
|
|
49
|
-
const first = s
|
|
50
|
-
.split("\n")
|
|
51
|
-
.map((l) => l.trim())
|
|
52
|
-
.find((l) => l.length > 0);
|
|
53
|
-
if (!first)
|
|
54
|
-
return undefined;
|
|
55
|
-
if (visibleText(first).length <= 160)
|
|
56
|
-
return first;
|
|
57
|
-
return `${visibleText(first).slice(0, 159)}…`;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=render.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/notify/render.ts"],"names":[],"mappings":"AAQA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,YAAY,GAA+B;IACtD,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,GAAG;IACT,OAAO,EAAE,GAAG;IACZ,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,GAAG;CACb,CAAC;AAEF,kDAAkD;AAClD,MAAM,UAAU,cAAc,CAAC,KAAoB;IACjD,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,UAAU,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IACpC,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACnB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,C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ACtC,MAAM,KAAK,GAAG,CAAC;SACZ,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC7B,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,MAAM,IAAI,GAAG;QAAE,OAAO,KAAK,CAAC;IACnD,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC;AAChD,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GitHub binding for the progress notifier. Owns a single comment id and edits
|
|
3
|
-
* it in place on every `publish()`; `note()` posts a fresh comment for moments
|
|
4
|
-
* that deserve a real notification (approval prompts, terminal summary).
|
|
5
|
-
*/
|
|
6
|
-
import type { GitHubClient } from "../../engine/github/github.js";
|
|
7
|
-
import type { NotifierTransport, ProgressModel } from "../types.js";
|
|
8
|
-
export interface GitHubTransportDeps {
|
|
9
|
-
github: GitHubClient;
|
|
10
|
-
owner: string;
|
|
11
|
-
repo: string;
|
|
12
|
-
issueNumber: number;
|
|
13
|
-
/** Existing status-comment id from a resumed run, if any. */
|
|
14
|
-
commentId?: number;
|
|
15
|
-
/** Persist the comment id the first time it's created (so resume re-attaches). */
|
|
16
|
-
save?: (commentId: number) => void;
|
|
17
|
-
}
|
|
18
|
-
export declare class GitHubTransport implements NotifierTransport {
|
|
19
|
-
private readonly deps;
|
|
20
|
-
/** No terminal ping — the finished checklist + the PR-opened event suffice. */
|
|
21
|
-
readonly terminalPing = false;
|
|
22
|
-
private commentId?;
|
|
23
|
-
constructor(deps: GitHubTransportDeps);
|
|
24
|
-
publish(markdown: string, _model?: ProgressModel): Promise<void>;
|
|
25
|
-
note(markdown: string): Promise<void>;
|
|
26
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export class GitHubTransport {
|
|
2
|
-
deps;
|
|
3
|
-
/** No terminal ping — the finished checklist + the PR-opened event suffice. */
|
|
4
|
-
terminalPing = false;
|
|
5
|
-
commentId;
|
|
6
|
-
constructor(deps) {
|
|
7
|
-
this.deps = deps;
|
|
8
|
-
this.commentId = deps.commentId;
|
|
9
|
-
}
|
|
10
|
-
async publish(markdown, _model) {
|
|
11
|
-
// GitHub renders markdown natively — the structured model is Slack-only.
|
|
12
|
-
const { github, owner, repo, issueNumber } = this.deps;
|
|
13
|
-
if (this.commentId !== undefined) {
|
|
14
|
-
await github.updateComment(owner, repo, this.commentId, markdown);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
const id = await github.postComment(owner, repo, issueNumber, markdown);
|
|
18
|
-
this.commentId = id;
|
|
19
|
-
this.deps.save?.(id);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
async note(markdown) {
|
|
23
|
-
const { github, owner, repo, issueNumber } = this.deps;
|
|
24
|
-
await github.postComment(owner, repo, issueNumber, markdown);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=github.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"github.js","sourceRoot":"","sources":["../../../src/notify/transports/github.ts"],"names":[],"mappings":"AAmBA,MAAM,OAAO,eAAe;IAKG;IAJ7B,+EAA+E;IACtE,YAAY,GAAG,KAAK,CAAC;IACtB,SAAS,CAAU;IAE3B,YAA6B,IAAyB;QAAzB,SAAI,GAAJ,IAAI,CAAqB;QACpD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAAgB,EAAE,MAAsB;QACpD,yEAAyE;QACzE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QACvD,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACpE,CAAC;aAAM,CAAC;YACN,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;YACxE,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;YACpB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,QAAgB;QACzB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QACvD,MAAM,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IAC/D,CAAC;CACF"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slack binding for the progress notifier. Owns a single message `ts` and
|
|
3
|
-
* edits it in place via `chat.update` on every `publish()`; `note()` posts a
|
|
4
|
-
* fresh threaded message for moments that deserve a real ping (approval
|
|
5
|
-
* prompts, terminal summary) — `chat.update` itself is silent.
|
|
6
|
-
*/
|
|
7
|
-
import type { SlackConnector } from "../../connectors/slack/connector.js";
|
|
8
|
-
import type { ApprovalNoteMeta, NotifierTransport, ProgressModel } from "../types.js";
|
|
9
|
-
export interface SlackTransportDeps {
|
|
10
|
-
slack: SlackConnector;
|
|
11
|
-
channel: string;
|
|
12
|
-
thread: string;
|
|
13
|
-
/** Existing status-message ts from a resumed run, if any. */
|
|
14
|
-
ts?: string;
|
|
15
|
-
/** Persist the ts the first time it's created (so resume re-attaches). */
|
|
16
|
-
save?: (ts: string) => void;
|
|
17
|
-
}
|
|
18
|
-
export declare class SlackTransport implements NotifierTransport {
|
|
19
|
-
private readonly deps;
|
|
20
|
-
/** Slack edits are silent and there's no other signal — so it wants the ping. */
|
|
21
|
-
readonly terminalPing = true;
|
|
22
|
-
private ts?;
|
|
23
|
-
constructor(deps: SlackTransportDeps);
|
|
24
|
-
publish(markdown: string, model?: ProgressModel): Promise<void>;
|
|
25
|
-
note(markdown: string): Promise<void>;
|
|
26
|
-
noteApproval(markdown: string, meta: ApprovalNoteMeta): Promise<void>;
|
|
27
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { renderApprovalBlocks, renderProgressBlocks } from "../blocks.js";
|
|
2
|
-
export class SlackTransport {
|
|
3
|
-
deps;
|
|
4
|
-
/** Slack edits are silent and there's no other signal — so it wants the ping. */
|
|
5
|
-
terminalPing = true;
|
|
6
|
-
ts;
|
|
7
|
-
constructor(deps) {
|
|
8
|
-
this.deps = deps;
|
|
9
|
-
this.ts = deps.ts;
|
|
10
|
-
}
|
|
11
|
-
async publish(markdown, model) {
|
|
12
|
-
const { slack, channel, thread } = this.deps;
|
|
13
|
-
// Render Block Kit from the model when available; `markdown` stays the
|
|
14
|
-
// notification/accessibility fallback carried alongside the blocks.
|
|
15
|
-
const blocks = model ? renderProgressBlocks(model) : undefined;
|
|
16
|
-
if (this.ts !== undefined) {
|
|
17
|
-
await slack.updateMessage(channel, this.ts, markdown, blocks);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
const ts = await slack.sendMessage(channel, thread, markdown, blocks);
|
|
21
|
-
if (typeof ts === "string") {
|
|
22
|
-
this.ts = ts;
|
|
23
|
-
this.deps.save?.(ts);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
async note(markdown) {
|
|
28
|
-
const { slack, channel, thread } = this.deps;
|
|
29
|
-
await slack.sendMessage(channel, thread, markdown);
|
|
30
|
-
}
|
|
31
|
-
async noteApproval(markdown, meta) {
|
|
32
|
-
const { slack, channel, thread } = this.deps;
|
|
33
|
-
const blocks = renderApprovalBlocks(markdown, meta.workflowRunId);
|
|
34
|
-
await slack.sendMessage(channel, thread, markdown, blocks);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=slack.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slack.js","sourceRoot":"","sources":["../../../src/notify/transports/slack.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAa1E,MAAM,OAAO,cAAc;IAKI;IAJ7B,iFAAiF;IACxE,YAAY,GAAG,IAAI,CAAC;IACrB,EAAE,CAAU;IAEpB,YAA6B,IAAwB;QAAxB,SAAI,GAAJ,IAAI,CAAoB;QACnD,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAAgB,EAAE,KAAqB;QACnD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAC7C,uEAAuE;QACvE,oEAAoE;QACpE,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC/D,IAAI,IAAI,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACN,MAAM,EAAE,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;YACtE,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;gBAC3B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;gBACb,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;YACvB,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,QAAgB;QACzB,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAC7C,MAAM,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAAgB,EAAE,IAAsB;QACzD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAC7C,MAAM,MAAM,GAAG,oBAAoB,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAClE,MAAM,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
package/dist/notify/types.d.ts
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared, platform-agnostic notification model.
|
|
3
|
-
*
|
|
4
|
-
* The notifier renders workflow progress as a single "task list" surface that
|
|
5
|
-
* is **edited in place** as phases run — one GitHub comment (via
|
|
6
|
-
* `issues.updateComment`) and/or one Slack message (via `chat.update`) instead
|
|
7
|
-
* of a fresh comment per phase. The model here is the canonical content; the
|
|
8
|
-
* renderer (`render.ts`) turns it into markdown that both platforms consume
|
|
9
|
-
* (Slack runs the markdown through `markdownToSlackMrkdwn` in its transport).
|
|
10
|
-
*
|
|
11
|
-
* Nothing in this module imports GitHub or Slack — platform code lives behind
|
|
12
|
-
* the `NotifierTransport` interface so the content model stays decoupled and
|
|
13
|
-
* shared.
|
|
14
|
-
*/
|
|
15
|
-
/** Lifecycle state of a single checklist step. */
|
|
16
|
-
export type StepStatus = "pending" | "running" | "done" | "blocked" | "awaiting" | "failed" | "skipped";
|
|
17
|
-
/** One row in the task list. `key` is stable; `label` is what humans see. */
|
|
18
|
-
export interface ProgressStep {
|
|
19
|
-
key: string;
|
|
20
|
-
label: string;
|
|
21
|
-
status: StepStatus;
|
|
22
|
-
/** Optional one-line context shown after the label (e.g. a link or status). */
|
|
23
|
-
detail?: string;
|
|
24
|
-
}
|
|
25
|
-
/** Metadata carried alongside an interactive approval prompt. */
|
|
26
|
-
export interface ApprovalNoteMeta {
|
|
27
|
-
/** The paused workflow run id — a Slack Approve/Reject button carries it as
|
|
28
|
-
* its action value so the click resolves the right gate. */
|
|
29
|
-
workflowRunId: string;
|
|
30
|
-
}
|
|
31
|
-
/** The full content model rendered into the single status surface. */
|
|
32
|
-
export interface ProgressModel {
|
|
33
|
-
/** Heading line, e.g. "build for #18". */
|
|
34
|
-
title: string;
|
|
35
|
-
/** Optional bold sub-heading, e.g. the issue title. */
|
|
36
|
-
subtitle?: string;
|
|
37
|
-
/** Optional metadata lines under the heading (branch link, PR link, …). */
|
|
38
|
-
meta?: string[];
|
|
39
|
-
/** Ordered checklist. */
|
|
40
|
-
steps: ProgressStep[];
|
|
41
|
-
/** Optional trailing line (e.g. artifacts link). */
|
|
42
|
-
footer?: string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* A platform binding. Each transport owns its own in-place-update handle
|
|
46
|
-
* (a GitHub comment id or a Slack message ts) internally.
|
|
47
|
-
*/
|
|
48
|
-
export interface NotifierTransport {
|
|
49
|
-
/**
|
|
50
|
-
* Create-or-update the single status surface with the rendered markdown.
|
|
51
|
-
* The `model` is the same content source the markdown was rendered from —
|
|
52
|
-
* a transport that can render richer UI (Slack Block Kit) uses it directly
|
|
53
|
-
* while keeping `markdown` as the notification/accessibility fallback.
|
|
54
|
-
* Transports that only speak markdown (GitHub) ignore it.
|
|
55
|
-
*/
|
|
56
|
-
publish(markdown: string, model?: ProgressModel): Promise<void>;
|
|
57
|
-
/**
|
|
58
|
-
* Post a *new, separate* message (not an edit). Used for approval prompts —
|
|
59
|
-
* moments worth an actual notification, since an in-place edit is silent.
|
|
60
|
-
*/
|
|
61
|
-
note(markdown: string): Promise<void>;
|
|
62
|
-
/**
|
|
63
|
-
* Post a standalone *approval prompt*. Rich surfaces (Slack) render
|
|
64
|
-
* interactive Approve/Reject controls from `meta`; markdown-only surfaces
|
|
65
|
-
* (GitHub) omit this and the notifier falls back to `note(markdown)`.
|
|
66
|
-
* Optional so a plain transport needs only `note`.
|
|
67
|
-
*/
|
|
68
|
-
noteApproval?(markdown: string, meta: ApprovalNoteMeta): Promise<void>;
|
|
69
|
-
/**
|
|
70
|
-
* Whether this surface wants a separate *completion* ping at the end of a
|
|
71
|
-
* run. Slack sets this (its in-place edits are silent and it has no other
|
|
72
|
-
* signal); GitHub leaves it false — the edited checklist plus the
|
|
73
|
-
* PR-opened event already notify watchers, so a terminal comment would just
|
|
74
|
-
* be noise. Default false.
|
|
75
|
-
*/
|
|
76
|
-
readonly terminalPing?: boolean;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* The runner-facing API. `runner.ts` only ever sees this interface — it never
|
|
80
|
-
* touches a transport or the markdown directly.
|
|
81
|
-
*/
|
|
82
|
-
export interface ProgressReporter {
|
|
83
|
-
/** Seed the task list. Idempotent: a resumed run re-seeds the same surface. */
|
|
84
|
-
start(model: ProgressModel): Promise<void>;
|
|
85
|
-
/** Transition a step's status (and optionally set its one-line detail). */
|
|
86
|
-
step(key: string, status: StepStatus, detail?: string): Promise<void>;
|
|
87
|
-
/**
|
|
88
|
-
* Insert (or update) a dynamic step before `beforeKey` — used for loop
|
|
89
|
-
* iterations (re-review / fix cycles). Appends when `beforeKey` is omitted
|
|
90
|
-
* or not found.
|
|
91
|
-
*/
|
|
92
|
-
insertStep(step: ProgressStep, beforeKey?: string): Promise<void>;
|
|
93
|
-
/** Post a standalone message to every surface (e.g. an approval prompt). */
|
|
94
|
-
note(markdown: string): Promise<void>;
|
|
95
|
-
/**
|
|
96
|
-
* Post an interactive approval prompt to every surface. Rich surfaces render
|
|
97
|
-
* Approve/Reject controls (Slack Block Kit); others fall back to plain text.
|
|
98
|
-
*/
|
|
99
|
-
noteApproval(markdown: string, meta: ApprovalNoteMeta): Promise<void>;
|
|
100
|
-
/**
|
|
101
|
-
* Set (or clear) the trailing footer of the single status surface and
|
|
102
|
-
* re-publish in place. Used to fold a workflow's final synthesized result
|
|
103
|
-
* into the same comment as the checklist rather than posting a new one.
|
|
104
|
-
* Pass an empty string to clear.
|
|
105
|
-
*/
|
|
106
|
-
footer(markdown: string): Promise<void>;
|
|
107
|
-
/**
|
|
108
|
-
* Post the run's completion message, but only to surfaces that want a
|
|
109
|
-
* terminal ping (Slack) — GitHub is left with just the finished checklist.
|
|
110
|
-
*/
|
|
111
|
-
noteTerminal(markdown: string): Promise<void>;
|
|
112
|
-
}
|
|
113
|
-
/** Persisted in-place-update handles, stored under `workflow_runs.scratch.notifier`. */
|
|
114
|
-
export interface NotifierState {
|
|
115
|
-
githubCommentId?: number;
|
|
116
|
-
slackTs?: string;
|
|
117
|
-
slackChannel?: string;
|
|
118
|
-
slackThread?: string;
|
|
119
|
-
}
|
package/dist/notify/types.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared, platform-agnostic notification model.
|
|
3
|
-
*
|
|
4
|
-
* The notifier renders workflow progress as a single "task list" surface that
|
|
5
|
-
* is **edited in place** as phases run — one GitHub comment (via
|
|
6
|
-
* `issues.updateComment`) and/or one Slack message (via `chat.update`) instead
|
|
7
|
-
* of a fresh comment per phase. The model here is the canonical content; the
|
|
8
|
-
* renderer (`render.ts`) turns it into markdown that both platforms consume
|
|
9
|
-
* (Slack runs the markdown through `markdownToSlackMrkdwn` in its transport).
|
|
10
|
-
*
|
|
11
|
-
* Nothing in this module imports GitHub or Slack — platform code lives behind
|
|
12
|
-
* the `NotifierTransport` interface so the content model stays decoupled and
|
|
13
|
-
* shared.
|
|
14
|
-
*/
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=types.js.map
|
package/dist/notify/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/notify/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|
package/dist/providers.d.ts
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provider registry — single source of truth for the LLM providers Last Light
|
|
3
|
-
* knows how to wire end-to-end.
|
|
4
|
-
*
|
|
5
|
-
* pi-ai (`@earendil-works/pi-ai`) is provider-agnostic and supports 15+
|
|
6
|
-
* providers out of the box. Of those, only a subset is "wizard-able" here:
|
|
7
|
-
* they authenticate with a single API-key env var and expose a stable
|
|
8
|
-
* endpoint reachable from the sandbox egress firewall. Excluded are the
|
|
9
|
-
* OAuth-only providers (`openai-codex`, `github-copilot`), the multi-env
|
|
10
|
-
* Ambient-cred ones (`amazon-bedrock`, `google-vertex`, `azure-openai-*`,
|
|
11
|
-
* `cloudflare-*`), and the regional-CN variants.
|
|
12
|
-
*
|
|
13
|
-
* This registry is consumed by:
|
|
14
|
-
* - `src/engine/llm.ts` — the cheap one-shot helper used by the
|
|
15
|
-
* prompt screener + intent classifier. It builds requests for the
|
|
16
|
-
* `openai-completions` family (which is most wizard-able providers —
|
|
17
|
-
* Google and Mistral are routed through their OpenAI-compatible
|
|
18
|
-
* endpoints) and the `anthropic-messages` family (Kimi for Coding,
|
|
19
|
-
* MiniMax, Anthropic itself).
|
|
20
|
-
* - `src/engine/agent-executor.ts` — forwards each provider's env var
|
|
21
|
-
* into the sandbox so agentic-pi can auth.
|
|
22
|
-
* - `src/sandbox/egress-allowlist.ts` — the SNI/firewall allowlist is
|
|
23
|
-
* seeded from each provider's `host`.
|
|
24
|
-
* - `src/cli/setup.ts` — the install wizard's step-4 provider picker.
|
|
25
|
-
*
|
|
26
|
-
* Keep this list aligned with pi-ai's provider registry. When pi-ai adds a
|
|
27
|
-
* new provider that we want to surface, add an entry here and everything
|
|
28
|
-
* else (forwarding, egress, wizard UI) follows automatically.
|
|
29
|
-
*/
|
|
30
|
-
/** API request/response family pi-ai uses to talk to a provider. */
|
|
31
|
-
export type ApiType =
|
|
32
|
-
/** Anthropic Messages API — `system` field, content-block response. */
|
|
33
|
-
"anthropic-messages"
|
|
34
|
-
/** OpenAI Chat Completions API — `messages`, `choices[0].message.content`. */
|
|
35
|
-
| "openai-completions";
|
|
36
|
-
/**
|
|
37
|
-
* Metadata for one wizard-able provider. The request-building differences
|
|
38
|
-
* between OpenAI-completions-family providers (maxTokensField name,
|
|
39
|
-
* extra headers, nested-model-id quirk) are small, so they live as optional
|
|
40
|
-
* fields here rather than separate adapter objects.
|
|
41
|
-
*/
|
|
42
|
-
export interface ProviderSpec {
|
|
43
|
-
/** pi-ai model-spec prefix — the part before `/` in `provider/model`. */
|
|
44
|
-
readonly prefix: string;
|
|
45
|
-
/** Display name (shown in the wizard). */
|
|
46
|
-
readonly displayName: string;
|
|
47
|
-
/** Env var that carries the API key (also the env var forwarded into the sandbox). */
|
|
48
|
-
readonly envKey: string;
|
|
49
|
-
/** API base URL — `chat/completions` or `messages` is appended per `api`. */
|
|
50
|
-
readonly baseUrl: string;
|
|
51
|
-
/** API request/response family. */
|
|
52
|
-
readonly api: ApiType;
|
|
53
|
-
/** Egress allowlist host — apex (matches all subdomains) or specific host. */
|
|
54
|
-
readonly host: string;
|
|
55
|
-
/** Small/fast model id used by the screener + classifier cheap helper. */
|
|
56
|
-
readonly fastModel: string;
|
|
57
|
-
/** Canonical primary model id (used as the wizard placeholder). */
|
|
58
|
-
readonly sampleModel: string;
|
|
59
|
-
/** OpenAI-completions only: body field for the token cap. Default `max_tokens`. */
|
|
60
|
-
readonly maxTokensField?: "max_tokens" | "max_completion_tokens";
|
|
61
|
-
/** OpenAI-completions only: keep the nested `vendor/model` tail verbatim (OpenRouter). */
|
|
62
|
-
readonly preserveNestedModelId?: boolean;
|
|
63
|
-
/** OpenAI-completions only: extra request headers (OpenRouter's referer/title). */
|
|
64
|
-
readonly extraHeaders?: Readonly<Record<string, string>>;
|
|
65
|
-
/** Optional wizard hint for the API-key prefix (used in placeholder + loose validation). */
|
|
66
|
-
readonly keyPrefix?: string;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* The registry. Order matters — `defaultFastModel()` in `llm.ts` selects
|
|
70
|
-
* a fast model by iterating this list and picking the first provider
|
|
71
|
-
* whose env var is present. Always keep Anthropic first (best raw-latency
|
|
72
|
-
* cheap helper) then OpenAI then OpenRouter, then the rest grouped by
|
|
73
|
-
* families so the array is easy to scan.
|
|
74
|
-
*/
|
|
75
|
-
export declare const PROVIDERS: readonly ProviderSpec[];
|
|
76
|
-
export declare function providerByPrefix(prefix: string): ProviderSpec | undefined;
|
|
77
|
-
export declare function providerByEnvKey(envKey: string): ProviderSpec | undefined;
|
|
78
|
-
/** All the env var names a harness must forward to reach every registered provider. */
|
|
79
|
-
export declare const PROVIDER_ENV_KEYS: readonly string[];
|
|
80
|
-
/** All the hosts the sandbox egress firewall must allowlist to reach these providers. */
|
|
81
|
-
export declare const PROVIDER_HOSTS: readonly string[];
|
|
82
|
-
/**
|
|
83
|
-
* Default model spec shipped with the harness. Keep aligned with the
|
|
84
|
-
* `OPENCODE_MODEL` default in `config/default.yaml` and the wizard's
|
|
85
|
-
* initial provider selection.
|
|
86
|
-
*/
|
|
87
|
-
export declare const DEFAULT_PROVIDER = "anthropic";
|
|
88
|
-
export declare const DEFAULT_MODEL = "anthropic/claude-sonnet-4-6";
|
|
89
|
-
/**
|
|
90
|
-
* OAuth (subscription-login) providers — the ones the API-key registry above
|
|
91
|
-
* deliberately excludes. These don't authenticate with a static key env var;
|
|
92
|
-
* a user logs in once (`lastlight oauth login <id>`) and pi-ai manages the
|
|
93
|
-
* token. Two consumption seams with different reach:
|
|
94
|
-
*
|
|
95
|
-
* - **chat** (in-process pi-ai) supports ALL of these — the chat runner
|
|
96
|
-
* passes the resolved token as the per-call `apiKey`.
|
|
97
|
-
* - **sandbox** (agentic-pi) resolves creds from ENV only, so a provider is
|
|
98
|
-
* sandbox-usable ONLY if `sandboxEnvVar` is set (the env var pi-ai reads
|
|
99
|
-
* inside the sandbox). Codex has none → chat-only.
|
|
100
|
-
*
|
|
101
|
-
* Egress note: chat is in-process (not behind the sandbox firewall), and the
|
|
102
|
-
* one sandbox-capable OAuth provider whose models we ship (`anthropic`) reuses
|
|
103
|
-
* the `anthropic.com` host already in the API-key registry — so no OAuth host
|
|
104
|
-
* is added to the sandbox allowlist here.
|
|
105
|
-
*/
|
|
106
|
-
export interface OAuthProviderSpec {
|
|
107
|
-
/** pi-ai OAuth provider id — also `lastlight oauth login <id>`. */
|
|
108
|
-
readonly id: string;
|
|
109
|
-
/** Display name (wizard + CLI). */
|
|
110
|
-
readonly displayName: string;
|
|
111
|
-
/** pi-ai model-spec prefix (`provider` in `provider/model`) for its models. */
|
|
112
|
-
readonly modelPrefix: string;
|
|
113
|
-
/** Representative model spec — wizard placeholder / docs hint. */
|
|
114
|
-
readonly sampleModel: string;
|
|
115
|
-
/**
|
|
116
|
-
* Env var pi-ai reads for this provider's OAuth token inside a sandbox, or
|
|
117
|
-
* `null` when there's no env route (⇒ chat-only; cannot run sandbox phases).
|
|
118
|
-
*/
|
|
119
|
-
readonly sandboxEnvVar: string | null;
|
|
120
|
-
/** True when login is mandatory (no API-key fallback). */
|
|
121
|
-
readonly oauthOnly: boolean;
|
|
122
|
-
}
|
|
123
|
-
export declare const OAUTH_PROVIDERS: readonly OAuthProviderSpec[];
|
|
124
|
-
export declare function oauthProviderByModelPrefix(prefix: string): OAuthProviderSpec | undefined;
|
|
125
|
-
export declare function oauthProviderById(id: string): OAuthProviderSpec | undefined;
|