opencastle 1.0.0 → 1.1.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 (76) hide show
  1. package/README.md +8 -3
  2. package/dist/cli/adapters/claude-code.d.ts +8 -4
  3. package/dist/cli/adapters/claude-code.d.ts.map +1 -1
  4. package/dist/cli/adapters/claude-code.js +13 -7
  5. package/dist/cli/adapters/claude-code.js.map +1 -1
  6. package/dist/cli/adapters/single-file-base.d.ts +8 -1
  7. package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
  8. package/dist/cli/adapters/single-file-base.js +13 -3
  9. package/dist/cli/adapters/single-file-base.js.map +1 -1
  10. package/dist/cli/adapters/vscode.d.ts +11 -1
  11. package/dist/cli/adapters/vscode.d.ts.map +1 -1
  12. package/dist/cli/adapters/vscode.js +48 -8
  13. package/dist/cli/adapters/vscode.js.map +1 -1
  14. package/dist/cli/command-namespace.d.ts +91 -0
  15. package/dist/cli/command-namespace.d.ts.map +1 -0
  16. package/dist/cli/command-namespace.js +218 -0
  17. package/dist/cli/command-namespace.js.map +1 -0
  18. package/dist/cli/command-namespace.test.d.ts +2 -0
  19. package/dist/cli/command-namespace.test.d.ts.map +1 -0
  20. package/dist/cli/command-namespace.test.js +356 -0
  21. package/dist/cli/command-namespace.test.js.map +1 -0
  22. package/dist/cli/copy.d.ts +1 -1
  23. package/dist/cli/copy.d.ts.map +1 -1
  24. package/dist/cli/copy.js +3 -2
  25. package/dist/cli/copy.js.map +1 -1
  26. package/dist/cli/doctor.test.js +2 -2
  27. package/dist/cli/doctor.test.js.map +1 -1
  28. package/dist/cli/explain.d.ts.map +1 -1
  29. package/dist/cli/explain.js +13 -1
  30. package/dist/cli/explain.js.map +1 -1
  31. package/dist/cli/github-report.js +1 -1
  32. package/dist/cli/github-report.js.map +1 -1
  33. package/dist/cli/init.d.ts.map +1 -1
  34. package/dist/cli/init.js +40 -6
  35. package/dist/cli/init.js.map +1 -1
  36. package/dist/cli/init.test.js +9 -4
  37. package/dist/cli/init.test.js.map +1 -1
  38. package/dist/cli/managed-paths.d.ts +18 -1
  39. package/dist/cli/managed-paths.d.ts.map +1 -1
  40. package/dist/cli/managed-paths.js +72 -2
  41. package/dist/cli/managed-paths.js.map +1 -1
  42. package/dist/cli/manifest.d.ts.map +1 -1
  43. package/dist/cli/manifest.js +2 -0
  44. package/dist/cli/manifest.js.map +1 -1
  45. package/dist/cli/remove.d.ts.map +1 -1
  46. package/dist/cli/remove.js +22 -4
  47. package/dist/cli/remove.js.map +1 -1
  48. package/dist/cli/sync-check.d.ts.map +1 -1
  49. package/dist/cli/sync-check.js +22 -4
  50. package/dist/cli/sync-check.js.map +1 -1
  51. package/dist/cli/types.d.ts +32 -0
  52. package/dist/cli/types.d.ts.map +1 -1
  53. package/dist/cli/types.js.map +1 -1
  54. package/dist/cli/update.d.ts.map +1 -1
  55. package/dist/cli/update.js +14 -0
  56. package/dist/cli/update.js.map +1 -1
  57. package/package.json +2 -2
  58. package/src/cli/adapters/claude-code.ts +13 -7
  59. package/src/cli/adapters/single-file-base.ts +22 -4
  60. package/src/cli/adapters/vscode.ts +51 -10
  61. package/src/cli/command-namespace.test.ts +417 -0
  62. package/src/cli/command-namespace.ts +222 -0
  63. package/src/cli/copy.ts +6 -2
  64. package/src/cli/doctor.test.ts +2 -2
  65. package/src/cli/explain.ts +13 -1
  66. package/src/cli/github-report.ts +1 -1
  67. package/src/cli/init.test.ts +9 -4
  68. package/src/cli/init.ts +43 -7
  69. package/src/cli/managed-paths.ts +73 -3
  70. package/src/cli/manifest.ts +2 -0
  71. package/src/cli/remove.ts +20 -4
  72. package/src/cli/sync-check.ts +19 -3
  73. package/src/cli/types.ts +32 -0
  74. package/src/cli/update.ts +12 -0
  75. package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
  76. package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +4 -4
