@ai-matrx/coding-sessions 0.1.83 → 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 +12 -0
- package/dist/engine/index.cjs +521 -112
- 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 +521 -112
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/worker.js +2 -2
- package/dist/engine/worker.js.map +1 -1
- package/dist/{index-DQ0teQvw.d.cts → index-DEPwyr2j.d.cts} +130 -0
- package/dist/{index-DQ0teQvw.d.ts → index-DEPwyr2j.d.ts} +130 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +87 -1
- package/dist/index.d.ts +87 -1
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +666 -408
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +87 -7
- package/dist/react/index.d.ts +87 -7
- package/dist/react/index.js +674 -403
- package/dist/react/index.js.map +1 -1
- package/dist/server/index.cjs +588 -127
- 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 +587 -126
- 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-C-_1qjy9.css +0 -2
- package/dist/ui/assets/index-CmFgFvLa.js +0 -69
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,6 +8,7 @@ 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";
|
|
@@ -192,6 +194,8 @@ interface CodingSession {
|
|
|
192
194
|
lastRunStatus: RunStatus | null;
|
|
193
195
|
/** Prompts waiting for the active run to finish, oldest first. */
|
|
194
196
|
queued: string[];
|
|
197
|
+
/** The AI Matrx agent loaded into every run of this session, when one was picked. */
|
|
198
|
+
agent?: SessionAgent | null | undefined;
|
|
195
199
|
}
|
|
196
200
|
/**
|
|
197
201
|
* One normalized transcript item — the same shape from Claude and Codex, from
|
|
@@ -272,6 +276,82 @@ interface StartInput {
|
|
|
272
276
|
prompt: string;
|
|
273
277
|
model?: string | null | undefined;
|
|
274
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;
|
|
275
355
|
}
|
|
276
356
|
interface TakeoverInput {
|
|
277
357
|
provider: CodingProvider;
|
|
@@ -348,6 +428,12 @@ interface CodingSessionsApi {
|
|
|
348
428
|
model?: string | null;
|
|
349
429
|
effort?: string | null;
|
|
350
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>;
|
|
351
437
|
}
|
|
352
438
|
type RawTranscript = {
|
|
353
439
|
available: true;
|
|
@@ -501,13 +587,7 @@ declare class CodingSessionsClient {
|
|
|
501
587
|
refreshAll: () => Promise<void>;
|
|
502
588
|
transcript(sessionId: string): SessionTranscript;
|
|
503
589
|
readPreview(provider: CodingProvider, providerSessionId: string, maxBytes?: number): Promise<PreviewState>;
|
|
504
|
-
start(input:
|
|
505
|
-
provider: CodingProvider;
|
|
506
|
-
cwd: string;
|
|
507
|
-
prompt: string;
|
|
508
|
-
model?: string | null;
|
|
509
|
-
effort?: string | null;
|
|
510
|
-
}): Promise<SendResult>;
|
|
590
|
+
start(input: StartInput): Promise<SendResult>;
|
|
511
591
|
takeover(session: DiscoveredSession): Promise<CodingSession>;
|
|
512
592
|
send(sessionId: string, prompt: string): Promise<SendResult>;
|
|
513
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,6 +8,7 @@ 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";
|
|
@@ -192,6 +194,8 @@ interface CodingSession {
|
|
|
192
194
|
lastRunStatus: RunStatus | null;
|
|
193
195
|
/** Prompts waiting for the active run to finish, oldest first. */
|
|
194
196
|
queued: string[];
|
|
197
|
+
/** The AI Matrx agent loaded into every run of this session, when one was picked. */
|
|
198
|
+
agent?: SessionAgent | null | undefined;
|
|
195
199
|
}
|
|
196
200
|
/**
|
|
197
201
|
* One normalized transcript item — the same shape from Claude and Codex, from
|
|
@@ -272,6 +276,82 @@ interface StartInput {
|
|
|
272
276
|
prompt: string;
|
|
273
277
|
model?: string | null | undefined;
|
|
274
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;
|
|
275
355
|
}
|
|
276
356
|
interface TakeoverInput {
|
|
277
357
|
provider: CodingProvider;
|
|
@@ -348,6 +428,12 @@ interface CodingSessionsApi {
|
|
|
348
428
|
model?: string | null;
|
|
349
429
|
effort?: string | null;
|
|
350
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>;
|
|
351
437
|
}
|
|
352
438
|
type RawTranscript = {
|
|
353
439
|
available: true;
|
|
@@ -501,13 +587,7 @@ declare class CodingSessionsClient {
|
|
|
501
587
|
refreshAll: () => Promise<void>;
|
|
502
588
|
transcript(sessionId: string): SessionTranscript;
|
|
503
589
|
readPreview(provider: CodingProvider, providerSessionId: string, maxBytes?: number): Promise<PreviewState>;
|
|
504
|
-
start(input:
|
|
505
|
-
provider: CodingProvider;
|
|
506
|
-
cwd: string;
|
|
507
|
-
prompt: string;
|
|
508
|
-
model?: string | null;
|
|
509
|
-
effort?: string | null;
|
|
510
|
-
}): Promise<SendResult>;
|
|
590
|
+
start(input: StartInput): Promise<SendResult>;
|
|
511
591
|
takeover(session: DiscoveredSession): Promise<CodingSession>;
|
|
512
592
|
send(sessionId: string, prompt: string): Promise<SendResult>;
|
|
513
593
|
stop(runId: string): Promise<RunRecord | null>;
|