lastlight 0.5.1 → 0.6.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.
Files changed (43) hide show
  1. package/.claude-plugin/marketplace.json +14 -0
  2. package/README.md +39 -0
  3. package/agent-context/rules.md +0 -38
  4. package/agent-context/soul.md +0 -11
  5. package/dist/cli.js +24 -0
  6. package/dist/cli.js.map +1 -1
  7. package/dist/config.d.ts +1 -1
  8. package/dist/config.js +3 -3
  9. package/dist/config.js.map +1 -1
  10. package/dist/engine/agent-executor.d.ts +2 -139
  11. package/dist/engine/agent-executor.js +76 -996
  12. package/dist/engine/agent-executor.js.map +1 -1
  13. package/dist/engine/executors/backends.d.ts +41 -0
  14. package/dist/engine/executors/backends.js +541 -0
  15. package/dist/engine/executors/backends.js.map +1 -0
  16. package/dist/engine/executors/shared.d.ts +189 -0
  17. package/dist/engine/executors/shared.js +612 -0
  18. package/dist/engine/executors/shared.js.map +1 -0
  19. package/dist/sandbox/index.d.ts +1 -1
  20. package/dist/sandbox/index.js +1 -1
  21. package/dist/sandbox/index.js.map +1 -1
  22. package/dist/sandbox/smol.d.ts +162 -0
  23. package/dist/sandbox/smol.integration.test.d.ts +1 -0
  24. package/dist/sandbox/smol.integration.test.js +130 -0
  25. package/dist/sandbox/smol.integration.test.js.map +1 -0
  26. package/dist/sandbox/smol.js +485 -0
  27. package/dist/sandbox/smol.js.map +1 -0
  28. package/dist/skills-install.d.ts +12 -0
  29. package/dist/skills-install.js +179 -0
  30. package/dist/skills-install.js.map +1 -0
  31. package/package.json +4 -2
  32. package/plugins/lastlight/.claude-plugin/plugin.json +12 -0
  33. package/plugins/lastlight/README.md +44 -0
  34. package/plugins/lastlight/skills/lastlight-client/SKILL.md +82 -0
  35. package/plugins/lastlight/skills/lastlight-evals/SKILL.md +97 -0
  36. package/plugins/lastlight/skills/lastlight-evals/references/instance-schema.md +84 -0
  37. package/plugins/lastlight/skills/lastlight-evals/references/models-json.md +42 -0
  38. package/plugins/lastlight/skills/lastlight-overlay/SKILL.md +72 -0
  39. package/plugins/lastlight/skills/lastlight-overlay/references/forking.md +55 -0
  40. package/plugins/lastlight/skills/lastlight-overlay/references/overlay-layout.md +52 -0
  41. package/plugins/lastlight/skills/lastlight-server/SKILL.md +124 -0
  42. package/plugins/lastlight/skills/lastlight-server/references/env-schema.md +103 -0
  43. package/plugins/lastlight/skills/lastlight-server/references/operations.md +60 -0
@@ -1,39 +1,5 @@
1
- import type { RunResult } from "agentic-pi";
2
- import { type DockerSandbox } from "../sandbox/index.js";
3
- import { type ExecutorConfig, type ExecutionResult, type ExtensionStatusMap, type SkillsStatus, type GitSandboxAccess } from "./profiles.js";
4
- /**
5
- * Stage this phase's declared skills into a per-phase bundle directory at
6
- * `<workspaceRoot>/.lastlight-skills/<phaseKey>/<basename>/` and return the
7
- * staged skill dirs, so the caller can point pi at them explicitly (via
8
- * `--skill` for docker or `skillPaths` for the in-process backends). Each
9
- * skill is a directory containing SKILL.md plus any `scripts/` / `references/`
10
- * / `assets/` — the whole tree comes along.
11
- *
12
- * Keyed by phase so concurrent phases in one workspace never touch each
13
- * other's bundle: only the phase's own `<phaseKey>` subtree is cleared, so a
14
- * clean slate per phase doesn't disturb a sibling phase mid-run.
15
- *
16
- * `mode` controls how each skill lands:
17
- * - "symlink": one symlink per skill → host source. gondolin/none, where pi
18
- * reads skill files host-side / through the cwd mount. Zero-copy.
19
- * - "copy": recursive copy. docker, where the agent's tools run inside the
20
- * container and host symlink targets wouldn't resolve; the copy lands
21
- * under the bind-mounted workspace.
22
- *
23
- * Returns `undefined` when the phase declares no skills (after clearing its
24
- * bundle), so a phase with no `skills:` gets no catalogue at all.
25
- */
26
- export declare function stageSkillBundle(workspaceRoot: string, phaseKey: string, skillPaths: string[] | undefined, mode: "symlink" | "copy"): string[] | undefined;
27
- /**
28
- * Add `entry` to a checkout's local `.git/info/exclude` (idempotent) so the
29
- * agent's own `git add`/`commit` can never pick it up. This file lives inside
30
- * `.git/` — it is never tracked, committed, or pushed, and it leaves the repo's
31
- * real `.gitignore` untouched; the exclusion applies only to this ephemeral
32
- * sandbox checkout. Used for the gondolin backend, where the skill bundle must
33
- * be staged under cwd (the only mounted dir) rather than as an out-of-repo
34
- * sibling. No-op when `repoDir` isn't a git checkout (e.g. the workspace root).
35
- */
36
- export declare function excludeFromGit(repoDir: string, entry: string): void;
1
+ import { type ExecutorConfig, type ExecutionResult, type GitSandboxAccess } from "./profiles.js";
2
+ export { RunResultAccumulator, stageSkillBundle, excludeFromGit, detectAccountError } from "./executors/shared.js";
37
3
  export declare function executeAgent(prompt: string, config: ExecutorConfig, opts?: {
38
4
  taskId?: string;
39
5
  /**
@@ -75,106 +41,3 @@ export declare function executeCommand(spec: CommandSpec, config: ExecutorConfig
75
41
  */
76
42
  writeSession?: boolean;
77
43
  }): Promise<ExecutionResult>;
