@starlein/paperclip-plugin-company-wizard 0.4.12 → 0.4.16

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.
Files changed (120) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/manifest.js +1 -1
  3. package/dist/manifest.js.map +1 -1
  4. package/dist/worker.js +71 -70
  5. package/dist/worker.js.map +2 -2
  6. package/package.json +1 -1
  7. package/templates/bootstrap-instructions.md +2 -1
  8. package/templates/modules/accessibility/agents/engineer/skills/accessibility-audit.fallback.md +2 -2
  9. package/templates/modules/accessibility/agents/ui-designer/skills/accessibility-audit.fallback.md +2 -2
  10. package/templates/modules/accessibility/module.meta.json +1 -1
  11. package/templates/modules/accessibility/skills/accessibility-audit.bar.md +1 -1
  12. package/templates/modules/accessibility/skills/accessibility-audit.md +1 -1
  13. package/templates/modules/architecture-plan/agents/ceo/skills/architecture-plan.bar.md +2 -2
  14. package/templates/modules/architecture-plan/agents/ceo/skills/architecture-plan.fallback.md +2 -2
  15. package/templates/modules/architecture-plan/agents/engineer/skills/design-system.fallback.md +2 -2
  16. package/templates/modules/architecture-plan/agents/ui-designer/skills/architecture-plan.md +2 -2
  17. package/templates/modules/architecture-plan/agents/ui-designer/skills/design-system.md +2 -2
  18. package/templates/modules/architecture-plan/module.meta.json +2 -2
  19. package/templates/modules/architecture-plan/skills/architecture-plan.bar.md +1 -1
  20. package/templates/modules/architecture-plan/skills/architecture-plan.md +2 -2
  21. package/templates/modules/architecture-plan/skills/design-system.md +5 -5
  22. package/templates/modules/backlog/docs/backlog-template.md +1 -1
  23. package/templates/modules/brand-identity/agents/ceo/skills/brand-identity.fallback.md +2 -2
  24. package/templates/modules/brand-identity/agents/cmo/skills/brand-identity.fallback.md +2 -2
  25. package/templates/modules/brand-identity/module.meta.json +1 -1
  26. package/templates/modules/brand-identity/skills/brand-identity.bar.md +1 -1
  27. package/templates/modules/brand-identity/skills/brand-identity.md +3 -3
  28. package/templates/modules/build-api/skills/api-design.bar.md +1 -1
  29. package/templates/modules/build-api/skills/api-design.md +1 -1
  30. package/templates/modules/ci-cd/agents/devops/skills/ci-cd.md +1 -1
  31. package/templates/modules/ci-cd/agents/engineer/skills/ci-cd.fallback.md +2 -2
  32. package/templates/modules/ci-cd/module.meta.json +1 -1
  33. package/templates/modules/ci-cd/skills/ci-cd.bar.md +1 -1
  34. package/templates/modules/ci-cd/skills/ci-cd.md +4 -4
  35. package/templates/modules/codebase-onboarding/agents/ceo/skills/codebase-audit.fallback.md +5 -5
  36. package/templates/modules/codebase-onboarding/module.meta.json +1 -1
  37. package/templates/modules/codebase-onboarding/skills/codebase-audit.bar.md +1 -1
  38. package/templates/modules/codebase-onboarding/skills/codebase-audit.md +2 -2
  39. package/templates/modules/competitive-intel/agents/ceo/skills/competitive-tracking.fallback.md +2 -2
  40. package/templates/modules/competitive-intel/agents/cmo/skills/competitive-tracking.fallback.md +2 -2
  41. package/templates/modules/competitive-intel/agents/customer-success/skills/competitive-tracking.md +2 -2
  42. package/templates/modules/competitive-intel/agents/product-owner/skills/competitive-tracking.fallback.md +2 -2
  43. package/templates/modules/competitive-intel/module.meta.json +1 -1
  44. package/templates/modules/competitive-intel/skills/competitive-tracking.bar.md +2 -2
  45. package/templates/modules/competitive-intel/skills/competitive-tracking.md +2 -2
  46. package/templates/modules/dependency-management/agents/engineer/skills/dependency-audit.fallback.md +2 -2
  47. package/templates/modules/dependency-management/skills/dependency-audit.md +2 -2
  48. package/templates/modules/game-design/agents/ceo/skills/game-design.fallback.md +1 -1
  49. package/templates/modules/game-design/agents/game-designer/skills/game-design.md +2 -2
  50. package/templates/modules/game-design/module.meta.json +1 -1
  51. package/templates/modules/game-design/skills/audio-design.fallback.md +2 -2
  52. package/templates/modules/game-design/skills/audio-design.md +3 -3
  53. package/templates/modules/game-design/skills/game-design.bar.md +1 -1
  54. package/templates/modules/game-design/skills/game-design.md +3 -3
  55. package/templates/modules/game-design/skills/level-design.fallback.md +2 -2
  56. package/templates/modules/game-design/skills/level-design.md +4 -4
  57. package/templates/modules/github-repo/agents/engineer/skills/git-workflow.md +51 -60
  58. package/templates/modules/github-repo/docs/git-workflow.md +14 -16
  59. package/templates/modules/github-repo/module.meta.json +1 -1
  60. package/templates/modules/market-analysis/agents/ceo/skills/market-analysis.fallback.md +2 -2
  61. package/templates/modules/market-analysis/agents/cmo/skills/market-analysis.fallback.md +2 -2
  62. package/templates/modules/market-analysis/agents/product-owner/skills/market-analysis.fallback.md +2 -2
  63. package/templates/modules/market-analysis/agents/ux-researcher/skills/market-analysis.md +1 -1
  64. package/templates/modules/market-analysis/module.meta.json +1 -1
  65. package/templates/modules/market-analysis/skills/market-analysis.bar.md +1 -1
  66. package/templates/modules/market-analysis/skills/market-analysis.md +1 -1
  67. package/templates/modules/monitoring/agents/devops/skills/monitoring.md +1 -1
  68. package/templates/modules/monitoring/agents/engineer/skills/monitoring.fallback.md +2 -2
  69. package/templates/modules/monitoring/module.meta.json +1 -1
  70. package/templates/modules/monitoring/skills/monitoring.bar.md +1 -1
  71. package/templates/modules/monitoring/skills/monitoring.md +3 -3
  72. package/templates/modules/pr-review/README.md +1 -1
  73. package/templates/modules/pr-review/agents/code-reviewer/skills/code-review.md +6 -6
  74. package/templates/modules/pr-review/agents/devops/skills/infra-review.md +1 -1
  75. package/templates/modules/pr-review/agents/engineer/skills/pr-workflow.md +7 -7
  76. package/templates/modules/pr-review/agents/product-owner/skills/product-review.md +1 -1
  77. package/templates/modules/pr-review/agents/qa/skills/qa-review.md +6 -9
  78. package/templates/modules/pr-review/agents/security-engineer/skills/pr-security-review.md +1 -1
  79. package/templates/modules/pr-review/agents/ui-designer/skills/design-review.md +3 -3
  80. package/templates/modules/pr-review/agents/ux-researcher/skills/ux-review.md +2 -2
  81. package/templates/modules/pr-review/docs/pr-conventions.md +6 -4
  82. package/templates/modules/release-management/agents/ceo/skills/release-process.fallback.md +2 -2
  83. package/templates/modules/release-management/agents/engineer/skills/release-process.fallback.md +2 -2
  84. package/templates/modules/release-management/module.meta.json +1 -1
  85. package/templates/modules/release-management/skills/release-process.md +2 -2
  86. package/templates/modules/security-audit/agents/devops/skills/security-review.fallback.md +2 -2
  87. package/templates/modules/security-audit/agents/devops/skills/threat-model.fallback.md +2 -2
  88. package/templates/modules/security-audit/agents/engineer/skills/security-review.fallback.md +2 -2
  89. package/templates/modules/security-audit/agents/engineer/skills/threat-model.fallback.md +2 -2
  90. package/templates/modules/security-audit/module.meta.json +2 -2
  91. package/templates/modules/security-audit/skills/security-review.bar.md +1 -1
  92. package/templates/modules/security-audit/skills/security-review.md +1 -1
  93. package/templates/modules/security-audit/skills/threat-model.bar.md +1 -1
  94. package/templates/modules/security-audit/skills/threat-model.md +2 -2
  95. package/templates/modules/stall-detection/agents/ceo/skills/stall-detection.md +14 -2
  96. package/templates/modules/tech-stack/agents/ceo/skills/tech-stack.fallback.md +2 -2
  97. package/templates/modules/tech-stack/module.meta.json +1 -1
  98. package/templates/modules/tech-stack/skills/tech-stack.bar.md +1 -1
  99. package/templates/modules/tech-stack/skills/tech-stack.md +1 -1
  100. package/templates/modules/user-testing/agents/ceo/skills/user-testing.fallback.md +2 -2
  101. package/templates/modules/user-testing/agents/product-owner/skills/user-testing.fallback.md +2 -2
  102. package/templates/modules/user-testing/agents/qa/skills/user-testing.md +1 -1
  103. package/templates/modules/user-testing/agents/ux-researcher/skills/user-testing.fallback.md +2 -2
  104. package/templates/modules/user-testing/module.meta.json +1 -1
  105. package/templates/modules/user-testing/skills/user-testing.md +1 -1
  106. package/templates/modules/vision-workshop/agents/ceo/skills/vision-workshop.md +1 -1
  107. package/templates/modules/vision-workshop/agents/ux-researcher/skills/vision-workshop.md +1 -1
  108. package/templates/modules/vision-workshop/module.meta.json +1 -1
  109. package/templates/modules/website-relaunch/agents/ui-designer/skills/site-audit.md +1 -1
  110. package/templates/modules/website-relaunch/module.meta.json +7 -7
  111. package/templates/modules/website-relaunch/skills/design-ingestion.md +1 -1
  112. package/templates/modules/website-relaunch/skills/site-audit.md +1 -1
  113. package/templates/presets/build-game/preset.meta.json +6 -6
  114. package/templates/presets/repo-maintenance/preset.meta.json +5 -5
  115. package/templates/roles/cmo/AGENTS.md +1 -1
  116. package/templates/roles/code-reviewer/AGENTS.md +1 -1
  117. package/templates/roles/cto/AGENTS.md +4 -4
  118. package/templates/roles/devops/AGENTS.md +1 -1
  119. package/templates/roles/engineer/HEARTBEAT.md +1 -1
  120. package/templates/roles/ux-researcher/AGENTS.md +1 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,68 @@ All notable changes to the Company Wizard plugin are documented here.
