@agimon-ai/po-cloudflare 0.0.2-alpha.11 → 0.0.2-alpha.13
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/dist/agent-DYFqCLl2.js +6850 -0
- package/dist/assets/plugins/assets/base-C3j1WCCq.css +2 -0
- package/dist/assets/plugins/chunks/po-web-runtime-Czm_C4SJ.js +1 -0
- package/dist/assets/plugins/compositions.json +1 -1
- package/dist/assets/plugins/slots/approval.8b3f37d9-CqQk6XG_.js +2 -0
- package/dist/assets/plugins/slots/artifacts.47d00f81-D-vQ-7Iz.js +1 -0
- package/dist/assets/plugins/slots/autocompact.9a92993d-B3KTYwW1.js +1 -0
- package/dist/assets/plugins/slots/builtin-tools.939bbfff-CZRYQVIP.js +7 -0
- package/dist/assets/plugins/slots/codemode.782e5bb1-Bzl_K_vt.js +10 -0
- package/dist/assets/plugins/slots/domain.21790b66-CvnpuKCY.js +1 -0
- package/dist/assets/plugins/slots/edit.c7c85129-kaxIknZ-.js +7 -0
- package/dist/assets/plugins/slots/files.bbcef824-wuB8gcQA.js +2 -0
- package/dist/assets/plugins/slots/grep.3dfd3214-3FnU8p-d.js +1 -0
- package/dist/assets/plugins/slots/log.33bc7d38-C0PXQ0O1.js +4 -0
- package/dist/assets/plugins/slots/mcp.59c68bcb-D0CkHnIw.js +109 -0
- package/dist/assets/plugins/slots/{profile.ab16dcec-B5yt7eny.js → profile.ea55f5e1-BSY3iYfJ.js} +1 -1
- package/dist/assets/plugins/slots/prompts.9957cc84-xdCkNkoA.js +3 -0
- package/dist/assets/plugins/slots/read.30a617e7-qqaxVlEX.js +1 -0
- package/dist/assets/plugins/slots/runner.9f3559b0-DfO2Z9HG.js +8 -0
- package/dist/assets/plugins/slots/skill.f506a5ea-CL_n-l4h.js +4 -0
- package/dist/assets/plugins/slots/vault.01657352-DbG3F_on.js +1 -0
- package/dist/{atomicJson-C_lN9leA.js → atomicJson-BF1fVXy1.js} +1 -1
- package/dist/browser-BWf8OMfl.js +3 -0
- package/dist/childSession-Cf2-kH4O.js +22 -0
- package/dist/{server-D190dXDN.js → dist-B-vqs6tA.js} +1 -546
- package/dist/{domains-CPX1dEVa.js → domains-Bl6T2dKV.js} +2 -2
- package/dist/{server-C5wixba6.js → esm-BKJy3O9-.js} +3 -296
- package/dist/{exports-2Vv52b9v.js → exports-CxkWsXI9.js} +7 -6
- package/dist/{exports-BF12Ftrd.js → exports-DlcCEAe3.js} +2 -9
- package/dist/{extensionFile-DpVvh-ud.js → extensionFile-D7wk8tFr.js} +11 -1
- package/dist/harnessStore-Bap8lsAg.js +1 -0
- package/dist/{harnessStore-Ct329wxJ.js → harnessStore-flLz1I0F.js} +2 -2
- package/dist/help-DjybmnPW.js +91 -0
- package/dist/{hubChannel-kFgtfJnv.js → hubChannel-Bi3PQrfD.js} +3 -27
- package/dist/hubRevisions-58pU2dW5.js +363 -0
- package/dist/index.edge-C9_xuXyy.js +57 -0
- package/dist/{index.edge-DhV_hfZA.js → index.edge-CJ2TFpgF.js} +2 -2
- package/dist/index.edge-COJJ_Dv2.js +937 -0
- package/dist/index.edge-ChYa2LU4.js +14 -0
- package/dist/index.edge-ClLTmPFz.js +191 -0
- package/dist/{index.edge-BNElrrHY.js → index.edge-uSjRpm6Z.js} +5 -0
- package/dist/iso-BPQViXM8.js +10 -0
- package/dist/{layeredConfig-BhFC6TBD.js → layeredConfig-B4s0eZ5o.js} +11 -4
- package/dist/{majorModes-CZqrWarh.js → majorModes-IygGmbb8.js} +2 -2
- package/dist/majorModes-xpLK9HpD.js +1 -0
- package/dist/notification-bGq1frYG.js +99 -0
- package/dist/piConfig-CcoMX-1L.js +127 -0
- package/dist/{platformFiles-BTDsAsmT.js → platformFiles-Ccj9HCvA.js} +24 -2
- package/dist/pluginContributions-Be9EnCAW.js +16 -0
- package/dist/sealedChannel-BeWNTWys.js +27 -0
- package/dist/server-4CmqIbH2.js +1476 -0
- package/dist/{server-DesPQYzJ.js → server-5vLvBTTs.js} +1 -1
- package/dist/server-BHhb0oir.js +505 -0
- package/dist/server-Bm6pAAw8.js +935 -0
- package/dist/server-C82Qzoh3.js +2658 -0
- package/dist/server-C8HyW7wN.js +489 -0
- package/dist/{server-DSusAvqK.js → server-C9gff7gU.js} +1 -1
- package/dist/{server-CTIkoJXM.js → server-CIhwIcbA.js} +4 -4
- package/dist/{server-DbmCxFL-.js → server-CMaTba5B.js} +1 -1
- package/dist/{server-DolHpEoY.js → server-COE7BKSa.js} +1 -1
- package/dist/server-CQXqMpeC.js +1744 -0
- package/dist/{server-BG6gwBcv.js → server-CTSvwoDy.js} +5 -4
- package/dist/server-C_34VM3M.js +217 -0
- package/dist/{server-CuGXhVFA.js → server-C_3jK2WM.js} +5 -5
- package/dist/server-CcNMwEFQ.js +190 -0
- package/dist/{server-D-zQp04y.js → server-CjsKNdSN.js} +1 -1
- package/dist/{server-DQy8hVXg.js → server-ClsNJwdv.js} +8 -8
- package/dist/{server-DfBHHyQo.js → server-Co57A8MH.js} +2 -9
- package/dist/{server-CRtXiNBP.js → server-CpJNq249.js} +5 -5
- package/dist/{server-zYYAg7ki.js → server-CxGGQFJs.js} +5 -16
- package/dist/{server-DpVsUiA-.js → server-DSu_uLDX.js} +4 -4
- package/dist/server-DeSuziRK.js +680 -0
- package/dist/{server-BIjpcE0Y.js → server-ZsazKk-n.js} +3 -3
- package/dist/{server-CZoHLCxk.js → server-il_s2Ycz.js} +5 -93
- package/dist/server-ziNfBZ2M.js +295 -0
- package/dist/{sessionConfig-BLmM5XLM.js → sessionConfig-DzAs6Pt-.js} +64 -499
- package/dist/{notification-qvyJJ_Df.js → telemetry-Csv1ZxAn.js} +1 -99
- package/dist/truncate-M3KbFyVj.js +89 -0
- package/dist/web-Cfvbn9H1.js +3 -0
- package/dist/worker.js +4545 -12244
- package/dist/workflow-w5JPZXgc.js +23 -0
- package/package.json +32 -24
- package/dist/assets/plugins/assets/base-_m1hGahv.css +0 -2
- package/dist/assets/plugins/chunks/po-web-runtime-CGjOl_1I.js +0 -1
- package/dist/assets/plugins/slots/approval.09e72f36-BW92gZQg.js +0 -2
- package/dist/assets/plugins/slots/artifacts.50b639bb-B6zDJhex.js +0 -1
- package/dist/assets/plugins/slots/builtin-tools.75108f21-DS-dJ07p.js +0 -7
- package/dist/assets/plugins/slots/codemode.c58fb583--t-nrGeQ.js +0 -10
- package/dist/assets/plugins/slots/domain.753f9f92-DWSqP3Jw.js +0 -1
- package/dist/assets/plugins/slots/mcp.82cc1ff5-jPY2OCuu.js +0 -109
- package/dist/assets/plugins/slots/skill.62a0a1b3-GtWLT33O.js +0 -4
- package/dist/assets/plugins/slots/vault.3cbfcdc3-B7BKfR_H.js +0 -1
- package/dist/harnessStore-BDI-s999.js +0 -1
- package/dist/majorModes-CzAWXyaf.js +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { n as createPoTelemetryService } from "./telemetry-Csv1ZxAn.js";
|
|
2
|
+
//#region ../../core/po-core/src/services/poTelemetry/index.edge.ts
|
|
3
|
+
function createPoTelemetry(options) {
|
|
4
|
+
if (options.telemetryFactory && options.endpointResolver) return createPoTelemetryService(options);
|
|
5
|
+
return createPoTelemetryService({
|
|
6
|
+
...options,
|
|
7
|
+
env: {
|
|
8
|
+
...options.env,
|
|
9
|
+
AGENT_TELEMETRY_DISABLED: "1"
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { createPoTelemetry as t };
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
//#region ../../utils/po-hashline/src/services/hashline/index.ts
|
|
5
|
+
const FNV_OFFSET_BASIS = 14695981039346656037n;
|
|
6
|
+
const FNV_PRIME = 1099511628211n;
|
|
7
|
+
const ANCHOR_SPACE = 26n * 26n * 26n;
|
|
8
|
+
const ASCII_A = 97;
|
|
9
|
+
const FILE_TAG_PATTERN = /^[A-Za-z0-9_-]{8}$/u;
|
|
10
|
+
const FILE_HEADER_PATTERN = /^@file (.+)#([A-Za-z0-9_-]{8})$/u;
|
|
11
|
+
const ANCHOR_PATTERN = /^\s*[>+-]*\s*(\d+)\s*[:#]\s*([a-zA-Z]{3})(?:\s*\|.*)?\s*$/u;
|
|
12
|
+
const ASCII_WHITESPACE = /[ \t\n\r\v\f]/gu;
|
|
13
|
+
/**
|
|
14
|
+
* Return Phi's three-letter whitespace-insensitive FNV-1a64 line anchor.
|
|
15
|
+
* Adapted from pulseaiclub/phi writetool under the MIT license.
|
|
16
|
+
*/
|
|
17
|
+
function hashLine(line) {
|
|
18
|
+
const bytes = new TextEncoder().encode(line.replace(ASCII_WHITESPACE, ""));
|
|
19
|
+
let hash = FNV_OFFSET_BASIS;
|
|
20
|
+
for (const byte of bytes) {
|
|
21
|
+
hash ^= BigInt(byte);
|
|
22
|
+
hash = BigInt.asUintN(64, hash * FNV_PRIME);
|
|
23
|
+
}
|
|
24
|
+
let value = hash % ANCHOR_SPACE;
|
|
25
|
+
const letters = Array.from({ length: 3 }, () => "");
|
|
26
|
+
for (let index = letters.length - 1; index >= 0; index -= 1) {
|
|
27
|
+
letters[index] = String.fromCharCode(ASCII_A + Number(value % 26n));
|
|
28
|
+
value /= 26n;
|
|
29
|
+
}
|
|
30
|
+
return letters.join("");
|
|
31
|
+
}
|
|
32
|
+
function normalizeToLf(text) {
|
|
33
|
+
return text.replace(/\r\n/gu, "\n").replace(/\r/gu, "\n");
|
|
34
|
+
}
|
|
35
|
+
function stripBom(text) {
|
|
36
|
+
return text.charCodeAt(0) === 65279 ? text.slice(1) : text;
|
|
37
|
+
}
|
|
38
|
+
function splitLines(text) {
|
|
39
|
+
return normalizeToLf(stripBom(text)).split("\n");
|
|
40
|
+
}
|
|
41
|
+
function normalizeFileTag(value) {
|
|
42
|
+
const trimmed = value.trim();
|
|
43
|
+
const hashIndex = trimmed.lastIndexOf("#");
|
|
44
|
+
const tag = hashIndex === -1 ? trimmed : trimmed.slice(hashIndex + 1);
|
|
45
|
+
if (!FILE_TAG_PATTERN.test(tag)) throw new Error(`Invalid file hash: ${value}. Expected the eight-character tag from @file path#HASH.`);
|
|
46
|
+
return tag;
|
|
47
|
+
}
|
|
48
|
+
function formatFileHeader(path, tag) {
|
|
49
|
+
if (path.length === 0 || path.includes("\n") || path.includes("\r")) throw new Error("Invalid file header path. Expected one non-empty path without line breaks.");
|
|
50
|
+
return `@file ${path}#${normalizeFileTag(tag)}`;
|
|
51
|
+
}
|
|
52
|
+
function parseFileHeader(value) {
|
|
53
|
+
const match = FILE_HEADER_PATTERN.exec(value);
|
|
54
|
+
const path = match?.[1];
|
|
55
|
+
const tag = match?.[2];
|
|
56
|
+
return path === void 0 || tag === void 0 ? void 0 : {
|
|
57
|
+
path,
|
|
58
|
+
tag
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function formatTaggedLine(line, lineNumber, prefix = "", anchorSource = line) {
|
|
62
|
+
assertLineNumber(lineNumber);
|
|
63
|
+
return `${prefix}${lineNumber}#${hashLine(anchorSource)}|${line}`;
|
|
64
|
+
}
|
|
65
|
+
function parseLineAnchor(value) {
|
|
66
|
+
if (value.includes("\n") || value.includes("\r")) throw new Error(`Invalid line anchor: ${value}. Expected one anchor such as 5#abc, not a pasted multiline block.`);
|
|
67
|
+
const match = ANCHOR_PATTERN.exec(value);
|
|
68
|
+
if (!match) throw new Error(`Invalid line anchor: ${value}. Expected one anchor such as 5#abc from the latest read or grep result.`);
|
|
69
|
+
const line = Number.parseInt(match[1] ?? "", 10);
|
|
70
|
+
const hash = match[2]?.toLowerCase();
|
|
71
|
+
if (!Number.isSafeInteger(line) || line < 1 || hash === void 0) throw new Error(`Invalid line anchor: ${value}. Expected a positive line number and three letters, such as 5#abc.`);
|
|
72
|
+
return {
|
|
73
|
+
line,
|
|
74
|
+
hash
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function applyHashlineEdits(originalContent, requestedEdits) {
|
|
78
|
+
const lines = splitLines(originalContent);
|
|
79
|
+
const edits = deduplicateEdits(requestedEdits.map((edit) => validateEdit(edit, lines))).sort(compareEdits);
|
|
80
|
+
validateNoOverlaps(edits);
|
|
81
|
+
const result = [...lines];
|
|
82
|
+
for (const edit of [...edits].reverse()) {
|
|
83
|
+
const deleteCount = edit.to.line - edit.from.line + 1;
|
|
84
|
+
const replacements = edit.content === null || edit.content === "" ? [] : splitReplacement(edit.content);
|
|
85
|
+
result.splice(edit.from.line - 1, deleteCount, ...replacements);
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
content: result.join("\n"),
|
|
89
|
+
edits
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function assertLineNumber(line) {
|
|
93
|
+
if (!Number.isSafeInteger(line) || line < 1) throw new Error(`Invalid tagged line number: ${String(line)}. Expected a positive safe integer.`);
|
|
94
|
+
}
|
|
95
|
+
function validateEdit(edit, lines) {
|
|
96
|
+
const from = parseLineAnchor(edit.from);
|
|
97
|
+
const to = parseLineAnchor(edit.to);
|
|
98
|
+
if (from.line > to.line) throw new Error(`Invalid edit range ${edit.from} to ${edit.to}: the starting line follows the ending line.`);
|
|
99
|
+
if (to.line > lines.length) throw new Error(`Invalid edit range ${edit.from} to ${edit.to}: the file has ${lines.length} lines.`);
|
|
100
|
+
validateAnchor(from, lines);
|
|
101
|
+
validateAnchor(to, lines);
|
|
102
|
+
return {
|
|
103
|
+
from,
|
|
104
|
+
to,
|
|
105
|
+
content: edit.content ?? null,
|
|
106
|
+
source: edit
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function validateAnchor(anchor, lines) {
|
|
110
|
+
const line = lines[anchor.line - 1];
|
|
111
|
+
if (line === void 0) throw new Error(`Line ${anchor.line} is outside the current file.`);
|
|
112
|
+
const currentHash = hashLine(line);
|
|
113
|
+
if (currentHash !== anchor.hash) throw new Error(`Stale line anchor ${anchor.line}#${anchor.hash}. Current anchor is ${anchor.line}#${currentHash}. Re-read the file and retry.`);
|
|
114
|
+
}
|
|
115
|
+
function deduplicateEdits(edits) {
|
|
116
|
+
const unique = /* @__PURE__ */ new Map();
|
|
117
|
+
for (const edit of edits) {
|
|
118
|
+
const key = JSON.stringify([
|
|
119
|
+
edit.from.line,
|
|
120
|
+
edit.from.hash,
|
|
121
|
+
edit.to.line,
|
|
122
|
+
edit.to.hash,
|
|
123
|
+
edit.content
|
|
124
|
+
]);
|
|
125
|
+
if (!unique.has(key)) unique.set(key, edit);
|
|
126
|
+
}
|
|
127
|
+
return [...unique.values()];
|
|
128
|
+
}
|
|
129
|
+
function compareEdits(left, right) {
|
|
130
|
+
return left.from.line - right.from.line || left.to.line - right.to.line;
|
|
131
|
+
}
|
|
132
|
+
function validateNoOverlaps(edits) {
|
|
133
|
+
for (let index = 1; index < edits.length; index += 1) {
|
|
134
|
+
const previous = edits[index - 1];
|
|
135
|
+
const current = edits[index];
|
|
136
|
+
if (previous !== void 0 && current !== void 0 && current.from.line <= previous.to.line) throw new Error(`Overlapping edit ranges ${previous.from.line}-${previous.to.line} and ${current.from.line}-${current.to.line}. Merge them and retry.`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function splitReplacement(content) {
|
|
140
|
+
const normalized = normalizeToLf(content);
|
|
141
|
+
const trimmed = normalized.endsWith("\n") ? normalized.slice(0, -1) : normalized;
|
|
142
|
+
return trimmed === "" ? [] : trimmed.split("\n");
|
|
143
|
+
}
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region ../../utils/po-hashline/src/services/files/portable.ts
|
|
146
|
+
const UNICODE_SPACES = /[\u00A0\u2000-\u200A\u202F\u205F\u3000]/gu;
|
|
147
|
+
function computeFileTag(bytes) {
|
|
148
|
+
return createHash("sha256").update(bytes).digest("base64url").slice(0, 8);
|
|
149
|
+
}
|
|
150
|
+
function decodeUtf8(bytes, path) {
|
|
151
|
+
try {
|
|
152
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
153
|
+
} catch (error) {
|
|
154
|
+
throw new Error(`Cannot use hashline tools on ${path}: the file is not valid UTF-8.`, { cause: error });
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/** Normalize an input path the way Pi's tools do: Unicode spaces become spaces and one leading `@` is dropped. */
|
|
158
|
+
function normalizeInputPath(input) {
|
|
159
|
+
const path = input.replace(UNICODE_SPACES, " ");
|
|
160
|
+
return path.startsWith("@") ? path.slice(1) : path;
|
|
161
|
+
}
|
|
162
|
+
function displayPath(absolutePath, cwd) {
|
|
163
|
+
const path = relative(cwd, absolutePath);
|
|
164
|
+
const portable = (path !== "" && path !== ".." && !path.startsWith(`..${sep}`) && !isAbsolute(path) ? path : absolutePath).split(sep).join("/");
|
|
165
|
+
return portable === "~" || portable.startsWith("~/") ? `./${portable}` : portable;
|
|
166
|
+
}
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region ../../utils/po-hashline/src/services/files/index.edge.ts
|
|
169
|
+
/** The edge host's home, as po-core's edge nodeHost and the Durable Object filesystem lay it out. */
|
|
170
|
+
const EDGE_HOME = "/home/po";
|
|
171
|
+
/**
|
|
172
|
+
* Every path is reported writable: the platform exposes no way to ask, and nodeHost.fileMode answers undefined on the
|
|
173
|
+
* edge so callers skip their permission checks. A write the filesystem refuses (such as under /bundle) fails with its
|
|
174
|
+
* own permission_denied error when the edit is applied.
|
|
175
|
+
*/
|
|
176
|
+
async function isWritableFile(_path) {
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
function resolveInputPath(input, cwd) {
|
|
180
|
+
let path = normalizeInputPath(input);
|
|
181
|
+
if (path === "~") path = EDGE_HOME;
|
|
182
|
+
else if (path.startsWith("~/")) path = `${EDGE_HOME}/${path.slice(2)}`;
|
|
183
|
+
else if (path.startsWith("file://")) path = fileURLToPath(path);
|
|
184
|
+
return isAbsolute(path) ? resolve(path) : resolve(cwd, path);
|
|
185
|
+
}
|
|
186
|
+
/** Without a filesystem argument there is nothing to probe, so this is the plain resolution. */
|
|
187
|
+
async function resolveReadInputPath(input, cwd) {
|
|
188
|
+
return resolveInputPath(input, cwd);
|
|
189
|
+
}
|
|
190
|
+
//#endregion
|
|
191
|
+
export { decodeUtf8 as a, formatFileHeader as c, normalizeToLf as d, parseFileHeader as f, computeFileTag as i, formatTaggedLine as l, stripBom as m, resolveInputPath as n, displayPath as o, splitLines as p, resolveReadInputPath as r, applyHashlineEdits as s, isWritableFile as t, normalizeFileTag as u };
|
|
@@ -11,6 +11,8 @@ var _virtual_po_bundle_default = {
|
|
|
11
11
|
"/bundle/po-config/src/prompts/help-how-to-config/references/config-contract.md": "# Po runtime configuration authoring contract\n\n## Sources\n\nPo loads runtime settings from two files:\n\n1. `~/.po/config.yaml`\n2. `<repoRoot>/.po/config.yaml`\n\nAn absent file parses as `projectTrust: ask`. Both files reject unknown keys and invalid value\ntypes. Parsing and merge policy live in `@agimon-ai/po-config`; packages should not duplicate\nthat logic.\n\nThe runtime file is separate from the three selection-axis catalogs. `modes.yaml` defines major\nmodes and layers, `domains.yaml` defines content domains, and `profiles.yaml` defines personas.\nConsult the Help skill owned by the corresponding package when editing those files.\n\n## Runtime schema\n\nThe supported root keys are:\n\n```yaml\nprojectTrust: ask\n\nmodes:\n planning:\n main:\n model: openai/gpt-5.4\n thinking: high\n subagents:\n model: openai/gpt-5.4-mini\n thinking: medium\n plansDirectory: .po/plans\n\neditor:\n command: code\n\nvoice:\n engine: auto\n language: en\n recorder:\n binary: ffmpeg\n device: none:default\n adapters:\n openai-whisper:\n binary: whisper\n model:\n id: turbo\n\nselection:\n majorMode: copilot\n domains: [default]\n profile: reviewer\n```\n\n### Project trust\n\n`projectTrust` accepts `ask`, `always`, or `never`. It is repository policy. The repository value\nis authoritative, and an absent repository value defaults to `ask` rather than inheriting a\npersonal value.\n\n### Workspace declarations\n\nDeclarations live in `<repoRoot>/.po/workspaces.yaml`, not personal configuration:\n\n```yaml\nworkspaces:\n - name: Product\n path: .\n alias: product\n instructions: Focus on this product.\n metadata:\n team: operations\n '@example/plugin': { projectId: 'product-id' }\n```\n\nEach entry accepts only `name`, `path`, `alias`, `instructions` and `metadata`. Names are trimmed,\nunique case-insensitively, at most 80 characters, begin with a letter or number, and contain only\nletters, numbers, spaces, dots, dashes or underscores, without `..`. Instructions are optional\nstrings preserved verbatim. Aliases are optional non-empty strings, unique within the file.\n`path` defaults to `.`, relative to the repository root. Admission currently accepts only paths\ncanonically equal to that root (including equivalent symlinks). Subfolder and cross-repository\npaths fail explicitly. Multiple declarations share the root but have separate workspace ids.\n\nMetadata is a free-form JSON object for other plugins to leverage, not a product-specific schema.\nFlat keys and plugin-namespaced blocks are both valid; namespacing is conventional, not required.\nCore validates JSON compatibility, but does not read `products.yaml`, validate plugin-specific\nblocks, select credentials or enforce tool scope. Each consuming plugin validates and interprets\nthe fields it uses and decides whether they supply defaults or enforced policy. Never put\ncredentials in metadata.\n\nAn existing new document replaces the entire legacy list, including an empty list. Invalid or\nblank new documents fail instead of falling back. When absent, the repository `config.yaml`\n`workspaces` list remains readable with a notice. Its legacy entries still accept only `name`\nand optional `instructions`. Personal declarations are ignored; no automatic migration writes occur.\n\nHost code calls `readWorkspaceDeclarations({ fs, repositoryRoot, context })`, which returns\n`{ declarations, source, notices }`. Node hosts load declarations at composition boundaries, not\non each plugin lookup, so a new workspace/session composition refreshes metadata without re-adding\nworkspaces. Metadata and aliases are not copied into `workspaces.json`. Instructions retain their\nexisting first-creation copy behavior. Renaming a declaration breaks its association with an\nexisting workspace; aliases are lookup labels, not identity keys.\n\n#### Consuming metadata and workspace services\n\nPlugins inject `po/workspace-registry` through Cordis instead of reading the YAML themselves:\n\n```ts\nimport { PO_WORKSPACE_REGISTRY_SERVICE, readPoWorkspaceRegistry } from '@agimon-ai/po-core/workspaceRegistry';\n\ncontext.inject([PO_WORKSPACE_REGISTRY_SERVICE], async (context) => {\n const registry = readPoWorkspaceRegistry(context)!;\n const result = await registry.resolve({ id: host.context.workspaceId });\n if (result.status !== 'found') return; // This optional integration stays inactive without a unique workspace.\n const metadata = result.workspace.metadata;\n // Validate the fields this plugin consumes before applying its defaults or policy.\n});\n```\n\n`list()` returns detached workspace records. `resolve()` accepts exactly one selector: `{ id }`,\n`{ name }`, `{ path }` or `{ alias }`, and distinguishes `found`, `missing` and `ambiguous`.\nUse the current workspace id for session-local integrations. Same-root siblings are ambiguous\nby path; cross-file alias collisions are also ambiguous. Do not pick the first candidate.\nAn optional integration may stay inactive when resolution is not `found`; a required integration\nmust report the missing or ambiguous workspace instead of silently applying another workspace's policy.\n\nWorkspace-scoped services are separate from this registry. Their provider declares a contract\nwith `defineServiceContract(name, { scope: 'workspace' })` and binds it with\n`requirePoServerScope(context).provide(contract, service)` from `@agimon-ai/po-core/serverPlugin`.\nOther plugins in that workspace and its descendant sessions acquire the service through normal\nCordis `context.inject([contract.name], ...)` and `context.get(contract.name)`. A global scope\ncannot see services provided below it, and sibling workspaces do not inherit one another's services.\nPlugins can combine the current workspace's metadata with its injected services. The registry\nitself is read-only inventory, not a cross-workspace service locator; it never returns another\nworkspace's Cordis context or services.\n\nThe current edge host exposes only its admitted tenant id/root with empty metadata, since edge\nadmission does not yet associate a tenant id with a declaration key.\n\n### Planning\n\n`modes` may contain only `planning`. `planning.main` and `planning.subagents` accept an optional\nnon-empty `model` and a `thinking` value from `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, or\n`max`.\n\n`plansDirectory` accepts an absolute path, `~`, `~/...`, or a path relative to the active repository\nroot. If omitted, it resolves to `~/.po/plans`. Other home aliases such as `~other/...` are rejected.\nThis directory is the fallback when session artifacts are unavailable; otherwise plans go in\n`<artifactRoot>/plans/`.\n\nThis `modes.planning` namespace configures the planning runtime. It does not define major modes from\n`modes.yaml`.\n\n### Editor\n\n`editor` may contain only a non-empty `command`. Editor choice is personal, so the effective value\ncomes from the personal config.\n\n### Voice\n\n`voice.engine` accepts `auto`, `whisper-cpp`, `openai-whisper`, or `mlx-whisper`. `language`, recorder\nbinary, and recorder device are optional non-empty strings.\n\nAdapters may be declared only for those three concrete engines. An adapter may set a binary and must\nset a model containing exactly one of `path` or `id`. `whisper-cpp` accepts only a path. The OpenAI\nand MLX adapters accept either form.\n\nAutonomous capture is personal-only and belongs in `~/.po/config.yaml`:\n\n```yaml\nvoice:\n autoCapture:\n model: openai/gpt-4.1-mini\n startPhrases: [hey po]\n stopPhrases: [stop speaking]\n utteranceIdleMs: 3000\n transcriptionTimeoutMs: 120000\n tts:\n engine: macos-say\n voice: Samantha\n rate: 190\n```\n\nThe model must use `provider/model-id` form. Control phrases must be non-empty, bounded strings and\nmust remain unique after normalization. Idle time accepts 1500 through 10000 milliseconds. The\ntranscription timeout accepts 1000 through 120000 milliseconds and defaults to 120000 milliseconds\nso cold local ASR model startup is covered. TTS currently accepts only `macos-say`, with an optional\nrate from 80 through 500. Repository `voice.autoCapture` is rejected.\n\n### Default selection\n\n`selection` may contain a non-empty `majorMode`, an array of string `domains`, and a non-empty\n`profile`. An empty domains array intentionally selects no content domains.\n\nThese values choose defaults only. They do not define any mode, domain, or profile.\n\nWhen a repository declares `selection`, repeat every personal axis that should remain selected.\nParsed omitted keys become unset, so the effective file-loaded selection contains the repository's\ndeclared values rather than inheriting omitted personal axes.\n\n## Source merge rules\n\nMerge behavior is field-specific:\n\n- `projectTrust` comes from the repository parse result. Missing repository configuration produces\n the `ask` default.\n- Workspace declarations come only from the repository `workspaces.yaml`, with the deprecated\n repository `config.yaml` key as an absence-only fallback. Personal declarations are ignored.\n- `editor` comes from personal configuration. A repository editor value is not selected.\n- `modes.planning.main` and `modes.planning.subagents` merge their fields, with repository fields\n replacing personal fields. Repository `plansDirectory` replaces the personal value when present.\n- `voice` merges with repository fields replacing personal fields. Recorder fields merge. Adapter\n binary fields merge, while a repository adapter model replaces the personal model as one value.\n- `voice.autoCapture` remains the personal value. Declaring it in repository configuration is an\n error.\n- If neither file declares `selection`, it remains absent. When only one file declares it, that\n mapping supplies the defaults. When the repository declares `selection`, its parsed mapping\n replaces personal values for omitted axes as well as axes it sets.\n\nDo not assume one generic deep-merge rule or copy this policy into consumers. Call `loadPoConfig`\nor use the live service snapshot.\n\n## Immutable Cordis context\n\n`@agimon-ai/po-config/extensions/pi` provides `PO_CONFIG_SERVICE` on the runner's shared Cordis\nsession branch. Consume it inside an owning injection:\n\n```ts\ncordis.inject([PO_CONFIG_SERVICE], (configContext) => {\n const snapshot = requirePoConfigContext(configContext);\n const settings = snapshot.settings;\n const active = snapshot.harness;\n const pending = snapshot.pendingSelection;\n const requiresRelaunch = snapshot.requiresRelaunch;\n\n return () => disposeConsumer();\n});\n```\n\nThe full snapshot is deeply frozen:\n\n- `settings` is the merged `config.yaml` result.\n- `harness` is the active launcher and synchronized composition state.\n- `pendingSelection` is the latest unacknowledged transition target, when one exists.\n- `requiresRelaunch` reports whether active state still differs from pending intent.\n\nThe provider publishes a new snapshot for a replacement session. Never mutate a snapshot, keep it\nat module scope, or retain it after the injection is disposed. Consumers that register Pi callbacks\nmay close over an active Cordis context only when their injection cleanup clears that binding.\n\n## Cross-axis transition state\n\nMajor-mode, domain, and profile packages own resolution and user interaction for their respective\naxes. The transition coordinator serializes their requests against the current session,\nconfiguration generation, and synchronized artifacts.\n\nConfig supplies two append-only Pi custom entry types:\n\n- `po:config:v1` records a complete selected major mode, domains list, optional profile, and\n optional composition fingerprint.\n- `po:transition:v1` records an operation ID, active selection, target selection, strategy, and\n `pending`, `applied`, `aborted`, or `superseded` phase.\n\nActive selection and pending intent are different state. A reload-capable transition stages the\ntarget harness and appends journal entries before calling Pi reload. A launcher-owned composition\nchange keeps pending intent for process relaunch. A fresh session acknowledges a pending record only\nwhen both the exact target selection and composition fingerprint are active.\n\nPre-application failure must not claim the target as active. Do not bypass the coordinator, mutate\n`snapshot.harness`, or treat environment transport as the durable journal.\n\n## Verification\n\n```sh\npnpm nx test @agimon-ai/po-config\npnpm nx typecheck @agimon-ai/po-config\npnpm nx build @agimon-ai/po-config\npnpm nx test @agimon-ai/po\npnpm --filter @agimon-ai/po exec po --explain\n```\n\nRun a parent-session smoke test when changing Cordis publication, provider replacement, reload, or\nprocess-relaunch behavior.\n",
|
|
12
12
|
"/bundle/po-domain/src/prompts/help-how-to-domain/SKILL.md": "---\nname: help-how-to-domain\ndescription: Configure Po plugin catalogs and domain resource selections in domains.yaml. Use when creating or editing .po/domains.yaml or ~/.po/domains.yaml, choosing local, Git, or npm plugins, filtering plugin resources, setting aliases or defaults, or verifying resolved domain composition.\n---\n\n# Author Po domain configuration\n\nKeep plugin locations in `plugins` and make domains refer to catalog IDs. Do not put filesystem paths directly in a domain's `plugins` list.\n\nBefore editing, read both `~/.po/domains.yaml` and the repository's `.po/domains.yaml` when they exist. Preserve their layered ownership and resolve every relative path from the file that declares it.\n\nUse the smallest source form that preserves intent. Pin Git sources with `sha` and npm sources with an exact `version` when reproducibility matters. Use a domain plugin mapping only when the domain needs resource filters or must disable plugin hooks or MCP.\n\nGive a domain an `mcp.servers` allowlist when its work does not need every configured server. Tool schemas are always-on context, so this is usually the largest saving a domain can make, and it is worth more than trimming skills. Filtering activates only when every selected domain declares `mcp`, so migrate the domains that get selected together or the selection stays unfiltered.\n\nAfter editing, validate the intended selection with `po --domains <name[,name...]> --explain` and compare the reported context cost against the previous selection, then run `po sync --check`. Run mutating `po sync` only when the user intends to materialize or refresh synchronized artifacts.\n\nRead [references/domains-contract.md](references/domains-contract.md) for the complete schema, precedence rules, source forms, filters, and verification checks.\n",
|
|
13
13
|
"/bundle/po-domain/src/prompts/help-how-to-domain/references/domains-contract.md": "# `domains.yaml` authoring contract\n\n## Files and precedence\n\nPo reads `~/.po/domains.yaml` first and `<repo>/.po/domains.yaml` second. The document accepts only these top-level keys:\n\n- `plugins`: plugin discovery roots and explicit catalog entries.\n- `domains`: named resource selections.\n- `aliases`: names that expand to arrays of concrete domain names.\n- `defaultDomains`: the selection used when no higher-precedence source names domains.\n\nRelative paths in the personal file resolve from `~/.po`. Relative paths in the repository file resolve from the repository root.\n\nPlugin roots from both files accumulate in source order and exact duplicate roots are removed. Explicit plugin entries, domains, and aliases merge by name. A repository definition replaces the complete personal definition with the same name, rather than deep-merging it. A repository `defaultDomains` replaces the personal value when present; omitting it inherits the personal value. `defaultDomains: []` is an explicit empty default.\n\nAt selection time, a present `PO_DOMAINS` value outranks `defaultDomains`, including an explicitly empty environment value. When neither exists, the compatibility fallback is `marketing` for the marketing major mode and `default` otherwise. Command-line or persisted session selections are applied by their caller before this fallback is needed.\n\n## Complete example\n\n```yaml\ndefaultDomains: [work]\n\nplugins:\n roots: [plugins]\n entries:\n repository-tools:\n source: local\n path: tools/repository-plugin\n description: Repository implementation tools.\n review-tools:\n source: url\n url: https://github.com/acme/review-tools.git\n path: plugins/review\n ref: v2\n sha: 0123456789abcdef0123456789abcdef01234567\n incident-tools:\n source: npm\n package: '@acme/incident-tools'\n version: 3.1.0\n\ndomains:\n development:\n description: Implementation and review resources.\n plugins:\n - repository-tools\n - name: review-tools\n skills: [typescript, review-*]\n agents: [reviewer]\n hooks: false\n mcp: true\n sharedSkills: true\n mcp:\n servers: [code-intel, agiflow-proxy]\n proxy: [repository-search]\n operations:\n description: Incident response resources.\n plugins: [incident-tools]\n mcp:\n servers: [agiflow-proxy]\n proxy: [production-observability]\n\naliases:\n work: [development, operations]\n```\n\n## Plugin discovery roots\n\n`plugins.roots` is an array. Each path can identify:\n\n- a supported marketplace root or its manifest;\n- one plugin root; or\n- a container whose direct-child directories are plugins.\n\nDiscovery does not recurse beyond direct children. Use another root or an explicit entry for a deeper plugin. Po recognizes schema-gated Agent Plugins v1 `plugin.json` files and the legacy `.codex-plugin/plugin.json`, `.claude-plugin/plugin.json`, and `.cursor-plugin/plugin.json` locations. A discovered plugin uses its manifest `name`, or its directory name when the manifest omits one.\n\nPo also inspects supported personal and repository marketplace locations automatically. Marketplace IDs are qualified as `plugin@marketplace`. When the same marketplace ID appears more than once, the first discovered marketplace entry wins. Explicit `plugins.entries` are applied last and may intentionally replace discovered IDs.\n\n## Standalone and disabled plugins\n\nTwo optional lists under `plugins` change where a catalog entry loads, without a domain:\n\n```yaml\nplugins:\n standalone: [linear, field-notes]\n disabled: [figma]\n```\n\n- `standalone`: plugin IDs that load in every session, after the selected domains' plugins. An ID the catalog no longer has is skipped.\n- `disabled`: plugin IDs that never load, even when a selected domain names them, until removed from the list.\n\nBoth lists accumulate across the personal and repository files, like `roots`. Settings > Plugins edits them in `~/.po/domains.yaml`. A discovered plugin that is in no domain and not `standalone` does not load.\n\n## Explicit plugin sources\n\nEvery `plugins.entries` key is the stable ID that domains reference.\n\nLocal plugins can use a path shorthand or the canonical mapping:\n\n```yaml\nplugins:\n entries:\n short-local: plugins/short-local\n local-tool:\n source: local\n path: plugins/local-tool\n```\n\nGit repositories use `source: url`. Use `source: git-subdir` when `path` is required by the declaration:\n\n```yaml\nplugins:\n entries:\n whole-repository:\n source: url\n url: acme/whole-plugin\n sha: 0123456789abcdef0123456789abcdef01234567\n monorepo-plugin:\n source: git-subdir\n url: ssh://git@example.com/acme/plugins.git\n path: packages/po-plugin\n ref: main\n sha: fedcba9876543210fedcba9876543210fedcba98\n```\n\nGit URLs may be HTTP, HTTPS, SSH, `file:`, scp-like `git@host:path`, absolute paths, declaring-root-relative `./` paths, or `owner/repository` GitHub shorthand. A remote `path` must remain inside the checkout. `git-subdir` requires it. When `sha` is present, Po checks out and verifies that commit; otherwise it uses `ref` when supplied.\n\nnpm plugins use a valid package name, plus optional version and registry:\n\n```yaml\nplugins:\n entries:\n published-tool:\n source: npm\n package: '@acme/published-tool'\n version: 1.4.2\n registry: https://registry.npmjs.org\n```\n\nGit and npm sources materialize under `~/.po/plugin-cache`. Cache identity includes the complete source descriptor. An existing cache is reused and does not refresh a mutable branch, tag, npm range, or unversioned package automatically. Prefer a full Git `sha` or exact npm `version`. Change the descriptor to produce a new cache identity when updating deliberately.\n\n## Domains and resource filters\n\nA domain accepts only `description`, `plugins`, `mcp`, and `sharedSkills`.\n\nA string in `plugins` selects every supported resource from that catalog entry. The mapping form selects the same plugin with optional controls:\n\n- `skills`: skill frontmatter names to retain. Exact names and `*` wildcards are supported.\n- `agents`: agent frontmatter names to retain. Exact names and `*` wildcards are supported.\n- `hooks`: set `false` to omit the plugin's `hooks/hooks.json`; omission keeps it.\n- `mcp`: set `false` to omit the plugin's MCP source; omission keeps it.\n\n`sharedSkills: false` opts out of repository `.claude/skills`. Shared skills remain enabled unless every selected concrete domain sets it to `false`.\n\nThe domain-level `mcp.servers` list keeps named servers from the merged repository and plugin MCP configuration. `mcp.proxy` keeps named upstreams from the `agiflow-proxy` configuration. Allowlist values from selected domains are unioned, but filtering activates only when every selected concrete domain declares `mcp`. If any selected domain omits `mcp`, the selection remains unfiltered. An omitted or empty `servers` or `proxy` list also leaves that slice unfiltered; an empty array is not a deny-all policy.\n\nAliases expand once to their listed concrete domain names. Keep alias targets concrete rather than chaining aliases. Domain and alias names both appear in `/domains` discovery. Plugin directories are deduplicated by resolved directory in first-selection order.\n\n## Code-mode scripts\n\nA plugin root may contain an optional `codemode/` folder of reusable code-mode scripts, beside `skills/` and `agents/`. Each `codemode/<name>.ts` file is an `exec` body (top-level `await`, `args` as its argument, `return` as its result). While the plugin's domain is active, code mode lists it in `discover` and a script imports it with `await (await import('<domain>/<name>'))(args)`. A leading `/** ... */` block comment describes the script; its first paragraph is the line `discover` shows. Po registers the folder only when it exists, and the folder has no subset filter in `domains.yaml`.\n\n## Verification\n\nFrom the repository root:\n\n```sh\npo --domains development --explain\npo --domains development,operations --explain\npo sync --check\n```\n\nConfirm the explanation lists the expected domains, plugin names, skill paths, agents, MCP servers, and proxy upstreams. Start a session and use `/domains` or `list_domains` to confirm the active and available names. A live switch uses `/domains <name[,name...]>` and reloads the session after validation and resource staging.\n\nRun mutating `po sync` only when the user intends to materialize remote sources or refresh\nsynchronized runtime artifacts.\n\nFor source changes in this repository, run:\n\n```sh\npnpm nx lint @agimon-ai/po-domain\npnpm nx typecheck @agimon-ai/po-domain\npnpm nx build @agimon-ai/po-domain\npnpm nx test @agimon-ai/po-domain\n```\n",
|
|
14
|
+
"/bundle/po-log/src/prompts/codemode-how-to-logsink/SKILL.md": "---\nname: codemode-how-to-logsink\ndescription: 'Find out what went wrong and what it cost: captured failures, token usage, logs and traces. Use when debugging a tool or runtime error in this session, or when reviewing past sessions to improve a workflow.'\n---\n\n# Read Log Sink evidence\n\nUse the base `how-to-codemode` guide, then `discover({ namespace: 'logsink' })` for signatures. These methods only inspect retained data. They never start, stop, clear, migrate, or repair the collector. When code mode is absent, use the equivalent `logsink_*` direct tools. A host without local SQLite access reports a capability limitation, not a healthy run.\n\n## Check availability first\n\n```ts\nreturn await logsink.status();\n```\n\nResults contain `scope` and `data`. `data.available` means retained storage can be read, not that the collector is running or currently capturing. Missing storage is not an empty successful query. No capture means no evidence, not no failures. A stopped collector can still have useful history. Report query errors separately and never start a collector as part of investigation.\n\n## Debug runtime and tools within this session\n\nOmit `scope` to stay in the current session. Do not widen a debugging query just because its result is empty.\n\n```ts\nconst issues = await logsink.agentIssues({ limit: 20 });\nreturn { scope: issues.scope, ...issues.data };\n```\n\nRead aggregates before samples: `uniqueIncidents`, `totalIssues`, `byCategory`, `byTool`, and `byErrorType`. Repeated `occurrenceCount` can be one noisy incident, not many independent failures. Check `coveragePercent` and `truncated` before treating a window as complete.\n\nFor expensive tools:\n\n```ts\nconst report = await logsink.metrics({ groupBy: 'session', toolSort: 'p90-total-tokens', toolLimit: 10 });\nreturn { scope: report.scope, totals: report.data.totals, tools: report.data.tools };\n```\n\nToken coverage measures usage records, not event-capture completeness. Tool token distributions describe the containing turn, not exclusive per-tool shares. Low cache use is evidence to investigate, not proof of a changing prompt prefix.\n\nUse `services` and `stats` to find the relevant subsystem. `search` handles structured filters without text, or FTS with `query`. `order` applies only to filter-only queries; FTS ranks by relevance and rejects `order`. Search supports filters and FTS only; semantic/hybrid search is not part of this read-only API. Preserve returned truncation indicators and narrow the window when necessary.\n\nUse `trace({ traceId })` only for a trace identified in relevant evidence. The query enforces the selected scope, including traces shared by multiple sessions. A guessed trace ID does not authorize broader access.\n\n## Continue a list\n\nEvery list query accepts `offset` (default 0) and `limit` (1 to 1000). Search, trace, issues, stats and services default to 100 items. Read `data.pagination`: `hasMore` indicates another page and `nextOffset` is a number or `null` at the end. Repeat the same query with that offset, keeping scope, filters, order and limit unchanged. Do not use `truncated` as the continuation signal: issue truncation describes scan coverage, and search truncation describes whether the page contains every match.\n\n```ts\nconst input = { service: 'pi', limit: 20 };\nconst first = await logsink.search(input);\nif (first.data.pagination.nextOffset === null) return first;\nreturn await logsink.search({ ...input, offset: first.data.pagination.nextOffset });\n```\n\nMetrics pages three lists independently: `limit`/`offset` for groups (default 50), `toolLimit`/`toolOffset` for tools (default 20), and `timelineLimit`/`timelineOffset` for timeline buckets (default 100). Each list has its own metadata under `data.pagination.groups`, `.tools` or `.timeline`. Advance only the list you need. Metrics totals and statistics `totalEntries` cover the full matching scope, not just the page. Issue pages contain deduplicated incidents from the same bounded scan; totals and coverage do not shrink when paging samples.\n\nOffset pages read live data, not a frozen snapshot. Concurrent ingestion or retention can shift rows. For repeatable investigations, use explicit fixed time bounds, preserve them on every request, and avoid unbounded collect-all loops. If a result exceeds the size cap, lower the relevant list limits or narrow the window. Raw structured results remain available to code mode; transcript copies may keep fewer rows.\n\nThe existing Help-only `diagnose_agent` tool remains a sanitized current-session summary. Help activation does not grant additional access or repair permissions.\n\n## Compare history to improve a workflow\n\nHistory is an explicit choice for cross-session investigation, not the default debugging path. Supply both ISO time bounds and narrow by workflow, service, agent, or session when possible. Retained session identifiers are opaque exported keys: use keys returned in results for history filters. The default scope maps the active session to its stored key automatically. The host-local global collector can include several repositories; instance identity is not an access-control boundary. Use the existing host/tool authorization boundaries and the user's requested scope.\n\n```ts\nconst endTime = new Date().toISOString();\nconst startTime = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString();\nconst report = await logsink.metrics({ scope: 'history', startTime, endTime, groupBy: 'session', limit: 20 });\nreturn { scope: report.scope, totals: report.data.totals, groups: report.data.groups };\n```\n\nUse the same explicit scope and bounds for follow-up issues, search, and traces. Do not accidentally drop filters when chaining calls. Quote the effective scope and time window in findings. Prefer patterns repeated across sessions over one anecdote, and distinguish total occurrences from unique incidents.\n\n## Guardrails\n\n- All inputs and results are structured JSON. Use `discover`, do not parse tool display text or invent parameters.\n- Result limits and scan bounds apply. Reads time out after 25 seconds; split a large history window rather than increasing it indefinitely.\n- There are no database-path, endpoint, SQL, or collector lifecycle selectors. Do not bypass these boundaries through shell commands.\n- Reads do not change database contents, schema, or application caches. SQLite can maintain WAL/SHM coordination sidecars to read live records.\n- Logs may contain identifiers, working directories, errors, caller attributes, and private data. Aggregate first; do not paste secrets, prompts, raw tool inputs, or private trace bodies into reports.\n- Never clear retained evidence, restart a shared sink, or enable telemetry just to obtain data. Setup changes require separate authorization.\n- Report observed evidence separately from hypotheses. Empty or truncated results cannot establish that a run was healthy.\n",
|
|
15
|
+
"/bundle/po-log/src/prompts/help-how-to-log/SKILL.md": "---\nname: help-how-to-log\ndescription: Debug a Po agent using session-scoped failure and usage evidence. Distinguish missing telemetry from a healthy run, diagnose expensive or failed tools, and investigate deeper traces without exposing secrets or changing the sink.\n---\n\n# Debug a Po agent\n\nStart with the user's symptom and an expected outcome. Identify the affected session and the shortest reproduction. Do not attribute a failure to the model before checking the tools and runtime it depends on.\n\n## Read captured evidence\n\nWhile Help is active, call `help_status` to see which diagnostics are actually available. Use `diagnose_agent` for the current session, initially with the default one-day window. Use `period: week` only when the relevant run is older. The tool has no arbitrary session or filesystem selector.\n\nThe result distinguishes unavailable data, an empty window, and captured evidence. `capturedIssues` describes the records inspected, not every failure that ever happened. Zero captured records does not establish that telemetry was working. Token coverage describes usage records, not completeness of the event stream. Tool token samples belong to the containing turn and are not exclusive tool cost.\n\nIf setup or capabilities are suspect, use `diagnose_setup` and the configuration, domain, mode, or skill guidance identified by the failed check. Preserve the current selection and unrelated settings.\n\n## Investigate beyond the summary\n\nThe diagnostic deliberately omits prompts, raw error messages, tool inputs, and trace bodies. It does not open a sink or repair logging. Load `codemode-how-to-logsink` and use the `logsink` namespace when deeper investigation is necessary. Keep runtime/tool debugging queries in the current session. Trace queries enforce that scope before retrieval; a guessed trace ID is not authorization. Explicit bounded history is a separate workflow-improvement investigation, not an automatic fallback for missing session evidence.\n\nWhen code mode is absent, use the equivalent `logsink_*` direct tools. If no authorized reader is available, report that capability limitation. Do not invent evidence or enable a server, domain, or permission merely to make a query available.\n\n## Propose and verify a repair\n\nSeparate observations from hypotheses. Present the smallest change and the expected verification. Configuration changes, model changes, package installation, authentication, restarts, and repairs use existing approval and permission boundaries. Help activation grants none of those actions by itself.\n\nNever clear logs, restart or stop a sink as part of diagnosis, or paste credentials and raw private logs into a report. After an authorized change, reproduce the original symptom and report the observed result and remaining evidence gaps.\n",
|
|
14
16
|
"/bundle/po-major-mode/src/prompts/help-how-to-major-mode/SKILL.md": "---\nname: help-how-to-major-mode\ndescription: Configure Po default packages, layers, extensions, hook groups, and named major modes. Use when creating or editing ~/.po/modes.yaml or a repository's .po/modes.yaml, choosing a default mode, or diagnosing which behavior a mode activates.\n---\n\n# Author Po major modes\n\nUse `modes.yaml` only for runtime composition. Major modes choose ordered layers, and layers choose\nPi extensions, extension packages, and hook groups. Domains configure plugin content and MCP access;\nprofiles configure personas and environment defaults.\n\n## Workflow\n\n1. Read both `~/.po/modes.yaml` and the repository's `.po/modes.yaml` when they exist.\n2. Decide whether the change belongs in the personal defaults or only in the current repository.\n3. Preserve unrelated definitions and authored array order.\n4. Put unconditional packages in `default.packages`, reusable behavior in `layers`, and selections\n under `majorMode`.\n5. Write new modes as mappings with a useful `description` and an ordered `layers` array.\n6. Put package-owned settings under that package's `config` mapping. Do not add layer-level `config`\n or the removed `targets` field.\n7. Check the result with `po --major-mode <name> --explain`. Use `po sync --check` when the\n change affects installed packages or the synchronized matrix.\n\nRelative local paths resolve from the repository root for repository configuration and from\n`~/.po` for personal configuration. A repository definition replaces a personal definition\nof the same name as a whole value, so never assume nested fields merge.\n\nRead [references/modes-contract.md](references/modes-contract.md) before editing package entries,\nlocal extension paths, hook-only layers, inherited definitions, or tombstones.\n",
|
|
15
17
|
"/bundle/po-major-mode/src/prompts/help-how-to-major-mode/references/modes-contract.md": "# Po `modes.yaml` authoring contract\n\n## Purpose and sources\n\n`modes.yaml` controls the behavior axis of a Po session:\n\n- `default.packages` is the unconditional package baseline.\n- `layers` are reusable ordered bundles of extensions, packages, and hook groups.\n- `majorMode` maps a session mode to an ordered list of layer names.\n- `defaultMajorMode` selects the starting mode when no flag or inherited environment value wins.\n\nPo reads `~/.po/modes.yaml` first and `<repoRoot>/.po/modes.yaml` second. Either file may\nstand alone. A missing or empty file contributes nothing.\n\nNamed `layers` and `majorMode` entries merge by name. A repository entry replaces the complete\npersonal entry with the same name. Setting an inherited layer or mode to `null` removes it. The\ntop-level `default` block is also replaced as a whole when the repository declares it. An omitted\nrepository `default` keeps the personal definition. `defaultMajorMode` uses the last declared value.\n\nRelative paths retain the source that declared them:\n\n- Personal paths resolve from `~/.po`.\n- Repository paths resolve from the repository root, not from `<repoRoot>/.po`.\n\n## Supported shape\n\n```yaml\n# Optional package baseline loaded before every selected named layer.\ndefault:\n packages:\n - '@agimon-ai/po-help'\n - name: '@scope/optional-extension'\n optional: true\n config:\n policy: concise\n\nlayers:\n local-review:\n extensions:\n - './extensions/review.ts'\n packages:\n - '@scope/review-extension'\n hookGroups: [repository]\n team:\n packages:\n - name: '@agimon-ai/po-team'\n config:\n models:\n - model: provider/model-id\n thinking: high\n\ndefaultMajorMode: copilot\nmajorMode:\n minimal:\n description: Small sessions with delegation only.\n layers: [team]\n copilot:\n description: General coding with delegation and local review policy.\n layers: [team, local-review]\n```\n\nTreat the `default` example as a shape, not as the current distribution package list. Preserve the\nbaseline emitted by `po init` unless the user explicitly wants to replace it. If neither source\ndeclares `default`, Po adds no fallback feature package set. `default.packages: []` deliberately\nselects an empty baseline. Fixed core packages remain active independently.\n\n### `default`\n\n`default` accepts exactly one field, `packages`, and `packages` must be an array. It does not accept\n`extensions` or `hookGroups`. Its packages activate before packages from selected named layers.\n\n### `layers`\n\nEach layer is a mapping with these supported fields:\n\n- `extensions`: an array of non-empty strings. A bare name selects a Po built-in extension.\n A `./` or `../` path, or an absolute path, selects a Pi-compatible script or extension directory.\n- `packages`: an array of package strings or package mappings. A normal npm package activates its\n ordered `package.json` `pi.extensions` entries. An exported subpath can select one adapter.\n Path-like packages are supported for local unpublished Pi packages.\n- `hookGroups`: a legacy array of hook group IDs. It still parses but has no runtime effect.\n\nA package mapping accepts only:\n\n- `name`: required non-empty package specifier or local path.\n- `optional`: optional boolean. A missing optional package is skipped and is not installed.\n- `config`: optional mapping owned and interpreted by that package. Its contents stay opaque to the\n major-mode parser.\n\nRequired npm packages missing from the active baseline or selected layers can be installed during\nlaunch. `po sync` considers required packages from the baseline and every declared layer.\nOptional packages and local paths are not installed automatically.\n\nPackage configuration belongs inside its package mapping. Layer-level `config` is rejected because\nthere is no unambiguous owner. The removed `targets` field is also rejected. Select a layer by naming\nit from the appropriate major modes.\n\n### `majorMode` and `defaultMajorMode`\n\nNew major modes use this mapping form:\n\n```yaml\nmajorMode:\n review:\n description: Focused review with repository policy and Team delegation.\n layers: [team, local-review]\n```\n\n`description` must be a non-empty string and `layers` must be an array of non-empty layer names.\nEvery referenced layer must survive source merging. Layer order and repeated entries are preserved.\nThe array-only compatibility form, such as `review: [team, local-review]`, is accepted and receives a\ngenerated description, but new configuration should use the mapping form.\n\nWhen `defaultMajorMode` is explicitly configured, it must name a surviving mode. If no source\ndeclares it, Po uses the compatible `copilot` fallback. Declare an explicit default when the\navailable modes do not include `copilot`.\n\n## Safe changes\n\n- Add a package to an existing layer when it should follow that layer's activation and ownership.\n- Add a new layer when the behavior should be reusable across multiple modes or independently\n ordered.\n- Add a new mode by composing existing layers, then add new layers only for missing behavior.\n- Use a repository replacement when a shared personal definition is unsuitable for one repository.\n- Use `null` only to remove an inherited named layer or named mode. Do not use it as a package entry\n or as a partial-field deletion mechanism.\n- Keep local paths within trusted, reviewable locations and confirm they resolve from the declaring\n source's base directory.\n\n## Verification\n\nRun a read-only resolution before launching:\n\n```sh\npo --major-mode review --explain\n```\n\nConfirm the reported major mode, ordered layers, hook groups, and resulting resources. If packages\nor synchronized composition changed, check drift and missing packages without updating artifacts:\n\n```sh\npo sync --check\n```\n\nRun `po sync` only when the user intends to install packages or refresh synchronized artifacts.\nFor repository changes to the parser or templates themselves, run the affected Po Config and\nPo lint, typecheck, build, and test targets.\n",
|
|
16
18
|
"/bundle/po-mcp/src/prompts/codemode-how-to-mcp/SKILL.md": "---\nname: codemode-how-to-mcp\ndescription: 'Reach external services, such as GitHub, through the MCP servers the person configured. Use whenever a task needs an MCP tool; loading it lists the servers and tools this session can call.'\n---\n\n# Use MCP from code mode\n\nMCP servers are configured outside Po. In code mode each server tool is a method on the `mcp` namespace: `mcp.<server>.<tool>(args)`. The servers and tool names this session can call are listed at the end of this skill when you load it with `load_skill`. For anything else, ask `discover`.\n\n## Find a tool\n\n- `discover({ query: 'github/search_issues' })` returns one tool's signature, its input fields and what it returns. Run it before the first call to a tool.\n- `discover({ namespace: 'mcp' })` returns every signature. A large catalog is cut at 24,000 characters, so narrow with `query`.\n- Use only the server and tool names the list or `discover` shows. Never guess a name or an argument.\n- The list below is a snapshot from when the skill loaded. After `/mcp reload` or a new sign-in, `discover` is the source of truth.\n\n## Call it\n\n```ts\nconst found = await mcp.github.search_issues({ query: 'is:open label:bug' });\nreturn found.structuredContent ?? found.text;\n```\n\n- Names are the exact configured server and original tool names. Use brackets when a name is not an identifier: `mcp['work-github']['search-issues'](args)`. `mcp.call(server, tool, args)` is the same call by string.\n- A result is `{ text, images, structuredContent?, blocks? }`. `structuredContent` is typed when the server declares an output schema. Pass a result to `image()` to see its images.\n- An upstream error rejects with the server's text. Wrap a call in `try` to keep going, or use `Promise.allSettled` for a batch.\n- Nothing is printed unless the script returns it. Return the fields you need, not the whole result.\n\n## Tools that change data ask first\n\nA tool counts as changing data unless its server marks it read-only (`readOnlyHint: true`) or not destructive (`destructiveHint: false`). Most servers mark nothing, so most tools ask. `discover` labels them `(asks first)`.\n\n- Call such a tool through its typed member, `mcp.<server>.<tool>(args)`. The script does not wait: the call throws a pending-approval error, the rest of the script keeps running, and the call runs once the person approves. Its outcome arrives as a message, so do not retry it and do not depend on its result later in the same script.\n- `mcp.call(server, tool, args)` refuses a tool that asks first. Use the typed member instead. A tool whose server or tool name contains a dot or a space cannot carry a prompt in code mode; call its direct tool.\n- The person can let these tools run without asking: in MCP settings for every session, or with `/mcp approve on` for this session only. Never ask them to turn it on to save you a step.\n- Subagents, background runs and other unattended calls are not asked: they run directly.\n- A server that is removed, disconnected, signed out or failing leaves this list, `discover` and the direct tools until it reconnects. If a tool you used earlier is gone, check `/mcp status` instead of guessing a new name.\n\n## Batch\n\nIndependent calls go in one `exec` with `Promise.all`. Several servers can answer in a single script:\n\n```ts\nconst [issues, docs] = await Promise.all([\n mcp.github.search_issues({ query: 'is:open' }),\n mcp.notion.search({ query: 'roadmap' }),\n]);\nreturn { issues: issues.structuredContent, docs: docs.text };\n```\n\n## Limits and mistakes\n\n- `exec` stops at 30 seconds by default. Pass `timeoutMs` up to 120,000 for slow tools. Time spent waiting for file-upload consent counts against it.\n- With code mode on, you have no direct tool such as `github_search_issues`: its schema would only cost context, so the namespace is the way in, and `discover` shows the signature. The exception is a tool that carries an MCP App, whose inline UI only works on its direct tool.\n- If the tool set changes while a script runs, the call fails with \"MCP tools changed\". Run `discover` again and retry in a new `exec`.\n- Ordinary MCP calls cannot reload configuration or read credentials. Use `/mcp auth <server>` and `/mcp reload` for configured servers. In Help mode, discover `mcpTest` to add a session-only URL server and await sign-in; see `help-how-to-mcp`. Ask permission before connecting.\n",
|
|
@@ -18,6 +20,9 @@ var _virtual_po_bundle_default = {
|
|
|
18
20
|
"/bundle/po-profile/src/prompts/codemode-how-to-memory/SKILL.md": "---\nname: codemode-how-to-memory\ndescription: Keep and recall durable facts about how the person likes to work, per profile, through the memory namespace. Use when a stable preference, convention, or decision should outlive this session, or when earlier context about the person may help; not for task progress or repository facts.\n---\n\n# Profile memory\n\n`memory` is long-term memory for the selected profile. One memory per profile, shared across repositories. Nothing is loaded into the prompt for you: search when it could help.\n\n## When to use it\n\n- Recall: before asking the person something they probably answered before (tone, tools, conventions), call `memory.search({ query })` with a few plain words, then `memory.read({ id })` for the full entry.\n- Remember: when the person states a stable preference or a decision that should hold next time, call `memory.write({ title, body })`. One fact per entry, short title, self-contained body.\n- Correct: `memory.read` first, then `memory.write({ id, title, body, expectedRevision })` with the revision you read.\n- Forget: `memory.forget({ id, expectedRevision })` when asked, or when an entry is wrong.\n\n## Do not\n\n- Store secrets, tokens, or credentials. Redaction is best effort, not a guarantee.\n- Store task progress (use `tasks`) or facts derivable from the repository.\n- Write on a guess. Store what the person said or clearly showed.\n- Retry blindly on a revision conflict: re-read, merge, then write.\n\n## Failure modes\n\n- \"No profile is selected\": there is no memory without a profile. Say so; do not work around it.\n- \"The selected profile changed during the memory call\": the person switched profiles mid-call. Discard the result and call again.\n- Search treats operators as literal text; use plain words.\n\nAutomatic extraction is opt-in (`profileMemory.automatic: true` in the user-global `config.yaml`). Extracted entries have `origin: 'extracted'`; treat them as hints and correct or forget wrong ones.\n",
|
|
19
21
|
"/bundle/po-profile/src/prompts/help-how-to-profile/SKILL.md": "---\nname: help-how-to-profile\ndescription: Configure Po profile discovery, personas, environment defaults, and precedence in profiles.yaml. Use when creating or changing personal or repository profiles. Do not use for config.yaml runtime settings, modes.yaml, or domains.yaml.\n---\n\n# Author Po profiles\n\nConfigure a profile as one persona plus optional environment defaults.\n\n## Workflow\n\n1. Read both `~/.po/profiles.yaml` and the repository's `.po/profiles.yaml` when they exist.\n2. Use `profiles.roots` for one-level persona discovery. A discovered directory may add `env`, `integration`, and scoped vault `secrets` through a strict `profile.yaml` sidecar. Use `profiles.entries` when a profile needs an explicit persona path.\n3. Resolve relative roots and persona paths against the file that declares them. Keep an explicit persona inside that file's `agents/` directory or one of its configured roots.\n4. Put instructions in `profile.md`, `SOUL.md`, or `AGENTS.md`. Po concatenates non-empty files in that order.\n5. Keep every `env` value a nonsecret string. An already exported value wins for process defaults; input templates read only the profile's declared mapping. Never put secret references in `env`, including Liquid syntax. Give each integration secret the narrowest `purposes` (`browser`, `proxy`, `env`, or `input`).\n6. Preserve the precedence rules. Explicit entries override discoveries, including sidecar-synced ones, and repository entries override personal entries at the same precedence level.\n7. Verify the selection with `po --profile <name> --explain`, then smoke-test `/profile` when changing live switching behavior.\n8. For profiles a plugin contributes, read the contract's section on plugin sources before relying on a name or default: a name no file declares waits for the plugin for at most ten seconds, then the session starts with no profile and one warning.\n\n## Input templates\n\nPass `{{ env.LOGIN_EMAIL }}` or `{{ secrets.PASSWORD }}` directly as input text to an integrated surface, not through a secret-reading tool. `secret` is a synonym for `secrets`; legacy `${env.NAME}` and `${secrets.NAME}` remain supported. Values resolve host-side, once, just before input. Only interpolation is supported: no tags, filters, bracket access, expressions, or recursive templates. Missing names and malformed templates fail rather than being typed literally.\n\nFor a vault-backed alias, add profile-level `secrets.PASSWORD` with `vault: { namespace: logins, key: example, field: password }`. Omit `field` only when the stored value itself is a string. Never put the actual credential into YAML. Browser delivery needs `purposes: [browser]` and exact `allowedOrigins`. Native delivery needs `purposes: [input]` and exact app identifiers in `allowedTargets`, for example `{ ios: [com.example.app], computer: [com.example.desktop] }`. Combine purposes only when both are needed. Provider-backed integration aliases may use the same input purpose and target allowlist. Do not reuse an alias in both mappings.\n\nA person without YAML saves a secret from the composer's '+' menu (Secret). It lands in the vault as `secrets/<NAME>` holding `{ value, purposes, allowedOrigins?, allowedTargets? }`, and resolves as `{{ secrets.NAME }}` in every session when no profile alias has that name. The same allowlist checks apply, and a malformed entry resolves as missing.\n\nUse only surface methods that explicitly implement this boundary. A target supplied by the model is not proof of the foreground app. Native surfaces may refuse unsupported targets, recording, or later observations to keep values out of captures. Never bypass those refusals with shell commands, clipboard tricks, raw API calls, or direct vault access. Arbitrary tool arguments and scripts are not globally templated.\n\nRead [references/profiles-contract.md](references/profiles-contract.md) before changing discovery, precedence, path handling, or profile application.\n",
|
|
20
22
|
"/bundle/po-profile/src/prompts/help-how-to-profile/references/profiles-contract.md": "# Po profiles authoring contract\n\n## Sources and shape\n\nPo reads profile declarations in this order:\n\n1. `~/.po/profiles.yaml`\n2. `<repoRoot>/.po/profiles.yaml`\n\nPlugins may also contribute in-memory profiles through `ProfileSources.register`. Session reads pass\n`{ workspaceId }` to each source's `list(scope)`, so a source can show only the profiles that belong\nto the session's workspace. File profiles are never filtered. See\n[Plugin sources, readiness and defaults](#plugin-sources-readiness-and-defaults) for sources that load\nasynchronously.\nThe current catalog shape is:\n\n```yaml\nprofiles:\n roots: [agents/acme]\n entries:\n writer:\n persona: agents/special/writer\n env:\n BRAND: acme\n TONE: concise\n defaultProfile: writer\n```\n\nThe document may contain only the `profiles` mapping. In catalog form, `profiles` may contain only\n`roots`, `entries` and `defaultProfile`. Po still accepts the earlier flat form, where profile\nnames appear directly below `profiles`, but new configuration should use catalog form.\n\n`defaultProfile` names the persona a run starts on when nothing else names one, the same way\n`modes.yaml` declares `defaultMajorMode` and `domains.yaml` declares `defaultDomains`. A repository\ndeclaration replaces a personal one. `po --profile <name>` overrides it for one run, and an\ninherited `PO_PROFILE` wins so a nested run stays on the persona its parent chose. A\n`defaultProfile` or `selection.profile` that names no file profile is not an error by itself: it is a\nrequested name that a plugin source may still deliver. The launch waits for the sources, at most ten\nseconds in total, and when the name never appears it starts with no profile and shows one warning.\nA value that is not a non-empty string still fails loading.\n\nEvery relative root or persona path resolves against the file that declares it. Repository paths\nresolve from the repository root. Personal paths resolve from `~/.po`.\n\n## Root discovery\n\nEach `profiles.roots` value must resolve to an existing directory.\n\n- If the root directly contains `profile.md`, `SOUL.md`, or `AGENTS.md`, the root is one profile.\n Its directory name is the profile name, and its children are not scanned.\n- Otherwise, Po inspects only the root's direct-child directories. A child becomes a profile\n when it directly contains at least one persona file.\n- Discovery does not recurse. Add another root or an explicit entry for a deeper persona.\n- A discovered profile has an empty environment mapping unless its directory holds a `profile.yaml` sidecar.\n- Unreadable candidates and candidates whose real path or persona files escape the configured root\n are ignored. An invalid configured root itself is an error.\n\n### Discovered `profile.yaml` sidecar\n\nA discovered persona directory may hold a nonsecret `profile.yaml` sidecar, typically written by a\nsync tool such as po-unsendbox:\n\n```yaml\nversion: 1\nenv:\n BRAND: receiptnote\nintegration:\n provider: unsendbox\n # same shape as an explicit entry's integration\n```\n\nOnly `version` (exactly `1`), `env`, `integration`, and scoped vault `secrets` are allowed. These are validated exactly like an\nexplicit entry. `env` cannot contain secret aliases in legacy or Liquid syntax. The sidecar must be a regular\nfile of at most 64 KiB inside the real persona directory; a symlink cannot escape it. A bad sidecar\nskips only that profile and reports a diagnostic in `loadProfileCatalog(...).diagnostics`; the rest of\nthe catalog still loads. Diagnostics never echo sidecar values. Sync and async loaders behave the same.\n\n## Explicit entries and path confinement\n\nAn explicit entry may contain only `persona`, `env`, optional `integration`, and optional vault `secrets`. `persona` is required, must be a non-empty\nrelative path, and must resolve to a directory containing readable persona content.\n\nThe persona must remain inside either:\n\n- the `agents/` directory beside the declaring repository root or personal `.po` directory, or\n- one of the `profiles.roots` directories declared in that same file.\n\nPo checks both the lexical path and the real filesystem path. A persona-directory symlink cannot\nescape an allowed root. Each resolved persona file must also remain inside the real persona\ndirectory, so a file symlink cannot import instructions from outside it. Invalid explicit entries\nfail loading instead of being skipped.\n\nPersona content is assembled from non-empty files in this order:\n\n1. `profile.md`\n2. `SOUL.md`\n3. `AGENTS.md`\n\n## Nonsecret integration bindings\n\nAn explicit profile may bind one integration provider. The binding contains identifiers only,\nnever API keys, passwords, cookies, or resolved credential values:\n\n```yaml\nprofiles:\n entries:\n worker:\n persona: agents/worker\n integration:\n provider: unsendbox\n organizationId: org-id\n mailboxId: mailbox-id\n credentialRef: local-auth-reference\n secrets:\n PASSWORD:\n credentialId: existing-credential-id\n field: password\n allowedOrigins: [https://login.example.com]\n browser:\n profileName: worker\n allowedOrigins: [https://login.example.com]\n```\n\n`provider`, `organizationId`, `mailboxId`, `credentialRef`, and `secrets` are required.\n`credentialRef` identifies authentication supplied by the concrete integration outside profile\nconfiguration. An empty `secrets` mapping is allowed. Each uppercase secret alias names an existing\ncredential and field (a field name, or `profileSecret:<ALIAS>` for provider-held profile secrets).\n\nEach integration secret declares `purposes`, a nonempty unique subset of `browser`, `proxy`, `env`, and `input`, defaulting\nto `[browser]`:\n\n- `browser`: `{{ secrets.PASSWORD }}` is filled host-side by the browser, never profile `env`. It\n requires nonempty exact HTTP(S) `allowedOrigins`, without paths, wildcards, userinfo, or trailing\n slashes.\n- `proxy`: named by `browser.proxySecret` and resolved host-side for the browser proxy only.\n- `env`: injected only into workflow `run` steps that declare the alias, through `po/profile-secrets`.\n- `input`: delivered only to an explicitly allowed native app through a trusted input boundary. Requires\n `allowedTargets`, a nonempty mapping of surface names to nonempty exact application-identifier lists,\n such as `{ios: [com.example.app], computer: [com.example.desktop]}`. Wildcards are refused. Browser,\n env and proxy are reserved and cannot be native surface names. Non-input aliases cannot set targets.\n\nA secret without the `browser` purpose cannot list origins. The optional browser binding requires a\nsafe profile name, not a filesystem path, and its own nonempty `allowedOrigins` containing every\nbrowser-purpose secret origin. It may set `mode` (`playwright`, `extension`, or `stealth`) and\n`proxySecret`, which must name a `proxy`-purpose secret. Unknown metadata is rejected.\n\nThe public `@agimon-ai/po-profile` API exposes the session-owned `po/profile-runtime` Cordis service.\nConsumers declare that service as an injected dependency, use `requireProfileRuntime(context)`,\nand attach exactly one concrete provider with `attachProvider(providerName, factory)`. The factory\nreceives deeply immutable binding metadata plus `{profileName, generation, signal}` and returns\n`{resolveSecret(reference, signal), dispose()}`. The attachment returns an awaited cleanup operation.\nDo not invoke `runtime.resolveSecret` from the factory: resolution is rejected until initialization\nfinishes. The runtime does not load provider SDKs or persist resolved values.\n\n`runtime.resolveSecret(name, {origin, signal})` accepts a trusted actual target-frame origin from\nthe browser boundary, never a tool-supplied origin, and resolves `browser`-purpose aliases only.\n`runtime.resolveProxySecret(signal)` is host-only and resolves `browser.proxySecret`. `ready()` rejects\nif a configured provider is missing or failed. Session startup and new-turn admission both require\nreadiness. Profile changes and shutdown abort old generations before asynchronous provider cleanup;\nlate secret results are rejected rather than delivered to a replacement profile. Persona-only\nprofiles remain compatible. The concrete browser integration owns persistence and exclusive profile\nleases.\n\nThe global `po/profile-secrets` service serves jobs that run outside a session. Providers call\n`registerProvider(provider, factory)`; workflow hosts call `resolveEnv({cwd, profile, names, signal})`.\nEach call loads the profile catalog for `cwd`, requires the `env` purpose for every name, opens a fresh\nprovider connection, and disposes it before returning. Every failure is the same generic error. The\nservice is never exposed as a model tool. `redactSecrets(value, secrets)` and\n`createSecretRedactionStream(secrets)` redact raw, JSON-escaped, and URL-encoded forms of resolved\nvalues, including overlapping and chunk-split matches; use them before any output reaches a model.\n\n## Vault aliases and Liquid input\n\nVault-backed aliases live at the profile level, independently of any integration provider:\n\n```yaml\nprofiles:\n entries:\n worker:\n persona: agents/worker\n env:\n LOGIN_EMAIL: ops@example.com\n secrets:\n PASSWORD:\n vault: { namespace: logins, key: example, field: password }\n purposes: [browser, input]\n allowedOrigins: [https://login.example.com]\n allowedTargets:\n ios: [com.example.app]\n computer: [com.example.desktop]\n```\n\nThe host reads only the configured vault entry. With `field`, only an own string property of that exact\nname is accepted (no nested traversal); without it, the value itself must be a nonempty string. Vault\naliases support browser and input purposes, not proxy or workflow env. Provider and vault alias names\nmust not collide. The vault remains host-only with no secret-reading model namespace.\n\nInput text may combine literals, `{{ env.LOGIN_EMAIL }}`, and `{{ secrets.PASSWORD }}`. `secret` is a\nsynonym for `secrets`, and legacy `${env.NAME}`, `${secret.NAME}`, and `${secrets.NAME}` remain supported.\nThe shared `@agimon-ai/po-core/inputTemplate` parser and LiquidJS renderer support interpolation only,\nwith at most 16 references and bounded input/output. Tags, filters, expressions, bracket/prototype access,\nand malformed templates fail before resolving any credential. Resolved values are never rendered again.\n`env` reads only this profile's declared nonsecret values, never arbitrary process or session environment.\n\n`runtime.resolveInputSecret(name, {surface, target, signal})` is host-only. The surface must obtain the\nactual app identity at its native boundary, recheck it after asynchronous resolution, and prevent values\nfrom reaching output, traces, logs, recordings, and screenshots. Profile changes, shutdown and request\ncancellation discard late results. Consumers must never return the resolved string to the model. New\nsurfaces reuse the shared parser/renderer and runtime method, not global argument interpolation or raw\nvault reads. A tool-supplied target is never authorization evidence. Browser aliases retain their existing\nactual-frame origin checks. An integration browser allowlist remains an additional restriction when set.\n\n## Persona identity front-matter\n\nA persona may open `profile.md` with a YAML front-matter block declaring who it is and how it\nsounds. Only `profile.md` is read this way; `SOUL.md` and `AGENTS.md` are always prose.\n\n```markdown\n---\nname: Rhea\nicon: avatar.png\nvoice:\n voice: Karen\n rate: 175\n---\n\nYou are Rhea, a blunt systems architect.\n```\n\nAll three fields are optional. `name` replaces the profile's directory name in the cockpit,\n`icon` is an image beside `profile.md`, and `voice` shadows `voice.autoCapture.tts` from\n`config.yaml` per field: a persona setting only `rate` keeps the configured voice. The TTS `engine`\nis never overridable, because it selects the synthesiser rather than the persona.\n\nBecause identity lives here rather than in `profiles.yaml`, it applies to profiles found by root\ndiscovery as well as to explicit entries.\n\nA block is only treated as identity when it is fenced on the very first line, closed, parses as a\nYAML mapping, and declares at least one of `name`, `icon`, or `voice`. Anything else is left in the\npersona text byte for byte, so a persona that legitimately opens with a horizontal rule is\nunaffected. A recognised block is removed from the prompt: it describes the persona rather than\ninstructing it. A `profile.md` holding nothing but front-matter therefore has no persona text, and\nthe profile fails to load unless `SOUL.md` or `AGENTS.md` supplies it.\n\nThe icon is read once when the profile loads and travels to the cockpit as a `data:` URL, so no\nfile is served at request time. It must be a PNG, JPEG, GIF, or WebP, checked by content rather\nthan by file extension. SVG is refused because an SVG rendered in the cockpit executes script. The\nicon must stay inside the persona directory under the same real-path rule as persona files, so a\nsymlink cannot smuggle a file out of it. An icon that is missing, unreadable, of another type, or\nlarger than 256 KiB once encoded is dropped: the persona keeps its name and the cockpit falls back\nto the default avatar rather than failing the profile.\n\n## Plugin sources, readiness and defaults\n\nA plugin that holds profiles in memory registers a `ProfileSource` with `ProfileSources.register(id, source)`.\nBesides the synchronous, cached `list(scope)`, a source may declare two optional hooks:\n\n- `ready(scope, signal)` resolves when `list` reflects the source's first complete load for that scope and\n rejects when the load failed. The signal aborts when nobody waits any more, so shared background work\n must keep running.\n- `defaultProfile(scope, signal)` returns the name a workspace starts with when nothing asked for a profile,\n or `undefined` for no opinion. Reject when the source holds a default it cannot honor.\n\nA source without the hooks counts as immediately ready and offers no default. The registry waits for every\ndeclared `ready` together and reports failures by source id only. It asks `defaultProfile` in registration\norder: the first answer that is not `undefined` wins, and a source that rejects ends the search instead of\nhanding the decision to the next source. A file profile keeps a name a source also holds.\n`readProfileSources(context, scope)` returns a view that reads every hook as that workspace.\n\n`resolveInitialProfile(files, sources, { intent, scope, signal })` decides a session's first profile once.\n`intent` is `{ kind: 'named', name }` for a requested name, `{ kind: 'unspecified' }` when nothing asked,\nand `{ kind: 'none' }` for an explicit choice of no profile that no default overrides.\n\n- A name that is already listed resolves at once and never waits.\n- A missing name waits for source readiness. Every wait of one resolution shares a single ten second\n deadline; a hook that ignores its signal cannot hold the session back.\n- A source default applies only to `unspecified` in a workspace with an id, and it must name a profile that\n is in that workspace's catalog. A default that is not listed yet waits for the sources under the same\n deadline before it is ruled out. An unlisted default never falls through to another source.\n- A name that never arrives, a failing source, a timeout and an unlisted default all give a session with no\n profile and one warning (`timeout`, `missing`, `source-failed` or `invalid-default`). Only the owning\n session aborting rejects.\n\nThe result is an `InitialProfileOutcome` holding names only. A launcher that decides before the session\nexists publishes it on the session context as `po/profile-initial-outcome` and builds the persona and\nenvironment from the same decision. The session then applies that outcome without waiting again, checks the\nname against the live catalog, and shows the warning once when it starts. A session launched without an\noutcome resolves for itself: a saved name waits for its source, and a session with no profile consults\n`defaultProfile` when its workspace is known. It cannot tell an explicit \"no profile\" from an absent choice, so\na launcher that wants no profile must publish an outcome. The decision it makes is published on the session\ncontext too. Every applied selection, whoever asked for it, leaves one identity marker once the session has\nstarted.\n\n`GET /api/workspaces/<workspace>/plugins/profile/launch-profiles` lists what a launcher may offer before a\nsession exists: `{ profiles: [{ name, identity?: { name?, icon?, role?, contact? }, sourceId }], readiness }`,\nwhere `sourceId` is `files` or a source id, and `readiness` is `unavailable` when a source failed or was not\nready within ten seconds. It never carries environment, persona text or paths, bindings, credential\nreferences or secrets.\n\nThe owner-authenticated session API lives under\n`/api/workspaces/<workspace>/sessions/<session>/plugins/profile`:\n\n- `GET /current` returns `{ profile: string | null }` from the live selection.\n- `GET /profiles` returns the same display-only catalog as the launch endpoint, but uses the session's\n repository root and admitted `HOME`, and the session workspace's sources. It waits up to ten seconds,\n keeps partial results on timeout or source failure, and may be requested again to discover late profiles.\n- `PUT /current` accepts `{ profile: string | null }`; `null` explicitly clears the selection. A known name\n is accepted immediately. A missing name waits up to ten seconds and is checked again. The change uses\n the next tool boundary, so a busy session keeps the request pending until application completes.\n Success returns the actual applied `{ profile }`. Identity journaling follows the normal host selection\n path and is not published a second time by the API.\n\nInvalid JSON or selection bodies return 400 `Invalid profile selection`. A name still missing after\nsuccessful readiness returns 404 `Unknown profile`. Incomplete readiness returns 503\n`Profiles are not ready. Try again.` An integration admission failure returns 503\n`Profile integration is unavailable. Restore its credential or choose another profile.` These sanitized\nresponses do not echo names or source errors. Profile configuration failure returns 500\n`Profile configuration is unavailable`.\n\nNative uses this API for the in-session Profile page. Only the core dispatch-gate 503 bodies\n`Session selection is not ready.` and `Session selection changed before dispatch.` fall back to the\n`/profile` recovery dialog: those responses occur before profile code runs. An admission failure does not\ntrigger recovery or replay. A request abort prevents application only before enqueue; an already queued\nchange may still apply after the caller leaves. Never automatically retry a failed or abandoned write.\nThe next live selection status is authoritative.\n\n## Precedence\n\nPo resolves names in four passes, from lowest to highest precedence:\n\n1. Personal root discoveries\n2. Repository root discoveries\n3. Personal explicit entries\n4. Repository explicit entries\n\nA later profile replaces an earlier profile with the same name. This means any explicit entry\noverrides discovery, including a personal explicit entry replacing a repository discovery. A\nrepository explicit entry wins over a personal explicit entry. Unrelated names from all sources\nremain available, and the final list is sorted by profile name.\n\nA `profile.yaml` sidecar does not change precedence: a synced profile is still a discovery. Any\nexplicit entry with the same name, personal or repository, replaces it entirely, including its\nintegration. When moving a profile to sync, remove or rename the old explicit entry.\n\n## Environment defaults and activation\n\nEvery `env` key maps to a nonsecret string. Secret alias expressions are rejected in `env`. Applying a profile writes only variables that are not already\nexported by the caller. When switching profiles, Po removes a value contributed by the previous\nprofile only if that value has not since changed, then applies the next profile's defaults.\n\nThe `/profile` command resolves the named profile and executes the change through the session\ntransition coordinator. A profile change uses Pi reload so extensions re-read the environment.\nPo assembles the persona into a private run-directory file, and the persona Pi entry appends\nthat content to the system prompt after reload.\n\nAutonomous voice can switch profiles too. The `profile` voice capability lists the configured\npersonas and queues a switch, which arrives as `/profile --voice-switch-token=…`. The chosen name\ntravels in a TTL-bounded handoff rather than in the command text, so an edited transcript cannot be\nturned into a switch to a different persona. A spoken switch therefore takes the same reload path\nas the command, which is also what lets the new persona's voice take effect: the spoken voice is\nread when autonomous voice activates.\n\n## Verification\n\n```sh\npnpm nx test @agimon-ai/po-config\npnpm nx typecheck @agimon-ai/po-config\npnpm nx test @agimon-ai/po-profile\npnpm nx typecheck @agimon-ai/po-profile\npnpm --filter @agimon-ai/po exec po --profile writer --explain\n```\n\nUse an actual parent session to smoke-test `/profile` when changing transition, environment, or\npersona application behavior.\n",
|
|
23
|
+
"/bundle/po-prompt/src/prompts/help-how-to-prompt/SKILL.md": "---\nname: help-how-to-prompt\ndescription: 'Use @agimon-ai/po-prompt: Staged recent prompts and saved prompt templates for Po'\n---\n\n# Use Prompt\n\nRead the package [README](../../../README.md) for its exact installation, command, configuration, and behavior.\n\n## Guidance\n\n- `/prompts`, or `SPC e p`, opens a filterable picker over the last three prompts of this session and every saved prompt, then stages the chosen one in the editor rather than sending it.\n- `/prompt-save <name>` saves the current draft, or the newest staged prompt when the draft is empty, as `~/.po/agent/prompts/<name>.md`. Names are lowercase letters, digits and dashes.\n- A saved prompt is an ordinary Pi prompt template, so it is also `/<name>` from the next start, with `$1` and `$@` argument substitution. Text containing those tokens is substituted on invocation; the save command says so when it sees them.\n- Staged prompts live in memory for the session only. Nothing reaches disk until the user saves a prompt explicitly.\n- Arrow up and down are Pi's own in-session history and are not modified by this package.\n- Do not require Po Help for runtime activation. Help only makes this package guidance discoverable while the minor mode is active.\n",
|
|
24
|
+
"/bundle/po-runner/src/prompts/codemode-how-to-runner/SKILL.md": "---\nname: codemode-how-to-runner\ndescription: 'Inspect supervised shell commands, read complete saved logs, send interactive input, and stop processes or sequential command groups through the runner namespace in code mode.'\n---\n\n# Use Runner from code mode\n\nRunner supervises commands started by `bash`, saves their complete output, and keeps their identity outside the transcript. Use the `runner` namespace for inspection and control instead of starting another shell just to invoke the CLI. Read the base `how-to-codemode` guide for execution basics.\n\nStart with `discover({ namespace: 'runner' })` for current signatures and result types. Calls are session-owned: IDs from another session are refused. Subagents in this session share its runners.\n\n## Start work with Bash\n\nKeep using the `bash` tool to launch commands. Always pass `command` as an array, including `[\"one command\"]`. Use `background: true` for dev servers and watchers. Use `interactive: true` when only the last command needs terminal input; earlier commands remain noninteractive.\n\nDo not pipe or redirect command output to a file, `head`, or `tail`. Runner saves full logs automatically and already bounds the returned output.\n\nFor dependent checks:\n\n```json\n{\n \"command\": [\"pnpm build\", \"pnpm typecheck\", \"pnpm lint\", \"pnpm test\"],\n \"name\": \"verification\"\n}\n```\n\nThe commands run separately, in order, stopping at the first unsuccessful command. Each has its own full log. The result lists the attempted logs and only the last executed command's trimmed output. A launch failure may have no log file.\n\n`timeout` applies to each command, even after promotion. Every command uses a fresh shell in the session's working directory: `cd` and `export` do not carry into the next entry. Keep repository mutations, such as merges, separate from verification.\n\nA long array continues as one supervised background sequence. Keep its returned ID, do not restart the array. Native sessions receive one aggregate completion report. Remote MCP callers use the CLI polling instructions their Bash tool provides, not an assumed local notification.\n\n## Inspect without restarting\n\n```ts\nreturn await runner.list();\n```\n\n```ts\nconst status = await runner.status({ id: 'returned-id' });\nconst logs = await runner.logs({ id: 'returned-id', lines: 100 });\nreturn { status, logs };\n```\n\n`list`, `status`, and `logs` read state. `list({ all: true })` includes retained history. A running sequence reports its ordered stages; read a stage's ID for its individual output. A completed sequence exposes only its guarded `result`, including whatever manifest the result policy allows. Reads are finite snapshots, not streaming follows. Filter large logs rather than returning everything to the model.\n\nReport started, passed, and failed stages with their IDs. Check status before retrying a failed or interrupted tool call. Do not sleep in a polling loop or report running work as complete.\n\n## Change state deliberately\n\n```ts\nreturn await runner.input({ id: 'interactive-id', text: 'y', enter: true });\n```\n\nInput requires a running interactive RMUX or tmux process, not a sequence or ordinary subprocess. With `interactive: true`, control returns when the final stage starts. Inspect that stage's runner ID and logs, then send input to the stage ID, not the sequence ID. An interrupted input call may already have delivered text, so do not blindly resend it.\n\n```ts\nreturn await runner.stop({ id: 'unused-id', reason: 'verification finished' });\n```\n\n`stop` and `stopAll` change state. Stopping a sequence cancels pending stages and stops its active child. A requested stop is not confirmed termination. Stop work you no longer need, and preserve logs when investigating failures.\n\nCancelling an inspection does not stop supervised work. Background sequences outlive the originating tool call, but not the owning session. Owner loss does not replay pending commands automatically.\n\n## Storage and fallback\n\nAll runner files, including logs, process metadata, sequence manifests, and cancellation requests, live beneath the host-admitted session temporary directory. They are temporary evidence, not durable artifacts. Save important deliverables to the session artifact folder. Do not invent storage paths.\n\nDo not redirect managed output just to save it, or pipe it to `head` or `tail`: Runner already saves the full log and bounds the returned excerpt. When output is truncated, inspect the saved evidence instead of rerunning the command.\n\nWithout code mode, the standalone `po-runner` CLI remains available through Bash. The existing Help guide documents its flags and host setup.\n",
|
|
25
|
+
"/bundle/po-runner/src/prompts/help-how-to-runner/SKILL.md": "---\nname: help-how-to-runner\ndescription: Use Runner CLI controls to supervise shell commands, inspect complete session-temp logs, provide interactive input, and stop background runs.\n---\n\n# Use Po Pi Runner\n\nUse Runner for shell work that may outlive one tool call, needs complete logs, or requires later inspection and control. When code mode is available, discover the typed `runner` namespace and use the pinned `codemode-how-to-runner` guide instead of spawning the CLI.\n\n## Launch work\n\n- Use the Runner-provided `bash` tool with `command` as an array, including for one command.\n- Let short commands return inline.\n- Set `background: true` when the command should detach immediately.\n- Set `interactive: true` only when the last command needs terminal input. Earlier commands are noninteractive. Send input to the last stage runner ID, not the sequence ID.\n- `timeout` applies per command even after sequence promotion.\n- Commands run in separate fresh shells sequentially and fail-fast. They do not share `cd` or `export`, save every stage's log, and return only the last executed command's trimmed output. Keep mutations separate from verification.\n- Do not pipe or redirect output to a file, `head`, or `tail`. Runner saves full logs automatically and already bounds returned output.\n\n## Inspect and control work\n\nFor remote MCP, run the following commands through `bash`. They inherit the\nbound session; do not supply another session ID. `/runners` and `SPC r l` are\nlocal TUI interfaces, not shell commands or remote tools. For direct control, use:\n\n```bash\npo-runner list\npo-runner status <runner-id>\npo-runner logs <runner-id> --lines 100\npo-runner input <runner-id> --text \"y\" --enter\npo-runner stop <runner-id>\npo-runner stop-all\n```\n\nInput requires a running interactive process backed by RMUX or tmux, never a sequence. Preserve the returned identifier because it remains usable after transcript compaction. Sequence IDs expose stages and their actual log paths; stage IDs address process logs.\n\n## Close the lifecycle\n\nRemote MCP never receives runner completion notices, and a runner you start\ndoes not resume your conversation when it ends. While a runner matters to your\ntask, check `po-runner status <id>` between steps of your own work and read\n`po-runner logs <id> --lines 100`. Stop checking when State is completed, and\nreport a runner that is still running with its identifier. Do not promise\nautomatic follow-up or relaunch uncertain work.\n\n- Inspect logs instead of relaunching a command whose status is uncertain.\n- Stop watchers, servers, and failed interactive processes when they are no longer needed.\n- Treat commands as running with the Po Pi process environment and the operating-system user's privileges.\n- Treat logs as sensitive because they may contain prompts, source, output, or credentials.\n\nAll runner files live in the host-admitted session temporary folder. Session removal, restart, or termination stops its processes and deletes its runner files and registry entries, including after owner hard kill. Compaction does not trigger cleanup. Save important deliverables to the session artifact folder.\n",
|
|
21
26
|
"/bundle/po-skill/src/prompts/help-how-to-author-skill/SKILL.md": "---\nname: help-how-to-author-skill\ndescription: Author and distribute Po agent skills. Use when creating a SKILL.md, adding supporting references or scripts, configuring a discovered skill source, or publishing activation-gated Help prompts from a Po package.\n---\n\n# Author Po skills\n\nCreate one focused skill per directory. Name the directory with lowercase letters, digits, and hyphens, and give it a required `SKILL.md`:\n\n```markdown\n---\nname: repository-review\ndescription: Review repository changes when the user asks for implementation-risk and regression analysis.\n---\n\n# Repository review\n\nPut the essential workflow and non-obvious constraints here.\n```\n\nThe frontmatter `name` must match the directory. Make the description specific enough for automatic routing. Keep the entrypoint concise, and put substantial conditional details in linked `references/`. Add `scripts/`, `assets/`, or `agents/` only when the skill actually uses them.\n\n## Choose the distribution path\n\n- For discovered plugin skills, ship `skills/<name>/SKILL.md` and configure the plugin and optional skill subset in `domains.yaml`. po-skill registers each loaded skill once with an any-of gate for its admitting domains. Shared `.claude/skills` follow domains that keep shared skills; repository `.po/skills` are unconditional. Do not register discovered plugin skills again from the package.\n- For guidance that should appear only while Po Help is active, put it at `src/prompts/<name>/SKILL.md`, publish `src/prompts`, link it from the package's H1-led `llms.txt`, and register a Help descriptor through `PO_HELP_SERVICE`.\n- For repository content selected by domains, place the skill in the plugin or shared skill source configured by `domains.yaml`; do not hard-code that directory into the Skill package.\n\nPi Help descriptors carry only `name` and `description`. The Help service resolves the owning package from the contribution's exact package `source` and `moduleUrl`, then wraps its `llms.txt`. Keep every index link inside the published package.\n\nOn the server host, contribute the same Help skill through a named `resource/*.server.ts` route with `when: PO_HELP_WHEN` from `@agimon-ai/po-core/help`. Include its useful description and an absolute `path` resolved with `packageResourcePath(import.meta.url, ...)`; a reader alone does not make the skill discoverable in the agent prompt. Keep ordinary runtime skills under their existing conditions.\n\nPackage-owned Help tools use ordinary named tool routes, not documentation descriptors. Server tools use the existing Help condition and execution guards. Pi tools also need `createPiHelpToolGate(packageName, toolNames)`: install its services and onStart in the owning root, then authorize each invocation with `gate.assertActive`. Portable `when` metadata alone does not enforce the Pi gate. The Help README and Log package's `diagnose_agent` contribution show the complete pattern. Bound diagnostics to the current session, omit secrets, and use existing approval mechanisms for repairs.\n\n## Verification\n\nValidate the skill frontmatter, ensure every relative reference resolves, and test the packed package rather than relying on checkout-only files. For discovered skills, cover domain swaps, shared-skill opt-outs, and duplicate source admission. Pi globally name-deduplicates, so a plugin can shadow a same-name shared fallback even when its domain is off. Test the actual prompt and tool surface before activation, while active, and after deactivation; stale calls must be rejected without removing ordinary capabilities. Use `/skills` or `SPC e s` in an interactive session to confirm the expected owner and invocation name. Do not add remote MCP exposure merely because a local Help contribution exists.\n",
|
|
22
27
|
"/bundle/po-skill/src/prompts/help-how-to-skill/SKILL.md": "---\nname: help-how-to-skill\ndescription: Use Po's skill catalog and deferred discovery. Use when browsing available skills, invoking /skill:name, understanding Help and extension-owned skill groups, or diagnosing why a skill is absent or shadowed.\n---\n\n# Use Po skills\n\nOpen the skill browser with `/skills` or `SPC e s`. The catalog groups normal session skills, package Help skills, plugin skills, and extension-contributed directories by owner.\n\nFor agent tool calls, use `load_skill` with the exact name. With at most 20 active skills, its description lists the names and descriptions. Above 20, use `search_skills` to find skills by name or description, then load the chosen name. Search returns metadata only, not skill instructions or paths.\n\nInvoke a skill with `/skill:<name>`. Po expands deferred skills before Pi handles the input, so a skill can be invokable even when its full body was not placed in the initial prompt. Help skills appear only while Help mode is active.\n\nWhen a skill is missing:\n\n1. Confirm its owning package, plugin, domain, or Help mode is active.\n2. Wait for deferred discovery to finish by opening `/skills` or invoking the exact skill.\n3. Check the browser diagnostics for unreadable `SKILL.md` files, invalid frontmatter, duplicate names, or unavailable Help resources.\n4. If two sources use the same name, remember that normal loaded and deferred skills take precedence over Help skills.\n5. After changing domains or package composition, reload or relaunch as requested so the session receives the new skill directories.\n"
|
|
23
28
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { B as _isoDate, V as _isoDateTime, n as ZodISODate, r as ZodISODateTime } from "./schemas-Vj8-rCR4.js";
|
|
2
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/iso.js
|
|
3
|
+
function datetime(params) {
|
|
4
|
+
return _isoDateTime(ZodISODateTime, params);
|
|
5
|
+
}
|
|
6
|
+
function date(params) {
|
|
7
|
+
return _isoDate(ZodISODate, params);
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { datetime as n, date as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as nodeHost, o as poHomeDirectory } from "./serverPlugin-pCqlBqQG.js";
|
|
2
|
-
import {
|
|
2
|
+
import { i as readTextIfExists } from "./platformFiles-Ccj9HCvA.js";
|
|
3
3
|
import "./platform-CyvF7X-b.js";
|
|
4
4
|
import "./piSettings-B6fsgIBA.js";
|
|
5
5
|
import "node:crypto";
|
|
@@ -5851,6 +5851,7 @@ const VOICE_KEYS = [
|
|
|
5851
5851
|
"autoCapture",
|
|
5852
5852
|
"live"
|
|
5853
5853
|
];
|
|
5854
|
+
/** `orchestrator` configured the removed Voice conversation; it stays accepted so older files still load, and is ignored. */
|
|
5854
5855
|
const VOICE_LIVE_KEYS = [
|
|
5855
5856
|
"voice",
|
|
5856
5857
|
"model",
|
|
@@ -6279,8 +6280,6 @@ function parseVoiceLive(value, filePath) {
|
|
|
6279
6280
|
if (typeof value.model !== "string" || value.model.length > MAX_LIVE_MODEL_LENGTH || !LIVE_MODEL_PATTERN.test(value.model)) throw new Error(`Po config at ${filePath} requires voice.live.model to be a model id of at most ${MAX_LIVE_MODEL_LENGTH} letters, digits, dots, colons, underscores or dashes`);
|
|
6280
6281
|
result.model = value.model;
|
|
6281
6282
|
}
|
|
6282
|
-
const orchestrator = parseAgent(value.orchestrator, "voice.live.orchestrator", filePath);
|
|
6283
|
-
if (orchestrator) result.orchestrator = orchestrator;
|
|
6284
6283
|
return result;
|
|
6285
6284
|
}
|
|
6286
6285
|
function parseSelection(value, filePath) {
|
|
@@ -6627,6 +6626,7 @@ function configScopeOf(keyPath) {
|
|
|
6627
6626
|
*/
|
|
6628
6627
|
const PO_DIR$1 = ".po";
|
|
6629
6628
|
const CONFIG_FILE = "config.yaml";
|
|
6629
|
+
const PLANS_DIR = "plans";
|
|
6630
6630
|
/** Runtime callers pass admitted environment; omission retains the legacy host lookup. */
|
|
6631
6631
|
function globalPoConfigDirectory(homeDirectory = nodeHost.homeDirectory(), environment) {
|
|
6632
6632
|
return poHomeDirectory(homeDirectory, environment);
|
|
@@ -6634,6 +6634,13 @@ function globalPoConfigDirectory(homeDirectory = nodeHost.homeDirectory(), envir
|
|
|
6634
6634
|
function globalPoConfigPath(homeDirectory = nodeHost.homeDirectory(), environment) {
|
|
6635
6635
|
return path.join(globalPoConfigDirectory(homeDirectory, environment), CONFIG_FILE);
|
|
6636
6636
|
}
|
|
6637
|
+
function resolvePlanningPlansDirectory(configured, repoRoot, homeDirectory = nodeHost.homeDirectory()) {
|
|
6638
|
+
if (!configured) return path.join(globalPoConfigDirectory(homeDirectory), PLANS_DIR);
|
|
6639
|
+
if (configured === "~") return homeDirectory;
|
|
6640
|
+
if (configured.startsWith("~/")) return path.resolve(homeDirectory, configured.slice(2));
|
|
6641
|
+
if (configured.startsWith("~")) throw new Error("Po planning plansDirectory supports only '~' or '~/' home aliases");
|
|
6642
|
+
return path.isAbsolute(configured) ? path.normalize(configured) : path.resolve(repoRoot, configured);
|
|
6643
|
+
}
|
|
6637
6644
|
function repositoryPoConfigPath(repoRoot) {
|
|
6638
6645
|
return path.join(repoRoot, PO_DIR$1, CONFIG_FILE);
|
|
6639
6646
|
}
|
|
@@ -6725,4 +6732,4 @@ async function readPoConfigSourcesAsync(fs, fileName, repoRoot, context, homeDir
|
|
|
6725
6732
|
return sources;
|
|
6726
6733
|
}
|
|
6727
6734
|
//#endregion
|
|
6728
|
-
export {
|
|
6735
|
+
export { YAMLMap as _, globalPoConfigDirectory as a, isSeq as b, repositoryConfigFor as c, configScopeOf as d, parsePoConfig as f, Document as g, stringify as h, defaultPoConfig as i, repositoryPoConfigPath as l, parseDocument as m, poConfigCandidates as n, globalPoConfigPath as o, parse as p, configFromText as r, mergeConfigLayers as s, readPoConfigSourcesAsync as t, resolvePlanningPlansDirectory as u, isMap as v, isScalar as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { l as nodeHost, p as getOrThrow } from "./serverPlugin-pCqlBqQG.js";
|
|
2
|
-
import {
|
|
2
|
+
import { i as readTextIfExists } from "./platformFiles-Ccj9HCvA.js";
|
|
3
3
|
import "./platform-CyvF7X-b.js";
|
|
4
|
-
import { t as readPoConfigSourcesAsync } from "./layeredConfig-
|
|
4
|
+
import { t as readPoConfigSourcesAsync } from "./layeredConfig-B4s0eZ5o.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
//#region ../../foundations/po-config/src/services/majorModes/core.ts
|
|
7
7
|
const MODES_FILE = "modes.yaml";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./majorModes-IygGmbb8.js";
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Et as String, It as Literal, Qt as _Object_, en as Optional, wt as Union } from "./serverPlugin-pCqlBqQG.js";
|
|
2
|
+
import { n as Check } from "./value-DGT5IoiK.js";
|
|
3
|
+
//#region ../../core/po-core/src/schemas/notification.ts
|
|
4
|
+
/** Provider-owned Cordis service for caller-authored notification requests. */
|
|
5
|
+
const PO_NOTIFICATION_SERVICE = "po/notification";
|
|
6
|
+
/** Custom session entry type used to publish normalized notification data. */
|
|
7
|
+
const PO_NOTIFICATION_ENTRY_TYPE = "po-notification";
|
|
8
|
+
const MAX_PO_NOTIFICATION_BODY_CHARACTERS = 4096;
|
|
9
|
+
const PoNotificationLevelSchema = Union([
|
|
10
|
+
Literal("info"),
|
|
11
|
+
Literal("warning"),
|
|
12
|
+
Literal("error")
|
|
13
|
+
]);
|
|
14
|
+
/** The person must act on this notice; the host may push it to paired devices. Other notices stay in-app. */
|
|
15
|
+
const PoNotificationAttentionSchema = Optional(Literal(true));
|
|
16
|
+
_Object_({
|
|
17
|
+
title: Optional(String({
|
|
18
|
+
minLength: 1,
|
|
19
|
+
maxLength: 128
|
|
20
|
+
})),
|
|
21
|
+
subtitle: Optional(String({
|
|
22
|
+
minLength: 1,
|
|
23
|
+
maxLength: 256
|
|
24
|
+
})),
|
|
25
|
+
body: String({
|
|
26
|
+
minLength: 1,
|
|
27
|
+
maxLength: MAX_PO_NOTIFICATION_BODY_CHARACTERS
|
|
28
|
+
}),
|
|
29
|
+
level: Optional(PoNotificationLevelSchema),
|
|
30
|
+
attention: PoNotificationAttentionSchema
|
|
31
|
+
}, { additionalProperties: false });
|
|
32
|
+
const NormalizablePoNotificationRequestSchema = _Object_({
|
|
33
|
+
title: Optional(String()),
|
|
34
|
+
subtitle: Optional(String()),
|
|
35
|
+
body: String(),
|
|
36
|
+
level: Optional(PoNotificationLevelSchema),
|
|
37
|
+
attention: PoNotificationAttentionSchema
|
|
38
|
+
}, { additionalProperties: false });
|
|
39
|
+
_Object_({
|
|
40
|
+
version: Literal(1),
|
|
41
|
+
title: String({ maxLength: 128 }),
|
|
42
|
+
subtitle: String({ maxLength: 256 }),
|
|
43
|
+
body: String({
|
|
44
|
+
minLength: 1,
|
|
45
|
+
maxLength: MAX_PO_NOTIFICATION_BODY_CHARACTERS
|
|
46
|
+
}),
|
|
47
|
+
level: PoNotificationLevelSchema,
|
|
48
|
+
attention: PoNotificationAttentionSchema
|
|
49
|
+
}, { additionalProperties: false });
|
|
50
|
+
function replaceControlCharacters(text) {
|
|
51
|
+
return Array.from(text, (character) => {
|
|
52
|
+
const codePoint = character.codePointAt(0);
|
|
53
|
+
return codePoint !== void 0 && (codePoint < 32 || codePoint === 127) ? " " : character;
|
|
54
|
+
}).join("");
|
|
55
|
+
}
|
|
56
|
+
function normalizeText(text, maximum) {
|
|
57
|
+
const normalized = replaceControlCharacters(text).replace(/\s+/gu, " ").trim();
|
|
58
|
+
if (!normalized) return void 0;
|
|
59
|
+
let truncated = "";
|
|
60
|
+
for (const character of normalized) {
|
|
61
|
+
if (truncated.length + character.length > maximum) break;
|
|
62
|
+
truncated += character;
|
|
63
|
+
}
|
|
64
|
+
return truncated;
|
|
65
|
+
}
|
|
66
|
+
/** Normalize caller-owned notification text into a validated request. */
|
|
67
|
+
function normalizePoNotificationRequest(request) {
|
|
68
|
+
if (!Check(NormalizablePoNotificationRequestSchema, request)) return void 0;
|
|
69
|
+
const body = normalizeText(request.body, MAX_PO_NOTIFICATION_BODY_CHARACTERS);
|
|
70
|
+
if (!body) return void 0;
|
|
71
|
+
const title = request.title && normalizeText(request.title, 128);
|
|
72
|
+
const subtitle = request.subtitle && normalizeText(request.subtitle, 256);
|
|
73
|
+
const normalized = {
|
|
74
|
+
body,
|
|
75
|
+
...title ? { title } : {},
|
|
76
|
+
...subtitle ? { subtitle } : {},
|
|
77
|
+
...request.level ? { level: request.level } : {},
|
|
78
|
+
...request.attention ? { attention: true } : {}
|
|
79
|
+
};
|
|
80
|
+
return Object.freeze(normalized);
|
|
81
|
+
}
|
|
82
|
+
/** Builds normalized, versioned data for a Po notification session entry. */
|
|
83
|
+
function createPoNotificationEntryData(request) {
|
|
84
|
+
const normalized = normalizePoNotificationRequest(request);
|
|
85
|
+
if (!normalized) return void 0;
|
|
86
|
+
return Object.freeze({
|
|
87
|
+
version: 1,
|
|
88
|
+
title: normalized.title ?? "",
|
|
89
|
+
subtitle: normalized.subtitle ?? "",
|
|
90
|
+
body: normalized.body,
|
|
91
|
+
level: normalized.level ?? "info",
|
|
92
|
+
...normalized.attention ? { attention: true } : {}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function readPoNotificationService(context) {
|
|
96
|
+
return context.get(PO_NOTIFICATION_SERVICE);
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { createPoNotificationEntryData as n, readPoNotificationService as r, PO_NOTIFICATION_ENTRY_TYPE as t };
|