78
- /**
79
- * Build a RunResult-shaped tally from the JSONL event stream emitted by
80
- * `agentic-pi run` inside the docker sandbox. Mirrors what agentic-pi's
81
- * own `run()` function does in-process — minimum viable subset of
82
- * fields the executor cares about.
83
- *
84
- * Usage accounting accumulates each assistant `message_end`'s `usage`
85
- * rather than trusting the terminal `usage_snapshot`. pi's snapshot is
86
- * derived from `getSessionStats()`, which recomputes from the *current*
87
- * in-memory message window — auto-compaction replaces those messages with
88
- * a summary, so the snapshot reports zero tokens/cost/turns the moment a
89
- * phase compacts. The per-message events fire at finalization (before any
90
- * compaction rebuild), so summing them is compaction-proof. `bestStats()`
91
- * prefers the accumulation and falls back to the snapshot only when no
92
- * per-message usage was observed.
93
- */
94
- export declare class RunResultAccumulator {
95
- private sessionId?;
96
- private finalText;
97
- private agentEnded;
98
- private toolErrors;
99
- private maxStepsReached;
100
- private lastToolError?;
101
- private lastAssistantHadToolCall;
102
- private fatalError?;
103
- private snapshotStats?;
104
- private messages;
105
- private assistantMessages;
106
- private userMessages;
107
- private toolCalls;
108
- private toolResults;
109
- private msgInput;
110
- private msgOutput;
111
- private msgCacheRead;
112
- private msgCacheWrite;
113
- private msgCost;
114
- private ext;
115
- private skillsRaw?;
116
- feed(r: Record<string, unknown>): void;
117
- private accumulateUsage;
118
- /** Stats summed from per-message usage, or undefined if none was seen. */
119
- private accumulatedStats;
120
- /**
121
- * Prefer the per-message accumulation (compaction-proof) over pi's
122
- * terminal `usage_snapshot`. Fall back to the snapshot only when the
123
- * accumulation carries no token data — e.g. a provider that doesn't
124
- * report per-message usage — so a non-compacted snapshot still wins.
125
- */
126
- bestStats(): RunResult["stats"] | undefined;
127
- build(exitCode: 0 | 1 | 2): RunResult;
128
- /**
129
- * Normalized extension status captured from `extension_status` events
130
- * (file-search / github / web-search), or undefined if none reported.
131
- * Decoupled from agentic-pi's `RunResult` type, which lags the runtime —
132
- * the docker sandbox's agentic-pi emits file-search even when the harness's
133
- * pinned `RunResult` type doesn't yet declare it.
134
- */
135
- extensions(): ExtensionStatusMap | undefined;
136
- /**
137
- * Normalized skill-loading status from the gated `skills_status` event, or
138
- * undefined if none was reported (agentic-pi suppresses it on a run that
139
- * configured no skills and discovered none). The skill-loading counterpart
140
- * to {@link extensions}.
141
- */
142
- skills(): SkillsStatus | undefined;
143
- /**
144
- * The last tool result that came back with `isError: true`, including the
145
- * failure text — or undefined if no tool errored. This is what turns a
146
- * bare `error_tool` stop reason into a human-readable cause.
147
- */
148
- toolError(): {
149
- tool?: string;
150
- message: string;
151
- } | undefined;
152
- /**
153
- * True iff the run's final assistant turn ended on a tool call — meaning
154
- * the agent intended to keep going but the loop stopped before it could
155
- * respond to the tool result and write its answer. The signal a run was
156
- * truncated (step-limit) rather than genuinely finished.
157
- */
158
- endedOnToolCall(): boolean;
159
- }
160
- /**
161
- * Detect a provider account error (out of credit, quota, rate-limited, bad key)
162
- * that pi may have surfaced as plain text rather than a hard failure.
163
- *
164
- * Critically, on a **successful** run we scan ONLY the genuine provider-error
165
- * channel (`agentErrorMessage`, which `extractAgentError` already turns into a
166
- * non-success stopReason when set — so it's empty here). The agent's own output
167
- * (`finalText`) and tool results (`fatalError`, `toolError`) are NOT scanned on
168
- * success: a legitimate `verify`/`qa-test` report or a `curl` probing a 401
169
- * endpoint routinely contains "unauthorized" / "rate limit" as part of the task
170
- * itself, and folding that in would wrongly fail a genuinely successful run
171
- * (and drop its report). Only on a failed run do we fold those in to label why.
172
- */
173
- export declare function detectAccountError(opts: {
174
- success: boolean;
175
- fatalErrorMessage?: string;
176
- agentErrorMessage?: string;
177
- finalText?: string;
178
- toolErrorText?: string;
179
- }): boolean;
180
- export type { DockerSandbox };