@averyyy/pi-coding-agent 0.80.6-piclient.4 → 0.80.6-piclient.5

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.
@@ -0,0 +1,14 @@
1
+ export declare const PI_CLIENT_RUNTIME_RELOAD_EXIT_CODE = 75;
2
+ export interface PiClientUpdateMarker {
3
+ version: string;
4
+ updatedAt: string;
5
+ }
6
+ export interface PiClientRuntimeReloadState {
7
+ sessionId: string;
8
+ sessionDir?: string;
9
+ updateMarkerPath: string;
10
+ }
11
+ export declare function getPiClientUpdateMarkerPath(agentDir?: string): string;
12
+ export declare function readPiClientUpdateMarker(agentDir?: string): PiClientUpdateMarker | undefined;
13
+ export declare function writePiClientRuntimeReloadState(path: string, state: PiClientRuntimeReloadState): void;
14
+ //# sourceMappingURL=pi-client-runtime-update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pi-client-runtime-update.d.ts","sourceRoot":"","sources":["../../src/core/pi-client-runtime-update.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kCAAkC,KAAK,CAAC;AAGrD,MAAM,WAAW,oBAAoB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,0BAA0B;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;CACzB;AAMD,wBAAgB,2BAA2B,CAAC,QAAQ,SAAgB,GAAG,MAAM,CAE5E;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,SAAgB,GAAG,oBAAoB,GAAG,SAAS,CAUnG;AAED,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,0BAA0B,GAAG,IAAI,CAErG","sourcesContent":["import { readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { getAgentDir } from \"../config.ts\";\n\nexport const PI_CLIENT_RUNTIME_RELOAD_EXIT_CODE = 75;\nconst UPDATE_MARKER_FILE = \"pi-client-update.json\";\n\nexport interface PiClientUpdateMarker {\n\tversion: string;\n\tupdatedAt: string;\n}\n\nexport interface PiClientRuntimeReloadState {\n\tsessionId: string;\n\tsessionDir?: string;\n\tupdateMarkerPath: string;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null;\n}\n\nexport function getPiClientUpdateMarkerPath(agentDir = getAgentDir()): string {\n\treturn join(agentDir, UPDATE_MARKER_FILE);\n}\n\nexport function readPiClientUpdateMarker(agentDir = getAgentDir()): PiClientUpdateMarker | undefined {\n\ttry {\n\t\tconst value: unknown = JSON.parse(readFileSync(getPiClientUpdateMarkerPath(agentDir), \"utf-8\"));\n\t\tif (!isRecord(value) || typeof value.version !== \"string\" || typeof value.updatedAt !== \"string\") {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn { version: value.version, updatedAt: value.updatedAt };\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport function writePiClientRuntimeReloadState(path: string, state: PiClientRuntimeReloadState): void {\n\twriteFileSync(path, `${JSON.stringify(state)}\\n`);\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import { readFileSync, writeFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { getAgentDir } from "../config.js";
4
+ export const PI_CLIENT_RUNTIME_RELOAD_EXIT_CODE = 75;
5
+ const UPDATE_MARKER_FILE = "pi-client-update.json";
6
+ function isRecord(value) {
7
+ return typeof value === "object" && value !== null;
8
+ }
9
+ export function getPiClientUpdateMarkerPath(agentDir = getAgentDir()) {
10
+ return join(agentDir, UPDATE_MARKER_FILE);
11
+ }
12
+ export function readPiClientUpdateMarker(agentDir = getAgentDir()) {
13
+ try {
14
+ const value = JSON.parse(readFileSync(getPiClientUpdateMarkerPath(agentDir), "utf-8"));
15
+ if (!isRecord(value) || typeof value.version !== "string" || typeof value.updatedAt !== "string") {
16
+ return undefined;
17
+ }
18
+ return { version: value.version, updatedAt: value.updatedAt };
19
+ }
20
+ catch {
21
+ return undefined;
22
+ }
23
+ }
24
+ export function writePiClientRuntimeReloadState(path, state) {
25
+ writeFileSync(path, `${JSON.stringify(state)}\n`);
26
+ }
27
+ //# sourceMappingURL=pi-client-runtime-update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pi-client-runtime-update.js","sourceRoot":"","sources":["../../src/core/pi-client-runtime-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,CAAC;AACrD,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AAanD,SAAS,QAAQ,CAAC,KAAc,EAAoC;IACnE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AAAA,CACnD;AAED,MAAM,UAAU,2BAA2B,CAAC,QAAQ,GAAG,WAAW,EAAE,EAAU;IAC7E,OAAO,IAAI,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;AAAA,CAC1C;AAED,MAAM,UAAU,wBAAwB,CAAC,QAAQ,GAAG,WAAW,EAAE,EAAoC;IACpG,IAAI,CAAC;QACJ,MAAM,KAAK,GAAY,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,2BAA2B,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QAChG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;YAClG,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IAC/D,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAC;IAClB,CAAC;AAAA,CACD;AAED,MAAM,UAAU,+BAA+B,CAAC,IAAY,EAAE,KAAiC,EAAQ;IACtG,aAAa,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAAA,CAClD","sourcesContent":["import { readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { getAgentDir } from \"../config.ts\";\n\nexport const PI_CLIENT_RUNTIME_RELOAD_EXIT_CODE = 75;\nconst UPDATE_MARKER_FILE = \"pi-client-update.json\";\n\nexport interface PiClientUpdateMarker {\n\tversion: string;\n\tupdatedAt: string;\n}\n\nexport interface PiClientRuntimeReloadState {\n\tsessionId: string;\n\tsessionDir?: string;\n\tupdateMarkerPath: string;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null;\n}\n\nexport function getPiClientUpdateMarkerPath(agentDir = getAgentDir()): string {\n\treturn join(agentDir, UPDATE_MARKER_FILE);\n}\n\nexport function readPiClientUpdateMarker(agentDir = getAgentDir()): PiClientUpdateMarker | undefined {\n\ttry {\n\t\tconst value: unknown = JSON.parse(readFileSync(getPiClientUpdateMarkerPath(agentDir), \"utf-8\"));\n\t\tif (!isRecord(value) || typeof value.version !== \"string\" || typeof value.updatedAt !== \"string\") {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn { version: value.version, updatedAt: value.updatedAt };\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport function writePiClientRuntimeReloadState(path: string, state: PiClientRuntimeReloadState): void {\n\twriteFileSync(path, `${JSON.stringify(state)}\\n`);\n}\n"]}