@agimon-ai/po-goal 0.0.0-alpha.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vuong Ngo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,104 @@
1
+ # @agimon-ai/po-goal
2
+
3
+ Keep one objective and an optional token budget active across agent turns, with independent idle-time completion checking.
4
+
5
+ Part of the [Po distribution](https://www.npmjs.com/package/@agimon-ai/po).
6
+
7
+ Completed, cleared, or blocked goals no longer contribute active work instructions. Goal history
8
+ is scoped to the repository. Lifecycle tools are private to the checker, never added to the working agent.
9
+
10
+ > **Alpha:** Goal behavior may change between releases.
11
+
12
+ ## Requirements
13
+
14
+ - Node.js 24 or newer
15
+ - The Po background-work coordination service for automatic completion checks. If coordination is missing or unavailable, Goal does not assume the session is idle.
16
+
17
+ ## Install
18
+
19
+ The seeded `modes.yaml` selects Goal in `default.packages`; it is not fixed host infrastructure.
20
+ Keep it there or select it through a layer. Goal starts inactive.
21
+
22
+ ## Command grammar
23
+
24
+ ```text
25
+ /goal <objective>
26
+ /goal --tokens 100k <objective>
27
+ /goal status
28
+ /goal pause
29
+ /goal resume
30
+ /goal edit [--tokens 1.5m] <objective>
31
+ /goal clear
32
+ ```
33
+
34
+ Budgets accept compact values such as `100k` and `1.5m`. Starting or resuming a goal wakes the
35
+ agent in both the CLI and server. After a turn settles, Goal waits for same-session subagents,
36
+ runners, workflows, and their result handoffs, and for all pending messages to be processed.
37
+
38
+ One bounded LLM check then evaluates the objective against the transcript and verification evidence.
39
+ The checker alone receives `goal_complete`, `goal_continue`, and `goal_blocked`. Completion archives
40
+ the evidence and removes the active goal. Incomplete work produces a targeted next-action prompt,
41
+ not a generic completion claim. Genuine repeated external blockers retain the unfinished goal.
42
+
43
+ New work, user input, edits, pause, session changes, or cancellation invalidate an in-flight verdict.
44
+ Provider failures and invalid verdicts pause the goal without automatic retry loops. Use `/goal resume`
45
+ after resolving the problem. Token and no-progress limits prevent further substantive continuation;
46
+ a final idle check may still establish that the already-finished work is complete.
47
+
48
+ ## In the cockpit
49
+
50
+ Once a session sets a goal, a `goal` group appears in the activity dock carrying the objective and
51
+ how far along it is. Its kebab menu edits the objective and the token budget, or removes the goal,
52
+ through `/goal` verbs. Removing archives to goal history and stops the turn in flight, so it asks first.
53
+
54
+ ## Settings
55
+
56
+ The CLI reads settings from `$PI_CODING_AGENT_DIR/pi-goal.json` (default
57
+ `~/.po/agent/pi-goal.json`). The defaults allow unlimited automatic turns and pause after three
58
+ repeated tool-free outputs. The server uses those default continuation limits. The legacy
59
+ `toolVisibility` setting is still decoded for compatibility but no longer exposes lifecycle tools.
60
+
61
+ ## State and history
62
+
63
+ Live Goal state and `goal-check` audit records are stored in session entries. Checker token usage
64
+ is included in Goal budget accounting. History is repository-scoped under:
65
+
66
+ ```text
67
+ $PI_CODING_AGENT_DIR/goal-history/
68
+ ```
69
+
70
+ The default history path is `~/.po/agent/goal-history/`. History retains up to 100 entries and
71
+ 1 MiB. Corrupt history files are quarantined instead of being interpreted as valid goals. Clearing
72
+ or completing removes the active objective and status. Archived history remains until retention
73
+ or explicit deletion removes it. Failed archival retains the goal instead of discarding it.
74
+
75
+ ## Public API
76
+
77
+ ```ts
78
+ import { DEFAULT_GOAL_SETTINGS, parseGoalCommand, parseTokenBudget } from '@agimon-ai/po-goal';
79
+ ```
80
+
81
+ The root also exports state-machine, history codec, accounting, safety, prompt, and tool
82
+ types for embedding.
83
+
84
+ ## Development
85
+
86
+ ```bash
87
+ pnpm build
88
+ pnpm typecheck
89
+ pnpm test
90
+ pnpm lint
91
+ ```
92
+
93
+ Maintained by [Agimon](https://agimon.ai/about).
94
+
95
+ ## License
96
+
97
+ MIT
98
+
99
+ Plugin entries live in `src/extensions`, with host-neutral runtime logic in `src/services` and host registrations in routed `src/extensions` surfaces. `src/models` owns goal state, accounting, transitions, and serialization. Named `src/services` folders handle history, persistence, prompts, and validation. Public helpers and types are exposed through flat `src/exports`.
100
+
101
+ The native session contributions declare minor-mode owners and use the shared background-work contract. Request-private
102
+ checker tools are validated before their effects are applied, with session and goal revision guards.
103
+ Provider calls do not hold the command queue, so pause and clear remain responsive during inference.
104
+ The main agent's ordinary tool policy is unchanged.
@@ -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/po-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/po-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,4CAAeA,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/po-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/po-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"}