@botiverse/oar 0.46.0 → 0.47.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.
Files changed (89) hide show
  1. package/README.md +34 -5
  2. package/assets/brands/NOTICE.md +2 -0
  3. package/assets/brands/pi-durable-on-dark.svg +6 -0
  4. package/assets/brands/pi-durable-on-light.svg +6 -0
  5. package/assets/brands/pi-durable.svg +6 -0
  6. package/dist/brands.d.ts +8 -0
  7. package/dist/brands.d.ts.map +1 -1
  8. package/dist/brands.js +2 -1
  9. package/dist/brands.js.map +1 -1
  10. package/dist/browser.d.ts +12 -0
  11. package/dist/browser.d.ts.map +1 -0
  12. package/dist/browser.js +10 -0
  13. package/dist/browser.js.map +1 -0
  14. package/dist/contracts/index.d.ts +14 -0
  15. package/dist/contracts/index.d.ts.map +1 -0
  16. package/dist/contracts/index.js +4 -0
  17. package/dist/contracts/index.js.map +1 -0
  18. package/dist/contracts/records.d.ts +5 -1
  19. package/dist/contracts/records.d.ts.map +1 -1
  20. package/dist/index.d.ts +1 -13
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +1 -3
  23. package/dist/index.js.map +1 -1
  24. package/dist/observe/agent-status.d.ts.map +1 -1
  25. package/dist/observe/agent-status.js +2 -0
  26. package/dist/observe/agent-status.js.map +1 -1
  27. package/dist/observe/session-view-events.d.ts.map +1 -1
  28. package/dist/observe/session-view-events.js +5 -0
  29. package/dist/observe/session-view-events.js.map +1 -1
  30. package/dist/pi-durable.d.ts +3 -0
  31. package/dist/pi-durable.d.ts.map +1 -0
  32. package/dist/pi-durable.js +3 -0
  33. package/dist/pi-durable.js.map +1 -0
  34. package/dist/runtimes/antigravity/index.d.ts +5 -5
  35. package/dist/runtimes/antigravity/installation.d.ts +1 -1
  36. package/dist/runtimes/antigravity/installation.d.ts.map +1 -1
  37. package/dist/runtimes/claude/index.d.ts +9 -9
  38. package/dist/runtimes/claude/installation.d.ts +1 -1
  39. package/dist/runtimes/claude/installation.d.ts.map +1 -1
  40. package/dist/runtimes/codex/index.d.ts +8 -8
  41. package/dist/runtimes/codex/installation.d.ts +1 -1
  42. package/dist/runtimes/codex/installation.d.ts.map +1 -1
  43. package/dist/runtimes/grok/index.d.ts +7 -7
  44. package/dist/runtimes/grok/installation.d.ts +1 -1
  45. package/dist/runtimes/grok/installation.d.ts.map +1 -1
  46. package/dist/runtimes/kimi/index.d.ts +7 -7
  47. package/dist/runtimes/kimi/installation.d.ts +1 -1
  48. package/dist/runtimes/kimi/installation.d.ts.map +1 -1
  49. package/dist/runtimes/kimi/session.d.ts +1 -1
  50. package/dist/runtimes/kimi/session.d.ts.map +1 -1
  51. package/dist/runtimes/opencode/index.d.ts +4 -4
  52. package/dist/runtimes/opencode/installation.d.ts +1 -1
  53. package/dist/runtimes/opencode/installation.d.ts.map +1 -1
  54. package/dist/runtimes/pi/index.d.ts +6 -6
  55. package/dist/runtimes/pi/list-models.d.ts +3 -35
  56. package/dist/runtimes/pi/list-models.d.ts.map +1 -1
  57. package/dist/runtimes/pi/list-models.js +2 -22
  58. package/dist/runtimes/pi/list-models.js.map +1 -1
  59. package/dist/runtimes/pi/model-projection.d.ts +36 -0
  60. package/dist/runtimes/pi/model-projection.d.ts.map +1 -0
  61. package/dist/runtimes/pi/model-projection.js +23 -0
  62. package/dist/runtimes/pi/model-projection.js.map +1 -0
  63. package/dist/runtimes/pi-durable/index.d.ts +12 -0
  64. package/dist/runtimes/pi-durable/index.d.ts.map +1 -0
  65. package/dist/runtimes/pi-durable/index.js +25 -0
  66. package/dist/runtimes/pi-durable/index.js.map +1 -0
  67. package/dist/runtimes/pi-durable/messages.d.ts +20 -0
  68. package/dist/runtimes/pi-durable/messages.d.ts.map +1 -0
  69. package/dist/runtimes/pi-durable/messages.js +57 -0
  70. package/dist/runtimes/pi-durable/messages.js.map +1 -0
  71. package/dist/runtimes/pi-durable/options.d.ts +7 -0
  72. package/dist/runtimes/pi-durable/options.d.ts.map +1 -0
  73. package/dist/runtimes/pi-durable/options.js +90 -0
  74. package/dist/runtimes/pi-durable/options.js.map +1 -0
  75. package/dist/runtimes/pi-durable/projection.d.ts +19 -0
  76. package/dist/runtimes/pi-durable/projection.d.ts.map +1 -0
  77. package/dist/runtimes/pi-durable/projection.js +140 -0
  78. package/dist/runtimes/pi-durable/projection.js.map +1 -0
  79. package/dist/runtimes/pi-durable/session.d.ts +5 -0
  80. package/dist/runtimes/pi-durable/session.d.ts.map +1 -0
  81. package/dist/runtimes/pi-durable/session.js +137 -0
  82. package/dist/runtimes/pi-durable/session.js.map +1 -0
  83. package/dist/shared/seal-session.d.ts.map +1 -1
  84. package/dist/shared/seal-session.js +1 -2
  85. package/dist/shared/seal-session.js.map +1 -1
  86. package/dist/shared/session-kernel.d.ts.map +1 -1
  87. package/dist/shared/session-kernel.js +2 -3
  88. package/dist/shared/session-kernel.js.map +1 -1
  89. package/package.json +22 -4
