projectinator 0.3.0 → 0.4.0

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 (170) hide show
  1. package/README.md +30 -11
  2. package/bin/projectinator.mjs +56 -11
  3. package/dist/bakeoff.js +163 -0
  4. package/dist/bakeoff.js.map +1 -0
  5. package/dist/build-state.js +26 -0
  6. package/dist/build-state.js.map +1 -0
  7. package/dist/burndown.js +19 -0
  8. package/dist/burndown.js.map +1 -0
  9. package/dist/calibration.js +86 -0
  10. package/dist/calibration.js.map +1 -0
  11. package/dist/cli.js +289 -0
  12. package/dist/cli.js.map +1 -0
  13. package/dist/cost.js +35 -0
  14. package/dist/cost.js.map +1 -0
  15. package/dist/council.js +147 -0
  16. package/dist/council.js.map +1 -0
  17. package/dist/demo.js +93 -0
  18. package/dist/demo.js.map +1 -0
  19. package/dist/estimate.js +98 -0
  20. package/dist/estimate.js.map +1 -0
  21. package/dist/executor.js +118 -0
  22. package/dist/executor.js.map +1 -0
  23. package/dist/git.js +82 -0
  24. package/dist/git.js.map +1 -0
  25. package/dist/intake.js +98 -0
  26. package/dist/intake.js.map +1 -0
  27. package/dist/models.js +171 -0
  28. package/dist/models.js.map +1 -0
  29. package/dist/narrate.js +76 -0
  30. package/dist/narrate.js.map +1 -0
  31. package/dist/openrouter.js +112 -0
  32. package/dist/openrouter.js.map +1 -0
  33. package/dist/orchestrator.js +273 -0
  34. package/dist/orchestrator.js.map +1 -0
  35. package/dist/pm.js +245 -0
  36. package/dist/pm.js.map +1 -0
  37. package/dist/preview.js +194 -0
  38. package/dist/preview.js.map +1 -0
  39. package/dist/registry-store.js +38 -0
  40. package/dist/registry-store.js.map +1 -0
  41. package/dist/registry.js +115 -0
  42. package/dist/registry.js.map +1 -0
  43. package/dist/research.js +98 -0
  44. package/dist/research.js.map +1 -0
  45. package/dist/retro.js +83 -0
  46. package/dist/retro.js.map +1 -0
  47. package/dist/roles.js +357 -0
  48. package/dist/roles.js.map +1 -0
  49. package/dist/router.js +95 -0
  50. package/dist/router.js.map +1 -0
  51. package/dist/run-bakeoff.js +68 -0
  52. package/dist/run-bakeoff.js.map +1 -0
  53. package/dist/run-build.js +193 -0
  54. package/dist/run-build.js.map +1 -0
  55. package/{src/run-dev.ts → dist/run-dev.js} +23 -39
  56. package/dist/run-dev.js.map +1 -0
  57. package/{src/run-pm.ts → dist/run-pm.js} +34 -46
  58. package/dist/run-pm.js.map +1 -0
  59. package/{src/run-research.ts → dist/run-research.js} +19 -30
  60. package/dist/run-research.js.map +1 -0
  61. package/{src/run-scout.ts → dist/run-scout.js} +17 -27
  62. package/dist/run-scout.js.map +1 -0
  63. package/dist/run-web.js +93 -0
  64. package/dist/run-web.js.map +1 -0
  65. package/dist/scout.js +81 -0
  66. package/dist/scout.js.map +1 -0
  67. package/dist/session-cost.js +15 -0
  68. package/dist/session-cost.js.map +1 -0
  69. package/dist/stack.js +34 -0
  70. package/dist/stack.js.map +1 -0
  71. package/dist/stuck.js +21 -0
  72. package/dist/stuck.js.map +1 -0
  73. package/dist/tui/App.js +1269 -0
  74. package/dist/tui/App.js.map +1 -0
  75. package/dist/tui/BakeOff.js +95 -0
  76. package/dist/tui/BakeOff.js.map +1 -0
  77. package/dist/tui/BoardEditor.js +183 -0
  78. package/dist/tui/BoardEditor.js.map +1 -0
  79. package/dist/tui/EditableBoard.js +140 -0
  80. package/dist/tui/EditableBoard.js.map +1 -0
  81. package/dist/tui/Frame.js +78 -0
  82. package/dist/tui/Frame.js.map +1 -0
  83. package/dist/tui/Intake.js +59 -0
  84. package/dist/tui/Intake.js.map +1 -0
  85. package/dist/tui/Kanban.js +75 -0
  86. package/dist/tui/Kanban.js.map +1 -0
  87. package/dist/tui/Settings.js +299 -0
  88. package/dist/tui/Settings.js.map +1 -0
  89. package/dist/tui/StackPick.js +44 -0
  90. package/dist/tui/StackPick.js.map +1 -0
  91. package/dist/tui/WebAccounts.js +131 -0
  92. package/dist/tui/WebAccounts.js.map +1 -0
  93. package/dist/tui/components.js +178 -0
  94. package/dist/tui/components.js.map +1 -0
  95. package/dist/tui/config.js +129 -0
  96. package/dist/tui/config.js.map +1 -0
  97. package/dist/tui/deploy.js +114 -0
  98. package/dist/tui/deploy.js.map +1 -0
  99. package/dist/tui/engine.js +710 -0
  100. package/dist/tui/engine.js.map +1 -0
  101. package/dist/tui/notify.js +47 -0
  102. package/dist/tui/notify.js.map +1 -0
  103. package/dist/tui/panels.js +42 -0
  104. package/dist/tui/panels.js.map +1 -0
  105. package/dist/tui/templates.js +106 -0
  106. package/dist/tui/templates.js.map +1 -0
  107. package/dist/tui/theme.js +42 -0
  108. package/dist/tui/theme.js.map +1 -0
  109. package/dist/tui/validate.js +51 -0
  110. package/dist/tui/validate.js.map +1 -0
  111. package/{src/tui.tsx → dist/tui.js} +23 -33
  112. package/dist/tui.js.map +1 -0
  113. package/dist/types.js +19 -0
  114. package/dist/types.js.map +1 -0
  115. package/dist/web/oauth-anthropic.js +179 -0
  116. package/dist/web/oauth-anthropic.js.map +1 -0
  117. package/dist/web/session.js +274 -0
  118. package/dist/web/session.js.map +1 -0
  119. package/package.json +5 -4
  120. package/src/bakeoff.ts +0 -214
  121. package/src/build-state.ts +0 -47
  122. package/src/burndown.ts +0 -35
  123. package/src/calibration.ts +0 -88
  124. package/src/cost.ts +0 -43
  125. package/src/council.ts +0 -175
  126. package/src/demo.ts +0 -106
  127. package/src/estimate.ts +0 -111
  128. package/src/executor.ts +0 -169
  129. package/src/git.ts +0 -72
  130. package/src/intake.ts +0 -125
  131. package/src/models.ts +0 -175
  132. package/src/narrate.ts +0 -87
  133. package/src/openrouter.ts +0 -119
  134. package/src/orchestrator.ts +0 -310
  135. package/src/pm.ts +0 -302
  136. package/src/preview.ts +0 -206
  137. package/src/registry-store.ts +0 -41
  138. package/src/registry.ts +0 -132
  139. package/src/research.ts +0 -123
  140. package/src/retro.ts +0 -99
  141. package/src/roles.ts +0 -401
  142. package/src/router.ts +0 -120
  143. package/src/run-bakeoff.ts +0 -77
  144. package/src/run-build.ts +0 -203
  145. package/src/run-web.ts +0 -87
  146. package/src/scout.ts +0 -121
  147. package/src/session-cost.ts +0 -17
  148. package/src/stack.ts +0 -46
  149. package/src/tui/App.tsx +0 -1760
  150. package/src/tui/BakeOff.tsx +0 -190
  151. package/src/tui/BoardEditor.tsx +0 -260
  152. package/src/tui/EditableBoard.tsx +0 -179
  153. package/src/tui/Frame.tsx +0 -142
  154. package/src/tui/Intake.tsx +0 -111
  155. package/src/tui/Kanban.tsx +0 -158
  156. package/src/tui/Settings.tsx +0 -513
  157. package/src/tui/StackPick.tsx +0 -79
  158. package/src/tui/WebAccounts.tsx +0 -197
  159. package/src/tui/components.tsx +0 -340
  160. package/src/tui/config.ts +0 -150
  161. package/src/tui/deploy.ts +0 -137
  162. package/src/tui/engine.ts +0 -749
  163. package/src/tui/notify.ts +0 -21
  164. package/src/tui/panels.tsx +0 -89
  165. package/src/tui/templates.ts +0 -119
  166. package/src/tui/theme.ts +0 -44
  167. package/src/tui/validate.ts +0 -53
  168. package/src/types.ts +0 -208
  169. package/src/web/oauth-anthropic.ts +0 -206
  170. package/src/web/session.ts +0 -299
