pi-harness-runtime 1.1.510 → 1.1.511
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 +89 -0
- package/harness/mirror-record-merge.ts +64 -0
- package/harness/optional-event.ts +27 -0
- package/harness/provider-recovery-runtime.ts +143 -4
- package/harness/weekly-exhaustion-registry.ts +178 -0
- package/harness/weekly-quota-exhaustion.ts +172 -0
- package/index.ts +321 -2
- package/package.json +1 -1
- package/packages/agent-policy/package.json +1 -1
- package/packages/auth/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/codex-watcher/package.json +1 -1
- package/packages/config-capture/package.json +1 -1
- package/packages/contracts/package.json +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/package.json +1 -1
- package/packages/file-copy-helper/package.json +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/knowledge-retrieval/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/logging/package.json +1 -1
- package/packages/memory-engine/package.json +1 -1
- package/packages/notification/dist/adapters/email-adapter.d.ts.map +1 -1
- package/packages/notification/dist/adapters/email-adapter.js +1 -0
- package/packages/notification/dist/adapters/email-adapter.js.map +1 -1
- package/packages/notification/dist/adapters/line-adapter.d.ts.map +1 -1
- package/packages/notification/dist/adapters/line-adapter.js +1 -0
- package/packages/notification/dist/adapters/line-adapter.js.map +1 -1
- package/packages/notification/dist/adapters/ntfy-adapter.d.ts.map +1 -1
- package/packages/notification/dist/adapters/ntfy-adapter.js +1 -0
- package/packages/notification/dist/adapters/ntfy-adapter.js.map +1 -1
- package/packages/notification/dist/adapters/telegram-adapter.d.ts.map +1 -1
- package/packages/notification/dist/adapters/telegram-adapter.js +1 -0
- package/packages/notification/dist/adapters/telegram-adapter.js.map +1 -1
- package/packages/notification/dist/notification-center.d.ts.map +1 -1
- package/packages/notification/dist/notification-center.js +6 -0
- package/packages/notification/dist/notification-center.js.map +1 -1
- package/packages/notification/dist/telegram-webhook-handler.d.ts +14 -0
- package/packages/notification/dist/telegram-webhook-handler.d.ts.map +1 -1
- package/packages/notification/dist/telegram-webhook-handler.js +14 -0
- package/packages/notification/dist/telegram-webhook-handler.js.map +1 -1
- package/packages/notification/dist/types.d.ts +9 -1
- package/packages/notification/dist/types.d.ts.map +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/notification/src/adapters/email-adapter.ts +1 -0
- package/packages/notification/src/adapters/line-adapter.ts +1 -0
- package/packages/notification/src/adapters/ntfy-adapter.ts +1 -0
- package/packages/notification/src/adapters/telegram-adapter.ts +1 -0
- package/packages/notification/src/notification-center.ts +6 -0
- package/packages/notification/src/telegram-webhook-handler.ts +14 -0
- package/packages/notification/src/types.ts +8 -0
- package/packages/paperclip-integration/package.json +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/qdrant-skills/package.json +1 -1
- package/packages/quota-manager/package.json +1 -1
- package/packages/relay/package.json +1 -1
- package/packages/skill-mcp-client/package.json +1 -1
- package/packages/skills/package.json +1 -1
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/tooling-preference/package.json +1 -1
- package/packages/trajectory/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/two-phase-review/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/webmcp-tester/package.json +1 -1
- package/packages/wiki/package.json +1 -1
- package/packages/write-review/package.json +1 -1
- package/proactive-compact.ts +21 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"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AC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -115,6 +115,7 @@ export class EmailAdapter extends BaseChannelAdapter {
|
|
|
115
115
|
TaskFailed: "[❌]",
|
|
116
116
|
QuotaPaused: "[⏸]",
|
|
117
117
|
QuotaLowRemaining: "[⏳]",
|
|
118
|
+
QuotaWeeklyExhausted: "[📅]",
|
|
118
119
|
ResumeScheduled: "[▶]",
|
|
119
120
|
ContextCompacted: "[📦]",
|
|
120
121
|
OutputLimitContinued: "[🔄]",
|
|
@@ -88,6 +88,7 @@ export class NtfyAdapter extends BaseChannelAdapter {
|
|
|
88
88
|
TaskFailed: "x",
|
|
89
89
|
QuotaPaused: "pause_button",
|
|
90
90
|
QuotaLowRemaining: "hourglass",
|
|
91
|
+
QuotaWeeklyExhausted: "calendar",
|
|
91
92
|
ResumeScheduled: "play_button",
|
|
92
93
|
ContextCompacted: "package",
|
|
93
94
|
OutputLimitContinued: "repeat",
|
|
@@ -68,6 +68,7 @@ export function telegramStatusLabel(event: NotificationPayload["event"]): string
|
|
|
68
68
|
TaskFailed: "[FAIL]",
|
|
69
69
|
QuotaPaused: "[PAUSE]",
|
|
70
70
|
QuotaLowRemaining: "[QUOTA]",
|
|
71
|
+
QuotaWeeklyExhausted: "[WEEK]",
|
|
71
72
|
ResumeScheduled: "[RESUME]",
|
|
72
73
|
ContextCompacted: "[COMPACT]",
|
|
73
74
|
OutputLimitContinued: "[CONTINUE]",
|
|
@@ -859,6 +859,12 @@ export class NotificationCenter {
|
|
|
859
859
|
context.resetAt ? `, it resets at ${context.resetAt}` : ""
|
|
860
860
|
}.`,
|
|
861
861
|
},
|
|
862
|
+
QuotaWeeklyExhausted: {
|
|
863
|
+
title: "Weekly Quota Exhausted",
|
|
864
|
+
// The whole message travels: the remaining time of the week
|
|
865
|
+
// and the state of the work are what the human decides about.
|
|
866
|
+
message: fullRequirement,
|
|
867
|
+
},
|
|
862
868
|
ResumeScheduled: {
|
|
863
869
|
title: "Resume Scheduled",
|
|
864
870
|
message: `Job will resume work on: "${requirement}"`,
|
|
@@ -30,6 +30,20 @@ export const CallbackActions = {
|
|
|
30
30
|
* splitting on "_", so an action with an underscore would be cut in two.
|
|
31
31
|
*/
|
|
32
32
|
TOOLING_PREFERENCE: "biome",
|
|
33
|
+
/**
|
|
34
|
+
* The count down to the reset of an empty weekly allowance.
|
|
35
|
+
*
|
|
36
|
+
* The action must be a single token: the callback data is parsed by
|
|
37
|
+
* splitting on "_", so an action with an underscore would be cut in
|
|
38
|
+
* two.
|
|
39
|
+
*/
|
|
40
|
+
WEEK_COUNTDOWN: "weekcountdown",
|
|
41
|
+
/**
|
|
42
|
+
* The human deals with the account itself.
|
|
43
|
+
*
|
|
44
|
+
* The action must be a single token, like every other action here.
|
|
45
|
+
*/
|
|
46
|
+
WEEK_MANUAL: "weekmanual",
|
|
33
47
|
/** Custom action prefix */
|
|
34
48
|
CUSTOM: "custom",
|
|
35
49
|
} as const;
|
|
@@ -10,6 +10,14 @@ export type NotificationEvent =
|
|
|
10
10
|
| "TaskFailed"
|
|
11
11
|
| "QuotaPaused"
|
|
12
12
|
| "QuotaLowRemaining"
|
|
13
|
+
/**
|
|
14
|
+
* The weekly allowance of a provider is empty.
|
|
15
|
+
*
|
|
16
|
+
* It is its own event: the work stays paused until the human decides
|
|
17
|
+
* whether the harness counts down to the reset of the week or the human
|
|
18
|
+
* deals with the account itself.
|
|
19
|
+
*/
|
|
20
|
+
| "QuotaWeeklyExhausted"
|
|
13
21
|
| "ResumeScheduled"
|
|
14
22
|
| "ContextCompacted"
|
|
15
23
|
| "OutputLimitContinued"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/two-phase-review",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.511",
|
|
4
4
|
"description": "pi-harness-runtime — two-phase implementation and review workflow (queue review signals, gate the phase, scope the diff)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
package/proactive-compact.ts
CHANGED
|
@@ -145,6 +145,27 @@ export function isProviderRetryFailedReport(text: string): boolean {
|
|
|
145
145
|
return /Retry failed after \d+ attempts:/i.test(text);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
/**
|
|
149
|
+
* Whether the text is the report of an overload of the provider.
|
|
150
|
+
*
|
|
151
|
+
* The compaction is a request of its own, and it fails with the same
|
|
152
|
+
* overload as a turn. The text of such a failure names the number of the
|
|
153
|
+
* status (529) or one of the words that name an overload.
|
|
154
|
+
*
|
|
155
|
+
* The predicate reads the text only: the report of a failed compaction has
|
|
156
|
+
* no role and no stop reason, so the predicates of the assistant messages
|
|
157
|
+
* cannot read it.
|
|
158
|
+
*/
|
|
159
|
+
export function isProviderOverloadText(text: string | undefined | null): boolean {
|
|
160
|
+
if (typeof text !== "string" || text.trim().length === 0) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
if (/\b529\b/.test(text)) return true;
|
|
164
|
+
return /overloaded_error|peak-hour surge|temporarily busy|server is temporarily busy|try again shortly/i.test(
|
|
165
|
+
text,
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
148
169
|
/**
|
|
149
170
|
* Legacy check - returns true for BOTH fresh overloads AND "Retry failed" reports
|
|
150
171
|
* @deprecated Use isFreshProviderOverloadError for retry logic
|