dsh-pstack 0.2.0-beta.1 → 0.2.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -3
- package/README.md +135 -84
- package/README.zh.md +185 -0
- package/cordis.patch.yml +97 -27
- package/dist/host-contract-CUPSpeNk.d.mts +22 -0
- package/dist/index.d.mts +49 -238
- package/dist/index.mjs +250 -123
- package/dist/models.d.mts +44 -0
- package/dist/models.mjs +201 -0
- package/dist/paths-BT77khwm.mjs +48 -0
- package/dist/pstack/LICENSE +21 -0
- package/dist/pstack/README.md +291 -0
- package/dist/pstack/agents/poteto-agent.md +9 -0
- package/{assets → dist/pstack}/docs/guide/01-setup.md +13 -11
- package/{assets → dist/pstack}/docs/guide/02-poteto-mode.md +4 -4
- package/{assets → dist/pstack}/docs/guide/04-design.md +4 -4
- package/{assets → dist/pstack}/docs/guide/05-build-and-clean.md +2 -2
- package/{assets → dist/pstack}/docs/guide/06-verify-and-ship.md +13 -3
- package/{assets → dist/pstack}/docs/guide/07-overnight.md +15 -13
- package/{assets → dist/pstack}/docs/guide/09-make-it-yours.md +6 -2
- package/{assets → dist/pstack}/docs/guide/10-recipes-and-pitfalls.md +7 -5
- package/{assets → dist/pstack}/docs/guide/README.md +1 -1
- package/dist/pstack/docs/harness/dsh.md +98 -0
- package/{assets → dist/pstack}/skills/architect/SKILL.md +12 -12
- package/dist/pstack/skills/arena/SKILL.md +50 -0
- package/{assets → dist/pstack}/skills/automate-me/SKILL.md +14 -14
- package/{assets → dist/pstack}/skills/benchmark-checklist/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/blast-radius/SKILL.md +4 -6
- package/{assets → dist/pstack}/skills/correct/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/create-formal-verification-skill/SKILL.md +4 -2
- package/{assets → dist/pstack}/skills/create-verification-skill/SKILL.md +5 -5
- package/dist/pstack/skills/figure-it-out/SKILL.md +54 -0
- package/dist/pstack/skills/how/SKILL.md +38 -0
- package/{assets → dist/pstack}/skills/in-your-own-words/SKILL.md +1 -1
- package/dist/pstack/skills/interrogate/SKILL.md +33 -0
- package/{assets → dist/pstack}/skills/ketchup/SKILL.md +3 -5
- package/dist/pstack/skills/ketchup-video/SKILL.md +29 -0
- package/{assets → dist/pstack}/skills/maintain-formal-verification-skill/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/maintain-verification-skill/SKILL.md +3 -3
- package/dist/pstack/skills/make-bot-ui/SKILL.md +117 -0
- package/dist/pstack/skills/no-comments/SKILL.md +26 -0
- package/{assets → dist/pstack}/skills/poteto-help/SKILL.md +34 -31
- package/{assets → dist/pstack}/skills/poteto-help/references/prompting.md +1 -1
- package/{assets → dist/pstack}/skills/poteto-help/references/recipes.md +3 -3
- package/{assets → dist/pstack}/skills/poteto-mode/SKILL.md +20 -19
- package/dist/pstack/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
- package/dist/pstack/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
- package/dist/pstack/skills/poteto-mode/playbooks/autopilot-full.md +25 -0
- package/dist/pstack/skills/poteto-mode/playbooks/autopilot-stack.md +8 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/babysit.md +4 -4
- package/dist/pstack/skills/poteto-mode/playbooks/bug-fix.md +15 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/eval.md +3 -3
- package/dist/pstack/skills/poteto-mode/playbooks/feature.md +21 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/hillclimb.md +3 -3
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/investigation.md +2 -2
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/multi-phase-plan.md +23 -23
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/opening-a-pr.md +6 -6
- package/dist/pstack/skills/poteto-mode/playbooks/orchestrate.md +25 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/pause-safely.md +2 -2
- package/dist/pstack/skills/poteto-mode/playbooks/perf-issue.md +25 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/prototype.md +4 -4
- package/dist/pstack/skills/poteto-mode/playbooks/refactoring.md +16 -0
- package/dist/pstack/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
- package/dist/pstack/skills/poteto-mode/playbooks/session-pickup.md +11 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/shipping.md +2 -2
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/trace-forensics.md +2 -2
- package/dist/pstack/skills/poteto-mode/playbooks/visual-parity.md +11 -0
- package/dist/pstack/skills/poteto-mode/playbooks/worktree-cleanup.md +12 -0
- package/{assets → dist/pstack}/skills/poteto-mode/scripts/check-plan.mjs +6 -8
- package/dist/pstack/skills/poteto-mode/scripts/check-plan.test.mjs +128 -0
- package/{assets/skills/poteto-mode/scripts/check-plan.test.mjs → dist/pstack/skills/poteto-mode/scripts/expect.mjs} +12 -101
- package/dist/pstack/skills/poteto-mode/scripts/support.mjs +93 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/cli.mjs +123 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/cli.test.mjs +217 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.mjs +119 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/github.mjs +626 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/github.test.mjs +521 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/policy.mjs +657 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/policy.test.mjs +523 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/render.mjs +106 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/types.mjs +9 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/watch-pr.mjs +5 -0
- package/{assets → dist/pstack}/skills/poteto-mode/scripts/worktree-audit.mjs +15 -22
- package/dist/pstack/skills/poteto-mode/scripts/worktree-audit.test.mjs +134 -0
- package/{assets → dist/pstack}/skills/principle-attack-the-premise/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-boundary-discipline/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-encode-lessons-in-structure/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-exhaust-the-design-space/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-experience-first/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-explain-the-number/SKILL.md +3 -2
- package/{assets → dist/pstack}/skills/principle-fix-root-causes/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-laziness-protocol/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-make-operations-idempotent/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-minimize-reader-load/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-model-the-domain/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-never-block-on-the-human/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-outcome-oriented-execution/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-prove-it-works/SKILL.md +2 -2
- package/{assets → dist/pstack}/skills/principle-redesign-from-first-principles/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-separate-before-serializing-shared-state/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-sequence-verifiable-units/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-subtract-before-you-add/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-test-behavior-not-implementation/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-type-system-discipline/SKILL.md +1 -1
- package/dist/pstack/skills/recall/SKILL.md +37 -0
- package/dist/pstack/skills/reflect/SKILL.md +71 -0
- package/{assets → dist/pstack}/skills/reflect/references/divergent-reviewer.md +4 -4
- package/{assets → dist/pstack}/skills/reflect/references/judgment-reviewer.md +2 -2
- package/{assets → dist/pstack}/skills/reflect/references/synthesizer.md +5 -5
- package/{assets → dist/pstack}/skills/reflect/references/tooling-reviewer.md +2 -2
- package/dist/pstack/skills/setup-pstack/SKILL.md +80 -0
- package/{assets → dist/pstack}/skills/sharpen/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/show-me-your-work/SKILL.md +8 -8
- package/{assets → dist/pstack}/skills/show-me-your-work/scripts/log.mjs +1 -3
- package/dist/pstack/skills/show-me-your-work/scripts/log.test.mjs +56 -0
- package/dist/pstack/skills/statechart/SKILL.md +82 -0
- package/dist/pstack/skills/statechart/references/render.md +93 -0
- package/dist/pstack/skills/statechart/scripts/backends/cfg.mjs +31 -0
- package/dist/pstack/skills/statechart/scripts/backends/mermaid.mjs +186 -0
- package/dist/pstack/skills/statechart/scripts/backends/plain-text.mjs +62 -0
- package/dist/pstack/skills/statechart/scripts/backends/report.mjs +84 -0
- package/dist/pstack/skills/statechart/scripts/frontends/config.mjs +268 -0
- package/dist/pstack/skills/statechart/scripts/frontends/dot.mjs +67 -0
- package/dist/pstack/skills/statechart/scripts/frontends/marks.mjs +94 -0
- package/dist/pstack/skills/statechart/scripts/frontends/messages.mjs +48 -0
- package/dist/pstack/skills/statechart/scripts/frontends/spec.mjs +101 -0
- package/dist/pstack/skills/statechart/scripts/frontends/trace.mjs +39 -0
- package/dist/pstack/skills/statechart/scripts/frontends/value.mjs +180 -0
- package/dist/pstack/skills/statechart/scripts/frontends/verdict.mjs +40 -0
- package/dist/pstack/skills/statechart/scripts/frontends/view.mjs +99 -0
- package/dist/pstack/skills/statechart/scripts/ir.mjs +277 -0
- package/dist/pstack/skills/statechart/scripts/passes/annotate.mjs +92 -0
- package/dist/pstack/skills/statechart/scripts/passes/label.mjs +210 -0
- package/dist/pstack/skills/statechart/scripts/passes/lift.mjs +84 -0
- package/dist/pstack/skills/statechart/scripts/passes/loop-check.mjs +47 -0
- package/dist/pstack/skills/statechart/scripts/passes/paths.mjs +72 -0
- package/dist/pstack/skills/statechart/scripts/passes/reach.mjs +135 -0
- package/dist/pstack/skills/statechart/scripts/passes/region-check.mjs +82 -0
- package/dist/pstack/skills/statechart/scripts/passes/regions.mjs +268 -0
- package/dist/pstack/skills/statechart/scripts/pipeline.mjs +72 -0
- package/dist/pstack/skills/statechart/scripts/run.mjs +440 -0
- package/dist/pstack/skills/statechart/scripts/statechart.mjs +155 -0
- package/dist/pstack/skills/statechart/scripts/statechart.test.mjs +198 -0
- package/dist/pstack/skills/statechart/scripts/worker.mjs +31 -0
- package/dist/pstack/skills/swarm/SKILL.md +43 -0
- package/{assets → dist/pstack}/skills/tdd/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/teach/SKILL.md +2 -2
- package/{assets → dist/pstack}/skills/technical-writing/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/typescript-best-practices/SKILL.md +3 -6
- package/{assets → dist/pstack}/skills/why/SKILL.md +8 -8
- package/dist/script.d.mts +9 -111
- package/dist/script.mjs +32 -329
- package/dist/skill.d.mts +38 -0
- package/dist/skill.mjs +183 -0
- package/dist/skills/authored/decision-audit/SKILL.md +99 -0
- package/dist/skills/authored/decision-audit/SKILL.zh.md +99 -0
- package/dist/skills/authored/decision-audit/references/recover-commit.md +17 -0
- package/dist/skills/authored/decision-audit/references/recover-commit.zh.md +17 -0
- package/dist/skills/authored/decision-write/SKILL.md +131 -0
- package/dist/skills/authored/decision-write/SKILL.zh.md +131 -0
- package/dist/skills/authored/decision-write/references/land.md +48 -0
- package/dist/skills/authored/decision-write/references/land.zh.md +48 -0
- package/dist/skills/authored/setup-project-docs/SKILL.md +58 -0
- package/dist/skills/authored/setup-project-docs/SKILL.zh.md +58 -0
- package/dist/skills/authored/setup-project-docs/references/decision-conventions.md +11 -0
- package/dist/skills/authored/setup-project-docs/references/decision-conventions.zh.md +11 -0
- package/dist/skills/vendored/retro/SKILL.md +44 -0
- package/dist/skills/vendored/retro/agents/openai.yaml +5 -0
- package/dist/skills/vendored/writing-for-agents/SKILL-MECHANICS.md +22 -0
- package/dist/skills/vendored/writing-for-agents/SKILL.md +81 -0
- package/dist/skills/vendored/writing-for-agents/agents/openai.yaml +3 -0
- package/dist/subagent.d.mts +56 -193
- package/dist/subagent.mjs +443 -741
- package/locale/en.json +3 -2
- package/locale/zh.json +3 -2
- package/package.json +63 -66
- package/assets/agents/poteto-agent.md +0 -8
- package/assets/docs/harness/dsh.md +0 -60
- package/assets/docs/pstack-models.example.md +0 -54
- package/assets/skills/arena/SKILL.md +0 -50
- package/assets/skills/figure-it-out/SKILL.md +0 -54
- package/assets/skills/how/SKILL.md +0 -38
- package/assets/skills/interrogate/SKILL.md +0 -71
- package/assets/skills/interrogate/references/code-quality-review.md +0 -47
- package/assets/skills/interrogate/references/lead-judgment.md +0 -39
- package/assets/skills/interrogate/references/reviewer-prompt.md +0 -62
- package/assets/skills/interrogate/references/rubric.md +0 -77
- package/assets/skills/no-comments/SKILL.md +0 -26
- package/assets/skills/poteto-mode/playbooks/authoring-a-skill.md +0 -12
- package/assets/skills/poteto-mode/playbooks/autonomous-run.md +0 -15
- package/assets/skills/poteto-mode/playbooks/autopilot-full.md +0 -25
- package/assets/skills/poteto-mode/playbooks/autopilot-stack.md +0 -12
- package/assets/skills/poteto-mode/playbooks/bug-fix.md +0 -15
- package/assets/skills/poteto-mode/playbooks/feature.md +0 -21
- package/assets/skills/poteto-mode/playbooks/orchestrate.md +0 -112
- package/assets/skills/poteto-mode/playbooks/perf-issue.md +0 -25
- package/assets/skills/poteto-mode/playbooks/refactoring.md +0 -16
- package/assets/skills/poteto-mode/playbooks/runtime-forensics.md +0 -11
- package/assets/skills/poteto-mode/playbooks/session-pickup.md +0 -11
- package/assets/skills/poteto-mode/playbooks/visual-parity.md +0 -11
- package/assets/skills/poteto-mode/playbooks/worktree-cleanup.md +0 -20
- package/assets/skills/poteto-mode/scripts/orch/orch.mjs +0 -4282
- package/assets/skills/poteto-mode/scripts/orch/orch.test.mjs +0 -2042
- package/assets/skills/poteto-mode/scripts/watch-pr/cli.test.mjs +0 -5101
- package/assets/skills/poteto-mode/scripts/watch-pr/github.test.mjs +0 -1177
- package/assets/skills/poteto-mode/scripts/watch-pr/policy.test.mjs +0 -1441
- package/assets/skills/poteto-mode/scripts/watch-pr/watch-pr.mjs +0 -4601
- package/assets/skills/recall/SKILL.md +0 -37
- package/assets/skills/reflect/SKILL.md +0 -69
- package/assets/skills/setup-pstack/SKILL.md +0 -67
- package/assets/skills/swarm/SKILL.md +0 -43
- package/dist/frontmatter-BQX3ekwP.mjs +0 -229
- package/dist/frontmatter-BQX3ekwP.mjs.map +0 -1
- package/dist/history.d.mts +0 -429
- package/dist/history.mjs +0 -1129
- package/dist/history.mjs.map +0 -1
- package/dist/host-contract-o47JH_r8.d.mts +0 -527
- package/dist/index.mjs.map +0 -1
- package/dist/paths-D_JlVmBk.mjs +0 -42
- package/dist/paths-D_JlVmBk.mjs.map +0 -1
- package/dist/script.mjs.map +0 -1
- package/dist/subagent.mjs.map +0 -1
- /package/{static/icon.png → assets/logo.png} +0 -0
- /package/{assets → dist/pstack}/agents/comment-sicko.md +0 -0
- /package/{assets → dist/pstack}/docs/guide/03-understand.md +0 -0
- /package/{assets → dist/pstack}/docs/guide/08-principles.md +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/design.jpg +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/overnight.jpg +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/recipes.jpg +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/router.jpg +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/understanding.jpg +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/verification.jpg +0 -0
- /package/{assets → dist/pstack}/skills/architect/references/design-red-flags.md +0 -0
- /package/{assets → dist/pstack}/skills/architect/references/rationale-template.md +0 -0
- /package/{assets → dist/pstack}/skills/architect/references/runner-prompt.md +0 -0
- /package/{assets → dist/pstack}/skills/bro/SKILL.md +0 -0
- /package/{assets → dist/pstack}/skills/create-verification-skill/references/feature-map-example/README.md +0 -0
- /package/{assets → dist/pstack}/skills/create-verification-skill/references/feature-map-example/create-note.md +0 -0
- /package/{assets → dist/pstack}/skills/create-verification-skill/references/feature-map-example/search.md +0 -0
- /package/{assets → dist/pstack}/skills/how/references/explainer-prompt.md +0 -0
- /package/{assets → dist/pstack}/skills/how/references/explorer-prompt.md +0 -0
- /package/{assets → dist/pstack}/skills/poteto-mode/references/bugbot-triage.md +0 -0
- /package/{assets → dist/pstack}/skills/principle-build-the-lever/SKILL.md +0 -0
- /package/{assets → dist/pstack}/skills/principle-foundational-thinking/SKILL.md +0 -0
- /package/{assets → dist/pstack}/skills/principle-guard-the-context-window/SKILL.md +0 -0
- /package/{assets → dist/pstack}/skills/show-me-your-work/references/decision-log-template.tsv +0 -0
- /package/{assets → dist/pstack}/skills/typescript-best-practices/references/patterns.md +0 -0
- /package/{assets → dist/pstack}/skills/unslop/SKILL.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/epistemics.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/investigator-prompt.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/source-playbook.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/code-archaeology.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/databricks.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/datadog.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/incident-postmortem.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/linear.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/notion.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/sentry.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/slack.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/synthesizer-prompt.md +0 -0
package/dist/subagent.d.mts
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region scripts/role-manifest.d.ts
|
|
1
|
+
import { _ as ToolsHost, g as ToolDefinition, h as SubagentsHost, m as SubagentCapabilities, n as AgentOptions, r as AgentsHost, s as LlmHost, t as Agent, v as WorkingDirectoryHost } from "./host-contract-CUPSpeNk.mjs";
|
|
3
2
|
/**
|
|
4
3
|
* The one pstack role manifest.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `setup-pstack` skill text, which points at that example instead of listing the
|
|
10
|
-
* roles again. A second literal role list anywhere is a bug.
|
|
5
|
+
* Keys are matched exactly after normalization, and commas belong to some keys
|
|
6
|
+
* (`feature, refactoring`, `reflect judgment, divergent, synthesizer`), so nothing here
|
|
7
|
+
* may split a key on a comma. A second literal role list anywhere is a bug.
|
|
11
8
|
*
|
|
12
|
-
*
|
|
13
|
-
* (`feature, refactoring`), so nothing here may be split on a comma.
|
|
14
|
-
*
|
|
15
|
-
* This module has no Node imports: the Host bundle imports it directly.
|
|
9
|
+
* This module has no Node imports: the bundle imports it directly.
|
|
16
10
|
*/
|
|
17
11
|
/** Whether a role holds one route or a comma-separated list of routes. */
|
|
18
12
|
type RoleValueShape = "single" | "list";
|
|
@@ -20,19 +14,11 @@ interface RoleSpec {
|
|
|
20
14
|
/** Exact key as written in the role file. Commas belong to the key. */
|
|
21
15
|
readonly key: string;
|
|
22
16
|
readonly shape: RoleValueShape;
|
|
23
|
-
/**
|
|
24
|
-
* A list role that automatically starts one child per entry. Only the three
|
|
25
|
-
* panel roles set this; every other list role selects one entry.
|
|
26
|
-
*/
|
|
17
|
+
/** A list role that starts one child per entry automatically. */
|
|
27
18
|
readonly autoPanel: boolean;
|
|
28
|
-
/** Skills and playbooks that read this role. */
|
|
29
|
-
readonly consumers: readonly string[];
|
|
30
|
-
readonly summary: string;
|
|
31
19
|
}
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/models.d.ts
|
|
34
20
|
/** One resolved child route. */
|
|
35
|
-
type
|
|
21
|
+
type Route = {
|
|
36
22
|
readonly kind: "inherit";
|
|
37
23
|
} | {
|
|
38
24
|
readonly kind: "route";
|
|
@@ -45,93 +31,43 @@ type RouteSelectionMode = "single" | "panel" | "selected";
|
|
|
45
31
|
interface RouteSelection {
|
|
46
32
|
readonly role: RoleSpec;
|
|
47
33
|
readonly mode: RouteSelectionMode;
|
|
48
|
-
/** Whether the role came from the file or
|
|
34
|
+
/** Whether the role came from the file or the inherit-parent fallback. */
|
|
49
35
|
readonly configured: boolean;
|
|
50
|
-
readonly routes: readonly
|
|
36
|
+
readonly routes: readonly Route[];
|
|
51
37
|
/** How many entries the role holds, before selection. */
|
|
52
38
|
readonly total: number;
|
|
53
39
|
readonly roleIndex?: number;
|
|
54
|
-
readonly issues: readonly string[];
|
|
55
40
|
}
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/effort.d.ts
|
|
58
|
-
/**
|
|
59
|
-
* The `agentOptions` one (route, effort override) pair contributes.
|
|
60
|
-
*
|
|
61
|
-
* The two independent halves are easy to get wrong in opposite directions:
|
|
62
|
-
*
|
|
63
|
-
* - an inherit-parent route with an override must still send `reasoningEffort`,
|
|
64
|
-
* which means `{ reasoningEffort }` on its own is a real `agentOptions` value and
|
|
65
|
-
* the backend still has to support the capability;
|
|
66
|
-
* - an override always wins over the role line, because the caller asked for this
|
|
67
|
-
* delegation specifically.
|
|
68
|
-
*/
|
|
69
|
-
export declare function agentOptionsFor(route: ChildRoute, effortOverride?: string): AgentOptions | undefined;
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/subagent.d.ts
|
|
72
41
|
/** Cordis row name, used by Loader diagnostics. */
|
|
73
42
|
export declare const name = "pstack-subagent";
|
|
74
43
|
/**
|
|
75
|
-
* Delegation needs the tool registry, the subagent registry,
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* has just started, and a composition without it still delegates: the children keep
|
|
79
|
-
* the effort their request carried and cannot change it afterwards. Declaring it as
|
|
80
|
-
* a hard dependency would make the whole row inert in such a profile, so the tool
|
|
81
|
-
* would not exist at all — the failure `pstack-history` already paid for once with
|
|
82
|
-
* `sessionQuery`. It is read per call through `ctx.get("agents")` instead, which is
|
|
83
|
-
* why a controller mounted after this row is still seen.
|
|
44
|
+
* Delegation needs the tool registry, the subagent registry, the LLM adapters, and the
|
|
45
|
+
* session directory. `agents` is not here: it is optional and read per call, so a
|
|
46
|
+
* profile without it still delegates and the child simply keeps its starting effort.
|
|
84
47
|
*/
|
|
85
48
|
export declare const inject: string[];
|
|
86
49
|
/** Model-facing tool name. */
|
|
87
50
|
export declare const TOOL_NAME = "pstack_subagent";
|
|
88
51
|
/** Backend used when the row does not name one. */
|
|
89
52
|
export declare const DEFAULT_SUBAGENT_PROVIDER = "spawn";
|
|
90
|
-
/** Agent type used when the call does not name one. */
|
|
91
|
-
export declare const DEFAULT_AGENT_KIND = "poteto-agent";
|
|
92
53
|
/** The child kinds this tool knows how to brief. */
|
|
93
54
|
export declare const AGENT_KINDS: readonly ["poteto-agent", "comment-sicko", "general"];
|
|
94
55
|
export type AgentKind = (typeof AGENT_KINDS)[number];
|
|
95
|
-
/** One exact route a row may authorize for explicit child selection. */
|
|
96
|
-
export interface AllowedModelRoute {
|
|
97
|
-
readonly provider: string;
|
|
98
|
-
readonly model: string;
|
|
99
|
-
}
|
|
100
56
|
/** Row configuration. */
|
|
101
57
|
export interface PstackSubagentConfig {
|
|
102
|
-
/** `ctx.subagents` provider to start children on. */
|
|
103
58
|
readonly provider: string;
|
|
104
|
-
/**
|
|
105
|
-
* This row's delegation-depth cap. A call may lower it and may never exceed it.
|
|
106
|
-
* Omitted means the Host setting decides.
|
|
107
|
-
*/
|
|
108
59
|
readonly maxDepth?: number;
|
|
109
|
-
/**
|
|
110
|
-
* Exact routes this row authorizes. Empty means no explicit route limit. This is
|
|
111
|
-
* pstack's own check and is unrelated to the native session `allowedModels`
|
|
112
|
-
* policy, which this plugin does not read.
|
|
113
|
-
*/
|
|
114
|
-
readonly allowedModels: readonly AllowedModelRoute[];
|
|
115
|
-
/** Non-empty allowlist; also what makes `agentPreset` appear in the schema. */
|
|
116
|
-
readonly allowedAgentPresets: readonly string[];
|
|
117
60
|
}
|
|
118
|
-
/** What a call asked for, after argument
|
|
61
|
+
/** What a call asked for, after every required argument has been validated. */
|
|
119
62
|
export interface DelegationArgs {
|
|
120
63
|
readonly description: string;
|
|
121
64
|
readonly prompt: string;
|
|
122
65
|
readonly agent: AgentKind;
|
|
123
|
-
readonly role
|
|
124
|
-
readonly cwd
|
|
125
|
-
readonly
|
|
126
|
-
readonly
|
|
127
|
-
readonly
|
|
128
|
-
/**
|
|
129
|
-
* Effort for every child this call starts, overriding each role line's value.
|
|
130
|
-
*
|
|
131
|
-
* Validated per entry against the model that entry will actually request, so a
|
|
132
|
-
* panel with one incompatible entry starts nothing rather than half its children.
|
|
133
|
-
*/
|
|
134
|
-
readonly reasoningEffort?: string;
|
|
66
|
+
readonly role: string | null;
|
|
67
|
+
readonly cwd: string | null;
|
|
68
|
+
readonly maxDepth: number;
|
|
69
|
+
readonly roleIndex: number | null;
|
|
70
|
+
readonly reasoningEffort: string | null;
|
|
135
71
|
}
|
|
136
72
|
/** One child this call started. */
|
|
137
73
|
export interface ChildRecord {
|
|
@@ -140,7 +76,6 @@ export interface ChildRecord {
|
|
|
140
76
|
readonly agent: string;
|
|
141
77
|
readonly role: string;
|
|
142
78
|
readonly route: string;
|
|
143
|
-
/** The effort this child runs at, when any applies. */
|
|
144
79
|
readonly effort?: string;
|
|
145
80
|
readonly maxDepth?: number;
|
|
146
81
|
}
|
|
@@ -158,73 +93,37 @@ export declare class PartialDelegationError extends DelegationError {
|
|
|
158
93
|
readonly startedChildren: readonly ChildRecord[];
|
|
159
94
|
constructor(message: string, startedChildren: readonly ChildRecord[]);
|
|
160
95
|
}
|
|
161
|
-
/** Raised when a required agent preamble is missing or unusable. */
|
|
162
|
-
export declare class PreambleError extends DelegationError {
|
|
163
|
-
constructor(message: string);
|
|
164
|
-
}
|
|
165
96
|
/** The live services and locations one delegation reads. */
|
|
166
97
|
export interface SubagentRuntime {
|
|
167
98
|
readonly subagents: SubagentsHost;
|
|
168
99
|
readonly llm: LlmHost;
|
|
169
|
-
/**
|
|
170
|
-
* The Agent registry, used to reach a child this tool just started.
|
|
171
|
-
*
|
|
172
|
-
* Optional because a row can be composed without the `agents` service and a
|
|
173
|
-
* delegation still works there: the children then keep the effort their request
|
|
174
|
-
* carried and simply cannot change it afterwards. Making it required would turn a
|
|
175
|
-
* missing service into a row that registers no tool at all.
|
|
176
|
-
*/
|
|
100
|
+
/** Optional: absent means the child keeps the effort it was started with. */
|
|
177
101
|
readonly agents?: AgentsHost;
|
|
178
|
-
|
|
102
|
+
readonly workingDirectory: WorkingDirectoryHost;
|
|
179
103
|
readonly dshHome: string;
|
|
180
|
-
/** Absolute package assets root, home of the agent preambles. */
|
|
181
|
-
readonly assetsRoot: string;
|
|
182
|
-
}
|
|
183
|
-
interface StandardSchemaIssue {
|
|
184
|
-
readonly message: string;
|
|
185
|
-
readonly path?: readonly (string | number)[];
|
|
186
104
|
}
|
|
187
|
-
type StandardSchemaResult = {
|
|
188
|
-
readonly value: PstackSubagentConfig;
|
|
189
|
-
readonly issues?: undefined;
|
|
190
|
-
} | {
|
|
191
|
-
readonly issues: readonly StandardSchemaIssue[];
|
|
192
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
* Minimal Standard Schema for this row, so an omitted `config` is valid and a
|
|
195
|
-
* typo fails at load instead of at the first delegation.
|
|
196
|
-
*/
|
|
197
|
-
export declare const Config: {
|
|
198
|
-
"~standard": {
|
|
199
|
-
version: number;
|
|
200
|
-
vendor: string;
|
|
201
|
-
validate(value: unknown): StandardSchemaResult;
|
|
202
|
-
};
|
|
203
|
-
};
|
|
204
105
|
/**
|
|
205
|
-
*
|
|
106
|
+
* Validate the row configuration without a Schemastery dependency.
|
|
206
107
|
*
|
|
207
|
-
* A
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*/
|
|
211
|
-
export declare function loadAgentPreamble(agent: AgentKind, assetsRoot: string): string | undefined;
|
|
212
|
-
/** One absolute path the Host injects into a child brief. */
|
|
213
|
-
export interface InjectedPath {
|
|
214
|
-
readonly label: string;
|
|
215
|
-
readonly path: string;
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Compose the self-contained prompt one child receives.
|
|
219
|
-
*
|
|
220
|
-
* The preambles used to locate things themselves; the Host injects the absolute
|
|
221
|
-
* paths instead, so a child never scans a plugin directory or guesses a version.
|
|
108
|
+
* A typo must fail at activation rather than at the first delegation, and an omitted
|
|
109
|
+
* `config` must be valid. Cordis passes the raw mapping because this row exports no
|
|
110
|
+
* `Config` object; callers that object as `config` are still checked here.
|
|
222
111
|
*/
|
|
112
|
+
export declare function normalizeConfig(value: unknown): PstackSubagentConfig;
|
|
113
|
+
/** The preset id behind each pstack agent kind. `general` joins the parent preset. */
|
|
114
|
+
export declare const AGENT_PRESETS: Readonly<Record<Exclude<AgentKind, "general">, string>>;
|
|
115
|
+
/** The preset a child of this kind must mount, or undefined to join the parent preset. */
|
|
116
|
+
export declare function agentPresetFor(agent: AgentKind): string | undefined;
|
|
117
|
+
/** Compose the self-contained prompt one child receives. */
|
|
223
118
|
export declare function composeChildPrompt(input: {
|
|
224
|
-
readonly
|
|
225
|
-
|
|
119
|
+
readonly injectedPaths?: readonly {
|
|
120
|
+
readonly label: string;
|
|
121
|
+
readonly path: string;
|
|
122
|
+
}[];
|
|
226
123
|
readonly task: string;
|
|
227
124
|
}): string;
|
|
125
|
+
/** Validate every required model-facing argument. Null declines an optional setting. */
|
|
126
|
+
export declare function parseDelegationArgs(raw: unknown): DelegationArgs;
|
|
228
127
|
/** One planned child, before any Host call. */
|
|
229
128
|
export interface ChildPlan {
|
|
230
129
|
readonly index: number;
|
|
@@ -232,16 +131,15 @@ export interface ChildPlan {
|
|
|
232
131
|
readonly label: string;
|
|
233
132
|
readonly agent: AgentKind;
|
|
234
133
|
readonly role: string;
|
|
235
|
-
readonly route:
|
|
134
|
+
readonly route: Route;
|
|
236
135
|
readonly routeLabel: string;
|
|
237
|
-
/** The effort this child will actually run at: the override when present, else the role line's. */
|
|
238
136
|
readonly effort?: string;
|
|
239
137
|
readonly agentOptions?: AgentOptions;
|
|
138
|
+
/** Preset id that supplies this child's persona and tool composition. */
|
|
240
139
|
readonly agentPreset?: string;
|
|
241
140
|
readonly cwd?: string;
|
|
242
141
|
readonly maxDepth?: number;
|
|
243
142
|
}
|
|
244
|
-
/** The decided plan for one call. */
|
|
245
143
|
export interface DelegationPlan {
|
|
246
144
|
readonly agent: AgentKind;
|
|
247
145
|
readonly prompt: string;
|
|
@@ -250,41 +148,15 @@ export interface DelegationPlan {
|
|
|
250
148
|
readonly mode: RouteSelection["mode"];
|
|
251
149
|
readonly roleIndex?: number;
|
|
252
150
|
readonly roleTotal: number;
|
|
253
|
-
/** The call-wide effort override, when it supplied one. */
|
|
254
151
|
readonly reasoningEffort?: string;
|
|
255
152
|
readonly children: readonly ChildPlan[];
|
|
256
153
|
readonly diagnostics: readonly string[];
|
|
257
154
|
}
|
|
258
|
-
/**
|
|
259
|
-
export declare function routeLabel(route:
|
|
260
|
-
/**
|
|
261
|
-
* The route text a caller sees when an effort override wins.
|
|
262
|
-
*
|
|
263
|
-
* `routeLabel` describes the role file, which stops being the whole truth once the
|
|
264
|
-
* caller overrode the effort. Reporting the file's value there would tell the model
|
|
265
|
-
* its override had been ignored.
|
|
266
|
-
*/
|
|
267
|
-
export declare function plannedRouteLabel(route: ChildRoute, effortOverride?: string): string;
|
|
268
|
-
/**
|
|
269
|
-
* Take the smallest of the requested depth, this row's cap, and the Host setting.
|
|
270
|
-
*
|
|
271
|
-
* A request above the row cap is an error rather than a silent clamp, so a caller
|
|
272
|
-
* cannot believe it asked for two levels when the row allows one.
|
|
273
|
-
*/
|
|
155
|
+
/** Route text as reported to the model. */
|
|
156
|
+
export declare function routeLabel(route: Route, effortOverride?: string): string;
|
|
157
|
+
/** Take the smallest of the requested depth, this row's cap, and the Host setting. */
|
|
274
158
|
export declare function resolveDelegationDepth(configured: number | undefined, requested: number | undefined, hostLimit: number | undefined): number | undefined;
|
|
275
|
-
/**
|
|
276
|
-
* Validate the model-facing arguments.
|
|
277
|
-
*
|
|
278
|
-
* The tool schema is advisory at the model boundary, so every constraint is
|
|
279
|
-
* re-checked here and reported with the reason.
|
|
280
|
-
*/
|
|
281
|
-
export declare function parseDelegationArgs(raw: unknown, config?: PstackSubagentConfig): DelegationArgs;
|
|
282
|
-
/**
|
|
283
|
-
* Resolve the role file, the routes, the prompt, and the depth into one plan.
|
|
284
|
-
*
|
|
285
|
-
* Pure with respect to the Host: it reads the role file and the packaged preamble,
|
|
286
|
-
* and it makes no service call.
|
|
287
|
-
*/
|
|
159
|
+
/** Resolve the role file, routes, prompt, and depth into one plan. Pure of service calls. */
|
|
288
160
|
export declare function planDelegation(args: DelegationArgs, runtime: SubagentRuntime, config?: PstackSubagentConfig): DelegationPlan;
|
|
289
161
|
/** Check the backend can enforce what this call asks for. */
|
|
290
162
|
export declare function assertProviderCapabilities(capabilities: SubagentCapabilities, providerName: string, asks: {
|
|
@@ -293,44 +165,35 @@ export declare function assertProviderCapabilities(capabilities: SubagentCapabil
|
|
|
293
165
|
readonly maxDepth: boolean;
|
|
294
166
|
}): void;
|
|
295
167
|
/**
|
|
296
|
-
*
|
|
168
|
+
* Resolve and validate one child's `cwd`.
|
|
297
169
|
*
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
170
|
+
* A child may run inside the session directory or inside an explicitly separate Git
|
|
171
|
+
* worktree. Anything else is refused: this tool does not create isolation, so it will
|
|
172
|
+
* not promise one.
|
|
173
|
+
*/
|
|
174
|
+
export declare function resolveChildCwd(requested: string | undefined, sessionRoot: string): string | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* Start the planned children. Everything rejectable has already been rejected; a
|
|
177
|
+
* failure at entry N keeps children 1..N-1 running and reports their ids.
|
|
301
178
|
*/
|
|
302
179
|
export declare function startPlannedChildren(parent: Agent, plan: DelegationPlan, runtime: SubagentRuntime, config: PstackSubagentConfig, signal: AbortSignal): Promise<DelegationResult>;
|
|
303
180
|
/** Full delegation: plan, validate, start. */
|
|
304
181
|
export declare function delegate(parent: Agent, args: DelegationArgs, runtime: SubagentRuntime, config?: PstackSubagentConfig, signal?: AbortSignal): Promise<DelegationResult>;
|
|
305
|
-
export declare const OUTPUT_SCHEMA: JsonSchemaNode;
|
|
306
182
|
/** Render one delegation result for the model. */
|
|
307
183
|
export declare function renderDelegationResult(result: DelegationResult): string;
|
|
308
184
|
/** Build the model-facing tool for one row. */
|
|
309
185
|
export declare function createPstackSubagentTool(runtime: SubagentRuntime, config?: PstackSubagentConfig): ToolDefinition;
|
|
310
|
-
/**
|
|
311
|
-
* The slices of the Cordis context this row uses.
|
|
312
|
-
*
|
|
313
|
-
* `agents` is optional in both directions: it is absent from `inject` and read per
|
|
314
|
-
* call below, so a profile that mounts no agent registry still registers this tool.
|
|
315
|
-
* See the `inject` comment for why a hard dependency is the wrong shape here.
|
|
316
|
-
*/
|
|
186
|
+
/** The slices of the Cordis context this row uses. */
|
|
317
187
|
export interface PstackSubagentHost {
|
|
318
188
|
readonly tools: ToolsHost;
|
|
319
189
|
readonly subagents: SubagentsHost;
|
|
320
190
|
readonly llm: LlmHost;
|
|
191
|
+
readonly workingDirectory: WorkingDirectoryHost;
|
|
321
192
|
}
|
|
322
193
|
/** Build the runtime a real Host call reads. */
|
|
323
194
|
export declare function hostRuntime(ctx: PstackSubagentHost, getAgentRegistry?: () => AgentsHost | undefined): SubagentRuntime;
|
|
324
|
-
/**
|
|
325
|
-
* Register `pstack_subagent` for this row.
|
|
326
|
-
*
|
|
327
|
-
* @param ctx - context providing the tool registry, the subagent registry, the LLM
|
|
328
|
-
* adapters, and optionally `ctx.get` for the agent registry.
|
|
329
|
-
* @param config - validated row config.
|
|
330
|
-
*/
|
|
195
|
+
/** Register `pstack_subagent` for this row. */
|
|
331
196
|
export declare function apply(ctx: PstackSubagentHost & {
|
|
332
197
|
get?: (name: string) => AgentsHost | undefined;
|
|
333
|
-
}, config?:
|
|
334
|
-
|
|
335
|
-
export {};
|
|
336
|
-
//# sourceMappingURL=subagent.d.mts.map
|
|
198
|
+
}, config?: unknown): void;
|
|
199
|
+
export {};
|