larkin 0.5.3 → 0.5.5

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 (49) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +22 -1
  3. package/artifacts/release/THIRD_PARTY_NOTICES.txt +1 -100
  4. package/dist/agent/agent-cli-capabilities.cjs +1 -1
  5. package/dist/agent/agent-cli-capabilities.mjs +1 -1
  6. package/dist/agent/config-cli-contract.cjs +3 -1
  7. package/dist/agent/config-cli-contract.mjs +3 -1
  8. package/dist/agent/context-prompt.cjs +16 -17
  9. package/dist/agent/context-prompt.mjs +15 -16
  10. package/dist/agent/inbox-audit-heartbeat.cjs +157 -37
  11. package/dist/agent/inbox-audit-heartbeat.mjs +122 -36
  12. package/dist/agent/missed-outbound-scan.cjs +326 -54
  13. package/dist/agent/missed-outbound-scan.mjs +319 -53
  14. package/dist/app/agent-cli.mjs +37 -6
  15. package/dist/app/agent-config.mjs +36 -5
  16. package/dist/app/cli.mjs +1 -0
  17. package/dist/dashboard/dashboard-config-controller.mjs +15 -0
  18. package/dist/dashboard/web/assets/dashboard.css +1 -1
  19. package/dist/dashboard/web/assets/dashboard.js +15 -15
  20. package/dist/feishu/host-shell.cjs +63 -5
  21. package/dist/feishu/host-shell.mjs +66 -8
  22. package/dist/platform/config.cjs +173 -5
  23. package/dist/platform/config.mjs +167 -4
  24. package/dist/runtime/pi-state-dir.cjs +105 -0
  25. package/dist/runtime/pi-state-dir.mjs +94 -0
  26. package/dist/runtime/pi-tmux-extension.mjs +137 -0
  27. package/dist/runtime/pi-tmux-injection.mjs +49 -0
  28. package/dist/runtime/pi-tmux.bundle.js +600 -0
  29. package/dist/runtime/pi-tmux.mjs +408 -0
  30. package/dist/runtime/runtime-adapters.mjs +26 -113
  31. package/dist/runtime/runtime-host.cjs +3 -413
  32. package/dist/runtime/runtime-host.mjs +2 -412
  33. package/package.json +2 -8
  34. package/dist/runtime/pi-bash-timeout-extension.mjs +0 -60
  35. package/dist/runtime/pi-bash-timeout-injection.mjs +0 -54
  36. package/dist/runtime/pi-bash-timeout.bundle.js +0 -43
  37. package/dist/runtime/pi-extension-api.mjs +0 -1
  38. package/dist/runtime/pi-subagent-injection.mjs +0 -290
  39. package/dist/runtime/pi-subagent-ledger.cjs +0 -632
  40. package/dist/runtime/pi-subagent-ledger.mjs +0 -594
  41. package/dist/runtime/pi-subagent-record-watchdog-injection.mjs +0 -43
  42. package/dist/runtime/pi-subagent-record-watchdog.bundle.js +0 -183
  43. package/dist/runtime/pi-subagent-record-watchdog.mjs +0 -46
  44. package/dist/runtime/pi-subagents-notification.mjs +0 -175
  45. package/dist/runtime/pi-subagents.bundle.js +0 -9110
  46. package/dist/runtime/pi-supervised-command-extension.mjs +0 -72
  47. package/dist/runtime/pi-supervised-command.bundle.js +0 -4735
  48. package/dist/runtime/pi-supervised-command.mjs +0 -420
  49. package/patches/@tintinweb%2Fpi-subagents@0.14.3.patch +0 -945
@@ -1,72 +0,0 @@
1
- import { Type } from "typebox";
2
- import { cancelSupervisedCommand, LARKIN_SUPERVISED_COMMAND_CAPABILITY, reapSupervisedCommands, resolveSupervisedCwd, startSupervisedCommand, supervisedWaitSeconds, waitSupervisedCommand, } from "./pi-supervised-command.mjs";
3
- void LARKIN_SUPERVISED_COMMAND_CAPABILITY;
4
- function ownerOf(ctx) {
5
- const owner = ctx?.sessionManager;
6
- if (!owner)
7
- throw new Error("supervised commands require a session");
8
- return owner;
9
- }
10
- export default function (pi) {
11
- const waitCap = supervisedWaitSeconds();
12
- let waitUsedThisTurn = false;
13
- const resetWaitTurn = () => { waitUsedThisTurn = false; };
14
- pi.on("turn_end", resetWaitTurn);
15
- const reapOwner = async (_event, ctx) => {
16
- const owner = ctx?.sessionManager;
17
- if (owner)
18
- await reapSupervisedCommands(owner);
19
- };
20
- pi.on("agent_end", reapOwner);
21
- pi.on("session_shutdown", reapOwner);
22
- pi.registerTool({
23
- name: "supervised_start",
24
- label: "supervised_start",
25
- description: "Start one supervised process with executable+args (shell:false). Background-agent only. Returns a handle; use supervised_wait in <=60s slices. Do not use bash for work that must outlive 60s.",
26
- parameters: Type.Object({
27
- executable: Type.String({ description: "Executable path or name. No shell." }),
28
- args: Type.Array(Type.String(), { description: "Argument vector. No shell metacharacters are interpreted." }),
29
- cwd: Type.Optional(Type.String({ description: "Optional cwd inside the child session root. Symlinks and path escape are rejected." })),
30
- }),
31
- async execute(_id, params, _signal, _onUpdate, ctx) {
32
- const session = ctx;
33
- const root = typeof session.cwd === "string" && session.cwd.length > 0 ? session.cwd : process.cwd();
34
- const started = startSupervisedCommand({
35
- owner: ownerOf(session),
36
- executable: params.executable,
37
- args: params.args ?? [],
38
- cwd: resolveSupervisedCwd(root, params.cwd),
39
- });
40
- return { content: [{ type: "text", text: JSON.stringify(started) }], details: started };
41
- },
42
- });
43
- pi.registerTool({
44
- name: "supervised_wait",
45
- label: "supervised_wait",
46
- description: `Wait on a supervised handle for at most ${waitCap}s. Timeout returns status=running without killing the process. At most one wait per assistant turn so queued Steer is consumed before the next wait.`,
47
- parameters: Type.Object({
48
- handle: Type.String({ description: "Handle from supervised_start" }),
49
- timeout: Type.Optional(Type.Number({ description: `Wait seconds, max ${waitCap}`, maximum: waitCap, minimum: 1 })),
50
- }),
51
- async execute(_id, params, _signal, _onUpdate, ctx) {
52
- if (waitUsedThisTurn) {
53
- throw new Error("supervised_wait is limited to once per turn; return to the model so queued Steer can run first");
54
- }
55
- waitUsedThisTurn = true;
56
- const result = await waitSupervisedCommand(ownerOf(ctx), params.handle, params.timeout);
57
- return { content: [{ type: "text", text: JSON.stringify(result) }], details: result };
58
- },
59
- });
60
- pi.registerTool({
61
- name: "supervised_cancel",
62
- label: "supervised_cancel",
63
- description: "Cancel a supervised handle and reap its process tree.",
64
- parameters: Type.Object({
65
- handle: Type.String({ description: "Handle from supervised_start" }),
66
- }),
67
- async execute(_id, params, _signal, _onUpdate, ctx) {
68
- const result = await cancelSupervisedCommand(ownerOf(ctx), params.handle);
69
- return { content: [{ type: "text", text: JSON.stringify(result) }], details: result };
70
- },
71
- });
72
- }