@@ -7,19 +7,19 @@ export declare const claudeRuntime: {
7
7
  readonly name: "Claude Code";
8
8
  readonly icon: `data:image/svg+xml,${string}`;
9
9
  };
10
- readonly skills: import("../../index.js").InventoryReader<import("../../index.js").SkillEntry>;
11
- readonly mcpServers: import("../../index.js").InventoryReader<import("../../index.js").McpServerEntry>;
12
- readonly tools: import("../../index.js").InventoryReader<import("../../index.js").ToolEntry>;
13
- readonly installation: import("../../index.js").InstallationProbe;
14
- readonly accountUsage: import("../../index.js").AccountUsageReader;
15
- readonly listModels: import("../../index.js").ModelLister;
16
- readonly checkUpdate: import("../../index.js").UpdateChecker;
10
+ readonly skills: import("../../browser.js").InventoryReader<import("../../browser.js").SkillEntry>;
11
+ readonly mcpServers: import("../../browser.js").InventoryReader<import("../../browser.js").McpServerEntry>;
12
+ readonly tools: import("../../browser.js").InventoryReader<import("../../browser.js").ToolEntry>;
13
+ readonly installation: import("../../browser.js").InstallationProbe;
14
+ readonly accountUsage: import("../../browser.js").AccountUsageReader;
15
+ readonly listModels: import("../../browser.js").ModelLister;
16
+ readonly checkUpdate: import("../../browser.js").UpdateChecker;
17
17
  readonly upgrade: typeof claudeUpgrade;
18
18
  readonly login: typeof claudeLogin;
19
19
  readonly logout: typeof claudeLogout;
20
20
  readonly authStatus: typeof claudeAuthStatus;
21
- readonly session: import("../../index.js").StartSession;
22
- } & import("../../index.js").RuntimeInventories & {
21
+ readonly session: import("../../browser.js").StartSession;
22
+ } & import("../../browser.js").RuntimeInventories & {
23
23
  readonly brand: import("../../brands.js").RuntimeBrand;
24
24
  };
25
25
  export { claudeAccountUsage } from "./account-usage.js";
@@ -1,2 +1,2 @@
1
- export declare const claudeInstallation: import("../../index.js").InstallationProbe;
1
+ export declare const claudeInstallation: import("../../browser.js").InstallationProbe;
2
2
  //# sourceMappingURL=installation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/runtimes/claude/installation.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,4CAAqD,CAAC"}
1
+ {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/runtimes/claude/installation.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,8CAAqD,CAAC"}
@@ -11,19 +11,19 @@ export declare const codexRuntime: {
11
11
  readonly dark: `data:image/svg+xml,${string}`;
12
12
  };
13
13
  };
14
- readonly skills: import("../../index.js").InventoryReader<import("../../index.js").SkillEntry>;
15
- readonly mcpServers: import("../../index.js").InventoryReader<import("../../index.js").McpServerEntry>;
16
- readonly tools: import("../../index.js").InventoryReader<import("../../index.js").ToolEntry>;
17
- readonly installation: import("../../index.js").InstallationProbe;
18
- readonly accountUsage: import("../../index.js").AccountUsageReader;
19
- readonly listModels: import("../../index.js").ModelLister;
14
+ readonly skills: import("../../browser.js").InventoryReader<import("../../browser.js").SkillEntry>;
15
+ readonly mcpServers: import("../../browser.js").InventoryReader<import("../../browser.js").McpServerEntry>;
16
+ readonly tools: import("../../browser.js").InventoryReader<import("../../browser.js").ToolEntry>;
17
+ readonly installation: import("../../browser.js").InstallationProbe;
18
+ readonly accountUsage: import("../../browser.js").AccountUsageReader;
19
+ readonly listModels: import("../../browser.js").ModelLister;
20
20
  readonly checkUpdate: typeof codexCheckUpdate;
21
21
  readonly upgrade: typeof codexUpgrade;
22
22
  readonly login: typeof codexLogin;
23
23
  readonly logout: typeof codexLogout;
24
24
  readonly authStatus: typeof codexAuthStatus;
25
- readonly session: import("../../index.js").StartSession;
26
- } & import("../../index.js").RuntimeInventories & {
25
+ readonly session: import("../../browser.js").StartSession;
26
+ } & import("../../browser.js").RuntimeInventories & {
27
27
  readonly brand: import("../../brands.js").RuntimeBrand;
28
28
  };
