@agimon-ai/doompi-loop 0.0.1-alpha.9 → 0.0.1-alpha.90
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 +83 -21
- package/dist/apiContracts.cjs +17 -0
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/apiContracts.d.mts +53 -0
- package/dist/apiContracts.d.mts.map +1 -0
- package/dist/apiContracts.mjs +13 -0
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/extensions/pi.cjs +659 -1
- package/dist/extensions/pi.cjs.map +1 -1
- package/dist/extensions/pi.d.mts +5 -2
- package/dist/extensions/pi.d.mts.map +1 -0
- package/dist/extensions/pi.mjs +654 -1
- package/dist/extensions/pi.mjs.map +1 -1
- package/dist/extensions/server.cjs +369 -0
- package/dist/extensions/server.cjs.map +1 -0
- package/dist/extensions/server.d.mts +5 -0
- package/dist/extensions/server.d.mts.map +1 -0
- package/dist/extensions/server.mjs +364 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/extensions/web.mjs +331 -0
- package/dist/extensions/web.mjs.map +1 -0
- package/dist/index.cjs +0 -1
- package/dist/index.d.mts +2 -4
- package/dist/index.mjs +1 -1
- package/dist/loopLaunchers-Bciapxt0.d.mts +69 -0
- package/dist/loopLaunchers-Bciapxt0.d.mts.map +1 -0
- package/dist/loopLaunchers-BtcLH_xN.cjs +32 -0
- package/dist/loopLaunchers-BtcLH_xN.cjs.map +1 -0
- package/dist/loopLaunchers-cCniFbVA.mjs +15 -0
- package/dist/loopLaunchers-cCniFbVA.mjs.map +1 -0
- package/dist/loopLaunchers.cjs +5 -0
- package/dist/loopLaunchers.d.mts +2 -0
- package/dist/loopLaunchers.mjs +2 -0
- package/dist/loopView-BK4X_1UI.mjs +349 -0
- package/dist/loopView-BK4X_1UI.mjs.map +1 -0
- package/dist/loopView-C_OPuy8L.cjs +456 -0
- package/dist/loopView-C_OPuy8L.cjs.map +1 -0
- package/llms.txt +9 -0
- package/package.json +82 -14
- package/src/prompts/doompi-use-loop/SKILL.md +44 -0
- package/src/types/loopView.ts +73 -0
- package/dist/commands/loopCommand.cjs +0 -2
- package/dist/commands/loopCommand.cjs.map +0 -1
- package/dist/commands/loopCommand.mjs +0 -2
- package/dist/commands/loopCommand.mjs.map +0 -1
- package/dist/constants.cjs +0 -2
- package/dist/constants.cjs.map +0 -1
- package/dist/constants.mjs +0 -2
- package/dist/constants.mjs.map +0 -1
- package/dist/defaultLauncher.cjs +0 -2
- package/dist/defaultLauncher.cjs.map +0 -1
- package/dist/defaultLauncher.d.cts +0 -10
- package/dist/defaultLauncher.d.cts.map +0 -1
- package/dist/defaultLauncher.d.mts +0 -10
- package/dist/defaultLauncher.d.mts.map +0 -1
- package/dist/defaultLauncher.mjs +0 -2
- package/dist/defaultLauncher.mjs.map +0 -1
- package/dist/extension.cjs +0 -2
- package/dist/extension.cjs.map +0 -1
- package/dist/extension.d.cts +0 -6
- package/dist/extension.d.cts.map +0 -1
- package/dist/extension.d.mts +0 -6
- package/dist/extension.d.mts.map +0 -1
- package/dist/extension.mjs +0 -2
- package/dist/extension.mjs.map +0 -1
- package/dist/extensions/pi.d.cts +0 -2
- package/dist/index.d.cts +0 -4
- package/dist/launcher.cjs +0 -2
- package/dist/launcher.cjs.map +0 -1
- package/dist/launcher.d.cts +0 -47
- package/dist/launcher.d.cts.map +0 -1
- package/dist/launcher.d.mts +0 -47
- package/dist/launcher.d.mts.map +0 -1
- package/dist/launcher.mjs +0 -2
- package/dist/launcher.mjs.map +0 -1
- package/dist/leader.cjs +0 -2
- package/dist/leader.cjs.map +0 -1
- package/dist/leader.mjs +0 -2
- package/dist/leader.mjs.map +0 -1
- package/dist/tui/loopListOverlay.cjs +0 -2
- package/dist/tui/loopListOverlay.cjs.map +0 -1
- package/dist/tui/loopListOverlay.mjs +0 -2
- package/dist/tui/loopListOverlay.mjs.map +0 -1
- package/dist/tui/startLoopOverlay.cjs +0 -2
- package/dist/tui/startLoopOverlay.cjs.map +0 -1
- package/dist/tui/startLoopOverlay.mjs +0 -2
- 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
|
-
|
|
3
|
+
Send a prompt now, then repeat it at a bounded interval for the current session.
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
23
|
+
pi install npm:@agimon-ai/doompi-loop
|
|
16
24
|
```
|
|
17
25
|
|
|
18
|
-
##
|
|
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
|
-
|
|
21
|
-
|
|
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
|
-
|
|
48
|
+
## Web extension slots
|
|
24
49
|
|
|
25
|
-
|
|
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
|
-
|
|
54
|
+
## Extension authors: cross-extension launchers
|
|
28
55
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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"}
|