@mozaik-ai/core 3.9.0 → 3.9.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/README.md +6 -0
- package/dist/index.d.mts +27 -11
- package/dist/index.d.ts +27 -11
- package/dist/index.js +42 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -352,6 +352,12 @@ agent.join(new AgenticEnvironment())
|
|
|
352
352
|
|
|
353
353
|
---
|
|
354
354
|
|
|
355
|
+
## Examples
|
|
356
|
+
|
|
357
|
+
Working examples are available here: [mozaik-examples](https://github.com/jigjoy-ai/mozaik-examples).
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
355
361
|
## Made with Mozaik
|
|
356
362
|
|
|
357
363
|
- **[baro](https://github.com/Lotus015/baro)** — a Claude agent orchestrator where ten specialized participants (planner, executors, reviewer, fixer, librarian, auditor, and more) work fully concurrently on the same goal, like a team collaborating in real time instead of a single agent doing everything alone.
|
package/dist/index.d.mts
CHANGED
|
@@ -313,10 +313,10 @@ declare abstract class Participant {
|
|
|
313
313
|
leave(environment: AgenticEnvironment): void;
|
|
314
314
|
protected isJoinedTo(environment: AgenticEnvironment): boolean;
|
|
315
315
|
getEnvironments(): AgenticEnvironment[];
|
|
316
|
-
abstract onParticipantJoined(participant: Participant
|
|
317
|
-
abstract onParticipantLeft(participant: Participant
|
|
318
|
-
abstract onJoined(
|
|
319
|
-
abstract onLeft(
|
|
316
|
+
abstract onParticipantJoined(participant: Participant): Promise<void> | void;
|
|
317
|
+
abstract onParticipantLeft(participant: Participant): Promise<void> | void;
|
|
318
|
+
abstract onJoined(): Promise<void> | void;
|
|
319
|
+
abstract onLeft(): Promise<void> | void;
|
|
320
320
|
abstract onFunctionCall(item: FunctionCallItem): Promise<void> | void;
|
|
321
321
|
abstract onExternalFunctionCall(source: Participant, item: FunctionCallItem): Promise<void> | void;
|
|
322
322
|
abstract onFunctionCallOutput(item: FunctionCallOutputItem): Promise<void> | void;
|
|
@@ -355,8 +355,8 @@ declare class BaseAgentParticipant extends Participant implements InputCapable,
|
|
|
355
355
|
private inferenceRunner;
|
|
356
356
|
private functionCallRunner;
|
|
357
357
|
constructor(inputSource: InputStream, inferenceRunner: InferenceRunner, functionCallRunner: FunctionCallRunner);
|
|
358
|
-
onJoined(
|
|
359
|
-
onLeft(
|
|
358
|
+
onJoined(): void;
|
|
359
|
+
onLeft(): void;
|
|
360
360
|
onParticipantJoined(participant: Participant): void;
|
|
361
361
|
onParticipantLeft(participant: Participant): void;
|
|
362
362
|
onFunctionCall(item: FunctionCallItem): void;
|
|
@@ -376,10 +376,10 @@ declare class BaseAgentParticipant extends Participant implements InputCapable,
|
|
|
376
376
|
declare class BaseHumanParticipant extends Participant implements InputCapable {
|
|
377
377
|
private inputSource;
|
|
378
378
|
constructor(inputSource: InputStream);
|
|
379
|
-
onJoined(
|
|
380
|
-
onLeft(
|
|
381
|
-
onParticipantJoined(participant: Participant
|
|
382
|
-
onParticipantLeft(participant: Participant
|
|
379
|
+
onJoined(): void;
|
|
380
|
+
onLeft(): void;
|
|
381
|
+
onParticipantJoined(participant: Participant): void;
|
|
382
|
+
onParticipantLeft(participant: Participant): void;
|
|
383
383
|
onMessage(message: string): void;
|
|
384
384
|
onFunctionCall(item: FunctionCallItem): void;
|
|
385
385
|
onFunctionCallOutput(item: FunctionCallOutputItem): void;
|
|
@@ -422,4 +422,20 @@ declare class Gpt55 implements GenerativeModel, ReasoningEffort<OpenAIReasoningE
|
|
|
422
422
|
getReasoningEffort(): OpenAIReasoningEffortType;
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
-
|
|
425
|
+
declare class BaseObserverParticipant extends Participant {
|
|
426
|
+
onFunctionCall(item: FunctionCallItem): void;
|
|
427
|
+
onExternalFunctionCall(source: Participant, item: FunctionCallItem): void;
|
|
428
|
+
onFunctionCallOutput(item: FunctionCallOutputItem): void;
|
|
429
|
+
onExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem): void;
|
|
430
|
+
onReasoning(item: ReasoningItem): void;
|
|
431
|
+
onExternalReasoning(source: Participant, item: ReasoningItem): void;
|
|
432
|
+
onModelMessage(item: ModelMessageItem): void;
|
|
433
|
+
onExternalModelMessage(source: Participant, item: ModelMessageItem): void;
|
|
434
|
+
onMessage(message: string): void;
|
|
435
|
+
onJoined(): void;
|
|
436
|
+
onLeft(): void;
|
|
437
|
+
onParticipantJoined(participant: Participant): void;
|
|
438
|
+
onParticipantLeft(participant: Participant): void;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export { AgenticEnvironment, BaseAgentParticipant, BaseHumanParticipant, BaseObserverParticipant, ContextItem, DefaultFunctionCallRunner, DeveloperMessageItem, FunctionCallItem, FunctionCallOutputItem, type FunctionCallRunner, type GenerativeModel, Gpt54, Gpt54Mini, Gpt54Nano, Gpt55, InMemoryModelContextRepository, InferenceRequest, InferenceResponse, type InferenceRunner, type InputStream, InputTokenDetails, ModelContext, type ModelContextRepository, ModelMessageItem, OpenAIInferenceRunner, OpenAIResponses, OutputTokenDetails, Participant, ReasoningItem, SystemMessageItem, TokenUsage, type Tool, UserMessageItem };
|
package/dist/index.d.ts
CHANGED
|
@@ -313,10 +313,10 @@ declare abstract class Participant {
|
|
|
313
313
|
leave(environment: AgenticEnvironment): void;
|
|
314
314
|
protected isJoinedTo(environment: AgenticEnvironment): boolean;
|
|
315
315
|
getEnvironments(): AgenticEnvironment[];
|
|
316
|
-
abstract onParticipantJoined(participant: Participant
|
|
317
|
-
abstract onParticipantLeft(participant: Participant
|
|
318
|
-
abstract onJoined(
|
|
319
|
-
abstract onLeft(
|
|
316
|
+
abstract onParticipantJoined(participant: Participant): Promise<void> | void;
|
|
317
|
+
abstract onParticipantLeft(participant: Participant): Promise<void> | void;
|
|
318
|
+
abstract onJoined(): Promise<void> | void;
|
|
319
|
+
abstract onLeft(): Promise<void> | void;
|
|
320
320
|
abstract onFunctionCall(item: FunctionCallItem): Promise<void> | void;
|
|
321
321
|
abstract onExternalFunctionCall(source: Participant, item: FunctionCallItem): Promise<void> | void;
|
|
322
322
|
abstract onFunctionCallOutput(item: FunctionCallOutputItem): Promise<void> | void;
|
|
@@ -355,8 +355,8 @@ declare class BaseAgentParticipant extends Participant implements InputCapable,
|
|
|
355
355
|
private inferenceRunner;
|
|
356
356
|
private functionCallRunner;
|
|
357
357
|
constructor(inputSource: InputStream, inferenceRunner: InferenceRunner, functionCallRunner: FunctionCallRunner);
|
|
358
|
-
onJoined(
|
|
359
|
-
onLeft(
|
|
358
|
+
onJoined(): void;
|
|
359
|
+
onLeft(): void;
|
|
360
360
|
onParticipantJoined(participant: Participant): void;
|
|
361
361
|
onParticipantLeft(participant: Participant): void;
|
|
362
362
|
onFunctionCall(item: FunctionCallItem): void;
|
|
@@ -376,10 +376,10 @@ declare class BaseAgentParticipant extends Participant implements InputCapable,
|
|
|
376
376
|
declare class BaseHumanParticipant extends Participant implements InputCapable {
|
|
377
377
|
private inputSource;
|
|
378
378
|
constructor(inputSource: InputStream);
|
|
379
|
-
onJoined(
|
|
380
|
-
onLeft(
|
|
381
|
-
onParticipantJoined(participant: Participant
|
|
382
|
-
onParticipantLeft(participant: Participant
|
|
379
|
+
onJoined(): void;
|
|
380
|
+
onLeft(): void;
|
|
381
|
+
onParticipantJoined(participant: Participant): void;
|
|
382
|
+
onParticipantLeft(participant: Participant): void;
|
|
383
383
|
onMessage(message: string): void;
|
|
384
384
|
onFunctionCall(item: FunctionCallItem): void;
|
|
385
385
|
onFunctionCallOutput(item: FunctionCallOutputItem): void;
|
|
@@ -422,4 +422,20 @@ declare class Gpt55 implements GenerativeModel, ReasoningEffort<OpenAIReasoningE
|
|
|
422
422
|
getReasoningEffort(): OpenAIReasoningEffortType;
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
-
|
|
425
|
+
declare class BaseObserverParticipant extends Participant {
|
|
426
|
+
onFunctionCall(item: FunctionCallItem): void;
|
|
427
|
+
onExternalFunctionCall(source: Participant, item: FunctionCallItem): void;
|
|
428
|
+
onFunctionCallOutput(item: FunctionCallOutputItem): void;
|
|
429
|
+
onExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem): void;
|
|
430
|
+
onReasoning(item: ReasoningItem): void;
|
|
431
|
+
onExternalReasoning(source: Participant, item: ReasoningItem): void;
|
|
432
|
+
onModelMessage(item: ModelMessageItem): void;
|
|
433
|
+
onExternalModelMessage(source: Participant, item: ModelMessageItem): void;
|
|
434
|
+
onMessage(message: string): void;
|
|
435
|
+
onJoined(): void;
|
|
436
|
+
onLeft(): void;
|
|
437
|
+
onParticipantJoined(participant: Participant): void;
|
|
438
|
+
onParticipantLeft(participant: Participant): void;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export { AgenticEnvironment, BaseAgentParticipant, BaseHumanParticipant, BaseObserverParticipant, ContextItem, DefaultFunctionCallRunner, DeveloperMessageItem, FunctionCallItem, FunctionCallOutputItem, type FunctionCallRunner, type GenerativeModel, Gpt54, Gpt54Mini, Gpt54Nano, Gpt55, InMemoryModelContextRepository, InferenceRequest, InferenceResponse, type InferenceRunner, type InputStream, InputTokenDetails, ModelContext, type ModelContextRepository, ModelMessageItem, OpenAIInferenceRunner, OpenAIResponses, OutputTokenDetails, Participant, ReasoningItem, SystemMessageItem, TokenUsage, type Tool, UserMessageItem };
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(index_exports, {
|
|
|
33
33
|
AgenticEnvironment: () => AgenticEnvironment,
|
|
34
34
|
BaseAgentParticipant: () => BaseAgentParticipant,
|
|
35
35
|
BaseHumanParticipant: () => BaseHumanParticipant,
|
|
36
|
+
BaseObserverParticipant: () => BaseObserverParticipant,
|
|
36
37
|
ContextItem: () => ContextItem,
|
|
37
38
|
DefaultFunctionCallRunner: () => DefaultFunctionCallRunner,
|
|
38
39
|
DeveloperMessageItem: () => DeveloperMessageItem,
|
|
@@ -612,9 +613,9 @@ var AgenticEnvironment = class {
|
|
|
612
613
|
this.subscribers.push(subscriber);
|
|
613
614
|
for (const subscriber2 of this.subscribers) {
|
|
614
615
|
if (subscriber2 === subscriber2) {
|
|
615
|
-
subscriber2.onJoined(
|
|
616
|
+
subscriber2.onJoined();
|
|
616
617
|
} else {
|
|
617
|
-
subscriber2.onParticipantJoined(subscriber2
|
|
618
|
+
subscriber2.onParticipantJoined(subscriber2);
|
|
618
619
|
}
|
|
619
620
|
}
|
|
620
621
|
}
|
|
@@ -622,9 +623,9 @@ var AgenticEnvironment = class {
|
|
|
622
623
|
this.subscribers = this.subscribers.filter((p) => p !== subscriber);
|
|
623
624
|
for (const subscriber2 of this.subscribers) {
|
|
624
625
|
if (subscriber2 === subscriber2) {
|
|
625
|
-
subscriber2.onLeft(
|
|
626
|
+
subscriber2.onLeft();
|
|
626
627
|
} else {
|
|
627
|
-
subscriber2.onParticipantLeft(subscriber2
|
|
628
|
+
subscriber2.onParticipantLeft(subscriber2);
|
|
628
629
|
}
|
|
629
630
|
}
|
|
630
631
|
}
|
|
@@ -690,9 +691,9 @@ var BaseAgentParticipant = class extends Participant {
|
|
|
690
691
|
this.inferenceRunner = inferenceRunner;
|
|
691
692
|
this.functionCallRunner = functionCallRunner;
|
|
692
693
|
}
|
|
693
|
-
onJoined(
|
|
694
|
+
onJoined() {
|
|
694
695
|
}
|
|
695
|
-
onLeft(
|
|
696
|
+
onLeft() {
|
|
696
697
|
}
|
|
697
698
|
onParticipantJoined(participant) {
|
|
698
699
|
}
|
|
@@ -751,13 +752,13 @@ var BaseHumanParticipant = class extends Participant {
|
|
|
751
752
|
super();
|
|
752
753
|
this.inputSource = inputSource;
|
|
753
754
|
}
|
|
754
|
-
onJoined(
|
|
755
|
+
onJoined() {
|
|
755
756
|
}
|
|
756
|
-
onLeft(
|
|
757
|
+
onLeft() {
|
|
757
758
|
}
|
|
758
|
-
onParticipantJoined(participant
|
|
759
|
+
onParticipantJoined(participant) {
|
|
759
760
|
}
|
|
760
|
-
onParticipantLeft(participant
|
|
761
|
+
onParticipantLeft(participant) {
|
|
761
762
|
}
|
|
762
763
|
onMessage(message) {
|
|
763
764
|
}
|
|
@@ -842,11 +843,42 @@ var Gpt55 = class {
|
|
|
842
843
|
return this.effort.getReasoningEffort();
|
|
843
844
|
}
|
|
844
845
|
};
|
|
846
|
+
|
|
847
|
+
// src/application/observer.ts
|
|
848
|
+
var BaseObserverParticipant = class extends Participant {
|
|
849
|
+
onFunctionCall(item) {
|
|
850
|
+
}
|
|
851
|
+
onExternalFunctionCall(source, item) {
|
|
852
|
+
}
|
|
853
|
+
onFunctionCallOutput(item) {
|
|
854
|
+
}
|
|
855
|
+
onExternalFunctionCallOutput(source, item) {
|
|
856
|
+
}
|
|
857
|
+
onReasoning(item) {
|
|
858
|
+
}
|
|
859
|
+
onExternalReasoning(source, item) {
|
|
860
|
+
}
|
|
861
|
+
onModelMessage(item) {
|
|
862
|
+
}
|
|
863
|
+
onExternalModelMessage(source, item) {
|
|
864
|
+
}
|
|
865
|
+
onMessage(message) {
|
|
866
|
+
}
|
|
867
|
+
onJoined() {
|
|
868
|
+
}
|
|
869
|
+
onLeft() {
|
|
870
|
+
}
|
|
871
|
+
onParticipantJoined(participant) {
|
|
872
|
+
}
|
|
873
|
+
onParticipantLeft(participant) {
|
|
874
|
+
}
|
|
875
|
+
};
|
|
845
876
|
// Annotate the CommonJS export names for ESM import in node:
|
|
846
877
|
0 && (module.exports = {
|
|
847
878
|
AgenticEnvironment,
|
|
848
879
|
BaseAgentParticipant,
|
|
849
880
|
BaseHumanParticipant,
|
|
881
|
+
BaseObserverParticipant,
|
|
850
882
|
ContextItem,
|
|
851
883
|
DefaultFunctionCallRunner,
|
|
852
884
|
DeveloperMessageItem,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/domain/model-context/model-context.ts","../src/domain/model-context/context-item/context-item.ts","../src/domain/model-context/context-item/item-content/item-content.ts","../src/domain/model-context/context-item/item-content/input-text.ts","../src/domain/model-context/context-item/client-item/user-message.ts","../src/domain/model-context/context-item/client-item/developer-message.ts","../src/domain/model-context/context-item/item-content/output-text.ts","../src/domain/model-context/context-item/model-item/model-message.ts","../src/domain/model-context/context-item/model-item/function-call.ts","../src/domain/model-context/context-item/model-item/reasoning.ts","../src/domain/model-context/context-item/client-item/function-call-output.ts","../src/domain/generative-model/inference-response.ts","../src/domain/generative-model/token-usage.ts","../src/infrastructure/providers/openai/runtime/openai-responses.ts","../src/domain/generative-model/inference-request.ts","../src/infrastructure/providers/openai/reasoning-effort.ts","../src/infrastructure/providers/openai/models/gpt-5-4-nano.ts","../src/infrastructure/providers/openai/models/gpt-5-4.ts","../src/infrastructure/providers/openai/models/gpt-5-4-mini.ts","../src/infrastructure/repository/in-memory-model-context-repository.ts","../src/domain/model-context/context-item/client-item/system-message.ts","../src/domain/agentic-environment/participant.ts","../src/domain/agentic-environment/agentic-environment.ts","../src/application/agent.ts","../src/application/human.ts","../src/application/openai-inference-runner.ts","../src/application/function-call-runner.ts","../src/infrastructure/providers/openai/models/gpt-5-5.ts"],"sourcesContent":["import { ModelContext } from \"@domain/model-context/model-context\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { UserMessageItem } from \"@domain/model-context/context-item/client-item/user-message\"\nimport { DeveloperMessageItem } from \"@domain/model-context/context-item/client-item/developer-message\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { ModelContextRepository } from \"@domain/model-context/model-context-repository\"\nimport { OpenAIResponses } from \"@infra/providers/openai/runtime/openai-responses\"\nimport { InferenceRequest } from \"@domain/generative-model/inference-request\"\nimport { Gpt54Nano } from \"@infra/providers/openai/models/gpt-5-4-nano\"\nimport { Gpt54 } from \"@infra/providers/openai/models/gpt-5-4\"\nimport { Gpt54Mini } from \"@infra/providers/openai/models/gpt-5-4-mini\"\nimport { InferenceResponse } from \"@domain/generative-model/inference-response\"\nimport { InputTokenDetails, OutputTokenDetails, TokenUsage } from \"@domain/generative-model/token-usage\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { InMemoryModelContextRepository } from \"@infra/repository/in-memory-model-context-repository\"\nimport { SystemMessageItem } from \"@domain/model-context/context-item/client-item/system-message\"\nimport { Participant } from \"@domain/agentic-environment/participant\"\nimport { AgenticEnvironment } from \"@domain/agentic-environment/agentic-environment\"\nimport { BaseAgentParticipant } from \"@app/agent\"\nimport { BaseHumanParticipant } from \"@app/human\"\nimport { FunctionCallRunner } from \"@domain/agentic-environment/function-call-runner\"\nimport { InferenceRunner } from \"@domain/agentic-environment/inference-runner\"\nimport { InputStream } from \"@domain/agentic-environment/input-stream\"\nimport { OpenAIInferenceRunner } from \"@app/openai-inference-runner\"\nimport { DefaultFunctionCallRunner } from \"@app/function-call-runner\"\nimport { Gpt55 } from \"@infra/providers/openai/models/gpt-5-5\"\n\nexport {\n\tModelContext,\n\tModelContextRepository,\n\tInMemoryModelContextRepository,\n\tContextItem,\n\tUserMessageItem,\n\tDeveloperMessageItem,\n\tSystemMessageItem,\n\tModelMessageItem,\n\tFunctionCallItem,\n\tFunctionCallOutputItem,\n\tReasoningItem,\n\tGenerativeModel,\n\tOpenAIResponses,\n\tGpt54,\n\tGpt54Mini,\n\tGpt54Nano,\n\tGpt55,\n\tInferenceRequest,\n\tInferenceResponse,\n\tTokenUsage,\n\tInputTokenDetails,\n\tOutputTokenDetails,\n\tTool,\n\tFunctionCallRunner,\n\tInferenceRunner,\n\tDefaultFunctionCallRunner,\n\tInputStream,\n\tAgenticEnvironment,\n\tParticipant,\n\tBaseAgentParticipant,\n\tBaseHumanParticipant,\n\tOpenAIInferenceRunner,\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class ModelContext {\n\treadonly id: string\n\treadonly projectId: string\n\treadonly items: ContextItem[]\n\n\tconstructor(id: string, projectId: string, items: ContextItem[]) {\n\t\tthis.projectId = projectId\n\t\tthis.id = id\n\t\tthis.items = items\n\t}\n\n\taddContextItem(item: ContextItem): ModelContext {\n\t\tthis.items.push(item)\n\t\treturn this\n\t}\n\n\tapplyModelOutput(items: ContextItem[]): ModelContext {\n\t\tfor (const item of items) {\n\t\t\tconst itemType = item.getType()\n\t\t\tif (itemType !== \"function_call\" && itemType !== \"message\" && itemType !== \"reasoning\") {\n\t\t\t\tthrow new Error(`Invalid item type: ${itemType}`)\n\t\t\t}\n\t\t}\n\t\tthis.items.push(...items)\n\t\treturn this\n\t}\n\n\tgetItems(): ContextItem[] {\n\t\treturn this.items\n\t}\n\n\tgetLastItem(): ContextItem {\n\t\tif (this.items.length === 0) {\n\t\t\tthrow new Error(\"No items in context\")\n\t\t}\n\t\treturn this.items[this.items.length - 1]\n\t}\n\n\tstatic create(projectId: string): ModelContext {\n\t\tconst id = crypto.randomUUID()\n\t\treturn new ModelContext(id, projectId, [])\n\t}\n\n\tstatic rehydrate(data: { id: string; projectId: string; items: ContextItem[] }): ModelContext {\n\t\treturn new ModelContext(data.id, data.projectId, data.items)\n\t}\n\n\ttoJSON(): any {\n\t\treturn this.items.map((item) => item.toJSON())\n\t}\n}\n","export abstract class ContextItem {\n\tabstract readonly type: string\n\n\tgetType(): string {\n\t\treturn this.type\n\t}\n\n\tabstract toJSON(): any\n}\n","export abstract class ItemContent {\n\tabstract readonly type: string\n}\n","import { ItemContent } from \"@domain/model-context/context-item/item-content/item-content\"\n\nexport class InputText extends ItemContent {\n\treadonly type = \"input_text\"\n\n\tprivate constructor(public readonly text: string) {\n\t\tsuper()\n\t}\n\n\tstatic create(text: string): InputText {\n\t\treturn new InputText(text)\n\t}\n\n\tstatic rehydrate(data: { text: string }): InputText {\n\t\treturn new InputText(data.text)\n\t}\n\n\ttoJSON(): any[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttype: this.type,\n\t\t\t\ttext: this.text,\n\t\t\t},\n\t\t]\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\n\nexport class UserMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"user\"\n\treadonly content: InputText\n\n\tprivate constructor(content: InputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\tstatic create(text: string): UserMessageItem {\n\t\tconst content = InputText.create(text)\n\t\treturn new UserMessageItem(content)\n\t}\n\n\tstatic rehydrate(data: { text: string }): UserMessageItem {\n\t\tconst content = InputText.rehydrate(data)\n\t\treturn new UserMessageItem(content)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n}\n","import { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class DeveloperMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"developer\"\n\treadonly content: InputText\n\n\tprivate constructor(content: InputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n\n\tstatic create(text: string): DeveloperMessageItem {\n\t\tconst content = InputText.create(text)\n\t\treturn new DeveloperMessageItem(content)\n\t}\n\n\tstatic rehydrate(data: { text: string }): DeveloperMessageItem {\n\t\tconst content = InputText.rehydrate(data)\n\t\treturn new DeveloperMessageItem(content)\n\t}\n}\n","import { ItemContent } from \"@domain/model-context/context-item/item-content/item-content\"\n\nexport class OutputText extends ItemContent {\n\treadonly type = \"output_text\"\n\n\tprivate constructor(public readonly text: string) {\n\t\tsuper()\n\t}\n\n\tstatic rehydrate(data: { text: string }): OutputText {\n\t\treturn new OutputText(data.text)\n\t}\n\n\ttoJSON(): any[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttype: this.type,\n\t\t\t\ttext: this.text,\n\t\t\t},\n\t\t]\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { OutputText } from \"@domain/model-context/context-item/item-content/output-text\"\n\nexport class ModelMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"assistant\"\n\treadonly content: OutputText\n\n\tprivate constructor(content: OutputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\tstatic rehydrate(data: { text: string }): ModelMessageItem {\n\t\tconst content = OutputText.rehydrate(data)\n\t\treturn new ModelMessageItem(content)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class FunctionCallItem extends ContextItem {\n\treadonly type = \"function_call\"\n\treadonly callId: string\n\treadonly name: string\n\treadonly args: string\n\n\tprivate constructor(callId: string, name: string, args: string) {\n\t\tsuper()\n\t\tthis.callId = callId\n\t\tthis.name = name\n\t\tthis.args = args\n\t}\n\n\tstatic rehydrate(data: { callId: string; name: string; args: string }): FunctionCallItem {\n\t\treturn new FunctionCallItem(data.callId, data.name, data.args)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tcall_id: this.callId,\n\t\t\tname: this.name,\n\t\t\targuments: this.args,\n\t\t}\n\t}\n}\n","import { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\nimport { SummaryText } from \"@domain/model-context/context-item/item-content/summary-text\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class ReasoningItem extends ContextItem {\n\treadonly type = \"reasoning\"\n\treadonly content: InputText | undefined\n\treadonly encryptedContent: string | undefined\n\treadonly summary: SummaryText[]\n\n\tprivate constructor(\n\t\tcontent: InputText | undefined,\n\t\tencryptedContent?: string | undefined,\n\t\tsummary: SummaryText[] = [],\n\t) {\n\t\tsuper()\n\t\tthis.content = content\n\t\tthis.encryptedContent = encryptedContent\n\t\tthis.summary = summary\n\t}\n\n\tstatic rehydrate(data: {\n\t\tcontent: InputText | undefined\n\t\tencryptedContent: string | undefined\n\t\tsummary: SummaryText[]\n\t}): ReasoningItem {\n\t\treturn new ReasoningItem(data.content, data.encryptedContent, data.summary)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tcontent: this.content?.toJSON(),\n\t\t\tencryptedContent: this.encryptedContent,\n\t\t\tsummary: this.summary.map((s) => s.toJSON()),\n\t\t}\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\n\nexport class FunctionCallOutputItem extends ContextItem {\n\treadonly type = \"function_call_output\"\n\treadonly callId: string\n\treadonly output: InputText\n\n\tprivate constructor(callId: string, output: InputText) {\n\t\tsuper()\n\t\tthis.callId = callId\n\t\tthis.output = output\n\t}\n\n\tstatic create(callId: string, output: string): FunctionCallOutputItem {\n\t\tconst outputText = InputText.create(output)\n\t\treturn new FunctionCallOutputItem(callId, outputText)\n\t}\n\n\tstatic rehydrate(data: { callId: string; output: InputText }): FunctionCallOutputItem {\n\t\treturn new FunctionCallOutputItem(data.callId, data.output)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tcall_id: this.callId,\n\t\t\toutput: this.output.toJSON(),\n\t\t}\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { TokenUsage } from \"@domain/generative-model/token-usage\"\n\nexport class InferenceResponse {\n\treadonly contextItems: ContextItem[]\n\treadonly tokenUsage?: TokenUsage\n\n\tconstructor(contextItems: ContextItem[], tokenUsage: TokenUsage | undefined) {\n\t\tthis.contextItems = contextItems\n\t\tthis.tokenUsage = tokenUsage\n\t}\n}\n","export class InputTokenDetails {\n\treadonly cached_tokens: number\n\n\tconstructor(cached_tokens: number) {\n\t\tthis.cached_tokens = cached_tokens\n\t}\n}\n\nexport class OutputTokenDetails {\n\treadonly reasoning_tokens: number\n\n\tconstructor(reasoning_tokens: number) {\n\t\tthis.reasoning_tokens = reasoning_tokens\n\t}\n}\n\nexport class TokenUsage {\n\treadonly inputTokens: number\n\treadonly outputTokens: number\n\treadonly totalTokens: number\n\treadonly inputTokenDetails: InputTokenDetails\n\treadonly outputTokenDetails: OutputTokenDetails\n\n\tconstructor(\n\t\tinputTokens: number,\n\t\toutputTokens: number,\n\t\ttotalTokens: number,\n\t\tinputTokenDetails: InputTokenDetails,\n\t\toutputTokenDetails: OutputTokenDetails,\n\t) {\n\t\tthis.inputTokens = inputTokens\n\t\tthis.outputTokens = outputTokens\n\t\tthis.totalTokens = totalTokens\n\t\tthis.inputTokenDetails = inputTokenDetails\n\t\tthis.outputTokenDetails = outputTokenDetails\n\t}\n}\n","import { ModelContext } from \"@domain/model-context/model-context\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { InferenceRequest } from \"@domain/generative-model/inference-request\"\nimport { InferenceResponse } from \"@domain/generative-model/inference-response\"\nimport { ModelRuntime } from \"@domain/generative-model/runtime/model-runtime\"\nimport { InputTokenDetails, OutputTokenDetails, TokenUsage } from \"@domain/generative-model/token-usage\"\nimport OpenAI from \"openai\"\n\nexport class OpenAIResponses implements ModelRuntime {\n\tprivate readonly client: OpenAI\n\tconstructor() {\n\t\tthis.client = new OpenAI()\n\t}\n\n\tasync infer(inferenceRequest: InferenceRequest): Promise<InferenceResponse> {\n\t\tconst input = this.mapContextToRequest(inferenceRequest.context)\n\n\t\tconst specification = inferenceRequest.model.specification\n\n\t\tlet request: any = {\n\t\t\tmodel: specification.name,\n\t\t\tinput: input,\n\t\t}\n\n\t\tif (specification.supportFunctionCalling && inferenceRequest.model.getTools().length > 0) {\n\t\t\trequest.tools = inferenceRequest.model.getTools().map((tool) => {\n\t\t\t\treturn {\n\t\t\t\t\ttype: tool.type,\n\t\t\t\t\tname: tool.name,\n\t\t\t\t\tdescription: tool.description,\n\t\t\t\t\tparameters: tool.parameters,\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tif (specification.supportReasoningEffort) {\n\t\t\trequest.reasoning = {\n\t\t\t\teffort: inferenceRequest.model.getReasoningEffort(),\n\t\t\t}\n\t\t}\n\n\t\tconst response = await this.client.responses.create(request)\n\n\t\tconst contextItems = this.extractContextItems(response)\n\t\tconst tokenUsage = this.extractTokenUsage(response)\n\t\treturn new InferenceResponse(contextItems, tokenUsage)\n\t}\n\n\textractTokenUsage(response: OpenAI.Responses.Response): TokenUsage | undefined {\n\t\tif (!response.usage) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn new TokenUsage(\n\t\t\tresponse.usage.input_tokens,\n\t\t\tresponse.usage.output_tokens,\n\t\t\tresponse.usage.total_tokens,\n\t\t\tnew InputTokenDetails(response.usage.input_tokens_details.cached_tokens),\n\t\t\tnew OutputTokenDetails(response.usage.output_tokens_details.reasoning_tokens),\n\t\t)\n\t}\n\n\tmapContextToRequest(context: ModelContext): any[] {\n\t\treturn context.getItems().map((item) => item.toJSON())\n\t}\n\n\textractContextItems(response: any): ContextItem[] {\n\t\treturn response.output.map((item: any) => {\n\t\t\tif (item.type === \"message\" && item.role === \"assistant\") {\n\t\t\t\treturn ModelMessageItem.rehydrate(item.content[0] as { text: string })\n\t\t\t}\n\t\t\tif (item.type === \"function_call\") {\n\t\t\t\treturn FunctionCallItem.rehydrate({\n\t\t\t\t\tcallId: item.call_id,\n\t\t\t\t\tname: item.name,\n\t\t\t\t\targs: item.arguments,\n\t\t\t\t})\n\t\t\t}\n\t\t\tif (item.type === \"reasoning\") {\n\t\t\t\treturn ReasoningItem.rehydrate(item)\n\t\t\t}\n\t\t})\n\t}\n}\n","import { ModelContext } from \"@domain/model-context/model-context\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\n\nexport class InferenceRequest {\n\treadonly model: GenerativeModel & ReasoningEffort<string> & ToolCallingCapability\n\treadonly context: ModelContext\n\n\tconstructor(model: GenerativeModel & ReasoningEffort<string> & ToolCallingCapability, context: ModelContext) {\n\t\tthis.model = model\n\t\tthis.context = context\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\n\nexport type OpenAIReasoningEffortType = \"xhigh\" | \"high\" | \"medium\" | \"low\" | \"none\"\n\nexport class OpenAIReasoningEffort implements ReasoningEffort<OpenAIReasoningEffortType> {\n\treasoningEffort: OpenAIReasoningEffortType\n\n\tconstructor(reasoningEffort: OpenAIReasoningEffortType) {\n\t\tthis.reasoningEffort = reasoningEffort\n\t}\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.reasoningEffort = effort\n\t}\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\tif (!this.reasoningEffort) {\n\t\t\tthrow new Error(\"Reasoning effort not supported\")\n\t\t}\n\t\treturn this.reasoningEffort\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt54Nano implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.4-nano\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 400_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt54 implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.4\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 1_050_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt54Mini implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.4-mini\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 400_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n}\n","import { ModelContext } from \"@domain/model-context/model-context\"\nimport { ModelContextRepository } from \"@domain/model-context/model-context-repository\"\n\nexport class InMemoryModelContextRepository implements ModelContextRepository {\n\tprivate readonly store = new Map<string, ModelContext>()\n\tprivate readonly projectIndex = new Map<string, Set<string>>()\n\n\tasync save(context: ModelContext): Promise<void> {\n\t\tconst existing = this.store.get(context.id)\n\t\tif (existing && existing.projectId !== context.projectId) {\n\t\t\tconst prevSet = this.projectIndex.get(existing.projectId)\n\t\t\tprevSet?.delete(existing.id)\n\t\t\tif (prevSet && prevSet.size === 0) this.projectIndex.delete(existing.projectId)\n\t\t}\n\n\t\tthis.store.set(context.id, this.clone(context))\n\n\t\tlet set = this.projectIndex.get(context.projectId)\n\t\tif (!set) {\n\t\t\tset = new Set<string>()\n\t\t\tthis.projectIndex.set(context.projectId, set)\n\t\t}\n\t\tset.add(context.id)\n\t}\n\n\tasync get(id: string): Promise<ModelContext> {\n\t\tconst context = this.store.get(id)\n\t\tif (!context) {\n\t\t\tthrow new Error(`Context not found: ${id}`)\n\t\t}\n\t\treturn this.clone(context)\n\t}\n\n\tasync getByProjectId(projectId: string): Promise<ModelContext[]> {\n\t\tconst ids = this.projectIndex.get(projectId)\n\t\tif (!ids || ids.size === 0) return []\n\t\treturn [...ids]\n\t\t\t.map((id) => this.store.get(id))\n\t\t\t.filter((c): c is ModelContext => Boolean(c))\n\t\t\t.map((c) => this.clone(c))\n\t}\n\n\tprivate clone(context: ModelContext): ModelContext {\n\t\treturn ModelContext.rehydrate({\n\t\t\tid: context.id,\n\t\t\tprojectId: context.projectId,\n\t\t\titems: [...context.getItems()],\n\t\t})\n\t}\n}\n","import { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class SystemMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"system\"\n\treadonly content: InputText\n\n\tprivate constructor(content: InputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n\n\tstatic create(text: string): SystemMessageItem {\n\t\tconst content = InputText.create(text)\n\t\treturn new SystemMessageItem(content)\n\t}\n\n\tstatic rehydrate(data: { text: string }): SystemMessageItem {\n\t\tconst content = InputText.rehydrate(data)\n\t\treturn new SystemMessageItem(content)\n\t}\n}\n","import { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { AgenticEnvironment } from \"./agentic-environment\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\n\nexport abstract class Participant {\n\tprivate environments: AgenticEnvironment[] = []\n\n\tjoin(environment: AgenticEnvironment) {\n\t\tif (this.isJoinedTo(environment)) {\n\t\t\treturn\n\t\t}\n\t\tenvironment.subscribe(this)\n\t\tthis.environments.push(environment)\n\t}\n\n\tleave(environment: AgenticEnvironment) {\n\t\tif (!this.isJoinedTo(environment)) {\n\t\t\treturn\n\t\t}\n\t\tenvironment.unsubscribe(this)\n\t\tthis.environments = this.environments.filter((e) => e !== environment)\n\t}\n\n\tprotected isJoinedTo(environment: AgenticEnvironment): boolean {\n\t\treturn this.environments.includes(environment)\n\t}\n\n\tgetEnvironments(): AgenticEnvironment[] {\n\t\treturn this.environments\n\t}\n\n\tabstract onParticipantJoined(participant: Participant, environment: AgenticEnvironment): Promise<void> | void\n\n\tabstract onParticipantLeft(participant: Participant, environment: AgenticEnvironment): Promise<void> | void\n\n\tabstract onJoined(environment: AgenticEnvironment): Promise<void> | void\n\n\tabstract onLeft(environment: AgenticEnvironment): Promise<void> | void\n\n\tabstract onFunctionCall(item: FunctionCallItem): Promise<void> | void\n\n\tabstract onExternalFunctionCall(source: Participant, item: FunctionCallItem): Promise<void> | void\n\n\tabstract onFunctionCallOutput(item: FunctionCallOutputItem): Promise<void> | void\n\n\tabstract onExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem): Promise<void> | void\n\n\tabstract onReasoning(item: ReasoningItem): Promise<void> | void\n\n\tabstract onExternalReasoning(source: Participant, item: ReasoningItem): Promise<void> | void\n\n\tabstract onModelMessage(item: ModelMessageItem): Promise<void> | void\n\n\tabstract onExternalModelMessage(source: Participant, item: ModelMessageItem): Promise<void> | void\n\n\tabstract onMessage(message: string): Promise<void> | void\n}\n","import { Participant } from \"@domain/agentic-environment/participant\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\n\nexport class AgenticEnvironment {\n\tprotected subscribers: Participant[] = []\n\tprivate isActive = false\n\n\tsubscribe(subscriber: Participant) {\n\t\tthis.subscribers.push(subscriber)\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === subscriber) {\n\t\t\t\tsubscriber.onJoined(this)\n\t\t\t} else {\n\t\t\t\tsubscriber.onParticipantJoined(subscriber, this)\n\t\t\t}\n\t\t}\n\t}\n\n\tunsubscribe(subscriber: Participant) {\n\t\tthis.subscribers = this.subscribers.filter((p) => p !== subscriber)\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === subscriber) {\n\t\t\t\tsubscriber.onLeft(this)\n\t\t\t} else {\n\t\t\t\tsubscriber.onParticipantLeft(subscriber, this)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverFunctionCall(source: Participant, item: FunctionCallItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onFunctionCall(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalFunctionCall(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverModelMessage(source: Participant, item: ModelMessageItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onModelMessage(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalModelMessage(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverReasoning(source: Participant, item: ReasoningItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onReasoning(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalReasoning(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverFunctionCallOutput(source: Participant, item: FunctionCallOutputItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onFunctionCallOutput(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalFunctionCallOutput(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverMessage(source: Participant, message: string): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) continue\n\n\t\t\tsubscriber.onMessage(message)\n\t\t}\n\t}\n\n\tstart() {\n\t\tthis.isActive = true\n\t\twhile (this.isActive) {\n\t\t\tsetTimeout(() => {}, 100)\n\t\t}\n\t}\n\n\tstop() {\n\t\tthis.isActive = false\n\t}\n}\n","import { AgenticEnvironment } from \"@domain/agentic-environment/agentic-environment\"\nimport { FunctionCallCapable, InferenceCapable, InputCapable } from \"@domain/agentic-environment/capabilities\"\nimport { Participant } from \"@domain/agentic-environment/participant\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelContext } from \"@domain/model-context/model-context\"\nimport { InferenceRunner } from \"@domain/agentic-environment/inference-runner\"\nimport { FunctionCallRunner } from \"@domain/agentic-environment/function-call-runner\"\nimport { InputStream } from \"@domain/agentic-environment/input-stream\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\n\nexport class BaseAgentParticipant extends Participant implements InputCapable, InferenceCapable, FunctionCallCapable {\n\tprivate inputSource: InputStream\n\tprivate inferenceRunner: InferenceRunner\n\tprivate functionCallRunner: FunctionCallRunner\n\n\tconstructor(inputSource: InputStream, inferenceRunner: InferenceRunner, functionCallRunner: FunctionCallRunner) {\n\t\tsuper()\n\t\tthis.inputSource = inputSource\n\t\tthis.inferenceRunner = inferenceRunner\n\t\tthis.functionCallRunner = functionCallRunner\n\t}\n\n\tonJoined(environment: AgenticEnvironment) {}\n\n\tonLeft(environment: AgenticEnvironment) {}\n\n\tonParticipantJoined(participant: Participant) {}\n\n\tonParticipantLeft(participant: Participant) {}\n\n\tonFunctionCall(item: FunctionCallItem) {}\n\n\tonExternalFunctionCall(source: Participant, item: FunctionCallItem) {}\n\n\tonFunctionCallOutput(item: FunctionCallOutputItem) {}\n\n\tonExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem) {}\n\n\tonReasoning(item: ReasoningItem) {}\n\n\tonExternalReasoning(source: Participant, item: ReasoningItem) {}\n\n\tonModelMessage(item: ModelMessageItem) {}\n\n\tonExternalModelMessage(source: Participant, item: ModelMessageItem) {}\n\n\tonMessage(message: string) {}\n\n\tasync executeFunctionCall(\n\t\tenvironment: AgenticEnvironment,\n\t\tfunctionCallItem: FunctionCallItem,\n\t\tsignal?: AbortSignal,\n\t): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.functionCallRunner.run(functionCallItem, signal)\n\n\t\tfor await (const item of stream) {\n\t\t\tawait environment.deliverFunctionCallOutput(this, item)\n\t\t}\n\t}\n\n\tasync runInference(\n\t\tenvironment: AgenticEnvironment,\n\t\tcontext: ModelContext,\n\t\tmodel: GenerativeModel,\n\t\tsignal?: AbortSignal,\n\t): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.inferenceRunner.run(context, model, signal)\n\n\t\tfor await (const item of stream) {\n\t\t\tif (item.type === \"reasoning\") {\n\t\t\t\tawait environment.deliverReasoning(this, item)\n\t\t\t} else if (item.type === \"function_call\") {\n\t\t\t\tawait environment.deliverFunctionCall(this, item)\n\t\t\t} else if (item.type === \"message\" && item.role === \"assistant\") {\n\t\t\t\tawait environment.deliverModelMessage(this, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tasync streamInput(environment: AgenticEnvironment): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.inputSource.stream()\n\t\tfor await (const message of stream) {\n\t\t\tawait environment.deliverMessage(this, message)\n\t\t}\n\t}\n}\n","import { AgenticEnvironment } from \"@domain/agentic-environment/agentic-environment\"\nimport { InputCapable } from \"@domain/agentic-environment/capabilities\"\nimport { InputStream } from \"@domain/agentic-environment/input-stream\"\nimport { Participant } from \"@domain/agentic-environment/participant\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\n\nexport class BaseHumanParticipant extends Participant implements InputCapable {\n\tprivate inputSource: InputStream\n\n\tconstructor(inputSource: InputStream) {\n\t\tsuper()\n\t\tthis.inputSource = inputSource\n\t}\n\n\tonJoined(environment: AgenticEnvironment) {}\n\t\n\tonLeft(environment: AgenticEnvironment) {}\n\n\tonParticipantJoined(participant: Participant, environment: AgenticEnvironment) {}\n\n\tonParticipantLeft(participant: Participant, environment: AgenticEnvironment) {}\n\n\tonMessage(message: string) {}\n\n\tonFunctionCall(item: FunctionCallItem) {}\n\n\tonFunctionCallOutput(item: FunctionCallOutputItem) {}\n\n\tonReasoning(item: ReasoningItem) {}\n\n\tonModelMessage(item: ModelMessageItem) {}\n\n\tonExternalFunctionCall(source: Participant, item: FunctionCallItem) {}\n\n\tonExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem) {}\n\n\tonExternalReasoning(source: Participant, item: ReasoningItem) {}\n\n\tonExternalModelMessage(source: Participant, item: ModelMessageItem) {}\n\n\tasync streamInput(environment: AgenticEnvironment): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.inputSource.stream()\n\t\tfor await (const message of stream) {\n\t\t\tawait environment.deliverMessage(this, message)\n\t\t}\n\t}\n}\n","import { InferenceRunner } from \"@domain/agentic-environment/inference-runner\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { InferenceRequest } from \"@domain/generative-model/inference-request\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { ModelContext } from \"@domain/model-context/model-context\"\nimport { OpenAIResponses } from \"@infra/providers/openai/runtime/openai-responses\"\n\ntype InferenceItem = ReasoningItem | FunctionCallItem | ModelMessageItem\n\nexport class OpenAIInferenceRunner implements InferenceRunner {\n\tprivate readonly runtime = new OpenAIResponses()\n\n\tasync *run(context: ModelContext, model: GenerativeModel, signal?: AbortSignal): AsyncIterable<InferenceItem> {\n\t\tconst response = await this.runtime.infer(new InferenceRequest(model, context))\n\t\tfor (const item of response.contextItems) {\n\t\t\tyield item as InferenceItem\n\t\t}\n\t}\n}\n","import { FunctionCallRunner } from \"@domain/agentic-environment/function-call-runner\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\n\nexport class DefaultFunctionCallRunner implements FunctionCallRunner {\n\tconstructor(private readonly tools: Tool[]) {}\n\n\tasync *run(call: FunctionCallItem, signal?: AbortSignal): AsyncIterable<FunctionCallOutputItem> {\n\t\tconst tool = this.tools.find((t) => t.name === call.name)\n\t\tif (!tool) throw new Error(`Unknown tool: ${call.name}`)\n\n\t\tconst result = await tool.invoke(JSON.parse(call.args))\n\t\tyield FunctionCallOutputItem.create(call.callId, JSON.stringify(result))\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt55 implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.5\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 1_050_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,eAAN,MAAM,cAAa;AAAA,EAKzB,YAAY,IAAY,WAAmB,OAAsB;AAChE,SAAK,YAAY;AACjB,SAAK,KA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B,KAAK,IAAI,EAAE;AAEvD,UAAM,SAAS,MAAM,KAAK,OAAO,KAAK,MAAM,KAAK,IAAI,CAAC;AACtD,UAAM,uBAAuB,OAAO,KAAK,QAAQ,KAAK,UAAU,MAAM,CAAC;AAAA,EACxE;AACD;;;ACTO,IAAM,QAAN,MAA0G;AAAA,EAA1G;AACN,SAAS,gBAAgB;AAAA,MACxB,MAAM;AAAA,MACN,wBAAwB;AAAA,MACxB,wBAAwB;AAAA,MACxB,kBAAkB;AAAA,MAClB,mBAAmB;AAAA,MACnB,iBAAiB;AAAA,MACjB,wBAAwB;AAAA,IACzB;AAEA,SAAQ,QAAgB,CAAC;AAUzB,SAAiB,SAAgC,IAAI;AAAA,MACpD,KAAK,cAAc;AAAA,IACpB;AAAA;AAAA,EAVA,SAAS,OAAqB;AAC7B,SAAK,QAAQ;AAAA,EACd;AAAA,EAEA,WAAmB;AAClB,WAAO,KAAK;AAAA,EACb;AAAA,EAMA,mBAAmB,QAAyC;AAC3D,SAAK,OAAO,mBAAmB,MAAM;AAAA,EACtC;AAAA,EAEA,qBAAgD;AAC/C,WAAO,KAAK,OAAO,mBAAmB;AAAA,EACvC;AACD;","names":["OpenAI","subscriber"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/domain/model-context/model-context.ts","../src/domain/model-context/context-item/context-item.ts","../src/domain/model-context/context-item/item-content/item-content.ts","../src/domain/model-context/context-item/item-content/input-text.ts","../src/domain/model-context/context-item/client-item/user-message.ts","../src/domain/model-context/context-item/client-item/developer-message.ts","../src/domain/model-context/context-item/item-content/output-text.ts","../src/domain/model-context/context-item/model-item/model-message.ts","../src/domain/model-context/context-item/model-item/function-call.ts","../src/domain/model-context/context-item/model-item/reasoning.ts","../src/domain/model-context/context-item/client-item/function-call-output.ts","../src/domain/generative-model/inference-response.ts","../src/domain/generative-model/token-usage.ts","../src/infrastructure/providers/openai/runtime/openai-responses.ts","../src/domain/generative-model/inference-request.ts","../src/infrastructure/providers/openai/reasoning-effort.ts","../src/infrastructure/providers/openai/models/gpt-5-4-nano.ts","../src/infrastructure/providers/openai/models/gpt-5-4.ts","../src/infrastructure/providers/openai/models/gpt-5-4-mini.ts","../src/infrastructure/repository/in-memory-model-context-repository.ts","../src/domain/model-context/context-item/client-item/system-message.ts","../src/domain/agentic-environment/participant.ts","../src/domain/agentic-environment/agentic-environment.ts","../src/application/agent.ts","../src/application/human.ts","../src/application/openai-inference-runner.ts","../src/application/function-call-runner.ts","../src/infrastructure/providers/openai/models/gpt-5-5.ts","../src/application/observer.ts"],"sourcesContent":["import { ModelContext } from \"@domain/model-context/model-context\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { UserMessageItem } from \"@domain/model-context/context-item/client-item/user-message\"\nimport { DeveloperMessageItem } from \"@domain/model-context/context-item/client-item/developer-message\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { ModelContextRepository } from \"@domain/model-context/model-context-repository\"\nimport { OpenAIResponses } from \"@infra/providers/openai/runtime/openai-responses\"\nimport { InferenceRequest } from \"@domain/generative-model/inference-request\"\nimport { Gpt54Nano } from \"@infra/providers/openai/models/gpt-5-4-nano\"\nimport { Gpt54 } from \"@infra/providers/openai/models/gpt-5-4\"\nimport { Gpt54Mini } from \"@infra/providers/openai/models/gpt-5-4-mini\"\nimport { InferenceResponse } from \"@domain/generative-model/inference-response\"\nimport { InputTokenDetails, OutputTokenDetails, TokenUsage } from \"@domain/generative-model/token-usage\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { InMemoryModelContextRepository } from \"@infra/repository/in-memory-model-context-repository\"\nimport { SystemMessageItem } from \"@domain/model-context/context-item/client-item/system-message\"\nimport { Participant } from \"@domain/agentic-environment/participant\"\nimport { AgenticEnvironment } from \"@domain/agentic-environment/agentic-environment\"\nimport { BaseAgentParticipant } from \"@app/agent\"\nimport { BaseHumanParticipant } from \"@app/human\"\nimport { FunctionCallRunner } from \"@domain/agentic-environment/function-call-runner\"\nimport { InferenceRunner } from \"@domain/agentic-environment/inference-runner\"\nimport { InputStream } from \"@domain/agentic-environment/input-stream\"\nimport { OpenAIInferenceRunner } from \"@app/openai-inference-runner\"\nimport { DefaultFunctionCallRunner } from \"@app/function-call-runner\"\nimport { Gpt55 } from \"@infra/providers/openai/models/gpt-5-5\"\nimport { BaseObserverParticipant } from \"@app/observer\"\n\nexport {\n\tModelContext,\n\tModelContextRepository,\n\tInMemoryModelContextRepository,\n\tContextItem,\n\tUserMessageItem,\n\tDeveloperMessageItem,\n\tSystemMessageItem,\n\tModelMessageItem,\n\tFunctionCallItem,\n\tFunctionCallOutputItem,\n\tReasoningItem,\n\tGenerativeModel,\n\tOpenAIResponses,\n\tGpt54,\n\tGpt54Mini,\n\tGpt54Nano,\n\tGpt55,\n\tInferenceRequest,\n\tInferenceResponse,\n\tTokenUsage,\n\tInputTokenDetails,\n\tOutputTokenDetails,\n\tTool,\n\tFunctionCallRunner,\n\tInferenceRunner,\n\tDefaultFunctionCallRunner,\n\tInputStream,\n\tAgenticEnvironment,\n\tParticipant,\n\tBaseAgentParticipant,\n\tBaseHumanParticipant,\n\tBaseObserverParticipant,\n\tOpenAIInferenceRunner,\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class ModelContext {\n\treadonly id: string\n\treadonly projectId: string\n\treadonly items: ContextItem[]\n\n\tconstructor(id: string, projectId: string, items: ContextItem[]) {\n\t\tthis.projectId = projectId\n\t\tthis.id = id\n\t\tthis.items = items\n\t}\n\n\taddContextItem(item: ContextItem): ModelContext {\n\t\tthis.items.push(item)\n\t\treturn this\n\t}\n\n\tapplyModelOutput(items: ContextItem[]): ModelContext {\n\t\tfor (const item of items) {\n\t\t\tconst itemType = item.getType()\n\t\t\tif (itemType !== \"function_call\" && itemType !== \"message\" && itemType !== \"reasoning\") {\n\t\t\t\tthrow new Error(`Invalid item type: ${itemType}`)\n\t\t\t}\n\t\t}\n\t\tthis.items.push(...items)\n\t\treturn this\n\t}\n\n\tgetItems(): ContextItem[] {\n\t\treturn this.items\n\t}\n\n\tgetLastItem(): ContextItem {\n\t\tif (this.items.length === 0) {\n\t\t\tthrow new Error(\"No items in context\")\n\t\t}\n\t\treturn this.items[this.items.length - 1]\n\t}\n\n\tstatic create(projectId: string): ModelContext {\n\t\tconst id = crypto.randomUUID()\n\t\treturn new ModelContext(id, projectId, [])\n\t}\n\n\tstatic rehydrate(data: { id: string; projectId: string; items: ContextItem[] }): ModelContext {\n\t\treturn new ModelContext(data.id, data.projectId, data.items)\n\t}\n\n\ttoJSON(): any {\n\t\treturn this.items.map((item) => item.toJSON())\n\t}\n}\n","export abstract class ContextItem {\n\tabstract readonly type: string\n\n\tgetType(): string {\n\t\treturn this.type\n\t}\n\n\tabstract toJSON(): any\n}\n","export abstract class ItemContent {\n\tabstract readonly type: string\n}\n","import { ItemContent } from \"@domain/model-context/context-item/item-content/item-content\"\n\nexport class InputText extends ItemContent {\n\treadonly type = \"input_text\"\n\n\tprivate constructor(public readonly text: string) {\n\t\tsuper()\n\t}\n\n\tstatic create(text: string): InputText {\n\t\treturn new InputText(text)\n\t}\n\n\tstatic rehydrate(data: { text: string }): InputText {\n\t\treturn new InputText(data.text)\n\t}\n\n\ttoJSON(): any[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttype: this.type,\n\t\t\t\ttext: this.text,\n\t\t\t},\n\t\t]\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\n\nexport class UserMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"user\"\n\treadonly content: InputText\n\n\tprivate constructor(content: InputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\tstatic create(text: string): UserMessageItem {\n\t\tconst content = InputText.create(text)\n\t\treturn new UserMessageItem(content)\n\t}\n\n\tstatic rehydrate(data: { text: string }): UserMessageItem {\n\t\tconst content = InputText.rehydrate(data)\n\t\treturn new UserMessageItem(content)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n}\n","import { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class DeveloperMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"developer\"\n\treadonly content: InputText\n\n\tprivate constructor(content: InputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n\n\tstatic create(text: string): DeveloperMessageItem {\n\t\tconst content = InputText.create(text)\n\t\treturn new DeveloperMessageItem(content)\n\t}\n\n\tstatic rehydrate(data: { text: string }): DeveloperMessageItem {\n\t\tconst content = InputText.rehydrate(data)\n\t\treturn new DeveloperMessageItem(content)\n\t}\n}\n","import { ItemContent } from \"@domain/model-context/context-item/item-content/item-content\"\n\nexport class OutputText extends ItemContent {\n\treadonly type = \"output_text\"\n\n\tprivate constructor(public readonly text: string) {\n\t\tsuper()\n\t}\n\n\tstatic rehydrate(data: { text: string }): OutputText {\n\t\treturn new OutputText(data.text)\n\t}\n\n\ttoJSON(): any[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttype: this.type,\n\t\t\t\ttext: this.text,\n\t\t\t},\n\t\t]\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { OutputText } from \"@domain/model-context/context-item/item-content/output-text\"\n\nexport class ModelMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"assistant\"\n\treadonly content: OutputText\n\n\tprivate constructor(content: OutputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\tstatic rehydrate(data: { text: string }): ModelMessageItem {\n\t\tconst content = OutputText.rehydrate(data)\n\t\treturn new ModelMessageItem(content)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class FunctionCallItem extends ContextItem {\n\treadonly type = \"function_call\"\n\treadonly callId: string\n\treadonly name: string\n\treadonly args: string\n\n\tprivate constructor(callId: string, name: string, args: string) {\n\t\tsuper()\n\t\tthis.callId = callId\n\t\tthis.name = name\n\t\tthis.args = args\n\t}\n\n\tstatic rehydrate(data: { callId: string; name: string; args: string }): FunctionCallItem {\n\t\treturn new FunctionCallItem(data.callId, data.name, data.args)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tcall_id: this.callId,\n\t\t\tname: this.name,\n\t\t\targuments: this.args,\n\t\t}\n\t}\n}\n","import { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\nimport { SummaryText } from \"@domain/model-context/context-item/item-content/summary-text\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class ReasoningItem extends ContextItem {\n\treadonly type = \"reasoning\"\n\treadonly content: InputText | undefined\n\treadonly encryptedContent: string | undefined\n\treadonly summary: SummaryText[]\n\n\tprivate constructor(\n\t\tcontent: InputText | undefined,\n\t\tencryptedContent?: string | undefined,\n\t\tsummary: SummaryText[] = [],\n\t) {\n\t\tsuper()\n\t\tthis.content = content\n\t\tthis.encryptedContent = encryptedContent\n\t\tthis.summary = summary\n\t}\n\n\tstatic rehydrate(data: {\n\t\tcontent: InputText | undefined\n\t\tencryptedContent: string | undefined\n\t\tsummary: SummaryText[]\n\t}): ReasoningItem {\n\t\treturn new ReasoningItem(data.content, data.encryptedContent, data.summary)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tcontent: this.content?.toJSON(),\n\t\t\tencryptedContent: this.encryptedContent,\n\t\t\tsummary: this.summary.map((s) => s.toJSON()),\n\t\t}\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\n\nexport class FunctionCallOutputItem extends ContextItem {\n\treadonly type = \"function_call_output\"\n\treadonly callId: string\n\treadonly output: InputText\n\n\tprivate constructor(callId: string, output: InputText) {\n\t\tsuper()\n\t\tthis.callId = callId\n\t\tthis.output = output\n\t}\n\n\tstatic create(callId: string, output: string): FunctionCallOutputItem {\n\t\tconst outputText = InputText.create(output)\n\t\treturn new FunctionCallOutputItem(callId, outputText)\n\t}\n\n\tstatic rehydrate(data: { callId: string; output: InputText }): FunctionCallOutputItem {\n\t\treturn new FunctionCallOutputItem(data.callId, data.output)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tcall_id: this.callId,\n\t\t\toutput: this.output.toJSON(),\n\t\t}\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { TokenUsage } from \"@domain/generative-model/token-usage\"\n\nexport class InferenceResponse {\n\treadonly contextItems: ContextItem[]\n\treadonly tokenUsage?: TokenUsage\n\n\tconstructor(contextItems: ContextItem[], tokenUsage: TokenUsage | undefined) {\n\t\tthis.contextItems = contextItems\n\t\tthis.tokenUsage = tokenUsage\n\t}\n}\n","export class InputTokenDetails {\n\treadonly cached_tokens: number\n\n\tconstructor(cached_tokens: number) {\n\t\tthis.cached_tokens = cached_tokens\n\t}\n}\n\nexport class OutputTokenDetails {\n\treadonly reasoning_tokens: number\n\n\tconstructor(reasoning_tokens: number) {\n\t\tthis.reasoning_tokens = reasoning_tokens\n\t}\n}\n\nexport class TokenUsage {\n\treadonly inputTokens: number\n\treadonly outputTokens: number\n\treadonly totalTokens: number\n\treadonly inputTokenDetails: InputTokenDetails\n\treadonly outputTokenDetails: OutputTokenDetails\n\n\tconstructor(\n\t\tinputTokens: number,\n\t\toutputTokens: number,\n\t\ttotalTokens: number,\n\t\tinputTokenDetails: InputTokenDetails,\n\t\toutputTokenDetails: OutputTokenDetails,\n\t) {\n\t\tthis.inputTokens = inputTokens\n\t\tthis.outputTokens = outputTokens\n\t\tthis.totalTokens = totalTokens\n\t\tthis.inputTokenDetails = inputTokenDetails\n\t\tthis.outputTokenDetails = outputTokenDetails\n\t}\n}\n","import { ModelContext } from \"@domain/model-context/model-context\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { InferenceRequest } from \"@domain/generative-model/inference-request\"\nimport { InferenceResponse } from \"@domain/generative-model/inference-response\"\nimport { ModelRuntime } from \"@domain/generative-model/runtime/model-runtime\"\nimport { InputTokenDetails, OutputTokenDetails, TokenUsage } from \"@domain/generative-model/token-usage\"\nimport OpenAI from \"openai\"\n\nexport class OpenAIResponses implements ModelRuntime {\n\tprivate readonly client: OpenAI\n\tconstructor() {\n\t\tthis.client = new OpenAI()\n\t}\n\n\tasync infer(inferenceRequest: InferenceRequest): Promise<InferenceResponse> {\n\t\tconst input = this.mapContextToRequest(inferenceRequest.context)\n\n\t\tconst specification = inferenceRequest.model.specification\n\n\t\tlet request: any = {\n\t\t\tmodel: specification.name,\n\t\t\tinput: input,\n\t\t}\n\n\t\tif (specification.supportFunctionCalling && inferenceRequest.model.getTools().length > 0) {\n\t\t\trequest.tools = inferenceRequest.model.getTools().map((tool) => {\n\t\t\t\treturn {\n\t\t\t\t\ttype: tool.type,\n\t\t\t\t\tname: tool.name,\n\t\t\t\t\tdescription: tool.description,\n\t\t\t\t\tparameters: tool.parameters,\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tif (specification.supportReasoningEffort) {\n\t\t\trequest.reasoning = {\n\t\t\t\teffort: inferenceRequest.model.getReasoningEffort(),\n\t\t\t}\n\t\t}\n\n\t\tconst response = await this.client.responses.create(request)\n\n\t\tconst contextItems = this.extractContextItems(response)\n\t\tconst tokenUsage = this.extractTokenUsage(response)\n\t\treturn new InferenceResponse(contextItems, tokenUsage)\n\t}\n\n\textractTokenUsage(response: OpenAI.Responses.Response): TokenUsage | undefined {\n\t\tif (!response.usage) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn new TokenUsage(\n\t\t\tresponse.usage.input_tokens,\n\t\t\tresponse.usage.output_tokens,\n\t\t\tresponse.usage.total_tokens,\n\t\t\tnew InputTokenDetails(response.usage.input_tokens_details.cached_tokens),\n\t\t\tnew OutputTokenDetails(response.usage.output_tokens_details.reasoning_tokens),\n\t\t)\n\t}\n\n\tmapContextToRequest(context: ModelContext): any[] {\n\t\treturn context.getItems().map((item) => item.toJSON())\n\t}\n\n\textractContextItems(response: any): ContextItem[] {\n\t\treturn response.output.map((item: any) => {\n\t\t\tif (item.type === \"message\" && item.role === \"assistant\") {\n\t\t\t\treturn ModelMessageItem.rehydrate(item.content[0] as { text: string })\n\t\t\t}\n\t\t\tif (item.type === \"function_call\") {\n\t\t\t\treturn FunctionCallItem.rehydrate({\n\t\t\t\t\tcallId: item.call_id,\n\t\t\t\t\tname: item.name,\n\t\t\t\t\targs: item.arguments,\n\t\t\t\t})\n\t\t\t}\n\t\t\tif (item.type === \"reasoning\") {\n\t\t\t\treturn ReasoningItem.rehydrate(item)\n\t\t\t}\n\t\t})\n\t}\n}\n","import { ModelContext } from \"@domain/model-context/model-context\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\n\nexport class InferenceRequest {\n\treadonly model: GenerativeModel & ReasoningEffort<string> & ToolCallingCapability\n\treadonly context: ModelContext\n\n\tconstructor(model: GenerativeModel & ReasoningEffort<string> & ToolCallingCapability, context: ModelContext) {\n\t\tthis.model = model\n\t\tthis.context = context\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\n\nexport type OpenAIReasoningEffortType = \"xhigh\" | \"high\" | \"medium\" | \"low\" | \"none\"\n\nexport class OpenAIReasoningEffort implements ReasoningEffort<OpenAIReasoningEffortType> {\n\treasoningEffort: OpenAIReasoningEffortType\n\n\tconstructor(reasoningEffort: OpenAIReasoningEffortType) {\n\t\tthis.reasoningEffort = reasoningEffort\n\t}\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.reasoningEffort = effort\n\t}\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\tif (!this.reasoningEffort) {\n\t\t\tthrow new Error(\"Reasoning effort not supported\")\n\t\t}\n\t\treturn this.reasoningEffort\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt54Nano implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.4-nano\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 400_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt54 implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.4\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 1_050_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt54Mini implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.4-mini\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 400_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n}\n","import { ModelContext } from \"@domain/model-context/model-context\"\nimport { ModelContextRepository } from \"@domain/model-context/model-context-repository\"\n\nexport class InMemoryModelContextRepository implements ModelContextRepository {\n\tprivate readonly store = new Map<string, ModelContext>()\n\tprivate readonly projectIndex = new Map<string, Set<string>>()\n\n\tasync save(context: ModelContext): Promise<void> {\n\t\tconst existing = this.store.get(context.id)\n\t\tif (existing && existing.projectId !== context.projectId) {\n\t\t\tconst prevSet = this.projectIndex.get(existing.projectId)\n\t\t\tprevSet?.delete(existing.id)\n\t\t\tif (prevSet && prevSet.size === 0) this.projectIndex.delete(existing.projectId)\n\t\t}\n\n\t\tthis.store.set(context.id, this.clone(context))\n\n\t\tlet set = this.projectIndex.get(context.projectId)\n\t\tif (!set) {\n\t\t\tset = new Set<string>()\n\t\t\tthis.projectIndex.set(context.projectId, set)\n\t\t}\n\t\tset.add(context.id)\n\t}\n\n\tasync get(id: string): Promise<ModelContext> {\n\t\tconst context = this.store.get(id)\n\t\tif (!context) {\n\t\t\tthrow new Error(`Context not found: ${id}`)\n\t\t}\n\t\treturn this.clone(context)\n\t}\n\n\tasync getByProjectId(projectId: string): Promise<ModelContext[]> {\n\t\tconst ids = this.projectIndex.get(projectId)\n\t\tif (!ids || ids.size === 0) return []\n\t\treturn [...ids]\n\t\t\t.map((id) => this.store.get(id))\n\t\t\t.filter((c): c is ModelContext => Boolean(c))\n\t\t\t.map((c) => this.clone(c))\n\t}\n\n\tprivate clone(context: ModelContext): ModelContext {\n\t\treturn ModelContext.rehydrate({\n\t\t\tid: context.id,\n\t\t\tprojectId: context.projectId,\n\t\t\titems: [...context.getItems()],\n\t\t})\n\t}\n}\n","import { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class SystemMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"system\"\n\treadonly content: InputText\n\n\tprivate constructor(content: InputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n\n\tstatic create(text: string): SystemMessageItem {\n\t\tconst content = InputText.create(text)\n\t\treturn new SystemMessageItem(content)\n\t}\n\n\tstatic rehydrate(data: { text: string }): SystemMessageItem {\n\t\tconst content = InputText.rehydrate(data)\n\t\treturn new SystemMessageItem(content)\n\t}\n}\n","import { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { AgenticEnvironment } from \"./agentic-environment\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\n\nexport abstract class Participant {\n\tprivate environments: AgenticEnvironment[] = []\n\n\tjoin(environment: AgenticEnvironment) {\n\t\tif (this.isJoinedTo(environment)) {\n\t\t\treturn\n\t\t}\n\t\tenvironment.subscribe(this)\n\t\tthis.environments.push(environment)\n\t}\n\n\tleave(environment: AgenticEnvironment) {\n\t\tif (!this.isJoinedTo(environment)) {\n\t\t\treturn\n\t\t}\n\t\tenvironment.unsubscribe(this)\n\t\tthis.environments = this.environments.filter((e) => e !== environment)\n\t}\n\n\tprotected isJoinedTo(environment: AgenticEnvironment): boolean {\n\t\treturn this.environments.includes(environment)\n\t}\n\n\tgetEnvironments(): AgenticEnvironment[] {\n\t\treturn this.environments\n\t}\n\n\tabstract onParticipantJoined(participant: Participant): Promise<void> | void\n\n\tabstract onParticipantLeft(participant: Participant): Promise<void> | void\n\n\tabstract onJoined(): Promise<void> | void\n\n\tabstract onLeft(): Promise<void> | void\n\n\tabstract onFunctionCall(item: FunctionCallItem): Promise<void> | void\n\n\tabstract onExternalFunctionCall(source: Participant, item: FunctionCallItem): Promise<void> | void\n\n\tabstract onFunctionCallOutput(item: FunctionCallOutputItem): Promise<void> | void\n\n\tabstract onExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem): Promise<void> | void\n\n\tabstract onReasoning(item: ReasoningItem): Promise<void> | void\n\n\tabstract onExternalReasoning(source: Participant, item: ReasoningItem): Promise<void> | void\n\n\tabstract onModelMessage(item: ModelMessageItem): Promise<void> | void\n\n\tabstract onExternalModelMessage(source: Participant, item: ModelMessageItem): Promise<void> | void\n\n\tabstract onMessage(message: string): Promise<void> | void\n}\n","import { Participant } from \"@domain/agentic-environment/participant\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\n\nexport class AgenticEnvironment {\n\tprotected subscribers: Participant[] = []\n\tprivate isActive = false\n\n\tsubscribe(subscriber: Participant) {\n\t\tthis.subscribers.push(subscriber)\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === subscriber) {\n\t\t\t\tsubscriber.onJoined()\n\t\t\t} else {\n\t\t\t\tsubscriber.onParticipantJoined(subscriber)\n\t\t\t}\n\t\t}\n\t}\n\n\tunsubscribe(subscriber: Participant) {\n\t\tthis.subscribers = this.subscribers.filter((p) => p !== subscriber)\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === subscriber) {\n\t\t\t\tsubscriber.onLeft()\n\t\t\t} else {\n\t\t\t\tsubscriber.onParticipantLeft(subscriber)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverFunctionCall(source: Participant, item: FunctionCallItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onFunctionCall(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalFunctionCall(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverModelMessage(source: Participant, item: ModelMessageItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onModelMessage(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalModelMessage(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverReasoning(source: Participant, item: ReasoningItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onReasoning(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalReasoning(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverFunctionCallOutput(source: Participant, item: FunctionCallOutputItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onFunctionCallOutput(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalFunctionCallOutput(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverMessage(source: Participant, message: string): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) continue\n\n\t\t\tsubscriber.onMessage(message)\n\t\t}\n\t}\n\n\tstart() {\n\t\tthis.isActive = true\n\t\twhile (this.isActive) {\n\t\t\tsetTimeout(() => {}, 100)\n\t\t}\n\t}\n\n\tstop() {\n\t\tthis.isActive = false\n\t}\n}\n","import { AgenticEnvironment } from \"@domain/agentic-environment/agentic-environment\"\nimport { FunctionCallCapable, InferenceCapable, InputCapable } from \"@domain/agentic-environment/capabilities\"\nimport { Participant } from \"@domain/agentic-environment/participant\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelContext } from \"@domain/model-context/model-context\"\nimport { InferenceRunner } from \"@domain/agentic-environment/inference-runner\"\nimport { FunctionCallRunner } from \"@domain/agentic-environment/function-call-runner\"\nimport { InputStream } from \"@domain/agentic-environment/input-stream\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\n\nexport class BaseAgentParticipant extends Participant implements InputCapable, InferenceCapable, FunctionCallCapable {\n\tprivate inputSource: InputStream\n\tprivate inferenceRunner: InferenceRunner\n\tprivate functionCallRunner: FunctionCallRunner\n\n\tconstructor(inputSource: InputStream, inferenceRunner: InferenceRunner, functionCallRunner: FunctionCallRunner) {\n\t\tsuper()\n\t\tthis.inputSource = inputSource\n\t\tthis.inferenceRunner = inferenceRunner\n\t\tthis.functionCallRunner = functionCallRunner\n\t}\n\n\tonJoined() {}\n\n\tonLeft() {}\n\n\tonParticipantJoined(participant: Participant) {}\n\n\tonParticipantLeft(participant: Participant) {}\n\n\tonFunctionCall(item: FunctionCallItem) {}\n\n\tonExternalFunctionCall(source: Participant, item: FunctionCallItem) {}\n\n\tonFunctionCallOutput(item: FunctionCallOutputItem) {}\n\n\tonExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem) {}\n\n\tonReasoning(item: ReasoningItem) {}\n\n\tonExternalReasoning(source: Participant, item: ReasoningItem) {}\n\n\tonModelMessage(item: ModelMessageItem) {}\n\n\tonExternalModelMessage(source: Participant, item: ModelMessageItem) {}\n\n\tonMessage(message: string) {}\n\n\tasync executeFunctionCall(\n\t\tenvironment: AgenticEnvironment,\n\t\tfunctionCallItem: FunctionCallItem,\n\t\tsignal?: AbortSignal,\n\t): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.functionCallRunner.run(functionCallItem, signal)\n\n\t\tfor await (const item of stream) {\n\t\t\tawait environment.deliverFunctionCallOutput(this, item)\n\t\t}\n\t}\n\n\tasync runInference(\n\t\tenvironment: AgenticEnvironment,\n\t\tcontext: ModelContext,\n\t\tmodel: GenerativeModel,\n\t\tsignal?: AbortSignal,\n\t): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.inferenceRunner.run(context, model, signal)\n\n\t\tfor await (const item of stream) {\n\t\t\tif (item.type === \"reasoning\") {\n\t\t\t\tawait environment.deliverReasoning(this, item)\n\t\t\t} else if (item.type === \"function_call\") {\n\t\t\t\tawait environment.deliverFunctionCall(this, item)\n\t\t\t} else if (item.type === \"message\" && item.role === \"assistant\") {\n\t\t\t\tawait environment.deliverModelMessage(this, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tasync streamInput(environment: AgenticEnvironment): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.inputSource.stream()\n\t\tfor await (const message of stream) {\n\t\t\tawait environment.deliverMessage(this, message)\n\t\t}\n\t}\n}\n","import { AgenticEnvironment } from \"@domain/agentic-environment/agentic-environment\"\nimport { InputCapable } from \"@domain/agentic-environment/capabilities\"\nimport { InputStream } from \"@domain/agentic-environment/input-stream\"\nimport { Participant } from \"@domain/agentic-environment/participant\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\n\nexport class BaseHumanParticipant extends Participant implements InputCapable {\n\tprivate inputSource: InputStream\n\n\tconstructor(inputSource: InputStream) {\n\t\tsuper()\n\t\tthis.inputSource = inputSource\n\t}\n\n\tonJoined() {}\n\t\n\tonLeft() {}\n\n\tonParticipantJoined(participant: Participant) {}\n\n\tonParticipantLeft(participant: Participant) {}\n\n\tonMessage(message: string) {}\n\n\tonFunctionCall(item: FunctionCallItem) {}\n\n\tonFunctionCallOutput(item: FunctionCallOutputItem) {}\n\n\tonReasoning(item: ReasoningItem) {}\n\n\tonModelMessage(item: ModelMessageItem) {}\n\n\tonExternalFunctionCall(source: Participant, item: FunctionCallItem) {}\n\n\tonExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem) {}\n\n\tonExternalReasoning(source: Participant, item: ReasoningItem) {}\n\n\tonExternalModelMessage(source: Participant, item: ModelMessageItem) {}\n\n\tasync streamInput(environment: AgenticEnvironment): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.inputSource.stream()\n\t\tfor await (const message of stream) {\n\t\t\tawait environment.deliverMessage(this, message)\n\t\t}\n\t}\n}\n","import { InferenceRunner } from \"@domain/agentic-environment/inference-runner\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { InferenceRequest } from \"@domain/generative-model/inference-request\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { ModelContext } from \"@domain/model-context/model-context\"\nimport { OpenAIResponses } from \"@infra/providers/openai/runtime/openai-responses\"\n\ntype InferenceItem = ReasoningItem | FunctionCallItem | ModelMessageItem\n\nexport class OpenAIInferenceRunner implements InferenceRunner {\n\tprivate readonly runtime = new OpenAIResponses()\n\n\tasync *run(context: ModelContext, model: GenerativeModel, signal?: AbortSignal): AsyncIterable<InferenceItem> {\n\t\tconst response = await this.runtime.infer(new InferenceRequest(model, context))\n\t\tfor (const item of response.contextItems) {\n\t\t\tyield item as InferenceItem\n\t\t}\n\t}\n}\n","import { FunctionCallRunner } from \"@domain/agentic-environment/function-call-runner\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\n\nexport class DefaultFunctionCallRunner implements FunctionCallRunner {\n\tconstructor(private readonly tools: Tool[]) {}\n\n\tasync *run(call: FunctionCallItem, signal?: AbortSignal): AsyncIterable<FunctionCallOutputItem> {\n\t\tconst tool = this.tools.find((t) => t.name === call.name)\n\t\tif (!tool) throw new Error(`Unknown tool: ${call.name}`)\n\n\t\tconst result = await tool.invoke(JSON.parse(call.args))\n\t\tyield FunctionCallOutputItem.create(call.callId, JSON.stringify(result))\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt55 implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.5\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 1_050_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n}\n","import { Participant } from \"@domain/agentic-environment/participant\";\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\";\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\";\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\";\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\";\n\nexport class BaseObserverParticipant extends Participant {\n onFunctionCall(item: FunctionCallItem) {}\n onExternalFunctionCall(source: Participant, item: FunctionCallItem) {}\n onFunctionCallOutput(item: FunctionCallOutputItem) {}\n onExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem) {}\n onReasoning(item: ReasoningItem) {}\n onExternalReasoning(source: Participant, item: ReasoningItem) {}\n onModelMessage(item: ModelMessageItem) {}\n onExternalModelMessage(source: Participant, item: ModelMessageItem) {}\n onMessage(message: string) {}\n\tonJoined() {}\n\tonLeft() {}\n\tonParticipantJoined(participant: Participant) {}\n\tonParticipantLeft(participant: Participant) {}\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AAC;AAAA,EACZ,SAAS;AAAA,EAAC;AAAA,EACV,oBAAoB,aAA0B;AAAA,EAAC;AAAA,EAC/C,kBAAkB,aAA0B;AAAA,EAAC;AAC9C;","names":["OpenAI","subscriber"]}
|
package/dist/index.mjs
CHANGED
|
@@ -551,9 +551,9 @@ var AgenticEnvironment = class {
|
|
|
551
551
|
this.subscribers.push(subscriber);
|
|
552
552
|
for (const subscriber2 of this.subscribers) {
|
|
553
553
|
if (subscriber2 === subscriber2) {
|
|
554
|
-
subscriber2.onJoined(
|
|
554
|
+
subscriber2.onJoined();
|
|
555
555
|
} else {
|
|
556
|
-
subscriber2.onParticipantJoined(subscriber2
|
|
556
|
+
subscriber2.onParticipantJoined(subscriber2);
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
}
|
|
@@ -561,9 +561,9 @@ var AgenticEnvironment = class {
|
|
|
561
561
|
this.subscribers = this.subscribers.filter((p) => p !== subscriber);
|
|
562
562
|
for (const subscriber2 of this.subscribers) {
|
|
563
563
|
if (subscriber2 === subscriber2) {
|
|
564
|
-
subscriber2.onLeft(
|
|
564
|
+
subscriber2.onLeft();
|
|
565
565
|
} else {
|
|
566
|
-
subscriber2.onParticipantLeft(subscriber2
|
|
566
|
+
subscriber2.onParticipantLeft(subscriber2);
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
569
|
}
|
|
@@ -629,9 +629,9 @@ var BaseAgentParticipant = class extends Participant {
|
|
|
629
629
|
this.inferenceRunner = inferenceRunner;
|
|
630
630
|
this.functionCallRunner = functionCallRunner;
|
|
631
631
|
}
|
|
632
|
-
onJoined(
|
|
632
|
+
onJoined() {
|
|
633
633
|
}
|
|
634
|
-
onLeft(
|
|
634
|
+
onLeft() {
|
|
635
635
|
}
|
|
636
636
|
onParticipantJoined(participant) {
|
|
637
637
|
}
|
|
@@ -690,13 +690,13 @@ var BaseHumanParticipant = class extends Participant {
|
|
|
690
690
|
super();
|
|
691
691
|
this.inputSource = inputSource;
|
|
692
692
|
}
|
|
693
|
-
onJoined(
|
|
693
|
+
onJoined() {
|
|
694
694
|
}
|
|
695
|
-
onLeft(
|
|
695
|
+
onLeft() {
|
|
696
696
|
}
|
|
697
|
-
onParticipantJoined(participant
|
|
697
|
+
onParticipantJoined(participant) {
|
|
698
698
|
}
|
|
699
|
-
onParticipantLeft(participant
|
|
699
|
+
onParticipantLeft(participant) {
|
|
700
700
|
}
|
|
701
701
|
onMessage(message) {
|
|
702
702
|
}
|
|
@@ -781,10 +781,41 @@ var Gpt55 = class {
|
|
|
781
781
|
return this.effort.getReasoningEffort();
|
|
782
782
|
}
|
|
783
783
|
};
|
|
784
|
+
|
|
785
|
+
// src/application/observer.ts
|
|
786
|
+
var BaseObserverParticipant = class extends Participant {
|
|
787
|
+
onFunctionCall(item) {
|
|
788
|
+
}
|
|
789
|
+
onExternalFunctionCall(source, item) {
|
|
790
|
+
}
|
|
791
|
+
onFunctionCallOutput(item) {
|
|
792
|
+
}
|
|
793
|
+
onExternalFunctionCallOutput(source, item) {
|
|
794
|
+
}
|
|
795
|
+
onReasoning(item) {
|
|
796
|
+
}
|
|
797
|
+
onExternalReasoning(source, item) {
|
|
798
|
+
}
|
|
799
|
+
onModelMessage(item) {
|
|
800
|
+
}
|
|
801
|
+
onExternalModelMessage(source, item) {
|
|
802
|
+
}
|
|
803
|
+
onMessage(message) {
|
|
804
|
+
}
|
|
805
|
+
onJoined() {
|
|
806
|
+
}
|
|
807
|
+
onLeft() {
|
|
808
|
+
}
|
|
809
|
+
onParticipantJoined(participant) {
|
|
810
|
+
}
|
|
811
|
+
onParticipantLeft(participant) {
|
|
812
|
+
}
|
|
813
|
+
};
|
|
784
814
|
export {
|
|
785
815
|
AgenticEnvironment,
|
|
786
816
|
BaseAgentParticipant,
|
|
787
817
|
BaseHumanParticipant,
|
|
818
|
+
BaseObserverParticipant,
|
|
788
819
|
ContextItem,
|
|
789
820
|
DefaultFunctionCallRunner,
|
|
790
821
|
DeveloperMessageItem,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/domain/model-context/model-context.ts","../src/domain/model-context/context-item/context-item.ts","../src/domain/model-context/context-item/item-content/item-content.ts","../src/domain/model-context/context-item/item-content/input-text.ts","../src/domain/model-context/context-item/client-item/user-message.ts","../src/domain/model-context/context-item/client-item/developer-message.ts","../src/domain/model-context/context-item/item-content/output-text.ts","../src/domain/model-context/context-item/model-item/model-message.ts","../src/domain/model-context/context-item/model-item/function-call.ts","../src/domain/model-context/context-item/model-item/reasoning.ts","../src/domain/model-context/context-item/client-item/function-call-output.ts","../src/domain/generative-model/inference-response.ts","../src/domain/generative-model/token-usage.ts","../src/infrastructure/providers/openai/runtime/openai-responses.ts","../src/domain/generative-model/inference-request.ts","../src/infrastructure/providers/openai/reasoning-effort.ts","../src/infrastructure/providers/openai/models/gpt-5-4-nano.ts","../src/infrastructure/providers/openai/models/gpt-5-4.ts","../src/infrastructure/providers/openai/models/gpt-5-4-mini.ts","../src/infrastructure/repository/in-memory-model-context-repository.ts","../src/domain/model-context/context-item/client-item/system-message.ts","../src/domain/agentic-environment/participant.ts","../src/domain/agentic-environment/agentic-environment.ts","../src/application/agent.ts","../src/application/human.ts","../src/application/openai-inference-runner.ts","../src/application/function-call-runner.ts","../src/infrastructure/providers/openai/models/gpt-5-5.ts"],"sourcesContent":["import { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class ModelContext {\n\treadonly id: string\n\treadonly projectId: string\n\treadonly items: ContextItem[]\n\n\tconstructor(id: string, projectId: string, items: ContextItem[]) {\n\t\tthis.projectId = projectId\n\t\tthis.id = id\n\t\tthis.items = items\n\t}\n\n\taddContextItem(item: ContextItem): ModelContext {\n\t\tthis.items.push(item)\n\t\treturn this\n\t}\n\n\tapplyModelOutput(items: ContextItem[]): ModelContext {\n\t\tfor (const item of items) {\n\t\t\tconst itemType = item.getType()\n\t\t\tif (itemType !== \"function_call\" && itemType !== \"message\" && itemType !== \"reasoning\") {\n\t\t\t\tthrow new Error(`Invalid item type: ${itemType}`)\n\t\t\t}\n\t\t}\n\t\tthis.items.push(...items)\n\t\treturn this\n\t}\n\n\tgetItems(): ContextItem[] {\n\t\treturn this.items\n\t}\n\n\tgetLastItem(): ContextItem {\n\t\tif (this.items.length === 0) {\n\t\t\tthrow new Error(\"No items in context\")\n\t\t}\n\t\treturn this.items[this.items.length - 1]\n\t}\n\n\tstatic create(projectId: string): ModelContext {\n\t\tconst id = crypto.randomUUID()\n\t\treturn new ModelContext(id, projectId, [])\n\t}\n\n\tstatic rehydrate(data: { id: string; projectId: string; items: ContextItem[] }): ModelContext {\n\t\treturn new ModelContext(data.id, data.projectId, data.items)\n\t}\n\n\ttoJSON(): any {\n\t\treturn this.items.map((item) => item.toJSON())\n\t}\n}\n","export abstract class ContextItem {\n\tabstract readonly type: string\n\n\tgetType(): string {\n\t\treturn this.type\n\t}\n\n\tabstract toJSON(): any\n}\n","export abstract class ItemContent {\n\tabstract readonly type: string\n}\n","import { ItemContent } from \"@domain/model-context/context-item/item-content/item-content\"\n\nexport class InputText extends ItemContent {\n\treadonly type = \"input_text\"\n\n\tprivate constructor(public readonly text: string) {\n\t\tsuper()\n\t}\n\n\tstatic create(text: string): InputText {\n\t\treturn new InputText(text)\n\t}\n\n\tstatic rehydrate(data: { text: string }): InputText {\n\t\treturn new InputText(data.text)\n\t}\n\n\ttoJSON(): any[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttype: this.type,\n\t\t\t\ttext: this.text,\n\t\t\t},\n\t\t]\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\n\nexport class UserMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"user\"\n\treadonly content: InputText\n\n\tprivate constructor(content: InputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\tstatic create(text: string): UserMessageItem {\n\t\tconst content = InputText.create(text)\n\t\treturn new UserMessageItem(content)\n\t}\n\n\tstatic rehydrate(data: { text: string }): UserMessageItem {\n\t\tconst content = InputText.rehydrate(data)\n\t\treturn new UserMessageItem(content)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n}\n","import { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class DeveloperMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"developer\"\n\treadonly content: InputText\n\n\tprivate constructor(content: InputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n\n\tstatic create(text: string): DeveloperMessageItem {\n\t\tconst content = InputText.create(text)\n\t\treturn new DeveloperMessageItem(content)\n\t}\n\n\tstatic rehydrate(data: { text: string }): DeveloperMessageItem {\n\t\tconst content = InputText.rehydrate(data)\n\t\treturn new DeveloperMessageItem(content)\n\t}\n}\n","import { ItemContent } from \"@domain/model-context/context-item/item-content/item-content\"\n\nexport class OutputText extends ItemContent {\n\treadonly type = \"output_text\"\n\n\tprivate constructor(public readonly text: string) {\n\t\tsuper()\n\t}\n\n\tstatic rehydrate(data: { text: string }): OutputText {\n\t\treturn new OutputText(data.text)\n\t}\n\n\ttoJSON(): any[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttype: this.type,\n\t\t\t\ttext: this.text,\n\t\t\t},\n\t\t]\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { OutputText } from \"@domain/model-context/context-item/item-content/output-text\"\n\nexport class ModelMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"assistant\"\n\treadonly content: OutputText\n\n\tprivate constructor(content: OutputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\tstatic rehydrate(data: { text: string }): ModelMessageItem {\n\t\tconst content = OutputText.rehydrate(data)\n\t\treturn new ModelMessageItem(content)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class FunctionCallItem extends ContextItem {\n\treadonly type = \"function_call\"\n\treadonly callId: string\n\treadonly name: string\n\treadonly args: string\n\n\tprivate constructor(callId: string, name: string, args: string) {\n\t\tsuper()\n\t\tthis.callId = callId\n\t\tthis.name = name\n\t\tthis.args = args\n\t}\n\n\tstatic rehydrate(data: { callId: string; name: string; args: string }): FunctionCallItem {\n\t\treturn new FunctionCallItem(data.callId, data.name, data.args)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tcall_id: this.callId,\n\t\t\tname: this.name,\n\t\t\targuments: this.args,\n\t\t}\n\t}\n}\n","import { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\nimport { SummaryText } from \"@domain/model-context/context-item/item-content/summary-text\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class ReasoningItem extends ContextItem {\n\treadonly type = \"reasoning\"\n\treadonly content: InputText | undefined\n\treadonly encryptedContent: string | undefined\n\treadonly summary: SummaryText[]\n\n\tprivate constructor(\n\t\tcontent: InputText | undefined,\n\t\tencryptedContent?: string | undefined,\n\t\tsummary: SummaryText[] = [],\n\t) {\n\t\tsuper()\n\t\tthis.content = content\n\t\tthis.encryptedContent = encryptedContent\n\t\tthis.summary = summary\n\t}\n\n\tstatic rehydrate(data: {\n\t\tcontent: InputText | undefined\n\t\tencryptedContent: string | undefined\n\t\tsummary: SummaryText[]\n\t}): ReasoningItem {\n\t\treturn new ReasoningItem(data.content, data.encryptedContent, data.summary)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tcontent: this.content?.toJSON(),\n\t\t\tencryptedContent: this.encryptedContent,\n\t\t\tsummary: this.summary.map((s) => s.toJSON()),\n\t\t}\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\n\nexport class FunctionCallOutputItem extends ContextItem {\n\treadonly type = \"function_call_output\"\n\treadonly callId: string\n\treadonly output: InputText\n\n\tprivate constructor(callId: string, output: InputText) {\n\t\tsuper()\n\t\tthis.callId = callId\n\t\tthis.output = output\n\t}\n\n\tstatic create(callId: string, output: string): FunctionCallOutputItem {\n\t\tconst outputText = InputText.create(output)\n\t\treturn new FunctionCallOutputItem(callId, outputText)\n\t}\n\n\tstatic rehydrate(data: { callId: string; output: InputText }): FunctionCallOutputItem {\n\t\treturn new FunctionCallOutputItem(data.callId, data.output)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tcall_id: this.callId,\n\t\t\toutput: this.output.toJSON(),\n\t\t}\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { TokenUsage } from \"@domain/generative-model/token-usage\"\n\nexport class InferenceResponse {\n\treadonly contextItems: ContextItem[]\n\treadonly tokenUsage?: TokenUsage\n\n\tconstructor(contextItems: ContextItem[], tokenUsage: TokenUsage | undefined) {\n\t\tthis.contextItems = contextItems\n\t\tthis.tokenUsage = tokenUsage\n\t}\n}\n","export class InputTokenDetails {\n\treadonly cached_tokens: number\n\n\tconstructor(cached_tokens: number) {\n\t\tthis.cached_tokens = cached_tokens\n\t}\n}\n\nexport class OutputTokenDetails {\n\treadonly reasoning_tokens: number\n\n\tconstructor(reasoning_tokens: number) {\n\t\tthis.reasoning_tokens = reasoning_tokens\n\t}\n}\n\nexport class TokenUsage {\n\treadonly inputTokens: number\n\treadonly outputTokens: number\n\treadonly totalTokens: number\n\treadonly inputTokenDetails: InputTokenDetails\n\treadonly outputTokenDetails: OutputTokenDetails\n\n\tconstructor(\n\t\tinputTokens: number,\n\t\toutputTokens: number,\n\t\ttotalTokens: number,\n\t\tinputTokenDetails: InputTokenDetails,\n\t\toutputTokenDetails: OutputTokenDetails,\n\t) {\n\t\tthis.inputTokens = inputTokens\n\t\tthis.outputTokens = outputTokens\n\t\tthis.totalTokens = totalTokens\n\t\tthis.inputTokenDetails = inputTokenDetails\n\t\tthis.outputTokenDetails = outputTokenDetails\n\t}\n}\n","import { ModelContext } from \"@domain/model-context/model-context\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { InferenceRequest } from \"@domain/generative-model/inference-request\"\nimport { InferenceResponse } from \"@domain/generative-model/inference-response\"\nimport { ModelRuntime } from \"@domain/generative-model/runtime/model-runtime\"\nimport { InputTokenDetails, OutputTokenDetails, TokenUsage } from \"@domain/generative-model/token-usage\"\nimport OpenAI from \"openai\"\n\nexport class OpenAIResponses implements ModelRuntime {\n\tprivate readonly client: OpenAI\n\tconstructor() {\n\t\tthis.client = new OpenAI()\n\t}\n\n\tasync infer(inferenceRequest: InferenceRequest): Promise<InferenceResponse> {\n\t\tconst input = this.mapContextToRequest(inferenceRequest.context)\n\n\t\tconst specification = inferenceRequest.model.specification\n\n\t\tlet request: any = {\n\t\t\tmodel: specification.name,\n\t\t\tinput: input,\n\t\t}\n\n\t\tif (specification.supportFunctionCalling && inferenceRequest.model.getTools().length > 0) {\n\t\t\trequest.tools = inferenceRequest.model.getTools().map((tool) => {\n\t\t\t\treturn {\n\t\t\t\t\ttype: tool.type,\n\t\t\t\t\tname: tool.name,\n\t\t\t\t\tdescription: tool.description,\n\t\t\t\t\tparameters: tool.parameters,\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tif (specification.supportReasoningEffort) {\n\t\t\trequest.reasoning = {\n\t\t\t\teffort: inferenceRequest.model.getReasoningEffort(),\n\t\t\t}\n\t\t}\n\n\t\tconst response = await this.client.responses.create(request)\n\n\t\tconst contextItems = this.extractContextItems(response)\n\t\tconst tokenUsage = this.extractTokenUsage(response)\n\t\treturn new InferenceResponse(contextItems, tokenUsage)\n\t}\n\n\textractTokenUsage(response: OpenAI.Responses.Response): TokenUsage | undefined {\n\t\tif (!response.usage) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn new TokenUsage(\n\t\t\tresponse.usage.input_tokens,\n\t\t\tresponse.usage.output_tokens,\n\t\t\tresponse.usage.total_tokens,\n\t\t\tnew InputTokenDetails(response.usage.input_tokens_details.cached_tokens),\n\t\t\tnew OutputTokenDetails(response.usage.output_tokens_details.reasoning_tokens),\n\t\t)\n\t}\n\n\tmapContextToRequest(context: ModelContext): any[] {\n\t\treturn context.getItems().map((item) => item.toJSON())\n\t}\n\n\textractContextItems(response: any): ContextItem[] {\n\t\treturn response.output.map((item: any) => {\n\t\t\tif (item.type === \"message\" && item.role === \"assistant\") {\n\t\t\t\treturn ModelMessageItem.rehydrate(item.content[0] as { text: string })\n\t\t\t}\n\t\t\tif (item.type === \"function_call\") {\n\t\t\t\treturn FunctionCallItem.rehydrate({\n\t\t\t\t\tcallId: item.call_id,\n\t\t\t\t\tname: item.name,\n\t\t\t\t\targs: item.arguments,\n\t\t\t\t})\n\t\t\t}\n\t\t\tif (item.type === \"reasoning\") {\n\t\t\t\treturn ReasoningItem.rehydrate(item)\n\t\t\t}\n\t\t})\n\t}\n}\n","import { ModelContext } from \"@domain/model-context/model-context\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\n\nexport class InferenceRequest {\n\treadonly model: GenerativeModel & ReasoningEffort<string> & ToolCallingCapability\n\treadonly context: ModelContext\n\n\tconstructor(model: GenerativeModel & ReasoningEffort<string> & ToolCallingCapability, context: ModelContext) {\n\t\tthis.model = model\n\t\tthis.context = context\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\n\nexport type OpenAIReasoningEffortType = \"xhigh\" | \"high\" | \"medium\" | \"low\" | \"none\"\n\nexport class OpenAIReasoningEffort implements ReasoningEffort<OpenAIReasoningEffortType> {\n\treasoningEffort: OpenAIReasoningEffortType\n\n\tconstructor(reasoningEffort: OpenAIReasoningEffortType) {\n\t\tthis.reasoningEffort = reasoningEffort\n\t}\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.reasoningEffort = effort\n\t}\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\tif (!this.reasoningEffort) {\n\t\t\tthrow new Error(\"Reasoning effort not supported\")\n\t\t}\n\t\treturn this.reasoningEffort\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt54Nano implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.4-nano\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 400_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt54 implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.4\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 1_050_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt54Mini implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.4-mini\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 400_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n}\n","import { ModelContext } from \"@domain/model-context/model-context\"\nimport { ModelContextRepository } from \"@domain/model-context/model-context-repository\"\n\nexport class InMemoryModelContextRepository implements ModelContextRepository {\n\tprivate readonly store = new Map<string, ModelContext>()\n\tprivate readonly projectIndex = new Map<string, Set<string>>()\n\n\tasync save(context: ModelContext): Promise<void> {\n\t\tconst existing = this.store.get(context.id)\n\t\tif (existing && existing.projectId !== context.projectId) {\n\t\t\tconst prevSet = this.projectIndex.get(existing.projectId)\n\t\t\tprevSet?.delete(existing.id)\n\t\t\tif (prevSet && prevSet.size === 0) this.projectIndex.delete(existing.projectId)\n\t\t}\n\n\t\tthis.store.set(context.id, this.clone(context))\n\n\t\tlet set = this.projectIndex.get(context.projectId)\n\t\tif (!set) {\n\t\t\tset = new Set<string>()\n\t\t\tthis.projectIndex.set(context.projectId, set)\n\t\t}\n\t\tset.add(context.id)\n\t}\n\n\tasync get(id: string): Promise<ModelContext> {\n\t\tconst context = this.store.get(id)\n\t\tif (!context) {\n\t\t\tthrow new Error(`Context not found: ${id}`)\n\t\t}\n\t\treturn this.clone(context)\n\t}\n\n\tasync getByProjectId(projectId: string): Promise<ModelContext[]> {\n\t\tconst ids = this.projectIndex.get(projectId)\n\t\tif (!ids || ids.size === 0) return []\n\t\treturn [...ids]\n\t\t\t.map((id) => this.store.get(id))\n\t\t\t.filter((c): c is ModelContext => Boolean(c))\n\t\t\t.map((c) => this.clone(c))\n\t}\n\n\tprivate clone(context: ModelContext): ModelContext {\n\t\treturn ModelContext.rehydrate({\n\t\t\tid: context.id,\n\t\t\tprojectId: context.projectId,\n\t\t\titems: [...context.getItems()],\n\t\t})\n\t}\n}\n","import { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class SystemMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"system\"\n\treadonly content: InputText\n\n\tprivate constructor(content: InputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n\n\tstatic create(text: string): SystemMessageItem {\n\t\tconst content = InputText.create(text)\n\t\treturn new SystemMessageItem(content)\n\t}\n\n\tstatic rehydrate(data: { text: string }): SystemMessageItem {\n\t\tconst content = InputText.rehydrate(data)\n\t\treturn new SystemMessageItem(content)\n\t}\n}\n","import { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { AgenticEnvironment } from \"./agentic-environment\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\n\nexport abstract class Participant {\n\tprivate environments: AgenticEnvironment[] = []\n\n\tjoin(environment: AgenticEnvironment) {\n\t\tif (this.isJoinedTo(environment)) {\n\t\t\treturn\n\t\t}\n\t\tenvironment.subscribe(this)\n\t\tthis.environments.push(environment)\n\t}\n\n\tleave(environment: AgenticEnvironment) {\n\t\tif (!this.isJoinedTo(environment)) {\n\t\t\treturn\n\t\t}\n\t\tenvironment.unsubscribe(this)\n\t\tthis.environments = this.environments.filter((e) => e !== environment)\n\t}\n\n\tprotected isJoinedTo(environment: AgenticEnvironment): boolean {\n\t\treturn this.environments.includes(environment)\n\t}\n\n\tgetEnvironments(): AgenticEnvironment[] {\n\t\treturn this.environments\n\t}\n\n\tabstract onParticipantJoined(participant: Participant, environment: AgenticEnvironment): Promise<void> | void\n\n\tabstract onParticipantLeft(participant: Participant, environment: AgenticEnvironment): Promise<void> | void\n\n\tabstract onJoined(environment: AgenticEnvironment): Promise<void> | void\n\n\tabstract onLeft(environment: AgenticEnvironment): Promise<void> | void\n\n\tabstract onFunctionCall(item: FunctionCallItem): Promise<void> | void\n\n\tabstract onExternalFunctionCall(source: Participant, item: FunctionCallItem): Promise<void> | void\n\n\tabstract onFunctionCallOutput(item: FunctionCallOutputItem): Promise<void> | void\n\n\tabstract onExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem): Promise<void> | void\n\n\tabstract onReasoning(item: ReasoningItem): Promise<void> | void\n\n\tabstract onExternalReasoning(source: Participant, item: ReasoningItem): Promise<void> | void\n\n\tabstract onModelMessage(item: ModelMessageItem): Promise<void> | void\n\n\tabstract onExternalModelMessage(source: Participant, item: ModelMessageItem): Promise<void> | void\n\n\tabstract onMessage(message: string): Promise<void> | void\n}\n","import { Participant } from \"@domain/agentic-environment/participant\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\n\nexport class AgenticEnvironment {\n\tprotected subscribers: Participant[] = []\n\tprivate isActive = false\n\n\tsubscribe(subscriber: Participant) {\n\t\tthis.subscribers.push(subscriber)\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === subscriber) {\n\t\t\t\tsubscriber.onJoined(this)\n\t\t\t} else {\n\t\t\t\tsubscriber.onParticipantJoined(subscriber, this)\n\t\t\t}\n\t\t}\n\t}\n\n\tunsubscribe(subscriber: Participant) {\n\t\tthis.subscribers = this.subscribers.filter((p) => p !== subscriber)\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === subscriber) {\n\t\t\t\tsubscriber.onLeft(this)\n\t\t\t} else {\n\t\t\t\tsubscriber.onParticipantLeft(subscriber, this)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverFunctionCall(source: Participant, item: FunctionCallItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onFunctionCall(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalFunctionCall(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverModelMessage(source: Participant, item: ModelMessageItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onModelMessage(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalModelMessage(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverReasoning(source: Participant, item: ReasoningItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onReasoning(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalReasoning(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverFunctionCallOutput(source: Participant, item: FunctionCallOutputItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onFunctionCallOutput(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalFunctionCallOutput(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverMessage(source: Participant, message: string): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) continue\n\n\t\t\tsubscriber.onMessage(message)\n\t\t}\n\t}\n\n\tstart() {\n\t\tthis.isActive = true\n\t\twhile (this.isActive) {\n\t\t\tsetTimeout(() => {}, 100)\n\t\t}\n\t}\n\n\tstop() {\n\t\tthis.isActive = false\n\t}\n}\n","import { AgenticEnvironment } from \"@domain/agentic-environment/agentic-environment\"\nimport { FunctionCallCapable, InferenceCapable, InputCapable } from \"@domain/agentic-environment/capabilities\"\nimport { Participant } from \"@domain/agentic-environment/participant\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelContext } from \"@domain/model-context/model-context\"\nimport { InferenceRunner } from \"@domain/agentic-environment/inference-runner\"\nimport { FunctionCallRunner } from \"@domain/agentic-environment/function-call-runner\"\nimport { InputStream } from \"@domain/agentic-environment/input-stream\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\n\nexport class BaseAgentParticipant extends Participant implements InputCapable, InferenceCapable, FunctionCallCapable {\n\tprivate inputSource: InputStream\n\tprivate inferenceRunner: InferenceRunner\n\tprivate functionCallRunner: FunctionCallRunner\n\n\tconstructor(inputSource: InputStream, inferenceRunner: InferenceRunner, functionCallRunner: FunctionCallRunner) {\n\t\tsuper()\n\t\tthis.inputSource = inputSource\n\t\tthis.inferenceRunner = inferenceRunner\n\t\tthis.functionCallRunner = functionCallRunner\n\t}\n\n\tonJoined(environment: AgenticEnvironment) {}\n\n\tonLeft(environment: AgenticEnvironment) {}\n\n\tonParticipantJoined(participant: Participant) {}\n\n\tonParticipantLeft(participant: Participant) {}\n\n\tonFunctionCall(item: FunctionCallItem) {}\n\n\tonExternalFunctionCall(source: Participant, item: FunctionCallItem) {}\n\n\tonFunctionCallOutput(item: FunctionCallOutputItem) {}\n\n\tonExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem) {}\n\n\tonReasoning(item: ReasoningItem) {}\n\n\tonExternalReasoning(source: Participant, item: ReasoningItem) {}\n\n\tonModelMessage(item: ModelMessageItem) {}\n\n\tonExternalModelMessage(source: Participant, item: ModelMessageItem) {}\n\n\tonMessage(message: string) {}\n\n\tasync executeFunctionCall(\n\t\tenvironment: AgenticEnvironment,\n\t\tfunctionCallItem: FunctionCallItem,\n\t\tsignal?: AbortSignal,\n\t): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.functionCallRunner.run(functionCallItem, signal)\n\n\t\tfor await (const item of stream) {\n\t\t\tawait environment.deliverFunctionCallOutput(this, item)\n\t\t}\n\t}\n\n\tasync runInference(\n\t\tenvironment: AgenticEnvironment,\n\t\tcontext: ModelContext,\n\t\tmodel: GenerativeModel,\n\t\tsignal?: AbortSignal,\n\t): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.inferenceRunner.run(context, model, signal)\n\n\t\tfor await (const item of stream) {\n\t\t\tif (item.type === \"reasoning\") {\n\t\t\t\tawait environment.deliverReasoning(this, item)\n\t\t\t} else if (item.type === \"function_call\") {\n\t\t\t\tawait environment.deliverFunctionCall(this, item)\n\t\t\t} else if (item.type === \"message\" && item.role === \"assistant\") {\n\t\t\t\tawait environment.deliverModelMessage(this, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tasync streamInput(environment: AgenticEnvironment): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.inputSource.stream()\n\t\tfor await (const message of stream) {\n\t\t\tawait environment.deliverMessage(this, message)\n\t\t}\n\t}\n}\n","import { AgenticEnvironment } from \"@domain/agentic-environment/agentic-environment\"\nimport { InputCapable } from \"@domain/agentic-environment/capabilities\"\nimport { InputStream } from \"@domain/agentic-environment/input-stream\"\nimport { Participant } from \"@domain/agentic-environment/participant\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\n\nexport class BaseHumanParticipant extends Participant implements InputCapable {\n\tprivate inputSource: InputStream\n\n\tconstructor(inputSource: InputStream) {\n\t\tsuper()\n\t\tthis.inputSource = inputSource\n\t}\n\n\tonJoined(environment: AgenticEnvironment) {}\n\t\n\tonLeft(environment: AgenticEnvironment) {}\n\n\tonParticipantJoined(participant: Participant, environment: AgenticEnvironment) {}\n\n\tonParticipantLeft(participant: Participant, environment: AgenticEnvironment) {}\n\n\tonMessage(message: string) {}\n\n\tonFunctionCall(item: FunctionCallItem) {}\n\n\tonFunctionCallOutput(item: FunctionCallOutputItem) {}\n\n\tonReasoning(item: ReasoningItem) {}\n\n\tonModelMessage(item: ModelMessageItem) {}\n\n\tonExternalFunctionCall(source: Participant, item: FunctionCallItem) {}\n\n\tonExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem) {}\n\n\tonExternalReasoning(source: Participant, item: ReasoningItem) {}\n\n\tonExternalModelMessage(source: Participant, item: ModelMessageItem) {}\n\n\tasync streamInput(environment: AgenticEnvironment): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.inputSource.stream()\n\t\tfor await (const message of stream) {\n\t\t\tawait environment.deliverMessage(this, message)\n\t\t}\n\t}\n}\n","import { InferenceRunner } from \"@domain/agentic-environment/inference-runner\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { InferenceRequest } from \"@domain/generative-model/inference-request\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { ModelContext } from \"@domain/model-context/model-context\"\nimport { OpenAIResponses } from \"@infra/providers/openai/runtime/openai-responses\"\n\ntype InferenceItem = ReasoningItem | FunctionCallItem | ModelMessageItem\n\nexport class OpenAIInferenceRunner implements InferenceRunner {\n\tprivate readonly runtime = new OpenAIResponses()\n\n\tasync *run(context: ModelContext, model: GenerativeModel, signal?: AbortSignal): AsyncIterable<InferenceItem> {\n\t\tconst response = await this.runtime.infer(new InferenceRequest(model, context))\n\t\tfor (const item of response.contextItems) {\n\t\t\tyield item as InferenceItem\n\t\t}\n\t}\n}\n","import { FunctionCallRunner } from \"@domain/agentic-environment/function-call-runner\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\n\nexport class DefaultFunctionCallRunner implements FunctionCallRunner {\n\tconstructor(private readonly tools: Tool[]) {}\n\n\tasync *run(call: FunctionCallItem, signal?: AbortSignal): AsyncIterable<FunctionCallOutputItem> {\n\t\tconst tool = this.tools.find((t) => t.name === call.name)\n\t\tif (!tool) throw new Error(`Unknown tool: ${call.name}`)\n\n\t\tconst result = await tool.invoke(JSON.parse(call.args))\n\t\tyield FunctionCallOutputItem.create(call.callId, JSON.stringify(result))\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt55 implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.5\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 1_050_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n}\n"],"mappings":";AAEO,IAAM,eAAN,MAAM,cAAa;AAAA,EAKzB,YAAY,IAAY,WAAmB,OAAsB;AAChE,SAAK,YAAY;AACjB,SAAK,KAAK;AACV,SAAK,QAAQ;AAAA,EACd;AAAA,EAEA,eAAe,MAAiC;AAC/C,SAAK,MAAM,KAAK,IAAI;AACpB,WAAO;AAAA,EACR;AAAA,EAEA,iBAAiB,OAAoC;AACpD,eAAW,QAAQ,OAAO;AACzB,YAAM,WAAW,KAAK,QAAQ;AAC9B,UAAI,aAAa,mBAAmB,aAAa,aAAa,aAAa,aAAa;AACvF,cAAM,IAAI,MAAM,sBAAsB,QAAQ,EAAE;AAAA,MACjD;AAAA,IACD;AACA,SAAK,MAAM,KAAK,GAAG,KAAK;AACxB,WAAO;AAAA,EACR;AAAA,EAEA,WAA0B;AACzB,WAAO,KAAK;AAAA,EACb;AAAA,EAEA,cAA2B;AAC1B,QAAI,KAAK,MAAM,WAAW,GAAG;AAC5B,YAAM,IAAI,MAAM,qBAAqB;AAAA,IACtC;AACA,WAAO,KAAK,MAAM,KAAK,MAAM,SAAS,CAAC;AAAA,EACxC;AAAA,EAEA,OAAO,OAAO,WAAiC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AAK,OAAO,mBAAmB,MAAM;AAAA,EACtC;AAAA,EAEA,qBAAgD;AAC/C,WAAO,KAAK,OAAO,mBAAmB;AAAA,EACvC;AACD;","names":["subscriber"]}
|
|
1
|
+
{"version":3,"sources":["../src/domain/model-context/model-context.ts","../src/domain/model-context/context-item/context-item.ts","../src/domain/model-context/context-item/item-content/item-content.ts","../src/domain/model-context/context-item/item-content/input-text.ts","../src/domain/model-context/context-item/client-item/user-message.ts","../src/domain/model-context/context-item/client-item/developer-message.ts","../src/domain/model-context/context-item/item-content/output-text.ts","../src/domain/model-context/context-item/model-item/model-message.ts","../src/domain/model-context/context-item/model-item/function-call.ts","../src/domain/model-context/context-item/model-item/reasoning.ts","../src/domain/model-context/context-item/client-item/function-call-output.ts","../src/domain/generative-model/inference-response.ts","../src/domain/generative-model/token-usage.ts","../src/infrastructure/providers/openai/runtime/openai-responses.ts","../src/domain/generative-model/inference-request.ts","../src/infrastructure/providers/openai/reasoning-effort.ts","../src/infrastructure/providers/openai/models/gpt-5-4-nano.ts","../src/infrastructure/providers/openai/models/gpt-5-4.ts","../src/infrastructure/providers/openai/models/gpt-5-4-mini.ts","../src/infrastructure/repository/in-memory-model-context-repository.ts","../src/domain/model-context/context-item/client-item/system-message.ts","../src/domain/agentic-environment/participant.ts","../src/domain/agentic-environment/agentic-environment.ts","../src/application/agent.ts","../src/application/human.ts","../src/application/openai-inference-runner.ts","../src/application/function-call-runner.ts","../src/infrastructure/providers/openai/models/gpt-5-5.ts","../src/application/observer.ts"],"sourcesContent":["import { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class ModelContext {\n\treadonly id: string\n\treadonly projectId: string\n\treadonly items: ContextItem[]\n\n\tconstructor(id: string, projectId: string, items: ContextItem[]) {\n\t\tthis.projectId = projectId\n\t\tthis.id = id\n\t\tthis.items = items\n\t}\n\n\taddContextItem(item: ContextItem): ModelContext {\n\t\tthis.items.push(item)\n\t\treturn this\n\t}\n\n\tapplyModelOutput(items: ContextItem[]): ModelContext {\n\t\tfor (const item of items) {\n\t\t\tconst itemType = item.getType()\n\t\t\tif (itemType !== \"function_call\" && itemType !== \"message\" && itemType !== \"reasoning\") {\n\t\t\t\tthrow new Error(`Invalid item type: ${itemType}`)\n\t\t\t}\n\t\t}\n\t\tthis.items.push(...items)\n\t\treturn this\n\t}\n\n\tgetItems(): ContextItem[] {\n\t\treturn this.items\n\t}\n\n\tgetLastItem(): ContextItem {\n\t\tif (this.items.length === 0) {\n\t\t\tthrow new Error(\"No items in context\")\n\t\t}\n\t\treturn this.items[this.items.length - 1]\n\t}\n\n\tstatic create(projectId: string): ModelContext {\n\t\tconst id = crypto.randomUUID()\n\t\treturn new ModelContext(id, projectId, [])\n\t}\n\n\tstatic rehydrate(data: { id: string; projectId: string; items: ContextItem[] }): ModelContext {\n\t\treturn new ModelContext(data.id, data.projectId, data.items)\n\t}\n\n\ttoJSON(): any {\n\t\treturn this.items.map((item) => item.toJSON())\n\t}\n}\n","export abstract class ContextItem {\n\tabstract readonly type: string\n\n\tgetType(): string {\n\t\treturn this.type\n\t}\n\n\tabstract toJSON(): any\n}\n","export abstract class ItemContent {\n\tabstract readonly type: string\n}\n","import { ItemContent } from \"@domain/model-context/context-item/item-content/item-content\"\n\nexport class InputText extends ItemContent {\n\treadonly type = \"input_text\"\n\n\tprivate constructor(public readonly text: string) {\n\t\tsuper()\n\t}\n\n\tstatic create(text: string): InputText {\n\t\treturn new InputText(text)\n\t}\n\n\tstatic rehydrate(data: { text: string }): InputText {\n\t\treturn new InputText(data.text)\n\t}\n\n\ttoJSON(): any[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttype: this.type,\n\t\t\t\ttext: this.text,\n\t\t\t},\n\t\t]\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\n\nexport class UserMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"user\"\n\treadonly content: InputText\n\n\tprivate constructor(content: InputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\tstatic create(text: string): UserMessageItem {\n\t\tconst content = InputText.create(text)\n\t\treturn new UserMessageItem(content)\n\t}\n\n\tstatic rehydrate(data: { text: string }): UserMessageItem {\n\t\tconst content = InputText.rehydrate(data)\n\t\treturn new UserMessageItem(content)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n}\n","import { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class DeveloperMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"developer\"\n\treadonly content: InputText\n\n\tprivate constructor(content: InputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n\n\tstatic create(text: string): DeveloperMessageItem {\n\t\tconst content = InputText.create(text)\n\t\treturn new DeveloperMessageItem(content)\n\t}\n\n\tstatic rehydrate(data: { text: string }): DeveloperMessageItem {\n\t\tconst content = InputText.rehydrate(data)\n\t\treturn new DeveloperMessageItem(content)\n\t}\n}\n","import { ItemContent } from \"@domain/model-context/context-item/item-content/item-content\"\n\nexport class OutputText extends ItemContent {\n\treadonly type = \"output_text\"\n\n\tprivate constructor(public readonly text: string) {\n\t\tsuper()\n\t}\n\n\tstatic rehydrate(data: { text: string }): OutputText {\n\t\treturn new OutputText(data.text)\n\t}\n\n\ttoJSON(): any[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttype: this.type,\n\t\t\t\ttext: this.text,\n\t\t\t},\n\t\t]\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { OutputText } from \"@domain/model-context/context-item/item-content/output-text\"\n\nexport class ModelMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"assistant\"\n\treadonly content: OutputText\n\n\tprivate constructor(content: OutputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\tstatic rehydrate(data: { text: string }): ModelMessageItem {\n\t\tconst content = OutputText.rehydrate(data)\n\t\treturn new ModelMessageItem(content)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class FunctionCallItem extends ContextItem {\n\treadonly type = \"function_call\"\n\treadonly callId: string\n\treadonly name: string\n\treadonly args: string\n\n\tprivate constructor(callId: string, name: string, args: string) {\n\t\tsuper()\n\t\tthis.callId = callId\n\t\tthis.name = name\n\t\tthis.args = args\n\t}\n\n\tstatic rehydrate(data: { callId: string; name: string; args: string }): FunctionCallItem {\n\t\treturn new FunctionCallItem(data.callId, data.name, data.args)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tcall_id: this.callId,\n\t\t\tname: this.name,\n\t\t\targuments: this.args,\n\t\t}\n\t}\n}\n","import { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\nimport { SummaryText } from \"@domain/model-context/context-item/item-content/summary-text\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class ReasoningItem extends ContextItem {\n\treadonly type = \"reasoning\"\n\treadonly content: InputText | undefined\n\treadonly encryptedContent: string | undefined\n\treadonly summary: SummaryText[]\n\n\tprivate constructor(\n\t\tcontent: InputText | undefined,\n\t\tencryptedContent?: string | undefined,\n\t\tsummary: SummaryText[] = [],\n\t) {\n\t\tsuper()\n\t\tthis.content = content\n\t\tthis.encryptedContent = encryptedContent\n\t\tthis.summary = summary\n\t}\n\n\tstatic rehydrate(data: {\n\t\tcontent: InputText | undefined\n\t\tencryptedContent: string | undefined\n\t\tsummary: SummaryText[]\n\t}): ReasoningItem {\n\t\treturn new ReasoningItem(data.content, data.encryptedContent, data.summary)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tcontent: this.content?.toJSON(),\n\t\t\tencryptedContent: this.encryptedContent,\n\t\t\tsummary: this.summary.map((s) => s.toJSON()),\n\t\t}\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\n\nexport class FunctionCallOutputItem extends ContextItem {\n\treadonly type = \"function_call_output\"\n\treadonly callId: string\n\treadonly output: InputText\n\n\tprivate constructor(callId: string, output: InputText) {\n\t\tsuper()\n\t\tthis.callId = callId\n\t\tthis.output = output\n\t}\n\n\tstatic create(callId: string, output: string): FunctionCallOutputItem {\n\t\tconst outputText = InputText.create(output)\n\t\treturn new FunctionCallOutputItem(callId, outputText)\n\t}\n\n\tstatic rehydrate(data: { callId: string; output: InputText }): FunctionCallOutputItem {\n\t\treturn new FunctionCallOutputItem(data.callId, data.output)\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tcall_id: this.callId,\n\t\t\toutput: this.output.toJSON(),\n\t\t}\n\t}\n}\n","import { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { TokenUsage } from \"@domain/generative-model/token-usage\"\n\nexport class InferenceResponse {\n\treadonly contextItems: ContextItem[]\n\treadonly tokenUsage?: TokenUsage\n\n\tconstructor(contextItems: ContextItem[], tokenUsage: TokenUsage | undefined) {\n\t\tthis.contextItems = contextItems\n\t\tthis.tokenUsage = tokenUsage\n\t}\n}\n","export class InputTokenDetails {\n\treadonly cached_tokens: number\n\n\tconstructor(cached_tokens: number) {\n\t\tthis.cached_tokens = cached_tokens\n\t}\n}\n\nexport class OutputTokenDetails {\n\treadonly reasoning_tokens: number\n\n\tconstructor(reasoning_tokens: number) {\n\t\tthis.reasoning_tokens = reasoning_tokens\n\t}\n}\n\nexport class TokenUsage {\n\treadonly inputTokens: number\n\treadonly outputTokens: number\n\treadonly totalTokens: number\n\treadonly inputTokenDetails: InputTokenDetails\n\treadonly outputTokenDetails: OutputTokenDetails\n\n\tconstructor(\n\t\tinputTokens: number,\n\t\toutputTokens: number,\n\t\ttotalTokens: number,\n\t\tinputTokenDetails: InputTokenDetails,\n\t\toutputTokenDetails: OutputTokenDetails,\n\t) {\n\t\tthis.inputTokens = inputTokens\n\t\tthis.outputTokens = outputTokens\n\t\tthis.totalTokens = totalTokens\n\t\tthis.inputTokenDetails = inputTokenDetails\n\t\tthis.outputTokenDetails = outputTokenDetails\n\t}\n}\n","import { ModelContext } from \"@domain/model-context/model-context\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { InferenceRequest } from \"@domain/generative-model/inference-request\"\nimport { InferenceResponse } from \"@domain/generative-model/inference-response\"\nimport { ModelRuntime } from \"@domain/generative-model/runtime/model-runtime\"\nimport { InputTokenDetails, OutputTokenDetails, TokenUsage } from \"@domain/generative-model/token-usage\"\nimport OpenAI from \"openai\"\n\nexport class OpenAIResponses implements ModelRuntime {\n\tprivate readonly client: OpenAI\n\tconstructor() {\n\t\tthis.client = new OpenAI()\n\t}\n\n\tasync infer(inferenceRequest: InferenceRequest): Promise<InferenceResponse> {\n\t\tconst input = this.mapContextToRequest(inferenceRequest.context)\n\n\t\tconst specification = inferenceRequest.model.specification\n\n\t\tlet request: any = {\n\t\t\tmodel: specification.name,\n\t\t\tinput: input,\n\t\t}\n\n\t\tif (specification.supportFunctionCalling && inferenceRequest.model.getTools().length > 0) {\n\t\t\trequest.tools = inferenceRequest.model.getTools().map((tool) => {\n\t\t\t\treturn {\n\t\t\t\t\ttype: tool.type,\n\t\t\t\t\tname: tool.name,\n\t\t\t\t\tdescription: tool.description,\n\t\t\t\t\tparameters: tool.parameters,\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tif (specification.supportReasoningEffort) {\n\t\t\trequest.reasoning = {\n\t\t\t\teffort: inferenceRequest.model.getReasoningEffort(),\n\t\t\t}\n\t\t}\n\n\t\tconst response = await this.client.responses.create(request)\n\n\t\tconst contextItems = this.extractContextItems(response)\n\t\tconst tokenUsage = this.extractTokenUsage(response)\n\t\treturn new InferenceResponse(contextItems, tokenUsage)\n\t}\n\n\textractTokenUsage(response: OpenAI.Responses.Response): TokenUsage | undefined {\n\t\tif (!response.usage) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn new TokenUsage(\n\t\t\tresponse.usage.input_tokens,\n\t\t\tresponse.usage.output_tokens,\n\t\t\tresponse.usage.total_tokens,\n\t\t\tnew InputTokenDetails(response.usage.input_tokens_details.cached_tokens),\n\t\t\tnew OutputTokenDetails(response.usage.output_tokens_details.reasoning_tokens),\n\t\t)\n\t}\n\n\tmapContextToRequest(context: ModelContext): any[] {\n\t\treturn context.getItems().map((item) => item.toJSON())\n\t}\n\n\textractContextItems(response: any): ContextItem[] {\n\t\treturn response.output.map((item: any) => {\n\t\t\tif (item.type === \"message\" && item.role === \"assistant\") {\n\t\t\t\treturn ModelMessageItem.rehydrate(item.content[0] as { text: string })\n\t\t\t}\n\t\t\tif (item.type === \"function_call\") {\n\t\t\t\treturn FunctionCallItem.rehydrate({\n\t\t\t\t\tcallId: item.call_id,\n\t\t\t\t\tname: item.name,\n\t\t\t\t\targs: item.arguments,\n\t\t\t\t})\n\t\t\t}\n\t\t\tif (item.type === \"reasoning\") {\n\t\t\t\treturn ReasoningItem.rehydrate(item)\n\t\t\t}\n\t\t})\n\t}\n}\n","import { ModelContext } from \"@domain/model-context/model-context\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\n\nexport class InferenceRequest {\n\treadonly model: GenerativeModel & ReasoningEffort<string> & ToolCallingCapability\n\treadonly context: ModelContext\n\n\tconstructor(model: GenerativeModel & ReasoningEffort<string> & ToolCallingCapability, context: ModelContext) {\n\t\tthis.model = model\n\t\tthis.context = context\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\n\nexport type OpenAIReasoningEffortType = \"xhigh\" | \"high\" | \"medium\" | \"low\" | \"none\"\n\nexport class OpenAIReasoningEffort implements ReasoningEffort<OpenAIReasoningEffortType> {\n\treasoningEffort: OpenAIReasoningEffortType\n\n\tconstructor(reasoningEffort: OpenAIReasoningEffortType) {\n\t\tthis.reasoningEffort = reasoningEffort\n\t}\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.reasoningEffort = effort\n\t}\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\tif (!this.reasoningEffort) {\n\t\t\tthrow new Error(\"Reasoning effort not supported\")\n\t\t}\n\t\treturn this.reasoningEffort\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt54Nano implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.4-nano\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 400_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt54 implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.4\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 1_050_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt54Mini implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.4-mini\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 400_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n}\n","import { ModelContext } from \"@domain/model-context/model-context\"\nimport { ModelContextRepository } from \"@domain/model-context/model-context-repository\"\n\nexport class InMemoryModelContextRepository implements ModelContextRepository {\n\tprivate readonly store = new Map<string, ModelContext>()\n\tprivate readonly projectIndex = new Map<string, Set<string>>()\n\n\tasync save(context: ModelContext): Promise<void> {\n\t\tconst existing = this.store.get(context.id)\n\t\tif (existing && existing.projectId !== context.projectId) {\n\t\t\tconst prevSet = this.projectIndex.get(existing.projectId)\n\t\t\tprevSet?.delete(existing.id)\n\t\t\tif (prevSet && prevSet.size === 0) this.projectIndex.delete(existing.projectId)\n\t\t}\n\n\t\tthis.store.set(context.id, this.clone(context))\n\n\t\tlet set = this.projectIndex.get(context.projectId)\n\t\tif (!set) {\n\t\t\tset = new Set<string>()\n\t\t\tthis.projectIndex.set(context.projectId, set)\n\t\t}\n\t\tset.add(context.id)\n\t}\n\n\tasync get(id: string): Promise<ModelContext> {\n\t\tconst context = this.store.get(id)\n\t\tif (!context) {\n\t\t\tthrow new Error(`Context not found: ${id}`)\n\t\t}\n\t\treturn this.clone(context)\n\t}\n\n\tasync getByProjectId(projectId: string): Promise<ModelContext[]> {\n\t\tconst ids = this.projectIndex.get(projectId)\n\t\tif (!ids || ids.size === 0) return []\n\t\treturn [...ids]\n\t\t\t.map((id) => this.store.get(id))\n\t\t\t.filter((c): c is ModelContext => Boolean(c))\n\t\t\t.map((c) => this.clone(c))\n\t}\n\n\tprivate clone(context: ModelContext): ModelContext {\n\t\treturn ModelContext.rehydrate({\n\t\t\tid: context.id,\n\t\t\tprojectId: context.projectId,\n\t\t\titems: [...context.getItems()],\n\t\t})\n\t}\n}\n","import { InputText } from \"@domain/model-context/context-item/item-content/input-text\"\nimport { ContextItem } from \"@domain/model-context/context-item/context-item\"\n\nexport class SystemMessageItem extends ContextItem {\n\treadonly type = \"message\"\n\treadonly role = \"system\"\n\treadonly content: InputText\n\n\tprivate constructor(content: InputText) {\n\t\tsuper()\n\t\tthis.content = content\n\t}\n\n\ttoJSON(): any {\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\trole: this.role,\n\t\t\tcontent: this.content.toJSON(),\n\t\t}\n\t}\n\n\tstatic create(text: string): SystemMessageItem {\n\t\tconst content = InputText.create(text)\n\t\treturn new SystemMessageItem(content)\n\t}\n\n\tstatic rehydrate(data: { text: string }): SystemMessageItem {\n\t\tconst content = InputText.rehydrate(data)\n\t\treturn new SystemMessageItem(content)\n\t}\n}\n","import { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { AgenticEnvironment } from \"./agentic-environment\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\n\nexport abstract class Participant {\n\tprivate environments: AgenticEnvironment[] = []\n\n\tjoin(environment: AgenticEnvironment) {\n\t\tif (this.isJoinedTo(environment)) {\n\t\t\treturn\n\t\t}\n\t\tenvironment.subscribe(this)\n\t\tthis.environments.push(environment)\n\t}\n\n\tleave(environment: AgenticEnvironment) {\n\t\tif (!this.isJoinedTo(environment)) {\n\t\t\treturn\n\t\t}\n\t\tenvironment.unsubscribe(this)\n\t\tthis.environments = this.environments.filter((e) => e !== environment)\n\t}\n\n\tprotected isJoinedTo(environment: AgenticEnvironment): boolean {\n\t\treturn this.environments.includes(environment)\n\t}\n\n\tgetEnvironments(): AgenticEnvironment[] {\n\t\treturn this.environments\n\t}\n\n\tabstract onParticipantJoined(participant: Participant): Promise<void> | void\n\n\tabstract onParticipantLeft(participant: Participant): Promise<void> | void\n\n\tabstract onJoined(): Promise<void> | void\n\n\tabstract onLeft(): Promise<void> | void\n\n\tabstract onFunctionCall(item: FunctionCallItem): Promise<void> | void\n\n\tabstract onExternalFunctionCall(source: Participant, item: FunctionCallItem): Promise<void> | void\n\n\tabstract onFunctionCallOutput(item: FunctionCallOutputItem): Promise<void> | void\n\n\tabstract onExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem): Promise<void> | void\n\n\tabstract onReasoning(item: ReasoningItem): Promise<void> | void\n\n\tabstract onExternalReasoning(source: Participant, item: ReasoningItem): Promise<void> | void\n\n\tabstract onModelMessage(item: ModelMessageItem): Promise<void> | void\n\n\tabstract onExternalModelMessage(source: Participant, item: ModelMessageItem): Promise<void> | void\n\n\tabstract onMessage(message: string): Promise<void> | void\n}\n","import { Participant } from \"@domain/agentic-environment/participant\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\n\nexport class AgenticEnvironment {\n\tprotected subscribers: Participant[] = []\n\tprivate isActive = false\n\n\tsubscribe(subscriber: Participant) {\n\t\tthis.subscribers.push(subscriber)\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === subscriber) {\n\t\t\t\tsubscriber.onJoined()\n\t\t\t} else {\n\t\t\t\tsubscriber.onParticipantJoined(subscriber)\n\t\t\t}\n\t\t}\n\t}\n\n\tunsubscribe(subscriber: Participant) {\n\t\tthis.subscribers = this.subscribers.filter((p) => p !== subscriber)\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === subscriber) {\n\t\t\t\tsubscriber.onLeft()\n\t\t\t} else {\n\t\t\t\tsubscriber.onParticipantLeft(subscriber)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverFunctionCall(source: Participant, item: FunctionCallItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onFunctionCall(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalFunctionCall(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverModelMessage(source: Participant, item: ModelMessageItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onModelMessage(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalModelMessage(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverReasoning(source: Participant, item: ReasoningItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onReasoning(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalReasoning(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverFunctionCallOutput(source: Participant, item: FunctionCallOutputItem): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) {\n\t\t\t\tsubscriber.onFunctionCallOutput(item)\n\t\t\t} else {\n\t\t\t\tsubscriber.onExternalFunctionCallOutput(source, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tdeliverMessage(source: Participant, message: string): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tif (subscriber === source) continue\n\n\t\t\tsubscriber.onMessage(message)\n\t\t}\n\t}\n\n\tstart() {\n\t\tthis.isActive = true\n\t\twhile (this.isActive) {\n\t\t\tsetTimeout(() => {}, 100)\n\t\t}\n\t}\n\n\tstop() {\n\t\tthis.isActive = false\n\t}\n}\n","import { AgenticEnvironment } from \"@domain/agentic-environment/agentic-environment\"\nimport { FunctionCallCapable, InferenceCapable, InputCapable } from \"@domain/agentic-environment/capabilities\"\nimport { Participant } from \"@domain/agentic-environment/participant\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelContext } from \"@domain/model-context/model-context\"\nimport { InferenceRunner } from \"@domain/agentic-environment/inference-runner\"\nimport { FunctionCallRunner } from \"@domain/agentic-environment/function-call-runner\"\nimport { InputStream } from \"@domain/agentic-environment/input-stream\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\n\nexport class BaseAgentParticipant extends Participant implements InputCapable, InferenceCapable, FunctionCallCapable {\n\tprivate inputSource: InputStream\n\tprivate inferenceRunner: InferenceRunner\n\tprivate functionCallRunner: FunctionCallRunner\n\n\tconstructor(inputSource: InputStream, inferenceRunner: InferenceRunner, functionCallRunner: FunctionCallRunner) {\n\t\tsuper()\n\t\tthis.inputSource = inputSource\n\t\tthis.inferenceRunner = inferenceRunner\n\t\tthis.functionCallRunner = functionCallRunner\n\t}\n\n\tonJoined() {}\n\n\tonLeft() {}\n\n\tonParticipantJoined(participant: Participant) {}\n\n\tonParticipantLeft(participant: Participant) {}\n\n\tonFunctionCall(item: FunctionCallItem) {}\n\n\tonExternalFunctionCall(source: Participant, item: FunctionCallItem) {}\n\n\tonFunctionCallOutput(item: FunctionCallOutputItem) {}\n\n\tonExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem) {}\n\n\tonReasoning(item: ReasoningItem) {}\n\n\tonExternalReasoning(source: Participant, item: ReasoningItem) {}\n\n\tonModelMessage(item: ModelMessageItem) {}\n\n\tonExternalModelMessage(source: Participant, item: ModelMessageItem) {}\n\n\tonMessage(message: string) {}\n\n\tasync executeFunctionCall(\n\t\tenvironment: AgenticEnvironment,\n\t\tfunctionCallItem: FunctionCallItem,\n\t\tsignal?: AbortSignal,\n\t): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.functionCallRunner.run(functionCallItem, signal)\n\n\t\tfor await (const item of stream) {\n\t\t\tawait environment.deliverFunctionCallOutput(this, item)\n\t\t}\n\t}\n\n\tasync runInference(\n\t\tenvironment: AgenticEnvironment,\n\t\tcontext: ModelContext,\n\t\tmodel: GenerativeModel,\n\t\tsignal?: AbortSignal,\n\t): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.inferenceRunner.run(context, model, signal)\n\n\t\tfor await (const item of stream) {\n\t\t\tif (item.type === \"reasoning\") {\n\t\t\t\tawait environment.deliverReasoning(this, item)\n\t\t\t} else if (item.type === \"function_call\") {\n\t\t\t\tawait environment.deliverFunctionCall(this, item)\n\t\t\t} else if (item.type === \"message\" && item.role === \"assistant\") {\n\t\t\t\tawait environment.deliverModelMessage(this, item)\n\t\t\t}\n\t\t}\n\t}\n\n\tasync streamInput(environment: AgenticEnvironment): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.inputSource.stream()\n\t\tfor await (const message of stream) {\n\t\t\tawait environment.deliverMessage(this, message)\n\t\t}\n\t}\n}\n","import { AgenticEnvironment } from \"@domain/agentic-environment/agentic-environment\"\nimport { InputCapable } from \"@domain/agentic-environment/capabilities\"\nimport { InputStream } from \"@domain/agentic-environment/input-stream\"\nimport { Participant } from \"@domain/agentic-environment/participant\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\n\nexport class BaseHumanParticipant extends Participant implements InputCapable {\n\tprivate inputSource: InputStream\n\n\tconstructor(inputSource: InputStream) {\n\t\tsuper()\n\t\tthis.inputSource = inputSource\n\t}\n\n\tonJoined() {}\n\t\n\tonLeft() {}\n\n\tonParticipantJoined(participant: Participant) {}\n\n\tonParticipantLeft(participant: Participant) {}\n\n\tonMessage(message: string) {}\n\n\tonFunctionCall(item: FunctionCallItem) {}\n\n\tonFunctionCallOutput(item: FunctionCallOutputItem) {}\n\n\tonReasoning(item: ReasoningItem) {}\n\n\tonModelMessage(item: ModelMessageItem) {}\n\n\tonExternalFunctionCall(source: Participant, item: FunctionCallItem) {}\n\n\tonExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem) {}\n\n\tonExternalReasoning(source: Participant, item: ReasoningItem) {}\n\n\tonExternalModelMessage(source: Participant, item: ModelMessageItem) {}\n\n\tasync streamInput(environment: AgenticEnvironment): Promise<void> {\n\t\tif (!this.isJoinedTo(environment)) return\n\n\t\tconst stream = this.inputSource.stream()\n\t\tfor await (const message of stream) {\n\t\t\tawait environment.deliverMessage(this, message)\n\t\t}\n\t}\n}\n","import { InferenceRunner } from \"@domain/agentic-environment/inference-runner\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { InferenceRequest } from \"@domain/generative-model/inference-request\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\"\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\"\nimport { ModelContext } from \"@domain/model-context/model-context\"\nimport { OpenAIResponses } from \"@infra/providers/openai/runtime/openai-responses\"\n\ntype InferenceItem = ReasoningItem | FunctionCallItem | ModelMessageItem\n\nexport class OpenAIInferenceRunner implements InferenceRunner {\n\tprivate readonly runtime = new OpenAIResponses()\n\n\tasync *run(context: ModelContext, model: GenerativeModel, signal?: AbortSignal): AsyncIterable<InferenceItem> {\n\t\tconst response = await this.runtime.infer(new InferenceRequest(model, context))\n\t\tfor (const item of response.contextItems) {\n\t\t\tyield item as InferenceItem\n\t\t}\n\t}\n}\n","import { FunctionCallRunner } from \"@domain/agentic-environment/function-call-runner\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\"\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\"\n\nexport class DefaultFunctionCallRunner implements FunctionCallRunner {\n\tconstructor(private readonly tools: Tool[]) {}\n\n\tasync *run(call: FunctionCallItem, signal?: AbortSignal): AsyncIterable<FunctionCallOutputItem> {\n\t\tconst tool = this.tools.find((t) => t.name === call.name)\n\t\tif (!tool) throw new Error(`Unknown tool: ${call.name}`)\n\n\t\tconst result = await tool.invoke(JSON.parse(call.args))\n\t\tyield FunctionCallOutputItem.create(call.callId, JSON.stringify(result))\n\t}\n}\n","import { ReasoningEffort } from \"@domain/generative-model/capabilities/reasoning-effort\"\nimport { ToolCallingCapability } from \"@domain/generative-model/capabilities/tool-calling\"\nimport { GenerativeModel } from \"@domain/generative-model/generative-model\"\nimport { Tool } from \"@domain/generative-model/tool\"\nimport { OpenAIReasoningEffort, OpenAIReasoningEffortType } from \"@infra/providers/openai/reasoning-effort\"\n\nexport class Gpt55 implements GenerativeModel, ReasoningEffort<OpenAIReasoningEffortType>, ToolCallingCapability {\n\treadonly specification = {\n\t\tname: \"gpt-5.5\",\n\t\tsupportReasoningEffort: true,\n\t\tdefaultReasoningEffort: \"none\" as OpenAIReasoningEffortType,\n\t\tsupportStreaming: true,\n\t\tcontextWindowSize: 1_050_000,\n\t\tmaxOutputTokens: 128_000,\n\t\tsupportFunctionCalling: true,\n\t}\n\n\tprivate tools: Tool[] = []\n\n\tsetTools(tools: Tool[]): void {\n\t\tthis.tools = tools\n\t}\n\n\tgetTools(): Tool[] {\n\t\treturn this.tools\n\t}\n\n\tprivate readonly effort: OpenAIReasoningEffort = new OpenAIReasoningEffort(\n\t\tthis.specification.defaultReasoningEffort,\n\t)\n\n\tsetReasoningEffort(effort: OpenAIReasoningEffortType): void {\n\t\tthis.effort.setReasoningEffort(effort)\n\t}\n\n\tgetReasoningEffort(): OpenAIReasoningEffortType {\n\t\treturn this.effort.getReasoningEffort()\n\t}\n}\n","import { Participant } from \"@domain/agentic-environment/participant\";\nimport { FunctionCallOutputItem } from \"@domain/model-context/context-item/client-item/function-call-output\";\nimport { FunctionCallItem } from \"@domain/model-context/context-item/model-item/function-call\";\nimport { ModelMessageItem } from \"@domain/model-context/context-item/model-item/model-message\";\nimport { ReasoningItem } from \"@domain/model-context/context-item/model-item/reasoning\";\n\nexport class BaseObserverParticipant extends Participant {\n onFunctionCall(item: FunctionCallItem) {}\n onExternalFunctionCall(source: Participant, item: FunctionCallItem) {}\n onFunctionCallOutput(item: FunctionCallOutputItem) {}\n onExternalFunctionCallOutput(source: Participant, item: FunctionCallOutputItem) {}\n onReasoning(item: ReasoningItem) {}\n onExternalReasoning(source: Participant, item: ReasoningItem) {}\n onModelMessage(item: ModelMessageItem) {}\n onExternalModelMessage(source: Participant, item: ModelMessageItem) {}\n onMessage(message: string) {}\n\tonJoined() {}\n\tonLeft() {}\n\tonParticipantJoined(participant: Participant) {}\n\tonParticipantLeft(participant: Participant) {}\n}"],"mappings":";AAEO,IAAM,eAAN,MAAM,cAAa;AAAA,EAKzB,YAAY,IAAY,WAAmB,OAAsB;AAChE,SAAK,YAAY;AACjB,SAAK,KAAK;AACV,SAAK,QAAQ;AAAA,EACd;AAAA,EAEA,eAAe,MAAiC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