29
29
  export { codexAccountUsage, projectCodexUsage } from "./account-usage.js";
@@ -1,2 +1,2 @@
1
- export declare const codexInstallation: import("../../index.js").InstallationProbe;
1
+ export declare const codexInstallation: import("../../browser.js").InstallationProbe;
2
2
  //# sourceMappingURL=installation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/runtimes/codex/installation.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,iBAAiB,4CAK7B,CAAC"}
1
+ {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/runtimes/codex/installation.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,iBAAiB,8CAK7B,CAAC"}
@@ -10,15 +10,15 @@ export declare const grokRuntime: {
10
10
  };
11
11
  };
12
12
  readonly refusedSessionOptions: Readonly<Partial<Record<import("../../contracts/runtime.js").RefusableSessionOption, string>>>;
13
- readonly skills: import("../../index.js").InventoryReader<import("../../index.js").SkillEntry>;
14
- readonly mcpServers: import("../../index.js").InventoryReader<import("../../index.js").McpServerEntry>;
15
- readonly installation: import("../../index.js").InstallationProbe;
16
- readonly accountUsage: import("../../index.js").AccountUsageReader;
17
- readonly listModels: import("../../index.js").ModelLister;
13
+ readonly skills: import("../../browser.js").InventoryReader<import("../../browser.js").SkillEntry>;
14
+ readonly mcpServers: import("../../browser.js").InventoryReader<import("../../browser.js").McpServerEntry>;
15
+ readonly installation: import("../../browser.js").InstallationProbe;
16
+ readonly accountUsage: import("../../browser.js").AccountUsageReader;
17
+ readonly listModels: import("../../browser.js").ModelLister;
18
18
  readonly checkUpdate: typeof grokCheckUpdate;
19
19
  readonly upgrade: typeof grokUpgrade;
20
- readonly session: import("../../index.js").StartSession;
21
- } & import("../../index.js").RuntimeInventories & {
20
+ readonly session: import("../../browser.js").StartSession;
21
+ } & import("../../browser.js").RuntimeInventories & {
22
22
  readonly brand: import("../../brands.js").RuntimeBrand;
23
23
  };
24
24
  export { grokAccountEmail, grokAccountUsage, projectGrokUsage } from "./account-usage.js";
@@ -1,4 +1,4 @@
1
1
  /** Official script/npm layouts that can be invisible to GUI-process PATH. */
2
2
  export declare function grokInstalledExecutableCandidates(platform?: NodeJS.Platform, home?: string, env?: Readonly<NodeJS.ProcessEnv>): readonly string[];
3
- export declare const grokInstallation: import("../../index.js").InstallationProbe;
3
+ export declare const grokInstallation: import("../../browser.js").InstallationProbe;
4
4
  //# sourceMappingURL=installation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/runtimes/grok/installation.ts"],"names":[],"mappings":"AAIA,6EAA6E;AAC7E,wBAAgB,iCAAiC,CAC/C,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,IAAI,GAAE,MAAkB,EACxB,GAAG,GAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAe,GAC7C,SAAS,MAAM,EAAE,CAYnB;AAED,eAAO,MAAM,gBAAgB,4CAK5B,CAAC"}
1
+ {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/runtimes/grok/installation.ts"],"names":[],"mappings":"AAIA,6EAA6E;AAC7E,wBAAgB,iCAAiC,CAC/C,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,IAAI,GAAE,MAAkB,EACxB,GAAG,GAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAe,GAC7C,SAAS,MAAM,EAAE,CAYnB;AAED,eAAO,MAAM,gBAAgB,8CAK5B,CAAC"}
@@ -8,14 +8,14 @@ export declare const kimiRuntime: {
8
8
  readonly dark: `data:image/svg+xml,${string}`;
9
9
  };
10
10
  };
11
- readonly installation: import("../../index.js").InstallationProbe;
12
- readonly accountUsage: import("../../index.js").AccountUsageReader;
13
- readonly listModels: import("../../index.js").ModelLister;
14
- readonly checkUpdate: import("../../index.js").UpdateChecker;
15
- readonly upgrade: import("../../index.js").Upgrader;
16
- readonly session: import("../../index.js").StartSession;
11
+ readonly installation: import("../../browser.js").InstallationProbe;
12
+ readonly accountUsage: import("../../browser.js").AccountUsageReader;
13
+ readonly listModels: import("../../browser.js").ModelLister;
14
+ readonly checkUpdate: import("../../browser.js").UpdateChecker;
15
+ readonly upgrade: import("../../browser.js").Upgrader;
16
+ readonly session: import("../../browser.js").StartSession;
17
17
  readonly refusedSessionOptions: Readonly<Partial<Record<import("../../contracts/runtime.js").RefusableSessionOption, string>>>;
18
- } & import("../../index.js").RuntimeInventories & {
18
+ } & import("../../browser.js").RuntimeInventories & {
19
19
  readonly brand: import("../../brands.js").RuntimeBrand;
20
20
  };
21
21
  export { kimiAccountUsage, projectKimiUsage } from "./account-usage.js";
@@ -1,4 +1,4 @@
1
1
  /** Official native-installer layouts that can be invisible to GUI-process PATH. */
