@srobroek/pi-speckit-beads 1.0.1 → 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,13 @@
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
+
1
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)
2
12
 
3
13
  ### Bug Fixes
package/README.md CHANGED
@@ -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
  | --- | --- | --- |
@@ -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.1",
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"