@harness-gw/sdk 0.5.0 → 0.5.1

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/README.md CHANGED
@@ -63,7 +63,7 @@ You need a running harness. Hermes is the primary one; see
63
63
  docker run --rm \
64
64
  -v "$PWD/config.yaml:/run/harness-gw/config.yaml:ro" \
65
65
  -v "$PWD/hermes-token:/run/secrets/hermes-token:ro" \
66
- ghcr.io/almogbaku/harness-gw:0.5.0 \
66
+ ghcr.io/almogbaku/harness-gw:0.5.1 \
67
67
  config check --config /run/harness-gw/config.yaml
68
68
  ```
69
69
 
@@ -73,7 +73,7 @@ You need a running harness. Hermes is the primary one; see
73
73
  docker run --rm -p 127.0.0.1:4100:4100 \
74
74
  -v "$PWD/config.yaml:/run/harness-gw/config.yaml:ro" \
75
75
  -v "$PWD/hermes-token:/run/secrets/hermes-token:ro" \
76
- ghcr.io/almogbaku/harness-gw:0.5.0 \
76
+ ghcr.io/almogbaku/harness-gw:0.5.1 \
77
77
  serve --config /run/harness-gw/config.yaml
78
78
  ```
79
79
 
@@ -156,8 +156,9 @@ Use [Bun](https://bun.sh).
156
156
 
157
157
  ```bash
158
158
  bun install
159
- bun run typecheck
160
- bun run lint
159
+ bun run typecheck # TypeScript 7
160
+ bun run lint # Oxlint, type-aware
161
+ bun run format # oxfmt
161
162
  bun run test # unit and integration
162
163
  bun run test:gate # build and packaging checks
163
164
  bun run build # the SDK's dist/
@@ -32,15 +32,15 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
32
32
  capabilities: (sessionId: string) => {
33
33
  workspace: {
34
34
  slashCommands: {
35
- status: "unavailable";
36
- reason: string;
37
- } | {
38
35
  status: "available";
39
36
  scope: "session";
40
37
  commands: {
41
38
  name: string;
42
39
  description?: string | undefined;
43
40
  }[];
41
+ } | {
42
+ status: "unavailable";
43
+ reason: string;
44
44
  };
45
45
  models: {
46
46
  status: "unavailable";
@@ -114,7 +114,7 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
114
114
  protocol: "acp-request";
115
115
  scope: "turn";
116
116
  answerModes: ["single", "multiple", "free-text"];
117
- cancellation: "native-empty-answer" | "native-reject" | "native-cancel";
117
+ cancellation: "native-cancel" | "native-empty-answer" | "native-reject";
118
118
  maxQuestions: number;
119
119
  maxChoicesPerQuestion: number;
120
120
  maxAnswerValuesPerQuestion: number | "complete-request";
@@ -133,7 +133,7 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
133
133
  status: "available";
134
134
  scope: "session";
135
135
  inputs: ["image", "file"];
136
- imageMimeTypes: string[] | "provider-dependent";
136
+ imageMimeTypes: "provider-dependent" | string[];
137
137
  fileMimeTypes: "provider-dependent" | "valid-type/subtype";
138
138
  maxMimeTypeBytes: number;
139
139
  maxFilenameBytes: number;
@@ -186,6 +186,7 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
186
186
  } | undefined;
187
187
  models: (sessionId: string) => {
188
188
  selectedId: string;
189
+ effortId?: string | undefined;
189
190
  options: {
190
191
  id: string;
191
192
  label: string;
@@ -195,14 +196,13 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
195
196
  name?: string | undefined;
196
197
  }[] | undefined;
197
198
  }[];
198
- effortId?: string | undefined;
199
199
  } | undefined;
200
200
  /** The newest reading, or none while the provider has reported none. */
201
201
  context: (sessionId: string) => {
202
202
  usedTokens: number;
203
203
  maxTokens: number;
204
- source: "provider-usage" | "provider-usage-plus-estimate" | "local-estimate";
205
204
  estimated?: true | undefined;
205
+ source: "local-estimate" | "provider-usage" | "provider-usage-plus-estimate";
206
206
  breakdown?: {
207
207
  systemTokens: number;
208
208
  toolTokens: number;
@@ -219,6 +219,7 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
219
219
  modelFeed: (sessionId: string) => ComposerModelFeed;
220
220
  selectModel: (sessionId: string, selectedId: string) => Promise<{
221
221
  selectedId: string;
222
+ effortId?: string | undefined;
222
223
  options: {
223
224
  id: string;
224
225
  label: string;
@@ -228,10 +229,10 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
228
229
  name?: string | undefined;
229
230
  }[] | undefined;
230
231
  }[];
231
- effortId?: string | undefined;
232
232
  }>;
233
233
  selectEffort: (sessionId: string, effortId: string) => Promise<{
234
234
  selectedId: string;
235
+ effortId?: string | undefined;
235
236
  options: {
236
237
  id: string;
237
238
  label: string;
@@ -241,6 +242,5 @@ export declare function createAcpComposerStore(connection: AcpConnection): {
241
242
  name?: string | undefined;
242
243
  }[] | undefined;
243
244
  }[];
244
- effortId?: string | undefined;
245
245
  }>;
246
246
  };
@@ -60,12 +60,12 @@ export declare function rowOf(session: SessionInfo): {
60
60
  sessionId: string;
61
61
  info: {
62
62
  agentId: string;
63
- status: "unknown" | "idle" | "running" | "waiting-for-input" | "failed";
63
+ status: "failed" | "idle" | "running" | "unknown" | "waiting-for-input";
64
64
  archived: boolean;
65
65
  createdAt?: string | undefined;
66
66
  unread?: boolean | undefined;
67
67
  pinned?: boolean | undefined;
68
- platform?: "buzz" | "whatsapp" | "slack" | "telegram" | "email" | "discord" | undefined;
68
+ platform?: "buzz" | "discord" | "email" | "slack" | "telegram" | "whatsapp" | undefined;
69
69
  };
70
70
  updatedAt: string | null | undefined;
71
71
  title: string | null | undefined;
@@ -23,9 +23,9 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
23
23
  id: string;
24
24
  name: string;
25
25
  description?: string | undefined;
26
- status?: "active" | "unknown" | "idle" | "running" | "attention" | undefined;
27
- activity?: "active" | "unknown" | "idle" | undefined;
28
- visibility?: "visible" | "hidden" | undefined;
26
+ status?: "active" | "attention" | "idle" | "running" | "unknown" | undefined;
27
+ activity?: "active" | "idle" | "unknown" | undefined;
28
+ visibility?: "hidden" | "visible" | undefined;
29
29
  role?: "creator" | undefined;
30
30
  avatar?: string | undefined;
31
31
  muted?: true | undefined;
@@ -35,9 +35,9 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
35
35
  id: string;
36
36
  name: string;
37
37
  description?: string | undefined;
38
- status?: "active" | "unknown" | "idle" | "running" | "attention" | undefined;
39
- activity?: "active" | "unknown" | "idle" | undefined;
40
- visibility?: "visible" | "hidden" | undefined;
38
+ status?: "active" | "attention" | "idle" | "running" | "unknown" | undefined;
39
+ activity?: "active" | "idle" | "unknown" | undefined;
40
+ visibility?: "hidden" | "visible" | undefined;
41
41
  role?: "creator" | undefined;
42
42
  avatar?: string | undefined;
43
43
  muted?: true | undefined;
@@ -48,14 +48,14 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
48
48
  id: string;
49
49
  name: string;
50
50
  description?: string | undefined;
51
- status?: "active" | "unknown" | "idle" | "running" | "attention" | undefined;
52
- activity?: "active" | "unknown" | "idle" | undefined;
53
- visibility?: "visible" | "hidden" | undefined;
51
+ status?: "active" | "attention" | "idle" | "running" | "unknown" | undefined;
52
+ activity?: "active" | "idle" | "unknown" | undefined;
53
+ visibility?: "hidden" | "visible" | undefined;
54
54
  role?: "creator" | undefined;
55
55
  avatar?: string | undefined;
56
56
  muted?: true | undefined;
57
57
  };
58
- visibility: "visible" | "hidden";
58
+ visibility: "hidden" | "visible";
59
59
  selectable: boolean;
60
60
  editable: boolean;
61
61
  avatarEditable: boolean;
@@ -64,7 +64,6 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
64
64
  updateAgent: (agentId: string, patch: AgentUpdate) => Promise<void>;
65
65
  subscribeAgentCatalog: (listener: () => void) => () => void;
66
66
  listSessions: (agentId?: string, cursor?: string) => Promise<{
67
- nextCursor?: string | undefined;
68
67
  sessions: {
69
68
  sessionId: string;
70
69
  agentId: string;
@@ -76,6 +75,7 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
76
75
  createdAt?: string;
77
76
  platform?: import("./workspace.js").SessionPlatform;
78
77
  }[];
78
+ nextCursor?: string | undefined;
79
79
  }>;
80
80
  readSessionPage: (meta: Parameters<AcpConnection["listSessions"]>[0], cursor?: string) => Promise<{
81
81
  sessions: SessionInfo[];
@@ -126,15 +126,15 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
126
126
  workspaceCapabilities: (sessionId: string) => {
127
127
  workspace: {
128
128
  slashCommands: {
129
- status: "unavailable";
130
- reason: string;
131
- } | {
132
129
  status: "available";
133
130
  scope: "session";
134
131
  commands: {
135
132
  name: string;
136
133
  description?: string | undefined;
137
134
  }[];
135
+ } | {
136
+ status: "unavailable";
137
+ reason: string;
138
138
  };
139
139
  models: {
140
140
  status: "unavailable";
@@ -208,7 +208,7 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
208
208
  protocol: "acp-request";
209
209
  scope: "turn";
210
210
  answerModes: ["single", "multiple", "free-text"];
211
- cancellation: "native-empty-answer" | "native-reject" | "native-cancel";
211
+ cancellation: "native-cancel" | "native-empty-answer" | "native-reject";
212
212
  maxQuestions: number;
213
213
  maxChoicesPerQuestion: number;
214
214
  maxAnswerValuesPerQuestion: number | "complete-request";
@@ -227,7 +227,7 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
227
227
  status: "available";
228
228
  scope: "session";
229
229
  inputs: ["image", "file"];
230
- imageMimeTypes: string[] | "provider-dependent";
230
+ imageMimeTypes: "provider-dependent" | string[];
231
231
  fileMimeTypes: "provider-dependent" | "valid-type/subtype";
232
232
  maxMimeTypeBytes: number;
233
233
  maxFilenameBytes: number;
@@ -280,6 +280,7 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
280
280
  } | undefined;
281
281
  models: (sessionId: string) => {
282
282
  selectedId: string;
283
+ effortId?: string | undefined;
283
284
  options: {
284
285
  id: string;
285
286
  label: string;
@@ -289,14 +290,13 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
289
290
  name?: string | undefined;
290
291
  }[] | undefined;
291
292
  }[];
292
- effortId?: string | undefined;
293
293
  } | undefined;
294
294
  /** The newest usage the provider pushed. */
295
295
  context: (sessionId: string) => {
296
296
  usedTokens: number;
297
297
  maxTokens: number;
298
- source: "provider-usage" | "provider-usage-plus-estimate" | "local-estimate";
299
298
  estimated?: true | undefined;
299
+ source: "local-estimate" | "provider-usage" | "provider-usage-plus-estimate";
300
300
  breakdown?: {
301
301
  systemTokens: number;
302
302
  toolTokens: number;
@@ -314,6 +314,7 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
314
314
  modelFeed: (sessionId: string) => import("./workspace.js").ComposerModelFeed;
315
315
  selectModel: (sessionId: string, selectedId: string) => Promise<{
316
316
  selectedId: string;
317
+ effortId?: string | undefined;
317
318
  options: {
318
319
  id: string;
319
320
  label: string;
@@ -323,10 +324,10 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
323
324
  name?: string | undefined;
324
325
  }[] | undefined;
325
326
  }[];
326
- effortId?: string | undefined;
327
327
  }>;
328
328
  selectEffort: (sessionId: string, effortId: string) => Promise<{
329
329
  selectedId: string;
330
+ effortId?: string | undefined;
330
331
  options: {
331
332
  id: string;
332
333
  label: string;
@@ -336,7 +337,6 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
336
337
  name?: string | undefined;
337
338
  }[] | undefined;
338
339
  }[];
339
- effortId?: string | undefined;
340
340
  }>;
341
341
  /** One provider write per half; the response settles what the Session runs. */
342
342
  updateModel(sessionId: string, patch: SessionModelUpdateRequest): Promise<SessionModelUpdateResponse>;
@@ -344,14 +344,14 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
344
344
  requestId: string;
345
345
  text: string;
346
346
  }) => Promise<{
347
- status: "steered" | "queued";
347
+ status: "queued" | "steered";
348
348
  }>;
349
349
  runtimeInfo: (signal?: AbortSignal) => Promise<{
350
350
  runtime: {
351
351
  id: string;
352
352
  name: string;
353
353
  };
354
- status: "unavailable" | "ready" | "degraded";
354
+ status: "degraded" | "ready" | "unavailable";
355
355
  capabilities: {
356
356
  agentCatalog: {
357
357
  status: "available";
@@ -469,8 +469,8 @@ export declare function createAcpWorkspaceClient({ connection, rest, agentIdFor,
469
469
  filename?: string | undefined;
470
470
  } | {
471
471
  type: "file";
472
- mimeType: string;
473
472
  filename?: string | undefined;
473
+ mimeType: string;
474
474
  })[];
475
475
  }>;
476
476
  readArtifact: (sessionId: string, artifactId: string, signal?: AbortSignal) => Promise<Blob>;
@@ -98,15 +98,15 @@ export declare function connectionMachine({ open, handshake, recover, inProcess,
98
98
  generation: number;
99
99
  attempt: number;
100
100
  }, ConnectionEvent, {
101
- [x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<void, import("xstate").NonReducibleUnknown, import("xstate").EventObject> | import("xstate").PromiseActorLogic<unknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject>> | undefined;
101
+ [x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<unknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject> | import("xstate").PromiseActorLogic<void, import("xstate").NonReducibleUnknown, import("xstate").EventObject>> | undefined;
102
102
  }, {
103
- src: "open";
104
- logic: import("xstate").PromiseActorLogic<void, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
105
- id: string | undefined;
106
- } | {
107
103
  src: "handshake";
108
104
  logic: import("xstate").PromiseActorLogic<unknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
109
105
  id: string | undefined;
106
+ } | {
107
+ src: "open";
108
+ logic: import("xstate").PromiseActorLogic<void, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
109
+ id: string | undefined;
110
110
  } | {
111
111
  src: "recover";
112
112
  logic: import("xstate").PromiseActorLogic<void, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
@@ -119,6 +119,9 @@ export declare function connectionMachine({ open, handshake, recover, inProcess,
119
119
  event: string;
120
120
  }[];
121
121
  };
122
+ } | {
123
+ type: "bumpGeneration";
124
+ params: undefined;
122
125
  } | {
123
126
  type: "clearAfter";
124
127
  params: {
@@ -127,29 +130,26 @@ export declare function connectionMachine({ open, handshake, recover, inProcess,
127
130
  event: string;
128
131
  }[];
129
132
  };
133
+ } | {
134
+ type: "closeTransport";
135
+ params: unknown;
136
+ } | {
137
+ type: "countAttempt";
138
+ params: undefined;
130
139
  } | {
131
140
  type: "logTransition";
132
141
  params: {
133
142
  to: string;
134
143
  info: boolean;
135
144
  };
136
- } | {
137
- type: "bumpGeneration";
138
- params: undefined;
139
- } | {
140
- type: "closeTransport";
141
- params: unknown;
142
- } | {
143
- type: "markReady";
144
- params: unknown;
145
145
  } | {
146
146
  type: "lose";
147
147
  params: {
148
148
  status: "reconnecting" | "capacity";
149
149
  };
150
150
  } | {
151
- type: "countAttempt";
152
- params: undefined;
151
+ type: "markReady";
152
+ params: unknown;
153
153
  } | {
154
154
  type: "resetAttempts";
155
155
  params: undefined;
@@ -162,7 +162,7 @@ export declare function connectionMachine({ open, handshake, recover, inProcess,
162
162
  } | {
163
163
  type: "tryAgainLater";
164
164
  params: unknown;
165
- }, "capacity" | "handshake" | "stable" | "reconnect", "ready" | "connecting" | "reconnecting" | "capacity" | "closed" | "handshaking", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
165
+ }, "capacity" | "handshake" | "reconnect" | "stable", "capacity" | "closed" | "connecting" | "handshaking" | "ready" | "reconnecting", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
166
166
  states: {
167
167
  readonly connecting: {};
168
168
  readonly handshaking: {};
@@ -209,6 +209,9 @@ export declare function sessionMachine({ join, replayOwed, oweReplay, transportL
209
209
  event: string;
210
210
  }[];
211
211
  };
212
+ } | {
213
+ type: "bumpGeneration";
214
+ params: undefined;
212
215
  } | {
213
216
  type: "clearAfter";
214
217
  params: {
@@ -217,6 +220,9 @@ export declare function sessionMachine({ join, replayOwed, oweReplay, transportL
217
220
  event: string;
218
221
  }[];
219
222
  };
223
+ } | {
224
+ type: "countAttempt";
225
+ params: undefined;
220
226
  } | {
221
227
  type: "logTransition";
222
228
  params: {
@@ -224,24 +230,18 @@ export declare function sessionMachine({ join, replayOwed, oweReplay, transportL
224
230
  info: boolean;
225
231
  };
226
232
  } | {
227
- type: "bumpGeneration";
228
- params: undefined;
229
- } | {
230
- type: "countAttempt";
231
- params: undefined;
233
+ type: "oweReplay";
234
+ params: unknown;
232
235
  } | {
233
236
  type: "resetAttempts";
234
237
  params: undefined;
235
- } | {
236
- type: "oweReplay";
237
- params: unknown;
238
238
  }, {
239
239
  type: "replayOwed";
240
240
  params: unknown;
241
241
  } | {
242
242
  type: "transportLost";
243
243
  params: unknown;
244
- }, "retry", "unavailable" | "joining" | "joined" | "gone" | "refused" | "detached", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
244
+ }, "retry", "detached" | "gone" | "joined" | "joining" | "refused" | "unavailable", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
245
245
  states: {
246
246
  readonly joining: {};
247
247
  readonly joined: {};