@copilotkitnext/runtime 1.52.2-next.1 → 1.52.2-next.2
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/dist/index.cjs +2 -0
- package/dist/index.d.cts +2 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +2 -1
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/runner/index.cjs +1 -0
- package/dist/runner/index.d.cts +1 -0
- package/dist/runner/index.d.mts +1 -0
- package/dist/runner/index.mjs +1 -0
- package/dist/runner/intelligence.cjs +115 -0
- package/dist/runner/intelligence.cjs.map +1 -0
- package/dist/runner/intelligence.d.cts +25 -0
- package/dist/runner/intelligence.d.cts.map +1 -0
- package/dist/runner/intelligence.d.mts +25 -0
- package/dist/runner/intelligence.d.mts.map +1 -0
- package/dist/runner/intelligence.mjs +114 -0
- package/dist/runner/intelligence.mjs.map +1 -0
- package/package.json +8 -5
package/dist/index.cjs
CHANGED
|
@@ -6,6 +6,7 @@ const require_runtime$1 = require('./runtime.cjs');
|
|
|
6
6
|
const require_hono = require('./endpoints/hono.cjs');
|
|
7
7
|
const require_hono_single = require('./endpoints/hono-single.cjs');
|
|
8
8
|
require('./endpoints/index.cjs');
|
|
9
|
+
const require_intelligence = require('./runner/intelligence.cjs');
|
|
9
10
|
require('./runner/index.cjs');
|
|
10
11
|
const require_transcription_service = require('./transcription-service/transcription-service.cjs');
|
|
11
12
|
let _copilotkitnext_shared = require("@copilotkitnext/shared");
|
|
@@ -13,6 +14,7 @@ let _copilotkitnext_shared = require("@copilotkitnext/shared");
|
|
|
13
14
|
exports.AgentRunner = require_agent_runner.AgentRunner;
|
|
14
15
|
exports.CopilotRuntime = require_runtime$1.CopilotRuntime;
|
|
15
16
|
exports.InMemoryAgentRunner = require_in_memory.InMemoryAgentRunner;
|
|
17
|
+
exports.IntelligenceAgentRunner = require_intelligence.IntelligenceAgentRunner;
|
|
16
18
|
exports.TranscriptionService = require_transcription_service.TranscriptionService;
|
|
17
19
|
exports.VERSION = require_runtime$1.VERSION;
|
|
18
20
|
exports.createCopilotEndpoint = require_hono.createCopilotEndpoint;
|
package/dist/index.d.cts
CHANGED
|
@@ -4,5 +4,6 @@ import { CopilotRuntime, CopilotRuntimeOptions, VERSION } from "./runtime.cjs";
|
|
|
4
4
|
import { CopilotEndpointCorsConfig, createCopilotEndpoint } from "./endpoints/hono.cjs";
|
|
5
5
|
import { createCopilotEndpointSingleRoute } from "./endpoints/hono-single.cjs";
|
|
6
6
|
import { InMemoryAgentRunner } from "./runner/in-memory.cjs";
|
|
7
|
+
import { IntelligenceAgentRunner, IntelligenceAgentRunnerOptions } from "./runner/intelligence.cjs";
|
|
7
8
|
import { finalizeRunEvents } from "./runner/index.cjs";
|
|
8
|
-
export { AgentRunner, AgentRunnerConnectRequest, AgentRunnerIsRunningRequest, AgentRunnerRunRequest, AgentRunnerStopRequest, CopilotEndpointCorsConfig, CopilotRuntime, CopilotRuntimeOptions, InMemoryAgentRunner, TranscribeFileOptions, TranscriptionService, VERSION, createCopilotEndpoint, createCopilotEndpointSingleRoute, finalizeRunEvents };
|
|
9
|
+
export { AgentRunner, AgentRunnerConnectRequest, AgentRunnerIsRunningRequest, AgentRunnerRunRequest, AgentRunnerStopRequest, CopilotEndpointCorsConfig, CopilotRuntime, CopilotRuntimeOptions, InMemoryAgentRunner, IntelligenceAgentRunner, IntelligenceAgentRunnerOptions, TranscribeFileOptions, TranscriptionService, VERSION, createCopilotEndpoint, createCopilotEndpointSingleRoute, finalizeRunEvents };
|
package/dist/index.d.mts
CHANGED
|
@@ -5,5 +5,6 @@ import { CopilotEndpointCorsConfig, createCopilotEndpoint } from "./endpoints/ho
|
|
|
5
5
|
import { createCopilotEndpointSingleRoute } from "./endpoints/hono-single.mjs";
|
|
6
6
|
import "./endpoints/index.mjs";
|
|
7
7
|
import { InMemoryAgentRunner } from "./runner/in-memory.mjs";
|
|
8
|
+
import { IntelligenceAgentRunner, IntelligenceAgentRunnerOptions } from "./runner/intelligence.mjs";
|
|
8
9
|
import { finalizeRunEvents } from "./runner/index.mjs";
|
|
9
|
-
export { AgentRunner, AgentRunnerConnectRequest, AgentRunnerIsRunningRequest, AgentRunnerRunRequest, AgentRunnerStopRequest, CopilotEndpointCorsConfig, CopilotRuntime, CopilotRuntimeOptions, InMemoryAgentRunner, TranscribeFileOptions, TranscriptionService, VERSION, createCopilotEndpoint, createCopilotEndpointSingleRoute, finalizeRunEvents };
|
|
10
|
+
export { AgentRunner, AgentRunnerConnectRequest, AgentRunnerIsRunningRequest, AgentRunnerRunRequest, AgentRunnerStopRequest, CopilotEndpointCorsConfig, CopilotRuntime, CopilotRuntimeOptions, InMemoryAgentRunner, IntelligenceAgentRunner, IntelligenceAgentRunnerOptions, TranscribeFileOptions, TranscriptionService, VERSION, createCopilotEndpoint, createCopilotEndpointSingleRoute, finalizeRunEvents };
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,8 @@ import { CopilotRuntime, VERSION } from "./runtime.mjs";
|
|
|
4
4
|
import { createCopilotEndpoint } from "./endpoints/hono.mjs";
|
|
5
5
|
import { createCopilotEndpointSingleRoute } from "./endpoints/hono-single.mjs";
|
|
6
6
|
import "./endpoints/index.mjs";
|
|
7
|
+
import { IntelligenceAgentRunner } from "./runner/intelligence.mjs";
|
|
7
8
|
import { finalizeRunEvents } from "./runner/index.mjs";
|
|
8
9
|
import { TranscriptionService } from "./transcription-service/transcription-service.mjs";
|
|
9
10
|
|
|
10
|
-
export { AgentRunner, CopilotRuntime, InMemoryAgentRunner, TranscriptionService, VERSION, createCopilotEndpoint, createCopilotEndpointSingleRoute, finalizeRunEvents };
|
|
11
|
+
export { AgentRunner, CopilotRuntime, InMemoryAgentRunner, IntelligenceAgentRunner, TranscriptionService, VERSION, createCopilotEndpoint, createCopilotEndpointSingleRoute, finalizeRunEvents };
|
package/dist/package.cjs
CHANGED
package/dist/package.mjs
CHANGED
package/dist/runner/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
2
|
const require_agent_runner = require('./agent-runner.cjs');
|
|
3
3
|
const require_in_memory = require('./in-memory.cjs');
|
|
4
|
+
const require_intelligence = require('./intelligence.cjs');
|
|
4
5
|
let _copilotkitnext_shared = require("@copilotkitnext/shared");
|
package/dist/runner/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AgentRunner, AgentRunnerConnectRequest, AgentRunnerIsRunningRequest, AgentRunnerRunRequest, AgentRunnerStopRequest } from "./agent-runner.cjs";
|
|
2
2
|
import { InMemoryAgentRunner } from "./in-memory.cjs";
|
|
3
|
+
import { IntelligenceAgentRunner, IntelligenceAgentRunnerOptions } from "./intelligence.cjs";
|
|
3
4
|
import { finalizeRunEvents } from "@copilotkitnext/shared";
|
|
4
5
|
export { finalizeRunEvents };
|
package/dist/runner/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AgentRunner, AgentRunnerConnectRequest, AgentRunnerIsRunningRequest, AgentRunnerRunRequest, AgentRunnerStopRequest } from "./agent-runner.mjs";
|
|
2
2
|
import { InMemoryAgentRunner } from "./in-memory.mjs";
|
|
3
|
+
import { IntelligenceAgentRunner, IntelligenceAgentRunnerOptions } from "./intelligence.mjs";
|
|
3
4
|
import { finalizeRunEvents as finalizeRunEvents$1 } from "@copilotkitnext/shared";
|
|
4
5
|
export { finalizeRunEvents$1 as finalizeRunEvents };
|
package/dist/runner/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AgentRunner } from "./agent-runner.mjs";
|
|
2
2
|
import { InMemoryAgentRunner } from "./in-memory.mjs";
|
|
3
|
+
import { IntelligenceAgentRunner } from "./intelligence.mjs";
|
|
3
4
|
import { finalizeRunEvents as finalizeRunEvents$1 } from "@copilotkitnext/shared";
|
|
4
5
|
|
|
5
6
|
export { finalizeRunEvents$1 as finalizeRunEvents };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_agent_runner = require('./agent-runner.cjs');
|
|
3
|
+
let rxjs = require("rxjs");
|
|
4
|
+
let _ag_ui_client = require("@ag-ui/client");
|
|
5
|
+
let _copilotkitnext_shared = require("@copilotkitnext/shared");
|
|
6
|
+
let rxjs_operators = require("rxjs/operators");
|
|
7
|
+
let phoenix = require("phoenix");
|
|
8
|
+
|
|
9
|
+
//#region src/runner/intelligence.ts
|
|
10
|
+
var IntelligenceAgentRunner = class extends require_agent_runner.AgentRunner {
|
|
11
|
+
socket;
|
|
12
|
+
threads = /* @__PURE__ */ new Map();
|
|
13
|
+
constructor(options) {
|
|
14
|
+
super();
|
|
15
|
+
this.socket = new phoenix.Socket(options.url, { params: options.socketParams ?? {} });
|
|
16
|
+
this.socket.connect();
|
|
17
|
+
}
|
|
18
|
+
run(request) {
|
|
19
|
+
const { threadId, agent, input } = request;
|
|
20
|
+
if (this.threads.get(threadId)?.isRunning) throw new Error("Thread already running");
|
|
21
|
+
return new rxjs.Observable((observer) => {
|
|
22
|
+
const currentEvents = [];
|
|
23
|
+
const channel = this.socket.channel(`agent:${threadId}`, { runId: input.runId });
|
|
24
|
+
const state = {
|
|
25
|
+
channel,
|
|
26
|
+
isRunning: true,
|
|
27
|
+
stopRequested: false,
|
|
28
|
+
agent,
|
|
29
|
+
currentEvents
|
|
30
|
+
};
|
|
31
|
+
this.threads.set(threadId, state);
|
|
32
|
+
channel.join().receive("ok", () => {
|
|
33
|
+
this.executeAgentRun(request, state, threadId).subscribe({ complete: () => observer.complete() });
|
|
34
|
+
}).receive("error", (resp) => {
|
|
35
|
+
const errorEvent = {
|
|
36
|
+
type: _ag_ui_client.EventType.RUN_ERROR,
|
|
37
|
+
message: `Failed to join channel: ${JSON.stringify(resp)}`,
|
|
38
|
+
code: "CHANNEL_JOIN_ERROR"
|
|
39
|
+
};
|
|
40
|
+
observer.next(errorEvent);
|
|
41
|
+
currentEvents.push(errorEvent);
|
|
42
|
+
this.removeThread(threadId);
|
|
43
|
+
observer.complete();
|
|
44
|
+
});
|
|
45
|
+
return () => {
|
|
46
|
+
this.removeThread(threadId);
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
connect(request) {
|
|
51
|
+
const { threadId } = request;
|
|
52
|
+
return new rxjs.Observable((observer) => {
|
|
53
|
+
const channel = this.socket.channel(`agent:${threadId}`, { mode: "connect" });
|
|
54
|
+
channel.on(_copilotkitnext_shared.AG_UI_CHANNEL_EVENT, (payload) => {
|
|
55
|
+
observer.next(payload);
|
|
56
|
+
if (payload.type === _ag_ui_client.EventType.RUN_FINISHED || payload.type === _ag_ui_client.EventType.RUN_ERROR) observer.complete();
|
|
57
|
+
});
|
|
58
|
+
channel.join().receive("ok", () => {
|
|
59
|
+
channel.push(_ag_ui_client.EventType.CUSTOM, {
|
|
60
|
+
type: _ag_ui_client.EventType.CUSTOM,
|
|
61
|
+
name: "connect",
|
|
62
|
+
value: { threadId }
|
|
63
|
+
});
|
|
64
|
+
}).receive("error", () => {
|
|
65
|
+
observer.complete();
|
|
66
|
+
});
|
|
67
|
+
return () => {
|
|
68
|
+
channel.leave();
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
isRunning(request) {
|
|
73
|
+
const state = this.threads.get(request.threadId);
|
|
74
|
+
return Promise.resolve(state?.isRunning ?? false);
|
|
75
|
+
}
|
|
76
|
+
stop(request) {
|
|
77
|
+
const state = this.threads.get(request.threadId);
|
|
78
|
+
if (!state || !state.isRunning || state.stopRequested) return Promise.resolve(false);
|
|
79
|
+
state.stopRequested = true;
|
|
80
|
+
if (state.agent) try {
|
|
81
|
+
state.agent.abortRun();
|
|
82
|
+
} catch {}
|
|
83
|
+
return Promise.resolve(true);
|
|
84
|
+
}
|
|
85
|
+
executeAgentRun(request, state, threadId) {
|
|
86
|
+
const { currentEvents, channel } = state;
|
|
87
|
+
return (0, rxjs.from)(request.agent.runAgent(request.input, { onEvent: ({ event }) => {
|
|
88
|
+
currentEvents.push(event);
|
|
89
|
+
channel.push(_copilotkitnext_shared.AG_UI_CHANNEL_EVENT, event);
|
|
90
|
+
} })).pipe((0, rxjs_operators.catchError)((error) => {
|
|
91
|
+
const errorEvent = {
|
|
92
|
+
type: _ag_ui_client.EventType.RUN_ERROR,
|
|
93
|
+
message: error instanceof Error ? error.message : String(error)
|
|
94
|
+
};
|
|
95
|
+
currentEvents.push(errorEvent);
|
|
96
|
+
channel.push(_copilotkitnext_shared.AG_UI_CHANNEL_EVENT, errorEvent);
|
|
97
|
+
return rxjs.EMPTY;
|
|
98
|
+
}), (0, rxjs_operators.finalize)(() => {
|
|
99
|
+
const appended = (0, _copilotkitnext_shared.finalizeRunEvents)(currentEvents, { stopRequested: state.stopRequested });
|
|
100
|
+
for (const event of appended) channel.push(_copilotkitnext_shared.AG_UI_CHANNEL_EVENT, event);
|
|
101
|
+
this.removeThread(threadId);
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
removeThread(threadId) {
|
|
105
|
+
const state = this.threads.get(threadId);
|
|
106
|
+
if (state) {
|
|
107
|
+
state.channel.leave();
|
|
108
|
+
this.threads.delete(threadId);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
//#endregion
|
|
114
|
+
exports.IntelligenceAgentRunner = IntelligenceAgentRunner;
|
|
115
|
+
//# sourceMappingURL=intelligence.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intelligence.cjs","names":["AgentRunner","Socket","Observable","EventType","AG_UI_CHANNEL_EVENT","EMPTY"],"sources":["../../src/runner/intelligence.ts"],"sourcesContent":["import {\n AgentRunner,\n AgentRunnerConnectRequest,\n AgentRunnerIsRunningRequest,\n AgentRunnerRunRequest,\n type AgentRunnerStopRequest,\n} from \"./agent-runner\";\nimport { EMPTY, Observable, from } from \"rxjs\";\nimport { catchError, finalize } from \"rxjs/operators\";\nimport { AbstractAgent, BaseEvent, EventType } from \"@ag-ui/client\";\nimport { finalizeRunEvents, AG_UI_CHANNEL_EVENT } from \"@copilotkitnext/shared\";\nimport { Socket, Channel } from \"phoenix\";\n\nexport interface IntelligenceAgentRunnerOptions {\n /** Phoenix websocket URL, e.g. \"ws://localhost:4000/socket\" */\n url: string;\n /** Optional params sent on socket connect (e.g. auth token) */\n socketParams?: Record<string, string>;\n}\n\ninterface ThreadState {\n channel: Channel;\n isRunning: boolean;\n stopRequested: boolean;\n agent: AbstractAgent | null;\n currentEvents: BaseEvent[];\n}\n\nexport class IntelligenceAgentRunner extends AgentRunner {\n private socket: Socket;\n private threads = new Map<string, ThreadState>();\n\n constructor(options: IntelligenceAgentRunnerOptions) {\n super();\n this.socket = new Socket(options.url, {\n params: options.socketParams ?? {},\n });\n this.socket.connect();\n }\n\n run(request: AgentRunnerRunRequest): Observable<BaseEvent> {\n const { threadId, agent, input } = request;\n\n const existing = this.threads.get(threadId);\n if (existing?.isRunning) {\n throw new Error(\"Thread already running\");\n }\n\n return new Observable((observer) => {\n const currentEvents: BaseEvent[] = [];\n\n const channel = this.socket.channel(`agent:${threadId}`, {\n runId: input.runId,\n });\n\n const state: ThreadState = {\n channel,\n isRunning: true,\n stopRequested: false,\n agent,\n currentEvents,\n };\n this.threads.set(threadId, state);\n\n channel\n .join()\n .receive(\"ok\", () => {\n this.executeAgentRun(request, state, threadId).subscribe({\n complete: () => observer.complete(),\n });\n })\n .receive(\"error\", (resp) => {\n const errorEvent = {\n type: EventType.RUN_ERROR,\n message: `Failed to join channel: ${JSON.stringify(resp)}`,\n code: \"CHANNEL_JOIN_ERROR\",\n } as BaseEvent;\n observer.next(errorEvent);\n currentEvents.push(errorEvent);\n this.removeThread(threadId);\n observer.complete();\n });\n\n return () => {\n this.removeThread(threadId);\n };\n });\n }\n\n connect(request: AgentRunnerConnectRequest): Observable<BaseEvent> {\n const { threadId } = request;\n\n return new Observable((observer) => {\n const channel = this.socket.channel(`agent:${threadId}`, {\n mode: \"connect\",\n });\n\n // Listen for AG-UI events on a single channel event name.\n channel.on(AG_UI_CHANNEL_EVENT, (payload: BaseEvent) => {\n observer.next(payload);\n\n if (\n payload.type === EventType.RUN_FINISHED ||\n payload.type === EventType.RUN_ERROR\n ) {\n observer.complete();\n }\n });\n\n channel\n .join()\n .receive(\"ok\", () => {\n // Ask the server to replay history via a CUSTOM event.\n channel.push(EventType.CUSTOM, {\n type: EventType.CUSTOM,\n name: \"connect\",\n value: { threadId },\n });\n })\n .receive(\"error\", () => {\n observer.complete();\n });\n\n return () => {\n channel.leave();\n };\n });\n }\n\n isRunning(request: AgentRunnerIsRunningRequest): Promise<boolean> {\n const state = this.threads.get(request.threadId);\n return Promise.resolve(state?.isRunning ?? false);\n }\n\n stop(request: AgentRunnerStopRequest): Promise<boolean | undefined> {\n const state = this.threads.get(request.threadId);\n if (!state || !state.isRunning || state.stopRequested) {\n return Promise.resolve(false);\n }\n\n state.stopRequested = true;\n\n // Direct local abort — the runtime is the authority.\n if (state.agent) {\n try {\n state.agent.abortRun();\n } catch {\n // Ignore abort errors.\n }\n }\n\n return Promise.resolve(true);\n }\n\n private executeAgentRun(\n request: AgentRunnerRunRequest,\n state: ThreadState,\n threadId: string,\n ): Observable<void> {\n const { currentEvents, channel } = state;\n\n return from(\n request.agent.runAgent(request.input, {\n onEvent: ({ event }: { event: BaseEvent }) => {\n currentEvents.push(event);\n\n // Push to Phoenix channel so frontend WS listeners receive it.\n channel.push(AG_UI_CHANNEL_EVENT, event);\n },\n }),\n ).pipe(\n catchError((error) => {\n const errorEvent = {\n type: EventType.RUN_ERROR,\n message: error instanceof Error ? error.message : String(error),\n } as BaseEvent;\n currentEvents.push(errorEvent);\n channel.push(AG_UI_CHANNEL_EVENT, errorEvent);\n return EMPTY;\n }),\n finalize(() => {\n const appended = finalizeRunEvents(currentEvents, {\n stopRequested: state.stopRequested,\n });\n for (const event of appended) {\n channel.push(AG_UI_CHANNEL_EVENT, event);\n }\n this.removeThread(threadId);\n }),\n );\n }\n\n private removeThread(threadId: string): void {\n const state = this.threads.get(threadId);\n if (state) {\n state.channel.leave();\n this.threads.delete(threadId);\n }\n }\n}\n"],"mappings":";;;;;;;;;AA4BA,IAAa,0BAAb,cAA6CA,iCAAY;CACvD,AAAQ;CACR,AAAQ,0BAAU,IAAI,KAA0B;CAEhD,YAAY,SAAyC;AACnD,SAAO;AACP,OAAK,SAAS,IAAIC,eAAO,QAAQ,KAAK,EACpC,QAAQ,QAAQ,gBAAgB,EAAE,EACnC,CAAC;AACF,OAAK,OAAO,SAAS;;CAGvB,IAAI,SAAuD;EACzD,MAAM,EAAE,UAAU,OAAO,UAAU;AAGnC,MADiB,KAAK,QAAQ,IAAI,SAAS,EAC7B,UACZ,OAAM,IAAI,MAAM,yBAAyB;AAG3C,SAAO,IAAIC,iBAAY,aAAa;GAClC,MAAM,gBAA6B,EAAE;GAErC,MAAM,UAAU,KAAK,OAAO,QAAQ,SAAS,YAAY,EACvD,OAAO,MAAM,OACd,CAAC;GAEF,MAAM,QAAqB;IACzB;IACA,WAAW;IACX,eAAe;IACf;IACA;IACD;AACD,QAAK,QAAQ,IAAI,UAAU,MAAM;AAEjC,WACG,MAAM,CACN,QAAQ,YAAY;AACnB,SAAK,gBAAgB,SAAS,OAAO,SAAS,CAAC,UAAU,EACvD,gBAAgB,SAAS,UAAU,EACpC,CAAC;KACF,CACD,QAAQ,UAAU,SAAS;IAC1B,MAAM,aAAa;KACjB,MAAMC,wBAAU;KAChB,SAAS,2BAA2B,KAAK,UAAU,KAAK;KACxD,MAAM;KACP;AACD,aAAS,KAAK,WAAW;AACzB,kBAAc,KAAK,WAAW;AAC9B,SAAK,aAAa,SAAS;AAC3B,aAAS,UAAU;KACnB;AAEJ,gBAAa;AACX,SAAK,aAAa,SAAS;;IAE7B;;CAGJ,QAAQ,SAA2D;EACjE,MAAM,EAAE,aAAa;AAErB,SAAO,IAAID,iBAAY,aAAa;GAClC,MAAM,UAAU,KAAK,OAAO,QAAQ,SAAS,YAAY,EACvD,MAAM,WACP,CAAC;AAGF,WAAQ,GAAGE,6CAAsB,YAAuB;AACtD,aAAS,KAAK,QAAQ;AAEtB,QACE,QAAQ,SAASD,wBAAU,gBAC3B,QAAQ,SAASA,wBAAU,UAE3B,UAAS,UAAU;KAErB;AAEF,WACG,MAAM,CACN,QAAQ,YAAY;AAEnB,YAAQ,KAAKA,wBAAU,QAAQ;KAC7B,MAAMA,wBAAU;KAChB,MAAM;KACN,OAAO,EAAE,UAAU;KACpB,CAAC;KACF,CACD,QAAQ,eAAe;AACtB,aAAS,UAAU;KACnB;AAEJ,gBAAa;AACX,YAAQ,OAAO;;IAEjB;;CAGJ,UAAU,SAAwD;EAChE,MAAM,QAAQ,KAAK,QAAQ,IAAI,QAAQ,SAAS;AAChD,SAAO,QAAQ,QAAQ,OAAO,aAAa,MAAM;;CAGnD,KAAK,SAA+D;EAClE,MAAM,QAAQ,KAAK,QAAQ,IAAI,QAAQ,SAAS;AAChD,MAAI,CAAC,SAAS,CAAC,MAAM,aAAa,MAAM,cACtC,QAAO,QAAQ,QAAQ,MAAM;AAG/B,QAAM,gBAAgB;AAGtB,MAAI,MAAM,MACR,KAAI;AACF,SAAM,MAAM,UAAU;UAChB;AAKV,SAAO,QAAQ,QAAQ,KAAK;;CAG9B,AAAQ,gBACN,SACA,OACA,UACkB;EAClB,MAAM,EAAE,eAAe,YAAY;AAEnC,wBACE,QAAQ,MAAM,SAAS,QAAQ,OAAO,EACpC,UAAU,EAAE,YAAkC;AAC5C,iBAAc,KAAK,MAAM;AAGzB,WAAQ,KAAKC,4CAAqB,MAAM;KAE3C,CAAC,CACH,CAAC,qCACY,UAAU;GACpB,MAAM,aAAa;IACjB,MAAMD,wBAAU;IAChB,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;IAChE;AACD,iBAAc,KAAK,WAAW;AAC9B,WAAQ,KAAKC,4CAAqB,WAAW;AAC7C,UAAOC;IACP,qCACa;GACb,MAAM,yDAA6B,eAAe,EAChD,eAAe,MAAM,eACtB,CAAC;AACF,QAAK,MAAM,SAAS,SAClB,SAAQ,KAAKD,4CAAqB,MAAM;AAE1C,QAAK,aAAa,SAAS;IAC3B,CACH;;CAGH,AAAQ,aAAa,UAAwB;EAC3C,MAAM,QAAQ,KAAK,QAAQ,IAAI,SAAS;AACxC,MAAI,OAAO;AACT,SAAM,QAAQ,OAAO;AACrB,QAAK,QAAQ,OAAO,SAAS"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AgentRunner, AgentRunnerConnectRequest, AgentRunnerIsRunningRequest, AgentRunnerRunRequest, AgentRunnerStopRequest } from "./agent-runner.cjs";
|
|
2
|
+
import { BaseEvent } from "@ag-ui/client";
|
|
3
|
+
import { Observable } from "rxjs";
|
|
4
|
+
|
|
5
|
+
//#region src/runner/intelligence.d.ts
|
|
6
|
+
interface IntelligenceAgentRunnerOptions {
|
|
7
|
+
/** Phoenix websocket URL, e.g. "ws://localhost:4000/socket" */
|
|
8
|
+
url: string;
|
|
9
|
+
/** Optional params sent on socket connect (e.g. auth token) */
|
|
10
|
+
socketParams?: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
declare class IntelligenceAgentRunner extends AgentRunner {
|
|
13
|
+
private socket;
|
|
14
|
+
private threads;
|
|
15
|
+
constructor(options: IntelligenceAgentRunnerOptions);
|
|
16
|
+
run(request: AgentRunnerRunRequest): Observable<BaseEvent>;
|
|
17
|
+
connect(request: AgentRunnerConnectRequest): Observable<BaseEvent>;
|
|
18
|
+
isRunning(request: AgentRunnerIsRunningRequest): Promise<boolean>;
|
|
19
|
+
stop(request: AgentRunnerStopRequest): Promise<boolean | undefined>;
|
|
20
|
+
private executeAgentRun;
|
|
21
|
+
private removeThread;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { IntelligenceAgentRunner, IntelligenceAgentRunnerOptions };
|
|
25
|
+
//# sourceMappingURL=intelligence.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intelligence.d.cts","names":[],"sources":["../../src/runner/intelligence.ts"],"mappings":";;;;;UAaiB,8BAAA;;EAEf,GAAA;EAF6C;EAI7C,YAAA,GAAe,MAAA;AAAA;AAAA,cAWJ,uBAAA,SAAgC,WAAA;EAAA,QACnC,MAAA;EAAA,QACA,OAAA;cAEI,OAAA,EAAS,8BAAA;EAQrB,GAAA,CAAI,OAAA,EAAS,qBAAA,GAAwB,UAAA,CAAW,SAAA;EAiDhD,OAAA,CAAQ,OAAA,EAAS,yBAAA,GAA4B,UAAA,CAAW,SAAA;EAwCxD,SAAA,CAAU,OAAA,EAAS,2BAAA,GAA8B,OAAA;EAKjD,IAAA,CAAK,OAAA,EAAS,sBAAA,GAAyB,OAAA;EAAA,QAoB/B,eAAA;EAAA,QAsCA,YAAA;AAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AgentRunner, AgentRunnerConnectRequest, AgentRunnerIsRunningRequest, AgentRunnerRunRequest, AgentRunnerStopRequest } from "./agent-runner.mjs";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
import { BaseEvent } from "@ag-ui/client";
|
|
4
|
+
|
|
5
|
+
//#region src/runner/intelligence.d.ts
|
|
6
|
+
interface IntelligenceAgentRunnerOptions {
|
|
7
|
+
/** Phoenix websocket URL, e.g. "ws://localhost:4000/socket" */
|
|
8
|
+
url: string;
|
|
9
|
+
/** Optional params sent on socket connect (e.g. auth token) */
|
|
10
|
+
socketParams?: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
declare class IntelligenceAgentRunner extends AgentRunner {
|
|
13
|
+
private socket;
|
|
14
|
+
private threads;
|
|
15
|
+
constructor(options: IntelligenceAgentRunnerOptions);
|
|
16
|
+
run(request: AgentRunnerRunRequest): Observable<BaseEvent>;
|
|
17
|
+
connect(request: AgentRunnerConnectRequest): Observable<BaseEvent>;
|
|
18
|
+
isRunning(request: AgentRunnerIsRunningRequest): Promise<boolean>;
|
|
19
|
+
stop(request: AgentRunnerStopRequest): Promise<boolean | undefined>;
|
|
20
|
+
private executeAgentRun;
|
|
21
|
+
private removeThread;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { IntelligenceAgentRunner, IntelligenceAgentRunnerOptions };
|
|
25
|
+
//# sourceMappingURL=intelligence.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intelligence.d.mts","names":[],"sources":["../../src/runner/intelligence.ts"],"mappings":";;;;;UAaiB,8BAAA;;EAEf,GAAA;EAF6C;EAI7C,YAAA,GAAe,MAAA;AAAA;AAAA,cAWJ,uBAAA,SAAgC,WAAA;EAAA,QACnC,MAAA;EAAA,QACA,OAAA;cAEI,OAAA,EAAS,8BAAA;EAQrB,GAAA,CAAI,OAAA,EAAS,qBAAA,GAAwB,UAAA,CAAW,SAAA;EAiDhD,OAAA,CAAQ,OAAA,EAAS,yBAAA,GAA4B,UAAA,CAAW,SAAA;EAwCxD,SAAA,CAAU,OAAA,EAAS,2BAAA,GAA8B,OAAA;EAKjD,IAAA,CAAK,OAAA,EAAS,sBAAA,GAAyB,OAAA;EAAA,QAoB/B,eAAA;EAAA,QAsCA,YAAA;AAAA"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { AgentRunner } from "./agent-runner.mjs";
|
|
2
|
+
import { EMPTY, Observable, from } from "rxjs";
|
|
3
|
+
import { EventType } from "@ag-ui/client";
|
|
4
|
+
import { AG_UI_CHANNEL_EVENT, finalizeRunEvents } from "@copilotkitnext/shared";
|
|
5
|
+
import { catchError, finalize } from "rxjs/operators";
|
|
6
|
+
import { Socket } from "phoenix";
|
|
7
|
+
|
|
8
|
+
//#region src/runner/intelligence.ts
|
|
9
|
+
var IntelligenceAgentRunner = class extends AgentRunner {
|
|
10
|
+
socket;
|
|
11
|
+
threads = /* @__PURE__ */ new Map();
|
|
12
|
+
constructor(options) {
|
|
13
|
+
super();
|
|
14
|
+
this.socket = new Socket(options.url, { params: options.socketParams ?? {} });
|
|
15
|
+
this.socket.connect();
|
|
16
|
+
}
|
|
17
|
+
run(request) {
|
|
18
|
+
const { threadId, agent, input } = request;
|
|
19
|
+
if (this.threads.get(threadId)?.isRunning) throw new Error("Thread already running");
|
|
20
|
+
return new Observable((observer) => {
|
|
21
|
+
const currentEvents = [];
|
|
22
|
+
const channel = this.socket.channel(`agent:${threadId}`, { runId: input.runId });
|
|
23
|
+
const state = {
|
|
24
|
+
channel,
|
|
25
|
+
isRunning: true,
|
|
26
|
+
stopRequested: false,
|
|
27
|
+
agent,
|
|
28
|
+
currentEvents
|
|
29
|
+
};
|
|
30
|
+
this.threads.set(threadId, state);
|
|
31
|
+
channel.join().receive("ok", () => {
|
|
32
|
+
this.executeAgentRun(request, state, threadId).subscribe({ complete: () => observer.complete() });
|
|
33
|
+
}).receive("error", (resp) => {
|
|
34
|
+
const errorEvent = {
|
|
35
|
+
type: EventType.RUN_ERROR,
|
|
36
|
+
message: `Failed to join channel: ${JSON.stringify(resp)}`,
|
|
37
|
+
code: "CHANNEL_JOIN_ERROR"
|
|
38
|
+
};
|
|
39
|
+
observer.next(errorEvent);
|
|
40
|
+
currentEvents.push(errorEvent);
|
|
41
|
+
this.removeThread(threadId);
|
|
42
|
+
observer.complete();
|
|
43
|
+
});
|
|
44
|
+
return () => {
|
|
45
|
+
this.removeThread(threadId);
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
connect(request) {
|
|
50
|
+
const { threadId } = request;
|
|
51
|
+
return new Observable((observer) => {
|
|
52
|
+
const channel = this.socket.channel(`agent:${threadId}`, { mode: "connect" });
|
|
53
|
+
channel.on(AG_UI_CHANNEL_EVENT, (payload) => {
|
|
54
|
+
observer.next(payload);
|
|
55
|
+
if (payload.type === EventType.RUN_FINISHED || payload.type === EventType.RUN_ERROR) observer.complete();
|
|
56
|
+
});
|
|
57
|
+
channel.join().receive("ok", () => {
|
|
58
|
+
channel.push(EventType.CUSTOM, {
|
|
59
|
+
type: EventType.CUSTOM,
|
|
60
|
+
name: "connect",
|
|
61
|
+
value: { threadId }
|
|
62
|
+
});
|
|
63
|
+
}).receive("error", () => {
|
|
64
|
+
observer.complete();
|
|
65
|
+
});
|
|
66
|
+
return () => {
|
|
67
|
+
channel.leave();
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
isRunning(request) {
|
|
72
|
+
const state = this.threads.get(request.threadId);
|
|
73
|
+
return Promise.resolve(state?.isRunning ?? false);
|
|
74
|
+
}
|
|
75
|
+
stop(request) {
|
|
76
|
+
const state = this.threads.get(request.threadId);
|
|
77
|
+
if (!state || !state.isRunning || state.stopRequested) return Promise.resolve(false);
|
|
78
|
+
state.stopRequested = true;
|
|
79
|
+
if (state.agent) try {
|
|
80
|
+
state.agent.abortRun();
|
|
81
|
+
} catch {}
|
|
82
|
+
return Promise.resolve(true);
|
|
83
|
+
}
|
|
84
|
+
executeAgentRun(request, state, threadId) {
|
|
85
|
+
const { currentEvents, channel } = state;
|
|
86
|
+
return from(request.agent.runAgent(request.input, { onEvent: ({ event }) => {
|
|
87
|
+
currentEvents.push(event);
|
|
88
|
+
channel.push(AG_UI_CHANNEL_EVENT, event);
|
|
89
|
+
} })).pipe(catchError((error) => {
|
|
90
|
+
const errorEvent = {
|
|
91
|
+
type: EventType.RUN_ERROR,
|
|
92
|
+
message: error instanceof Error ? error.message : String(error)
|
|
93
|
+
};
|
|
94
|
+
currentEvents.push(errorEvent);
|
|
95
|
+
channel.push(AG_UI_CHANNEL_EVENT, errorEvent);
|
|
96
|
+
return EMPTY;
|
|
97
|
+
}), finalize(() => {
|
|
98
|
+
const appended = finalizeRunEvents(currentEvents, { stopRequested: state.stopRequested });
|
|
99
|
+
for (const event of appended) channel.push(AG_UI_CHANNEL_EVENT, event);
|
|
100
|
+
this.removeThread(threadId);
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
removeThread(threadId) {
|
|
104
|
+
const state = this.threads.get(threadId);
|
|
105
|
+
if (state) {
|
|
106
|
+
state.channel.leave();
|
|
107
|
+
this.threads.delete(threadId);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
//#endregion
|
|
113
|
+
export { IntelligenceAgentRunner };
|
|
114
|
+
//# sourceMappingURL=intelligence.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intelligence.mjs","names":[],"sources":["../../src/runner/intelligence.ts"],"sourcesContent":["import {\n AgentRunner,\n AgentRunnerConnectRequest,\n AgentRunnerIsRunningRequest,\n AgentRunnerRunRequest,\n type AgentRunnerStopRequest,\n} from \"./agent-runner\";\nimport { EMPTY, Observable, from } from \"rxjs\";\nimport { catchError, finalize } from \"rxjs/operators\";\nimport { AbstractAgent, BaseEvent, EventType } from \"@ag-ui/client\";\nimport { finalizeRunEvents, AG_UI_CHANNEL_EVENT } from \"@copilotkitnext/shared\";\nimport { Socket, Channel } from \"phoenix\";\n\nexport interface IntelligenceAgentRunnerOptions {\n /** Phoenix websocket URL, e.g. \"ws://localhost:4000/socket\" */\n url: string;\n /** Optional params sent on socket connect (e.g. auth token) */\n socketParams?: Record<string, string>;\n}\n\ninterface ThreadState {\n channel: Channel;\n isRunning: boolean;\n stopRequested: boolean;\n agent: AbstractAgent | null;\n currentEvents: BaseEvent[];\n}\n\nexport class IntelligenceAgentRunner extends AgentRunner {\n private socket: Socket;\n private threads = new Map<string, ThreadState>();\n\n constructor(options: IntelligenceAgentRunnerOptions) {\n super();\n this.socket = new Socket(options.url, {\n params: options.socketParams ?? {},\n });\n this.socket.connect();\n }\n\n run(request: AgentRunnerRunRequest): Observable<BaseEvent> {\n const { threadId, agent, input } = request;\n\n const existing = this.threads.get(threadId);\n if (existing?.isRunning) {\n throw new Error(\"Thread already running\");\n }\n\n return new Observable((observer) => {\n const currentEvents: BaseEvent[] = [];\n\n const channel = this.socket.channel(`agent:${threadId}`, {\n runId: input.runId,\n });\n\n const state: ThreadState = {\n channel,\n isRunning: true,\n stopRequested: false,\n agent,\n currentEvents,\n };\n this.threads.set(threadId, state);\n\n channel\n .join()\n .receive(\"ok\", () => {\n this.executeAgentRun(request, state, threadId).subscribe({\n complete: () => observer.complete(),\n });\n })\n .receive(\"error\", (resp) => {\n const errorEvent = {\n type: EventType.RUN_ERROR,\n message: `Failed to join channel: ${JSON.stringify(resp)}`,\n code: \"CHANNEL_JOIN_ERROR\",\n } as BaseEvent;\n observer.next(errorEvent);\n currentEvents.push(errorEvent);\n this.removeThread(threadId);\n observer.complete();\n });\n\n return () => {\n this.removeThread(threadId);\n };\n });\n }\n\n connect(request: AgentRunnerConnectRequest): Observable<BaseEvent> {\n const { threadId } = request;\n\n return new Observable((observer) => {\n const channel = this.socket.channel(`agent:${threadId}`, {\n mode: \"connect\",\n });\n\n // Listen for AG-UI events on a single channel event name.\n channel.on(AG_UI_CHANNEL_EVENT, (payload: BaseEvent) => {\n observer.next(payload);\n\n if (\n payload.type === EventType.RUN_FINISHED ||\n payload.type === EventType.RUN_ERROR\n ) {\n observer.complete();\n }\n });\n\n channel\n .join()\n .receive(\"ok\", () => {\n // Ask the server to replay history via a CUSTOM event.\n channel.push(EventType.CUSTOM, {\n type: EventType.CUSTOM,\n name: \"connect\",\n value: { threadId },\n });\n })\n .receive(\"error\", () => {\n observer.complete();\n });\n\n return () => {\n channel.leave();\n };\n });\n }\n\n isRunning(request: AgentRunnerIsRunningRequest): Promise<boolean> {\n const state = this.threads.get(request.threadId);\n return Promise.resolve(state?.isRunning ?? false);\n }\n\n stop(request: AgentRunnerStopRequest): Promise<boolean | undefined> {\n const state = this.threads.get(request.threadId);\n if (!state || !state.isRunning || state.stopRequested) {\n return Promise.resolve(false);\n }\n\n state.stopRequested = true;\n\n // Direct local abort — the runtime is the authority.\n if (state.agent) {\n try {\n state.agent.abortRun();\n } catch {\n // Ignore abort errors.\n }\n }\n\n return Promise.resolve(true);\n }\n\n private executeAgentRun(\n request: AgentRunnerRunRequest,\n state: ThreadState,\n threadId: string,\n ): Observable<void> {\n const { currentEvents, channel } = state;\n\n return from(\n request.agent.runAgent(request.input, {\n onEvent: ({ event }: { event: BaseEvent }) => {\n currentEvents.push(event);\n\n // Push to Phoenix channel so frontend WS listeners receive it.\n channel.push(AG_UI_CHANNEL_EVENT, event);\n },\n }),\n ).pipe(\n catchError((error) => {\n const errorEvent = {\n type: EventType.RUN_ERROR,\n message: error instanceof Error ? error.message : String(error),\n } as BaseEvent;\n currentEvents.push(errorEvent);\n channel.push(AG_UI_CHANNEL_EVENT, errorEvent);\n return EMPTY;\n }),\n finalize(() => {\n const appended = finalizeRunEvents(currentEvents, {\n stopRequested: state.stopRequested,\n });\n for (const event of appended) {\n channel.push(AG_UI_CHANNEL_EVENT, event);\n }\n this.removeThread(threadId);\n }),\n );\n }\n\n private removeThread(threadId: string): void {\n const state = this.threads.get(threadId);\n if (state) {\n state.channel.leave();\n this.threads.delete(threadId);\n }\n }\n}\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilotkitnext/runtime",
|
|
3
|
-
"version": "1.52.2-next.
|
|
3
|
+
"version": "1.52.2-next.2",
|
|
4
4
|
"description": "Server-side runtime package for CopilotKit2",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"types": "./dist/index.d.cts",
|
|
@@ -23,29 +23,32 @@
|
|
|
23
23
|
"@types/cors": "^2.8.17",
|
|
24
24
|
"@types/express": "^4.17.21",
|
|
25
25
|
"@types/node": "^22.15.3",
|
|
26
|
+
"@types/phoenix": "^1.6.6",
|
|
26
27
|
"eslint": "^9.30.0",
|
|
27
28
|
"supertest": "^7.1.1",
|
|
28
29
|
"tsdown": "^0.20.3",
|
|
29
30
|
"typescript": "5.8.2",
|
|
30
31
|
"vitest": "^3.0.5",
|
|
31
|
-
"@copilotkitnext/eslint-config": "1.52.2-next.
|
|
32
|
-
"@copilotkitnext/typescript-config": "1.52.2-next.
|
|
32
|
+
"@copilotkitnext/eslint-config": "1.52.2-next.2",
|
|
33
|
+
"@copilotkitnext/typescript-config": "1.52.2-next.2"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
36
|
"@ag-ui/client": "0.0.46",
|
|
36
37
|
"@ag-ui/core": "0.0.46",
|
|
37
38
|
"@ag-ui/encoder": "0.0.46",
|
|
38
39
|
"cors": "^2.8.5",
|
|
40
|
+
"phoenix": "^1.8.4",
|
|
41
|
+
"ws": "^8.18.0",
|
|
39
42
|
"express": "^4.21.2",
|
|
40
43
|
"hono": "^4.11.4",
|
|
41
44
|
"rxjs": "7.8.1",
|
|
42
|
-
"@copilotkitnext/shared": "1.52.2-next.
|
|
45
|
+
"@copilotkitnext/shared": "1.52.2-next.2"
|
|
43
46
|
},
|
|
44
47
|
"peerDependencies": {
|
|
45
48
|
"@ag-ui/client": "0.0.46",
|
|
46
49
|
"@ag-ui/core": "0.0.46",
|
|
47
50
|
"@ag-ui/encoder": "0.0.46",
|
|
48
|
-
"@copilotkitnext/shared": "1.52.2-next.
|
|
51
|
+
"@copilotkitnext/shared": "1.52.2-next.2"
|
|
49
52
|
},
|
|
50
53
|
"peerDependenciesMeta": {},
|
|
51
54
|
"engines": {
|