@radheim/client 0.0.0-stage → 2.4.3

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 (100) hide show
  1. package/README.md +27 -3
  2. package/dist/chunks/contract-0d78mgf1.js +52 -0
  3. package/dist/chunks/contract-20jd153t.js +2089 -0
  4. package/dist/chunks/contract-2h09qg7t.js +62 -0
  5. package/dist/chunks/contract-5f99ddep.js +149 -0
  6. package/dist/chunks/contract-6mptkzbc.js +0 -0
  7. package/dist/chunks/contract-6mq2wh8y.js +33 -0
  8. package/dist/chunks/contract-6r38tsk5.js +0 -0
  9. package/dist/chunks/contract-6sr7f8yw.js +92 -0
  10. package/dist/chunks/contract-850x4mfy.js +948 -0
  11. package/dist/chunks/contract-8s2anffy.js +11 -0
  12. package/dist/chunks/contract-96mz1w8q.js +104 -0
  13. package/dist/chunks/contract-9rqn6x4v.js +16 -0
  14. package/dist/chunks/contract-d9s8wkgw.js +2082 -0
  15. package/dist/chunks/contract-mn9bt8t4.js +4 -0
  16. package/dist/chunks/contract-mwrzahmf.js +38 -0
  17. package/dist/chunks/contract-n4yq1n4a.js +111 -0
  18. package/dist/chunks/contract-nwcpakzx.js +12 -0
  19. package/dist/chunks/contract-qav6mfdz.js +0 -0
  20. package/dist/chunks/contract-qtt7zwr0.js +30 -0
  21. package/dist/chunks/contract-rhrawkx2.js +49 -0
  22. package/dist/chunks/contract-rrraq56y.js +67 -0
  23. package/dist/chunks/contract-sxt88q69.js +12 -0
  24. package/dist/chunks/contract-t5nrycbt.js +39 -0
  25. package/dist/chunks/contract-vyas3vgt.js +0 -0
  26. package/dist/chunks/contract-xgnj2w4v.js +20 -0
  27. package/dist/chunks/contract-y2etg5bs.js +9 -0
  28. package/dist/chunks/contract-ydhz1zrh.js +238 -0
  29. package/dist/chunks/contract-ztxd8xjp.js +81 -0
  30. package/dist/contract.d.ts +1 -0
  31. package/dist/contract.js +14 -0
  32. package/dist/effect/api/api.d.ts +3744 -0
  33. package/dist/effect/api/api.js +0 -0
  34. package/dist/effect/api.d.ts +5 -0
  35. package/dist/effect/api.js +0 -0
  36. package/dist/effect/client.d.ts +3129 -0
  37. package/dist/effect/client.js +15 -0
  38. package/dist/effect/generated/client-error.d.ts +7 -0
  39. package/dist/effect/generated/client-error.js +6 -0
  40. package/dist/effect/generated/client.d.ts +3158 -0
  41. package/dist/effect/generated/client.js +8 -0
  42. package/dist/effect/generated/index.d.ts +2 -0
  43. package/dist/effect/generated/index.js +12 -0
  44. package/dist/effect/index.d.ts +35 -0
  45. package/dist/effect/index.js +75 -0
  46. package/dist/effect/rpc.d.ts +20 -0
  47. package/dist/effect/rpc.js +11 -0
  48. package/dist/effect/service.d.ts +90 -0
  49. package/dist/effect/service.js +187 -0
  50. package/dist/mcp.d.ts +44 -0
  51. package/dist/mcp.js +110 -0
  52. package/dist/promise/api.d.ts +25 -0
  53. package/dist/promise/api.js +0 -0
  54. package/dist/promise/client.d.ts +414 -0
  55. package/dist/promise/client.js +14 -0
  56. package/dist/promise/generated/client-error.d.ts +8 -0
  57. package/dist/promise/generated/client-error.js +6 -0
  58. package/dist/promise/generated/client.d.ts +456 -0
  59. package/dist/promise/generated/client.js +7 -0
  60. package/dist/promise/generated/index.d.ts +3 -0
  61. package/dist/promise/generated/index.js +105 -0
  62. package/dist/promise/generated/types.d.ts +6642 -0
  63. package/dist/promise/generated/types.js +96 -0
  64. package/dist/promise/index.d.ts +8 -0
  65. package/dist/promise/index.js +115 -0
  66. package/dist/promise/media.d.ts +424 -0
  67. package/dist/promise/media.js +8 -0
  68. package/dist/promise/rpc.d.ts +32 -0
  69. package/dist/promise/rpc.js +7 -0
  70. package/dist/promise/service.d.ts +24 -0
  71. package/dist/promise/service.js +188 -0
  72. package/dist/pty-handoff.d.ts +12 -0
  73. package/dist/pty-handoff.js +17 -0
  74. package/dist/rpc-runtime.d.ts +20 -0
  75. package/dist/rpc-runtime.js +14 -0
  76. package/dist/service-contender.d.ts +37 -0
  77. package/dist/service-contender.js +10 -0
  78. package/dist/service-probe.d.ts +74 -0
  79. package/dist/service-probe.js +16 -0
  80. package/dist/service-timing.d.ts +12 -0
  81. package/dist/service-timing.js +10 -0
  82. package/dist/service-version.d.ts +2 -0
  83. package/dist/service-version.js +6 -0
  84. package/dist/service.d.ts +52 -0
  85. package/dist/service.js +1 -0
  86. package/dist/shared-events.d.ts +16 -0
  87. package/dist/shared-events.js +8 -0
  88. package/dist/solid/connection.d.ts +37 -0
  89. package/dist/solid/connection.js +10 -0
  90. package/dist/solid/data.d.ts +238 -0
  91. package/dist/solid/data.js +19 -0
  92. package/dist/solid/index.d.ts +5 -0
  93. package/dist/solid/index.js +45 -0
  94. package/dist/solid/pty.d.ts +80 -0
  95. package/dist/solid/pty.js +12 -0
  96. package/dist/solid/retention.d.ts +10 -0
  97. package/dist/solid/retention.js +6 -0
  98. package/dist/solid/usage.d.ts +9 -0
  99. package/dist/solid/usage.js +6 -0
  100. package/package.json +89 -4
