@starlein/paperclip-plugin-company-wizard 0.4.13 → 0.4.17

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 +58 -0
  2. package/dist/manifest.js +1 -1
  3. package/dist/manifest.js.map +1 -1
  4. package/dist/worker.js +67 -72
  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,64 @@ 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.17] - 2026-06-29
8
+
9
+ ### Fixed
10
+
11
+ **Worker agents no longer send `reasoning.effort: "auto"` to Codex (400 error)**
12
+
13
+ Worker agents default to `DEFAULT_WORKER_THINKING_LEVEL = 'auto'` ("let the model decide"), but Codex's `reasoning.effort` API rejects `"auto"` with a 400 — the accepted values are `none|minimal|low|medium|high|xhigh`. The "let the model decide" semantics are achieved by **omitting the parameter entirely**. Both the worker provisioning path (`ceo-defaults.js` → `buildAdapterConfig`) and the BOOTSTRAP.md generation path (`assemble.js` → `resolveRoleAdapterConfig`) now strip `modelReasoningEffort` and `thinkingLevel` when the resolved level is `"auto"` for `codex_local` adapters, so Codex picks its own effort instead of failing. Explicit levels (`none`–`xhigh`) are still passed through unchanged.
14
+
15
+ ## [0.4.16] - 2026-06-28
16
+
17
+ ### Changed
18
+
19
+ **Agents and projects use external paths under `companies/<Company>/…` with relative instruction references**
20
+
21
+ 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.
22
+
23
+ - **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.
24
+ - **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.
25
+ - **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.
26
+ - **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).
27
+
28
+ > Deploy + "Update templates" + update-company to migrate a live company's agents from managed to external instructions.
29
+
30
+ ## [0.4.15] - 2026-06-28
31
+
32
+ ### Fixed
33
+
34
+ **Template-cache refresh now hits the dir the worker reads (Docker) — fixes "fixed but never deployed"**
35
+
36
+ `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.
37
+
38
+ ### Changed
39
+
40
+ **CI/CD is a merge gate only when the company owns it (`ci-cd` module)**
41
+
42
+ 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`.
43
+
44
+ **Without the pr-review module, the engineer works direct-to-base instead of opening a PR**
45
+
46
+ 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.
47
+
48
+ ## [0.4.14] - 2026-06-25
49
+
50
+ ### Fixed
51
+
52
+ **Stranded-blocked merge issues — a CEO-routine safety net (templates)**
53
+
54
+ > 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.
55
+
56
+ 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.
57
+
58
+ Template fixes:
59
+
60
+ - `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.
61
+ - `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.
62
+
63
+ > 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.
64
+
7
65
  ## [0.4.13] - 2026-06-25
8
66
 
9
67
  ### 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.13",
