@cotal-ai/pi 0.50.0 → 0.51.0
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/dist/agui-map.d.ts +22 -0
- package/dist/agui-map.d.ts.map +1 -0
- package/dist/agui-source.d.ts +11 -0
- package/dist/agui-source.d.ts.map +1 -0
- package/dist/connector.d.ts.map +1 -1
- package/dist/events.d.ts +27 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/extension.d.ts.map +1 -1
- package/dist/index.js +2388 -121
- package/dist/standalone.js +2710 -374
- package/package.json +4 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type RecordMapper } from "@cotal-ai/connector-core";
|
|
2
|
+
export interface PiSessionEntry {
|
|
3
|
+
type: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
timestamp?: string;
|
|
6
|
+
message?: {
|
|
7
|
+
role?: string;
|
|
8
|
+
content?: Array<{
|
|
9
|
+
type?: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
id?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
}>;
|
|
14
|
+
stopReason?: string;
|
|
15
|
+
timestamp?: number;
|
|
16
|
+
errorMessage?: string;
|
|
17
|
+
toolCallId?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** Pi persists completed messages, not live deltas. User messages have no separable peer authorship. */
|
|
21
|
+
export declare function createPiMapper(threadId: string, resumedRun?: string, resumedTools?: readonly string[]): RecordMapper<PiSessionEntry>;
|
|
22
|
+
//# sourceMappingURL=agui-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agui-map.d.ts","sourceRoot":"","sources":["../src/agui-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAEuB,KAAK,YAAY,EAC9C,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,EAAE,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAC9E,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,wGAAwG;AACxG,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,YAAY,GAAE,SAAS,MAAM,EAAO,GAAG,YAAY,CAAC,cAAc,CAAC,CAkDxI"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type DurableSource, type SourceRead } from "@cotal-ai/connector-core";
|
|
2
|
+
import type { PiSessionEntry } from "./agui-map.js";
|
|
3
|
+
/** Pi creates the physical JSONL only when it saves the first assistant message. */
|
|
4
|
+
export declare class PiSessionSource implements DurableSource<PiSessionEntry> {
|
|
5
|
+
readonly path: string;
|
|
6
|
+
readonly kind = "pi-native-session-jsonl";
|
|
7
|
+
private readonly file;
|
|
8
|
+
constructor(path: string);
|
|
9
|
+
read(cursor: string | undefined): Promise<SourceRead<PiSessionEntry>>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=agui-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agui-source.d.ts","sourceRoot":"","sources":["../src/agui-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAChG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,oFAAoF;AACpF,qBAAa,eAAgB,YAAW,aAAa,CAAC,cAAc,CAAC;IAGvD,QAAQ,CAAC,IAAI,EAAE,MAAM;IAFjC,QAAQ,CAAC,IAAI,6BAA6B;IAC1C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAkC;gBAClC,IAAI,EAAE,MAAM;IAG3B,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;CAK5E"}
|
package/dist/connector.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAKA,OAAO,EAML,KAAK,SAAS,EAGf,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAKA,OAAO,EAML,KAAK,SAAS,EAGf,MAAM,gBAAgB,CAAC;AAcxB,eAAO,MAAM,gBAAgB,6mBAQnB,CAAC;AAEX,eAAO,MAAM,WAAW,EAAE,SA6FzB,CAAC"}
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type MeshAgent } from "@cotal-ai/connector-core";
|
|
2
|
+
/** One holder per native session. The file is the source, while hooks only wake its reader. */
|
|
3
|
+
export declare class PiEvents {
|
|
4
|
+
private readonly mesh;
|
|
5
|
+
private readonly space;
|
|
6
|
+
private holder?;
|
|
7
|
+
private lock?;
|
|
8
|
+
private sessionId?;
|
|
9
|
+
private path?;
|
|
10
|
+
private pending;
|
|
11
|
+
private closing;
|
|
12
|
+
private dead;
|
|
13
|
+
constructor(mesh: MeshAgent, space: string);
|
|
14
|
+
start(sessionId: string, path: string | undefined, freshSession?: boolean): Promise<void>;
|
|
15
|
+
flush(sessionId: string, path: string | undefined): void;
|
|
16
|
+
shutdown(): Promise<void>;
|
|
17
|
+
private release;
|
|
18
|
+
/** A file-free native session needs its durable start cursor before Pi may save its first answer.
|
|
19
|
+
* This is local filesystem work only: no broker dial or AG-UI preflight blocks the host hook. */
|
|
20
|
+
private prepareFirstFile;
|
|
21
|
+
/** A resumed/forked native file can already contain history. Capture its end before allowing
|
|
22
|
+
* the next turn to append. An acknowledged WAL cursor takes precedence on a process restart. */
|
|
23
|
+
private prepareExistingFile;
|
|
24
|
+
private newHolder;
|
|
25
|
+
private fail;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAEA,OAAO,EAEsC,KAAK,SAAS,EAC1D,MAAM,0BAA0B,CAAC;AAIlC,+FAA+F;AAC/F,qBAAa,QAAQ;IASP,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAa,OAAO,CAAC,QAAQ,CAAC,KAAK;IARpE,OAAO,CAAC,MAAM,CAAC,CAAoC;IACnD,OAAO,CAAC,IAAI,CAAC,CAAgB;IAC7B,OAAO,CAAC,SAAS,CAAC,CAAS;IAC3B,OAAO,CAAC,IAAI,CAAC,CAAS;IACtB,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,IAAI,CAAS;gBAEQ,IAAI,EAAE,SAAS,EAAmB,KAAK,EAAE,MAAM;IAEtE,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,YAAY,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAuB7F,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAgBlD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;YAQjB,OAAO;IAWrB;qGACiG;YACnF,gBAAgB;IAW9B;oGACgG;YAClF,mBAAmB;IAUjC,OAAO,CAAC,SAAS;IA+BjB,OAAO,CAAC,IAAI;CAKb"}
|
package/dist/extension.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,iCAAiC,CAAC;AA4DtF,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,SAAS,GAAG,MAAkB,GAAG,IAAI,CAKhG;AA+CD,mGAAmG;AACnG,wBAA8B,SAAS,CAAC,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA4FvE"}
|