pi-harness-runtime 0.10.25 → 0.10.26
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
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.10.26](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.10.14...v0.10.26) (2026-08-10)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **file-copy-helper:** inject cp rule when user asks to mimic/copy files ([f089f0d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f089f0d5e3e933231c99ee38cf18fa208c8eb8b2))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* align TS formatting with main (remove 3-line logError) ([2515ad5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/2515ad54f43f0566123c686d3ec4f92ad363ea13))
|
|
16
|
+
* correct import paths for notification-center dist files ([f248722](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f24872240c07bf115f69530a3bdabedf73e3c858))
|
|
17
|
+
* **file-copy-helper:** inject rule for import errors - copy missing files, don't fix one-by-one ([03a5b0a](https://github.com/ManotLuijiu/pi-harness-runtime/commit/03a5b0a1bd899866f76fbd6482b52097c7d27a5b))
|
|
18
|
+
* **file-copy-helper:** strengthen rule - agent must NOT read source files before copying ([5bbf7f7](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5bbf7f70f19213f4e08059aa3766301d5966daa8))
|
|
19
|
+
* handle array/object content in pi-usage-status build detection ([68b07a8](https://github.com/ManotLuijiu/pi-harness-runtime/commit/68b07a8e8167a95ab1b519782a07ec3a582eec5a))
|
|
20
|
+
* skip publish-time scripts in release workflow ([b385148](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b38514835dc3f6fd717ca8c71dbb6d131de4887f))
|
|
21
|
+
* suppress noisy stack traces in harness agents ([34bbe98](https://github.com/ManotLuijiu/pi-harness-runtime/commit/34bbe98f59e740fcfcd8622f1dcc09c379f6f3df))
|
|
22
|
+
* **todo-bd-sync:** disable auto-injection completely - was causing noisy output ([699d6de](https://github.com/ManotLuijiu/pi-harness-runtime/commit/699d6de5e7f3b062799a0f791b386d1ecd452b00))
|
|
23
|
+
* **todo-bd-sync:** silence all console output - no startup warnings ([2d29bcf](https://github.com/ManotLuijiu/pi-harness-runtime/commit/2d29bcf51b25fe1b1253aa965e370852f3cae289))
|
|
24
|
+
* update bd install URL to correct repo ([5800f30](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5800f304913912a84c34d3f42a29b01bb2d87b24))
|
|
25
|
+
|
|
5
26
|
### [0.10.25](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.10.14...v0.10.25) (2026-08-10)
|
|
6
27
|
|
|
7
28
|
|
package/package.json
CHANGED
|
@@ -21,6 +21,21 @@ var READ_SOURCE_TRIGGERS = [
|
|
|
21
21
|
"reading file",
|
|
22
22
|
"lets read"
|
|
23
23
|
];
|
|
24
|
+
var IMPORT_ERROR_TRIGGERS = [
|
|
25
|
+
"import error",
|
|
26
|
+
"import errors",
|
|
27
|
+
"cannot find module",
|
|
28
|
+
"cannot resolve",
|
|
29
|
+
"module not found",
|
|
30
|
+
"missing import",
|
|
31
|
+
"missing file",
|
|
32
|
+
"does not exist",
|
|
33
|
+
"@repo/",
|
|
34
|
+
"error one by one",
|
|
35
|
+
"fix errors one by one",
|
|
36
|
+
"fix imports one by one",
|
|
37
|
+
"roll back"
|
|
38
|
+
];
|
|
24
39
|
var COPY_RULE = `
|
|
25
40
|
## COPY FILES DIRECTLY (CRITICAL)
|
|
26
41
|
|
|
@@ -55,6 +70,32 @@ Just run: sudo cp /path/to/source /path/to/dest
|
|
|
55
70
|
|
|
56
71
|
Copying is instant and preserves exact code. Reading is unnecessary.
|
|
57
72
|
`;
|
|
73
|
+
var IMPORT_ERROR_RULE = `
|
|
74
|
+
## IMPORT ERRORS? COPY THOSE FILES TOO!
|
|
75
|
+
|
|
76
|
+
When you see import/module errors after copying a file:
|
|
77
|
+
|
|
78
|
+
1. **STOP fixing imports one by one**
|
|
79
|
+
2. **STOP rolling back**
|
|
80
|
+
3. **LIST all missing import files** for the user
|
|
81
|
+
4. **Ask user which to copy**, then copy them via sudo cp
|
|
82
|
+
|
|
83
|
+
Example:
|
|
84
|
+
\`\`\`bash
|
|
85
|
+
# If error shows missing:
|
|
86
|
+
# - @repo/auth/server
|
|
87
|
+
# - @repo/design-system/components/ui/sidebar
|
|
88
|
+
# - ./components/notifications-provider
|
|
89
|
+
|
|
90
|
+
# Then copy these files the same way:
|
|
91
|
+
sudo cp /source/path/@repo/auth/server.ts /dest/path/@repo/auth/server.ts
|
|
92
|
+
sudo cp -r /source/path/@repo/design-system/components/ui/sidebar /dest/path/@repo/design-system/components/ui/sidebar
|
|
93
|
+
sudo cp /source/path/components/notifications-provider.tsx /dest/path/components/notifications-provider.tsx
|
|
94
|
+
\`\`\`
|
|
95
|
+
|
|
96
|
+
**NEVER fix imports one by one** - copy the missing files instead!
|
|
97
|
+
**NEVER roll back** - keep the copied file and copy its dependencies!
|
|
98
|
+
`;
|
|
58
99
|
function shouldInjectCopyRule(text) {
|
|
59
100
|
const lower = text.toLowerCase();
|
|
60
101
|
return COPY_KEYWORDS.some((keyword) => lower.includes(keyword));
|
|
@@ -65,6 +106,10 @@ function shouldInjectReadWarning(text) {
|
|
|
65
106
|
const hasReadIntent = READ_SOURCE_TRIGGERS.some((t) => lower.includes(t));
|
|
66
107
|
return hasSourcePath && hasReadIntent;
|
|
67
108
|
}
|
|
109
|
+
function shouldInjectImportErrorRule(text) {
|
|
110
|
+
const lower = text.toLowerCase();
|
|
111
|
+
return IMPORT_ERROR_TRIGGERS.some((t) => lower.includes(t));
|
|
112
|
+
}
|
|
68
113
|
function registerFileCopyHelper(pi) {
|
|
69
114
|
pi.on("input", (event) => {
|
|
70
115
|
if (event.source !== "interactive") {
|
|
@@ -86,6 +131,12 @@ function registerFileCopyHelper(pi) {
|
|
|
86
131
|
text: text + READ_WARNING
|
|
87
132
|
};
|
|
88
133
|
}
|
|
134
|
+
if (shouldInjectImportErrorRule(text)) {
|
|
135
|
+
return {
|
|
136
|
+
action: "transform",
|
|
137
|
+
text: text + IMPORT_ERROR_RULE
|
|
138
|
+
};
|
|
139
|
+
}
|
|
89
140
|
return;
|
|
90
141
|
});
|
|
91
142
|
}
|
|
@@ -37,6 +37,23 @@ const READ_SOURCE_TRIGGERS = [
|
|
|
37
37
|
"lets read",
|
|
38
38
|
];
|
|
39
39
|
|
|
40
|
+
// When agent sees import/module errors (needs to copy those files too)
|
|
41
|
+
const IMPORT_ERROR_TRIGGERS = [
|
|
42
|
+
"import error",
|
|
43
|
+
"import errors",
|
|
44
|
+
"cannot find module",
|
|
45
|
+
"cannot resolve",
|
|
46
|
+
"module not found",
|
|
47
|
+
"missing import",
|
|
48
|
+
"missing file",
|
|
49
|
+
"does not exist",
|
|
50
|
+
"@repo/",
|
|
51
|
+
"error one by one",
|
|
52
|
+
"fix errors one by one",
|
|
53
|
+
"fix imports one by one",
|
|
54
|
+
"roll back",
|
|
55
|
+
];
|
|
56
|
+
|
|
40
57
|
// Extract source and destination from user request
|
|
41
58
|
const COPY_RULE = `
|
|
42
59
|
## COPY FILES DIRECTLY (CRITICAL)
|
|
@@ -75,6 +92,34 @@ Just run: sudo cp /path/to/source /path/to/dest
|
|
|
75
92
|
Copying is instant and preserves exact code. Reading is unnecessary.
|
|
76
93
|
`;
|
|
77
94
|
|
|
95
|
+
// When agent sees import errors - copy those files too!
|
|
96
|
+
const IMPORT_ERROR_RULE = `
|
|
97
|
+
## IMPORT ERRORS? COPY THOSE FILES TOO!
|
|
98
|
+
|
|
99
|
+
When you see import/module errors after copying a file:
|
|
100
|
+
|
|
101
|
+
1. **STOP fixing imports one by one**
|
|
102
|
+
2. **STOP rolling back**
|
|
103
|
+
3. **LIST all missing import files** for the user
|
|
104
|
+
4. **Ask user which to copy**, then copy them via sudo cp
|
|
105
|
+
|
|
106
|
+
Example:
|
|
107
|
+
\`\`\`bash
|
|
108
|
+
# If error shows missing:
|
|
109
|
+
# - @repo/auth/server
|
|
110
|
+
# - @repo/design-system/components/ui/sidebar
|
|
111
|
+
# - ./components/notifications-provider
|
|
112
|
+
|
|
113
|
+
# Then copy these files the same way:
|
|
114
|
+
sudo cp /source/path/@repo/auth/server.ts /dest/path/@repo/auth/server.ts
|
|
115
|
+
sudo cp -r /source/path/@repo/design-system/components/ui/sidebar /dest/path/@repo/design-system/components/ui/sidebar
|
|
116
|
+
sudo cp /source/path/components/notifications-provider.tsx /dest/path/components/notifications-provider.tsx
|
|
117
|
+
\`\`\`
|
|
118
|
+
|
|
119
|
+
**NEVER fix imports one by one** - copy the missing files instead!
|
|
120
|
+
**NEVER roll back** - keep the copied file and copy its dependencies!
|
|
121
|
+
`;
|
|
122
|
+
|
|
78
123
|
/**
|
|
79
124
|
* Check if text contains copy-related keywords
|
|
80
125
|
*/
|
|
@@ -94,6 +139,14 @@ function shouldInjectReadWarning(text: string): boolean {
|
|
|
94
139
|
return hasSourcePath && hasReadIntent;
|
|
95
140
|
}
|
|
96
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Check if text contains import error triggers
|
|
144
|
+
*/
|
|
145
|
+
function shouldInjectImportErrorRule(text: string): boolean {
|
|
146
|
+
const lower = text.toLowerCase();
|
|
147
|
+
return IMPORT_ERROR_TRIGGERS.some((t) => lower.includes(t));
|
|
148
|
+
}
|
|
149
|
+
|
|
97
150
|
/**
|
|
98
151
|
* Register the file-copy-helper extension
|
|
99
152
|
*/
|
|
@@ -125,6 +178,14 @@ export function registerFileCopyHelper(pi: ExtensionAPI): void {
|
|
|
125
178
|
};
|
|
126
179
|
}
|
|
127
180
|
|
|
181
|
+
// Inject import error rule when agent sees missing imports
|
|
182
|
+
if (shouldInjectImportErrorRule(text)) {
|
|
183
|
+
return {
|
|
184
|
+
action: "transform",
|
|
185
|
+
text: text + IMPORT_ERROR_RULE,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
128
189
|
return;
|
|
129
190
|
});
|
|
130
191
|
}
|