pi-harness-runtime 1.1.404 → 1.1.406

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 (158) hide show
  1. package/index.ts +275 -1
  2. package/package.json +1 -1
  3. package/packages/a2a-adapter/package.json +1 -1
  4. package/packages/agent-policy/package.json +1 -1
  5. package/packages/architecture-generator/package.json +1 -1
  6. package/packages/auth/package.json +1 -1
  7. package/packages/autonomous-refactor/package.json +1 -1
  8. package/packages/autonomous-runtime/package.json +1 -1
  9. package/packages/cache-strategy/package.json +1 -1
  10. package/packages/capability-registry/package.json +1 -1
  11. package/packages/checkpoint/package.json +1 -1
  12. package/packages/cli-plugin-sdk/package.json +1 -1
  13. package/packages/clipboard/package.json +1 -1
  14. package/packages/clipboard-plugin/package.json +1 -1
  15. package/packages/code-generation/package.json +1 -1
  16. package/packages/code-review/package.json +1 -1
  17. package/packages/codex-adapter/package.json +1 -1
  18. package/packages/codex-watcher/package.json +1 -1
  19. package/packages/config-capture/package.json +1 -1
  20. package/packages/connection-runtime/package.json +1 -1
  21. package/packages/context-compiler/package.json +1 -1
  22. package/packages/context-discovery/package.json +1 -1
  23. package/packages/context-manager/package.json +1 -1
  24. package/packages/contracts/package.json +1 -1
  25. package/packages/cookie-sanitizer/package.json +1 -1
  26. package/packages/cost-optimizer/package.json +1 -1
  27. package/packages/dependency-analyzer/package.json +1 -1
  28. package/packages/django-plugin/package.json +1 -1
  29. package/packages/doc-generator/package.json +1 -1
  30. package/packages/durable-review/package.json +1 -1
  31. package/packages/e2e-tester/package.json +1 -1
  32. package/packages/evaluation-engine/package.json +1 -1
  33. package/packages/evaluation-runner/package.json +1 -1
  34. package/packages/event-bus/package.json +1 -1
  35. package/packages/event-sink/package.json +1 -1
  36. package/packages/event-store/package.json +1 -1
  37. package/packages/experience-replay/package.json +1 -1
  38. package/packages/feedback-collector/package.json +1 -1
  39. package/packages/file-copy-helper/package.json +1 -1
  40. package/packages/framework-detector/package.json +1 -1
  41. package/packages/framework-plugin-sdk/package.json +1 -1
  42. package/packages/frappe-plugin/package.json +1 -1
  43. package/packages/generic-web-plugin/package.json +1 -1
  44. package/packages/health-monitor/package.json +1 -1
  45. package/packages/intent-analyzer/package.json +1 -1
  46. package/packages/jev-judge/package.json +1 -1
  47. package/packages/knowledge-graph/package.json +1 -1
  48. package/packages/knowledge-retrieval/package.json +1 -1
  49. package/packages/laravel-plugin/package.json +1 -1
  50. package/packages/learning-engine/package.json +1 -1
  51. package/packages/logging/package.json +1 -1
  52. package/packages/mcp-adapter/package.json +1 -1
  53. package/packages/memory-engine/package.json +1 -1
  54. package/packages/milestone-manager/package.json +1 -1
  55. package/packages/model-registry/package.json +1 -1
  56. package/packages/nextjs-plugin/package.json +1 -1
  57. package/packages/notification/dist/adapters/line-adapter.d.ts.map +1 -1
  58. package/packages/notification/dist/adapters/line-adapter.js +6 -1
  59. package/packages/notification/dist/adapters/line-adapter.js.map +1 -1
  60. package/packages/notification/dist/notification-center.d.ts.map +1 -1
  61. package/packages/notification/dist/notification-center.js +32 -0
  62. package/packages/notification/dist/notification-center.js.map +1 -1
  63. package/packages/notification/dist/telegram-webhook-handler.d.ts +7 -0
  64. package/packages/notification/dist/telegram-webhook-handler.d.ts.map +1 -1
  65. package/packages/notification/dist/telegram-webhook-handler.js +7 -0
  66. package/packages/notification/dist/telegram-webhook-handler.js.map +1 -1
  67. package/packages/notification/dist/types.d.ts +1 -1
  68. package/packages/notification/dist/types.d.ts.map +1 -1
  69. package/packages/notification/package.json +1 -1
  70. package/packages/notification/src/adapters/line-adapter.ts +7 -1
  71. package/packages/notification/src/notification-center.ts +30 -0
  72. package/packages/notification/src/telegram-webhook-handler.ts +7 -0
  73. package/packages/notification/src/types.ts +1 -0
  74. package/packages/notification/test/notification.test.ts +31 -28
  75. package/packages/notification/test/tooling-proposal-payload.test.ts +212 -0
  76. package/packages/observability/package.json +1 -1
  77. package/packages/okf-indexer/package.json +1 -1
  78. package/packages/paperclip-integration/package.json +1 -1
  79. package/packages/performance-optimizer/package.json +1 -1
  80. package/packages/permission-mode/package.json +1 -1
  81. package/packages/privilege-broker/package.json +1 -1
  82. package/packages/project-analyzer/package.json +1 -1
  83. package/packages/project-bootstrap/package.json +1 -1
  84. package/packages/projection-engine/package.json +1 -1
  85. package/packages/prompt-compiler/package.json +1 -1
  86. package/packages/prompt-versioning/package.json +1 -1
  87. package/packages/provider-adapter-sdk/package.json +1 -1
  88. package/packages/provider-router/package.json +1 -1
  89. package/packages/provider-selector/package.json +1 -1
  90. package/packages/providers/package.json +1 -1
  91. package/packages/qdrant-skills/package.json +1 -1
  92. package/packages/quota-manager/package.json +1 -1
  93. package/packages/rate-limiter/package.json +1 -1
  94. package/packages/react-vite-plugin/package.json +1 -1
  95. package/packages/relay/package.json +1 -1
  96. package/packages/release-manager/package.json +1 -1
  97. package/packages/requirement-compiler/package.json +1 -1
  98. package/packages/runtime/package.json +1 -1
  99. package/packages/scheduler/package.json +1 -1
  100. package/packages/scheduler-adapter/package.json +1 -1
  101. package/packages/session/package.json +1 -1
  102. package/packages/session-api/package.json +1 -1
  103. package/packages/session-export/package.json +1 -1
  104. package/packages/shared-context/package.json +1 -1
  105. package/packages/skill-mcp-client/package.json +1 -1
  106. package/packages/skill-registry/package.json +1 -1
  107. package/packages/skills/package.json +1 -1
  108. package/packages/sprint-planner/package.json +1 -1
  109. package/packages/subscription-engine/package.json +1 -1
  110. package/packages/task-compiler/package.json +1 -1
  111. package/packages/telegram/package.json +1 -1
  112. package/packages/tencentdb-memory/package.json +1 -1
  113. package/packages/tencentdb-sync/package.json +1 -1
  114. package/packages/test-data-generator/package.json +1 -1
  115. package/packages/test-generator/package.json +1 -1
  116. package/packages/todo-bd-sync/package.json +1 -1
  117. package/packages/token-estimation/package.json +1 -1
  118. package/packages/token-optimizer/package.json +1 -1
  119. package/packages/tooling-preference/dist/detect.d.ts +62 -0
  120. package/packages/tooling-preference/dist/detect.d.ts.map +1 -0
  121. package/packages/tooling-preference/dist/detect.js +209 -0
  122. package/packages/tooling-preference/dist/detect.js.map +1 -0
  123. package/packages/tooling-preference/dist/index.d.ts +13 -0
  124. package/packages/tooling-preference/dist/index.d.ts.map +1 -0
  125. package/packages/tooling-preference/dist/index.js +13 -0
  126. package/packages/tooling-preference/dist/index.js.map +1 -0
  127. package/packages/tooling-preference/dist/proposal.d.ts +70 -0
  128. package/packages/tooling-preference/dist/proposal.d.ts.map +1 -0
  129. package/packages/tooling-preference/dist/proposal.js +137 -0
  130. package/packages/tooling-preference/dist/proposal.js.map +1 -0
  131. package/packages/tooling-preference/dist/registry.d.ts +50 -0
  132. package/packages/tooling-preference/dist/registry.d.ts.map +1 -0
  133. package/packages/tooling-preference/dist/registry.js +53 -0
  134. package/packages/tooling-preference/dist/registry.js.map +1 -0
  135. package/packages/tooling-preference/dist/store.d.ts +61 -0
  136. package/packages/tooling-preference/dist/store.d.ts.map +1 -0
  137. package/packages/tooling-preference/dist/store.js +129 -0
  138. package/packages/tooling-preference/dist/store.js.map +1 -0
  139. package/packages/tooling-preference/package.json +21 -0
  140. package/packages/tooling-preference/src/detect.ts +251 -0
  141. package/packages/tooling-preference/src/index.ts +44 -0
  142. package/packages/tooling-preference/src/proposal.ts +173 -0
  143. package/packages/tooling-preference/src/registry.ts +79 -0
  144. package/packages/tooling-preference/src/store.ts +162 -0
  145. package/packages/tooling-preference/tests/detect.test.ts +188 -0
  146. package/packages/tooling-preference/tests/proposal.test.ts +107 -0
  147. package/packages/tooling-preference/tests/registry.test.ts +51 -0
  148. package/packages/tooling-preference/tests/store.test.ts +99 -0
  149. package/packages/trajectory/package.json +1 -1
  150. package/packages/tui/package.json +1 -1
  151. package/packages/types/package.json +1 -1
  152. package/packages/voice-api/package.json +1 -1
  153. package/packages/webmcp-tester/package.json +1 -1
  154. package/packages/wiki/package.json +1 -1
  155. package/packages/workflow-events/package.json +1 -1
  156. package/packages/workspace-scanner/package.json +1 -1
  157. package/packages/worktree/package.json +1 -1
  158. package/packages/write-review/package.json +1 -1
