@agimon-ai/po-help 0.0.0-alpha.1 → 0.0.0-stage
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 +2 -72
- package/package.json +3 -114
- package/LICENSE +0 -21
- package/dist/apiContracts.cjs +0 -17
- package/dist/apiContracts.cjs.map +0 -1
- package/dist/apiContracts.d.mts +0 -53
- package/dist/apiContracts.d.mts.map +0 -1
- package/dist/apiContracts.mjs +0 -13
- package/dist/apiContracts.mjs.map +0 -1
- package/dist/extensions/server.cjs +0 -323
- package/dist/extensions/server.cjs.map +0 -1
- package/dist/extensions/server.d.mts +0 -5
- package/dist/extensions/server.d.mts.map +0 -1
- package/dist/extensions/server.mjs +0 -318
- package/dist/extensions/server.mjs.map +0 -1
- package/dist/extensions/web.mjs +0 -88
- package/dist/extensions/web.mjs.map +0 -1
- package/dist/index.cjs +0 -763
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.mts +0 -133
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -732
- package/dist/index.mjs.map +0 -1
- package/llms.txt +0 -15
- package/src/prompts/po-develop-native-extension/SKILL.md +0 -63
- package/src/prompts/po-use-chatgpt-instructions/SKILL.md +0 -66
- package/src/prompts/po-use-help/SKILL.md +0 -40
package/README.md
CHANGED
|
@@ -1,73 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Temporary Holding Version
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Part of the [Po distribution](https://www.npmjs.com/package/@agimon-ai/po).
|
|
6
|
-
|
|
7
|
-
> **Alpha:** Help contribution contracts may change between releases.
|
|
8
|
-
|
|
9
|
-
## Requirements and installation
|
|
10
|
-
|
|
11
|
-
Requires Node.js 24 or newer and the Pi version declared in this package's peer dependencies. The distribution selects Help through `default.packages` in `modes.yaml`; it remains configurable rather than fixed host infrastructure.
|
|
12
|
-
|
|
13
|
-
## Activate and diagnose
|
|
14
|
-
|
|
15
|
-
Use the minor-mode menu, `/minor help`, or `/doom-help`. Help is additive: unrelated tools, skills, and modes retain their existing activation and permission rules.
|
|
16
|
-
|
|
17
|
-
The mode detail reports applied Help skill and diagnostic-tool counts. Pending discovery is not presented as a successful skill count. A failed contributor can leave Help degraded while healthy contributions remain usable.
|
|
18
|
-
|
|
19
|
-
| Capability | Owner | Purpose |
|
|
20
|
-
| ---------------- | ------------ | ---------------------------------------------------------------------------------- |
|
|
21
|
-
| `help_status` | Help | Applied Help skills/tools, owners, availability, and bounded diagnostic codes. |
|
|
22
|
-
| `diagnose_setup` | Distribution | Saved configuration, installed packages, and sync drift for the current workspace. |
|
|
23
|
-
| `diagnose_agent` | Log | Bounded current-session captured failure and token-usage evidence. |
|
|
24
|
-
|
|
25
|
-
Optional owners contribute only when present in the composition. The entry skill `po-use-help` routes to configuration, profile, mode, domain, hook, skill, and debugging guidance rather than loading every document eagerly. When `@agimon-ai/po-hook` is loaded, active Help exposes its `po-author-hook` skill for creating registry groups, TypeScript modules, and command hooks. Deactivating Help withdraws it from future discovery.
|
|
26
|
-
|
|
27
|
-
Diagnostics do not install packages, change configuration, authenticate servers, clear logs, or restart processes. Existing approval and permission boundaries apply to repairs. Agent telemetry distinguishes empty or unavailable data from captured evidence and never treats absent records as proof of health.
|
|
28
|
-
|
|
29
|
-
Deactivation removes Help-only capabilities from future prompts, catalogs, and calls. Stale tool references are rejected. Supported in-flight work is cancelled, but completed effects cannot be undone. Earlier tool results and guidance can remain in conversation history; cached files may remain on disk.
|
|
30
|
-
|
|
31
|
-
## Package-owned contributions
|
|
32
|
-
|
|
33
|
-
Use named routes under `src/extensions/workspaces/sessions/(backend)/resource/` and `tool/`. Root files own shared state and lifecycle. Do not create a second tool registry inside Help or add executable callbacks to the documentation descriptor.
|
|
34
|
-
|
|
35
|
-
### Skills
|
|
36
|
-
|
|
37
|
-
For the server, declare a normal skill resource with `HELP_WHEN`, a useful description, and `path: packageResourcePath(import.meta.url, 'src/prompts/<name>/SKILL.md')`. Its reader returns the same file. Validate required content and report unavailable resources rather than registering empty successful guidance. Keep package documents lazy; eager context is only for small live activation instructions.
|
|
38
|
-
|
|
39
|
-
Publish `llms.txt` and `src/prompts` in the package files allowlist. Relative links must remain inside the published package. Normal runtime skills retain their ordinary activation rules; content-only domain plugin schemas are not changed by this feature.
|
|
40
|
-
|
|
41
|
-
### Tools
|
|
42
|
-
|
|
43
|
-
```ts
|
|
44
|
-
import { DOOM_HELP_WHEN as HELP_WHEN } from '@agimon-ai/po-core/help';
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Contributor packages import the shared contract from Core, not the optional Help package, so the distribution does not acquire an unconditional minor-mode dependency.
|
|
48
|
-
|
|
49
|
-
A server tool uses `when: HELP_WHEN`, remains owned by its normal facet, and checks the active host and Help selection at execution boundaries. Domain conditions can be combined with Help when both are required. Help does not bypass other restrictions.
|
|
50
|
-
|
|
51
|
-
The Log package's `diagnose_agent` routes are a first-party example. Provider replacement, late arrival, withdrawal, cancellation, and package shutdown must preserve owner cleanup. Adding Help never grants filesystem, shell, network, or remote MCP access.
|
|
52
|
-
|
|
53
|
-
## Public API
|
|
54
|
-
|
|
55
|
-
The Help service binds the skill consumer's accepted inventory instead of assuming every resolved descriptor reaches the model. Server status reads the host's applied capability metadata. Neither status API exposes executable declarations, credentials, raw logs, or skill bodies.
|
|
56
|
-
|
|
57
|
-
## Verification
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
pnpm nx run @agimon-ai/po-help:test
|
|
61
|
-
pnpm nx run @agimon-ai/po-help:typecheck
|
|
62
|
-
pnpm nx run @agimon-ai/po-help:lint
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Tests cover contribution withdrawal and rollback, the real headless prompt and tool surface, explicit skill reading, deactivation, and remote MCP exclusion. Packed-install checks must also verify resource paths outside the checkout before release.
|
|
66
|
-
|
|
67
|
-
## License
|
|
68
|
-
|
|
69
|
-
MIT
|
|
70
|
-
|
|
71
|
-
Active Help also exposes `po-use-chatgpt-instructions`, which prints a paste-ready instruction of at most 8,000 characters using session tools and every root AGENTS.md rule. It writes no files and does not test connector calls.
|
|
72
|
-
|
|
73
|
-
Active Help also exposes `po-develop-native-extension`, the workflow for adding phone UI to a Po package: `.native` routing and package setup, cockpit parity, native templates, story-first approval, and device verification.
|
|
3
|
+
This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
|
package/package.json
CHANGED
|
@@ -1,117 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-help",
|
|
3
|
-
"version": "0.0.0-
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"agent-documentation",
|
|
7
|
-
"ai",
|
|
8
|
-
"coding-agent",
|
|
9
|
-
"developer-tools",
|
|
10
|
-
"help-system",
|
|
11
|
-
"pi-coding-agent",
|
|
12
|
-
"pi-extension",
|
|
13
|
-
"pi-package",
|
|
14
|
-
"po",
|
|
15
|
-
"skills"
|
|
16
|
-
],
|
|
17
|
-
"homepage": "https://agimon.ai",
|
|
18
|
-
"bugs": {
|
|
19
|
-
"url": "https://github.com/AgiFlow/po/issues"
|
|
20
|
-
},
|
|
21
|
-
"license": "MIT",
|
|
22
|
-
"author": "Vuong Ngo",
|
|
23
|
-
"repository": {
|
|
24
|
-
"type": "git",
|
|
25
|
-
"url": "git+https://github.com/AgiFlow/po.git",
|
|
26
|
-
"directory": "packages/minor/po-help"
|
|
27
|
-
},
|
|
28
|
-
"files": [
|
|
29
|
-
"dist",
|
|
30
|
-
"llms.txt",
|
|
31
|
-
"src/prompts",
|
|
32
|
-
"README.md",
|
|
33
|
-
"LICENSE",
|
|
34
|
-
"package.json"
|
|
35
|
-
],
|
|
36
|
-
"type": "module",
|
|
37
|
-
"main": "./dist/index.cjs",
|
|
38
|
-
"module": "./dist/index.mjs",
|
|
39
|
-
"types": "./dist/index.d.mts",
|
|
40
|
-
"jsnext:main": "./dist/index.mjs",
|
|
41
|
-
"exports": {
|
|
42
|
-
".": {
|
|
43
|
-
"types": "./dist/index.d.mts",
|
|
44
|
-
"import": "./dist/index.mjs",
|
|
45
|
-
"require": "./dist/index.cjs"
|
|
46
|
-
},
|
|
47
|
-
"./extensions/server": {
|
|
48
|
-
"types": "./dist/extensions/server.d.mts",
|
|
49
|
-
"import": "./dist/extensions/server.mjs",
|
|
50
|
-
"require": "./dist/extensions/server.cjs"
|
|
51
|
-
},
|
|
52
|
-
"./extensions/web": {
|
|
53
|
-
"import": "./dist/extensions/web.mjs"
|
|
54
|
-
},
|
|
55
|
-
"./package.json": "./package.json"
|
|
56
|
-
},
|
|
57
|
-
"publishConfig": {
|
|
58
|
-
"access": "public"
|
|
59
|
-
},
|
|
60
|
-
"dependencies": {
|
|
61
|
-
"@agimon-ai/po-core": "0.0.0-alpha.1",
|
|
62
|
-
"@agimon-ai/po-minor-mode": "0.0.0-alpha.1",
|
|
63
|
-
"@agimon-ai/po-web-components": "0.0.0-alpha.1",
|
|
64
|
-
"@deepseek-ai/cordis": "4.0.4",
|
|
65
|
-
"typebox": "1.3.34"
|
|
66
|
-
},
|
|
67
|
-
"devDependencies": {
|
|
68
|
-
"@agimon-ai/po-build": "0.0.0-alpha.1",
|
|
69
|
-
"@agimon-ai/vibe-lint-plugin-doom-extension": "0.0.0-alpha.1",
|
|
70
|
-
"@earendil-works/pi-coding-agent": "1.0.2",
|
|
71
|
-
"@types/node": "26.6.4",
|
|
72
|
-
"@types/react": "19.3.0",
|
|
73
|
-
"@vitest/coverage-v8": "5.0.3",
|
|
74
|
-
"react": "19.3.0",
|
|
75
|
-
"react-dom": "19.3.0",
|
|
76
|
-
"tsdown": "0.23.0",
|
|
77
|
-
"typescript": "7.0.2",
|
|
78
|
-
"vitest": "5.0.3"
|
|
79
|
-
},
|
|
80
|
-
"peerDependencies": {
|
|
81
|
-
"@earendil-works/pi-coding-agent": "1.0.2"
|
|
82
|
-
},
|
|
83
|
-
"peerDependenciesMeta": {
|
|
84
|
-
"@earendil-works/pi-coding-agent": {
|
|
85
|
-
"optional": true
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
"engines": {
|
|
89
|
-
"node": ">=24"
|
|
90
|
-
},
|
|
91
|
-
"poServer": {
|
|
92
|
-
"entry": "./generated/server.ts",
|
|
93
|
-
"dist": "./dist/extensions/server.mjs",
|
|
94
|
-
"scopes": [
|
|
95
|
-
"session"
|
|
96
|
-
],
|
|
97
|
-
"contracts": {
|
|
98
|
-
"entry": "./src/exports/apiContracts.ts",
|
|
99
|
-
"dist": "./dist/apiContracts.mjs"
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
"poWeb": {
|
|
103
|
-
"pluginId": "help",
|
|
104
|
-
"channels": [],
|
|
105
|
-
"client": "./dist/extensions/web.mjs",
|
|
106
|
-
"scopes": [
|
|
107
|
-
"session"
|
|
108
|
-
]
|
|
109
|
-
},
|
|
110
|
-
"scripts": {
|
|
111
|
-
"build": "tsdown",
|
|
112
|
-
"test": "vitest --run",
|
|
113
|
-
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.web.json",
|
|
114
|
-
"lint": "oxlint . && oxfmt . --check",
|
|
115
|
-
"fixcode": "oxlint . --fix && oxfmt ."
|
|
116
|
-
}
|
|
3
|
+
"version": "0.0.0-stage",
|
|
4
|
+
"stub": true,
|
|
5
|
+
"description": "Temporary package placeholder for staged publishing"
|
|
117
6
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
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/dist/apiContracts.cjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/apiContracts.d.mts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAGa"}
|
package/dist/apiContracts.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
Object.defineProperties(exports, {
|
|
2
|
-
__esModule: { value: true },
|
|
3
|
-
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
-
});
|
|
5
|
-
let _agimon_ai_po_core_help = require("@agimon-ai/po-core/help");
|
|
6
|
-
let _agimon_ai_po_core_serverFacet = require("@agimon-ai/po-core/serverFacet");
|
|
7
|
-
let _agimon_ai_po_core_extensionFile = require("@agimon-ai/po-core/extensionFile");
|
|
8
|
-
let _agimon_ai_po_minor_mode = require("@agimon-ai/po-minor-mode");
|
|
9
|
-
let typebox = require("typebox");
|
|
10
|
-
//#region src/constants/help.ts
|
|
11
|
-
const HELP_COMMAND_NAME = "doom-help";
|
|
12
|
-
const HELP_COMMAND_DESCRIPTION = "Toggle Help guidance and read-only support diagnostics";
|
|
13
|
-
const HELP_MODE_ID = "help";
|
|
14
|
-
const HELP_PACKAGE_SOURCE = "@agimon-ai/po-help";
|
|
15
|
-
const HELP_SKILL = {
|
|
16
|
-
name: "po-use-help",
|
|
17
|
-
description: "Set up and debug Po agents using installed package guidance and scoped, read-only diagnostics. Diagnose missing capabilities before proposing authorized repairs."
|
|
18
|
-
};
|
|
19
|
-
const HELP_GUIDANCE = "Help mode is active. Read po-use-help, inspect the available diagnostics, and use the narrowest package guidance for the task. Diagnose before proposing changes. Help does not grant additional permissions.";
|
|
20
|
-
const HELP_STATUS_TOOL_NAME = "help_status";
|
|
21
|
-
const HELP_STATUS_TOOL_DESCRIPTION = "Inspect active Help skills, diagnostic tools, contributor ownership, and unavailable contributions in this session. Read-only; does not change selection or permissions.";
|
|
22
|
-
const HELP_CHATGPT_SKILL = {
|
|
23
|
-
name: "po-use-chatgpt-instructions",
|
|
24
|
-
description: "Print a paste-ready ChatGPT project instruction (at most 8,000 characters) that routes code-mode work through this session's MCP tools and condenses every AGENTS.md rule. Writes no files."
|
|
25
|
-
};
|
|
26
|
-
const HELP_NATIVE_SKILL = {
|
|
27
|
-
name: "po-develop-native-extension",
|
|
28
|
-
description: "Add or change a Po package's phone UI (.native files, native templates) so it mirrors the cockpit, passes the native build, and is approved and verified before it ships."
|
|
29
|
-
};
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/schemas/diagnostics.ts
|
|
32
|
-
const helpStatusParameters = typebox.Type.Object({}, { additionalProperties: false });
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region src/services/helpStatus/index.ts
|
|
35
|
-
function serverHelpStatus(snapshot, enabled) {
|
|
36
|
-
const entries = snapshot.capabilities.filter((entry) => entry.when?.state?.["minor-mode"] === HELP_MODE_ID);
|
|
37
|
-
const skills = entries.filter((entry) => entry.kind === "skill");
|
|
38
|
-
const tools = entries.filter((entry) => entry.kind === "tool");
|
|
39
|
-
const diagnostics = entries.filter((entry) => enabled && entry.reason && entry.reason !== "inactive").map((entry) => ({
|
|
40
|
-
source: entry.source,
|
|
41
|
-
code: `HELP_${entry.reason.replaceAll("-", "_").toUpperCase()}`
|
|
42
|
-
}));
|
|
43
|
-
const ready = snapshot.ready;
|
|
44
|
-
return {
|
|
45
|
-
activation: !enabled ? "inactive" : !ready ? "activating" : diagnostics.length ? "degraded" : "active",
|
|
46
|
-
ready,
|
|
47
|
-
revision: snapshot.revision,
|
|
48
|
-
counts: {
|
|
49
|
-
skills: ready ? skills.filter((entry) => entry.active && entry.discoverable).length : null,
|
|
50
|
-
tools: tools.filter((entry) => entry.active).length
|
|
51
|
-
},
|
|
52
|
-
skills: skills.slice(0, 128).map(({ name, source, active, discoverable, reason }) => ({
|
|
53
|
-
name,
|
|
54
|
-
source,
|
|
55
|
-
active: active && discoverable,
|
|
56
|
-
...reason ? { reason } : {}
|
|
57
|
-
})),
|
|
58
|
-
tools: tools.slice(0, 128).map(({ name, source, active, reason }) => ({
|
|
59
|
-
name,
|
|
60
|
-
source,
|
|
61
|
-
active,
|
|
62
|
-
...reason ? { reason } : {}
|
|
63
|
-
})),
|
|
64
|
-
diagnostics: diagnostics.slice(0, 128),
|
|
65
|
-
truncated: skills.length > 128 || tools.length > 128 || diagnostics.length > 128
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
function helpStatusDetail(report) {
|
|
69
|
-
return `${report.counts.skills ?? "pending"} Help skills, ${report.counts.tools} diagnostic tools${report.diagnostics.length ? " (diagnostics available)" : ""}`;
|
|
70
|
-
}
|
|
71
|
-
function createHelpStatusTool(inspect, authorize) {
|
|
72
|
-
return (0, _agimon_ai_po_core_serverFacet.defineTool)({
|
|
73
|
-
name: HELP_STATUS_TOOL_NAME,
|
|
74
|
-
description: HELP_STATUS_TOOL_DESCRIPTION,
|
|
75
|
-
parameters: helpStatusParameters,
|
|
76
|
-
when: _agimon_ai_po_core_help.DOOM_HELP_WHEN,
|
|
77
|
-
promptGuidelines: [HELP_GUIDANCE],
|
|
78
|
-
async execute(_input, execution) {
|
|
79
|
-
const signal = authorize(execution.signal);
|
|
80
|
-
const report = await inspect();
|
|
81
|
-
signal.throwIfAborted();
|
|
82
|
-
authorize(execution.signal);
|
|
83
|
-
return {
|
|
84
|
-
content: [{
|
|
85
|
-
type: "text",
|
|
86
|
-
text: JSON.stringify(report, null, 2)
|
|
87
|
-
}],
|
|
88
|
-
details: report
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region src/services/helpServerSession/index.ts
|
|
95
|
-
function createHelpServerSession(host) {
|
|
96
|
-
let modeOwner;
|
|
97
|
-
let pending;
|
|
98
|
-
let failure;
|
|
99
|
-
let generation = 0;
|
|
100
|
-
let disposed = false;
|
|
101
|
-
const active = () => (host.context.selection.state?.["minor-mode"] ?? []).includes(HELP_MODE_ID);
|
|
102
|
-
const inspect = () => serverHelpStatus(host.inspectCapabilities(), active());
|
|
103
|
-
const modeState = () => {
|
|
104
|
-
const report = inspect();
|
|
105
|
-
return {
|
|
106
|
-
activation: pending === true ? "activating" : active() ? "active" : "inactive",
|
|
107
|
-
condition: pending !== void 0 || !report.ready ? "queued" : failure ? "failed" : report.activation === "degraded" ? "degraded" : "ready",
|
|
108
|
-
...pending !== void 0 ? { detail: "applying Help capabilities" } : failure ? { detail: failure } : active() ? { detail: helpStatusDetail(report) } : {},
|
|
109
|
-
actions: [{
|
|
110
|
-
id: "activate",
|
|
111
|
-
enabled: !active() && pending === void 0,
|
|
112
|
-
...!active() && pending === void 0 ? {} : { disabledReason: "Help is active or changing." }
|
|
113
|
-
}, {
|
|
114
|
-
id: "deactivate",
|
|
115
|
-
enabled: active() || pending === true,
|
|
116
|
-
...active() || pending === true ? {} : { disabledReason: "Help mode is not active." }
|
|
117
|
-
}]
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
const resources = [
|
|
121
|
-
{
|
|
122
|
-
when: _agimon_ai_po_core_help.DOOM_HELP_WHEN,
|
|
123
|
-
name: "po-help",
|
|
124
|
-
kind: "context",
|
|
125
|
-
read: () => HELP_GUIDANCE
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
when: _agimon_ai_po_core_help.DOOM_HELP_WHEN,
|
|
129
|
-
...HELP_SKILL,
|
|
130
|
-
kind: "skill",
|
|
131
|
-
path: (0, _agimon_ai_po_core_serverFacet.packageResourcePath)(require("url").pathToFileURL(__filename).href, "src/prompts/po-use-help/SKILL.md"),
|
|
132
|
-
read: async () => {
|
|
133
|
-
const text = await (0, _agimon_ai_po_core_serverFacet.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/po-use-help/SKILL.md");
|
|
134
|
-
if (!text.trim()) throw new Error("The installed Help skill is missing or unreadable.");
|
|
135
|
-
return text;
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
when: _agimon_ai_po_core_help.DOOM_HELP_WHEN,
|
|
140
|
-
...HELP_CHATGPT_SKILL,
|
|
141
|
-
kind: "skill",
|
|
142
|
-
path: (0, _agimon_ai_po_core_serverFacet.packageResourcePath)(require("url").pathToFileURL(__filename).href, "src/prompts/po-use-chatgpt-instructions/SKILL.md"),
|
|
143
|
-
read: async () => {
|
|
144
|
-
const text = await (0, _agimon_ai_po_core_serverFacet.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/po-use-chatgpt-instructions/SKILL.md");
|
|
145
|
-
if (!text.trim()) throw new Error("The installed ChatGPT instruction skill is missing or unreadable.");
|
|
146
|
-
return text;
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
when: _agimon_ai_po_core_help.DOOM_HELP_WHEN,
|
|
151
|
-
...HELP_NATIVE_SKILL,
|
|
152
|
-
kind: "skill",
|
|
153
|
-
path: (0, _agimon_ai_po_core_serverFacet.packageResourcePath)(require("url").pathToFileURL(__filename).href, "src/prompts/po-develop-native-extension/SKILL.md"),
|
|
154
|
-
read: async () => {
|
|
155
|
-
const text = await (0, _agimon_ai_po_core_serverFacet.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/po-develop-native-extension/SKILL.md");
|
|
156
|
-
if (!text.trim()) throw new Error("The installed native extension skill is missing or unreadable.");
|
|
157
|
-
return text;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
];
|
|
161
|
-
const selectMode = async (enabled, signal) => {
|
|
162
|
-
if (disposed) throw new Error("Help runtime is disposed.");
|
|
163
|
-
signal?.throwIfAborted();
|
|
164
|
-
const operation = ++generation;
|
|
165
|
-
pending = enabled;
|
|
166
|
-
failure = void 0;
|
|
167
|
-
modeOwner?.publish();
|
|
168
|
-
try {
|
|
169
|
-
if (enabled) await resources[1].read(host.context);
|
|
170
|
-
signal?.throwIfAborted();
|
|
171
|
-
if (operation !== generation || disposed) throw new Error("Help activation was cancelled.");
|
|
172
|
-
const modes = (host.context.selection.state?.["minor-mode"] ?? []).filter((mode) => mode !== HELP_MODE_ID);
|
|
173
|
-
await host.changeSelection({
|
|
174
|
-
axis: "state",
|
|
175
|
-
key: "minor-mode",
|
|
176
|
-
values: enabled ? [...modes, HELP_MODE_ID] : modes
|
|
177
|
-
});
|
|
178
|
-
} catch (error) {
|
|
179
|
-
if (operation === generation) failure = (error instanceof Error ? error.message : String(error)).slice(0, 160);
|
|
180
|
-
throw error;
|
|
181
|
-
} finally {
|
|
182
|
-
if (operation === generation) {
|
|
183
|
-
pending = void 0;
|
|
184
|
-
modeOwner?.publish();
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
const command = {
|
|
189
|
-
name: HELP_COMMAND_NAME,
|
|
190
|
-
description: HELP_COMMAND_DESCRIPTION,
|
|
191
|
-
async execute(_args, execution) {
|
|
192
|
-
await selectMode(!(pending ?? active()));
|
|
193
|
-
await execution.client.notify({
|
|
194
|
-
title: "Po Help",
|
|
195
|
-
body: active() ? "Help mode activated." : "Help mode deactivated.",
|
|
196
|
-
level: "info"
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
modeOwner = (0, _agimon_ai_po_minor_mode.defineMinorMode)({
|
|
201
|
-
descriptor: {
|
|
202
|
-
source: HELP_PACKAGE_SOURCE,
|
|
203
|
-
id: HELP_MODE_ID,
|
|
204
|
-
label: "Help",
|
|
205
|
-
description: "Package guidance and read-only diagnostics for agent setup and debugging.",
|
|
206
|
-
order: 50,
|
|
207
|
-
actions: [{
|
|
208
|
-
id: "activate",
|
|
209
|
-
label: "Activate",
|
|
210
|
-
description: "Expose Help guidance and diagnostic tools.",
|
|
211
|
-
contexts: ["headless"],
|
|
212
|
-
parameters: []
|
|
213
|
-
}, {
|
|
214
|
-
id: "deactivate",
|
|
215
|
-
label: "Deactivate",
|
|
216
|
-
description: "Withdraw Help-only guidance and diagnostic tools.",
|
|
217
|
-
contexts: ["headless"],
|
|
218
|
-
parameters: []
|
|
219
|
-
}]
|
|
220
|
-
},
|
|
221
|
-
state: modeState,
|
|
222
|
-
async handleAction(_runtime, actionId, _argumentsValue, { signal }) {
|
|
223
|
-
if (actionId !== "activate" && actionId !== "deactivate") throw new Error(`Unknown Help mode action: ${actionId}`);
|
|
224
|
-
await selectMode(actionId === "activate", signal);
|
|
225
|
-
return { message: active() ? "Help mode activated." : "Help mode deactivated." };
|
|
226
|
-
}
|
|
227
|
-
}).createOwner(void 0);
|
|
228
|
-
return {
|
|
229
|
-
services: [(0, _agimon_ai_po_minor_mode.serverMinorModes)([modeOwner])],
|
|
230
|
-
resources,
|
|
231
|
-
commands: [command],
|
|
232
|
-
tools: [createHelpStatusTool(inspect, (signal) => {
|
|
233
|
-
signal?.throwIfAborted();
|
|
234
|
-
host.assertActive(HELP_PACKAGE_SOURCE);
|
|
235
|
-
if (disposed || !active()) throw new Error("Help mode is not active.");
|
|
236
|
-
return signal ?? new AbortController().signal;
|
|
237
|
-
})],
|
|
238
|
-
onDispose() {
|
|
239
|
-
disposed = true;
|
|
240
|
-
generation += 1;
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
//#endregion
|
|
245
|
-
//#region src/extensions/workspaces/sessions/(backend)/_lib/runtime.server.ts
|
|
246
|
-
var runtime_server_default = (({ agent }) => agent ? createHelpServerSession(agent) : {});
|
|
247
|
-
//#endregion
|
|
248
|
-
//#region src/extensions/workspaces/sessions/(backend)/root.server.ts
|
|
249
|
-
var root_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoot)((context) => {
|
|
250
|
-
const value = runtime_server_default(context);
|
|
251
|
-
return {
|
|
252
|
-
value,
|
|
253
|
-
services: value.services,
|
|
254
|
-
activities: value.activities,
|
|
255
|
-
onStart: value.onStart,
|
|
256
|
-
onStop: value.onStop,
|
|
257
|
-
onDispose: value.onDispose
|
|
258
|
-
};
|
|
259
|
-
});
|
|
260
|
-
//#endregion
|
|
261
|
-
//#region src/extensions/workspaces/sessions/(backend)/command/doom-help.server.ts
|
|
262
|
-
var doom_help_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoutedContribution)((context) => context.root.commands?.[0], { cardinality: "optional" });
|
|
263
|
-
//#endregion
|
|
264
|
-
//#region src/extensions/workspaces/sessions/(backend)/resource/po-develop-native-extension.server.ts
|
|
265
|
-
var po_develop_native_extension_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoutedContribution)((context) => context.root.resources?.[3], { cardinality: "optional" });
|
|
266
|
-
//#endregion
|
|
267
|
-
//#region src/extensions/workspaces/sessions/(backend)/resource/po-help.server.ts
|
|
268
|
-
var po_help_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoutedContribution)((context) => context.root.resources?.[0], { cardinality: "optional" });
|
|
269
|
-
//#endregion
|
|
270
|
-
//#region src/extensions/workspaces/sessions/(backend)/resource/po-use-chatgpt-instructions.server.ts
|
|
271
|
-
var po_use_chatgpt_instructions_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoutedContribution)((context) => context.root.resources?.[2], { cardinality: "optional" });
|
|
272
|
-
//#endregion
|
|
273
|
-
//#region src/extensions/workspaces/sessions/(backend)/resource/po-use-help.server.ts
|
|
274
|
-
var po_use_help_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoutedContribution)((context) => context.root.resources?.[1], { cardinality: "optional" });
|
|
275
|
-
//#endregion
|
|
276
|
-
//#region src/extensions/workspaces/sessions/(backend)/tool/help_status.server.ts
|
|
277
|
-
var help_status_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoutedContribution)((context) => context.root.tools?.[0], { cardinality: "optional" });
|
|
278
|
-
//#endregion
|
|
279
|
-
//#region generated/server.ts
|
|
280
|
-
const at = (value, context) => typeof value === "function" ? value(context) : value;
|
|
281
|
-
/* v8 ignore next -- generated normalization branch */
|
|
282
|
-
const defined = (values) => values.filter((value) => value !== void 0);
|
|
283
|
-
const via = (identity, value) => value === void 0 ? void 0 : {
|
|
284
|
-
...identity,
|
|
285
|
-
...value
|
|
286
|
-
};
|
|
287
|
-
const facet = (0, _agimon_ai_po_core_serverFacet.defineServerPlugin)({
|
|
288
|
-
name: "@agimon-ai/po-help",
|
|
289
|
-
providerOverrides: (0, _agimon_ai_po_core_serverFacet.composeServerProviderOverrides)(root_server_default),
|
|
290
|
-
session: async (context) => {
|
|
291
|
-
const scopeSession = await root_server_default(context);
|
|
292
|
-
const contextSession = {
|
|
293
|
-
...context,
|
|
294
|
-
root: scopeSession.value
|
|
295
|
-
};
|
|
296
|
-
return {
|
|
297
|
-
...(0, _agimon_ai_po_core_extensionFile.composeRootHooks)(scopeSession),
|
|
298
|
-
get commands() {
|
|
299
|
-
return defined([via({ name: "doom-help" }, at(doom_help_server_default, contextSession))]);
|
|
300
|
-
},
|
|
301
|
-
get resources() {
|
|
302
|
-
return defined([
|
|
303
|
-
at(po_develop_native_extension_server_default, contextSession),
|
|
304
|
-
at(po_help_server_default, contextSession),
|
|
305
|
-
at(po_use_chatgpt_instructions_server_default, contextSession),
|
|
306
|
-
at(po_use_help_server_default, contextSession)
|
|
307
|
-
]);
|
|
308
|
-
},
|
|
309
|
-
get tools() {
|
|
310
|
-
return defined([via({ name: "help_status" }, at(help_status_server_default, contextSession))]);
|
|
311
|
-
},
|
|
312
|
-
services: [...scopeSession.services ?? []],
|
|
313
|
-
get activities() {
|
|
314
|
-
return [...scopeSession.activities ?? []];
|
|
315
|
-
}
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
//#endregion
|
|
320
|
-
exports.default = facet;
|
|
321
|
-
exports.facet = facet;
|
|
322
|
-
|
|
323
|
-
//# sourceMappingURL=server.cjs.map
|