@zihanw/pi-forge 0.4.0-beta.1 → 0.4.1
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/CHANGELOG.md +45 -1
- package/PUBLIC_API.md +3 -26
- package/README.md +90 -601
- package/README.zh-CN.md +86 -585
- package/SUBAGENT_ADAPTER_CONTRACT.md +3 -197
- package/dist/agent-profile.d.ts +24 -1
- package/dist/agent-profile.d.ts.map +1 -1
- package/dist/agent-profile.js +146 -36
- package/dist/agent-profile.js.map +1 -1
- package/dist/catalog.d.ts +27 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +59 -0
- package/dist/catalog.js.map +1 -0
- package/dist/forge-config.d.ts +106 -0
- package/dist/forge-config.d.ts.map +1 -1
- package/dist/forge-config.js +305 -18
- package/dist/forge-config.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +55 -8
- package/dist/index.js.map +1 -1
- package/dist/lifecycle.d.ts +2 -1
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +7 -4
- package/dist/lifecycle.js.map +1 -1
- package/dist/loader.d.ts +17 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +84 -25
- package/dist/loader.js.map +1 -1
- package/dist/preset-command.d.ts +1 -1
- package/dist/preset-command.d.ts.map +1 -1
- package/dist/preset-command.js +38 -10
- package/dist/preset-command.js.map +1 -1
- package/dist/profile-command.d.ts.map +1 -1
- package/dist/profile-command.js +46 -21
- package/dist/profile-command.js.map +1 -1
- package/dist/profile-service.d.ts +6 -3
- package/dist/profile-service.d.ts.map +1 -1
- package/dist/profile-service.js +55 -13
- package/dist/profile-service.js.map +1 -1
- package/dist/resource-identity.d.ts +33 -0
- package/dist/resource-identity.d.ts.map +1 -0
- package/dist/resource-identity.js +56 -0
- package/dist/resource-identity.js.map +1 -0
- package/dist/runtime/profile-runtime.d.ts.map +1 -1
- package/dist/runtime/profile-runtime.js +7 -2
- package/dist/runtime/profile-runtime.js.map +1 -1
- package/dist/runtime/prompt-stack-runtime.d.ts +1 -1
- package/dist/runtime/prompt-stack-runtime.d.ts.map +1 -1
- package/dist/runtime/prompt-stack-runtime.js +22 -12
- package/dist/runtime/prompt-stack-runtime.js.map +1 -1
- package/dist/runtime/subagent-runtime.d.ts +23 -8
- package/dist/runtime/subagent-runtime.d.ts.map +1 -1
- package/dist/runtime/subagent-runtime.js +296 -67
- package/dist/runtime/subagent-runtime.js.map +1 -1
- package/dist/storage.d.ts +11 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +51 -2
- package/dist/storage.js.map +1 -1
- package/dist/subagent/canonical.d.ts +19 -7
- package/dist/subagent/canonical.d.ts.map +1 -1
- package/dist/subagent/canonical.js +19 -47
- package/dist/subagent/canonical.js.map +1 -1
- package/dist/subagent/contract.d.ts +1 -2
- package/dist/subagent/contract.d.ts.map +1 -1
- package/dist/subagent/contract.js +1 -2
- package/dist/subagent/contract.js.map +1 -1
- package/dist/subagent/index.d.ts +4 -3
- package/dist/subagent/index.d.ts.map +1 -1
- package/dist/subagent/index.js +4 -3
- package/dist/subagent/index.js.map +1 -1
- package/dist/subagent/plan.d.ts +5 -1
- package/dist/subagent/plan.d.ts.map +1 -1
- package/dist/subagent/plan.js +29 -32
- package/dist/subagent/plan.js.map +1 -1
- package/dist/subagent/request.d.ts.map +1 -1
- package/dist/subagent/request.js +36 -4
- package/dist/subagent/request.js.map +1 -1
- package/dist/subagent/types.d.ts +66 -178
- package/dist/subagent/types.d.ts.map +1 -1
- package/dist/subagent/types.js +1 -1
- package/dist/subagent/types.js.map +1 -1
- package/dist/subagent/validation.d.ts +14 -14
- package/dist/subagent/validation.d.ts.map +1 -1
- package/dist/subagent/validation.js +52 -238
- package/dist/subagent/validation.js.map +1 -1
- package/dist/subagent-command.d.ts +2 -1
- package/dist/subagent-command.d.ts.map +1 -1
- package/dist/subagent-command.js +115 -19
- package/dist/subagent-command.js.map +1 -1
- package/dist/subagent-host.d.ts.map +1 -1
- package/dist/subagent-host.js +43 -16
- package/dist/subagent-host.js.map +1 -1
- package/dist/subagent-profile-tool.d.ts +25 -2
- package/dist/subagent-profile-tool.d.ts.map +1 -1
- package/dist/subagent-profile-tool.js +41 -9
- package/dist/subagent-profile-tool.js.map +1 -1
- package/dist/subagent-tool.d.ts +31 -4
- package/dist/subagent-tool.d.ts.map +1 -1
- package/dist/subagent-tool.js +311 -137
- package/dist/subagent-tool.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/web-editor/client-script.generated.d.ts +1 -1
- package/dist/web-editor/client-script.generated.d.ts.map +1 -1
- package/dist/web-editor/client-script.generated.js +1 -1
- package/dist/web-editor/client-script.generated.js.map +1 -1
- package/dist/web-editor/client-styles.d.ts +2 -0
- package/dist/web-editor/client-styles.d.ts.map +1 -0
- package/dist/web-editor/client-styles.generated.d.ts +2 -0
- package/dist/web-editor/client-styles.generated.d.ts.map +1 -0
- package/dist/web-editor/client-styles.generated.js +3 -0
- package/dist/web-editor/client-styles.generated.js.map +1 -0
- package/dist/web-editor/client-styles.js +2 -0
- package/dist/web-editor/client-styles.js.map +1 -0
- package/dist/web-editor/page.d.ts +2 -0
- package/dist/web-editor/page.d.ts.map +1 -1
- package/dist/web-editor/page.js +11 -73
- package/dist/web-editor/page.js.map +1 -1
- package/dist/web-editor/server.d.ts.map +1 -1
- package/dist/web-editor/server.js +176 -1
- package/dist/web-editor/server.js.map +1 -1
- package/dist/web-editor/styles.d.ts.map +1 -1
- package/dist/web-editor/styles.js +60 -3
- package/dist/web-editor/styles.js.map +1 -1
- package/dist/web-editor/types.d.ts +87 -0
- package/dist/web-editor/types.d.ts.map +1 -1
- package/dist/web-host.d.ts +13 -2
- package/dist/web-host.d.ts.map +1 -1
- package/dist/web-host.js +371 -27
- package/dist/web-host.js.map +1 -1
- package/docs/README.md +41 -0
- package/docs/concepts/agent-profiles.md +60 -0
- package/docs/concepts/prompt-stacks.md +95 -0
- package/docs/design/README.md +17 -0
- package/docs/design/roadmap-0.4-archive.md +216 -0
- package/docs/design/subagents/design-review.md +220 -0
- package/docs/design/subagents/interface-design.md +274 -0
- package/docs/design/subagents/sdk-spike-findings.md +117 -0
- package/docs/development/complexity-review.md +86 -0
- package/docs/development/release.md +31 -0
- package/docs/development/roadmap.md +36 -0
- package/docs/development/scoped-global-profiles-stacks.md +325 -0
- package/docs/development/setup.md +75 -0
- package/docs/getting-started.md +95 -0
- package/docs/guides/custom-macros-and-slots.md +68 -0
- package/docs/guides/debugging.md +39 -0
- package/docs/guides/delegation.md +107 -0
- package/docs/guides/sillytavern-import.md +47 -0
- package/docs/guides/use-cases.md +65 -0
- package/docs/guides/web-editor.md +75 -0
- package/docs/reference/commands.md +60 -0
- package/docs/reference/configuration.md +66 -0
- package/docs/reference/features.md +280 -0
- package/docs/reference/macros-and-slots.md +82 -0
- package/docs/reference/public-api.md +28 -0
- package/docs/reference/stack-schema.md +167 -0
- package/docs/reference/subagent-adapter.md +204 -0
- package/docs/zh-CN/README.md +37 -0
- package/docs/zh-CN/concepts/agent-profiles.md +46 -0
- package/docs/zh-CN/concepts/prompt-stacks.md +42 -0
- package/docs/zh-CN/getting-started.md +81 -0
- package/docs/zh-CN/guides/delegation.md +66 -0
- package/docs/zh-CN/guides/web-editor.md +45 -0
- package/docs/zh-CN/reference/commands.md +60 -0
- package/package.json +29 -15
- package/dist/subagent/backend-registry.d.ts +0 -75
- package/dist/subagent/backend-registry.d.ts.map +0 -1
- package/dist/subagent/backend-registry.js +0 -463
- package/dist/subagent/backend-registry.js.map +0 -1
- package/dist/subagent/diagnostics.d.ts +0 -3
- package/dist/subagent/diagnostics.d.ts.map +0 -1
- package/dist/subagent/diagnostics.js +0 -5
- package/dist/subagent/diagnostics.js.map +0 -1
- package/dist/subagent/pi-model-runtime.d.ts +0 -8
- package/dist/subagent/pi-model-runtime.d.ts.map +0 -1
- package/dist/subagent/pi-model-runtime.js +0 -22
- package/dist/subagent/pi-model-runtime.js.map +0 -1
- package/dist/subagent/pi-sdk-backend.d.ts +0 -23
- package/dist/subagent/pi-sdk-backend.d.ts.map +0 -1
- package/dist/subagent/pi-sdk-backend.js +0 -383
- package/dist/subagent/pi-sdk-backend.js.map +0 -1
- package/dist/subagent/pi-subprocess-backend.d.ts +0 -72
- package/dist/subagent/pi-subprocess-backend.d.ts.map +0 -1
- package/dist/subagent/pi-subprocess-backend.js +0 -756
- package/dist/subagent/pi-subprocess-backend.js.map +0 -1
- package/dist/subagent/subprocess-bridge.d.ts +0 -21
- package/dist/subagent/subprocess-bridge.d.ts.map +0 -1
- package/dist/subagent/subprocess-bridge.js +0 -87
- package/dist/subagent/subprocess-bridge.js.map +0 -1
- package/dist/subagent/subprocess-report.d.ts +0 -4
- package/dist/subagent/subprocess-report.d.ts.map +0 -1
- package/dist/subagent/subprocess-report.js +0 -55
- package/dist/subagent/subprocess-report.js.map +0 -1
- package/dist/subagent-contract.d.ts +0 -8
- package/dist/subagent-contract.d.ts.map +0 -1
- package/dist/subagent-contract.js +0 -8
- package/dist/subagent-contract.js.map +0 -1
- package/dist/web-editor/client/api.d.ts +0 -9
- package/dist/web-editor/client/api.d.ts.map +0 -1
- package/dist/web-editor/client/api.js +0 -26
- package/dist/web-editor/client/api.js.map +0 -1
- package/dist/web-editor/client/dom.d.ts +0 -13
- package/dist/web-editor/client/dom.d.ts.map +0 -1
- package/dist/web-editor/client/dom.js +0 -30
- package/dist/web-editor/client/dom.js.map +0 -1
- package/dist/web-editor/client/inspector.d.ts +0 -22
- package/dist/web-editor/client/inspector.d.ts.map +0 -1
- package/dist/web-editor/client/inspector.js +0 -226
- package/dist/web-editor/client/inspector.js.map +0 -1
- package/dist/web-editor/client/main.d.ts +0 -2
- package/dist/web-editor/client/main.d.ts.map +0 -1
- package/dist/web-editor/client/main.js +0 -1468
- package/dist/web-editor/client/main.js.map +0 -1
- package/dist/web-editor/client/policy-editor.d.ts +0 -16
- package/dist/web-editor/client/policy-editor.d.ts.map +0 -1
- package/dist/web-editor/client/policy-editor.js +0 -330
- package/dist/web-editor/client/policy-editor.js.map +0 -1
- package/dist/web-editor/client/regex-editor.d.ts +0 -19
- package/dist/web-editor/client/regex-editor.d.ts.map +0 -1
- package/dist/web-editor/client/regex-editor.js +0 -281
- package/dist/web-editor/client/regex-editor.js.map +0 -1
- package/dist/web-editor/client/types.d.ts +0 -60
- package/dist/web-editor/client/types.d.ts.map +0 -1
- package/dist/web-editor/client/types.js +0 -2
- package/dist/web-editor/client/types.js.map +0 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Custom macros and slots
|
|
2
|
+
|
|
3
|
+
[Documentation](../README.md)
|
|
4
|
+
|
|
5
|
+
Custom macros and slots are registered by trusted extension code, never embedded as executable code in prompt-stack JSON.
|
|
6
|
+
|
|
7
|
+
Put small project registrations in `.pi/forge/extensions/` and machine-wide personal registrations in `~/.pi/forge/extensions/`. Global modules load first, then project modules, after trust and before stack validation. Both locations reload with `/preset reload`.
|
|
8
|
+
|
|
9
|
+
## Registration module
|
|
10
|
+
|
|
11
|
+
Modules receive the pi-forge API directly, so they do not need to import the package:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
// .pi/forge/extensions/ticket-context.ts
|
|
15
|
+
export default function register(api) {
|
|
16
|
+
api.registerMacro({
|
|
17
|
+
name: "ticketId",
|
|
18
|
+
description: "Current ticket id from session variables.",
|
|
19
|
+
render: (ctx) => ctx.variables.toMacroText(ctx.variables.get("ticket.id")),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
api.registerSlot({
|
|
23
|
+
name: "ticket-context",
|
|
24
|
+
description: "Render ticket context for the current task.",
|
|
25
|
+
options: {
|
|
26
|
+
heading: { type: "string", default: "Ticket context" },
|
|
27
|
+
},
|
|
28
|
+
render: (ctx) => [
|
|
29
|
+
String(ctx.options.heading ?? "Ticket context") + ":",
|
|
30
|
+
"- Ticket: " + ctx.variables.toMacroText(ctx.variables.get("ticket.id")),
|
|
31
|
+
"- Project: " + ctx.helpers.normalizePath(ctx.runtime.options.cwd),
|
|
32
|
+
].join("\n"),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Use the slot declaratively:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"kind": "slot",
|
|
42
|
+
"id": "ticket-context",
|
|
43
|
+
"enabled": true,
|
|
44
|
+
"role": "system",
|
|
45
|
+
"slot": "ticket-context",
|
|
46
|
+
"options": { "heading": "Current ticket" }
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Module rules
|
|
51
|
+
|
|
52
|
+
- Supported files are `.ts`, `.js`, `.mjs`, `.cjs`, and `index.*` inside a subdirectory.
|
|
53
|
+
- TypeScript should use syntax Node can strip at runtime; otherwise use JavaScript or precompile it.
|
|
54
|
+
- Export `default function register(api)` or named `register(api)`.
|
|
55
|
+
- Names must be unique across built-ins, global extensions, and project extensions.
|
|
56
|
+
- Duplicate names and load failures appear in diagnostics.
|
|
57
|
+
- Missing custom slots are validation warnings until their module is loaded.
|
|
58
|
+
- Registration ownership is disposed when the runtime shuts down.
|
|
59
|
+
|
|
60
|
+
The API provides `cwd`, `forgeDir`, `extensionPath`, helpers, registration functions, and `getRegisteredMacros()` / `getRegisteredSlots()`. Global `forgeDir` is `~/.pi/forge`; project `forgeDir` is `<project>/.pi/forge`.
|
|
61
|
+
|
|
62
|
+
Reusable Pi packages may import `registerMacro` and `registerSlot` from `@zihanw/pi-forge`. The directory loaders are intended for small trusted customizations without package boilerplate.
|
|
63
|
+
|
|
64
|
+
## Security
|
|
65
|
+
|
|
66
|
+
Registration modules execute with the Pi process's user permissions. Load them only from code you trust. Stack JSON remains declarative and cannot register executable behavior by itself.
|
|
67
|
+
|
|
68
|
+
For a copyable example, see [custom-system-status-extension](../../examples/custom-system-status-extension/README.md). For built-ins, see [macros and slots](../reference/macros-and-slots.md).
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Prompt and payload debugging
|
|
2
|
+
|
|
3
|
+
[Documentation](../README.md)
|
|
4
|
+
|
|
5
|
+
## Validate and preview
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
/preset validate [id]
|
|
9
|
+
/preset preview [id]
|
|
10
|
+
/preset status
|
|
11
|
+
/preset diagnostics
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Validation checks schema shape, item IDs, slots, policy, regex rules, custom dependencies, and activation conflicts. Preview compiles without sending a provider request. Diagnostics includes runtime policy, regex activity, extension modules, and load failures.
|
|
15
|
+
|
|
16
|
+
The web editor provides the same validation plus a full visual preview and source-aware resources.
|
|
17
|
+
|
|
18
|
+
## Inspect the next provider payload
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
/payload next
|
|
22
|
+
/payload next save=.pi/forge/payloads/last.json
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Or open `/preset ui`, click **Arm payload**, then send the next Pi prompt. Credential-shaped token fields are redacted; normal request limits and accounting fields such as `max_tokens`, `input_tokens`, and `output_tokens` remain visible.
|
|
26
|
+
|
|
27
|
+
`/intercept` is the compact command for showing the next provider payload.
|
|
28
|
+
|
|
29
|
+
Saved payloads can contain prompt and conversation content. Keep them out of version control unless deliberately sanitized.
|
|
30
|
+
|
|
31
|
+
## Common checks
|
|
32
|
+
|
|
33
|
+
- Unexpected duplicate task: set the `chat-history` slot's `includeLastUserMessage` to `false` when a later block uses `{{lastUserMessage}}`.
|
|
34
|
+
- Missing tool: inspect stack `allow`/`deny` policy and `/preset status`; the tool-call guard enforces the selected stack even if another extension modifies active tools.
|
|
35
|
+
- Skill still visible: use `replace` mode when Pi's base prompt must not include its own skill listing.
|
|
36
|
+
- Missing custom slot: trust the project, check `.pi/forge/extensions`, reload, and inspect diagnostics.
|
|
37
|
+
- Changed profile source: `/profile status` distinguishes source-definition changes from manual runtime drift.
|
|
38
|
+
- Delegation unavailable: use `/forge-agent backends`, `/profile preview`, and `forge_subagent_profiles` metadata before provider execution.
|
|
39
|
+
- Provider authentication works in the parent but not the child: restart after updating Pi or pi-forge and confirm the installed extension/runtime versions are not stale.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Experimental foreground delegation
|
|
2
|
+
|
|
3
|
+
[Documentation](../README.md) · [中文](../zh-CN/guides/delegation.md)
|
|
4
|
+
|
|
5
|
+
> **Experimental:** This API and its backends may change independently of stable prompt-stack and profile behavior.
|
|
6
|
+
|
|
7
|
+
pi-forge can execute an explicitly authorized agent profile as a separate, clean, one-shot Pi process. It runs in the foreground and returns a bounded report to the parent conversation.
|
|
8
|
+
|
|
9
|
+
## Enable a profile
|
|
10
|
+
|
|
11
|
+
Profiles are not delegatable by default. Enable each eligible ID in the trusted project's `.pi/forge/config.json`, or use the profile's delegation card in `/preset ui`:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"subagents": {
|
|
16
|
+
"backend": "pi-subprocess-readonly",
|
|
17
|
+
"timeoutMs": 60000,
|
|
18
|
+
"profiles": {
|
|
19
|
+
"reviewer": {
|
|
20
|
+
"enabled": true,
|
|
21
|
+
"timeoutMs": 300000
|
|
22
|
+
},
|
|
23
|
+
"rpc-reviewer": {
|
|
24
|
+
"enabled": true,
|
|
25
|
+
"backend": "pi-rpc-readonly",
|
|
26
|
+
"timeoutMs": 180000
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Enablement follows the profile's scope. A global `~/.pi/forge/config.json` may define general `backend` and `timeoutMs` defaults and may authorize `global:<id>` profiles through its own `profiles` map. The trusted project's `.pi/forge/config.json` authorizes `project:<id>` profiles. Same-ID global and project profiles never inherit enablement, backend, or timeout policy from one another. Disabled or unlisted profiles are hidden from discovery and rejected even if guessed.
|
|
34
|
+
|
|
35
|
+
## Discover, plan, and run
|
|
36
|
+
|
|
37
|
+
Humans use:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
/forge-agent backends
|
|
41
|
+
/forge-agent plan reviewer Review this API design for correctness.
|
|
42
|
+
/forge-agent run reviewer Review this API design for correctness.
|
|
43
|
+
/forge-agent run reviewer --backend pi-rpc-readonly Review this API design.
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`plan` resolves the profile and stack, compiles and validates the exact immutable provider-bound plan, displays it, and discards it without provider transport.
|
|
47
|
+
|
|
48
|
+
Profile selectors accept the same grammar everywhere: `reviewer` (project first), `project:reviewer`, or `global:reviewer`. When both scopes expose the same ID, the project profile keeps the concise selector and the global profile remains callable as `global:<id>`.
|
|
49
|
+
|
|
50
|
+
The parent model uses `forge_subagent_profiles` to discover enabled profiles and `forge_subagent` to invoke one. A restrictive parent stack must allow both tool names. Discovery is local/no-egress and reports metadata, resolution readiness, effective backend/timeout, approval mode, and whether parent tool policy permits invocation.
|
|
51
|
+
|
|
52
|
+
Projects with only a few frequently used profiles can set `subagents.summaryInToolDescription: true` (global or trusted-project config). The `forge_subagent` tool description then carries a compact summary of enabled profiles—id, model, thinking level, stack, backend, and timeout—so the parent model does not need a discovery call to pick a profile. Ready profiles appear first; unavailable enabled profiles remain visible with their first resolution error so the model knows not to invoke them. The summary rides in every request, is capped at 8 profiles and 1,000 characters, and refreshes with profiles, stacks, and configuration; `forge_subagent_profiles` remains the authoritative full-detail surface.
|
|
53
|
+
|
|
54
|
+
## Parallel invocation
|
|
55
|
+
|
|
56
|
+
`forge_subagent` is a parallel-execution tool: the parent model may issue several calls in one turn, and they prepare and run concurrently. Interactive approval dialogs are serialized one at a time because Pi's selector/editor UI is a single slot—a second concurrent dialog would clear the first and leave it unresolved—so each call waits its turn for the dialog and then executes immediately, letting approved runs overlap. Unattended invocation needs no dialog and is fully concurrent. Each run is an independent `pi` subprocess and provider request; a burst of parallel calls multiplies provider cost and process load, so keep the parent tool policy conservative until a configurable concurrency cap lands.
|
|
57
|
+
|
|
58
|
+
## Backends and precedence
|
|
59
|
+
|
|
60
|
+
Two fresh-process backends are registered:
|
|
61
|
+
|
|
62
|
+
- `pi-subprocess-readonly` is the default and uses `pi --mode text --print`.
|
|
63
|
+
- `pi-rpc-readonly` uses `pi --mode rpc`.
|
|
64
|
+
|
|
65
|
+
Both execute the same sealed prompt and shared-user read-only policy; only their process protocol differs. There is no fallback if the selected backend is unavailable.
|
|
66
|
+
|
|
67
|
+
Interactive backend precedence is: per-run override, project profile override, project default, user default, built-in default. Unattended model invocation is pinned to the effective configured backend and rejects a per-call override. Timeout follows profile, project, user, then the 60-second built-in default; valid values are 1,000–3,600,000 ms. Host timeout is best effort.
|
|
68
|
+
|
|
69
|
+
## Approval and unattended invocation
|
|
70
|
+
|
|
71
|
+
By default, the exact plan is prepared before an approval screen shows the task, profile/stack, provider/model, thinking level, tools, working directory, boundary, payload size, and fingerprint. **View full prompt** reveals the complete provider-bound system prompt and ordered messages. Editing that view cannot alter the sealed plan.
|
|
72
|
+
|
|
73
|
+
To authorize the parent model without per-run approval:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"subagents": {
|
|
78
|
+
"allowAgentInvocationWithoutApproval": true
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
This affects only `forge_subagent`; `/forge-agent run` remains interactive. It is ignored in untrusted projects and malformed values fail closed. Treat this project config as an authorization file: do not enable or commit it unless every parent agent allowed to call `forge_subagent` may send the compiled prompt and readable file contents to the selected provider without asking again.
|
|
84
|
+
|
|
85
|
+
## Child context and output
|
|
86
|
+
|
|
87
|
+
The child receives a clean conversation, the exact profile model/thinking/stack, and the delegated task as a protected final user message. It does not automatically receive parent history.
|
|
88
|
+
|
|
89
|
+
Candidate tools are `read`, `grep`, `find`, and `ls`, further restricted by stack tool policy. The child loads no write/edit/shell tools, skills, prompt templates, project context files, or third-party extensions.
|
|
90
|
+
|
|
91
|
+
The model-visible result is bounded. Expandable human details retain normalized status, a text transcript, tool events, diagnostics, usage, approval receipt, and execution report. Retained strings are bounded, base64-like text is redacted, and the transcript keeps a 512 KiB rolling tail. Inline image bytes are replaced by MIME/encoded-size metadata before retention in the parent session.
|
|
92
|
+
|
|
93
|
+
## Security boundary
|
|
94
|
+
|
|
95
|
+
The current backends are **shared-user, not operating-system sandboxes**.
|
|
96
|
+
|
|
97
|
+
- “Read-only” is a model-tool policy. The process retains the invoking user's OS permissions.
|
|
98
|
+
- Absolute paths readable by that user may be read and sent to the selected provider.
|
|
99
|
+
- Text may be retained in parent tool-result details and Pi's on-disk session JSONL.
|
|
100
|
+
- Timeout and cancellation are best effort.
|
|
101
|
+
- `/tree` changes the active conversation branch; abandoned entries can remain on disk.
|
|
102
|
+
- `/tree` cannot undo provider requests, billing, or external effects.
|
|
103
|
+
- Removing sensitive retained text requires deleting the relevant Pi session data.
|
|
104
|
+
|
|
105
|
+
The default tools intentionally provide no mutation path. Do not add write, edit, or shell access to this shared-user design. OS isolation and separately approved staged writes remain future work.
|
|
106
|
+
|
|
107
|
+
For integration authors, see the [experimental adapter contract](../reference/subagent-adapter.md).
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Importing SillyTavern presets
|
|
2
|
+
|
|
3
|
+
[Documentation](../README.md)
|
|
4
|
+
|
|
5
|
+
Import through the command line:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
/preset import-silly ~/SillyTavern/presets/my-preset.json
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Use `--dry-run` to preview, `--overwrite` to replace protected output, and an optional `character_id` when the preset contains multiple prompt orders. The web editor also accepts SillyTavern JSON and asks which character order to use when necessary.
|
|
12
|
+
|
|
13
|
+
Generated stacks go to `.pi/forge/prompt-stacks/<id>.json`; reports go to `.pi/forge/import-reports/<id>.md`. Always read the report before activating the stack.
|
|
14
|
+
|
|
15
|
+
## Converted behavior
|
|
16
|
+
|
|
17
|
+
The importer:
|
|
18
|
+
|
|
19
|
+
- converts prompt order into ordered stack items;
|
|
20
|
+
- maps the chat-history marker to a movable `chat-history` slot;
|
|
21
|
+
- detects `{{lastUserMessage}}` and avoids duplicating the latest user turn;
|
|
22
|
+
- carries relevant identifiers in `source.sillytavern` metadata;
|
|
23
|
+
- maps deterministic `promptOnly` regex scripts to history-stage outgoing rules when their behavior is representable;
|
|
24
|
+
- converts full-match replacement syntax and preserves trim strings, depth limits, and supported user/assistant placement.
|
|
25
|
+
|
|
26
|
+
## Report-only behavior
|
|
27
|
+
|
|
28
|
+
The following require manual review and are not executed:
|
|
29
|
+
|
|
30
|
+
- display-only or mixed prompt/display scripts;
|
|
31
|
+
- DOM, browser, CSS, HTML-decoration, or JavaScript behavior;
|
|
32
|
+
- unsupported placements or invalid regular expressions;
|
|
33
|
+
- markers with no pi-forge equivalent;
|
|
34
|
+
- SillyTavern features whose ordering or lifecycle cannot be represented safely.
|
|
35
|
+
|
|
36
|
+
pi-forge does not embed arbitrary executable preset code. Unsupported content stays visible in the migration report instead of being silently approximated.
|
|
37
|
+
|
|
38
|
+
## Recommended workflow
|
|
39
|
+
|
|
40
|
+
1. Run a dry import.
|
|
41
|
+
2. Read every warning and omission in the report.
|
|
42
|
+
3. Open the generated stack in `/preset ui`.
|
|
43
|
+
4. Validate it and inspect the full preview.
|
|
44
|
+
5. Compare the history placement and regex rules with the original preset.
|
|
45
|
+
6. Activate it only after the preview matches your intent.
|
|
46
|
+
|
|
47
|
+
See [stack schema](../reference/stack-schema.md#regex-transforms) for the supported regex runtime.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Prompt-stack patterns and examples
|
|
2
|
+
|
|
3
|
+
[Documentation](../README.md)
|
|
4
|
+
|
|
5
|
+
Use these as starting patterns rather than rigid templates. The [default Pi mirror](../../examples/default-prompt-stack.json) is the safest baseline to fork.
|
|
6
|
+
|
|
7
|
+
## Roleplay and creative writing
|
|
8
|
+
|
|
9
|
+
Put long-lived character rules in a system block, runtime context in appropriate slots, and the current user action in an explicit final user block:
|
|
10
|
+
|
|
11
|
+
1. System character/personality block.
|
|
12
|
+
2. Tools, project context, variables, and other runtime slots.
|
|
13
|
+
3. `chat-history` with `includeLastUserMessage: false`.
|
|
14
|
+
4. Final user block containing `{{lastUserMessage}}`.
|
|
15
|
+
|
|
16
|
+
This keeps the latest request clear and avoids duplication. Static `{{char}}` / `{{user}}` variables work well for character constants; turn/session macros can track temporary scene state. Durable project memory belongs in project files, not prompt variables.
|
|
17
|
+
|
|
18
|
+
## Focused code review
|
|
19
|
+
|
|
20
|
+
Start from [the reviewer example](../../examples/reviewer-prompt-stack.json). It denies writing tools, wraps prior history as background, omits the latest user message from history, then reinserts it as the explicit review target.
|
|
21
|
+
|
|
22
|
+
Use a rule such as “prioritize correctness, regressions, security, and missing tests.” Keep tools, project context, variables, and history when the reviewer must inspect the repository. Use `append` to retain Pi's normal coding prompt, or `replace` when the stack must fully control prompt and skill visibility.
|
|
23
|
+
|
|
24
|
+
## Translation mode
|
|
25
|
+
|
|
26
|
+
Create a small stack with a system block for target language, register/tone, and terminology rules. Retain history and a final `{{lastUserMessage}}`. Separate literal translation, localization review, and bilingual editing into different stacks when their rules conflict.
|
|
27
|
+
|
|
28
|
+
## Multi-mode switching
|
|
29
|
+
|
|
30
|
+
Keep independent project files:
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
.pi/forge/prompt-stacks/
|
|
34
|
+
coder.json
|
|
35
|
+
writer.json
|
|
36
|
+
translator.json
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Switch with `/preset use coder`, `/preset use writer`, or `/preset use translator`. Capture a profile when a mode also needs a specific model and thinking level.
|
|
40
|
+
|
|
41
|
+
## Read-only scout
|
|
42
|
+
|
|
43
|
+
Allow only `read`, `grep`, `find`, and `ls`, omit editing tools, and cap chat history with `maxChars`. This is useful for exploration turns where the model should report findings without changing files.
|
|
44
|
+
|
|
45
|
+
Tool policy constrains model tool calls but is not an operating-system sandbox. A normal Pi agent may still have other non-tool ways to interact with its host; do not describe a prompt stack alone as process isolation.
|
|
46
|
+
|
|
47
|
+
## Surgical patcher
|
|
48
|
+
|
|
49
|
+
Keep the Pi mirror, require the tools needed for the workflow, strip prior assistant thinking from inserted history, and move project context near the current user turn. This reduces distracting prompt material without removing relevant repository instructions.
|
|
50
|
+
|
|
51
|
+
## SillyTavern DM writer
|
|
52
|
+
|
|
53
|
+
[The DM-writer example](../../examples/sillytavern-dm-writer-prompt-stack.json) defines a Dungeon Master through `{{char}}` / `{{user}}`, wraps prior adventure history, reinserts the current action, and uses deterministic regex cleanup for OOC notes, secret-roll markers, dice notation, and `Player:` prefixes.
|
|
54
|
+
|
|
55
|
+
## Payload lab
|
|
56
|
+
|
|
57
|
+
Include `active-model`, `date-cwd`, and `variables`, then add compiled regex rules for deterministic redaction or formatting. Pair the stack with `/payload next` or the web editor's capture view to audit exactly what changed.
|
|
58
|
+
|
|
59
|
+
## Pi-docs expert
|
|
60
|
+
|
|
61
|
+
Allow read/search tools, include the `pi-docs` and project-context slots, and keep a focused system instruction. This encourages answers grounded in installed Pi documentation rather than general model memory.
|
|
62
|
+
|
|
63
|
+
## Trusted runtime status
|
|
64
|
+
|
|
65
|
+
The [custom system-status example](../../examples/custom-system-status-extension/README.md) registers `{{cpuLoad}}` and a `machine-status` slot from trusted project code. Use this pattern for deterministic host data that cannot be represented as static stack JSON.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Web editor
|
|
2
|
+
|
|
3
|
+
[Documentation](../README.md)
|
|
4
|
+
|
|
5
|
+
Open the browser editor from a trusted Pi project:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
/preset ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Use `/preset ui restart` to replace its server or `/preset ui stop` to close it.
|
|
12
|
+
|
|
13
|
+
## Connection and trust
|
|
14
|
+
|
|
15
|
+
The editor binds to an available `127.0.0.1` port and uses a session token. Multiple Pi projects can run editors simultaneously. Lifecycle reinitialization reuses the existing editor URL for the same project when possible.
|
|
16
|
+
|
|
17
|
+
Reads, preview, resources, and payload inspection remain available as appropriate, but writes require Pi to trust the project. Files are constrained to pi-forge's stack/profile storage. Never expose or proxy the editor URL to an untrusted network.
|
|
18
|
+
|
|
19
|
+
Choose a preferred port in `.pi/forge/config.json`:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"webEditor": {
|
|
24
|
+
"port": 41738
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
If that port is unavailable, pi-forge selects another and shows the actual URL.
|
|
30
|
+
|
|
31
|
+
## Prompt-stack workspace
|
|
32
|
+
|
|
33
|
+
The stack workspace provides:
|
|
34
|
+
|
|
35
|
+
- creation from the default Pi-mirror layout;
|
|
36
|
+
- structured metadata, item, policy, variables, context, and regex editing;
|
|
37
|
+
- drag-and-drop item order and enable/disable controls;
|
|
38
|
+
- validation and a full compiled preview;
|
|
39
|
+
- registered-tool and loaded-skill search with exact-name chips and wildcard patterns;
|
|
40
|
+
- raw JSON recovery for advanced or unknown fields;
|
|
41
|
+
- native pi-forge and SillyTavern JSON import;
|
|
42
|
+
- export, fork, and deletion;
|
|
43
|
+
- payload arming and redacted captured-payload inspection;
|
|
44
|
+
- light and dark themes.
|
|
45
|
+
|
|
46
|
+
Existing IDs are immutable during edit. Use **Fork** to create a different ID without breaking profile references or the active selection. The toolbar scope selector (default `project`) chooses where new stacks, imports, and forks are written: `global` targets the user-global `~/.pi/forge/prompt-stacks`, `project` targets `.pi/forge/prompt-stacks`. Stack rows show a `global` badge, and save/delete routes use `global:<id>` for exact global mutations. Legacy stacks remain editable in place.
|
|
47
|
+
|
|
48
|
+
Saves, imports, forks, and deletes reload stack state into the current Pi session. When another surface changes a referenced stack, returning to profiles refreshes profile resolution without discarding unsaved delegation fields.
|
|
49
|
+
|
|
50
|
+
## Agent-profile workspace
|
|
51
|
+
|
|
52
|
+
The profile list shows each profile's ID, display metadata, model, thinking level, stack, resolution state, auto-activation, last-applied provenance, delegation status, and a `project`/`global` scope badge. Same-ID shadow pairs are marked `shadows global:<id>` or `shadowed by project:<id>`.
|
|
53
|
+
|
|
54
|
+
Trusted projects can create profiles in either scope: the scope selector beside **New profile** (default `project`) chooses whether to write the user-global `~/.pi/forge/agent-profiles` or the project `.pi/forge/agent-profiles`. Global profiles can be edited, validated, saved, applied once, and deleted through explicit `global:<id>` routes; unqualified routes stay project-only. When editing a global profile, the prompt-stack dropdown offers only global stacks. Model choices come from Pi's model registry, thinking choices reflect model support, and stack choices come from the shared repository. The editor rejects a second auto-activation profile within the same scope.
|
|
55
|
+
|
|
56
|
+
The runtime/provenance card separates current runtime state, last-applied snapshot, source-definition changes, and field-level runtime drift.
|
|
57
|
+
|
|
58
|
+
## Delegation card
|
|
59
|
+
|
|
60
|
+
The profile delegation card edits the `subagents.profiles.<id>` values for the selected profile's scope: project profiles write to `.pi/forge/config.json`, global profiles write to `~/.pi/forge/config.json`. General defaults and `allowAgentInvocationWithoutApproval` remain config-file-only because they affect broader authorization.
|
|
61
|
+
|
|
62
|
+
Unsaved delegation changes are guarded when selecting another profile, starting another profile operation, refreshing, deleting, or leaving/reloading the page. The card shows effective values and the source of each inherited or overridden setting.
|
|
63
|
+
|
|
64
|
+
Read [foreground delegation](delegation.md) before enabling a profile.
|
|
65
|
+
|
|
66
|
+
## Migration
|
|
67
|
+
|
|
68
|
+
To copy legacy `.pi/prompt-stacks` into `.pi/forge/prompt-stacks`:
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
/preset migrate-stacks --dry-run
|
|
72
|
+
/preset migrate-stacks
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Review before adding `--overwrite` or `--delete-legacy`.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Command reference
|
|
2
|
+
|
|
3
|
+
[Documentation](../README.md) · [中文](../zh-CN/reference/commands.md)
|
|
4
|
+
|
|
5
|
+
Arguments in brackets are optional. Commands that write project files require a trusted project.
|
|
6
|
+
|
|
7
|
+
## Prompt stacks
|
|
8
|
+
|
|
9
|
+
| Command | Behavior |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `/preset list` | List stacks and activation/validation state. |
|
|
12
|
+
| `/preset status` | Show the selected stack and diagnostics summary. |
|
|
13
|
+
| `/preset use <id>` | Validate and select a stack. |
|
|
14
|
+
| `/preset use none` | Disable prompt stacks for this session branch. `off` is accepted as an alias. |
|
|
15
|
+
| `/preset preview [id]` | Compile and display a stack without provider transport. Defaults to the selected stack. |
|
|
16
|
+
| `/preset validate [id]` | Validate one stack or all stacks when omitted. |
|
|
17
|
+
| `/preset diagnostics` | Show loader, runtime, policy, regex, and trusted-extension diagnostics. |
|
|
18
|
+
| `/preset reload` | Reload stacks and trusted macro/slot registrations. |
|
|
19
|
+
| `/preset ui [stop\|restart]` | Open, stop, or replace the local web editor. |
|
|
20
|
+
|
|
21
|
+
## Storage migration and import
|
|
22
|
+
|
|
23
|
+
| Command | Behavior |
|
|
24
|
+
|---|---|
|
|
25
|
+
| `/preset migrate-stacks [--dry-run] [--overwrite] [--delete-legacy]` | Copy legacy `.pi/prompt-stacks` files into `.pi/forge/prompt-stacks`. |
|
|
26
|
+
| `/preset import-silly <path> [character_id] [--dry-run] [--overwrite]` | Convert a SillyTavern preset and write a migration report. |
|
|
27
|
+
|
|
28
|
+
Use migration/import dry runs before overwriting or deleting anything. See [SillyTavern import](../guides/sillytavern-import.md).
|
|
29
|
+
|
|
30
|
+
## Agent profiles
|
|
31
|
+
|
|
32
|
+
| Command | Behavior |
|
|
33
|
+
|---|---|
|
|
34
|
+
| `/profile list` | List project profiles and resolution diagnostics. |
|
|
35
|
+
| `/profile use <id>` | Preflight and apply a profile once. |
|
|
36
|
+
| `/profile save <id> [--overwrite]` | Capture the current model, thinking level, and stack. |
|
|
37
|
+
| `/profile status` | Compare current runtime with last-applied branch provenance. |
|
|
38
|
+
| `/profile preview <id>` | Resolve model/auth/thinking/stack/tools without applying. |
|
|
39
|
+
| `/profile validate [id]` | Validate one profile or all profiles when omitted. |
|
|
40
|
+
| `/profile reload` | Reload definitions without applying them. |
|
|
41
|
+
| `/profile forget` | Remove last-applied provenance without changing runtime state. |
|
|
42
|
+
|
|
43
|
+
## Experimental foreground delegation
|
|
44
|
+
|
|
45
|
+
| Command | Behavior |
|
|
46
|
+
|---|---|
|
|
47
|
+
| `/forge-agent backends` | List registered experimental backends, capabilities, and effective defaults. |
|
|
48
|
+
| `/forge-agent plan <profile> [--backend <id>] <task>` | Prepare, validate, display, and discard an exact plan without provider transport. |
|
|
49
|
+
| `/forge-agent run <profile> [--backend <id>] <task>` | Review and approve an exact foreground read-only run. |
|
|
50
|
+
|
|
51
|
+
Only project-authorized delegation profiles are accepted. The model-callable equivalents are `forge_subagent_profiles` (local discovery) and `forge_subagent` (execution). See the [delegation safety guide](../guides/delegation.md).
|
|
52
|
+
|
|
53
|
+
## Payload inspection
|
|
54
|
+
|
|
55
|
+
| Command | Behavior |
|
|
56
|
+
|---|---|
|
|
57
|
+
| `/intercept` | Display the next redacted provider payload. |
|
|
58
|
+
| `/payload next [save=<path>]` | Display the next payload, optionally save it, and expose it to the web editor. |
|
|
59
|
+
|
|
60
|
+
Saved payloads may include prompt and conversation text even though credential-shaped fields are redacted. Handle them as potentially sensitive.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Configuration reference
|
|
2
|
+
|
|
3
|
+
[Documentation](../README.md)
|
|
4
|
+
|
|
5
|
+
Project configuration lives in `.pi/forge/config.json` and is loaded only for a trusted project. User defaults live in `~/.pi/forge/config.json`.
|
|
6
|
+
|
|
7
|
+
## Web editor
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"webEditor": {
|
|
12
|
+
"port": 41738
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The port is preferred, not guaranteed. The editor binds only to `127.0.0.1` and chooses another available port when necessary.
|
|
18
|
+
|
|
19
|
+
## Experimental subagents
|
|
20
|
+
|
|
21
|
+
User configuration may set general defaults:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"subagents": {
|
|
26
|
+
"backend": "pi-subprocess-readonly",
|
|
27
|
+
"timeoutMs": 60000
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Trusted project configuration may override defaults, authorize individual project profile IDs, and authorize unattended model invocation:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"subagents": {
|
|
37
|
+
"backend": "pi-subprocess-readonly",
|
|
38
|
+
"timeoutMs": 60000,
|
|
39
|
+
"allowAgentInvocationWithoutApproval": false,
|
|
40
|
+
"profiles": {
|
|
41
|
+
"reviewer": {
|
|
42
|
+
"enabled": true,
|
|
43
|
+
"backend": "pi-rpc-readonly",
|
|
44
|
+
"timeoutMs": 180000
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Valid timeouts are 1,000–3,600,000 ms. Invalid fields warn and fall back to the preceding applicable default. General backend precedence is project then user then built-in; an interactive run and a project profile entry can further override it as described in [delegation](../guides/delegation.md#backends-and-precedence).
|
|
52
|
+
|
|
53
|
+
`subagents.summaryInToolDescription` (default `false`) embeds a compact, bounded summary of enabled subagent profiles directly in the `forge_subagent` tool description so the parent model can pick a profile without a discovery call. Ready profiles appear first, and unavailable enabled profiles include their first resolution error. It may be set in user or trusted-project configuration and applies wherever it is enabled.
|
|
54
|
+
|
|
55
|
+
`profiles` in global configuration authorizes `global:<id>` profiles; the trusted project's `profiles` authorizes `project:<id>` profiles. Same-ID profiles never inherit enablement, backend, or timeout policy from each other. `allowAgentInvocationWithoutApproval` is project-only, requires trust, and fails closed when malformed. Deleting a profile clears delegation policy only from the matching scope's config.
|
|
56
|
+
|
|
57
|
+
Treat project configuration as an authorization boundary. In particular, do not commit unattended delegation unless every permitted parent agent may transmit compiled prompt and readable project content without another human approval.
|
|
58
|
+
|
|
59
|
+
## Trusted registration directories
|
|
60
|
+
|
|
61
|
+
These are code-loading locations rather than JSON fields:
|
|
62
|
+
|
|
63
|
+
- `~/.pi/forge/extensions/` loads trusted user macro/slot registrations.
|
|
64
|
+
- `.pi/forge/extensions/` loads trusted project registrations after project trust.
|
|
65
|
+
|
|
66
|
+
See [custom macros and slots](../guides/custom-macros-and-slots.md).
|