@agimon-ai/po-cloudflare 0.0.2-alpha.7 → 0.0.2-alpha.8
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/assets/plugins/compositions.json +1 -1
- package/dist/{exports-LjvSY7Y6.js → exports-Bp6JO2RF.js} +1 -1
- package/dist/{index.edge-BgSx_gRO.js → index.edge-C72-ZBgp.js} +2 -2
- package/dist/{server-BpPEzRes.js → server-BnPO3PNs.js} +66 -14
- package/dist/{server-BWJmxCrm.js → server-Bp-WHVdj.js} +2 -2
- package/dist/{server-CWg0m_wq.js → server-C2i_CX3S.js} +2 -2
- package/dist/{server-5hLs7M43.js → server-C5wmZnJc.js} +1 -1
- package/dist/{server-Y5A21sJf.js → server-CSf4-zya.js} +1 -1
- package/dist/{server-a1K226XK.js → server-DB615aaR.js} +1 -1
- package/dist/{server-Dv0EKLwc.js → server-TsVQJqi8.js} +1 -1
- package/dist/{sessionConfig-DgnPcGBu.js → sessionConfig-CQHZcOsg.js} +87 -16
- package/dist/worker.js +21 -21
- package/package.json +22 -22
- /package/dist/assets/plugins/slots/{approval.09e72f36-DwFz-UMh.js → approval.3e4ea6e4-DwFz-UMh.js} +0 -0
- /package/dist/assets/plugins/slots/{artifacts.50b639bb-CUtFC806.js → artifacts.84980c32-CUtFC806.js} +0 -0
- /package/dist/assets/plugins/slots/{builtin-tools.75108f21-B69GLfY_.js → builtin-tools.16ef5e25-B69GLfY_.js} +0 -0
- /package/dist/assets/plugins/slots/{codemode.c58fb583-C0Gmb7_s.js → codemode.5f359b9c-C0Gmb7_s.js} +0 -0
- /package/dist/assets/plugins/slots/{domain.753f9f92-BTBYRLkE.js → domain.832848c8-BTBYRLkE.js} +0 -0
- /package/dist/assets/plugins/slots/{mcp.82cc1ff5-Ecacjn0a.js → mcp.ea8b6aa2-Ecacjn0a.js} +0 -0
- /package/dist/assets/plugins/slots/{profile.ab16dcec-DIVXNHmh.js → profile.63bc3ae6-DIVXNHmh.js} +0 -0
- /package/dist/assets/plugins/slots/{skill.62a0a1b3-BNr7DmPH.js → skill.56c1cc07-BNr7DmPH.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"global":{"id":"
|
|
1
|
+
{"global":{"id":"317f31ef39c70de89c7f12358acddc604c139c2fe88a917a44ffefc5c7164aaf","scope":"global","revision":1,"manifestUrl":"/plugins/compositions.json","rawAssetBaseUrl":"/plugins","verifiedAssetBaseUrl":"/plugins","pluginEntries":[["approval.3e4ea6e4","/slots/approval.3e4ea6e4-DwFz-UMh.js"],["artifacts.84980c32","/slots/artifacts.84980c32-CUtFC806.js"],["builtin-tools.16ef5e25","/slots/builtin-tools.16ef5e25-B69GLfY_.js"],["codemode.5f359b9c","/slots/codemode.5f359b9c-C0Gmb7_s.js"],["domain.832848c8","/slots/domain.832848c8-BTBYRLkE.js"],["mcp.ea8b6aa2","/slots/mcp.ea8b6aa2-Ecacjn0a.js"],["profile.63bc3ae6","/slots/profile.63bc3ae6-DIVXNHmh.js"],["skill.56c1cc07","/slots/skill.56c1cc07-BNr7DmPH.js"]],"assetPaths":["/slots/approval.3e4ea6e4-DwFz-UMh.js","/chunks/po-web-runtime-4JiBsb_c.js","/assets/base-DyDpY0zD.css","/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2","/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2","/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2","/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2","/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2","/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2","/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2","/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2","/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2","/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2","/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2","/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2","/slots/artifacts.84980c32-CUtFC806.js","/slots/builtin-tools.16ef5e25-B69GLfY_.js","/slots/codemode.5f359b9c-C0Gmb7_s.js","/slots/domain.832848c8-BTBYRLkE.js","/slots/mcp.ea8b6aa2-Ecacjn0a.js","/slots/profile.63bc3ae6-DIVXNHmh.js","/slots/skill.56c1cc07-BNr7DmPH.js"],"stylePaths":["/assets/base-DyDpY0zD.css"],"channels":["approval_activity","artifacts"],"plugins":["approval.3e4ea6e4","artifacts.84980c32","builtin-tools.16ef5e25","codemode.5f359b9c","domain.832848c8","mcp.ea8b6aa2","profile.63bc3ae6","skill.56c1cc07"]},"workspace":{"id":"317f31ef39c70de89c7f12358acddc604c139c2fe88a917a44ffefc5c7164aaf","scope":"workspace","revision":1,"manifestUrl":"/plugins/compositions.json","rawAssetBaseUrl":"/plugins","verifiedAssetBaseUrl":"/plugins","pluginEntries":[["approval.3e4ea6e4","/slots/approval.3e4ea6e4-DwFz-UMh.js"],["artifacts.84980c32","/slots/artifacts.84980c32-CUtFC806.js"],["builtin-tools.16ef5e25","/slots/builtin-tools.16ef5e25-B69GLfY_.js"],["codemode.5f359b9c","/slots/codemode.5f359b9c-C0Gmb7_s.js"],["domain.832848c8","/slots/domain.832848c8-BTBYRLkE.js"],["mcp.ea8b6aa2","/slots/mcp.ea8b6aa2-Ecacjn0a.js"],["profile.63bc3ae6","/slots/profile.63bc3ae6-DIVXNHmh.js"],["skill.56c1cc07","/slots/skill.56c1cc07-BNr7DmPH.js"]],"assetPaths":["/slots/approval.3e4ea6e4-DwFz-UMh.js","/chunks/po-web-runtime-4JiBsb_c.js","/assets/base-DyDpY0zD.css","/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2","/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2","/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2","/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2","/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2","/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2","/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2","/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2","/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2","/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2","/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2","/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2","/slots/artifacts.84980c32-CUtFC806.js","/slots/builtin-tools.16ef5e25-B69GLfY_.js","/slots/codemode.5f359b9c-C0Gmb7_s.js","/slots/domain.832848c8-BTBYRLkE.js","/slots/mcp.ea8b6aa2-Ecacjn0a.js","/slots/profile.63bc3ae6-DIVXNHmh.js","/slots/skill.56c1cc07-BNr7DmPH.js"],"stylePaths":["/assets/base-DyDpY0zD.css"],"channels":["approval_activity","artifacts"],"plugins":["approval.3e4ea6e4","artifacts.84980c32","builtin-tools.16ef5e25","codemode.5f359b9c","domain.832848c8","mcp.ea8b6aa2","profile.63bc3ae6","skill.56c1cc07"]},"session":{"id":"317f31ef39c70de89c7f12358acddc604c139c2fe88a917a44ffefc5c7164aaf","scope":"session","revision":1,"manifestUrl":"/plugins/compositions.json","rawAssetBaseUrl":"/plugins","verifiedAssetBaseUrl":"/plugins","pluginEntries":[["approval.3e4ea6e4","/slots/approval.3e4ea6e4-DwFz-UMh.js"],["artifacts.84980c32","/slots/artifacts.84980c32-CUtFC806.js"],["builtin-tools.16ef5e25","/slots/builtin-tools.16ef5e25-B69GLfY_.js"],["codemode.5f359b9c","/slots/codemode.5f359b9c-C0Gmb7_s.js"],["domain.832848c8","/slots/domain.832848c8-BTBYRLkE.js"],["mcp.ea8b6aa2","/slots/mcp.ea8b6aa2-Ecacjn0a.js"],["profile.63bc3ae6","/slots/profile.63bc3ae6-DIVXNHmh.js"],["skill.56c1cc07","/slots/skill.56c1cc07-BNr7DmPH.js"]],"assetPaths":["/slots/approval.3e4ea6e4-DwFz-UMh.js","/chunks/po-web-runtime-4JiBsb_c.js","/assets/base-DyDpY0zD.css","/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2","/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2","/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2","/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2","/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2","/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2","/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2","/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2","/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2","/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2","/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2","/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2","/slots/artifacts.84980c32-CUtFC806.js","/slots/builtin-tools.16ef5e25-B69GLfY_.js","/slots/codemode.5f359b9c-C0Gmb7_s.js","/slots/domain.832848c8-BTBYRLkE.js","/slots/mcp.ea8b6aa2-Ecacjn0a.js","/slots/profile.63bc3ae6-DIVXNHmh.js","/slots/skill.56c1cc07-BNr7DmPH.js"],"stylePaths":["/assets/base-DyDpY0zD.css"],"channels":["approval_activity","artifacts"],"plugins":["approval.3e4ea6e4","artifacts.84980c32","builtin-tools.16ef5e25","codemode.5f359b9c","domain.832848c8","mcp.ea8b6aa2","profile.63bc3ae6","skill.56c1cc07"]}}
|
|
@@ -2,7 +2,7 @@ import { s as createSerialRunner } from "./serverPlugin-DUc4gGep.js";
|
|
|
2
2
|
import "./platform-Bs2_X_dK.js";
|
|
3
3
|
import "./atomicJson-wczZBXQP.js";
|
|
4
4
|
import "./layeredConfig-xmTHGrw8.js";
|
|
5
|
-
import "./sessionConfig-
|
|
5
|
+
import "./sessionConfig-CQHZcOsg.js";
|
|
6
6
|
import "./domains-B6Ae4swm.js";
|
|
7
7
|
import "./majorModes-CCnwAjfF.js";
|
|
8
8
|
import "./harnessStore-Ccbia9_u.js";
|
|
@@ -16,8 +16,8 @@ var _virtual_po_bundle_default = {
|
|
|
16
16
|
"/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## 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",
|
|
17
17
|
"/bundle/po-mcp/src/prompts/help-how-to-mcp/SKILL.md": "---\nname: help-how-to-mcp\ndescription: Use Po MCP to inspect domain-scoped servers, authenticate, reload configuration, measure what server tool schemas cost in context, and troubleshoot tool availability.\n---\n\n# Use Po MCP\n\nUse MCP when a task depends on a configured external server, proxy upstream, or tool selected by the active Po domains.\n\n## Named tools and accounts\n\nMain and native child agents receive permitted direct tool names, descriptions and complete input schemas.\nUse the advertised registered name: configured entries `personal` and `work` exposing `search` become\n`personal_search` and `work_search`, even at the same endpoint. Each entry uses its own connection and\nconfigured-name credential slot. Never infer dispatch identity by splitting the prefix.\n\nChildren borrow the parent's tools. The direct connection-management tool is main-agent-only;\nborrowed trusted `exec` still binds to the parent's session. `mcp` and `mcp_use` requests\nexpand into permitted direct tools; configured-server or `server/tool` selectors narrow access.\nCapability ceilings require explicit MCP permission and still constrain exact tool grants.\n\n## Po MCP namespace\n\nCode mode's `mcp` namespace is taught by the `codemode-how-to-mcp` skill, which is always\nactive. Pi's internal MCP codemode and tool search remain disabled. These are separate\nmechanisms, also distinct from code mode run by a remote MCP client. While code mode is\nbound, the main agent's direct tools for these servers are withdrawn (Context lists them as\ninactive) and only an MCP App's tool stays direct. Without code mode every direct tool and the\n`mcp_use` compatibility route remain. The namespace does not change MCP access grants.\n\n## Remote MCP connection\n\nThis connection already belongs to one Po session. Use the tools actually\nexposed by its selected domains. Prefer a named upstream tool with its declared\nschema. Use `mcp_use` only when the server name, tool name, and arguments have\nbeen discovered from a trusted catalog; never guess them.\n\nThe commands below are local Po interfaces, not Bash commands or MCP tools.\nIf status, authentication, or reload is not exposed, explain which local action\nthe user needs to take. Do not read private credentials or create another session\nto work around an unavailable capability. Tool/resource support in a packaged\nChatGPT plugin does not establish support in this MCP connection.\n\n## Local Po: inspect and operate\n\n- Run `/mcp` for the interactive overlay.\n- Run `/mcp status` to inspect configured servers, connection state, and diagnostics.\n- Run `/mcp auth <server>` when a server requires OAuth authorization.\n- Run `/mcp reload` after changing MCP configuration.\n\nThe web Context panel also offers authorization and management actions. Headless hosts never open a desktop browser automatically; use the provider link in Context or the reported authorization URL.\n\n## Test a URL server without saving it\n\nAsk the person for permission before connecting. Help mode is not approval.\nIn Help mode, discover `mcpTest` and call `await mcpTest.add({name, url, type: 'http'})`\n(or `type: 'sse'`). Optional headers and OAuth client settings use the discovered schema.\nNever paste literal secrets into tool arguments or code: conversation history can persist them.\nUse `${ENV_VAR}` references from the admitted session environment for sensitive settings.\nIn configured servers, prefer `${vault:NAME}` references in header values, env values and\n`bearerToken`. Agents never write secret values: ask the person to enter a missing secret in the\nsession MCP panel (\"needs secret NAME\").\nWithout code mode, use the main-agent-only `mcp_test_server` tool with `action: 'add'` and `server`.\n\nAdd waits for connection and OAuth completion. If sign-in is needed, ask the person to open\nthe MCP servers panel and follow its link. Use a long enough `exec` timeout or a background\nexec for browser sign-in. Cancellation removes the unfinished addition. Never paste secrets\nor authorization codes into the conversation.\n\n`mcpTest.list()` lists only session-added servers. `mcpTest.remove(name)` disconnects one and\nforgets its memory credentials. Entries, headers and credentials never go into MCP config,\nthe Po vault, credential files or the shared definitions cache. Reload retains them; ending the\nsession forgets them. Turning Help off hides management but leaves already-added servers\nconnected. MCP disabled with `--no-mcp` remains disabled. No stdio or `/mcp add` is supported.\n\n## Inspect schema cost and domain selection\n\nPermitted direct tools contribute names, descriptions and full input schemas to native child model context, and to the main agent's unless code mode is bound (then only MCP Apps' tools do). Context shows the active declarations and estimated schema cost; a withdrawn tool shows as inactive.\n\n- Run `po --explain` to inspect per-server schema estimates. Figures come from a real handshake and are cached, so the first run for a new server descriptor is slower than later ones.\n- Compare declarations with `po --domains <name[,name...]> --explain`.\n- Control server availability with an `mcp.servers` allowlist in `.po/domains.yaml` rather than deleting servers from `.mcp.json`, which keeps them available to other domains.\n\nKeep catalogs out of prompt prose and narrow child subsets. Filtering activates only when every selected domain declares `mcp`. A selection that mixes an allowlisted domain with one that omits `mcp` stays unfiltered.\n\n## Troubleshoot missing tools\n\n1. Confirm the server exists in repository `.mcp.json`, a valid Agent Plugin `mcp.json`, or `mcp-config.yaml` for proxy upstreams.\n2. Confirm the active `.po/domains.yaml` selection permits the direct server or proxy upstream.\n3. Check `/mcp status` diagnostics before changing configuration.\n4. Reload after a valid change, then confirm the tool catalog again.\n5. If Po was launched with `--no-mcp`, keep MCP disabled unless the user explicitly starts a new session without that flag.\n\nDomain filtering happens before disallowed stdio processes are spawned. Treat allowed stdio configuration as executable code because it runs with the Pi process environment and operating-system privileges. Keep OAuth stores and emitted configuration private.\n\n## Session file transfer\n\nUse advertised `share_file({path})` for a short-lived public link to a session file,\nnot an absolute host path as an attachment. It needs remote access and returns\nURL, file name, MIME, size, expiry, and a three-download limit without a consent\nprompt. Outbound file parameters to other MCP servers still ask consent.\n\n`save_file` accepts exactly one `file` form: a public HTTPS\n`{download_url,file_name,file_id?,mime_type?}` (25 MiB maximum), or\n`{name,data_base64}` (5 MiB decoded maximum). Default storage is private session\nattachments. Optional relative `path` writes a new file in the bound cwd through\nexisting non-symlink parents, never overwriting. This mode assumes no hostile\nconcurrent workspace mutation; portable identity rechecks are not atomic against\nancestor swaps. Failed cwd writes truncate owned bytes but may leave an empty\nprivate file that must be removed before retry.\n",
|
|
18
18
|
"/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
|
-
"/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` and `
|
|
20
|
-
"/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`, and `integration` are allowed. Both are validated exactly like an\nexplicit entry. `env` cannot contain `${secret.` or `${secrets.` aliases. 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`, and optional `integration`. `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 secret declares `purposes`, a nonempty unique subset of `browser`, `proxy`, and `env`, defaulting\nto `[browser]`:\n\n- `browser`: `${secrets.PASSWORD}` is filled host-side by the bound 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\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## 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",
|
|
19
|
+
"/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\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
|
+
"/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",
|
|
21
21
|
"/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
22
|
"/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
23
|
};
|
|
@@ -2,12 +2,12 @@ import { $ as PO_SQLITE_SERVICE, $t as Optional, B as isPoHeadlessPromptAdmissio
|
|
|
2
2
|
import { n as Check } from "./value-Bd477RDX.js";
|
|
3
3
|
import { m as jsonApiResponses, t as defineApiContract } from "./apiContracts-sG5b90Qa.js";
|
|
4
4
|
import { c as defineRoute, f as defineServerPlugin, i as defineHook, l as defineRoutedContribution, n as composeRootInjects, o as defineResource, p as runCleanups, s as defineRoot, t as composeRootHooks } from "./extensionFile-CacKVegY.js";
|
|
5
|
-
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-
|
|
5
|
+
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-C72-ZBgp.js";
|
|
6
6
|
import { o as PO_PROFILE_IDENTITY_ENTRY_TYPE } from "./contextProjection-DDIQRgN4.js";
|
|
7
7
|
import "./platform-Bs2_X_dK.js";
|
|
8
8
|
import "./piSettings-B6fsgIBA.js";
|
|
9
|
-
import { a as buildPersonaPrompt, c as parseProfileBinding, i as loadProfilesAsync, o as loadProfiles, s as inlineProfile } from "./sessionConfig-
|
|
10
|
-
import "./exports-
|
|
9
|
+
import { a as buildPersonaPrompt, c as parseProfileBinding, i as loadProfilesAsync, l as parseProfileVaultSecrets, o as loadProfiles, s as inlineProfile } from "./sessionConfig-CQHZcOsg.js";
|
|
10
|
+
import "./exports-Bp6JO2RF.js";
|
|
11
11
|
import { i as readPoCodemode, n as PO_CODEMODE_SERVICE } from "./codemode-CFVDmyGm.js";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
//#region ../../foundations/po-profile/src/constants/profileMemory.ts
|
|
@@ -767,10 +767,14 @@ var SessionProfileRuntime = class {
|
|
|
767
767
|
capture(profileName, generation) {
|
|
768
768
|
const binding = profileName === void 0 ? void 0 : this.options.readBinding(profileName);
|
|
769
769
|
const env = profileName === void 0 ? void 0 : this.options.readEnv?.(profileName);
|
|
770
|
+
const sourceSecrets = profileName === void 0 ? void 0 : this.options.readSecrets?.(profileName);
|
|
771
|
+
const secrets = sourceSecrets === void 0 ? void 0 : parseProfileVaultSecrets(sourceSecrets);
|
|
772
|
+
if (secrets && Object.keys(secrets).some((name) => binding?.secrets && Object.hasOwn(binding.secrets, name))) throw new Error("Profile secret aliases must be unique");
|
|
770
773
|
return Object.freeze({
|
|
771
774
|
...profileName === void 0 ? {} : { profileName },
|
|
772
775
|
...binding === void 0 ? {} : { integration: parseProfileBinding(binding) },
|
|
773
776
|
...env === void 0 ? {} : { env: Object.freeze({ ...env }) },
|
|
777
|
+
...secrets === void 0 ? {} : { secrets },
|
|
774
778
|
generation,
|
|
775
779
|
signal: this.controller.signal
|
|
776
780
|
});
|
|
@@ -886,6 +890,11 @@ var SessionProfileRuntime = class {
|
|
|
886
890
|
if (!reference.allowedOrigins.includes(request.origin)) throw new Error("Profile secret origin is not allowed");
|
|
887
891
|
});
|
|
888
892
|
}
|
|
893
|
+
resolveInputSecret(name, request) {
|
|
894
|
+
return this.resolveReference(name, request.signal, (reference) => {
|
|
895
|
+
if (!reference.purposes.includes("input") || !reference.allowedTargets || !Object.hasOwn(reference.allowedTargets, request.surface) || !reference.allowedTargets[request.surface]?.includes(request.target)) throw new Error("Profile secret input target is not allowed");
|
|
896
|
+
});
|
|
897
|
+
}
|
|
889
898
|
resolveProxySecret(signal) {
|
|
890
899
|
const name = this.snapshot.integration?.browser?.proxySecret;
|
|
891
900
|
if (name === void 0) return Promise.reject(/* @__PURE__ */ new Error("Profile proxy is not configured"));
|
|
@@ -898,14 +907,26 @@ var SessionProfileRuntime = class {
|
|
|
898
907
|
await this.ready();
|
|
899
908
|
const snapshot = this.snapshot;
|
|
900
909
|
const connection = this.connection;
|
|
901
|
-
const
|
|
902
|
-
|
|
910
|
+
const vaultReference = snapshot.secrets && Object.hasOwn(snapshot.secrets, name) ? snapshot.secrets[name] : void 0;
|
|
911
|
+
const providerReference = snapshot.integration?.secrets && Object.hasOwn(snapshot.integration.secrets, name) ? snapshot.integration.secrets[name] : void 0;
|
|
912
|
+
const reference = vaultReference ?? providerReference;
|
|
913
|
+
if (!reference) throw new Error("Profile secret alias is unavailable");
|
|
903
914
|
authorize(reference);
|
|
904
915
|
const signal = requestSignal ? AbortSignal.any([snapshot.signal, requestSignal]) : snapshot.signal;
|
|
905
916
|
if (signal.aborted) throw new Error(INVALIDATED);
|
|
906
917
|
let value;
|
|
907
918
|
try {
|
|
908
|
-
|
|
919
|
+
if (vaultReference) {
|
|
920
|
+
if (!this.options.readVault) throw new Error("Vault unavailable");
|
|
921
|
+
const { namespace, key, field } = vaultReference.vault;
|
|
922
|
+
const entry = await this.options.readVault(namespace, key, signal);
|
|
923
|
+
const selected = field === void 0 ? entry : typeof entry === "object" && entry !== null && !Array.isArray(entry) && Object.hasOwn(entry, field) ? entry[field] : void 0;
|
|
924
|
+
if (typeof selected !== "string") throw new Error("Vault field unavailable");
|
|
925
|
+
value = selected;
|
|
926
|
+
} else {
|
|
927
|
+
if (!connection || !providerReference) throw new Error("Provider unavailable");
|
|
928
|
+
value = await connection.resolveSecret(providerReference, signal);
|
|
929
|
+
}
|
|
909
930
|
} catch {
|
|
910
931
|
throw new Error("Profile secret resolution failed");
|
|
911
932
|
}
|
|
@@ -1098,14 +1119,16 @@ function profileSessionState(context) {
|
|
|
1098
1119
|
}
|
|
1099
1120
|
//#endregion
|
|
1100
1121
|
//#region ../../foundations/po-profile/src/extensions/workspaces/sessions/(backend)/root.server.ts
|
|
1101
|
-
var root_server_default = defineRoot(({ agent, host, signal, context }) => {
|
|
1122
|
+
var root_server_default = defineRoot(async ({ agent, host, signal, context }) => {
|
|
1102
1123
|
if (!agent) return { value: void 0 };
|
|
1103
1124
|
const execution = agent.context;
|
|
1104
1125
|
const scope = { workspaceId: host.context.workspaceId };
|
|
1105
1126
|
const state = profileSessionState(context);
|
|
1106
|
-
const homeDirectory =
|
|
1107
|
-
|
|
1108
|
-
const
|
|
1127
|
+
const homeDirectory = host.context.homeDirectory ?? execution.environment.HOME;
|
|
1128
|
+
if (!homeDirectory) throw new Error("Profile session requires a host home directory.");
|
|
1129
|
+
const loadFiles = () => loadProfilesAsync(requirePoFs(context), execution.repoRoot, BACKGROUND_CONTEXT, homeDirectory);
|
|
1130
|
+
let files = await loadFiles();
|
|
1131
|
+
const readProfile = (profileName) => findProfile(files, readProfileSources(context, scope), profileName);
|
|
1109
1132
|
const handoff = readInitialProfileOutcome(context);
|
|
1110
1133
|
let publishOutcome;
|
|
1111
1134
|
const applyHandoff = (selection, outcome) => {
|
|
@@ -1115,7 +1138,7 @@ var root_server_default = defineRoot(({ agent, host, signal, context }) => {
|
|
|
1115
1138
|
...selection,
|
|
1116
1139
|
profile: void 0
|
|
1117
1140
|
};
|
|
1118
|
-
if (mergeProfiles(
|
|
1141
|
+
if (mergeProfiles(files, readProfileSources(context, scope)).some((profile) => profile.name === name)) return {
|
|
1119
1142
|
...selection,
|
|
1120
1143
|
profile: name
|
|
1121
1144
|
};
|
|
@@ -1133,7 +1156,7 @@ var root_server_default = defineRoot(({ agent, host, signal, context }) => {
|
|
|
1133
1156
|
kind: "named",
|
|
1134
1157
|
name: selection.profile
|
|
1135
1158
|
};
|
|
1136
|
-
const outcome = await resolveInitialProfile(
|
|
1159
|
+
const outcome = await resolveInitialProfile(files, readProfileSources(context, scope), {
|
|
1137
1160
|
intent,
|
|
1138
1161
|
scope,
|
|
1139
1162
|
signal
|
|
@@ -1146,13 +1169,29 @@ var root_server_default = defineRoot(({ agent, host, signal, context }) => {
|
|
|
1146
1169
|
};
|
|
1147
1170
|
};
|
|
1148
1171
|
const unregisterResolver = agent.registerInitialSelectionResolver((selection) => handoff === void 0 ? resolveStartup(selection) : applyHandoff(selection, handoff));
|
|
1172
|
+
let vaultBinding;
|
|
1149
1173
|
const runtime = createProfileRuntime({
|
|
1150
1174
|
readBinding: (profileName) => readProfile(profileName).integration,
|
|
1151
|
-
readEnv: (profileName) => readProfile(profileName).env
|
|
1175
|
+
readEnv: (profileName) => readProfile(profileName).env,
|
|
1176
|
+
readSecrets: (profileName) => readProfile(profileName).secrets,
|
|
1177
|
+
readVault: async (namespace, key, requestSignal) => {
|
|
1178
|
+
requestSignal.throwIfAborted();
|
|
1179
|
+
const binding = vaultBinding;
|
|
1180
|
+
if (!binding?.active) throw new Error("Profile vault is unavailable");
|
|
1181
|
+
const record = await binding.provider.get(namespace, key);
|
|
1182
|
+
requestSignal.throwIfAborted();
|
|
1183
|
+
if (!binding.active) throw new Error("Profile vault is unavailable");
|
|
1184
|
+
return record?.value;
|
|
1185
|
+
}
|
|
1152
1186
|
});
|
|
1153
1187
|
const unsubscribe = agent.subscribeSelection(async (selection, applied) => {
|
|
1154
1188
|
try {
|
|
1155
|
-
|
|
1189
|
+
const force = applied?.refresh?.includes("profile") === true;
|
|
1190
|
+
if (force) {
|
|
1191
|
+
runtime.invalidate();
|
|
1192
|
+
files = await loadFiles();
|
|
1193
|
+
}
|
|
1194
|
+
await runtime.select(selection.profile, { force });
|
|
1156
1195
|
} catch (error) {
|
|
1157
1196
|
throw new PoHeadlessPromptAdmissionError(error);
|
|
1158
1197
|
}
|
|
@@ -1165,6 +1204,19 @@ var root_server_default = defineRoot(({ agent, host, signal, context }) => {
|
|
|
1165
1204
|
value: runtime,
|
|
1166
1205
|
services: [
|
|
1167
1206
|
createProfileRuntimePlugin(runtime),
|
|
1207
|
+
(serviceContext) => {
|
|
1208
|
+
serviceContext.inject(["po/vault"], (injected) => {
|
|
1209
|
+
const binding = {
|
|
1210
|
+
provider: injected.get("po/vault"),
|
|
1211
|
+
active: true
|
|
1212
|
+
};
|
|
1213
|
+
vaultBinding = binding;
|
|
1214
|
+
return () => {
|
|
1215
|
+
binding.active = false;
|
|
1216
|
+
if (vaultBinding === binding) vaultBinding = void 0;
|
|
1217
|
+
};
|
|
1218
|
+
});
|
|
1219
|
+
},
|
|
1168
1220
|
(serviceContext) => {
|
|
1169
1221
|
if (handoff !== void 0) return;
|
|
1170
1222
|
serviceContext.provide(PROFILE_INITIAL_OUTCOME_SERVICE, void 0);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Jn as BACKGROUND_CONTEXT, Xn as withAbortSignal, it as requirePoFs, q as composeServerProviderOverrides } from "./serverPlugin-DUc4gGep.js";
|
|
2
2
|
import { f as defineServerPlugin, l as defineRoutedContribution, n as composeRootInjects, o as defineResource, s as defineRoot, t as composeRootHooks } from "./extensionFile-CacKVegY.js";
|
|
3
|
-
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-
|
|
3
|
+
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-C72-ZBgp.js";
|
|
4
4
|
import { a as readPoNotificationService, n as createPoTelemetryService } from "./notification-valMY1zH.js";
|
|
5
5
|
import "./platform-Bs2_X_dK.js";
|
|
6
|
-
import { n as providePoConfigContext, r as createSettingsApi, t as createNativePoConfigContext } from "./sessionConfig-
|
|
6
|
+
import { n as providePoConfigContext, r as createSettingsApi, t as createNativePoConfigContext } from "./sessionConfig-CQHZcOsg.js";
|
|
7
7
|
import { a as createPoMcpProjectionService, i as createDisabledPoMcpProjection, n as PO_MCP_PROJECTION_SERVICE, o as isPoMcpProjection } from "./mcpProjection-BXiECnW0.js";
|
|
8
8
|
//#region ../../core/po-core/src/schemas/readiness.ts
|
|
9
9
|
/** Cordis service name for session-scoped package initialization. */
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $t as Optional, H as readPoHeadlessHost, It as Integer, Jn as BACKGROUND_CONTEXT, Q as PO_SHELL_SERVICE, Tt as String$1, X as PO_BROWSER_SERVICE, Xn as withAbortSignal, Zt as _Object_, er as PO_SERVER_SCOPE_SERVICE, et as readPoBrowser, f as getOrThrow, n as PO_SESSION_FILES_SERVICE, nr as requirePoServerScope, nt as readPoIsolate, ot as PO_CONFIG_SERVICE, q as composeServerProviderOverrides, rt as readPoNpm, tr as defineServiceContract, tt as readPoFs, z as invalidImageReason } from "./serverPlugin-DUc4gGep.js";
|
|
2
2
|
import { i as Errors, n as Check, r as Check$1 } from "./value-Bd477RDX.js";
|
|
3
3
|
import { d as defineServerTool, f as defineServerPlugin, n as composeRootInjects, o as defineResource, s as defineRoot, t as composeRootHooks } from "./extensionFile-CacKVegY.js";
|
|
4
|
-
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-
|
|
4
|
+
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-C72-ZBgp.js";
|
|
5
5
|
import { i as isUnattended, n as gateApproval, o as PO_APPROVAL_SERVICE, s as readPoApproval, t as ApprovalPendingError } from "./approval-CQ3ZuoTy.js";
|
|
6
6
|
import { i as readPoBackgroundWorkService, r as PO_BACKGROUND_WORK_SERVICE } from "./backgroundWork-CSpsJ-Rg.js";
|
|
7
7
|
import "./platform-Bs2_X_dK.js";
|
|
8
8
|
import { n as readPackageConfigurations, t as readMajorModesConfig } from "./majorModes-CCnwAjfF.js";
|
|
9
|
-
import "./exports-
|
|
9
|
+
import "./exports-Bp6JO2RF.js";
|
|
10
10
|
import { r as assertCodemodeNamespaceName, t as PO_CODEMODE_CONTRACT } from "./codemode-CFVDmyGm.js";
|
|
11
11
|
import "./majorModes-DNQbxkpt.js";
|
|
12
12
|
//#endregion
|
|
@@ -2,7 +2,7 @@ import { $t as Optional, Ct as Union, Ft as Literal, It as Integer, M as PO_HEAD
|
|
|
2
2
|
import { a as modelInputSchema, i as readPoMcpRemoteServers, n as PO_MCP_REMOTE_SERVERS_SERVICE, o as isModelVisibleMcpTool, r as connectRemoteMcpServers, s as normalizeMcpAppMetadata } from "./remoteMcp-DqE2xFWS.js";
|
|
3
3
|
import "./value-Bd477RDX.js";
|
|
4
4
|
import { c as defineRoute, d as defineServerTool, f as defineServerPlugin, l as defineRoutedContribution, n as composeRootInjects, o as defineResource, s as defineRoot, t as composeRootHooks, u as defineServerCommand } from "./extensionFile-CacKVegY.js";
|
|
5
|
-
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-
|
|
5
|
+
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-C72-ZBgp.js";
|
|
6
6
|
import { i as readPoCodemode, n as PO_CODEMODE_SERVICE } from "./codemode-CFVDmyGm.js";
|
|
7
7
|
//#region ../../default/po-mcp/src/extensions/(backend)/_lib/root.server.edge.ts
|
|
8
8
|
async function createMcpGlobalRoot(_plugin) {
|
|
@@ -2,7 +2,7 @@ import { $t as Optional, Ct as Union, Ft as Literal, It as Integer, Jn as BACKGR
|
|
|
2
2
|
import "./value-Bd477RDX.js";
|
|
3
3
|
import { r as removePath } from "./platformFiles-CCGujP9o.js";
|
|
4
4
|
import { c as defineRoute, f as defineServerPlugin, l as defineRoutedContribution, n as composeRootInjects, o as defineResource, s as defineRoot, t as composeRootHooks } from "./extensionFile-CacKVegY.js";
|
|
5
|
-
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-
|
|
5
|
+
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-C72-ZBgp.js";
|
|
6
6
|
import "./platform-Bs2_X_dK.js";
|
|
7
7
|
import "./layeredConfig-xmTHGrw8.js";
|
|
8
8
|
import "./piSettings-B6fsgIBA.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $t as Optional, Jn as BACKGROUND_CONTEXT, Tt as String$1, Xn as withAbortSignal, Zt as _Object_, c as nodeHost, f as getOrThrow, it as requirePoFs, q as composeServerProviderOverrides } from "./serverPlugin-DUc4gGep.js";
|
|
2
2
|
import { f as defineServerPlugin, l as defineRoutedContribution, n as composeRootInjects, s as defineRoot, t as composeRootHooks } from "./extensionFile-CacKVegY.js";
|
|
3
|
-
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-
|
|
3
|
+
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-C72-ZBgp.js";
|
|
4
4
|
import "./platform-Bs2_X_dK.js";
|
|
5
5
|
import { t as readHarnessState } from "./harnessState-gmzJcPGt.js";
|
|
6
6
|
//#region ../../foundations/po-skill/src/constants/skillInventory.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./serverPlugin-DUc4gGep.js";
|
|
2
2
|
import { c as defineRoute, f as defineServerPlugin, l as defineRoutedContribution, o as defineResource } from "./extensionFile-CacKVegY.js";
|
|
3
|
-
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-
|
|
3
|
+
import { n as readPackageResource, t as packageResourcePath } from "./index.edge-C72-ZBgp.js";
|
|
4
4
|
import { i as resolveLayers, r as loadMajorModesConfig } from "./majorModes-CCnwAjfF.js";
|
|
5
5
|
import "./majorModes-DNQbxkpt.js";
|
|
6
6
|
//#region ../../foundations/po-major-mode/src/extensions/workspaces/sessions/(backend)/api/major-mode/route.server.ts
|
|
@@ -868,7 +868,14 @@ const SECRET_KEYS = /* @__PURE__ */ new Set([
|
|
|
868
868
|
"credentialId",
|
|
869
869
|
"field",
|
|
870
870
|
"purposes",
|
|
871
|
-
"allowedOrigins"
|
|
871
|
+
"allowedOrigins",
|
|
872
|
+
"allowedTargets"
|
|
873
|
+
]);
|
|
874
|
+
const VAULT_SECRET_KEYS = /* @__PURE__ */ new Set([
|
|
875
|
+
"vault",
|
|
876
|
+
"purposes",
|
|
877
|
+
"allowedOrigins",
|
|
878
|
+
"allowedTargets"
|
|
872
879
|
]);
|
|
873
880
|
const BROWSER_KEYS = /* @__PURE__ */ new Set([
|
|
874
881
|
"profileName",
|
|
@@ -879,7 +886,8 @@ const BROWSER_KEYS = /* @__PURE__ */ new Set([
|
|
|
879
886
|
const PURPOSES = /* @__PURE__ */ new Set([
|
|
880
887
|
"browser",
|
|
881
888
|
"proxy",
|
|
882
|
-
"env"
|
|
889
|
+
"env",
|
|
890
|
+
"input"
|
|
883
891
|
]);
|
|
884
892
|
const BROWSER_MODES = /* @__PURE__ */ new Set([
|
|
885
893
|
"playwright",
|
|
@@ -915,7 +923,7 @@ function origins(value, location) {
|
|
|
915
923
|
}
|
|
916
924
|
function purposes(value, location) {
|
|
917
925
|
if (value === void 0) return Object.freeze(["browser"]);
|
|
918
|
-
if (!Array.isArray(value) || value.length === 0 || value.some((entry) => typeof entry !== "string" || !PURPOSES.has(entry)) || new Set(value).size !== value.length) throw new Error(`${location} must list distinct purposes: browser, proxy or
|
|
926
|
+
if (!Array.isArray(value) || value.length === 0 || value.some((entry) => typeof entry !== "string" || !PURPOSES.has(entry)) || new Set(value).size !== value.length) throw new Error(`${location} must list distinct purposes: browser, proxy, env or input`);
|
|
919
927
|
return Object.freeze([...value]);
|
|
920
928
|
}
|
|
921
929
|
function browser(value, location) {
|
|
@@ -930,6 +938,70 @@ function browser(value, location) {
|
|
|
930
938
|
...entry.proxySecret === void 0 ? {} : { proxySecret: entry.proxySecret }
|
|
931
939
|
});
|
|
932
940
|
}
|
|
941
|
+
function targets(value, forInput, location) {
|
|
942
|
+
if (value === void 0) {
|
|
943
|
+
if (forInput) throw new Error(`${location} requires explicit input targets`);
|
|
944
|
+
return;
|
|
945
|
+
}
|
|
946
|
+
if (!forInput) throw new Error(`${location} requires the input purpose`);
|
|
947
|
+
const entries = record(value, location);
|
|
948
|
+
if (Object.keys(entries).length === 0) throw new Error(`${location} requires explicit input targets`);
|
|
949
|
+
const result = Object.create(null);
|
|
950
|
+
for (const [surface, list] of Object.entries(entries)) {
|
|
951
|
+
if (!/^[a-z][a-z0-9-]{0,63}$/.test(surface) || [
|
|
952
|
+
"browser",
|
|
953
|
+
"env",
|
|
954
|
+
"proxy",
|
|
955
|
+
"constructor",
|
|
956
|
+
"prototype"
|
|
957
|
+
].includes(surface) || !Array.isArray(list) || list.length === 0 || list.some((entry) => typeof entry !== "string" || !/^[A-Za-z0-9][A-Za-z0-9_.-]{0,255}$/.test(entry))) throw new Error(`${location} must map surfaces to exact application identifiers`);
|
|
958
|
+
result[surface] = Object.freeze([...new Set(list)]);
|
|
959
|
+
}
|
|
960
|
+
return Object.freeze(result);
|
|
961
|
+
}
|
|
962
|
+
function delivery(secret, location) {
|
|
963
|
+
const secretPurposes = purposes(secret.purposes, `${location}.purposes`);
|
|
964
|
+
const forBrowser = secretPurposes.includes("browser");
|
|
965
|
+
const emptyOrigins = Array.isArray(secret.allowedOrigins) && secret.allowedOrigins.length === 0;
|
|
966
|
+
if (!forBrowser && secret.allowedOrigins !== void 0 && !emptyOrigins) throw new Error(`${location}.allowedOrigins requires the browser purpose`);
|
|
967
|
+
const allowedTargets = targets(secret.allowedTargets, secretPurposes.includes("input"), `${location}.allowedTargets`);
|
|
968
|
+
return {
|
|
969
|
+
purposes: secretPurposes,
|
|
970
|
+
allowedOrigins: forBrowser ? origins(secret.allowedOrigins, `${location}.allowedOrigins`) : Object.freeze([]),
|
|
971
|
+
...allowedTargets === void 0 ? {} : { allowedTargets }
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
/** Explicit vault aliases only. Templates never name a namespace or key themselves. */
|
|
975
|
+
function parseProfileVaultSecrets(value, location = "Profile secrets") {
|
|
976
|
+
const result = Object.create(null);
|
|
977
|
+
for (const [alias, valueEntry] of Object.entries(record(value, location))) {
|
|
978
|
+
if (!ALIAS_PATTERN.test(alias)) throw new Error(`${location} requires uppercase alias names`);
|
|
979
|
+
const secret = record(valueEntry, location, VAULT_SECRET_KEYS);
|
|
980
|
+
const vault = record(secret.vault, `${location}.vault`, /* @__PURE__ */ new Set([
|
|
981
|
+
"namespace",
|
|
982
|
+
"key",
|
|
983
|
+
"field"
|
|
984
|
+
]));
|
|
985
|
+
if (typeof vault.namespace !== "string" || !/^[a-z][a-z0-9.-]{0,63}$/.test(vault.namespace) || typeof vault.key !== "string" || vault.key.length < 1 || vault.key.length > 512 || /\p{Cc}/u.test(vault.key)) throw new Error(`${location}.vault requires a valid namespace and key`);
|
|
986
|
+
const field = vault.field === void 0 ? void 0 : reference(vault.field, `${location}.vault.field`);
|
|
987
|
+
if (field !== void 0 && ([
|
|
988
|
+
"__proto__",
|
|
989
|
+
"prototype",
|
|
990
|
+
"constructor"
|
|
991
|
+
].includes(field) || !FIELD_PATTERN.test(field))) throw new Error(`${location}.vault.field must be an own string field name`);
|
|
992
|
+
const scope = delivery(secret, location);
|
|
993
|
+
if (scope.purposes.some((purpose) => purpose !== "browser" && purpose !== "input")) throw new Error(`${location} vault aliases support browser and input purposes only`);
|
|
994
|
+
result[alias] = Object.freeze({
|
|
995
|
+
vault: Object.freeze({
|
|
996
|
+
namespace: vault.namespace,
|
|
997
|
+
key: vault.key,
|
|
998
|
+
...field === void 0 ? {} : { field }
|
|
999
|
+
}),
|
|
1000
|
+
...scope
|
|
1001
|
+
});
|
|
1002
|
+
}
|
|
1003
|
+
return Object.freeze(result);
|
|
1004
|
+
}
|
|
933
1005
|
/** Validates and deeply freezes a detached metadata snapshot. No provider SDK or secret is loaded. */
|
|
934
1006
|
function parseProfileBinding(value, location = "Profile integration") {
|
|
935
1007
|
const entry = record(value, location, BINDING_KEYS);
|
|
@@ -939,15 +1011,10 @@ function parseProfileBinding(value, location = "Profile integration") {
|
|
|
939
1011
|
if (!ALIAS_PATTERN.test(alias)) throw new Error(`${location}.secrets requires uppercase alias names`);
|
|
940
1012
|
const secret = record(value, `${location}.secrets.${alias}`, SECRET_KEYS);
|
|
941
1013
|
if (typeof secret.field !== "string" || !FIELD_PATTERN.test(secret.field)) throw new Error(`${location}.secrets.${alias}.field must be a credential field name`);
|
|
942
|
-
const secretPurposes = purposes(secret.purposes, `${location}.secrets.${alias}.purposes`);
|
|
943
|
-
const forBrowser = secretPurposes.includes("browser");
|
|
944
|
-
const emptyOrigins = Array.isArray(secret.allowedOrigins) && secret.allowedOrigins.length === 0;
|
|
945
|
-
if (!forBrowser && secret.allowedOrigins !== void 0 && !emptyOrigins) throw new Error(`${location}.secrets.${alias}.allowedOrigins requires the browser purpose`);
|
|
946
1014
|
secrets[alias] = Object.freeze({
|
|
947
1015
|
credentialId: reference(secret.credentialId, `${location}.secrets.${alias}.credentialId`),
|
|
948
1016
|
field: secret.field,
|
|
949
|
-
|
|
950
|
-
allowedOrigins: forBrowser ? origins(secret.allowedOrigins, `${location}.secrets.${alias}.allowedOrigins`) : Object.freeze([])
|
|
1017
|
+
...delivery(secret, `${location}.secrets.${alias}`)
|
|
951
1018
|
});
|
|
952
1019
|
}
|
|
953
1020
|
const browserBinding = entry.browser === void 0 ? void 0 : browser(entry.browser, `${location}.browser`);
|
|
@@ -975,7 +1042,8 @@ const PERSONA_IDENTITY_FILE = "profile.md";
|
|
|
975
1042
|
const PROFILE_KEYS = /* @__PURE__ */ new Set([
|
|
976
1043
|
"persona",
|
|
977
1044
|
"env",
|
|
978
|
-
"integration"
|
|
1045
|
+
"integration",
|
|
1046
|
+
"secrets"
|
|
979
1047
|
]);
|
|
980
1048
|
const PROFILE_CATALOG_KEYS = /* @__PURE__ */ new Set([
|
|
981
1049
|
"roots",
|
|
@@ -985,7 +1053,8 @@ const PROFILE_CATALOG_KEYS = /* @__PURE__ */ new Set([
|
|
|
985
1053
|
const SIDECAR_KEYS = /* @__PURE__ */ new Set([
|
|
986
1054
|
"version",
|
|
987
1055
|
"env",
|
|
988
|
-
"integration"
|
|
1056
|
+
"integration",
|
|
1057
|
+
"secrets"
|
|
989
1058
|
]);
|
|
990
1059
|
const SIDECAR_VERSION = 1;
|
|
991
1060
|
const SIDECAR_MAX_BYTES = 65536;
|
|
@@ -1007,7 +1076,7 @@ function parseEnvironment(name, value) {
|
|
|
1007
1076
|
const environment = {};
|
|
1008
1077
|
for (const [key, entry] of Object.entries(value)) {
|
|
1009
1078
|
if (typeof entry !== "string") throw new Error(`Profile "${name}" env.${key} must be a string`);
|
|
1010
|
-
if (
|
|
1079
|
+
if (/\$\{\s*secrets?\b|\{\{\s*secrets?\b/.test(entry)) throw new Error(`Profile "${name}" env cannot contain secret aliases`);
|
|
1011
1080
|
environment[key] = entry;
|
|
1012
1081
|
}
|
|
1013
1082
|
return environment;
|
|
@@ -1022,10 +1091,11 @@ function parseProfileSidecar(name, text) {
|
|
|
1022
1091
|
throw new Error(`Profile "${name}" ${PROFILE_SIDECAR_FILE} is not valid YAML`);
|
|
1023
1092
|
}
|
|
1024
1093
|
if (!isRecord$1(document)) throw new Error(`Profile "${name}" ${PROFILE_SIDECAR_FILE} must be a mapping`);
|
|
1025
|
-
if (Object.keys(document).some((key) => !SIDECAR_KEYS.has(key))) throw new Error(`Profile "${name}" ${PROFILE_SIDECAR_FILE} may only set version, env and
|
|
1094
|
+
if (Object.keys(document).some((key) => !SIDECAR_KEYS.has(key))) throw new Error(`Profile "${name}" ${PROFILE_SIDECAR_FILE} may only set version, env, integration and secrets`);
|
|
1026
1095
|
if (document.version !== SIDECAR_VERSION) throw new Error(`Profile "${name}" ${PROFILE_SIDECAR_FILE} must declare version: ${SIDECAR_VERSION}`);
|
|
1027
1096
|
return {
|
|
1028
1097
|
env: parseEnvironment(name, document.env),
|
|
1098
|
+
...document.secrets === void 0 ? {} : { secrets: parseProfileVaultSecrets(document.secrets) },
|
|
1029
1099
|
...document.integration === void 0 ? {} : { integration: parseProfileBinding(document.integration, `Profile "${name}" integration`) }
|
|
1030
1100
|
};
|
|
1031
1101
|
}
|
|
@@ -1073,8 +1143,7 @@ function parseProfileLayer(source) {
|
|
|
1073
1143
|
*/
|
|
1074
1144
|
function draftProfileEntry(personaRoot, configuredRoots, name, value) {
|
|
1075
1145
|
if (!isRecord$1(value)) throw new Error(`Profile "${name}" must be a mapping`);
|
|
1076
|
-
|
|
1077
|
-
if (unsupported.length > 0) throw new Error(`Profile "${name}" may only set persona, env and integration; unsupported: ${unsupported.join(", ")}`);
|
|
1146
|
+
if (Object.keys(value).filter((key) => !PROFILE_KEYS.has(key)).length > 0) throw new Error(`Profile "${name}" may only set persona, env and integration or secrets; unsupported metadata`);
|
|
1078
1147
|
if (typeof value.persona !== "string" || value.persona.trim().length === 0) throw new Error(`Profile "${name}" must set a persona`);
|
|
1079
1148
|
if (path.isAbsolute(value.persona)) throw new Error(`Profile "${name}" persona must be relative to the config that declares it`);
|
|
1080
1149
|
const persona = value.persona;
|
|
@@ -1109,6 +1178,7 @@ function profileFromDraft(draft, personaRoot, presentation) {
|
|
|
1109
1178
|
persona: draft.persona,
|
|
1110
1179
|
personaRoot,
|
|
1111
1180
|
env: parseEnvironment(name, value.env),
|
|
1181
|
+
...value.secrets === void 0 ? {} : { secrets: parseProfileVaultSecrets(value.secrets) },
|
|
1112
1182
|
...value.integration === void 0 ? {} : { integration: parseProfileBinding(value.integration, `Profile "${name}" integration`) },
|
|
1113
1183
|
...presentation
|
|
1114
1184
|
};
|
|
@@ -1169,6 +1239,7 @@ function inlineProfile(input) {
|
|
|
1169
1239
|
persona: source,
|
|
1170
1240
|
personaRoot: "",
|
|
1171
1241
|
env: parseEnvironment(name, input.env),
|
|
1242
|
+
...input.secrets === void 0 ? {} : { secrets: parseProfileVaultSecrets(input.secrets) },
|
|
1172
1243
|
...input.integration === void 0 ? {} : { integration: parseProfileBinding(input.integration, `Profile "${name}" integration`) },
|
|
1173
1244
|
...presentation,
|
|
1174
1245
|
...Object.keys(identity).length === 0 ? {} : { identity },
|
|
@@ -1744,4 +1815,4 @@ function providePoConfigContext(ctx, context, generation = `po-config:${crypto.r
|
|
|
1744
1815
|
return new PoConfigService(ctx, deepFreeze(context), loadPoConfig, generation);
|
|
1745
1816
|
}
|
|
1746
1817
|
//#endregion
|
|
1747
|
-
export { buildPersonaPrompt as a, parseProfileBinding as c, loadProfilesAsync as i, providePoConfigContext as n, loadProfiles as o, createSettingsApi as r, inlineProfile as s, createNativePoConfigContext as t };
|
|
1818
|
+
export { buildPersonaPrompt as a, parseProfileBinding as c, loadProfilesAsync as i, parseProfileVaultSecrets as l, providePoConfigContext as n, loadProfiles as o, createSettingsApi as r, inlineProfile as s, createNativePoConfigContext as t };
|
package/dist/worker.js
CHANGED
|
@@ -94085,16 +94085,16 @@ const SERVER_PACKAGES = {
|
|
|
94085
94085
|
"@agimon-ai/po-approval": () => import("./server-BhYE7Vqk.js"),
|
|
94086
94086
|
"@agimon-ai/po-artifact": () => import("./server-Cg07O2W6.js"),
|
|
94087
94087
|
"@agimon-ai/po-cache": () => import("./server-yABhJa2K.js"),
|
|
94088
|
-
"@agimon-ai/po-codemode": () => import("./server-
|
|
94089
|
-
"@agimon-ai/po-config": () => import("./server-
|
|
94090
|
-
"@agimon-ai/po-domain": () => import("./server-
|
|
94091
|
-
"@agimon-ai/po-major-mode": () => import("./server-
|
|
94092
|
-
"@agimon-ai/po-mcp": () => import("./server-
|
|
94088
|
+
"@agimon-ai/po-codemode": () => import("./server-C2i_CX3S.js"),
|
|
94089
|
+
"@agimon-ai/po-config": () => import("./server-Bp-WHVdj.js"),
|
|
94090
|
+
"@agimon-ai/po-domain": () => import("./server-CSf4-zya.js"),
|
|
94091
|
+
"@agimon-ai/po-major-mode": () => import("./server-TsVQJqi8.js"),
|
|
94092
|
+
"@agimon-ai/po-mcp": () => import("./server-C5wmZnJc.js"),
|
|
94093
94093
|
"@agimon-ai/po-minor-mode": () => import("./server-zkcrP99W.js"),
|
|
94094
94094
|
"@agimon-ai/po-notification": () => import("./server-SA0dsIJ2.js"),
|
|
94095
|
-
"@agimon-ai/po-profile": () => import("./server-
|
|
94095
|
+
"@agimon-ai/po-profile": () => import("./server-BnPO3PNs.js"),
|
|
94096
94096
|
"@agimon-ai/po-session": () => import("./server-BXjfQYeU.js"),
|
|
94097
|
-
"@agimon-ai/po-skill": () => import("./server-
|
|
94097
|
+
"@agimon-ai/po-skill": () => import("./server-DB615aaR.js"),
|
|
94098
94098
|
"@agimon-ai/po-ui": () => import("./server-B3iqBHOP.js")
|
|
94099
94099
|
};
|
|
94100
94100
|
const SESSION = ["session"];
|
|
@@ -101444,85 +101444,85 @@ var virtual_po_capabilities_default = {
|
|
|
101444
101444
|
"packages": [
|
|
101445
101445
|
{
|
|
101446
101446
|
"name": "@agimon-ai/po-approval",
|
|
101447
|
-
"version": "0.0.0-alpha.
|
|
101447
|
+
"version": "0.0.0-alpha.108",
|
|
101448
101448
|
"contractFingerprint": "2fe2af06dfdf1ea281408f3a86b7599e2409044cac334bcd4060f55dac3d6953",
|
|
101449
101449
|
"operations": []
|
|
101450
101450
|
},
|
|
101451
101451
|
{
|
|
101452
101452
|
"name": "@agimon-ai/po-artifact",
|
|
101453
|
-
"version": "0.0.0-alpha.
|
|
101453
|
+
"version": "0.0.0-alpha.107",
|
|
101454
101454
|
"contractFingerprint": "594fd017f549087206fa296d5b98fe89cccf0942a71674bfbb8dadac4d13cb38",
|
|
101455
101455
|
"operations": []
|
|
101456
101456
|
},
|
|
101457
101457
|
{
|
|
101458
101458
|
"name": "@agimon-ai/po-cache",
|
|
101459
|
-
"version": "0.0.0-alpha.
|
|
101459
|
+
"version": "0.0.0-alpha.108",
|
|
101460
101460
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
101461
101461
|
"operations": []
|
|
101462
101462
|
},
|
|
101463
101463
|
{
|
|
101464
101464
|
"name": "@agimon-ai/po-codemode",
|
|
101465
|
-
"version": "0.0.1-alpha.
|
|
101465
|
+
"version": "0.0.1-alpha.81",
|
|
101466
101466
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
101467
101467
|
"operations": []
|
|
101468
101468
|
},
|
|
101469
101469
|
{
|
|
101470
101470
|
"name": "@agimon-ai/po-config",
|
|
101471
|
-
"version": "0.0.0-alpha.
|
|
101471
|
+
"version": "0.0.0-alpha.108",
|
|
101472
101472
|
"contractFingerprint": "305bb8372fccda962a3c7bb747e009f767af4a5b9ae904cfd827e9c402caad42",
|
|
101473
101473
|
"operations": []
|
|
101474
101474
|
},
|
|
101475
101475
|
{
|
|
101476
101476
|
"name": "@agimon-ai/po-domain",
|
|
101477
|
-
"version": "0.0.0-alpha.
|
|
101477
|
+
"version": "0.0.0-alpha.108",
|
|
101478
101478
|
"contractFingerprint": "714ad0c508af5784df5529c71aea4ebeba1e9b434906e7769d46716ff1b10da7",
|
|
101479
101479
|
"operations": []
|
|
101480
101480
|
},
|
|
101481
101481
|
{
|
|
101482
101482
|
"name": "@agimon-ai/po-major-mode",
|
|
101483
|
-
"version": "0.0.0-alpha.
|
|
101483
|
+
"version": "0.0.0-alpha.108",
|
|
101484
101484
|
"contractFingerprint": "d7c10b6c5f808271f9cd1a3ec6803cb0f0f282f1a3ec390643c2b2fee1a081cd",
|
|
101485
101485
|
"operations": []
|
|
101486
101486
|
},
|
|
101487
101487
|
{
|
|
101488
101488
|
"name": "@agimon-ai/po-mcp",
|
|
101489
|
-
"version": "0.0.0-alpha.
|
|
101489
|
+
"version": "0.0.0-alpha.108",
|
|
101490
101490
|
"contractFingerprint": "545021df543fd4f5172489477a33452578862a8eb83ee3628032cb18c36f7a29",
|
|
101491
101491
|
"operations": []
|
|
101492
101492
|
},
|
|
101493
101493
|
{
|
|
101494
101494
|
"name": "@agimon-ai/po-minor-mode",
|
|
101495
|
-
"version": "0.0.0-alpha.
|
|
101495
|
+
"version": "0.0.0-alpha.108",
|
|
101496
101496
|
"contractFingerprint": "9d4d7a4b9c338333a720b9f7fc083970d95b6d4f8be11b5f2920b40b7198c002",
|
|
101497
101497
|
"operations": []
|
|
101498
101498
|
},
|
|
101499
101499
|
{
|
|
101500
101500
|
"name": "@agimon-ai/po-notification",
|
|
101501
|
-
"version": "0.0.0-alpha.
|
|
101501
|
+
"version": "0.0.0-alpha.108",
|
|
101502
101502
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
101503
101503
|
"operations": []
|
|
101504
101504
|
},
|
|
101505
101505
|
{
|
|
101506
101506
|
"name": "@agimon-ai/po-profile",
|
|
101507
|
-
"version": "0.0.0-alpha.
|
|
101507
|
+
"version": "0.0.0-alpha.108",
|
|
101508
101508
|
"contractFingerprint": "53f20be6c3e331c19eccd416e278d5c7741374acb5be785fe21ad07d69a5ec7f",
|
|
101509
101509
|
"operations": []
|
|
101510
101510
|
},
|
|
101511
101511
|
{
|
|
101512
101512
|
"name": "@agimon-ai/po-session",
|
|
101513
|
-
"version": "0.0.0-alpha.
|
|
101513
|
+
"version": "0.0.0-alpha.108",
|
|
101514
101514
|
"contractFingerprint": "23e1825133c5d10030161590d858cdd4636159973d94ea747500bbf3cd3e60c0",
|
|
101515
101515
|
"operations": []
|
|
101516
101516
|
},
|
|
101517
101517
|
{
|
|
101518
101518
|
"name": "@agimon-ai/po-skill",
|
|
101519
|
-
"version": "0.0.0-alpha.
|
|
101519
|
+
"version": "0.0.0-alpha.108",
|
|
101520
101520
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
101521
101521
|
"operations": []
|
|
101522
101522
|
},
|
|
101523
101523
|
{
|
|
101524
101524
|
"name": "@agimon-ai/po-ui",
|
|
101525
|
-
"version": "0.0.0-alpha.
|
|
101525
|
+
"version": "0.0.0-alpha.108",
|
|
101526
101526
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
101527
101527
|
"operations": []
|
|
101528
101528
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-cloudflare",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.8",
|
|
4
4
|
"description": "Cloudflare Workers and Durable Objects host for Po headless sessions. Ships the built Worker and its wrangler config.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/AgiFlow/po/issues"
|
|
@@ -22,27 +22,27 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@agimon-ai/po-approval": "0.0.0-alpha.
|
|
26
|
-
"@agimon-ai/po-artifact": "0.0.0-alpha.
|
|
27
|
-
"@agimon-ai/po-autostop": "0.0.0-alpha.
|
|
28
|
-
"@agimon-ai/po-build": "0.0.0-alpha.
|
|
29
|
-
"@agimon-ai/po-cache": "0.0.0-alpha.
|
|
30
|
-
"@agimon-ai/po-calendar": "0.0.1-alpha.
|
|
31
|
-
"@agimon-ai/po-codemode": "0.0.1-alpha.
|
|
32
|
-
"@agimon-ai/po-config": "0.0.0-alpha.
|
|
33
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
34
|
-
"@agimon-ai/po-domain": "0.0.0-alpha.
|
|
35
|
-
"@agimon-ai/po-identity": "0.0.2-alpha.
|
|
36
|
-
"@agimon-ai/po-major-mode": "0.0.0-alpha.
|
|
37
|
-
"@agimon-ai/po-mcp": "0.0.0-alpha.
|
|
38
|
-
"@agimon-ai/po-minor-mode": "0.0.0-alpha.
|
|
39
|
-
"@agimon-ai/po-network": "0.0.2-alpha.
|
|
40
|
-
"@agimon-ai/po-notification": "0.0.0-alpha.
|
|
41
|
-
"@agimon-ai/po-profile": "0.0.0-alpha.
|
|
42
|
-
"@agimon-ai/po-session": "0.0.0-alpha.
|
|
43
|
-
"@agimon-ai/po-skill": "0.0.0-alpha.
|
|
44
|
-
"@agimon-ai/po-ui": "0.0.0-alpha.
|
|
45
|
-
"@agimon-ai/po-web-security": "0.0.0-alpha.
|
|
25
|
+
"@agimon-ai/po-approval": "0.0.0-alpha.108",
|
|
26
|
+
"@agimon-ai/po-artifact": "0.0.0-alpha.107",
|
|
27
|
+
"@agimon-ai/po-autostop": "0.0.0-alpha.108",
|
|
28
|
+
"@agimon-ai/po-build": "0.0.0-alpha.108",
|
|
29
|
+
"@agimon-ai/po-cache": "0.0.0-alpha.108",
|
|
30
|
+
"@agimon-ai/po-calendar": "0.0.1-alpha.67",
|
|
31
|
+
"@agimon-ai/po-codemode": "0.0.1-alpha.81",
|
|
32
|
+
"@agimon-ai/po-config": "0.0.0-alpha.108",
|
|
33
|
+
"@agimon-ai/po-core": "0.0.0-alpha.108",
|
|
34
|
+
"@agimon-ai/po-domain": "0.0.0-alpha.108",
|
|
35
|
+
"@agimon-ai/po-identity": "0.0.2-alpha.55",
|
|
36
|
+
"@agimon-ai/po-major-mode": "0.0.0-alpha.108",
|
|
37
|
+
"@agimon-ai/po-mcp": "0.0.0-alpha.108",
|
|
38
|
+
"@agimon-ai/po-minor-mode": "0.0.0-alpha.108",
|
|
39
|
+
"@agimon-ai/po-network": "0.0.2-alpha.55",
|
|
40
|
+
"@agimon-ai/po-notification": "0.0.0-alpha.108",
|
|
41
|
+
"@agimon-ai/po-profile": "0.0.0-alpha.108",
|
|
42
|
+
"@agimon-ai/po-session": "0.0.0-alpha.108",
|
|
43
|
+
"@agimon-ai/po-skill": "0.0.0-alpha.108",
|
|
44
|
+
"@agimon-ai/po-ui": "0.0.0-alpha.108",
|
|
45
|
+
"@agimon-ai/po-web-security": "0.0.0-alpha.108",
|
|
46
46
|
"@better-auth/sso": "1.7.12",
|
|
47
47
|
"@cloudflare/puppeteer": "1.4.0",
|
|
48
48
|
"@cloudflare/workers-types": "5.20261013.1",
|
/package/dist/assets/plugins/slots/{approval.09e72f36-DwFz-UMh.js → approval.3e4ea6e4-DwFz-UMh.js}
RENAMED
|
File without changes
|
/package/dist/assets/plugins/slots/{artifacts.50b639bb-CUtFC806.js → artifacts.84980c32-CUtFC806.js}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/assets/plugins/slots/{codemode.c58fb583-C0Gmb7_s.js → codemode.5f359b9c-C0Gmb7_s.js}
RENAMED
|
File without changes
|
/package/dist/assets/plugins/slots/{domain.753f9f92-BTBYRLkE.js → domain.832848c8-BTBYRLkE.js}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/assets/plugins/slots/{profile.ab16dcec-DIVXNHmh.js → profile.63bc3ae6-DIVXNHmh.js}
RENAMED
|
File without changes
|
/package/dist/assets/plugins/slots/{skill.62a0a1b3-BNr7DmPH.js → skill.56c1cc07-BNr7DmPH.js}
RENAMED
|
File without changes
|