@@ -0,0 +1,51 @@
1
+ import { describe, expect, it } from "bun:test";
2
+ import { ToolingRequestRegistry } from "../src/registry.ts";
3
+
4
+ const request = {
5
+ requestId: "biome-abc123",
6
+ workspaceRoot: "/work/web",
7
+ userKey: "user-1",
8
+ frameworks: ["next"],
9
+ };
10
+
11
+ describe("ToolingRequestRegistry", () => {
12
+ it("registers a proposal once", () => {
13
+ const registry = new ToolingRequestRegistry();
14
+ expect(registry.register(request)).toBe(true);
15
+ expect(registry.register(request)).toBe(false);
16
+ expect(registry.has(request.requestId)).toBe(true);
17
+ });
18
+
19
+ it("lets the first answer win", () => {
20
+ const registry = new ToolingRequestRegistry();
21
+ registry.register(request);
22
+
23
+ const first = registry.claim(request.requestId, "yes", "telegram");
24
+ expect(first?.resolution.preference).toBe("prefer_biome");
25
+ expect(first?.request.workspaceRoot).toBe("/work/web");
26
+
27
+ // The second click finds nothing - the first answer stays.
28
+ expect(registry.claim(request.requestId, "no", "line")).toBeNull();
29
+ expect(registry.resolutionOf(request.requestId)?.preference).toBe("prefer_biome");
30
+ });
31
+
32
+ it("maps a no to the current tools", () => {
33
+ const registry = new ToolingRequestRegistry();
34
+ registry.register(request);
35
+ const claimed = registry.claim(request.requestId, "no", "line");
36
+ expect(claimed?.resolution.preference).toBe("use_project_tools");
37
+ expect(claimed?.resolution.channel).toBe("line");
38
+ });
39
+
40
+ it("refuses a claim for an unknown request", () => {
41
+ const registry = new ToolingRequestRegistry();
42
+ expect(registry.claim("biome-unknown", "yes")).toBeNull();
43
+ });
44
+
45
+ it("does not register a request that was already answered", () => {
46
+ const registry = new ToolingRequestRegistry();
47
+ registry.register(request);
48
+ registry.claim(request.requestId, "no");
49
+ expect(registry.register(request)).toBe(false);
50
+ });
51
+ });
@@ -0,0 +1,99 @@
1
+ import { describe, expect, it } from "bun:test";
2
+ import { mkdtempSync, rmSync } from "node:fs";
3
+ import { tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+ import {
6
+ shouldAskAgain,
7
+ ToolingPreferenceStore,
8
+ toolingPreferenceKey,
9
+ } from "../src/store.ts";
10
+
11
+ function storePath(): string {
12
+ return join(mkdtempSync(join(tmpdir(), "tooling-store-")), "tooling-preference.json");
13
+ }
14
+
15
+ describe("ToolingPreferenceStore", () => {
16
+ it("has no record for an unknown user and workspace", () => {
17
+ const path = storePath();
18
+ const store = new ToolingPreferenceStore(path);
19
+ expect(store.read("user-1", "/work/web")).toBeUndefined();
20
+ });
21
+
22
+ it("keeps the record of a user in a workspace apart", () => {
23
+ const path = storePath();
24
+ const store = new ToolingPreferenceStore(path);
25
+ store.recordDecision("user-1", "/work/web", "prefer_biome", "biome-1");
26
+ store.recordDecision("user-2", "/work/web", "use_project_tools", "biome-2");
27
+ store.recordDecision("user-1", "/work/other", "use_project_tools", "biome-3");
28
+
29
+ expect(store.read("user-1", "/work/web")?.decision).toBe("prefer_biome");
30
+ expect(store.read("user-2", "/work/web")?.decision).toBe("use_project_tools");
31
+ expect(store.read("user-1", "/work/other")?.decision).toBe("use_project_tools");
32
+ });
33
+
34
+ it("remembers that the proposal was sent", () => {
35
+ const path = storePath();
36
+ const store = new ToolingPreferenceStore(path);
37
+ store.markAsked("user-1", "/work/web", "biome-1");
38
+ const record = store.read("user-1", "/work/web");
39
+ expect(record?.askedAt).toBeTruthy();
40
+ expect(record?.requestId).toBe("biome-1");
41
+ expect(record?.decision).toBeUndefined();
42
+ });
43
+
44
+ it("keeps a decision across a new store instance", () => {
45
+ const path = storePath();
46
+ new ToolingPreferenceStore(path).recordDecision(
47
+ "user-1",
48
+ "/work/web",
49
+ "prefer_biome",
50
+ "biome-1",
51
+ "telegram",
52
+ );
53
+ const record = new ToolingPreferenceStore(path).read("user-1", "/work/web");
54
+ expect(record?.decision).toBe("prefer_biome");
55
+ expect(record?.channel).toBe("telegram");
56
+ });
57
+
58
+ it("survives a broken store file", () => {
59
+ const path = storePath();
60
+ const store = new ToolingPreferenceStore(path);
61
+ store.markAsked("user-1", "/work/web", "biome-1");
62
+ // A store that cannot be read must not stop the harness.
63
+ Bun.write(path, "not json");
64
+ expect(store.read("user-1", "/work/web")).toBeUndefined();
65
+ });
66
+
67
+ it("keys a record by the user and the workspace", () => {
68
+ expect(toolingPreferenceKey("user-1", "/work/web")).not.toBe(
69
+ toolingPreferenceKey("user-2", "/work/web"),
70
+ );
71
+ expect(toolingPreferenceKey("user-1", "/work/web")).toBe(
72
+ toolingPreferenceKey("user-1", "/work/web"),
73
+ );
74
+ });
75
+ });
76
+
77
+ describe("shouldAskAgain", () => {
78
+ const day = 24 * 60 * 60 * 1000;
79
+ const now = new Date("2026-10-24T12:00:00.000Z");
80
+
81
+ it("asks a workspace that was never asked", () => {
82
+ expect(shouldAskAgain(undefined, 30 * day, now)).toBe(true);
83
+ });
84
+
85
+ it("never asks a workspace with a decision", () => {
86
+ const record = { decision: "prefer_biome" as const, askedAt: "2026-01-01T00:00:00.000Z" };
87
+ expect(shouldAskAgain(record, 30 * day, now)).toBe(false);
88
+ });
89
+
90
+ it("does not ask again inside the cooldown", () => {
91
+ const record = { askedAt: new Date(now.getTime() - day).toISOString() };
92
+ expect(shouldAskAgain(record, 30 * day, now)).toBe(false);
93
+ });
94
+
95
+ it("asks again after the cooldown", () => {
96
+ const record = { askedAt: new Date(now.getTime() - 31 * day).toISOString() };
97
+ expect(shouldAskAgain(record, 30 * day, now)).toBe(true);
98
+ });
99
+ });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/trajectory",
3
- "version": "1.1.404",
3
+ "version": "1.1.406",
4
4
  "description": "Trajectory capture for the write-review loop — persists cycle records for learning",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/tui",
3
- "version": "1.1.404",
3
+ "version": "1.1.406",
4
4
  "description": "pi-harness-runtime — tui",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/types",
3
- "version": "1.1.404",
3
+ "version": "1.1.406",
4
4
  "description": "Shared TypeScript types for pi-harness-runtime packages",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/voice-api",
3
- "version": "1.1.404",
3
+ "version": "1.1.406",
4
4
  "type": "module",
5
5
  "description": "Voice-to-text API using Whisper for Telegram and LINE integration",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/webmcp-tester",
3
- "version": "1.1.404",
3
+ "version": "1.1.406",
4
4
  "description": "WebMCP-powered E2E testing for pi-harness - natural language test scenarios",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/wiki",
3
- "version": "1.1.404",
3
+ "version": "1.1.406",
4
4
  "description": "LLM Wiki integration for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/workflow-events",
3
- "version": "1.1.404",
3
+ "version": "1.1.406",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/workspace-scanner",
3
- "version": "1.1.404",
3
+ "version": "1.1.406",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/worktree",
3
- "version": "1.1.404",
3
+ "version": "1.1.406",
4
4
  "description": "pi-harness-runtime — worktree",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/write-review",
3
- "version": "1.1.404",
3
+ "version": "1.1.406",
4
4
  "description": "Two-agent write-review loop with blackboard coordination",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",