@srobroek/pi-speckit-beads 1.0.0 → 2.0.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## speckit-beads [2.0.0](https://github.com/srobroek/harness-plugins/compare/speckit-beads--v1.0.1...speckit-beads--v2.0.0) (2026-11-25)
2
+
3
+ ### ⚠ BREAKING CHANGES
4
+
5
+ * **speckit-beads:** pi reads the speckit-beads key of `<agentDir>/settings.json`; `<agentDir>/speckit-beads.json` is no longer read. Move its object under the key.
6
+
7
+ ### Features
8
+
9
+ * **speckit-beads:** read settings from pi settings.json ([3d0dd48](https://github.com/srobroek/harness-plugins/commit/3d0dd48d51fc20249d560e497578a46b549f096b))
10
+
11
+ ## speckit-beads [1.0.1](https://github.com/srobroek/harness-plugins/compare/speckit-beads--v1.0.0...speckit-beads--v1.0.1) (2026-11-25)
12
+
13
+ ### Bug Fixes
14
+
15
+ * **speckit-beads:** pin the spec agent's workspace check to the repository ([2acceca](https://github.com/srobroek/harness-plugins/commit/2acceca26fa4c4fb4f5b0a8b04c8e4e01313caff))
16
+
1
17
  ## speckit-beads 1.0.0 (2026-11-25)
2
18
 
3
19
  ### Features
package/README.md CHANGED
@@ -18,7 +18,7 @@ installs the formulas, and nothing switches that off.
18
18
 
19
19
  | Tool | Needed for | Version |
20
20
  | --- | --- | --- |
21
- | `bd` | The beads workspace, the formulas and the task state. The tasks.md guard asks `bd where`. Required. | 1.3.0 or later |
21
+ | `bd` | The beads workspace, the formulas and the task state. Setup and the tasks.md guard ask `bd -C <repository> where`. Required. | 1.3.0 or later |
22
22
  | `specify` | `speckit_setup`'s `specify init` and extension installs | 1.4.0 or later |
23
23
 
24
24
  On pi, a session start reports a missing or too-old tool with its install hint
@@ -35,9 +35,14 @@ On pi, a session start reports a missing or too-old tool with its install hint
35
35
 
36
36
  ## Options
37
37
 
38
- OpenCode takes them as the plugin's `options`. pi reads the same keys from
39
- `~/.pi/agent/speckit-beads.json` (`$PI_CODING_AGENT_DIR/speckit-beads.json`). Claude Code
40
- takes none.
38
+ OpenCode takes them as the plugin's `options`, and Claude Code takes none.
39
+
40
+ pi reads the same keys from the `speckit-beads` key of its user settings,
41
+ `~/.pi/agent/settings.json` (`$PI_CODING_AGENT_DIR/settings.json`). For example,
42
+ `{ "speckit-beads": { "tasksGuard": false } }` turns the tasks.md guard off. The extension ignores
43
+ a project's `.pi/settings.json`, so a repository cannot switch a guard off. Without the key, the
44
+ defaults below apply. A `speckit-beads` value that is not an object gives the defaults and a
45
+ warning at session start. So does a `settings.json` that is unreadable or not valid JSON.
41
46
 
42
47
  | Option | Default | Effect |
43
48
  | --- | --- | --- |
@@ -137,7 +142,7 @@ options in bounds.
137
142
 
138
143
  ## Guards and routes
139
144
 
140
- All of them apply only where `bd where` finds a beads workspace, and fail open when
145
+ All of them apply only where `bd -C <repository> where` finds a beads workspace, and fail open when
141
146
  it cannot run.
142
147
 
143
148
  | Surface | Behavior |
package/agents/spec.md CHANGED
@@ -28,7 +28,7 @@ When the user points at a decision record (`docs/adr/` or `docs/decisions/`), re
28
28
 
29
29
  ## Flow
30
30
 
31
- 1. **Setup.** Check that `.specify/` exists (here or at the repository root, which the tools then use), the SpecKit prompts exist (`.pi/prompts/speckit.*.md`, or `speckit-*` skills from another integration), and `bd where` finds a beads workspace. If any is missing, say what and offer `speckit_setup`; run it only after the user agrees. Report each phase it returns. Then run `bd prime` once for Beads' own workflow and command reference.
31
+ 1. **Setup.** Check that `.specify/` exists (here or at the repository root, which the tools then use), the SpecKit prompts exist (`.pi/prompts/speckit.*.md`, or `speckit-*` skills from another integration), and `bd -C <repository root> where` finds a beads workspace (a bare `bd where` can report another store, for example one an inherited `BEADS_DIR` names). If any is missing, say what and offer `speckit_setup`; run it only after the user agrees. Report each phase it returns. Then run `bd prime` once for Beads' own workflow and command reference.
32
32
  2. **Start.** Call `speckit_start` with the identity the entry path settled. Ask the question each status returns, then:
33
33
  - `CHOICE_REQUIRED`: call again with the answer as `approvals` (`yes` or `no`) and the user's words as `decision`.
34
34
  - `MIGRATION_REQUIRED`: the answer is consent to migrate, not an approvals answer. On yes, call again with the pending `approvals=no`, `migrate=true`, the returned `root` and the user's words as `decision`. On no, stop and report that the run keeps its approval gates.
@@ -618,24 +618,35 @@ function repositoryRoot(dir) {
618
618
  }
619
619
  }
620
620
 
621
- // lib/src/pi-options.ts
621
+ // lib/src/pi-settings.ts
622
622
  import { readFileSync } from "fs";
623
- function loadPiOptionsFile(path, plugin, fallback) {
623
+ var PI_SETTINGS_FILE = "settings.json";
624
+ var isObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
625
+ function loadPiPluginSettings(path, plugin, fallback) {
626
+ const unusable = (problem) => ({ options: {}, warning: `${plugin}: ${problem}; ${fallback}.` });
627
+ const unread = `so its "${plugin}" key was not read`;
624
628
  let text;
625
629
  try {
626
630
  text = readFileSync(path, "utf8");
627
631
  } catch (error) {
628
632
  if (error.code === "ENOENT")
629
633
  return { options: {} };
630
- return { options: {}, warning: `${plugin}: ${path} could not be read; ${fallback}.` };
634
+ return unusable(`${path} could not be read, ${unread}`);
631
635
  }
632
- let raw;
636
+ let settings;
633
637
  try {
634
- raw = JSON.parse(text);
638
+ settings = JSON.parse(text.replace(/^\uFEFF/, ""));
635
639
  } catch {
636
- return { options: {}, warning: `${plugin}: ${path} is not valid JSON; ${fallback}.` };
640
+ return unusable(`${path} is not valid JSON, ${unread}`);
637
641
  }
638
- return { options: raw !== null && typeof raw === "object" && !Array.isArray(raw) ? raw : {} };
642
+ if (!isObject(settings))
643
+ return unusable(`${path} is not a JSON object, ${unread}`);
644
+ const value = settings[plugin];
645
+ if (value === undefined)
646
+ return { options: {} };
647
+ if (!isObject(value))
648
+ return unusable(`the "${plugin}" key in ${path} is not an object`);
649
+ return { options: value };
639
650
  }
640
651
 
641
652
  // plugins/speckit-beads/opencode/instructions/speckit-workflow.md
@@ -2972,14 +2983,13 @@ async function executeStart(input, directory, signal, lock = BEADS_LOCK) {
2972
2983
  // plugins/speckit-beads/pi-src/routes.ts
2973
2984
  import { homedir as homedir2 } from "os";
2974
2985
  import { isAbsolute as isAbsolute8, resolve as resolve8 } from "path";
2975
- var OPTIONS_FILE = "speckit-beads.json";
2976
2986
  var WORKFLOW_SECTION = "speckit_workflow";
2977
2987
  var MESSAGE_TYPE = "speckit-beads";
2978
- function guardReason(optionsPath) {
2979
- return `${GUARD_REASON} Disable: set "tasksGuard": false in ${optionsPath}`;
2988
+ function guardReason(settingsPath) {
2989
+ return `${GUARD_REASON} Disable: set "tasksGuard": false under the "speckit-beads" key of ${settingsPath}`;
2980
2990
  }
2981
- function tasksToIssuesReason(optionsPath) {
2982
- return `${TASKSTOISSUES_REASON} Disable: set "blockTasksToIssues": false in ${optionsPath}`;
2991
+ function tasksToIssuesReason(settingsPath) {
2992
+ return `${TASKSTOISSUES_REASON} Disable: set "blockTasksToIssues": false under the "speckit-beads" key of ${settingsPath}`;
2983
2993
  }
2984
2994
  var ROUTED = new Set([...IMPLEMENT_SKILLS, ...ANALYZE_SKILLS, ...TASKSTOISSUES_SKILLS]);
2985
2995
  function routedCommand(text) {
@@ -3037,12 +3047,12 @@ function notify(ctx, message) {
3037
3047
  `);
3038
3048
  }
3039
3049
  function setupSpeckitPi(pi, deps = {}) {
3040
- const optionsPath = deps.optionsPath ?? join8(getAgentDir(), OPTIONS_FILE);
3041
- const loaded = loadPiOptionsFile(optionsPath, "speckit-beads", "the defaults apply");
3050
+ const settingsPath = deps.settingsPath ?? join8(getAgentDir(), PI_SETTINGS_FILE);
3051
+ const loaded = loadPiPluginSettings(settingsPath, "speckit-beads", "the defaults apply");
3042
3052
  const options = parseOptions(loaded.options, PI_INTEGRATION);
3043
3053
  const probe = deps.probe ?? ((directory) => beadsActive(directory));
3044
3054
  const workflow = speckit_workflow_default.trim();
3045
- const refusal = tasksToIssuesReason(optionsPath);
3055
+ const refusal = tasksToIssuesReason(settingsPath);
3046
3056
  const workspaceOf = (directory) => speckitWorkspace(directory, repositoryRoot(directory));
3047
3057
  const routing = async (cwd) => {
3048
3058
  const active = await probe(cwd);
@@ -3090,7 +3100,7 @@ function setupSpeckitPi(pi, deps = {}) {
3090
3100
  return;
3091
3101
  let reason;
3092
3102
  try {
3093
- reason = await decideToolCall(event.toolName, guardInput(event.input, ctx.cwd), ctx.cwd, probe, guardReason(optionsPath));
3103
+ reason = await decideToolCall(event.toolName, guardInput(event.input, ctx.cwd), ctx.cwd, probe, guardReason(settingsPath));
3094
3104
  } catch {
3095
3105
  return;
3096
3106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@srobroek/pi-speckit-beads",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "SpecKit on Beads: a tasks.md guard, setup, ledger and bugfix skills, formulas, and the speckit-sync and speckit-verify subagents.",
5
5
  "keywords": [
6
6
  "pi-package"