package/src/tui/deploy.ts DELETED
@@ -1,137 +0,0 @@
1
- // One-click deploy — ship a built static site to Cloudflare Pages, Vercel, or
2
- // Netlify by shelling out to that provider's CLI. No secrets stored here: auth
3
- // comes from the CLI's own login (browser) or a token env var the user sets.
4
-
5
- import { spawn } from "node:child_process";
6
- import { cpSync, mkdirSync, readdirSync, rmSync } from "node:fs";
7
- import { join } from "node:path";
8
-
9
- export type DeployTarget = "cloudflare" | "vercel" | "netlify";
10
-
11
- export interface TargetMeta {
12
- label: string;
13
- cli: string;
14
- install: string;
15
- auth: string;
16
- /** Regex to pull the live URL out of the CLI output. */
17
- urlPattern: RegExp;
18
- }
19
-
20
- export const DEPLOY_META: Record<DeployTarget, TargetMeta> = {
21
- cloudflare: {
22
- label: "Cloudflare Pages",
23
- cli: "wrangler",
24
- install: "npm i -g wrangler",
25
- auth: "wrangler login (or set CLOUDFLARE_API_TOKEN)",
26
- urlPattern: /https:\/\/[^\s]+\.pages\.dev/g,
27
- },
28
- vercel: {
29
- label: "Vercel",
30
- cli: "vercel",
31
- install: "npm i -g vercel",
32
- auth: "vercel login (or set VERCEL_TOKEN)",
33
- urlPattern: /https:\/\/[^\s]+\.vercel\.app/g,
34
- },
35
- netlify: {
36
- label: "Netlify",
37
- cli: "netlify",
38
- install: "npm i -g netlify-cli",
39
- auth: "netlify login (or set NETLIFY_AUTH_TOKEN)",
40
- urlPattern: /https:\/\/[^\s]+\.netlify\.app/g,
41
- },
42
- };
43
-
44
- // Project metadata / non-servable files we never want on the public site.
45
- const INTERNAL = new Set([
46
- "build-state.json", "DESIGN-SPEC.md", "export.md", "export.csv",
47
- "jira-import.csv", "trello-import.csv", "node_modules",
48
- ]);
49
-
50
- /** Sanitise a project name into a deploy-safe slug (Cloudflare/Vercel project id). */
51
- export function deploySlug(name: string): string {
52
- return (name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40)) || "projectinator-app";
53
- }
54
-
55
- /** Copy servable web files into <dir>/.deploy, dropping internal metadata. */
56
- export function stageForDeploy(dir: string): string {
57
- const staging = join(dir, ".deploy");
58
- rmSync(staging, { recursive: true, force: true });
59
- mkdirSync(staging, { recursive: true });
60
- let copied = 0;
61
- for (const name of readdirSync(dir)) {
62
- if (name.startsWith(".")) continue; // .deploy, hidden files
63
- if (INTERNAL.has(name)) continue;
64
- cpSync(join(dir, name), join(staging, name), { recursive: true });
65
- copied++;
66
- }
67
- if (copied === 0) throw new Error("No web files to deploy — build the app first.");
68
- return staging;
69
- }
70
-
71
- function buildArgs(target: DeployTarget, staging: string, slug: string): string[] {
72
- switch (target) {
73
- case "cloudflare":
74
- return ["pages", "deploy", staging, "--project-name", slug, "--branch", "main", "--commit-dirty=true"];
75
- case "vercel":
76
- return [staging, "--prod", "--yes"];
77
- case "netlify":
78
- return ["deploy", "--dir", staging, "--prod"];
79
- }
80
- }
81
-
82
- export interface DeployResult {
83
- url?: string;
84
- output: string;
85
- }
86
-
87
- /** Run a deploy. Streams output via onLog; resolves with the live URL (if found).
88
- * Rejects with a helpful message when the CLI is missing or the deploy fails. */
89
- export function deploy(
90
- target: DeployTarget,
91
- dir: string,
92
- projectName: string,
93
- onLog: (line: string) => void,
94
- ): Promise<DeployResult> {
95
- return new Promise((resolve, reject) => {
96
- let staging: string;
97
- try {
98
- staging = stageForDeploy(dir);
99
- } catch (e) {
100
- reject(e);
101
- return;
102
- }
103
- const meta = DEPLOY_META[target];
104
- const args = buildArgs(target, staging, deploySlug(projectName));
105
- const child = spawn(meta.cli, args, { cwd: dir, env: process.env });
106
-
107
- let output = "";
108
- const onData = (buf: Buffer) => {
109
- const text = buf.toString();
110
- output += text;
111
- for (const line of text.split("\n")) {
112
- const t = line.trimEnd();
113
- if (t) onLog(t);
114
- }
115
- };
116
- child.stdout.on("data", onData);
117
- child.stderr.on("data", onData);
118
-
119
- child.on("error", (err: NodeJS.ErrnoException) => {
120
- if (err.code === "ENOENT") {
121
- reject(new Error(`${meta.cli} is not installed. Install it:\n ${meta.install}\nthen sign in:\n ${meta.auth}`));
122
- } else {
123
- reject(err);
124
- }
125
- });
126
-
127
- child.on("close", (code) => {
128
- if (code === 0) {
129
- const matches = output.match(meta.urlPattern);
130
- resolve({ url: matches ? matches[matches.length - 1] : undefined, output });
131
- } else {
132
- const tail = output.trim().split("\n").slice(-8).join("\n");
133
- reject(new Error(`${meta.label} deploy failed (exit ${code}).\nIf it's an auth error, sign in:\n ${meta.auth}\n\n${tail}`));
134
- }
135
- });
136
- });
137
- }