package/src/cli/types.ts CHANGED
@@ -110,6 +110,8 @@ export interface CopyResults {
110
110
  export interface CopyDirOptions {
111
111
  overwrite?: boolean;
112
112
  filter?: (_name: string, _srcPath: string) => boolean;
113
+ /** The name a file is installed under, given its source name. Directories keep theirs. */
114
+ rename?: (_name: string) => string;
113
115
  transform?: (
114
116
  _content: string,
115
117
  _srcPath: string
@@ -157,6 +159,13 @@ export interface Manifest {
157
159
  * "unknown", which is treated as "not ours to delete".
158
160
  */
159
161
  createdConfigs?: string[];
162
+ /**
163
+ * The namespace this install's commands are compiled under — `oc`. Absent on
164
+ * a project a release before the namespace compiled, which is how `sync`
165
+ * knows to look for the un-namespaced commands it left (`/bug-fix` beside
166
+ * `/oc:bug-fix`), and how it knows to stop looking afterwards.
167
+ */
168
+ commandNamespace?: string;
160
169
  stack?: StackConfig;
161
170
  repoInfo?: RepoInfo;
162
171
  }
@@ -212,6 +221,29 @@ export interface IdeAdapter {
212
221
  ): Promise<CopyResults>;
213
222
  getManagedPaths(): ManagedPaths;
214
223
  getDoctorChecks(): DoctorCheck[];
224
+ /**
225
+ * Files an earlier release wrote under a name this one no longer uses —
226
+ * `/bug-fix` before it became `/oc:bug-fix` — present on disk now, relative to
227
+ * the project root with forward slashes. `sync` removes them, `sync --check`
228
+ * reports them, `remove` takes them with the rest, and `init` reads them as a
229
+ * previous installation. Absent when a target has never renamed its output.
230
+ */
231
+ getLegacyOutputs?(_projectRoot: string): string[];
232
+ /**
233
+ * Framework directories this target shares with the user — `.github/prompts/`,
234
+ * which VS Code reads only at its top, so OpenCastle's `oc.` files and a
235
+ * person's own sit side by side. `remove` and a dropped target's cleanup take
236
+ * only what `ownsFile` claims there; every other framework directory is
237
+ * removed whole.
238
+ */
239
+ getSharedDirs?(): string[];
240
+ /**
241
+ * Whether a file under one of this target's framework directories is one it
242
+ * wrote. Sweeps and drift leave a file that answers no alone. Absent means
243
+ * every file there is the target's. `_rel` is relative to the project root,
244
+ * with forward slashes.
245
+ */
246
+ ownsFile?(_rel: string, _projectRoot: string): boolean;
215
247
  }
216
248
 
217
249
  /** Select prompt option. */
package/src/cli/update.ts CHANGED
@@ -31,6 +31,7 @@ import {
31
31
  } from './layers.js'
32
32
  import { buildLock, writeLock, LOCK_REL, priorTeam } from './lock.js'
33
33
  import { parseVersion, compareVersions } from './version-range.js'
34
+ import { COMMAND_NAMESPACE } from './command-namespace.js'
34
35
 
35
36
  /** Print what is wrong with the team's sources, and that nothing was written. */
36
37
  function reportTeamIssues(resolved: ResolvedSources): void {
@@ -458,6 +459,14 @@ export default async function update({
458
459
  for (const p of preview.framework) {
459
460
  console.log(` ${c.yellow('↻')} ${p}`)
460
461
  }
462
+ // Named here because they are deleted, not updated: commands an earlier
463
+ // release wrote before the `oc:` namespace.
464
+ const legacy: string[] = []
465
+ for (const ide of ides) legacy.push(...((await IDE_ADAPTERS[ide]()).getLegacyOutputs?.(projectRoot) ?? []))
466
+ if (legacy.length > 0) {
467
+ console.log(`\n ${c.dim('[dry-run]')} Files from before the oc: namespace that would be removed:\n`)
468
+ for (const p of legacy) console.log(` ${c.red('-')} ${p}`)
469
+ }
461
470
  if (preview.merged.length > 0) {
462
471
  console.log(`\n ${c.dim('[dry-run]')} Files where only the managed block changes:\n`)
463
472
  for (const p of preview.merged) {
@@ -651,6 +660,9 @@ export default async function update({
651
660
  manifest.version = pkg.version
652
661
  manifest.ides = ides
653
662
  manifest.managedPaths = allManagedPaths
663
+ // After the compile above, which has removed any un-namespaced commands an
664
+ // earlier release left: from here on the old names are free again.
665
+ manifest.commandNamespace = COMMAND_NAMESPACE
654
666
  manifest.stack = newStack
655
667
  manifest.repoInfo = mergeStackIntoRepoInfo(repoInfo, newStack)
656
668
  if (manifestMeaning(manifest as unknown as Record<string, unknown>) !== before) {
@@ -1,25 +1,25 @@
1
1
  {
2
- "hash": "d8816c8a",
2
+ "hash": "e0fa8b55",
3
3
  "configHash": "30f8ea04",
4
- "lockfileHash": "aa5f6b33",
5
- "browserHash": "acbce511",
4
+ "lockfileHash": "fef2b8d5",
5
+ "browserHash": "5d80b0d7",
6
6
  "optimized": {
7
7
  "astro > cssesc": {
8
8
  "src": "../../../../../node_modules/cssesc/cssesc.js",
9
9
  "file": "astro___cssesc.js",
10
- "fileHash": "4f9d68ca",
10
+ "fileHash": "03500902",
11
11
  "needsInterop": true
12
12
  },
13
13
  "astro > aria-query": {
14
14
  "src": "../../../../../node_modules/aria-query/lib/index.js",
15
15
  "file": "astro___aria-query.js",
16
- "fileHash": "7e629593",
16
+ "fileHash": "06610c08",
17
17
  "needsInterop": true
18
18
  },
19
19
  "astro > axobject-query": {
20
20
  "src": "../../../../../node_modules/axobject-query/lib/index.js",
21
21
  "file": "astro___axobject-query.js",
22
- "fileHash": "26826007",
22
+ "fileHash": "58969224",
23
23
  "needsInterop": true
24
24
  }
25
25
  },
@@ -262,10 +262,10 @@ After your summary, suggest next steps:
262
262
  Now that your `.opencastle/` configuration is complete, here's what you can do:
263
263
 
264
264
  1. **Review remaining TODOs** — Scan `.opencastle/` for any remaining `<!-- TODO: verify -->` comments and fill in missing values (e.g., tracker team IDs that require API access)
265
- 2. **Implement a feature** — Use the **"Implement Feature"** prompt to have the Team Lead orchestrate a full feature build with task tracking, delegation, and verification
266
- 3. **Fix a bug** — Use the **"Bug Fix"** prompt for structured triage, root cause analysis, and fix with tracker tracking
267
- 4. **Brainstorm first** — Not sure how to approach something? Use the **"Brainstorm"** prompt to explore requirements and trade-offs before committing to a plan
268
- 5. **Generate a convoy spec** — Use the **"Generate Convoy"** prompt to create a `.convoy.yml` spec for autonomous convoy execution with `npx opencastle convoy run --file <spec>` CLI command.
265
+ 2. **Implement a feature** — Use the **"Implement Feature"** prompt (`/oc:implement-feature` in Claude Code and Copilot) to have the Team Lead orchestrate a full feature build with task tracking, delegation, and verification
266
+ 3. **Fix a bug** — Use the **"Bug Fix"** prompt (`/oc:bug-fix`) for structured triage, root cause analysis, and fix with tracker tracking
267
+ 4. **Brainstorm first** — Not sure how to approach something? Use the **"Brainstorm"** prompt (`/oc:brainstorm`) to explore requirements and trade-offs before committing to a plan
268
+ 5. **Generate a convoy spec** — Use the **"Generate Convoy"** prompt (`/oc:generate-convoy`) to create a `.convoy.yml` spec for autonomous convoy execution with `npx opencastle convoy run --file <spec>` CLI command.
269
269
 
270
270
  ## Guidelines
271
271