4
4
 
5
5
  The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
+ ## [0.4.16] - 2026-06-28
8
+
9
+ ### Changed
10
+
11
+ **Agents and projects use external paths under `companies/<Company>/…` with relative instruction references**
12
+
13
+ Agents were provisioned with a **managed** instructions bundle (materialized by the host under `companies/<companyId>/agents/<agentId>/instructions/`), and the assembled instruction files hard-coded **absolute** `$AGENT_HOME/...` paths that pointed at the human-readable `companies/<CompanyName>/agents/<role>/` dir — a mismatch that made references fragile and unportable.
14
+
15
+ - **External instructions bundle (all agents, incl. CEO):** provisioning now points each agent at its assembled on-disk dir via `updateInstructionsBundle({ mode: 'external', rootPath: '…/companies/<Company>/agents/<role>', entryFile: 'AGENTS.md' })`. That call also sets `adapterConfig.instructionsFilePath`, which every local adapter (codex/claude/acpx) loads — instructing the model to *"resolve relative file references from the instructions directory"*. Existing managed agents are migrated to external on the next update.
16
+ - **Relative references** in assembled files: `$AGENT_HOME/HEARTBEAT.md` → `HEARTBEAT.md`, `$AGENT_HOME/skills/<x>.md` → `skills/<x>.md`. Bare `$AGENT_HOME` prose (the runtime home env var) is left intact. The old absolute-path rewrite is removed; no managed-bundle file upload happens anymore.
17
+ - **Company doc references unified to `../../docs/<y>.md`** across every agent-facing file (AGENTS.md, HEARTBEAT, skills, the shipped docs themselves like `git-workflow.md`/`pr-conventions.md`, heartbeat-sections, bootstrap-instructions, and module/preset issue descriptions) — 170+ refs. This path is **cwd-independent**: both the instructions dir (`agents/<role>/`) and the execution cwd (the project workspace `projects/<name>/`) sit at depth 2 under the company dir, so `../../docs/` resolves to `companies/<Company>/docs/` from either. A bare `docs/<y>.md` would have broken once the agent runs in a project workspace.
18
+ - **Project workspaces** are realized under `companies/<Company>/projects/<Project>` for external (`git_repo`) projects too — the repo is cloned into that dir via `workspace.cwd` instead of a separate host-managed clone path (local projects already used this path).
19
+
20
+ > Deploy + "Update templates" + update-company to migrate a live company's agents from managed to external instructions.
21
+
22
+ ## [0.4.15] - 2026-06-28
23
+
24
+ ### Fixed
25
+
26
+ **Template-cache refresh now hits the dir the worker reads (Docker) — fixes "fixed but never deployed"**
27
+
28
+ `refresh-templates` (the "Update templates" button) always deleted/re-downloaded `~/.paperclip/plugin-templates`, but on Docker instances the worker reads `~/plugin-templates` (`isDockerLayout()`). So refreshing never updated the dir the worker actually assembles from, and shipped template fixes (e.g. the v0.4.7 Code-Reviewer merge-ownership fix) silently never reached agents. A shared `resolveTemplatesCacheDir`/`refreshTemplatesCache` helper now targets the same Docker-aware dir, and `start-provision` refreshes the cache from the repo before assembling (best-effort; `params.refreshTemplates: false` opts out) so an update always provisions the latest published instructions.
29
+
30
+ ### Changed
31
+
32
+ **CI/CD is a merge gate only when the company owns it (`ci-cd` module)**
33
+
34
+ The merge gate enforced "CI must be green" whenever the repo had any CI checks — so a pre-existing/external CI on an imported repo (broken or flaky, never configured by the company) deadlocked the merge queue. Now the **authoritative gate is the merge-gate agent's executed local lint/test/build** (run it, paste the output); a green CI is required *in addition* only when the `ci-cd` module is active (the company runs its own pipeline). Without a CI/CD module, pre-existing repo checks are advisory — never block a merge solely on a check the company never set up. Reworded across `pr-conventions.md`, `code-review.md`, `qa-review.md`, the Code-Reviewer `AGENTS.md`, and the engineer `git-workflow.md`.
35
+
36
+ **Without the pr-review module, the engineer works direct-to-base instead of opening a PR**
37
+
38
+ The no-pr-review fallback was a "PR Self-Merge Flow" that still opened a PR per change — the source of the orphan/draft/conflict PR pile-up. With no reviewer, that PR adds no value, so the engineer now commits and pushes **directly to the base ref** after local verification, and opens a PR *only* as a fallback when branch protection rejects the direct push. Rewrote `github-repo` `git-workflow.md` (skill + `docs/git-workflow.md`) to the Direct-to-Base Flow, updated Branch-Protection guidance (do not require PRs for an unreviewed company), and scoped the engineer `HEARTBEAT.md` review-path rule to "pr-review active". The PR workflow remains gated to the `pr-review` module only.
39
+
40
+ ## [0.4.14] - 2026-06-25
41
+
42
+ ### Fixed
43
+
44
+ **Stranded-blocked merge issues — a CEO-routine safety net (templates)**
45
+
46
+ > The longstanding, CI-independent root cause of "agents open PRs but never merge them" was a **contradiction in the Code Reviewer's instructions** — the role's `AGENTS.md` said "Never merge PRs. That's the engineer's job." while its skill (and the engineer's pr-workflow) made the Code Reviewer the merge owner, so nobody merged. That was already fixed in **v0.4.7** (commit `3e065cf`); instances still piling up PRs are running pre-v0.4.7 instruction bundles and need a template-cache refresh + update-company to pick up the corrected instructions. This v0.4.14 entry addresses a **secondary, downstream** failure, not that root cause.
47
+
48
+ Observed on two live instances (LeadConversionOptimizer, Dial24Modern2): because the normal merge never fired, the CEO fanned a single PR out into separate per-role issues (QA/Security/Product) plus a standalone "Code review and merge PR #N" issue assigned to the Code Reviewer and `blockedBy` those reviews. When the reviews close `done`, Paperclip does not reliably re-wake the blocked merge issue (worker heartbeats are disabled, and the liveness watchdog skips a `blocked` issue whose blockers are all `done`), so even those explicit merge issues strand. Evidence: merge issues sitting `blocked` with `blockerAttention.needs_attention` and zero unresolved blockers.
49
+
50
+ Template fixes:
51
+
52
+ - `stall-detection.md` (CEO skill): new `## Stranded blocked` recovery — detect a `blocked` issue whose blockers are all `done`/`cancelled` (or `blockerAttention` with `unresolvedBlockerCount: 0`), flag `STRANDED-BLOCKED`, reactivate via `PATCH {"status":"in_progress"}`, re-assign to the merge owner to trigger a wake, and run the merge. Step 4's skip-rule now treats "blocked with all blockers done" as a stall, not validly blocked. PR-queue hygiene gains a step 7 that reconciles each open green/mergeable PR against its owning issue and merges/reactivates when the merge step was skipped.
53
+ - `bootstrap-instructions.md` + `pr-review/README.md`: explicit prohibition — one PR ⇒ one issue ⇒ its `executionPolicy` stages. Never fan a PR out into per-role `blocks`-linked issues, and never model the merge as a standalone `blockedBy` merge issue; the merge gate is the last stage on the same implementation issue, which advances in place.
54
+
55
+ > Note: the durable platform-level guarantee (auto-reactivate a `blocked` issue once it has no unresolved blockers, and/or a workspace-finalize-barrier timeout) lives in the Paperclip server, not this plugin. These template changes prevent the fan-out and add a CEO-routine safety net that recovers already-stranded merges.
56
+
57
+ ## [0.4.13] - 2026-06-25
58
+
59
+ ### Changed
60
+
61
+ **Worker agents default to `auto` thinking effort, and per-role adapter levels now reach provisioning**
62
+
63
+ Provisioned worker (non-CEO) agents were pinned to `thinkingLevel`/`modelReasoningEffort: "medium"`, and the `"thinkingLevel": "auto"` declared in each `role.meta.json` was silently dropped at provisioning time — the `roleAdapterOverrides` passed to `buildWorkerAdapterConfig` were assembled only from **module** `adapterOverrides`, never from the role's own `adapter` block. So every worker ran at a flat `medium` regardless of its template.
64
+
65
+ - `DEFAULT_WORKER_THINKING_LEVEL` changed from `medium` to `auto` — let the model pick effort per task instead of pinning a flat level. The CEO default is unchanged (`high`, still inherits the wizard's explicit setting).
66
+ - `assembleCompany` now seeds `roleAdapterOverrides` from each role's `role.meta.json` adapter (`thinkingLevel` / `modelReasoningEffort` / `reasoningEffort` / `effort`), so a role's declared level reaches the provisioned agent. Module `adapterOverrides` still merge on top (module wins).
67
+ - `buildAdapterConfig` now also resolves an override expressed as `effort`, and strips the raw thinking keys before re-applying the resolved level per adapter — so a non-codex adapter no longer carries a stray `thinkingLevel`.
68
+
7
69
  ## [0.4.12] - 2026-06-25
8
70
 
9
71
  ### Changed
package/dist/manifest.js CHANGED
@@ -2,7 +2,7 @@
2
2
  var manifest = {
3
3
  id: "starlein.paperclip-plugin-company-wizard",
4
4
  apiVersion: 1,
5
- version: "0.4.12",
5
+ version: "0.4.16",
6
6
  displayName: "Company Wizard",
7
7
  description: "AI-powered wizard to bootstrap agent companies from composable templates",
8
8
  author: "Sascha Pietrowski <sp@speednetwork.de>",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/manifest.ts"],
4
- "sourcesContent": ["import type { PaperclipPluginManifestV1 } from '@paperclipai/plugin-sdk';\n\nconst manifest: PaperclipPluginManifestV1 = {\n id: 'starlein.paperclip-plugin-company-wizard',\n apiVersion: 1,\n version: '0.4.12',\n displayName: 'Company Wizard',\n description: 'AI-powered wizard to bootstrap agent companies from composable templates',\n author: 'Sascha Pietrowski <sp@speednetwork.de>',\n categories: ['workspace', 'ui'],\n capabilities: [\n 'companies.read',\n 'issues.create',\n 'issues.read',\n 'issues.update',\n 'goals.create',\n 'goals.read',\n 'agents.read',\n 'projects.read',\n 'plugin.state.read',\n 'plugin.state.write',\n 'secrets.read-ref',\n 'events.subscribe',\n 'ui.page.register',\n 'ui.sidebar.register',\n ],\n instanceConfigSchema: {\n type: 'object',\n properties: {\n companiesDir: {\n type: 'string',\n description:\n 'Directory where assembled company workspaces are written. Auto-detected: ~/instances/default/companies in Docker setups, ~/.paperclip/instances/default/companies otherwise. Rarely needs manual override.',\n },\n templatesPath: {\n type: 'string',\n description:\n 'Path to the templates directory. Auto-detected: ~/plugin-templates in Docker setups, ~/.paperclip/plugin-templates otherwise. Rarely needs manual override.',\n },\n templatesRepoUrl: {\n type: 'string',\n default: 'https://github.com/starlein/paperclip-plugin-company-wizard/tree/main/templates',\n description:\n 'GitHub tree URL for template downloads. The default is correct for most setups \u2014 only change this if using a custom fork.',\n },\n anthropicApiKey: {\n type: 'string',\n description:\n 'Anthropic API key for the AI wizard (e.g. sk-ant-...). Required to use the AI-powered company setup path.',\n },\n paperclipUrl: {\n type: 'string',\n description:\n 'Paperclip instance URL. Defaults to http://localhost:3100 or the PAPERCLIP_PUBLIC_URL env var.',\n },\n paperclipEmail: {\n type: 'string',\n description: 'Board login email (for authenticated instances).',\n },\n paperclipPassword: {\n type: 'string',\n description: 'Board login password (for authenticated instances).',\n },\n },\n },\n entrypoints: {\n worker: './dist/worker.js',\n ui: './dist/ui',\n },\n ui: {\n slots: [\n {\n type: 'page',\n id: 'company-wizard',\n displayName: 'Company Wizard',\n exportName: 'WizardPage',\n routePath: 'company-creator',\n },\n {\n type: 'sidebar',\n id: 'company-wizard-link',\n displayName: 'Create Company',\n exportName: 'SidebarLink',\n },\n ],\n },\n};\n\nexport default manifest;\n"],
4
+ "sourcesContent": ["import type { PaperclipPluginManifestV1 } from '@paperclipai/plugin-sdk';\n\nconst manifest: PaperclipPluginManifestV1 = {\n id: 'starlein.paperclip-plugin-company-wizard',\n apiVersion: 1,\n version: '0.4.16',\n displayName: 'Company Wizard',\n description: 'AI-powered wizard to bootstrap agent companies from composable templates',\n author: 'Sascha Pietrowski <sp@speednetwork.de>',\n categories: ['workspace', 'ui'],\n capabilities: [\n 'companies.read',\n 'issues.create',\n 'issues.read',\n 'issues.update',\n 'goals.create',\n 'goals.read',\n 'agents.read',\n 'projects.read',\n 'plugin.state.read',\n 'plugin.state.write',\n 'secrets.read-ref',\n 'events.subscribe',\n 'ui.page.register',\n 'ui.sidebar.register',\n ],\n instanceConfigSchema: {\n type: 'object',\n properties: {\n companiesDir: {\n type: 'string',\n description:\n 'Directory where assembled company workspaces are written. Auto-detected: ~/instances/default/companies in Docker setups, ~/.paperclip/instances/default/companies otherwise. Rarely needs manual override.',\n },\n templatesPath: {\n type: 'string',\n description:\n 'Path to the templates directory. Auto-detected: ~/plugin-templates in Docker setups, ~/.paperclip/plugin-templates otherwise. Rarely needs manual override.',\n },\n templatesRepoUrl: {\n type: 'string',\n default: 'https://github.com/starlein/paperclip-plugin-company-wizard/tree/main/templates',\n description:\n 'GitHub tree URL for template downloads. The default is correct for most setups \u2014 only change this if using a custom fork.',\n },\n anthropicApiKey: {\n type: 'string',\n description:\n 'Anthropic API key for the AI wizard (e.g. sk-ant-...). Required to use the AI-powered company setup path.',\n },\n paperclipUrl: {\n type: 'string',\n description:\n 'Paperclip instance URL. Defaults to http://localhost:3100 or the PAPERCLIP_PUBLIC_URL env var.',\n },\n paperclipEmail: {\n type: 'string',\n description: 'Board login email (for authenticated instances).',\n },\n paperclipPassword: {\n type: 'string',\n description: 'Board login password (for authenticated instances).',\n },\n },\n },\n entrypoints: {\n worker: './dist/worker.js',\n ui: './dist/ui',\n },\n ui: {\n slots: [\n {\n type: 'page',\n id: 'company-wizard',\n displayName: 'Company Wizard',\n exportName: 'WizardPage',\n routePath: 'company-creator',\n },\n {\n type: 'sidebar',\n id: 'company-wizard-link',\n displayName: 'Create Company',\n exportName: 'SidebarLink',\n },\n ],\n },\n};\n\nexport default manifest;\n"],
5
5
  "mappings": ";AAEA,IAAM,WAAsC;AAAA,EAC1C,IAAI;AAAA,EACJ,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,aAAa;AAAA,EACb,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,YAAY,CAAC,aAAa,IAAI;AAAA,EAC9B,cAAc;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,sBAAsB;AAAA,IACpB,MAAM;AAAA,IACN,YAAY;AAAA,MACV,cAAc;AAAA,QACZ,MAAM;AAAA,QACN,aACE;AAAA,MACJ;AAAA,MACA,eAAe;AAAA,QACb,MAAM;AAAA,QACN,aACE;AAAA,MACJ;AAAA,MACA,kBAAkB;AAAA,QAChB,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aACE;AAAA,MACJ;AAAA,MACA,iBAAiB;AAAA,QACf,MAAM;AAAA,QACN,aACE;AAAA,MACJ;AAAA,MACA,cAAc;AAAA,QACZ,MAAM;AAAA,QACN,aACE;AAAA,MACJ;AAAA,MACA,gBAAgB;AAAA,QACd,MAAM;AAAA,QACN,aAAa;AAAA,MACf;AAAA,MACA,mBAAmB;AAAA,QACjB,MAAM;AAAA,QACN,aAAa;AAAA,MACf;AAAA,IACF;AAAA,EACF;AAAA,EACA,aAAa;AAAA,IACX,QAAQ;AAAA,IACR,IAAI;AAAA,EACN;AAAA,EACA,IAAI;AAAA,IACF,OAAO;AAAA,MACL;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,aAAa;AAAA,QACb,YAAY;AAAA,QACZ,WAAW;AAAA,MACb;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,aAAa;AAAA,QACb,YAAY;AAAA,MACd;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,mBAAQ;",
6
6
  "names": []
7
7
  }
package/dist/worker.js CHANGED
@@ -9282,7 +9282,7 @@ import { join } from "node:path";
9282
9282
  var DEFAULT_CEO_ADAPTER_TYPE = "codex_local";
9283
9283
  var DEFAULT_CEO_MODEL = "gpt-5.5";
9284
9284
  var DEFAULT_CEO_THINKING_LEVEL = "high";
9285
- var DEFAULT_WORKER_THINKING_LEVEL = "medium";
9285
+ var DEFAULT_WORKER_THINKING_LEVEL = "auto";
9286
9286
  var DEFAULT_CEO_MAX_CONCURRENT_RUNS = 1;
9287
9287
  var DEFAULT_CEO_HEARTBEAT_INTERVAL_SEC = 3600;
9288
9288
  var DEFAULT_CLAUDE_CEO_MODEL = "claude-opus-4-6";
@@ -9306,7 +9306,7 @@ function buildAdapterConfig({
9306
9306
  const defaultModel = adapterType === "claude_local" ? DEFAULT_CLAUDE_CEO_MODEL : DEFAULT_CEO_MODEL;
9307
9307
  const model = userModel || overrideModel || defaultModel;
9308
9308
  const userThinking = inheritUserThinking ? asTrimmedString(userCeoAdapter.thinkingLevel) || asTrimmedString(userCeoAdapter.modelReasoningEffort) || asTrimmedString(userCeoAdapter.reasoningEffort) : "";
9309
- const thinkingLevel = userThinking || asTrimmedString(roleAdapterOverrides.thinkingLevel) || asTrimmedString(roleAdapterOverrides.modelReasoningEffort) || asTrimmedString(roleAdapterOverrides.reasoningEffort) || defaultThinkingLevel;
9309
+ const thinkingLevel = userThinking || asTrimmedString(roleAdapterOverrides.thinkingLevel) || asTrimmedString(roleAdapterOverrides.modelReasoningEffort) || asTrimmedString(roleAdapterOverrides.reasoningEffort) || asTrimmedString(roleAdapterOverrides.effort) || defaultThinkingLevel;
9310
9310
  const adapterConfig = {
9311
9311
  ...roleAdapterOverrides,
9312
9312
  cwd: userCwd || companyDir,
@@ -9314,6 +9314,10 @@ function buildAdapterConfig({
9314
9314
  };
9315
9315
  delete adapterConfig.promptTemplate;
9316
9316
  delete adapterConfig.bootstrapPromptTemplate;
9317
+ delete adapterConfig.thinkingLevel;
9318
+ delete adapterConfig.modelReasoningEffort;
9319
+ delete adapterConfig.reasoningEffort;
9320
+ delete adapterConfig.effort;
9317
9321
  if (adapterType === "codex_local") {
9318
9322
  adapterConfig.modelReasoningEffort = thinkingLevel;
9319
9323
  adapterConfig.thinkingLevel = thinkingLevel;
@@ -9526,6 +9530,14 @@ async function assembleCompany({
9526
9530
  const initialRoutines = Array.isArray(presetRoutines) ? presetRoutines.map((routine) => ({ ...routine, source: routine.source || "preset" })) : [];
9527
9531
  const explicitBootstrapLabels = Array.isArray(presetLabels) ? [...presetLabels] : [];
9528
9532
  const roleAdapterOverrides = /* @__PURE__ */ new Map();
9533
+ for (const role of allRoles) {
9534
+ const roleMeta = roleMetaByName.get(role) || {};
9535
+ const adapter = roleMeta && typeof roleMeta.adapter === "object" ? roleMeta.adapter : {};
9536
+ const thinkingLevel = typeof adapter.thinkingLevel === "string" && adapter.thinkingLevel.trim() || typeof adapter.modelReasoningEffort === "string" && adapter.modelReasoningEffort.trim() || typeof adapter.reasoningEffort === "string" && adapter.reasoningEffort.trim() || typeof adapter.effort === "string" && adapter.effort.trim() || "";
9537
+ if (thinkingLevel) {
9538
+ roleAdapterOverrides.set(role, { thinkingLevel });
9539
+ }
9540
+ }
9529
9541
  const docRoleMap = /* @__PURE__ */ new Map();
9530
9542
  const addDocRoles = (docName, roles) => {
9531
9543
  const set = docRoleMap.get(docName) ?? /* @__PURE__ */ new Set();
@@ -9718,7 +9730,7 @@ ${stages.join("\n")}
9718
9730
  await appendToFile(
9719
9731
  join(companyDir, "agents", roleName, "AGENTS.md"),
9720
9732
  `
9721
- Read and follow: \`$AGENT_HOME/skills/${fileName}\`
9733
+ Read and follow: \`skills/${fileName}\`
9722
9734
  `
9723
9735
  );
9724
9736
  const sourceTag = resolved.source === "shared" ? ", shared" : "";
@@ -9757,7 +9769,7 @@ Read and follow: \`$AGENT_HOME/skills/${fileName}\`
9757
9769
  await appendToFile(
9758
9770
  join(companyDir, "agents", role.name, "AGENTS.md"),
9759
9771
  `
9760
- Read and follow: \`$AGENT_HOME/skills/${skillFile}\`
9772
+ Read and follow: \`skills/${skillFile}\`
9761
9773
  `
9762
9774
  );
9763
9775
  onProgress(`+ agents/${role.name}/skills/${skillFile} (${moduleName})`);
@@ -9825,10 +9837,10 @@ Read and follow: \`$AGENT_HOME/skills/${skillFile}\`
9825
9837
  return !roles || roles.has("*") || roles.has(role.name);
9826
9838
  });
9827
9839
  if (relevantDocs.length === 0) continue;
9828
- let docRefs = "\n## Shared Documentation\n\nReference docs relevant to your role (paths are relative to your workspace home):\n";
9840
+ let docRefs = "\n## Shared Documentation\n\nReference docs relevant to your role (paths are relative to this AGENTS.md, in the shared company docs dir):\n";
9829
9841
  for (const doc of relevantDocs) {
9830
9842
  docRefs += `
9831
- Read: \`docs/${doc}\`
9843
+ Read: \`../../docs/${doc}\`
9832
9844
  `;
9833
9845
  }
9834
9846
  await appendToFile(agentsMd, docRefs);
@@ -9840,7 +9852,6 @@ Read: \`docs/${doc}\`
9840
9852
  const agentRoleDirs = await readdir(agentsBaseDirForSubst, { withFileTypes: true });
9841
9853
  for (const roleDir of agentRoleDirs) {
9842
9854
  if (!roleDir.isDirectory()) continue;
9843
- const absoluteAgentHome = join(agentsBaseDirForSubst, roleDir.name);
9844
9855
  const subst = async (dir) => {
9845
9856
  const entries = await readdir(dir, { withFileTypes: true });
9846
9857
  for (const entry of entries) {
@@ -9849,8 +9860,8 @@ Read: \`docs/${doc}\`
9849
9860
  await subst(full);
9850
9861
  } else if (entry.name.endsWith(".md")) {
9851
9862
  const content = await readFile(full, "utf-8");
9852
- if (content.includes("$AGENT_HOME")) {
9853
- await writeFile(full, content.split("$AGENT_HOME").join(absoluteAgentHome));
9863
+ if (content.includes("$AGENT_HOME/")) {
9864
+ await writeFile(full, content.split("$AGENT_HOME/").join(""));
9854
9865
  }
9855
9866
  }
9856
9867
  }
@@ -10067,7 +10078,7 @@ Read: \`docs/${doc}\`
10067
10078
  if (repoUrl) workspace.repoUrl = repoUrl;
10068
10079
  if (repoRef) workspace.repoRef = repoRef;
10069
10080
  if (defaultRef) workspace.defaultRef = defaultRef;
10070
- delete workspace.cwd;
10081
+ if (!workspace.cwd) workspace.cwd = localCwd;
10071
10082
  } else {
10072
10083
  if (!workspace.cwd) workspace.cwd = localCwd;
10073
10084
  const trimmedSetup = typeof workspace.setupCommand === "string" ? workspace.setupCommand.trim() : "";
@@ -11011,7 +11022,7 @@ var __dirname = path2.dirname(fileURLToPath2(import.meta.url));
11011
11022
  var DEFAULT_TEMPLATES_REPO_URL = "https://github.com/starlein/paperclip-plugin-company-wizard/tree/main/templates";
11012
11023
  var BUNDLED_TEMPLATES_DIR = path2.resolve(__dirname, "..", "templates");
11013
11024
  var PLUGIN_PACKAGE_NAME = "@starlein/paperclip-plugin-company-wizard";
11014
- var CURRENT_PLUGIN_VERSION = "0.4.12";
11025
+ var CURRENT_PLUGIN_VERSION = "0.4.16";
11015
11026
  var NPM_LATEST_URL = "https://registry.npmjs.org/@starlein%2Fpaperclip-plugin-company-wizard/latest";
11016
11027
  function copyDirSync(src, dest) {
11017
11028
  fs2.mkdirSync(dest, { recursive: true });
@@ -11090,6 +11101,21 @@ async function ensureTemplatesDir(cfg) {
11090
11101
  );
11091
11102
  }
11092
11103
  }
11104
+ function resolveTemplatesCacheDir(cfg) {
11105
+ if (cfg.templatesPath) return cfg.templatesPath;
11106
+ if (isDockerLayout()) return path2.join(os.homedir(), "plugin-templates");
11107
+ return path2.join(os.homedir(), ".paperclip", "plugin-templates");
11108
+ }
11109
+ function refreshTemplatesCache(cfg, log) {
11110
+ const repoUrl = cfg.templatesRepoUrl || DEFAULT_TEMPLATES_REPO_URL;
11111
+ const targetDir = resolveTemplatesCacheDir(cfg);
11112
+ if (fs2.existsSync(targetDir)) {
11113
+ fs2.rmSync(targetDir, { recursive: true, force: true });
11114
+ }
11115
+ downloadTemplatesFromGithub(targetDir, repoUrl);
11116
+ log?.(`\u2713 Refreshed templates cache from ${repoUrl} \u2192 ${targetDir}`);
11117
+ return targetDir;
11118
+ }
11093
11119
  function isLikelyAnthropicApiKey(value) {
11094
11120
  return value.startsWith("sk-ant-");
11095
11121
  }
@@ -11332,57 +11358,24 @@ function prepareLocalProjectWorkspace(mainProject, companyDir, log, gitIdentity)
11332
11358
  function formatRoleName(role) {
11333
11359
  return role.split("-").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
11334
11360
  }
11335
- function collectInstructionFiles(rootDir) {
11336
- const out = {};
11337
- if (!fs2.existsSync(rootDir)) return out;
11338
- const walk = (dir) => {
11339
- for (const entry of fs2.readdirSync(dir, { withFileTypes: true })) {
11340
- const abs = path2.join(dir, entry.name);
11341
- if (entry.isDirectory()) {
11342
- walk(abs);
11343
- continue;
11344
- }
11345
- if (!entry.isFile()) continue;
11346
- const rel = path2.relative(rootDir, abs).split(path2.sep).join("/");
11347
- out[rel] = fs2.readFileSync(abs, "utf-8");
11348
- }
11349
- };
11350
- walk(rootDir);
11351
- return out;
11352
- }
11353
- async function syncAgentInstructionsIntoManagedBundle({
11361
+ async function setExternalInstructionsBundle({
11354
11362
  client,
11355
11363
  agentId,
11356
11364
  sourceDir,
11357
11365
  entryFile,
11358
- fallbackEntryContent,
11359
11366
  log
11360
11367
  }) {
11361
11368
  try {
11362
11369
  await client.updateInstructionsBundle(agentId, {
11363
- mode: "managed",
11370
+ mode: "external",
11371
+ rootPath: sourceDir,
11364
11372
  entryFile,
11365
11373
  clearLegacyPromptTemplate: true
11366
11374
  });
11367
- const files = collectInstructionFiles(sourceDir);
11368
- if (!files[entryFile] && typeof fallbackEntryContent === "string" && fallbackEntryContent.trim()) {
11369
- files[entryFile] = fallbackEntryContent;
11370
- }
11371
- const entries = Object.entries(files).sort(([a], [b]) => a.localeCompare(b));
11372
- if (entries.length === 0) {
11373
- log("\u26A0 No instruction files found to sync into managed bundle.");
11374
- return;
11375
- }
11376
- for (const [relativePath, content] of entries) {
11377
- await client.upsertInstructionsBundleFile(agentId, {
11378
- path: relativePath,
11379
- content
11380
- });
11381
- }
11382
- log(`\u2713 Synced ${entries.length} instruction file(s) into managed bundle`);
11375
+ log(`\u2713 Pointed instructions at external dir ${sourceDir} (entry ${entryFile})`);
11383
11376
  } catch (err) {
11384
11377
  log(
11385
- `\u26A0 Could not sync managed instructions bundle: ${err instanceof Error ? err.message : String(err)}`
11378
+ `\u26A0 Could not set external instructions bundle: ${err instanceof Error ? err.message : String(err)}`
11386
11379
  );
11387
11380
  }
11388
11381
  }
@@ -11615,13 +11608,8 @@ var plugin = definePlugin({
11615
11608
  ctx.actions.register("refresh-templates", async () => {
11616
11609
  try {
11617
11610
  const cfg = await ctx.config.get() ?? {};
11618
- const repoUrl = cfg.templatesRepoUrl || DEFAULT_TEMPLATES_REPO_URL;
11619
- const targetDir = cfg.templatesPath || path2.join(os.homedir(), ".paperclip", "plugin-templates");
11620
- if (fs2.existsSync(targetDir)) {
11621
- fs2.rmSync(targetDir, { recursive: true, force: true });
11622
- }
11623
- downloadTemplatesFromGithub(targetDir, repoUrl);
11624
- return { ok: true };
11611
+ const targetDir = refreshTemplatesCache(cfg);
11612
+ return { ok: true, targetDir };
11625
11613
  } catch (err) {
11626
11614
  return { ok: false, error: err instanceof Error ? err.message : String(err) };
11627
11615
  }
@@ -12023,6 +12011,17 @@ var plugin = definePlugin({
12023
12011
  const companyName = typeof params.companyName === "string" ? params.companyName.trim() : "";
12024
12012
  const existingCompanyId = typeof params.existingCompanyId === "string" && params.existingCompanyId.trim() ? params.existingCompanyId.trim() : "";
12025
12013
  if (!companyName) return { error: "companyName is required", logs };
12014
+ if (params.refreshTemplates !== false && !cfg.templatesPath) {
12015
+ try {
12016
+ refreshTemplatesCache(cfg, log);
12017
+ } catch (err) {
12018
+ log(
12019
+ `\u26A0 Could not refresh templates cache (${err instanceof Error ? err.message : String(err)}); using existing cache.`
12020
+ );
12021
+ }
12022
+ } else if (cfg.templatesPath) {
12023
+ log(`Using configured templatesPath (${cfg.templatesPath}); skipping auto-refresh.`);
12024
+ }
12026
12025
  const templatesDir = await ensureTemplatesDir(cfg);
12027
12026
  const [presets, allModules, roleTemplates] = await Promise.all([
12028
12027
  loadPresets(templatesDir),
@@ -12090,7 +12089,11 @@ var plugin = definePlugin({
12090
12089
  const ceoInstructionsDir = path2.join(companyDir, "agents", "ceo");
12091
12090
  const ceoEntryFile = "AGENTS.md";
12092
12091
  const ceoEntryPath = path2.join(ceoInstructionsDir, ceoEntryFile);
12093
- const ceoPromptTemplate = fs2.existsSync(ceoEntryPath) ? fs2.readFileSync(ceoEntryPath, "utf-8") : "";
12092
+ if (!fs2.existsSync(ceoEntryPath)) {
12093
+ log(
12094
+ `\u26A0 Assembled CEO entry file missing at ${ceoEntryPath}; external bundle may be empty.`
12095
+ );
12096
+ }
12094
12097
  log("");
12095
12098
  log(`\u2713 Generated files: ${companyDir}`);
12096
12099
  let company;
@@ -12204,11 +12207,7 @@ var plugin = definePlugin({
12204
12207
  companyDir,
12205
12208
  roleAdapterOverrides: assembleResult.roleAdapterOverrides?.get("ceo") ?? {}
12206
12209
  });
12207
- const ceoInstructionFiles = collectInstructionFiles(ceoInstructionsDir);
12208
- if (!ceoInstructionFiles[ceoEntryFile] && typeof ceoPromptTemplate === "string" && ceoPromptTemplate.trim()) {
12209
- ceoInstructionFiles[ceoEntryFile] = ceoPromptTemplate;
12210
- }
12211
- const ceoInstructionsBundle = Object.keys(ceoInstructionFiles).length > 0 ? { entryFile: ceoEntryFile, files: ceoInstructionFiles } : void 0;
12210
+ adapterConfig.instructionsFilePath = ceoEntryPath;
12212
12211
  const logPendingApproval = (agent) => {
12213
12212
  if (!agent?._pendingApprovalId) return;
12214
12213
  log(
@@ -12256,7 +12255,6 @@ var plugin = definePlugin({
12256
12255
  reportsTo: null,
12257
12256
  adapterType,
12258
12257
  adapterConfig,
12259
- instructionsBundle: ceoInstructionsBundle,
12260
12258
  runtimeConfig: ceoRuntimeConfig,
12261
12259
  permissions: { canCreateAgents: true },
12262
12260
  ...boardOperationsIssue?.id ? { sourceIssueId: boardOperationsIssue.id } : {}
@@ -12276,7 +12274,6 @@ var plugin = definePlugin({
12276
12274
  reportsTo: null,
12277
12275
  adapterType,
12278
12276
  adapterConfig,
12279
- instructionsBundle: ceoInstructionsBundle,
12280
12277
  runtimeConfig: ceoRuntimeConfig,
12281
12278
  permissions: { canCreateAgents: true },
12282
12279
  ...boardOperationsIssue?.id ? { sourceIssueId: boardOperationsIssue.id } : {}
@@ -12285,12 +12282,11 @@ var plugin = definePlugin({
12285
12282
  log(`\u2713 CEO agent created (${ceoAgentId})`);
12286
12283
  logPendingApproval(ceoAgent);
12287
12284
  }
12288
- await syncAgentInstructionsIntoManagedBundle({
12285
+ await setExternalInstructionsBundle({
12289
12286
  client,
12290
12287
  agentId: ceoAgentId,
12291
12288
  sourceDir: ceoInstructionsDir,
12292
12289
  entryFile: ceoEntryFile,
12293
- fallbackEntryContent: ceoPromptTemplate,
12294
12290
  log
12295
12291
  });
12296
12292
  for (const govIssue of [
@@ -12338,8 +12334,7 @@ var plugin = definePlugin({
12338
12334
  roleAdapterOverrides: assembleResult.roleAdapterOverrides?.get(roleName) ?? {}
12339
12335
  });
12340
12336
  const roleInstructionsDir = path2.join(companyDir, "agents", roleName);
12341
- const roleInstructionFiles = collectInstructionFiles(roleInstructionsDir);
12342
- const roleInstructionsBundle = Object.keys(roleInstructionFiles).length > 0 ? { entryFile: "AGENTS.md", files: roleInstructionFiles } : void 0;
12337
+ roleAdapterConfig.instructionsFilePath = path2.join(roleInstructionsDir, "AGENTS.md");
12343
12338
  const existingAgent = existingByTemplateRole.get(roleName);
12344
12339
  if (existingAgent?.id) {
12345
12340
  try {
@@ -12358,7 +12353,7 @@ var plugin = definePlugin({
12358
12353
  );
12359
12354
  }
12360
12355
  teamAgentIds[roleName] = existingAgent.id;
12361
- await syncAgentInstructionsIntoManagedBundle({
12356
+ await setExternalInstructionsBundle({
12362
12357
  client,
12363
12358
  agentId: existingAgent.id,
12364
12359
  sourceDir: roleInstructionsDir,
@@ -12377,11 +12372,17 @@ var plugin = definePlugin({
12377
12372
  reportsTo: ceoAgentId,
12378
12373
  adapterType,
12379
12374
  adapterConfig: roleAdapterConfig,
12380
- instructionsBundle: roleInstructionsBundle,
12381
12375
  runtimeConfig: roleRuntimeConfig,
12382
12376
  ...hiringPlanIssue?.id ? { sourceIssueId: hiringPlanIssue.id } : {}
12383
12377
  });
12384
12378
  teamAgentIds[roleName] = roleAgent.id;
12379
+ await setExternalInstructionsBundle({
12380
+ client,
12381
+ agentId: roleAgent.id,
12382
+ sourceDir: roleInstructionsDir,
12383
+ entryFile: "AGENTS.md",
12384
+ log
12385
+ });
12385
12386
  log(`\u2713 ${roleTitle} created (${roleAgent.id})`);
12386
12387
  if (roleAgent?._pendingApprovalId) {
12387
12388
  log(