@fitchmultz/pi-subagents 0.52.15 → 0.52.17
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 +26 -0
- package/dist/agent/host.js +1 -1
- package/dist/agent/notifications.js +10 -8
- package/dist/agent/observe-layout.js +3 -3
- package/dist/agent/parking.js +0 -1
- package/dist/agent/process.js +1 -4
- package/dist/agent/runner.js +0 -2
- package/dist/agent/shutdown.js +0 -1
- package/dist/agent/typebox.js +2 -2
- package/dist/build-info.js +1 -1
- package/dist/pi-intercom/bridge-presence.js +0 -1
- package/dist/pi-intercom/bridge-protocol.js +0 -2
- package/dist/pi-intercom/bridge-session.js +0 -1
- package/dist/pi-intercom/bridge-wake.js +0 -1
- package/dist/pi-intercom/broker/client.js +0 -2
- package/dist/pi-intercom/broker/spawn.js +0 -3
- package/dist/pi-intercom/tool-registration.js +1 -2
- package/dist/pi-intercom/validation.js +0 -2
- package/dist/shared/cooperative.js +0 -1
- package/docs/code-quality.md +96 -68
- package/package.json +9 -6
- package/scripts/build.mjs +11 -13
- package/scripts/check-compat.mjs +3 -2
- package/scripts/compat-host.mjs +5 -5
- package/scripts/intercom-bridge-credentials.mjs +4 -3
- package/scripts/intercom-remote.mjs +0 -1
- package/scripts/native-package-smoke-assertions.mjs +25 -23
- package/scripts/native-package-smoke.mjs +38 -54
- package/scripts/package-smoke.mjs +39 -30
- package/scripts/prepare.mjs +16 -10
- package/scripts/real-pi-events.mjs +92 -0
- package/scripts/real-pi-live.mjs +28 -108
- package/scripts/real-pi-processes.mjs +77 -82
- package/scripts/real-pi-smoke.mjs +20 -18
- package/src/agent/host.ts +1 -1
- package/src/agent/notifications.ts +11 -8
- package/src/agent/observe-layout.ts +3 -3
- package/src/agent/parking.ts +0 -1
- package/src/agent/process.ts +1 -4
- package/src/agent/runner.ts +0 -2
- package/src/agent/shutdown.ts +0 -1
- package/src/agent/typebox.ts +2 -2
- package/src/pi-intercom/bridge-presence.ts +0 -1
- package/src/pi-intercom/bridge-protocol.ts +0 -2
- package/src/pi-intercom/bridge-session.ts +0 -1
- package/src/pi-intercom/bridge-wake.ts +0 -1
- package/src/pi-intercom/broker/client.ts +0 -2
- package/src/pi-intercom/broker/spawn.ts +0 -3
- package/src/pi-intercom/tool-registration.ts +1 -2
- package/src/pi-intercom/validation.ts +0 -2
- package/src/shared/cooperative.ts +0 -1
|
@@ -118,7 +118,6 @@ export class PersistentPresence {
|
|
|
118
118
|
}
|
|
119
119
|
try {
|
|
120
120
|
// Each identity has one connection attempt; preserve the native broker's spawn safeguards.
|
|
121
|
-
// oxlint-disable-next-line no-await-in-loop
|
|
122
121
|
await this.owner.connect(identity, registration.expires);
|
|
123
122
|
} catch {
|
|
124
123
|
log("presence_retry", { name: identity.name, result: "broker_unavailable" });
|
|
@@ -33,7 +33,6 @@ export function object(value: unknown, fields: readonly string[]): UnknownRecord
|
|
|
33
33
|
|
|
34
34
|
export function label(value: unknown, field: string, max = 512): string {
|
|
35
35
|
// Labels are single-line identifiers and paths; reject C0/C1 controls and DEL.
|
|
36
|
-
// oxlint-disable-next-line no-control-regex
|
|
37
36
|
const controls = /[\u0000-\u001f\u007f-\u009f]/;
|
|
38
37
|
if (
|
|
39
38
|
typeof value !== "string" ||
|
|
@@ -48,7 +47,6 @@ export function label(value: unknown, field: string, max = 512): string {
|
|
|
48
47
|
|
|
49
48
|
export function text(value: unknown): string {
|
|
50
49
|
// Message text permits tab/newline/CR, but rejects other C0/C1 controls and DEL.
|
|
51
|
-
// oxlint-disable-next-line no-control-regex
|
|
52
50
|
const controls = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f]/;
|
|
53
51
|
if (typeof value !== "string" || value.trim() === "" || controls.test(value)) {
|
|
54
52
|
throw new Fault(400, "invalid_input", "Invalid message.");
|
|
@@ -359,7 +359,6 @@ export class Session {
|
|
|
359
359
|
log("inbox_wait", { ...this.fields(), requestId: context.requestId, after: operation.after });
|
|
360
360
|
try {
|
|
361
361
|
// A nonmatching commit must rearm the same cursor, not start parallel readers.
|
|
362
|
-
// oxlint-disable-next-line no-await-in-loop
|
|
363
362
|
await delay(remaining, undefined, { signal });
|
|
364
363
|
} catch (error) {
|
|
365
364
|
if (!signal.aborted) {
|
|
@@ -199,7 +199,6 @@ export class WakeDeliveries {
|
|
|
199
199
|
// ponytail: two cold Macs can each admit one wake. Literal cross-Mac single admission
|
|
200
200
|
// requires a neutral quota authority governing every writer, not a URL hash or HTTP 2xx.
|
|
201
201
|
try {
|
|
202
|
-
// oxlint-disable-next-line no-await-in-loop
|
|
203
202
|
await this.post(candidate);
|
|
204
203
|
} finally {
|
|
205
204
|
// Expiry starts after response/error/abort, never before COMMIT or connect/TLS.
|
|
@@ -202,12 +202,10 @@ export class IntercomClient extends EventEmitter {
|
|
|
202
202
|
): Promise<void> {
|
|
203
203
|
for (const topic of topics ?? []) {
|
|
204
204
|
// Restore frames are individually acknowledged to preserve order and bound socket payloads.
|
|
205
|
-
// oxlint-disable-next-line no-await-in-loop
|
|
206
205
|
await this.updateTopics({ action: "restore", topic });
|
|
207
206
|
}
|
|
208
207
|
for (const subscription of subscriptions ?? []) {
|
|
209
208
|
// Subscriptions are committed before connect resolves and subsequent messages can arrive.
|
|
210
|
-
// oxlint-disable-next-line no-await-in-loop
|
|
211
209
|
await this.updateTopics({ action: "restore", subscription });
|
|
212
210
|
}
|
|
213
211
|
}
|
|
@@ -179,7 +179,6 @@ async function previousBrokerWarning(): Promise<string | undefined> {
|
|
|
179
179
|
const previousSockets = getPreviousBrokerSocketPaths();
|
|
180
180
|
for (const socketPath of previousSockets) {
|
|
181
181
|
// Migration probes are sequential and never register or send to old peers.
|
|
182
|
-
// oxlint-disable-next-line no-await-in-loop
|
|
183
182
|
if (isOwnedBrokerSocket(socketPath) && (await checkOneSocket(socketPath))) {
|
|
184
183
|
return "An older agent-directory Intercom broker is still running. Its peers are not part of shared same-user discovery until they reload with the updated extension. Existing sessions and accepted work are untouched; no legacy fallback is used.";
|
|
185
184
|
}
|
|
@@ -289,12 +288,10 @@ async function waitForBroker(timeoutMs = 5000): Promise<void> {
|
|
|
289
288
|
const start = Date.now();
|
|
290
289
|
while (Date.now() - start < timeoutMs) {
|
|
291
290
|
// Each probe must finish before the next to avoid parallel socket attempts.
|
|
292
|
-
// oxlint-disable-next-line no-await-in-loop
|
|
293
291
|
if (await checkSocketConnectable()) {
|
|
294
292
|
return;
|
|
295
293
|
}
|
|
296
294
|
// Polling waits between probes rather than starting an unbounded batch.
|
|
297
|
-
// oxlint-disable-next-line no-await-in-loop
|
|
298
295
|
await sleep(100);
|
|
299
296
|
}
|
|
300
297
|
throw new Error("Broker failed to start within timeout");
|
|
@@ -16,8 +16,7 @@ export function registerIntercomTools(
|
|
|
16
16
|
"Message connected Pi sessions in your group; mains also reach other mains across projects. List shows target IDs. Ask waits for a correlated reply; reply answers the active or sole pending ask. Pending lists asks; status shows connection and inbound queue. Last pages a peer's last completed response without waking it. Broker acceptance is not recipient persistence, consumption or completion.",
|
|
17
17
|
parameters: intercomSchema,
|
|
18
18
|
renderResult: renderCompactResult,
|
|
19
|
-
|
|
20
|
-
async execute(_id, params, signal, _update, ctx) {
|
|
19
|
+
async execute(...[, params, signal, , ctx]) {
|
|
21
20
|
const result = throwIfToolError(await tools.execute(params, signal, ctx));
|
|
22
21
|
return { content: [...result.content], details: result.details };
|
|
23
22
|
},
|
|
@@ -38,10 +38,8 @@ export function asError(error: unknown): Error {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
// Protocol text permits line feeds and tabs, but rejects other C0/C1 controls.
|
|
41
|
-
// oxlint-disable-next-line no-control-regex
|
|
42
41
|
const UNSAFE_TEXT_CONTROLS = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f]/;
|
|
43
42
|
// Protocol labels are single-line fields and reject every C0/C1 control.
|
|
44
|
-
// oxlint-disable-next-line no-control-regex
|
|
45
43
|
const UNSAFE_LABEL_CONTROLS = /[\u0000-\u001f\u007f-\u009f]/;
|
|
46
44
|
|
|
47
45
|
export function safeText(value: unknown): boolean {
|
|
@@ -16,7 +16,6 @@ export async function runCooperatively<T>(steps: Generator<void, T>): Promise<T>
|
|
|
16
16
|
// single-record stall off-thread rather than increasing this batch size.
|
|
17
17
|
if (++count === 32) {
|
|
18
18
|
// Yield between ordered atomic recovery records; concurrency would reorder delivery.
|
|
19
|
-
// oxlint-disable-next-line no-await-in-loop
|
|
20
19
|
await yieldToInput();
|
|
21
20
|
count = 0;
|
|
22
21
|
}
|