pi-autotalk 0.1.8 → 0.1.12

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,11 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.12 - 2026-10-18
4
+
5
+ ### Changed
6
+
7
+ - Reuse the editor snapshot during an AutoTalk send tick to avoid a duplicate UI read.
8
+
9
+ ## 0.1.11 - 2026-10-16
10
+
11
+ ### Changed
12
+
13
+ - Verify compatibility with Pi SDK 1.2.0.
14
+
15
+ ## 0.1.10 - 2026-10-12
16
+
17
+ ### Changed
18
+
19
+ - Verify compatibility with Pi SDK 1.1.0.
20
+
3
21
  ## 0.1.8 - 2026-09-27
4
22
 
5
23
  - chore: periodic patch bump after 7+ days without npm publish
6
24
 
7
25
  ## Unreleased
8
26
 
27
+ ## [0.1.9] - 2026-09-30
28
+
29
+ ### Changed
30
+
31
+ - Update `@earendil-works/pi-*` dependencies to `0.99.1`.
32
+
9
33
  ## [0.1.7] - 2026-08-22
10
34
 
11
35
  ### Changed
@@ -0,0 +1,103 @@
1
+ {
2
+ "schema_version": 1,
3
+ "verification_contract": "pi-sdk-behavior-v2",
4
+ "sdk_versions": {
5
+ "@earendil-works/pi-agent-core": "1.2.0",
6
+ "@earendil-works/pi-ai": "1.2.0",
7
+ "@earendil-works/pi-coding-agent": "1.2.0",
8
+ "@earendil-works/pi-tui": "1.2.0"
9
+ },
10
+ "platform": "win32",
11
+ "model_inference": "none; actual Pi RPC host handles AutoTalk commands using isolated settings",
12
+ "unhandled_errors": 0,
13
+ "extension_load_errors": 0,
14
+ "cases": [
15
+ {
16
+ "name": "extension_load",
17
+ "command": "npm run smoke:pi",
18
+ "exit_code": 0,
19
+ "passed": true,
20
+ "evidence": "{\"type\":\"extension_ui_request\",\"id\":\"ed66b7e3-ee56-45f4-be92-5e49de9c8805\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\"}\n{\"type\":\"extension_ui_request\",\"id\":\"b7cc395f-fb81-4e9b-8c23-1ebdb41bc6f0\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\",\"statusText\":\"\\u001b[38;5;5mAutoTalk\\u001b[39m\\u001b[39m\\u001b[2m on 10s followUp\\u001b[22;39m\"}\n{\"id\":\"load-on\",\"type\":\"response\",\"command\":\"prompt\",\"success\":true,\"data\":{\"disposition\":\"handled\"}}\n{\"type\":\"extension_ui_request\",\"id\":\"7014a6de-7c02-4fac-98cb-3dd3a9380d1d\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\"}\n{\"id\":\"load-off\",\"type\":\"response\",\"command\":\"prompt\",\"success\":true,\"data\":{\"disposition\":\"handled\"}}\n",
21
+ "assertions": [
22
+ {
23
+ "id": "extension_registered",
24
+ "expected": "Actual Pi handles /autotalk:on and emits AutoTalk's enabled status",
25
+ "observed": "{\"response\":{\"id\":\"load-on\",\"type\":\"response\",\"command\":\"prompt\",\"success\":true,\"data\":{\"disposition\":\"handled\"}},\"status\":{\"type\":\"extension_ui_request\",\"id\":\"b7cc395f-fb81-4e9b-8c23-1ebdb41bc6f0\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\",\"statusText\":\"\\u001b[38;5;5mAutoTalk\\u001b[39m\\u001b[39m\\u001b[2m on 10s followUp\\u001b[22;39m\"}}",
26
+ "passed": true
27
+ }
28
+ ]
29
+ },
30
+ {
31
+ "name": "happy_path",
32
+ "command": "npm run smoke:pi",
33
+ "exit_code": 0,
34
+ "passed": true,
35
+ "evidence": "{\"type\":\"extension_ui_request\",\"id\":\"da797a71-ea50-4eb0-9fb6-e14455f02fb9\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\"}\n{\"type\":\"extension_ui_request\",\"id\":\"86b3bb49-b134-4be5-96a8-c2e036fc1242\",\"method\":\"input\",\"title\":\"AutoTalk interval seconds (5-120):\",\"placeholder\":\"10\"}\n{\"type\":\"extension_ui_request\",\"id\":\"27bd9863-843c-4d1b-bb90-3b99e27b253d\",\"method\":\"select\",\"title\":\"AutoTalk delivery mode:\",\"options\":[\"followUp\",\"steer\"]}\n{\"type\":\"extension_ui_request\",\"id\":\"17aee6da-ac1e-49ec-94e1-c83388b3661c\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\"}\n{\"id\":\"feature-settings\",\"type\":\"response\",\"command\":\"prompt\",\"success\":true,\"data\":{\"disposition\":\"handled\"}}\n{\"type\":\"extension_ui_request\",\"id\":\"91a0e62f-c068-4922-88f7-095ff180ff46\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\",\"statusText\":\"\\u001b[38;5;5mAutoTalk\\u001b[39m\\u001b[39m\\u001b[2m on 15s steer\\u001b[22;39m\"}\n{\"id\":\"feature-on\",\"type\":\"response\",\"command\":\"prompt\",\"success\":true,\"data\":{\"disposition\":\"handled\"}}\n{\"type\":\"extension_ui_request\",\"id\":\"5088469c-cdbf-4539-952c-59264b0536a9\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\"}\n{\"id\":\"feature-off\",\"type\":\"response\",\"command\":\"prompt\",\"success\":true,\"data\":{\"disposition\":\"handled\"}}\n",
36
+ "assertions": [
37
+ {
38
+ "id": "feature_response",
39
+ "expected": "Settings entered through Pi RPC persist and the enabled command reports the configured interval and mode",
40
+ "observed": "{\"response\":{\"id\":\"feature-on\",\"type\":\"response\",\"command\":\"prompt\",\"success\":true,\"data\":{\"disposition\":\"handled\"}},\"status\":{\"type\":\"extension_ui_request\",\"id\":\"91a0e62f-c068-4922-88f7-095ff180ff46\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\",\"statusText\":\"\\u001b[38;5;5mAutoTalk\\u001b[39m\\u001b[39m\\u001b[2m on 15s steer\\u001b[22;39m\"},\"persistedSettings\":{\"intervalSec\":15,\"deliveryMode\":\"steer\"}}",
41
+ "passed": true
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ "name": "error_path",
47
+ "command": "npm run smoke:pi",
48
+ "exit_code": 0,
49
+ "passed": true,
50
+ "evidence": "{\"type\":\"extension_ui_request\",\"id\":\"a6839064-1c2a-467e-ba61-8586d4c7fe36\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\"}\n{\"type\":\"response\",\"command\":\"parse\",\"success\":false,\"error\":\"Failed to parse command: Unexpected token 'o', \\\"not-json\\\" is not valid JSON\"}\n",
51
+ "assertions": [
52
+ {
53
+ "id": "handled_error",
54
+ "expected": "Malformed RPC input is rejected with success=false and a parse error, without an unhandled host error",
55
+ "observed": "{\"type\":\"response\",\"command\":\"parse\",\"success\":false,\"error\":\"Failed to parse command: Unexpected token 'o', \\\"not-json\\\" is not valid JSON\"}",
56
+ "passed": true
57
+ }
58
+ ]
59
+ },
60
+ {
61
+ "name": "reload_cleanup",
62
+ "command": "npm run smoke:pi",
63
+ "exit_code": 0,
64
+ "passed": true,
65
+ "evidence": "{\"type\":\"extension_ui_request\",\"id\":\"f0d3a51b-01eb-49b0-98db-be4a1923aab0\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\"}\n{\"type\":\"extension_ui_request\",\"id\":\"8abc6627-b12d-4a32-afa9-55e19bfd95c5\",\"method\":\"input\",\"title\":\"AutoTalk interval seconds (5-120):\",\"placeholder\":\"15\"}\n{\"type\":\"extension_ui_request\",\"id\":\"a4cf440d-b679-47ad-9e6c-feb9c965dd51\",\"method\":\"select\",\"title\":\"AutoTalk delivery mode:\",\"options\":[\"followUp\",\"steer\"]}\n{\"type\":\"extension_ui_request\",\"id\":\"a79bc984-58bd-4fcc-80d5-22110159987e\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\"}\n{\"id\":\"reload-settings\",\"type\":\"response\",\"command\":\"prompt\",\"success\":true,\"data\":{\"disposition\":\"handled\"}}\n\n--- second Pi host ---\n{\"type\":\"extension_ui_request\",\"id\":\"e4ed8103-ce77-45fc-96dd-cda4a4497a77\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\"}\n{\"type\":\"extension_ui_request\",\"id\":\"e79486af-93c3-41c0-9e40-4245e1599ca9\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\",\"statusText\":\"\\u001b[38;5;5mAutoTalk\\u001b[39m\\u001b[39m\\u001b[2m on 15s steer\\u001b[22;39m\"}\n{\"id\":\"reload-on\",\"type\":\"response\",\"command\":\"prompt\",\"success\":true,\"data\":{\"disposition\":\"handled\"}}\n{\"type\":\"extension_ui_request\",\"id\":\"cb76b940-2799-481c-ab9c-3ee4f388c3be\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\"}\n{\"id\":\"reload-off\",\"type\":\"response\",\"command\":\"prompt\",\"success\":true,\"data\":{\"disposition\":\"handled\"}}\n",
66
+ "assertions": [
67
+ {
68
+ "id": "reloaded_extension_registered",
69
+ "expected": "A second actual Pi host loads the persisted AutoTalk settings and handles /autotalk:on",
70
+ "observed": "{\"id\":\"reload-on\",\"type\":\"response\",\"command\":\"prompt\",\"success\":true,\"data\":{\"disposition\":\"handled\"}}",
71
+ "passed": true
72
+ },
73
+ {
74
+ "id": "reloaded_feature_response",
75
+ "expected": "The reloaded host emits the feature status using settings persisted by the first host",
76
+ "observed": "{\"status\":{\"type\":\"extension_ui_request\",\"id\":\"e79486af-93c3-41c0-9e40-4245e1599ca9\",\"method\":\"setStatus\",\"statusKey\":\"autotalk\",\"statusText\":\"\\u001b[38;5;5mAutoTalk\\u001b[39m\\u001b[39m\\u001b[2m on 15s steer\\u001b[22;39m\"},\"persistedSettings\":{\"intervalSec\":15,\"deliveryMode\":\"steer\"}}",
77
+ "passed": true
78
+ },
79
+ {
80
+ "id": "clean_shutdown",
81
+ "expected": "Both actual Pi hosts close with exit code zero and no unhandled or shutdown errors",
82
+ "observed": "{\"exit_codes\":[0,0],\"errors\":false}",
83
+ "passed": true
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ "name": "host_shell",
89
+ "command": "npm run smoke:pi",
90
+ "exit_code": 0,
91
+ "passed": true,
92
+ "evidence": "1.2.0\n",
93
+ "assertions": [
94
+ {
95
+ "id": "native_shell_boundary",
96
+ "expected": "Native host shell launches the locally pinned Pi CLI and returns its exact SDK version",
97
+ "observed": "{\"exit_code\":0,\"output\":\"1.2.0\",\"expectedVersion\":\"1.2.0\"}",
98
+ "passed": true
99
+ }
100
+ ]
101
+ }
102
+ ]
103
+ }
@@ -53,14 +53,16 @@ export default function (pi: ExtensionAPI) {
53
53
  editorWatcher = undefined;
54
54
  }
55
55
 
56
- function observeEditor(ctx = latestContext): void {
57
- if (!ctx?.hasUI) return;
56
+ function observeEditor(ctx = latestContext): string | undefined {
57
+ if (!ctx?.hasUI) return undefined;
58
58
 
59
59
  const current = ctx.ui.getEditorText();
60
60
  if (current !== lastObservedEditorText) {
61
61
  lastObservedEditorText = current;
62
62
  lastInputChangeAt = Date.now();
63
63
  }
64
+
65
+ return current;
64
66
  }
65
67
 
66
68
  function sendUserMessage(ctx: ExtensionContext, text: string): void {
@@ -88,12 +90,11 @@ export default function (pi: ExtensionAPI) {
88
90
  const ctx = latestContext;
89
91
  if (!enabled || sending || !ctx?.hasUI) return;
90
92
 
91
- observeEditor(ctx);
93
+ const editorText = observeEditor(ctx);
94
+ if (editorText === undefined) return;
92
95
 
93
96
  if (Date.now() - lastInputChangeAt < IDLE_BEFORE_SEND_MS) return;
94
97
 
95
- const editorText = ctx.ui.getEditorText();
96
-
97
98
  if (editorText.startsWith("/")) return;
98
99
 
99
100
  if (editorText.trim() === "") {
package/package.json CHANGED
@@ -1,56 +1,60 @@
1
- {
2
- "name": "pi-autotalk",
3
- "version": "0.1.8",
4
- "description": "A Pi extension for timed AutoTalk brainstorming from the editor input.",
5
- "type": "module",
6
- "license": "MIT",
7
- "author": "eiei114",
8
- "keywords": [
9
- "pi-package",
10
- "pi",
11
- "pi-extension",
12
- "autotalk",
13
- "brainstorming",
14
- "typescript"
15
- ],
16
- "repository": {
17
- "type": "git",
18
- "url": "git+https://github.com/eiei114/pi-autotalk.git"
19
- },
20
- "bugs": {
21
- "url": "https://github.com/eiei114/pi-autotalk/issues"
22
- },
23
- "homepage": "https://github.com/eiei114/pi-autotalk#readme",
24
- "files": [
25
- "extensions/",
26
- "lib/",
27
- "docs/",
28
- "README.md",
29
- "LICENSE",
30
- "CHANGELOG.md",
31
- "SECURITY.md"
32
- ],
33
- "scripts": {
34
- "typecheck": "tsc --noEmit",
35
- "test": "node --test tests/*.test.mjs",
36
- "ci": "npm run typecheck && npm test && npm run pack:check",
37
- "pack:check": "npm pack --dry-run",
38
- "version:check": "node scripts/check-version-bump.mjs"
39
- },
40
- "pi": {
41
- "extensions": [
42
- "./extensions"
43
- ]
44
- },
45
- "publishConfig": {
46
- "access": "public"
47
- },
48
- "peerDependencies": {
49
- "@earendil-works/pi-coding-agent": "*"
50
- },
51
- "devDependencies": {
52
- "@earendil-works/pi-coding-agent": "^0.84.1",
53
- "@types/node": "^26.0.1",
54
- "typescript": "^7.0.2"
55
- }
56
- }
1
+ {
2
+ "name": "pi-autotalk",
3
+ "version": "0.1.12",
4
+ "description": "A Pi extension for timed AutoTalk brainstorming from the editor input.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "eiei114",
8
+ "keywords": [
9
+ "pi-package",
10
+ "pi",
11
+ "pi-extension",
12
+ "autotalk",
13
+ "brainstorming",
14
+ "typescript"
15
+ ],
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/eiei114/pi-autotalk.git"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/eiei114/pi-autotalk/issues"
22
+ },
23
+ "homepage": "https://github.com/eiei114/pi-autotalk#readme",
24
+ "files": [
25
+ "extensions/",
26
+ "lib/",
27
+ "docs/",
28
+ "README.md",
29
+ "LICENSE",
30
+ "CHANGELOG.md",
31
+ "SECURITY.md"
32
+ ],
33
+ "scripts": {
34
+ "typecheck": "tsc --noEmit",
35
+ "test": "node --test tests/*.test.mjs",
36
+ "ci": "npm run typecheck && npm test && npm run smoke:pi && npm run pack:check",
37
+ "smoke:pi": "node scripts/pi-sdk-smoke.mjs",
38
+ "pack:check": "npm pack --dry-run",
39
+ "version:check": "node scripts/check-version-bump.mjs"
40
+ },
41
+ "pi": {
42
+ "extensions": [
43
+ "./extensions"
44
+ ]
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "peerDependencies": {
50
+ "@earendil-works/pi-coding-agent": "*"
51
+ },
52
+ "devDependencies": {
53
+ "@earendil-works/pi-agent-core": "1.2.0",
54
+ "@earendil-works/pi-ai": "1.2.0",
55
+ "@earendil-works/pi-coding-agent": "1.2.0",
56
+ "@earendil-works/pi-tui": "1.2.0",
57
+ "@types/node": "^26.0.1",
58
+ "typescript": "^7.0.2"
59
+ }
60
+ }