2
2
  export declare function kimiInstalledExecutableCandidates(platform?: NodeJS.Platform, home?: string, env?: Readonly<NodeJS.ProcessEnv>): readonly string[];
3
- export declare const kimiInstallation: import("../../index.js").InstallationProbe;
3
+ export declare const kimiInstallation: import("../../browser.js").InstallationProbe;
4
4
  //# sourceMappingURL=installation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/runtimes/kimi/installation.ts"],"names":[],"mappings":"AAIA,mFAAmF;AACnF,wBAAgB,iCAAiC,CAC/C,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,IAAI,GAAE,MAAkB,EACxB,GAAG,GAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAe,GAC7C,SAAS,MAAM,EAAE,CAWnB;AAED,eAAO,MAAM,gBAAgB,4CAM5B,CAAC"}
1
+ {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/runtimes/kimi/installation.ts"],"names":[],"mappings":"AAIA,mFAAmF;AACnF,wBAAgB,iCAAiC,CAC/C,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,IAAI,GAAE,MAAkB,EACxB,GAAG,GAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAe,GAC7C,SAAS,MAAM,EAAE,CAWnB;AAED,eAAO,MAAM,gBAAgB,8CAM5B,CAAC"}
@@ -5,5 +5,5 @@ export declare function selectKimiAuthMethod(initialized: JsonRecord): string |
5
5
  export declare function supportsKimiYolo(response: JsonRecord): boolean;
6
6
  export declare const kimiRefusedSessionOptions: RefusedSessionOptions;
7
7
  export declare const kimiAcpProfile: AcpSessionProfile;
8
- export declare const kimiSession: import("../../index.js").StartSession;
8
+ export declare const kimiSession: import("../../browser.js").StartSession;
9
9
  //# sourceMappingURL=session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/runtimes/kimi/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGjE,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAOhF;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAU9D;AAED,eAAO,MAAM,yBAAyB,EAAE,qBAKvC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,iBA4B5B,CAAC;AAEF,eAAO,MAAM,WAAW,uCAA6B,CAAC"}
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/runtimes/kimi/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGjE,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAOhF;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAU9D;AAED,eAAO,MAAM,yBAAyB,EAAE,qBAKvC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,iBA4B5B,CAAC;AAEF,eAAO,MAAM,WAAW,yCAA6B,CAAC"}
@@ -9,10 +9,10 @@ export declare const opencodeRuntime: {
9
9
  };
10
10
  };
11
11
  readonly refusedSessionOptions: Readonly<Partial<Record<import("../../contracts/runtime.js").RefusableSessionOption, string>>>;
12
- readonly installation: import("../../index.js").InstallationProbe;
13
- readonly session: import("../../index.js").StartSession;
14
- readonly listModels: import("../../index.js").ModelLister;
15
- } & import("../../index.js").RuntimeInventories & {
12
+ readonly installation: import("../../browser.js").InstallationProbe;
13
+ readonly session: import("../../browser.js").StartSession;
14
+ readonly listModels: import("../../browser.js").ModelLister;
15
+ } & import("../../browser.js").RuntimeInventories & {
16
16
  readonly brand: import("../../brands.js").RuntimeBrand;
17
17
  };
18
18
  export { opencodeSession } from "./session.js";
@@ -4,5 +4,5 @@
4
4
  */
5
5
  export declare function opencodeInstalledExecutableCandidates(platform?: NodeJS.Platform, home?: string): readonly string[];
6
6
  /** `opencode --version` (1.18.30) prints the bare release and takes about 2 s to start. */
7
- export declare const opencodeInstallation: import("../../index.js").InstallationProbe;
7
+ export declare const opencodeInstallation: import("../../browser.js").InstallationProbe;
8
8
  //# sourceMappingURL=installation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/runtimes/opencode/installation.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,qCAAqC,CACnD,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,IAAI,GAAE,MAAkB,GACvB,SAAS,MAAM,EAAE,CAGnB;AAED,2FAA2F;AAC3F,eAAO,MAAM,oBAAoB,4CAMhC,CAAC"}
1
+ {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/runtimes/opencode/installation.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,qCAAqC,CACnD,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,IAAI,GAAE,MAAkB,GACvB,SAAS,MAAM,EAAE,CAGnB;AAED,2FAA2F;AAC3F,eAAO,MAAM,oBAAoB,8CAMhC,CAAC"}
@@ -14,12 +14,12 @@ export declare const piRuntime: {
14
14
  };
15
15
  };
16
16
  readonly refusedSessionOptions: Readonly<Partial<Record<import("../../contracts/runtime.js").RefusableSessionOption, string>>>;
17
- readonly skills: import("../../index.js").InventoryReader<import("../../index.js").SkillEntry>;
18
- readonly tools: import("../../index.js").InventoryReader<import("../../index.js").ToolEntry>;
19
- readonly installation: import("../../index.js").InstallationProbe;
20
- readonly listModels: import("../../index.js").ModelLister;
21
- readonly session: import("../../index.js").StartSession;
22
- } & import("../../index.js").RuntimeInventories & {
17
+ readonly skills: import("../../browser.js").InventoryReader<import("../../browser.js").SkillEntry>;
18
+ readonly tools: import("../../browser.js").InventoryReader<import("../../browser.js").ToolEntry>;
19
+ readonly installation: import("../../browser.js").InstallationProbe;
20
+ readonly listModels: import("../../browser.js").ModelLister;
21
+ readonly session: import("../../browser.js").StartSession;
22
+ } & import("../../browser.js").RuntimeInventories & {
23
23
  readonly brand: import("../../brands.js").RuntimeBrand;
24
24
  };