5
+ version: "0.4.17",
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.13',\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.17',\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
@@ -9319,8 +9319,11 @@ function buildAdapterConfig({
9319
9319
  delete adapterConfig.reasoningEffort;
9320
9320
  delete adapterConfig.effort;
9321
9321
  if (adapterType === "codex_local") {
9322
- adapterConfig.modelReasoningEffort = thinkingLevel;
9323
- adapterConfig.thinkingLevel = thinkingLevel;
9322
+ const codexEffort = thinkingLevel && thinkingLevel !== "auto" ? thinkingLevel : "";
9323
+ if (codexEffort) {
9324
+ adapterConfig.modelReasoningEffort = codexEffort;
9325
+ adapterConfig.thinkingLevel = codexEffort;
9326
+ }
9324
9327
  adapterConfig.dangerouslyBypassApprovalsAndSandbox = true;
9325
9328
  } else if (adapterType === "claude_local") {
9326
9329
  adapterConfig.dangerouslySkipPermissions = true;
@@ -9730,7 +9733,7 @@ ${stages.join("\n")}
9730
9733
  await appendToFile(
9731
9734
  join(companyDir, "agents", roleName, "AGENTS.md"),
9732
9735
  `
9733
- Read and follow: \`$AGENT_HOME/skills/${fileName}\`
9736
+ Read and follow: \`skills/${fileName}\`
9734
9737
  `
9735
9738
  );
9736
9739
  const sourceTag = resolved.source === "shared" ? ", shared" : "";
@@ -9769,7 +9772,7 @@ Read and follow: \`$AGENT_HOME/skills/${fileName}\`
9769
9772
  await appendToFile(
9770
9773
  join(companyDir, "agents", role.name, "AGENTS.md"),
9771
9774
  `
9772
- Read and follow: \`$AGENT_HOME/skills/${skillFile}\`
9775
+ Read and follow: \`skills/${skillFile}\`
9773
9776
  `
9774
9777
  );
9775
9778
  onProgress(`+ agents/${role.name}/skills/${skillFile} (${moduleName})`);
@@ -9837,10 +9840,10 @@ Read and follow: \`$AGENT_HOME/skills/${skillFile}\`
9837
9840
  return !roles || roles.has("*") || roles.has(role.name);
9838
9841
  });
9839
9842
  if (relevantDocs.length === 0) continue;
9840
- let docRefs = "\n## Shared Documentation\n\nReference docs relevant to your role (paths are relative to your workspace home):\n";
9843
+ 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";
9841
9844
  for (const doc of relevantDocs) {
9842
9845
  docRefs += `
9843
- Read: \`docs/${doc}\`
9846
+ Read: \`../../docs/${doc}\`
9844
9847
  `;
9845
9848
  }
9846
9849
  await appendToFile(agentsMd, docRefs);
@@ -9852,7 +9855,6 @@ Read: \`docs/${doc}\`
9852
9855
  const agentRoleDirs = await readdir(agentsBaseDirForSubst, { withFileTypes: true });
9853
9856
  for (const roleDir of agentRoleDirs) {
9854
9857
  if (!roleDir.isDirectory()) continue;
9855
- const absoluteAgentHome = join(agentsBaseDirForSubst, roleDir.name);
9856
9858
  const subst = async (dir) => {
9857
9859
  const entries = await readdir(dir, { withFileTypes: true });
9858
9860
  for (const entry of entries) {
@@ -9861,8 +9863,8 @@ Read: \`docs/${doc}\`
9861
9863
  await subst(full);
9862
9864
  } else if (entry.name.endsWith(".md")) {
9863
9865
  const content = await readFile(full, "utf-8");
9864
- if (content.includes("$AGENT_HOME")) {
9865
- await writeFile(full, content.split("$AGENT_HOME").join(absoluteAgentHome));
9866
+ if (content.includes("$AGENT_HOME/")) {
9867
+ await writeFile(full, content.split("$AGENT_HOME/").join(""));
9866
9868
  }
9867
9869
  }
9868
9870
  }
@@ -9909,8 +9911,11 @@ Read: \`docs/${doc}\`
9909
9911
  }
9910
9912
  }
9911
9913
  if (adapterType === DEFAULT_CEO_ADAPTER_TYPE) {
9912
- adapterConfig.modelReasoningEffort = thinkingLevel;
9913
- adapterConfig.thinkingLevel = thinkingLevel;
9914
+ const codexEffort = thinkingLevel && thinkingLevel !== "auto" ? thinkingLevel : "";
9915
+ if (codexEffort) {
9916
+ adapterConfig.modelReasoningEffort = codexEffort;
9917
+ adapterConfig.thinkingLevel = codexEffort;
9918
+ }
9914
9919
  adapterConfig.dangerouslyBypassApprovalsAndSandbox = true;
9915
9920
  }
9916
9921
  return { adapterType, adapterConfig };
@@ -10079,7 +10084,7 @@ Read: \`docs/${doc}\`
10079
10084
  if (repoUrl) workspace.repoUrl = repoUrl;
10080
10085
  if (repoRef) workspace.repoRef = repoRef;
10081
10086
  if (defaultRef) workspace.defaultRef = defaultRef;
10082
- delete workspace.cwd;
10087
+ if (!workspace.cwd) workspace.cwd = localCwd;
10083
10088
  } else {
10084
10089
  if (!workspace.cwd) workspace.cwd = localCwd;
10085
10090
  const trimmedSetup = typeof workspace.setupCommand === "string" ? workspace.setupCommand.trim() : "";
@@ -11023,7 +11028,7 @@ var __dirname = path2.dirname(fileURLToPath2(import.meta.url));
11023
11028
  var DEFAULT_TEMPLATES_REPO_URL = "https://github.com/starlein/paperclip-plugin-company-wizard/tree/main/templates";
11024
11029
  var BUNDLED_TEMPLATES_DIR = path2.resolve(__dirname, "..", "templates");
11025
11030
  var PLUGIN_PACKAGE_NAME = "@starlein/paperclip-plugin-company-wizard";
11026
- var CURRENT_PLUGIN_VERSION = "0.4.13";
11031
+ var CURRENT_PLUGIN_VERSION = "0.4.16";
11027
11032
  var NPM_LATEST_URL = "https://registry.npmjs.org/@starlein%2Fpaperclip-plugin-company-wizard/latest";
11028
11033
  function copyDirSync(src, dest) {
11029
11034
  fs2.mkdirSync(dest, { recursive: true });
@@ -11102,6 +11107,21 @@ async function ensureTemplatesDir(cfg) {
11102
11107
  );
11103
11108
  }
11104
11109
  }
11110
+ function resolveTemplatesCacheDir(cfg) {
11111
+ if (cfg.templatesPath) return cfg.templatesPath;
11112
+ if (isDockerLayout()) return path2.join(os.homedir(), "plugin-templates");
11113
+ return path2.join(os.homedir(), ".paperclip", "plugin-templates");
11114
+ }
11115
+ function refreshTemplatesCache(cfg, log) {
11116
+ const repoUrl = cfg.templatesRepoUrl || DEFAULT_TEMPLATES_REPO_URL;
11117
+ const targetDir = resolveTemplatesCacheDir(cfg);
11118
+ if (fs2.existsSync(targetDir)) {
11119
+ fs2.rmSync(targetDir, { recursive: true, force: true });
11120
+ }
11121
+ downloadTemplatesFromGithub(targetDir, repoUrl);
11122
+ log?.(`\u2713 Refreshed templates cache from ${repoUrl} \u2192 ${targetDir}`);
11123
+ return targetDir;
11124
+ }
11105
11125
  function isLikelyAnthropicApiKey(value) {
11106
11126
  return value.startsWith("sk-ant-");
11107
11127
  }
@@ -11344,57 +11364,24 @@ function prepareLocalProjectWorkspace(mainProject, companyDir, log, gitIdentity)
11344
11364
  function formatRoleName(role) {
11345
11365
  return role.split("-").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
11346
11366
  }
11347
- function collectInstructionFiles(rootDir) {
11348
- const out = {};
11349
- if (!fs2.existsSync(rootDir)) return out;
11350
- const walk = (dir) => {
11351
- for (const entry of fs2.readdirSync(dir, { withFileTypes: true })) {
11352
- const abs = path2.join(dir, entry.name);
11353
- if (entry.isDirectory()) {
11354
- walk(abs);
11355
- continue;
11356
- }
11357
- if (!entry.isFile()) continue;
11358
- const rel = path2.relative(rootDir, abs).split(path2.sep).join("/");
11359
- out[rel] = fs2.readFileSync(abs, "utf-8");
11360
- }
11361
- };
11362
- walk(rootDir);
11363
- return out;
11364
- }
11365
- async function syncAgentInstructionsIntoManagedBundle({
11367
+ async function setExternalInstructionsBundle({
11366
11368
  client,
11367
11369
  agentId,
11368
11370
  sourceDir,
11369
11371
  entryFile,
11370
- fallbackEntryContent,
11371
11372
  log
11372
11373
  }) {
11373
11374
  try {
11374
11375
  await client.updateInstructionsBundle(agentId, {
11375
- mode: "managed",
11376
+ mode: "external",
11377
+ rootPath: sourceDir,
11376
11378
  entryFile,
11377
11379
  clearLegacyPromptTemplate: true
11378
11380
  });
11379
- const files = collectInstructionFiles(sourceDir);
11380
- if (!files[entryFile] && typeof fallbackEntryContent === "string" && fallbackEntryContent.trim()) {
11381
- files[entryFile] = fallbackEntryContent;
11382
- }
11383
- const entries = Object.entries(files).sort(([a], [b]) => a.localeCompare(b));
11384
- if (entries.length === 0) {
11385
- log("\u26A0 No instruction files found to sync into managed bundle.");
11386
- return;
11387
- }
11388
- for (const [relativePath, content] of entries) {
11389
- await client.upsertInstructionsBundleFile(agentId, {
11390
- path: relativePath,
11391
- content
11392
- });
11393
- }
11394
- log(`\u2713 Synced ${entries.length} instruction file(s) into managed bundle`);
11381
+ log(`\u2713 Pointed instructions at external dir ${sourceDir} (entry ${entryFile})`);
11395
11382
  } catch (err) {
11396
11383
  log(
11397
- `\u26A0 Could not sync managed instructions bundle: ${err instanceof Error ? err.message : String(err)}`
11384
+ `\u26A0 Could not set external instructions bundle: ${err instanceof Error ? err.message : String(err)}`
11398
11385
  );
11399
11386
  }
11400
11387
  }
@@ -11627,13 +11614,8 @@ var plugin = definePlugin({
11627
11614
  ctx.actions.register("refresh-templates", async () => {
11628
11615
  try {
11629
11616
  const cfg = await ctx.config.get() ?? {};
11630
- const repoUrl = cfg.templatesRepoUrl || DEFAULT_TEMPLATES_REPO_URL;
11631
- const targetDir = cfg.templatesPath || path2.join(os.homedir(), ".paperclip", "plugin-templates");
11632
- if (fs2.existsSync(targetDir)) {
11633
- fs2.rmSync(targetDir, { recursive: true, force: true });
11634
- }
11635
- downloadTemplatesFromGithub(targetDir, repoUrl);
11636
- return { ok: true };
11617
+ const targetDir = refreshTemplatesCache(cfg);
11618
+ return { ok: true, targetDir };
11637
11619
  } catch (err) {
11638
11620
  return { ok: false, error: err instanceof Error ? err.message : String(err) };
11639
11621
  }
@@ -12035,6 +12017,17 @@ var plugin = definePlugin({
12035
12017
  const companyName = typeof params.companyName === "string" ? params.companyName.trim() : "";
12036
12018
  const existingCompanyId = typeof params.existingCompanyId === "string" && params.existingCompanyId.trim() ? params.existingCompanyId.trim() : "";
12037
12019
  if (!companyName) return { error: "companyName is required", logs };
12020
+ if (params.refreshTemplates !== false && !cfg.templatesPath) {
12021
+ try {
12022
+ refreshTemplatesCache(cfg, log);
12023
+ } catch (err) {
12024
+ log(
12025
+ `\u26A0 Could not refresh templates cache (${err instanceof Error ? err.message : String(err)}); using existing cache.`
12026
+ );
12027
+ }
12028
+ } else if (cfg.templatesPath) {
12029
+ log(`Using configured templatesPath (${cfg.templatesPath}); skipping auto-refresh.`);
12030
+ }
12038
12031
  const templatesDir = await ensureTemplatesDir(cfg);
12039
12032
  const [presets, allModules, roleTemplates] = await Promise.all([
12040
12033
  loadPresets(templatesDir),
@@ -12102,7 +12095,11 @@ var plugin = definePlugin({
12102
12095
  const ceoInstructionsDir = path2.join(companyDir, "agents", "ceo");
12103
12096
  const ceoEntryFile = "AGENTS.md";
12104
12097
  const ceoEntryPath = path2.join(ceoInstructionsDir, ceoEntryFile);
12105
- const ceoPromptTemplate = fs2.existsSync(ceoEntryPath) ? fs2.readFileSync(ceoEntryPath, "utf-8") : "";
12098
+ if (!fs2.existsSync(ceoEntryPath)) {
12099
+ log(
12100
+ `\u26A0 Assembled CEO entry file missing at ${ceoEntryPath}; external bundle may be empty.`
12101
+ );
12102
+ }
12106
12103
  log("");
12107
12104
  log(`\u2713 Generated files: ${companyDir}`);
12108
12105
  let company;
@@ -12216,11 +12213,7 @@ var plugin = definePlugin({
12216
12213
  companyDir,
12217
12214
  roleAdapterOverrides: assembleResult.roleAdapterOverrides?.get("ceo") ?? {}
12218
12215
  });
12219
- const ceoInstructionFiles = collectInstructionFiles(ceoInstructionsDir);
12220
- if (!ceoInstructionFiles[ceoEntryFile] && typeof ceoPromptTemplate === "string" && ceoPromptTemplate.trim()) {
12221
- ceoInstructionFiles[ceoEntryFile] = ceoPromptTemplate;
12222
- }
12223
- const ceoInstructionsBundle = Object.keys(ceoInstructionFiles).length > 0 ? { entryFile: ceoEntryFile, files: ceoInstructionFiles } : void 0;
12216
+ adapterConfig.instructionsFilePath = ceoEntryPath;
12224
12217
  const logPendingApproval = (agent) => {
12225
12218
  if (!agent?._pendingApprovalId) return;
12226
12219
  log(
@@ -12268,7 +12261,6 @@ var plugin = definePlugin({
12268
12261
  reportsTo: null,
12269
12262
  adapterType,
12270
12263
  adapterConfig,
12271
- instructionsBundle: ceoInstructionsBundle,
12272
12264
  runtimeConfig: ceoRuntimeConfig,
12273
12265
  permissions: { canCreateAgents: true },
12274
12266
  ...boardOperationsIssue?.id ? { sourceIssueId: boardOperationsIssue.id } : {}
@@ -12288,7 +12280,6 @@ var plugin = definePlugin({
12288
12280
  reportsTo: null,
12289
12281
  adapterType,
12290
12282
  adapterConfig,
12291
- instructionsBundle: ceoInstructionsBundle,
12292
12283
  runtimeConfig: ceoRuntimeConfig,
12293
12284
  permissions: { canCreateAgents: true },
12294
12285
  ...boardOperationsIssue?.id ? { sourceIssueId: boardOperationsIssue.id } : {}
@@ -12297,12 +12288,11 @@ var plugin = definePlugin({
12297
12288
  log(`\u2713 CEO agent created (${ceoAgentId})`);
12298
12289
  logPendingApproval(ceoAgent);
12299
12290
  }
12300
- await syncAgentInstructionsIntoManagedBundle({
12291
+ await setExternalInstructionsBundle({
12301
12292
  client,
12302
12293
  agentId: ceoAgentId,
12303
12294
  sourceDir: ceoInstructionsDir,
12304
12295
  entryFile: ceoEntryFile,
12305
- fallbackEntryContent: ceoPromptTemplate,
12306
12296
  log
12307
12297
  });
12308
12298
  for (const govIssue of [
@@ -12350,8 +12340,7 @@ var plugin = definePlugin({
12350
12340
  roleAdapterOverrides: assembleResult.roleAdapterOverrides?.get(roleName) ?? {}
12351
12341
  });
12352
12342
  const roleInstructionsDir = path2.join(companyDir, "agents", roleName);
12353
- const roleInstructionFiles = collectInstructionFiles(roleInstructionsDir);
12354
- const roleInstructionsBundle = Object.keys(roleInstructionFiles).length > 0 ? { entryFile: "AGENTS.md", files: roleInstructionFiles } : void 0;
12343
+ roleAdapterConfig.instructionsFilePath = path2.join(roleInstructionsDir, "AGENTS.md");
12355
12344
  const existingAgent = existingByTemplateRole.get(roleName);
12356
12345
  if (existingAgent?.id) {
12357
12346
  try {
@@ -12370,7 +12359,7 @@ var plugin = definePlugin({
12370
12359
  );
12371
12360
  }
12372
12361
  teamAgentIds[roleName] = existingAgent.id;
12373
- await syncAgentInstructionsIntoManagedBundle({
12362
+ await setExternalInstructionsBundle({
12374
12363
  client,
12375
12364
  agentId: existingAgent.id,
12376
12365
  sourceDir: roleInstructionsDir,
@@ -12389,11 +12378,17 @@ var plugin = definePlugin({
12389
12378
  reportsTo: ceoAgentId,
12390
12379
  adapterType,
12391
12380
  adapterConfig: roleAdapterConfig,
12392
- instructionsBundle: roleInstructionsBundle,
12393
12381
  runtimeConfig: roleRuntimeConfig,
12394
12382
  ...hiringPlanIssue?.id ? { sourceIssueId: hiringPlanIssue.id } : {}
12395
12383
  });
12396
12384
  teamAgentIds[roleName] = roleAgent.id;
12385
+ await setExternalInstructionsBundle({
12386
+ client,
12387
+ agentId: roleAgent.id,
12388
+ sourceDir: roleInstructionsDir,
12389
+ entryFile: "AGENTS.md",
12390
+ log
12391
+ });
12397
12392
  log(`\u2713 ${roleTitle} created (${roleAgent.id})`);
12398
12393
  if (roleAgent?._pendingApprovalId) {
12399
12394
  log(