@@ -0,0 +1,238 @@
1
+ import type { AgentInfo, CommandInfo, ConfigEntry, SessionFormCancelInput, FormInfo, SessionFormReplyInput, IntegrationInfo, JobInfo, LocationRef, McpResource, McpServer, ModelInfo, ModelRef, PermissionSavedInfo, PermissionRequest, PermissionReplyInput, Project, ProviderInfo, ReferenceInfo, SessionMessageInfo, SessionInfo, SessionInboxInfo, SessionInboxCompaction, ShellInfo, SkillInfo, UsageLimitsInfo, VcsInfo, RadheEvent, RadheClient, WebSearchProvider } from "../promise";
2
+ import { type SessionPromptInput } from "../promise";
3
+ export type DataSessionStatus = "idle" | "running";
4
+ /**
5
+ * Where a pending user prompt stands relative to the runner: `starting` is promoted at the next idle boundary,
6
+ * `steering` waits for the next step boundary of an execution that already delivered input, `stranded` outlived an
7
+ * execution that ended without delivering it, and `queued` waits for every steer to drain.
8
+ */
9
+ export type DataPendingStatus = "starting" | "steering" | "stranded" | "queued";
10
+ type RadheEventMap = {
11
+ [Type in RadheEvent["type"]]: Extract<RadheEvent, {
12
+ type: Type;
13
+ }>;
14
+ };
15
+ export type CreateDataInput = {
16
+ readonly api: () => RadheClient;
17
+ readonly directory: string;
18
+ /** Raw-message window used for an initial transcript read. Older pages retain their normal size. */
19
+ readonly initialMessageLimit?: () => number;
20
+ readonly event: {
21
+ readonly on: <Type extends RadheEvent["type"]>(type: Type, handler: (event: RadheEventMap[Type]) => void) => () => void;
22
+ readonly listen: (handler: (event: {
23
+ name: RadheEvent["type"];
24
+ details: RadheEvent;
25
+ }) => void) => () => void;
26
+ };
27
+ readonly connection?: {
28
+ readonly status: () => "connected" | "connecting" | "reconnecting";
29
+ };
30
+ /** Receives failed event-driven reads. Explicit reads still reject to their caller. */
31
+ readonly onError?: (error: unknown) => void;
32
+ /**
33
+ * Drops the payload of inline `data:` files in tool results before they enter the store. For clients that never
34
+ * render tool-result files: a session full of screenshots otherwise keeps hundreds of MB of base64 alive. A function
35
+ * is read for each message and event, so a client can follow a setting that changes while it runs.
36
+ */
37
+ readonly omitToolFileData?: boolean | (() => boolean);
38
+ };
39
+ export declare const settleMs = 150;
40
+ export type FormWithLocation = FormInfo & {
41
+ readonly location?: LocationRef;
42
+ };
43
+ type ShellWithLocation = ShellInfo & {
44
+ readonly location: LocationRef;
45
+ };
46
+ export declare function locationKey(location: LocationRef): string;
47
+ export declare function createData(config: CreateDataInput): {
48
+ on: <Type extends RadheEvent["type"]>(type: Type, handler: (event: RadheEventMap[Type]) => void) => () => void;
49
+ listen: (handler: (event: {
50
+ name: RadheEvent["type"];
51
+ details: RadheEvent;
52
+ }) => void) => () => void;
53
+ session: {
54
+ list(): SessionInfo[];
55
+ get(sessionID: string): SessionInfo;
56
+ missing(sessionID: string): boolean;
57
+ forget(sessionID: string): void;
58
+ creating(sessionID: string): boolean;
59
+ remember(info: SessionInfo): void;
60
+ setStatus(sessionID: string, status: DataSessionStatus): void;
61
+ root(sessionID: string): string;
62
+ family(sessionID: string): string[];
63
+ /** Clear heavy cached data for the root and all known descendants. */
64
+ evict(sessionID: string): void;
65
+ cost(sessionID: string): number;
66
+ status(sessionID: string): DataSessionStatus;
67
+ active(): string[];
68
+ input: {
69
+ list(sessionID: string): string[];
70
+ has(sessionID: string, inboxID: string): boolean;
71
+ };
72
+ pending: {
73
+ list(sessionID: string): SessionInboxInfo[];
74
+ status(sessionID: string, inboxID: string): DataPendingStatus | undefined;
75
+ sync(sessionID: string): Promise<void>;
76
+ invalidate(sessionID: string): void;
77
+ };
78
+ create(input: {
79
+ id?: string;
80
+ title?: string;
81
+ agent?: string;
82
+ model?: ModelRef;
83
+ location?: LocationRef;
84
+ projectID?: string;
85
+ }): {
86
+ id: string;
87
+ request: Promise<SessionInfo>;
88
+ };
89
+ compact(input: {
90
+ sessionID: string;
91
+ model?: ModelRef;
92
+ }): Promise<SessionInboxCompaction>;
93
+ sequence<Value>(sessionID: string, send: () => Promise<Value>, prepare?: () => Promise<unknown>): Promise<Value>;
94
+ prompt(input: SessionPromptInput & {
95
+ gate?: Promise<unknown>;
96
+ prepare?: () => Promise<unknown>;
97
+ }): Promise<import("../promise").SessionInboxUser>;
98
+ sync(sessionID: string, options?: {
99
+ children?: boolean;
100
+ }): Promise<void>;
101
+ invalidate(sessionID: string): void;
102
+ message: {
103
+ list(sessionID: string): SessionMessageInfo[];
104
+ get(sessionID: string, messageID: string): SessionMessageInfo | undefined;
105
+ /** Re-reads every loaded message whose tool file data was dropped, for a client that starts showing tool files. */
106
+ restoreFiles(): Promise<void[]>;
107
+ sync(sessionID: string): Promise<void>;
108
+ more(sessionID: string): boolean;
109
+ loading(sessionID: string): boolean;
110
+ loadMore(sessionID: string, options?: {
111
+ all?: boolean;
112
+ signal?: AbortSignal;
113
+ /** Runs synchronously inside the store-publication batch. */
114
+ beforePublish?: () => void;
115
+ }): Promise<void>;
116
+ invalidate(sessionID: string): void;
117
+ };
118
+ permission: {
119
+ list(sessionID: string): PermissionRequest[];
120
+ sessions(): string[];
121
+ sync(sessionID: string): Promise<void>;
122
+ invalidate(sessionID: string): void;
123
+ reply(input: PermissionReplyInput): Promise<void>;
124
+ };
125
+ form: {
126
+ list(sessionID: string, ref?: LocationRef): FormWithLocation[] | undefined;
127
+ sessions(): string[];
128
+ sync(sessionID: string, ref?: LocationRef): Promise<void>;
129
+ invalidate(sessionID: string, ref?: LocationRef): void;
130
+ reply(input: SessionFormReplyInput, ref?: LocationRef): Promise<void>;
131
+ cancel(input: SessionFormCancelInput, ref?: LocationRef): Promise<void>;
132
+ };
133
+ };
134
+ project: {
135
+ list(): Project[];
136
+ get(projectID: string): Project;
137
+ sync(): Promise<void>;
138
+ invalidate(): void;
139
+ permission: {
140
+ list(projectID: string): PermissionSavedInfo[];
141
+ sync(projectID: string): Promise<void>;
142
+ invalidate(projectID: string): void;
143
+ };
144
+ };
145
+ shell: {
146
+ list(location?: LocationRef): ShellWithLocation[];
147
+ listBySession(sessionID: string): ShellWithLocation[];
148
+ get(id: string): ShellWithLocation | undefined;
149
+ sync: (ref?: LocationRef) => Promise<void>;
150
+ invalidate: (ref?: LocationRef) => void;
151
+ };
152
+ job: {
153
+ list(sessionID: string): JobInfo[];
154
+ sync(sessionID: string): Promise<void>;
155
+ invalidate(sessionID: string): void;
156
+ };
157
+ location: {
158
+ info(ref?: LocationRef): import("../promise").LocationPublicInfo | undefined;
159
+ default(): LocationRef;
160
+ syncInfo(ref?: LocationRef): Promise<void>;
161
+ sync(ref?: LocationRef): Promise<void>;
162
+ invalidate(ref?: LocationRef): void;
163
+ vcs: {
164
+ info: (ref?: LocationRef) => VcsInfo | undefined;
165
+ sync: (ref?: LocationRef) => Promise<void>;
166
+ invalidate: (ref?: LocationRef) => void;
167
+ };
168
+ flag(key: string, ref?: LocationRef): boolean;
169
+ flags: {
170
+ list: (ref?: LocationRef) => Record<string, boolean> | undefined;
171
+ sync: (ref?: LocationRef) => Promise<void>;
172
+ invalidate: (ref?: LocationRef) => void;
173
+ };
174
+ usage: {
175
+ limits: (ref?: LocationRef) => UsageLimitsInfo | null | undefined;
176
+ sync: (ref?: LocationRef) => Promise<void>;
177
+ invalidate: (ref?: LocationRef) => void;
178
+ };
179
+ agent: {
180
+ list: (ref?: LocationRef) => AgentInfo[] | undefined;
181
+ sync: (ref?: LocationRef) => Promise<void>;
182
+ invalidate: (ref?: LocationRef) => void;
183
+ };
184
+ command: {
185
+ list: (ref?: LocationRef) => CommandInfo[] | undefined;
186
+ sync: (ref?: LocationRef) => Promise<void>;
187
+ invalidate: (ref?: LocationRef) => void;
188
+ };
189
+ config: {
190
+ list: (ref?: LocationRef) => ConfigEntry[] | undefined;
191
+ sync: (ref?: LocationRef) => Promise<void>;
192
+ invalidate: (ref?: LocationRef) => void;
193
+ };
194
+ integration: {
195
+ list: (ref?: LocationRef) => IntegrationInfo[] | undefined;
196
+ sync: (ref?: LocationRef) => Promise<void>;
197
+ invalidate: (ref?: LocationRef) => void;
198
+ };
199
+ mcp: {
200
+ server: {
201
+ list: (ref?: LocationRef) => McpServer[] | undefined;
202
+ sync: (ref?: LocationRef) => Promise<void>;
203
+ invalidate: (ref?: LocationRef) => void;
204
+ };
205
+ resource: {
206
+ list: (ref?: LocationRef) => McpResource[] | undefined;
207
+ sync: (ref?: LocationRef) => Promise<void>;
208
+ invalidate: (ref?: LocationRef) => void;
209
+ };
210
+ };
211
+ model: {
212
+ list: (ref?: LocationRef) => ModelInfo[] | undefined;
213
+ sync: (ref?: LocationRef) => Promise<void>;
214
+ invalidate: (ref?: LocationRef) => void;
215
+ };
216
+ provider: {
217
+ list: (ref?: LocationRef) => ProviderInfo[] | undefined;
218
+ sync: (ref?: LocationRef) => Promise<void>;
219
+ invalidate: (ref?: LocationRef) => void;
220
+ };
221
+ reference: {
222
+ list: (ref?: LocationRef) => ReferenceInfo[] | undefined;
223
+ sync: (ref?: LocationRef) => Promise<void>;
224
+ invalidate: (ref?: LocationRef) => void;
225
+ };
226
+ websearch: {
227
+ list(location?: LocationRef): WebSearchProvider[] | undefined;
228
+ refresh(ref?: LocationRef): Promise<void>;
229
+ };
230
+ skill: {
231
+ list: (ref?: LocationRef) => SkillInfo[] | undefined;
232
+ sync: (ref?: LocationRef) => Promise<void>;
233
+ invalidate: (ref?: LocationRef) => void;
234
+ };
235
+ };
236
+ };
237
+ export type Data = ReturnType<typeof createData>;
238
+ export {};
@@ -0,0 +1,19 @@
1
+ import {
2
+ settleMs2,
3
+ locationKey2,
4
+ createData2
5
+ } from "../chunks/contract-20jd153t.js";
6
+ import"../chunks/contract-6r38tsk5.js";
7
+ import"../chunks/contract-qtt7zwr0.js";
8
+ import"../chunks/contract-vyas3vgt.js";
9
+ import"../chunks/contract-mwrzahmf.js";
10
+ import"../chunks/contract-ztxd8xjp.js";
11
+ import"../chunks/contract-rhrawkx2.js";
12
+ import"../chunks/contract-d9s8wkgw.js";
13
+ import"../chunks/contract-nwcpakzx.js";
14
+ import"../chunks/contract-5f99ddep.js";
15
+ export {
16
+ createData2 as createData,
17
+ locationKey2 as locationKey,
18
+ settleMs2 as settleMs
19
+ };
@@ -0,0 +1,5 @@
1
+ export * from "./data";
2
+ export * from "./connection";
3
+ export * from "./pty";
4
+ export * from "./retention";
5
+ export * from "./usage";
@@ -0,0 +1,45 @@
1
+ import"../chunks/contract-nwcpakzx.js";
2
+ import"../chunks/contract-d9s8wkgw.js";
3
+ import"../chunks/contract-rhrawkx2.js";
4
+ import"../chunks/contract-vyas3vgt.js";
5
+ import"../chunks/contract-5f99ddep.js";
6
+ import"../chunks/contract-ztxd8xjp.js";
7
+ import"../chunks/contract-qtt7zwr0.js";
8
+ import"../chunks/contract-mwrzahmf.js";
9
+ import"../chunks/contract-6r38tsk5.js";
10
+ import {
11
+ settleMs2,
12
+ locationKey2,
13
+ createData2
14
+ } from "../chunks/contract-20jd153t.js";
15
+ import {
16
+ defaultIdleTimeout2,
17
+ foregroundIdleThreshold2,
18
+ createClientConnection2
19
+ } from "../chunks/contract-ydhz1zrh.js";
20
+ import {
21
+ PersistentPtyMessage2,
22
+ decodePersistentPtyMessage2,
23
+ persistentPtyFrame2,
24
+ createPersistentPtyClient2
25
+ } from "../chunks/contract-rrraq56y.js";
26
+ import {
27
+ createSessionRetention2
28
+ } from "../chunks/contract-6mq2wh8y.js";
29
+ import {
30
+ lastAssistantWithUsage2
31
+ } from "../chunks/contract-8s2anffy.js";
32
+ export {
33
+ PersistentPtyMessage2 as PersistentPtyMessage,
34
+ createClientConnection2 as createClientConnection,
35
+ createData2 as createData,
36
+ createPersistentPtyClient2 as createPersistentPtyClient,
37
+ createSessionRetention2 as createSessionRetention,
38
+ decodePersistentPtyMessage2 as decodePersistentPtyMessage,
39
+ defaultIdleTimeout2 as defaultIdleTimeout,
40
+ foregroundIdleThreshold2 as foregroundIdleThreshold,
41
+ lastAssistantWithUsage2 as lastAssistantWithUsage,
42
+ locationKey2 as locationKey,
43
+ persistentPtyFrame2 as persistentPtyFrame,
44
+ settleMs2 as settleMs
45
+ };
@@ -0,0 +1,80 @@
1
+ import { Schema } from "effect";
2
+ import type { ExperimentalPersistentPtyConnectTokenInput, RadheClient } from "../promise";
3
+ export declare const PersistentPtyMessage: Schema.Union<readonly [Schema.Struct<{
4
+ readonly type: Schema.Literal<"attached">;
5
+ readonly inputProtocol: Schema.optional<Schema.Number>;
6
+ readonly info: Schema.Struct<{
7
+ readonly size: Schema.Struct<{
8
+ readonly cols: Schema.Int;
9
+ readonly rows: Schema.Int;
10
+ }>;
11
+ }>;
12
+ readonly role: Schema.optional<Schema.Literals<readonly ["controller", "observer"]>>;
13
+ }>, Schema.Struct<{
14
+ readonly type: Schema.Literal<"replay_complete">;
15
+ }>, Schema.Struct<{
16
+ readonly type: Schema.Literal<"resized">;
17
+ readonly cols: Schema.Number;
18
+ readonly rows: Schema.Number;
19
+ readonly checkpoint: Schema.String;
20
+ }>, Schema.Struct<{
21
+ readonly type: Schema.Literal<"controller_changed">;
22
+ readonly attachmentID: Schema.optional<Schema.NullOr<Schema.String>>;
23
+ }>, Schema.Struct<{
24
+ readonly type: Schema.Literal<"exited">;
25
+ readonly exitCode: Schema.optional<Schema.NullOr<Schema.Number>>;
26
+ }>, Schema.Struct<{
27
+ readonly type: Schema.Literal<"title_changed">;
28
+ readonly title: Schema.String;
29
+ }>, Schema.Struct<{
30
+ readonly type: Schema.Literal<"foreground_process_changed">;
31
+ readonly process: Schema.NullOr<Schema.String>;
32
+ }>]>;
33
+ export type PersistentPtyMessage = typeof PersistentPtyMessage.Type;
34
+ export declare function decodePersistentPtyMessage(text: string): import("effect/Option").Option<{
35
+ readonly type: "replay_complete";
36
+ } | {
37
+ readonly type: "resized";
38
+ readonly cols: number;
39
+ readonly rows: number;
40
+ readonly checkpoint: string;
41
+ } | {
42
+ readonly type: "title_changed";
43
+ readonly title: string;
44
+ } | {
45
+ readonly type: "foreground_process_changed";
46
+ readonly process: string | null;
47
+ } | {
48
+ readonly type: "attached";
49
+ readonly inputProtocol?: number | undefined;
50
+ readonly info: {
51
+ readonly size: {
52
+ readonly cols: number;
53
+ readonly rows: number;
54
+ };
55
+ };
56
+ readonly role?: "controller" | "observer" | undefined;
57
+ } | {
58
+ readonly type: "controller_changed";
59
+ readonly attachmentID?: string | null | undefined;
60
+ } | {
61
+ readonly type: "exited";
62
+ readonly exitCode?: number | null | undefined;
63
+ }>;
64
+ export declare function persistentPtyFrame(size: {
65
+ cols: number;
66
+ rows: number;
67
+ }, data?: Uint8Array): Uint8Array<ArrayBuffer>;
68
+ export type PtyClientOptions = {
69
+ readonly url: string;
70
+ readonly openSocket?: (url: URL) => WebSocket;
71
+ };
72
+ export type PersistentPtyConnectInput = {
73
+ readonly ptyID: ExperimentalPersistentPtyConnectTokenInput["ptyID"];
74
+ readonly cursor: number;
75
+ readonly attachmentID: string;
76
+ readonly takeover?: boolean;
77
+ };
78
+ export declare function createPersistentPtyClient(api: RadheClient, options: PtyClientOptions): {
79
+ connect(input: PersistentPtyConnectInput): Promise<WebSocket>;
80
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ PersistentPtyMessage2,
3
+ decodePersistentPtyMessage2,
4
+ persistentPtyFrame2,
5
+ createPersistentPtyClient2
6
+ } from "../chunks/contract-rrraq56y.js";
7
+ export {
8
+ PersistentPtyMessage2 as PersistentPtyMessage,
9
+ createPersistentPtyClient2 as createPersistentPtyClient,
10
+ decodePersistentPtyMessage2 as decodePersistentPtyMessage,
11
+ persistentPtyFrame2 as persistentPtyFrame
12
+ };
@@ -0,0 +1,10 @@
1
+ import { type Accessor } from "solid-js";
2
+ import type { Data } from "./data";
3
+ export declare function createSessionRetention(input: {
4
+ session: Pick<Data["session"], "list" | "root" | "evict"> & {
5
+ message?: Pick<Data["session"]["message"], "list">;
6
+ };
7
+ current: Accessor<string | undefined>;
8
+ keep: Accessor<readonly string[]>;
9
+ limit: number;
10
+ }): void;
@@ -0,0 +1,6 @@
1
+ import {
2
+ createSessionRetention2
3
+ } from "../chunks/contract-6mq2wh8y.js";
4
+ export {
5
+ createSessionRetention2 as createSessionRetention
6
+ };
@@ -0,0 +1,9 @@
1
+ import type { SessionMessageAssistant, SessionMessageInfo } from "../promise";
2
+ /**
3
+ * The assistant step whose tokens fill the context window now: the latest one after the last completed
4
+ * compaction and before the revert boundary. Every client shows context usage from this step, so the TUI
5
+ * and the desktop app agree on it.
6
+ */
7
+ export declare function lastAssistantWithUsage(messages: ReadonlyArray<SessionMessageInfo>, boundary?: string): (SessionMessageAssistant & {
8
+ tokens: NonNullable<SessionMessageAssistant["tokens"]>;
9
+ }) | undefined;
@@ -0,0 +1,6 @@
1
+ import {
2
+ lastAssistantWithUsage2
3
+ } from "../chunks/contract-8s2anffy.js";
4
+ export {
5
+ lastAssistantWithUsage2 as lastAssistantWithUsage
6
+ };
package/package.json CHANGED
@@ -1,6 +1,91 @@
1
1
  {
2
+ "$schema": "https://json.schemastore.org/package.json",
2
3
  "name": "@radheim/client",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
4
+ "version": "2.4.3",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/anomalyco/opencode.git",
10
+ "directory": "packages/client"
11
+ },
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/promise/index.d.ts",
21
+ "import": "./dist/promise/index.js"
22
+ },
23
+ "./promise": {
24
+ "types": "./dist/promise/index.d.ts",
25
+ "import": "./dist/promise/index.js"
26
+ },
27
+ "./promise/api": {
28
+ "types": "./dist/promise/api.d.ts",
29
+ "import": "./dist/promise/api.js"
30
+ },
31
+ "./service": {
32
+ "types": "./dist/promise/service.d.ts",
33
+ "import": "./dist/promise/service.js"
34
+ },
35
+ "./solid": {
36
+ "types": "./dist/solid/index.d.ts",
37
+ "import": "./dist/solid/index.js"
38
+ },
39
+ "./effect": {
40
+ "types": "./dist/effect/index.d.ts",
41
+ "import": "./dist/effect/index.js"
42
+ },
43
+ "./effect/api": {
44
+ "types": "./dist/effect/api.d.ts",
45
+ "import": "./dist/effect/api.js"
46
+ },
47
+ "./effect/service": {
48
+ "types": "./dist/effect/service.d.ts",
49
+ "import": "./dist/effect/service.js"
50
+ },
51
+ "./mcp": {
52
+ "types": "./dist/mcp.d.ts",
53
+ "import": "./dist/mcp.js"
54
+ }
55
+ },
56
+ "scripts": {
57
+ "build": "bun run script/build.ts",
58
+ "pack": "bun run script/pack.ts",
59
+ "generate": "bun run script/generate.ts",
60
+ "check:generated": "bun run generate && git diff --exit-code -- src/promise/generated src/effect/generated src/effect/api",
61
+ "test": "bun test --timeout 5000",
62
+ "typecheck": "bun check --no-script",
63
+ "typecheck:tsc": "tsc --noEmit"
64
+ },
65
+ "dependencies": {
66
+ "@radheim/schema": "2.4.3",
67
+ "@radheim/protocol": "2.4.3"
68
+ },
69
+ "peerDependencies": {
70
+ "effect": "4.1.0",
71
+ "solid-js": ">=1.9.0"
72
+ },
73
+ "peerDependenciesMeta": {
74
+ "effect": {
75
+ "optional": true
76
+ },
77
+ "solid-js": {
78
+ "optional": true
79
+ }
80
+ },
81
+ "devDependencies": {
82
+ "@effect/platform-node": "4.1.0",
83
+ "@modelcontextprotocol/client": "2.4.0",
84
+ "@radheim/httpapi-codegen": "2.4.3",
85
+ "@tsconfig/bun": "1.0.9",
86
+ "@types/bun": "1.4.3",
87
+ "@typescript/native": "npm:typescript@7.1.0-beta",
88
+ "effect": "4.1.0",
89
+ "solid-js": "1.9.17"
90
+ }
91
+ }