25
25
  export { piListModels, projectPiModels } from "./list-models.js";
@@ -1,38 +1,6 @@
1
- import type { ModelEntry, ModelLister } from "../../contracts/list-models.js";
2
- /** The subset of Pi's `Model` the projection reads; kept structural for tests. */
3
- export interface PiListedModel {
4
- readonly id: string;
5
- readonly provider: string;
6
- readonly name?: string;
7
- /** Pi's reasoning flag: a model without it runs only the `off` thinking level. */
8
- readonly reasoning?: boolean;
9
- }
10
- /**
11
- * The slice of Pi's `ModelRuntime` the lister depends on. `getAvailable()`
12
- * runs the per-provider availability check (credentials present, OAuth token
13
- * usable) and returns the usable-now list; it is what `pi --list-models`
14
- * itself awaits.
15
- */
16
- export interface PiAvailabilitySource<Model extends PiListedModel = PiListedModel> {
17
- getAvailable(providerId?: string, options?: {
18
- readonly signal?: AbortSignal;
19
- }): Promise<readonly Model[]>;
20
- }
21
- /** Pi's own thinking-level menu for one model (pi-ai `getSupportedThinkingLevels`), injected so the projection stays pure. */
22
- export type PiThinkingLevelsOf<Model extends PiListedModel> = (model: Model) => readonly string[];
23
- /**
24
- * Pi model ids are only unique per provider, so the session-facing id is
25
- * `provider/model`, the same spelling Pi's own `--model` flag accepts.
26
- *
27
- * `effortLevels` is pi's thinking-level menu for a reasoning model, exactly
28
- * as pi derives it (`thinkingLevelMap` drops levels mapped to null and adds
29
- * `xhigh`/`max` only where mapped; `off` is one of pi's levels and stays
30
- * where pi offers it), the levels `SessionOptions.effort` accepts on pi. A
31
- * model without `reasoning` runs only `off` and lists no menu. No
32
- * `defaultEffort`: pi's default is a settings value clamped per model at
33
- * session creation, and the session's `effort()` reports it.
34
- */
35
- export declare function projectPiModels<Model extends PiListedModel>(models: readonly Model[], thinkingLevelsOf?: PiThinkingLevelsOf<Model>): ModelEntry[];
1
+ import type { ModelLister } from "../../contracts/list-models.js";
2
+ import { type PiListedModel, type PiAvailabilitySource, type PiThinkingLevelsOf } from "./model-projection.js";
3
+ export { projectPiModels } from "./model-projection.js";
36
4
  /**
37
5
  * In-process through the bundled SDK, built the way `pi --list-models` builds
38
6
  * its own runtime: `createAgentSessionServices` loads the extensions under the
@@ -1 +1 @@
1
- {"version":3,"file":"list-models.d.ts","sourceRoot":"","sources":["../../../src/runtimes/pi/list-models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG9E,kFAAkF;AAClF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,kFAAkF;IAClF,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB,CAAC,KAAK,SAAS,aAAa,GAAG,aAAa;IAC/E,YAAY,CACV,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAC1C,OAAO,CAAC,SAAS,KAAK,EAAE,CAAC,CAAC;CAC9B;AAED,8HAA8H;AAC9H,MAAM,MAAM,kBAAkB,CAAC,KAAK,SAAS,aAAa,IAAI,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,MAAM,EAAE,CAAC;AAElG;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,SAAS,aAAa,EACzD,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,gBAAgB,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,GAC3C,UAAU,EAAE,CASd;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,SAAS,aAAa,EAC5D,aAAa,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,EAC5E,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,GAC1D,WAAW,CAeb;AAED,eAAO,MAAM,YAAY,EAAE,WA0BzB,CAAC"}
1
+ {"version":3,"file":"list-models.d.ts","sourceRoot":"","sources":["../../../src/runtimes/pi/list-models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAGlE,OAAO,EAAmB,KAAK,aAAa,EAAE,KAAK,oBAAoB,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhI,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,SAAS,aAAa,EAC5D,aAAa,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,EAC5E,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,GAC1D,WAAW,CAeb;AAED,eAAO,MAAM,YAAY,EAAE,WA0BzB,CAAC"}
@@ -1,26 +1,6 @@
1
1
  import { configurePiHttp } from "./http.js";
2
- /**
3
- * Pi model ids are only unique per provider, so the session-facing id is
4
- * `provider/model`, the same spelling Pi's own `--model` flag accepts.
5
- *
6
- * `effortLevels` is pi's thinking-level menu for a reasoning model, exactly
7
- * as pi derives it (`thinkingLevelMap` drops levels mapped to null and adds
8
- * `xhigh`/`max` only where mapped; `off` is one of pi's levels and stays
9
- * where pi offers it), the levels `SessionOptions.effort` accepts on pi. A
10
- * model without `reasoning` runs only `off` and lists no menu. No
11
- * `defaultEffort`: pi's default is a settings value clamped per model at
12
- * session creation, and the session's `effort()` reports it.
13
- */
14
- export function projectPiModels(models, thinkingLevelsOf) {
15
- return models.map((model) => {
16
- const effortLevels = model.reasoning === true && thinkingLevelsOf !== undefined ? thinkingLevelsOf(model) : [];
17
- return {
18
- id: `${model.provider}/${model.id}`,
19
- displayName: model.name === undefined || model.name.trim().length === 0 ? model.id : model.name.trim(),
20
- ...(effortLevels.length === 0 ? {} : { effortLevels: [...effortLevels] }),
21
- };
22
- });
23
- }
2
+ import { projectPiModels } from "./model-projection.js";
3
+ export { projectPiModels } from "./model-projection.js";
24
4
  /**
25
5
  * In-process through the bundled SDK, built the way `pi --list-models` builds
26
6
  * its own runtime: `createAgentSessionServices` loads the extensions under the
@@ -1 +1 @@
1
- {"version":3,"file":"list-models.js","sourceRoot":"","sources":["../../../src/runtimes/pi/list-models.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AA2B5C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAwB,EACxB,gBAA4C;IAE5C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1B,MAAM,YAAY,GAAG,KAAK,CAAC,SAAS,KAAK,IAAI,IAAI,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/G,OAAO;YACL,EAAE,EAAE,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,EAAE,EAAE;YACnC,WAAW,EAAE,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE;YACtG,GAAG,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,GAAG,YAAY,CAAC,EAAE,CAAC;SAC1E,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,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,qBAAqB,EAAE;YACrB,QAAQ,EAAE,IAAI;YACd,iBAAiB,EAAE,IAAI;YACvB,QAAQ,EAAE,IAAI;YACd,cAAc,EAAE,IAAI;SACrB;KACF,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,YAAY,CAAC;AAC/B,CAAC,EAAE,KAAK,IAAI,EAAE;IACZ,4EAA4E;IAC5E,2EAA2E;IAC3E,MAAM,EAAE,0BAA0B,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAC7E,OAAO,0BAA0B,CAAC;AACpC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { ModelEntry } from "../../contracts/list-models.js";
2
+ /** The subset of Pi's `Model` the projection reads; kept structural for tests. */
3
+ export interface PiListedModel {
4
+ readonly id: string;
5
+ readonly provider: string;
6
+ readonly name?: string;
7
+ /** Pi's reasoning flag: a model without it runs only the `off` thinking level. */
8
+ readonly reasoning?: boolean;
9
+ }
10
+ /**
11
+ * The slice of Pi's `ModelRuntime` the lister depends on. `getAvailable()`
12
+ * runs the per-provider availability check (credentials present, OAuth token
13
+ * usable) and returns the usable-now list; it is what `pi --list-models`
14
+ * itself awaits.
15
+ */
16
+ export interface PiAvailabilitySource<Model extends PiListedModel = PiListedModel> {
17
+ getAvailable(providerId?: string, options?: {
18
+ readonly signal?: AbortSignal;
19
+ }): Promise<readonly Model[]>;
20
+ }
21
+ /** Pi's own thinking-level menu for one model (pi-ai `getSupportedThinkingLevels`), injected so the projection stays pure. */
22
+ export type PiThinkingLevelsOf<Model extends PiListedModel> = (model: Model) => readonly string[];
23
+ /**
24
+ * Pi model ids are only unique per provider, so the session-facing id is
25
+ * `provider/model`, the same spelling Pi's own `--model` flag accepts.
26
+ *
27
+ * `effortLevels` is pi's thinking-level menu for a reasoning model, exactly
28
+ * as pi derives it (`thinkingLevelMap` drops levels mapped to null and adds
29
+ * `xhigh`/`max` only where mapped; `off` is one of pi's levels and stays
30
+ * where pi offers it), the levels `SessionOptions.effort` accepts on pi. A
31
+ * model without `reasoning` runs only `off` and lists no menu. No
32
+ * `defaultEffort`: pi's default is a settings value clamped per model at
33
+ * session creation, and the session's `effort()` reports it.
34
+ */
35
+ export declare function projectPiModels<Model extends PiListedModel>(models: readonly Model[], thinkingLevelsOf?: PiThinkingLevelsOf<Model>): ModelEntry[];
36
+ //# sourceMappingURL=model-projection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-projection.d.ts","sourceRoot":"","sources":["../../../src/runtimes/pi/model-projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE,kFAAkF;AAClF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,kFAAkF;IAClF,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB,CAAC,KAAK,SAAS,aAAa,GAAG,aAAa;IAC/E,YAAY,CACV,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAC1C,OAAO,CAAC,SAAS,KAAK,EAAE,CAAC,CAAC;CAC9B;AAED,8HAA8H;AAC9H,MAAM,MAAM,kBAAkB,CAAC,KAAK,SAAS,aAAa,IAAI,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,MAAM,EAAE,CAAC;AAElG;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,SAAS,aAAa,EACzD,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,gBAAgB,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,GAC3C,UAAU,EAAE,CASd"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Pi model ids are only unique per provider, so the session-facing id is
3
+ * `provider/model`, the same spelling Pi's own `--model` flag accepts.
4
+ *
5
+ * `effortLevels` is pi's thinking-level menu for a reasoning model, exactly
6
+ * as pi derives it (`thinkingLevelMap` drops levels mapped to null and adds
7
+ * `xhigh`/`max` only where mapped; `off` is one of pi's levels and stays
8
+ * where pi offers it), the levels `SessionOptions.effort` accepts on pi. A
9
+ * model without `reasoning` runs only `off` and lists no menu. No
10
+ * `defaultEffort`: pi's default is a settings value clamped per model at
11
+ * session creation, and the session's `effort()` reports it.
12
+ */
13
+ export function projectPiModels(models, thinkingLevelsOf) {
14
+ return models.map((model) => {
15
+ const effortLevels = model.reasoning === true && thinkingLevelsOf !== undefined ? thinkingLevelsOf(model) : [];
16
+ return {
17
+ id: `${model.provider}/${model.id}`,
18
+ displayName: model.name === undefined || model.name.trim().length === 0 ? model.id : model.name.trim(),
19
+ ...(effortLevels.length === 0 ? {} : { effortLevels: [...effortLevels] }),
20
+ };
21
+ });
22
+ }
23
+ //# sourceMappingURL=model-projection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-projection.js","sourceRoot":"","sources":["../../../src/runtimes/pi/model-projection.ts"],"names":[],"mappings":"AA2BA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAwB,EACxB,gBAA4C;IAE5C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1B,MAAM,YAAY,GAAG,KAAK,CAAC,SAAS,KAAK,IAAI,IAAI,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/G,OAAO;YACL,EAAE,EAAE,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,EAAE,EAAE;YACnC,WAAW,EAAE,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE;YACtG,GAAG,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,GAAG,YAAY,CAAC,EAAE,CAAC;SAC1E,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Models } from "@earendil-works/pi-ai";
2
+ import type { Harness } from "@earendil-works/pi-durable";
3
+ import { type Runtime } from "../../contracts/runtime.js";
4
+ export interface PiDurableRuntimeOptions {
5
+ /** An already-open host-owned Harness. OAR never closes it or its storage. */
6
+ readonly harness: Harness;
7
+ /** The same Models passed to Harness.open; native Harness exposes no getter, so OAR cannot verify identity. */
8
+ readonly models: Models;
9
+ }
10
+ /** Pi Durable 1.1.0 conversations over host-owned storage, providers, extensions and execution environment. */
11
+ export declare function createPiDurableRuntime({ harness, models }: PiDurableRuntimeOptions): Runtime;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtimes/pi-durable/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAG1D,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAMzE,MAAM,WAAW,uBAAuB;IACtC,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,+GAA+G;IAC/G,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,+GAA+G;AAC/G,wBAAgB,sBAAsB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAc5F"}
@@ -0,0 +1,25 @@
1
+ import { getSupportedThinkingLevels } from "@earendil-works/pi-ai/models";
2
+ import { defineRuntime } from "../../contracts/runtime.js";
3
+ import { runtimeBrands } from "../../brands.js";
4
+ import { projectPiModels } from "../pi/model-projection.js";
5
+ import { piDurableRefusedSessionOptions } from "./options.js";
6
+ import { piDurableSession } from "./session.js";
7
+ /** Pi Durable 1.1.0 conversations over host-owned storage, providers, extensions and execution environment. */
8
+ export function createPiDurableRuntime({ harness, models }) {
9
+ const runtime = defineRuntime({
10
+ id: "pi-durable",
11
+ brand: runtimeBrands["pi-durable"],
12
+ refusedSessionOptions: piDurableRefusedSessionOptions,
13
+ installation: async () => { await Promise.resolve(); return { kind: "available", via: "bundled" }; },
14
+ listModels: async () => { await Promise.resolve(); return { kind: "ok", models: projectPiModels(models.getModels(), getSupportedThinkingLevels) }; },
15
+ session: async (installation, options) => {
16
+ if (installation.via !== "bundled") {
17
+ throw new Error("pi-durable requires the host's bundled Harness");
18
+ }
19
+ const session = await piDurableSession(harness, models, options);
20
+ return session;
21
+ },
22
+ });
23
+ return runtime;
24
+ }
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtimes/pi-durable/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAI1E,OAAO,EAAE,aAAa,EAAgB,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAShD,+GAA+G;AAC/G,MAAM,UAAU,sBAAsB,CAAC,EAAE,OAAO,EAAE,MAAM,EAA2B;IACjF,MAAM,OAAO,GAAG,aAAa,CAAC;QAC5B,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,aAAa,CAAC,YAAY,CAAC;QAClC,qBAAqB,EAAE,8BAA8B;QACrD,YAAY,EAAE,KAAK,IAAI,EAAE,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;QACpG,UAAU,EAAE,KAAK,IAAI,EAAE,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,0BAA0B,CAAC,EAAE,CAAC,CAAC,CAAC;QACpJ,OAAO,EAAE,KAAK,EAAE,YAAmC,EAAE,OAAuB,EAAE,EAAE;YAC9E,IAAI,YAAY,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;gBAAC,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;YAAC,CAAC;YAC1G,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YACjE,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { AssistantMessage } from "@earendil-works/pi-ai";
2
+ import type { MessageChange } from "@earendil-works/pi-durable";
3
+ import type { RuntimeEventBody } from "../../contracts/session.js";
4
+ export interface MessageProjection {
5
+ readonly blocks: ReadonlyMap<number, {
6
+ readonly kind: "text" | "thinking";
7
+ readonly text: string;
8
+ }>;
9
+ }
10
+ export declare const emptyMessage: MessageProjection;
11
+ /** Whole blocks include text already delivered as deltas. Emit only the observed suffix. */
12
+ export declare function wholeMessage(previous: MessageProjection, message: AssistantMessage): {
13
+ readonly state: MessageProjection;
14
+ readonly events: readonly RuntimeEventBody[];
15
+ };
16
+ export declare function messageChanges(previous: MessageProjection, changes: readonly MessageChange[]): {
17
+ readonly state: MessageProjection;
18
+ readonly events: readonly RuntimeEventBody[];
19
+ };
20
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/runtimes/pi-durable/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrG;AACD,eAAO,MAAM,YAAY,EAAE,iBAAyC,CAAC;AAErE,4FAA4F;AAC5F,wBAAgB,YAAY,CAAC,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,gBAAgB,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAA;CAAE,CASxK;AAmBD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,SAAS,aAAa,EAAE,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAA;CAAE,CASlL"}
@@ -0,0 +1,57 @@
1
+ export const emptyMessage = { blocks: new Map() };
2
+ /** Whole blocks include text already delivered as deltas. Emit only the observed suffix. */
3
+ export function wholeMessage(previous, message) {
4
+ let state = previous;
5
+ const events = [];
6
+ for (const [index, block] of message.content.entries()) {
7
+ const next = wholeBlock(state, index, block);
8
+ state = next.state;
9
+ events.push(...next.events);
10
+ }
11
+ return { state, events };
12
+ }
13
+ function textEvent(kind, text) {
14
+ return kind === "text" ? { kind: "text_delta", text } : { kind: "reasoning", content: text === "" ? { kind: "empty" } : { kind: "text", text } };
15
+ }
16
+ function wholeBlock(previous, index, block) {
17
+ if (block.type === "toolCall") {
18
+ return { state: previous, events: [] };
19
+ }
20
+ const text = block.type === "text" ? block.text : block.thinking;
21
+ const before = previous.blocks.get(index);
22
+ const prefix = before?.kind === block.type ? before.text : "";
23
+ const blocks = new Map(previous.blocks).set(index, { kind: block.type, text });
24
+ // OAR has no text replacement event. A native correction stays in the raw batch,
25
+ // never appended as a second copy or disguised as an invented delta.
26
+ const suffix = text.startsWith(prefix) ? text.slice(prefix.length) : "";
27
+ const events = suffix !== "" || (block.type === "thinking" && before === undefined) ? [textEvent(block.type, suffix)] : [];
28
+ return { state: { blocks }, events };
29
+ }
30
+ export function messageChanges(previous, changes) {
31
+ let state = previous;
32
+ const events = [];
33
+ for (const change of changes) {
34
+ const next = messageChange(state, change);
35
+ state = next.state;
36
+ events.push(...next.events);
37
+ }
38
+ return { state, events };
39
+ }
40
+ function messageChange(state, change) {
41
+ switch (change.type) {
42
+ case "message": return wholeMessage(state, change.message);
43
+ case "text_start":
44
+ case "thinking_start":
45
+ case "toolcall_start":
46
+ case "block": return wholeBlock(state, change.contentIndex, change.block);
47
+ case "text_delta":
48
+ case "thinking_delta": {
49
+ const kind = change.type === "text_delta" ? "text" : "thinking";
50
+ const text = (state.blocks.get(change.contentIndex)?.text ?? "") + change.delta;
51
+ return { state: { blocks: new Map(state.blocks).set(change.contentIndex, { kind, text }) }, events: change.delta === "" ? [] : [textEvent(kind, change.delta)] };
52
+ }
53
+ case "toolcall_delta": return { state, events: [] };
54
+ }
55
+ return { state, events: [] };
56
+ }
57
+ //# sourceMappingURL=messages.js.map
@@ -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KAAK,gBAAgB,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACtD,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { Models } from "@earendil-works/pi-ai";
2
+ import { type Conversation, type Harness } from "@earendil-works/pi-durable";
3
+ import type { RefusedSessionOptions } from "../../contracts/runtime.js";
4
+ import type { SessionOptions } from "../../contracts/session.js";
5
+ export declare const piDurableRefusedSessionOptions: RefusedSessionOptions;
6
+ export declare function openConversation(harness: Harness, models: Models, options: SessionOptions): Promise<Conversation>;
7
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/runtimes/pi-durable/options.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAsB,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAExE,OAAO,EAAmE,KAAK,YAAY,EAAuB,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAEnK,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGjE,eAAO,MAAM,8BAA8B,EAAE,qBAO5C,CAAC;AA8DF,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAYvH"}