@agimon-ai/doompi-loop 0.0.1-alpha.9 → 0.0.1-alpha.91

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 (87) hide show
  1. package/README.md +83 -21
  2. package/dist/apiContracts.cjs +17 -0
  3. package/dist/apiContracts.cjs.map +1 -0
  4. package/dist/apiContracts.d.mts +53 -0
  5. package/dist/apiContracts.d.mts.map +1 -0
  6. package/dist/apiContracts.mjs +13 -0
  7. package/dist/apiContracts.mjs.map +1 -0
  8. package/dist/extensions/pi.cjs +659 -1
  9. package/dist/extensions/pi.cjs.map +1 -1
  10. package/dist/extensions/pi.d.mts +5 -2
  11. package/dist/extensions/pi.d.mts.map +1 -0
  12. package/dist/extensions/pi.mjs +654 -1
  13. package/dist/extensions/pi.mjs.map +1 -1
  14. package/dist/extensions/server.cjs +369 -0
  15. package/dist/extensions/server.cjs.map +1 -0
  16. package/dist/extensions/server.d.mts +5 -0
  17. package/dist/extensions/server.d.mts.map +1 -0
  18. package/dist/extensions/server.mjs +364 -0
  19. package/dist/extensions/server.mjs.map +1 -0
  20. package/dist/extensions/web.mjs +331 -0
  21. package/dist/extensions/web.mjs.map +1 -0
  22. package/dist/index.cjs +0 -1
  23. package/dist/index.d.mts +2 -4
  24. package/dist/index.mjs +1 -1
  25. package/dist/loopLaunchers-Bciapxt0.d.mts +69 -0
  26. package/dist/loopLaunchers-Bciapxt0.d.mts.map +1 -0
  27. package/dist/loopLaunchers-BtcLH_xN.cjs +32 -0
  28. package/dist/loopLaunchers-BtcLH_xN.cjs.map +1 -0
  29. package/dist/loopLaunchers-cCniFbVA.mjs +15 -0
  30. package/dist/loopLaunchers-cCniFbVA.mjs.map +1 -0
  31. package/dist/loopLaunchers.cjs +5 -0
  32. package/dist/loopLaunchers.d.mts +2 -0
  33. package/dist/loopLaunchers.mjs +2 -0
  34. package/dist/loopView-BK4X_1UI.mjs +349 -0
  35. package/dist/loopView-BK4X_1UI.mjs.map +1 -0
  36. package/dist/loopView-C_OPuy8L.cjs +456 -0
  37. package/dist/loopView-C_OPuy8L.cjs.map +1 -0
  38. package/llms.txt +9 -0
  39. package/package.json +82 -14
  40. package/src/prompts/doompi-use-loop/SKILL.md +44 -0
  41. package/src/types/loopView.ts +73 -0
  42. package/dist/commands/loopCommand.cjs +0 -2
  43. package/dist/commands/loopCommand.cjs.map +0 -1
  44. package/dist/commands/loopCommand.mjs +0 -2
  45. package/dist/commands/loopCommand.mjs.map +0 -1
  46. package/dist/constants.cjs +0 -2
  47. package/dist/constants.cjs.map +0 -1
  48. package/dist/constants.mjs +0 -2
  49. package/dist/constants.mjs.map +0 -1
  50. package/dist/defaultLauncher.cjs +0 -2
  51. package/dist/defaultLauncher.cjs.map +0 -1
  52. package/dist/defaultLauncher.d.cts +0 -10
  53. package/dist/defaultLauncher.d.cts.map +0 -1
  54. package/dist/defaultLauncher.d.mts +0 -10
  55. package/dist/defaultLauncher.d.mts.map +0 -1
  56. package/dist/defaultLauncher.mjs +0 -2
  57. package/dist/defaultLauncher.mjs.map +0 -1
  58. package/dist/extension.cjs +0 -2
  59. package/dist/extension.cjs.map +0 -1
  60. package/dist/extension.d.cts +0 -6
  61. package/dist/extension.d.cts.map +0 -1
  62. package/dist/extension.d.mts +0 -6
  63. package/dist/extension.d.mts.map +0 -1
  64. package/dist/extension.mjs +0 -2
  65. package/dist/extension.mjs.map +0 -1
  66. package/dist/extensions/pi.d.cts +0 -2
  67. package/dist/index.d.cts +0 -4
  68. package/dist/launcher.cjs +0 -2
  69. package/dist/launcher.cjs.map +0 -1
  70. package/dist/launcher.d.cts +0 -47
  71. package/dist/launcher.d.cts.map +0 -1
  72. package/dist/launcher.d.mts +0 -47
  73. package/dist/launcher.d.mts.map +0 -1
  74. package/dist/launcher.mjs +0 -2
  75. package/dist/launcher.mjs.map +0 -1
  76. package/dist/leader.cjs +0 -2
  77. package/dist/leader.cjs.map +0 -1
  78. package/dist/leader.mjs +0 -2
  79. package/dist/leader.mjs.map +0 -1
  80. package/dist/tui/loopListOverlay.cjs +0 -2
  81. package/dist/tui/loopListOverlay.cjs.map +0 -1
  82. package/dist/tui/loopListOverlay.mjs +0 -2
  83. package/dist/tui/loopListOverlay.mjs.map +0 -1
  84. package/dist/tui/startLoopOverlay.cjs +0 -2
  85. package/dist/tui/startLoopOverlay.cjs.map +0 -1
  86. package/dist/tui/startLoopOverlay.mjs +0 -2
  87. package/dist/tui/startLoopOverlay.mjs.map +0 -1
