@ai-matrx/coding-sessions 0.1.81 → 0.1.85
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/CHANGELOG.md +24 -0
- package/dist/engine/index.cjs +724 -139
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.d.cts +4 -1
- package/dist/engine/index.d.ts +4 -1
- package/dist/engine/index.js +717 -132
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/worker.js +14 -2
- package/dist/engine/worker.js.map +1 -1
- package/dist/{index-RYOb-YZT.d.cts → index-DEPwyr2j.d.cts} +148 -0
- package/dist/{index-RYOb-YZT.d.ts → index-DEPwyr2j.d.ts} +148 -0
- package/dist/index.cjs +21 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +105 -1
- package/dist/index.d.ts +105 -1
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +722 -410
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +105 -7
- package/dist/react/index.d.ts +105 -7
- package/dist/react/index.js +730 -405
- package/dist/react/index.js.map +1 -1
- package/dist/server/index.cjs +792 -155
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +4 -1
- package/dist/server/index.d.ts +4 -1
- package/dist/server/index.js +783 -146
- package/dist/server/index.js.map +1 -1
- package/dist/ui/assets/index-DSWoryQZ.js +72 -0
- package/dist/ui/assets/index-Gp2bMDtx.css +2 -0
- package/dist/ui/index.html +2 -2
- package/package.json +4 -2
- package/dist/ui/assets/index-B3Ic2ziA.js +0 -69
- package/dist/ui/assets/index-BAkpc01s.css +0 -2
package/dist/react/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { JsonValue } from '@ai-matrx/agents/portable';
|
|
2
3
|
import { ChatThreadStore, ChatMessage } from '@ai-matrx/chat';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -7,10 +8,27 @@ import { ChatThreadStore, ChatMessage } from '@ai-matrx/chat';
|
|
|
7
8
|
* touches Node or the DOM, and every value is JSON-serializable because it
|
|
8
9
|
* crosses a transport (WebSocket today, desktop IPC later).
|
|
9
10
|
*/
|
|
11
|
+
|
|
10
12
|
/** The coding agents this package drives. "coding session" is the canonical
|
|
11
13
|
* platform term (chat.coding_session, the Coding Session Bridge). */
|
|
12
14
|
type CodingProvider = "claude" | "codex";
|
|
13
15
|
type Billing = "subscription" | "api" | "unknown";
|
|
16
|
+
/** Where the CLI a provider runs came from. */
|
|
17
|
+
type BinarySource = "desktop-app" | "path" | "npm-global" | "configured";
|
|
18
|
+
/** The exact CLI runs use: the newest copy on this computer (or the host's pick). */
|
|
19
|
+
interface ProviderBinary {
|
|
20
|
+
path: string;
|
|
21
|
+
version: string | null;
|
|
22
|
+
source: BinarySource;
|
|
23
|
+
/** "from ChatGPT app", "from PATH", … */
|
|
24
|
+
sourceLabel: string;
|
|
25
|
+
/** A newer copy than the one in use, when one exists. */
|
|
26
|
+
newer: {
|
|
27
|
+
path: string;
|
|
28
|
+
version: string;
|
|
29
|
+
sourceLabel: string;
|
|
30
|
+
} | null;
|
|
31
|
+
}
|
|
14
32
|
/** What `providers()` answers for one provider, in plain terms. */
|
|
15
33
|
interface ProviderStatus {
|
|
16
34
|
provider: CodingProvider;
|
|
@@ -48,6 +66,8 @@ interface ProviderStatus {
|
|
|
48
66
|
} | null | undefined;
|
|
49
67
|
/** The effort a run uses when none is picked (the person's own settings). */
|
|
50
68
|
defaultEffort?: string | null | undefined;
|
|
69
|
+
/** Which CLI runs use, and its version. */
|
|
70
|
+
binary?: ProviderBinary | null | undefined;
|
|
51
71
|
}
|
|
52
72
|
interface ModelOption {
|
|
53
73
|
id: string;
|
|
@@ -174,6 +194,8 @@ interface CodingSession {
|
|
|
174
194
|
lastRunStatus: RunStatus | null;
|
|
175
195
|
/** Prompts waiting for the active run to finish, oldest first. */
|
|
176
196
|
queued: string[];
|
|
197
|
+
/** The AI Matrx agent loaded into every run of this session, when one was picked. */
|
|
198
|
+
agent?: SessionAgent | null | undefined;
|
|
177
199
|
}
|
|
178
200
|
/**
|
|
179
201
|
* One normalized transcript item — the same shape from Claude and Codex, from
|
|
@@ -254,6 +276,82 @@ interface StartInput {
|
|
|
254
276
|
prompt: string;
|
|
255
277
|
model?: string | null | undefined;
|
|
256
278
|
effort?: string | null | undefined;
|
|
279
|
+
/** An AI Matrx agent to load into the CLI. Needs the host's `agents` credentials. */
|
|
280
|
+
agent?: AgentSelection | null | undefined;
|
|
281
|
+
}
|
|
282
|
+
/** Which AI Matrx agent a new session loads, and the person's variable values. */
|
|
283
|
+
interface AgentSelection {
|
|
284
|
+
agentId: string;
|
|
285
|
+
/** Pin one saved version; omitted = the latest, pinned at start. */
|
|
286
|
+
versionId?: string | null | undefined;
|
|
287
|
+
variables?: Record<string, JsonValue> | undefined;
|
|
288
|
+
}
|
|
289
|
+
/** One part of an agent and whether this session's CLI carries it. */
|
|
290
|
+
interface SessionAgentPart {
|
|
291
|
+
part: "instructions" | "skills" | "tools";
|
|
292
|
+
loaded: number;
|
|
293
|
+
total: number;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* The agent a session runs with. Recorded at start and never drifts: every
|
|
297
|
+
* later turn reloads the SAME bundle (same version, same hash).
|
|
298
|
+
*/
|
|
299
|
+
interface SessionAgent {
|
|
300
|
+
agentId: string;
|
|
301
|
+
versionId: string | null;
|
|
302
|
+
versionNumber: number | null;
|
|
303
|
+
name: string;
|
|
304
|
+
definitionHash: string;
|
|
305
|
+
loaded: SessionAgentPart[];
|
|
306
|
+
/** What could not be carried, with the reason. */
|
|
307
|
+
unavailable: {
|
|
308
|
+
kind: string;
|
|
309
|
+
name: string;
|
|
310
|
+
reason: string;
|
|
311
|
+
}[];
|
|
312
|
+
}
|
|
313
|
+
/** Whether this host can reach AI Matrx as a signed-in person. */
|
|
314
|
+
interface AgentAccess {
|
|
315
|
+
signedIn: boolean;
|
|
316
|
+
userId: string | null;
|
|
317
|
+
organizationId: string | null;
|
|
318
|
+
/** True when the host was started with no AI Matrx connection at all. */
|
|
319
|
+
configured: boolean;
|
|
320
|
+
}
|
|
321
|
+
/** A catalogue read the picker asks the host to make (PostgREST RPC shape). */
|
|
322
|
+
interface AgentCatalogRpcRequest {
|
|
323
|
+
fn: string;
|
|
324
|
+
args?: Record<string, unknown> | undefined;
|
|
325
|
+
count?: "exact" | "planned" | "estimated" | undefined;
|
|
326
|
+
range?: [number, number] | undefined;
|
|
327
|
+
order?: {
|
|
328
|
+
column: string;
|
|
329
|
+
ascending?: boolean | undefined;
|
|
330
|
+
} | undefined;
|
|
331
|
+
}
|
|
332
|
+
interface AgentCatalogRpcResult {
|
|
333
|
+
data: unknown;
|
|
334
|
+
error: {
|
|
335
|
+
message: string;
|
|
336
|
+
code?: string | undefined;
|
|
337
|
+
details?: string | null | undefined;
|
|
338
|
+
hint?: string | null | undefined;
|
|
339
|
+
} | null;
|
|
340
|
+
count?: number | null;
|
|
341
|
+
}
|
|
342
|
+
/** What the New session form needs about one agent. */
|
|
343
|
+
interface AgentDetails {
|
|
344
|
+
agentId: string;
|
|
345
|
+
name: string;
|
|
346
|
+
/** Variable declarations as authored (camelCase). */
|
|
347
|
+
variables: Record<string, JsonValue>[];
|
|
348
|
+
versions: {
|
|
349
|
+
id: string;
|
|
350
|
+
versionNumber: number;
|
|
351
|
+
changedAt: string | null;
|
|
352
|
+
}[];
|
|
353
|
+
/** The version "Latest" resolves to right now. */
|
|
354
|
+
latestVersionNumber: number | null;
|
|
257
355
|
}
|
|
258
356
|
interface TakeoverInput {
|
|
259
357
|
provider: CodingProvider;
|
|
@@ -330,6 +428,12 @@ interface CodingSessionsApi {
|
|
|
330
428
|
model?: string | null;
|
|
331
429
|
effort?: string | null;
|
|
332
430
|
}): Promise<CodingSession>;
|
|
431
|
+
/** Is this host signed in to AI Matrx (so agents can load)? */
|
|
432
|
+
agentAccess(): Promise<AgentAccess>;
|
|
433
|
+
/** One allowlisted agent-catalogue read, made by the host as the signed-in person. */
|
|
434
|
+
agentCatalogRpc(request: AgentCatalogRpcRequest): Promise<AgentCatalogRpcResult>;
|
|
435
|
+
/** An agent's variables and saved versions, for the New session form. */
|
|
436
|
+
agentDetails(agentId: string): Promise<AgentDetails>;
|
|
333
437
|
}
|
|
334
438
|
type RawTranscript = {
|
|
335
439
|
available: true;
|
|
@@ -483,13 +587,7 @@ declare class CodingSessionsClient {
|
|
|
483
587
|
refreshAll: () => Promise<void>;
|
|
484
588
|
transcript(sessionId: string): SessionTranscript;
|
|
485
589
|
readPreview(provider: CodingProvider, providerSessionId: string, maxBytes?: number): Promise<PreviewState>;
|
|
486
|
-
start(input:
|
|
487
|
-
provider: CodingProvider;
|
|
488
|
-
cwd: string;
|
|
489
|
-
prompt: string;
|
|
490
|
-
model?: string | null;
|
|
491
|
-
effort?: string | null;
|
|
492
|
-
}): Promise<SendResult>;
|
|
590
|
+
start(input: StartInput): Promise<SendResult>;
|
|
493
591
|
takeover(session: DiscoveredSession): Promise<CodingSession>;
|
|
494
592
|
send(sessionId: string, prompt: string): Promise<SendResult>;
|
|
495
593
|
stop(runId: string): Promise<RunRecord | null>;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { JsonValue } from '@ai-matrx/agents/portable';
|
|
2
3
|
import { ChatThreadStore, ChatMessage } from '@ai-matrx/chat';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -7,10 +8,27 @@ import { ChatThreadStore, ChatMessage } from '@ai-matrx/chat';
|
|
|
7
8
|
* touches Node or the DOM, and every value is JSON-serializable because it
|
|
8
9
|
* crosses a transport (WebSocket today, desktop IPC later).
|
|
9
10
|
*/
|
|
11
|
+
|
|
10
12
|
/** The coding agents this package drives. "coding session" is the canonical
|
|
11
13
|
* platform term (chat.coding_session, the Coding Session Bridge). */
|
|
12
14
|
type CodingProvider = "claude" | "codex";
|
|
13
15
|
type Billing = "subscription" | "api" | "unknown";
|
|
16
|
+
/** Where the CLI a provider runs came from. */
|
|
17
|
+
type BinarySource = "desktop-app" | "path" | "npm-global" | "configured";
|
|
18
|
+
/** The exact CLI runs use: the newest copy on this computer (or the host's pick). */
|
|
19
|
+
interface ProviderBinary {
|
|
20
|
+
path: string;
|
|
21
|
+
version: string | null;
|
|
22
|
+
source: BinarySource;
|
|
23
|
+
/** "from ChatGPT app", "from PATH", … */
|
|
24
|
+
sourceLabel: string;
|
|
25
|
+
/** A newer copy than the one in use, when one exists. */
|
|
26
|
+
newer: {
|
|
27
|
+
path: string;
|
|
28
|
+
version: string;
|
|
29
|
+
sourceLabel: string;
|
|
30
|
+
} | null;
|
|
31
|
+
}
|
|
14
32
|
/** What `providers()` answers for one provider, in plain terms. */
|
|
15
33
|
interface ProviderStatus {
|
|
16
34
|
provider: CodingProvider;
|
|
@@ -48,6 +66,8 @@ interface ProviderStatus {
|
|
|
48
66
|
} | null | undefined;
|
|
49
67
|
/** The effort a run uses when none is picked (the person's own settings). */
|
|
50
68
|
defaultEffort?: string | null | undefined;
|
|
69
|
+
/** Which CLI runs use, and its version. */
|
|
70
|
+
binary?: ProviderBinary | null | undefined;
|
|
51
71
|
}
|
|
52
72
|
interface ModelOption {
|
|
53
73
|
id: string;
|
|
@@ -174,6 +194,8 @@ interface CodingSession {
|
|
|
174
194
|
lastRunStatus: RunStatus | null;
|
|
175
195
|
/** Prompts waiting for the active run to finish, oldest first. */
|
|
176
196
|
queued: string[];
|
|
197
|
+
/** The AI Matrx agent loaded into every run of this session, when one was picked. */
|
|
198
|
+
agent?: SessionAgent | null | undefined;
|
|
177
199
|
}
|
|
178
200
|
/**
|
|
179
201
|
* One normalized transcript item — the same shape from Claude and Codex, from
|
|
@@ -254,6 +276,82 @@ interface StartInput {
|
|
|
254
276
|
prompt: string;
|
|
255
277
|
model?: string | null | undefined;
|
|
256
278
|
effort?: string | null | undefined;
|
|
279
|
+
/** An AI Matrx agent to load into the CLI. Needs the host's `agents` credentials. */
|
|
280
|
+
agent?: AgentSelection | null | undefined;
|
|
281
|
+
}
|
|
282
|
+
/** Which AI Matrx agent a new session loads, and the person's variable values. */
|
|
283
|
+
interface AgentSelection {
|
|
284
|
+
agentId: string;
|
|
285
|
+
/** Pin one saved version; omitted = the latest, pinned at start. */
|
|
286
|
+
versionId?: string | null | undefined;
|
|
287
|
+
variables?: Record<string, JsonValue> | undefined;
|
|
288
|
+
}
|
|
289
|
+
/** One part of an agent and whether this session's CLI carries it. */
|
|
290
|
+
interface SessionAgentPart {
|
|
291
|
+
part: "instructions" | "skills" | "tools";
|
|
292
|
+
loaded: number;
|
|
293
|
+
total: number;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* The agent a session runs with. Recorded at start and never drifts: every
|
|
297
|
+
* later turn reloads the SAME bundle (same version, same hash).
|
|
298
|
+
*/
|
|
299
|
+
interface SessionAgent {
|
|
300
|
+
agentId: string;
|
|
301
|
+
versionId: string | null;
|
|
302
|
+
versionNumber: number | null;
|
|
303
|
+
name: string;
|
|
304
|
+
definitionHash: string;
|
|
305
|
+
loaded: SessionAgentPart[];
|
|
306
|
+
/** What could not be carried, with the reason. */
|
|
307
|
+
unavailable: {
|
|
308
|
+
kind: string;
|
|
309
|
+
name: string;
|
|
310
|
+
reason: string;
|
|
311
|
+
}[];
|
|
312
|
+
}
|
|
313
|
+
/** Whether this host can reach AI Matrx as a signed-in person. */
|
|
314
|
+
interface AgentAccess {
|
|
315
|
+
signedIn: boolean;
|
|
316
|
+
userId: string | null;
|
|
317
|
+
organizationId: string | null;
|
|
318
|
+
/** True when the host was started with no AI Matrx connection at all. */
|
|
319
|
+
configured: boolean;
|
|
320
|
+
}
|
|
321
|
+
/** A catalogue read the picker asks the host to make (PostgREST RPC shape). */
|
|
322
|
+
interface AgentCatalogRpcRequest {
|
|
323
|
+
fn: string;
|
|
324
|
+
args?: Record<string, unknown> | undefined;
|
|
325
|
+
count?: "exact" | "planned" | "estimated" | undefined;
|
|
326
|
+
range?: [number, number] | undefined;
|
|
327
|
+
order?: {
|
|
328
|
+
column: string;
|
|
329
|
+
ascending?: boolean | undefined;
|
|
330
|
+
} | undefined;
|
|
331
|
+
}
|
|
332
|
+
interface AgentCatalogRpcResult {
|
|
333
|
+
data: unknown;
|
|
334
|
+
error: {
|
|
335
|
+
message: string;
|
|
336
|
+
code?: string | undefined;
|
|
337
|
+
details?: string | null | undefined;
|
|
338
|
+
hint?: string | null | undefined;
|
|
339
|
+
} | null;
|
|
340
|
+
count?: number | null;
|
|
341
|
+
}
|
|
342
|
+
/** What the New session form needs about one agent. */
|
|
343
|
+
interface AgentDetails {
|
|
344
|
+
agentId: string;
|
|
345
|
+
name: string;
|
|
346
|
+
/** Variable declarations as authored (camelCase). */
|
|
347
|
+
variables: Record<string, JsonValue>[];
|
|
348
|
+
versions: {
|
|
349
|
+
id: string;
|
|
350
|
+
versionNumber: number;
|
|
351
|
+
changedAt: string | null;
|
|
352
|
+
}[];
|
|
353
|
+
/** The version "Latest" resolves to right now. */
|
|
354
|
+
latestVersionNumber: number | null;
|
|
257
355
|
}
|
|
258
356
|
interface TakeoverInput {
|
|
259
357
|
provider: CodingProvider;
|
|
@@ -330,6 +428,12 @@ interface CodingSessionsApi {
|
|
|
330
428
|
model?: string | null;
|
|
331
429
|
effort?: string | null;
|
|
332
430
|
}): Promise<CodingSession>;
|
|
431
|
+
/** Is this host signed in to AI Matrx (so agents can load)? */
|
|
432
|
+
agentAccess(): Promise<AgentAccess>;
|
|
433
|
+
/** One allowlisted agent-catalogue read, made by the host as the signed-in person. */
|
|
434
|
+
agentCatalogRpc(request: AgentCatalogRpcRequest): Promise<AgentCatalogRpcResult>;
|
|
435
|
+
/** An agent's variables and saved versions, for the New session form. */
|
|
436
|
+
agentDetails(agentId: string): Promise<AgentDetails>;
|
|
333
437
|
}
|
|
334
438
|
type RawTranscript = {
|
|
335
439
|
available: true;
|
|
@@ -483,13 +587,7 @@ declare class CodingSessionsClient {
|
|
|
483
587
|
refreshAll: () => Promise<void>;
|
|
484
588
|
transcript(sessionId: string): SessionTranscript;
|
|
485
589
|
readPreview(provider: CodingProvider, providerSessionId: string, maxBytes?: number): Promise<PreviewState>;
|
|
486
|
-
start(input:
|
|
487
|
-
provider: CodingProvider;
|
|
488
|
-
cwd: string;
|
|
489
|
-
prompt: string;
|
|
490
|
-
model?: string | null;
|
|
491
|
-
effort?: string | null;
|
|
492
|
-
}): Promise<SendResult>;
|
|
590
|
+
start(input: StartInput): Promise<SendResult>;
|
|
493
591
|
takeover(session: DiscoveredSession): Promise<CodingSession>;
|
|
494
592
|
send(sessionId: string, prompt: string): Promise<SendResult>;
|
|
495
593
|
stop(runId: string): Promise<RunRecord | null>;
|