package/README.md CHANGED
@@ -1,42 +1,104 @@
1
1
  # @agimon-ai/doompi-loop
2
2
 
3
- Generic multi-loop controller for Doompi.
3
+ Send a prompt now, then repeat it at a bounded interval for the current session.
4
4
 
5
- Runs a prompt on a schedule. Loop is a minor mode: it toggles mid-session, stacks with
6
- the others, and reports itself on the shared `MODES` line.
5
+ Part of the [DoomPi distribution](https://www.npmjs.com/package/@agimon-ai/doompi).
7
6
 
8
- Part of [Doompi](https://www.npmjs.com/package/@agimon-ai/doompi), a coding agent that loads
9
- only the skills and tools you name. This package is composed by Doompi and is not usually
10
- installed on its own.
7
+ Several loops can coexist. Loop is a minor mode and remains active while at least one scheduled
8
+ prompt belongs to the current session.
9
+
10
+ > **Alpha:** launcher and scheduling contracts may change between releases.
11
+
12
+ ## Requirements
13
+
14
+ - Node.js 22.19.0 or newer
15
+ - Pi 0.85.0 and Pi TUI 0.85.0
11
16
 
12
17
  ## Install
13
18
 
19
+ The seeded `modes.yaml` selects Loop in `default.packages`. Keep it there or select it through a
20
+ layer; it is not fixed host infrastructure. For standalone Pi:
21
+
14
22
  ```bash
15
- npm install @agimon-ai/doompi-loop
23
+ pi install npm:@agimon-ai/doompi-loop
16
24
  ```
17
25
 
18
- ## How it loads
26
+ ## Start and manage loops
27
+
28
+ Use `/loop` to start a loop and `/loops` to inspect or stop active loops. In DoomPi, `SPC l s` opens
29
+ the start flow and `SPC l l` opens the list.
30
+
31
+ The default interval is 300 seconds. Accepted intervals range from 30 to 3600 seconds. A loop runs
32
+ its prompt once immediately, then schedules later passes.
33
+
34
+ If Pi is busy, a due pass waits for the shared agent to become idle. Multiple due signals can
35
+ coalesce rather than creating overlapping model turns. Stopping a loop prevents future passes but
36
+ does not rewind side effects from a pass already sent.
37
+
38
+ ## Lifecycle and cost
39
+
40
+ Loop state belongs to the session's `doom/loop-launchers` service; it is not a durable queue.
41
+ Replacing or shutting down the session aborts pending launches and stops active timers. Resuming a
42
+ transcript does not restart old loops.
19
43
 
20
- Doompi loads this unconditionally. It is core, not a layer, so it does not appear in
21
- `.doom/modes.yaml`: making it optional would only create broken configurations.
44
+ Every pass can start another model turn and repeat tool or external side effects. Choose
45
+ conservative intervals, make prompts idempotent where possible, and stop loops when the recurring
46
+ work is complete.
22
47
 
23
- Extension entry: `@agimon-ai/doompi-loop/extensions/pi`
48
+ ## Web extension slots
24
49
 
25
- ## Leader
50
+ The Loop Activity section declares `loop.registration` for start controls and `loop.items` for
51
+ session-scoped instance rows. Other web plugins may fill either slot; Loop owns the section shell and
52
+ renders all registered fills without requiring a feature-specific dependency.
26
53
 
27
- `SPC l s` starts a loop, `SPC l l` lists and stops them, once the extension is loaded.
54
+ ## Extension authors: cross-extension launchers
28
55
 
29
- The built-in **Default loop** asks for a prompt and an interval, runs one pass immediately,
30
- and repeats while the session is open. Other extensions can register domain-specific loop
31
- launchers alongside it.
56
+ Launcher definitions use the shared Cordis service. A consumer registers a launcher and returns its
57
+ cleanup callback. Cordis removes that launcher when either package or the session unloads, then
58
+ registers it again when the provider returns.
32
59
 
33
- ## Entry points
60
+ ```ts
61
+ import { DOOM_LOOP_LAUNCHERS_SERVICE, requireDoomLoopLaunchers } from '@agimon-ai/doompi-loop/loop-launchers';
62
+ import type { Context } from '@deepseek-ai/cordis';
34
63
 
35
- | Import |
36
- | -------------------------------------- |
37
- | `@agimon-ai/doompi-loop` |
38
- | `@agimon-ai/doompi-loop/extensions/pi` |
64
+ export function myLoopPlugin(ctx: Context): void {
65
+ ctx.inject([DOOM_LOOP_LAUNCHERS_SERVICE], (sessionContext) => {
66
+ const registration = requireDoomLoopLaunchers(sessionContext).register({
67
+ id: 'example.recurring-check',
68
+ source: '@example/doompi-recurring-check',
69
+ label: 'Recurring check',
70
+ async launch({ instanceId, signal }) {
71
+ signal.throwIfAborted();
72
+ // Start session work. The returned stop callback owns cleanup.
73
+ return { instanceId, stop: () => undefined };
74
+ },
75
+ });
76
+ return () => registration.dispose('Contributor unloaded.');
77
+ });
78
+ }
79
+ ```
80
+
81
+ Mount that plugin on the runner's shared Doom Cordis root. Loop owns the registry and default
82
+ launcher. Consumers depend only on
83
+ `@agimon-ai/doompi-loop/loop-launchers`; there is no process-global registry or
84
+ session-ID lookup API.
85
+
86
+ The package root exports the service contract
87
+ types. Normal Pi activation uses the discovered `extensions/pi` entry.
88
+
89
+ ## Development
90
+
91
+ ```bash
92
+ pnpm build
93
+ pnpm typecheck
94
+ pnpm test
95
+ pnpm lint
96
+ ```
97
+
98
+ Maintained by [Agimon](https://agimon.ai/about).
39
99
 
40
100
  ## License
41
101
 
42
102
  MIT
103
+
104
+ Pi and server entries live directly in `src/extensions/`. They declare commands, minor mode owners, and optional services. The helpers own registration and cleanup; `onDispose` clears UI state, while session service disposal stops pending launches and timers. Services live in named folders and public exports remain flat.
@@ -0,0 +1,17 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ //#region src/schemas/apiContracts.ts
6
+ /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
7
+ const apiContracts = (0, require("@agimon-ai/doompi-core/apiContracts").defineApiContract)({
8
+ version: 1,
9
+ http: [],
10
+ sockets: [],
11
+ dynamic: []
12
+ });
13
+ //#endregion
14
+ exports.apiContracts = apiContracts;
15
+ exports.default = apiContracts;
16
+
17
+ //# sourceMappingURL=apiContracts.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiContracts.cjs","names":["defineApiContract"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/doompi-core/apiContracts';\n\n/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;;;;AAGA,MAAa,gBAAA,gDAAeA,CAAAA,CAAAA,kBAAAA,CAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
@@ -0,0 +1,53 @@
1
+ //#region src/schemas/apiContracts.d.ts
2
+ /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
3
+ export declare const apiContracts: {
4
+ version: 1;
5
+ protocols?: Record<string, string> | undefined;
6
+ schemas?: Record<string, boolean | object> | undefined;
7
+ http: {
8
+ id: string;
9
+ scope: "global" | "session" | "workspace";
10
+ basePath?: string | undefined;
11
+ path: string;
12
+ method: "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT";
13
+ description: string;
14
+ availability?: string | undefined;
15
+ authentication: "device" | "none" | "owner";
16
+ parameters?: {
17
+ name: string;
18
+ in: "header" | "path" | "query";
19
+ required: boolean;
20
+ schema: boolean | object;
21
+ }[] | undefined;
22
+ body?: {
23
+ contentType: string;
24
+ contentTypes?: string[] | undefined;
25
+ required: boolean;
26
+ schema: boolean | object;
27
+ } | undefined;
28
+ responses: Record<string, {
29
+ description: string;
30
+ contentType?: string | undefined;
31
+ schema?: boolean | object | undefined;
32
+ events?: Record<string, boolean | object> | undefined;
33
+ }>;
34
+ }[];
35
+ sockets: {
36
+ id: string;
37
+ scope: "global" | "session" | "workspace";
38
+ description: string;
39
+ availability?: string | undefined;
40
+ service: string;
41
+ member: string;
42
+ direction: "client-to-server" | "server-to-client";
43
+ kind: "channel" | "method" | "state";
44
+ input: boolean | object;
45
+ output?: boolean | object | undefined;
46
+ errors?: boolean | object | undefined;
47
+ }[];
48
+ dynamic: string[];
49
+ gaps?: string[] | undefined;
50
+ };
51
+ //#endregion
52
+ export { apiContracts as default };
53
+ //# sourceMappingURL=apiContracts.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAGa"}
@@ -0,0 +1,13 @@
1
+ import { defineApiContract } from "@agimon-ai/doompi-core/apiContracts";
2
+ //#region src/schemas/apiContracts.ts
3
+ /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
4
+ const apiContracts = defineApiContract({
5
+ version: 1,
6
+ http: [],
7
+ sockets: [],
8
+ dynamic: []
9
+ });
10
+ //#endregion
11
+ export { apiContracts, apiContracts as default };
12
+
13
+ //# sourceMappingURL=apiContracts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/doompi-core/apiContracts';\n\n/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAa,eAAe,kBAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}