@makaio/framework 1.0.0-dev-1781260968078 → 1.0.0-dev-1781367632837
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 +1 -1
- package/dist/.makaio-build.json +2 -2
- package/dist/adapter-UpcpZDOv.mjs +1 -0
- package/dist/adapter-subsystem/index.d.mts +493 -0
- package/dist/adapter-subsystem/index.mjs +1 -0
- package/dist/adapters/config/index.d.mts +1 -1
- package/dist/adapters/index.d.mts +12 -4
- package/dist/adapters/index.mjs +1 -1
- package/dist/bus/index.mjs +1 -1
- package/dist/clients/index.d.mts +4 -7
- package/dist/clients/index.mjs +1 -1
- package/dist/contracts/adapter/index.d.mts +2 -2
- package/dist/contracts/adapter/index.mjs +1 -1
- package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
- package/dist/contracts/artifact/index.d.mts +1 -1
- package/dist/contracts/client/index.d.mts +1 -1
- package/dist/contracts/config/index.d.mts +6 -6
- package/dist/contracts/extension/index.d.mts +2 -2
- package/dist/contracts/facet/index.d.mts +1 -1
- package/dist/contracts/index.d.mts +203 -38
- package/dist/contracts/index.mjs +1 -1
- package/dist/contracts/materialization/index.d.mts +3 -3
- package/dist/contracts/provider/index.d.mts +1 -1
- package/dist/contracts/session/index.d.mts +3 -3
- package/dist/contracts/session/index.mjs +1 -1
- package/dist/{definition-SiimP25_.d.mts → definition-DqJOg6Lv.d.mts} +1 -1
- package/dist/drizzle/0015_m_mqbh8q5b.sql +1 -0
- package/dist/drizzle/0016_m_mqbmq8h7.sql +1 -0
- package/dist/drizzle/0017_m_mqbnf924.sql +1 -0
- package/dist/drizzle/meta/_journal.json +21 -0
- package/dist/{handler-DSfSAlxx.mjs → handler-DqpiV9eA.mjs} +1 -1
- package/dist/handlers-BAB4fQNH.mjs +41 -0
- package/dist/inbound-hooks/index.d.mts +174 -0
- package/dist/inbound-hooks/index.mjs +1 -0
- package/dist/{index-BvSyOgTY.d.mts → index-7EPRy0nT.d.mts} +113 -44
- package/dist/{index-Cb64d5c5.d.mts → index-B7uYo0C6.d.mts} +20 -3
- package/dist/{index-B2xbnMZe.d.mts → index-BCKRUuI2.d.mts} +1 -1
- package/dist/{index-CARxIllg.d.mts → index-BFuke0jw.d.mts} +28 -28
- package/dist/{index-DTdqGAfH2.d.mts → index-BfUq8fO52.d.mts} +1 -1
- package/dist/{index-BtztOqaF.d.mts → index-BheaEhyI.d.mts} +6 -6
- package/dist/{index-CZ_TcT6J.d.mts → index-Bibt5jAX.d.mts} +8 -8
- package/dist/{index-D5CI1V5d.d.mts → index-C3zfJg6s.d.mts} +16 -16
- package/dist/{index-Buo9H8RK.d.mts → index-COPhs8Ay.d.mts} +1 -1
- package/dist/{index-CgjslA5-.d.mts → index-CcBAFO-1.d.mts} +4 -4
- package/dist/{index-BpniJgxu.d.mts → index-CncH-7wf.d.mts} +16 -16
- package/dist/{index-BQiHs8EF.d.mts → index-DdZ9PDEE.d.mts} +24 -24
- package/dist/{index-BDRKAxIV.d.mts → index-dAjtejnc.d.mts} +2 -2
- package/dist/{index-DDQkhhRo.d.mts → index-qGJoNJon.d.mts} +397 -157
- package/dist/{index-BKKNWqkP2.d.mts → index-zgm2j9V92.d.mts} +44 -2
- package/dist/kernel/extension/index.d.mts +1 -1
- package/dist/kernel/index.d.mts +2 -2
- package/dist/kernel/observability/index.d.mts +1 -1
- package/dist/mcp-http-server/index.d.mts +132 -19
- package/dist/mcp-http-server/index.mjs +1 -1
- package/dist/{namespace-D1Iw_d1P.d.mts → namespace--s0d86h-.d.mts} +144 -0
- package/dist/{namespace-CHMszppN.d.mts → namespace-6OzA9SwY.d.mts} +26 -26
- package/dist/{namespace-CqUGzG53.d.mts → namespace-Bx40zNgT.d.mts} +2 -2
- package/dist/{namespace-Ba4bxtHQ.d.mts → namespace-BxxBhcV_.d.mts} +9 -9
- package/dist/{namespace-7tsuJhQ9.d.mts → namespace-Cq8ScJGp.d.mts} +94 -58
- package/dist/{namespace-B73Sxj5L.d.mts → namespace-DI9_OYOU.d.mts} +6 -6
- package/dist/{namespace-DwE2g8Wm.mjs → namespace-Dfq6MDN9.mjs} +1 -1
- package/dist/{namespace-BBVtD1gu.d.mts → namespace-Do0AUzwu.d.mts} +6 -6
- package/dist/{namespace-DDCjoQUj.d.mts → namespace-aJJfBJU5.d.mts} +170 -0
- package/dist/{orchestrator-shared-Dt4WDse7.mjs → orchestrator-shared-BKFXaKPL.mjs} +1 -1
- package/dist/{package-BSnp1zOR.d.mts → package--RZnpN2J.d.mts} +2 -3
- package/dist/package-BzJvtM5O.mjs +1 -0
- package/dist/package-DzN_jdqd.mjs +1 -0
- package/dist/package.json +1 -1
- package/dist/primitive-runtime-CNC_bSac.mjs +1 -0
- package/dist/runtime-node/bus/runtime/namespace.d.mts +8 -8
- package/dist/runtime-node/bus/runtime/schemas.d.mts +11 -4
- package/dist/runtime-node/bus/runtime/schemas.mjs +1 -1
- package/dist/runtime-node/index.d.mts +27 -60
- package/dist/runtime-node/index.mjs +26 -26
- package/dist/runtime-node/workflow-worker/index.d.mts +1 -1
- package/dist/{schema-BNrM9LWb.d.mts → schema-C-yfxlRI.d.mts} +24 -4
- package/dist/{schema-BerZmr2q.mjs → schema-C3TgjrsV.mjs} +1 -1
- package/dist/{schema-BrnYlDwZ.mjs → schema-CzhOc7TV.mjs} +1 -1
- package/dist/{schemas-B5ToLwIs.d.mts → schemas-CJYNpT6v.d.mts} +6 -6
- package/dist/{schemas-lqvZ6UpK.d.mts → schemas-CW0h1h6l.d.mts} +3 -3
- package/dist/schemas-CuKayWhA.mjs +1 -0
- package/dist/{schemas-DAFYpgHk2.d.mts → schemas-DtJWNKZ_2.d.mts} +14 -14
- package/dist/{schemas-CkOSG2eJ.d.mts → schemas-t1VR6_b_.d.mts} +3 -3
- package/dist/services/adapter-subsystem/index.d.mts +2 -2
- package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
- package/dist/services/context-rules/index.d.mts +3 -3
- package/dist/services/execution-target/index.d.mts +2 -2
- package/dist/services/execution-target/namespace.d.mts +1 -1
- package/dist/services/execution-target/schemas.d.mts +1 -1
- package/dist/services/filesystem/namespace.d.mts +6 -6
- package/dist/services/filesystem/schemas.d.mts +3 -3
- package/dist/services/git/namespace.d.mts +2 -2
- package/dist/services/git/schemas.d.mts +2 -2
- package/dist/services/harness/index.d.mts +3 -4
- package/dist/services/harness/index.mjs +1 -1
- package/dist/services/index.d.mts +147 -50
- package/dist/services/index.mjs +1 -1
- package/dist/services/log-import/browser.d.mts +2 -2
- package/dist/services/log-import/index.d.mts +4 -5
- package/dist/services/log-import/index.mjs +1 -1
- package/dist/services/log-import/log-import.d.mts +1 -1
- package/dist/services/log-import/namespace.d.mts +2 -2
- package/dist/services/log-import/schemas.d.mts +1 -1
- package/dist/services/provider-context/index.mjs +1 -1
- package/dist/services/session/handlers/index.mjs +1 -1
- package/dist/services/session/index.d.mts +7 -7
- package/dist/services/session/index.mjs +1 -1
- package/dist/services/session/messages/namespace.d.mts +1 -1
- package/dist/services/session/messages/namespace.mjs +1 -1
- package/dist/services/session/orchestrator-testing/index.mjs +1 -1
- package/dist/services/session/session-events/namespace.d.mts +1 -1
- package/dist/services/session/session-events/namespace.mjs +1 -1
- package/dist/services/session/storage/namespace.d.mts +1 -1
- package/dist/services/session/storage/schema.d.mts +1 -1
- package/dist/services/session/storage/schema.mjs +1 -1
- package/dist/services/session/testing/index.mjs +5 -3
- package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
- package/dist/services/session/turns/namespace.d.mts +1 -1
- package/dist/services/session/turns/namespace.mjs +1 -1
- package/dist/services/settings/index.mjs +1 -1
- package/dist/services/settings/namespace.d.mts +14 -14
- package/dist/services/settings/storage/clients-namespace.mjs +1 -1
- package/dist/services/settings/storage/extension-configs/namespace.d.mts +3 -3
- package/dist/services/settings/storage/index.mjs +1 -1
- package/dist/services/settings/storage/providers-namespace.mjs +1 -1
- package/dist/services/subagent/index.d.mts +1 -1
- package/dist/services/subagent/index.mjs +1 -1
- package/dist/services/subagent-template/index.d.mts +1 -1
- package/dist/services/subagent-template/schemas.d.mts +1 -1
- package/dist/services/tool-approval/index.mjs +1 -1
- package/dist/services/tools/index.mjs +1 -1
- package/dist/services/tray-menu/index.d.mts +2 -2
- package/dist/services/tray-menu/namespace.d.mts +1 -1
- package/dist/services/tray-menu/schemas.d.mts +1 -1
- package/dist/services/turn/index.d.mts +1 -1
- package/dist/services/turn/namespace.d.mts +1 -1
- package/dist/services/turn/schemas.d.mts +72 -0
- package/dist/services/turn/schemas.mjs +1 -1
- package/dist/{session-C1Cami7U.mjs → session-BwX5_k47.mjs} +1 -1
- package/dist/session-P4nX60Xx.mjs +39 -0
- package/dist/{session-lineage-CXzV_hAP.d.mts → session-lineage-CKg6mErA.d.mts} +1 -1
- package/dist/storage/drizzle/index.d.mts +1 -1
- package/dist/storage/drizzle/index.mjs +1 -1
- package/dist/{tool-approval-service-Cb2F1yT6.mjs → tool-approval-service-DNHV5x0M.mjs} +1 -1
- package/dist/{tools-D5DVHC-R.mjs → tools-CQImrHAp.mjs} +1 -1
- package/dist/{types-DLVitCZP.d.mts → types-BOuU-0Vs.d.mts} +901 -718
- package/dist/{types-D5IMwOkJ.d.mts → types-D0fPFh-D.d.mts} +1 -1
- package/dist/{types-BMpIa4fx.d.mts → types-D6jnDjP2.d.mts} +18 -5
- package/dist/ui-components/index.d.mts +36 -37
- package/dist/ui-views/index.d.mts +2 -2
- package/dist/workflow-engine/index.d.mts +49 -16
- package/dist/workflow-engine/index.mjs +1 -1
- package/dist/workflow-engine/package.d.mts +1 -1
- package/dist/workflow-engine/package.mjs +1 -1
- package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
- package/package.json +18 -1
- package/dist/adapter-Dt2FDMs4.mjs +0 -1
- package/dist/drizzle/0001_messages_content_tsv.na.md +0 -18
- package/dist/drizzle/meta/0000_snapshot.json +0 -2813
- package/dist/drizzle/meta/0001_snapshot.json +0 -2820
- package/dist/drizzle/meta/0002_snapshot.json +0 -2827
- package/dist/drizzle/meta/0003_snapshot.json +0 -2834
- package/dist/drizzle/meta/0004_snapshot.json +0 -2842
- package/dist/drizzle/meta/0005_snapshot.json +0 -2849
- package/dist/drizzle/meta/0006_snapshot.json +0 -2865
- package/dist/drizzle/meta/0007_snapshot.json +0 -2879
- package/dist/drizzle/meta/0008_snapshot.json +0 -2886
- package/dist/drizzle/meta/0009_snapshot.json +0 -2901
- package/dist/drizzle/meta/0010_snapshot.json +0 -2908
- package/dist/drizzle/meta/0011_snapshot.json +0 -2915
- package/dist/drizzle/meta/0012_snapshot.json +0 -2934
- package/dist/drizzle/meta/0013_snapshot.json +0 -2954
- package/dist/drizzle/meta/0014_snapshot.json +0 -2959
- package/dist/handlers-C8EtpSqK.mjs +0 -41
- package/dist/package-Be2Ez4vv.mjs +0 -1
- package/dist/package-OE9dMQsq.mjs +0 -1
- package/dist/primitive-runtime-Xrc9xh6p.mjs +0 -1
- package/dist/schemas-CSUwpaNm.mjs +0 -1
- package/dist/session-KnewDVxt.mjs +0 -39
- /package/dist/{provider-context-lfG0BpqX.mjs → provider-context-wp4VSJFI.mjs} +0 -0
- /package/dist/{shared-schemas-CKe2uN4-.mjs → shared-schemas-DYL7a-No.mjs} +0 -0
|
@@ -334,10 +334,10 @@ declare const MessageStorageNamespace$1: {
|
|
|
334
334
|
output: _$zod.ZodString;
|
|
335
335
|
isError: _$zod.ZodOptional<_$zod.ZodBoolean>;
|
|
336
336
|
}, _$zod_v4_core0.$strip>], "type">>;
|
|
337
|
+
timestamp: _$zod.ZodNumber;
|
|
337
338
|
agentId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
338
339
|
adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
339
340
|
turnId: _$zod.ZodNullable<_$zod.ZodString>;
|
|
340
|
-
timestamp: _$zod.ZodNumber;
|
|
341
341
|
contentText: _$zod.ZodString;
|
|
342
342
|
adapterMessageId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
343
343
|
editOf: _$zod.ZodOptional<_$zod.ZodString>;
|
|
@@ -1119,10 +1119,10 @@ declare const MessageStorageNamespace$1: {
|
|
|
1119
1119
|
output: _$zod.ZodString;
|
|
1120
1120
|
isError: _$zod.ZodOptional<_$zod.ZodBoolean>;
|
|
1121
1121
|
}, _$zod_v4_core0.$strip>], "type">>;
|
|
1122
|
+
timestamp: _$zod.ZodNumber;
|
|
1122
1123
|
agentId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
1123
1124
|
adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
1124
1125
|
turnId: _$zod.ZodNullable<_$zod.ZodString>;
|
|
1125
|
-
timestamp: _$zod.ZodNumber;
|
|
1126
1126
|
contentText: _$zod.ZodString;
|
|
1127
1127
|
adapterMessageId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
1128
1128
|
editOf: _$zod.ZodOptional<_$zod.ZodString>;
|
|
@@ -1960,8 +1960,8 @@ declare const MessageStorageNamespace$1: {
|
|
|
1960
1960
|
output: string;
|
|
1961
1961
|
isError?: boolean | undefined;
|
|
1962
1962
|
})[];
|
|
1963
|
-
turnId: string | null;
|
|
1964
1963
|
timestamp: number;
|
|
1964
|
+
turnId: string | null;
|
|
1965
1965
|
contentText: string;
|
|
1966
1966
|
origin?: "text" | "voice" | "compact" | undefined;
|
|
1967
1967
|
agentId?: string | undefined;
|
|
@@ -2029,12 +2029,12 @@ declare const MessageStorageNamespace$1: {
|
|
|
2029
2029
|
isError?: boolean | undefined;
|
|
2030
2030
|
})[];
|
|
2031
2031
|
messageId: string;
|
|
2032
|
+
timestamp: number;
|
|
2033
|
+
query: string;
|
|
2034
|
+
limit: never;
|
|
2032
2035
|
agentId: never;
|
|
2033
2036
|
adapterSessionId: never;
|
|
2034
2037
|
turnId: string | null;
|
|
2035
|
-
limit: never;
|
|
2036
|
-
timestamp: number;
|
|
2037
|
-
query: string;
|
|
2038
2038
|
contentText: string;
|
|
2039
2039
|
adapterMessageId: string;
|
|
2040
2040
|
emitEvent: never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sessionsDual as e}from"./services/session/storage/schema.mjs";import{n as t}from"./schema-
|
|
1
|
+
import{sessionsDual as e}from"./services/session/storage/schema.mjs";import{n as t}from"./schema-CzhOc7TV.mjs";import{t as n}from"./schema-C3TgjrsV.mjs";import{SessionEventStorageNamespace as r,SessionEventStorageSubjects as i}from"@makaio/framework/contracts";import{index as a}from"drizzle-orm/sqlite-core";import{customType as o,index as s,pgTable as c,text as l}from"drizzle-orm/pg-core";import{defineDialectSchema as u,defineDualTable as d}from"@makaio/framework/storage/drizzle";import{sql as f}from"drizzle-orm";import{epochMs as p}from"@makaio/framework/storage/drizzle/columns/postgres";const m=o({dataType(){return`tsvector`}}),h=c(`messages`,{messageId:l(`message_id`).primaryKey(),turnId:l(`turn_id`).references(()=>t.postgres.turnId,{onDelete:`cascade`}),sessionId:l(`session_id`).notNull().references(()=>e.postgres.sessionId,{onDelete:`cascade`}),role:l(`role`,{enum:[`user`,`assistant`]}).notNull(),contentText:l(`content_text`).notNull(),blocks:l(`blocks`).notNull().default(`[]`),agentId:l(`agent_id`),adapterSessionId:l(`adapter_session_id`),adapterMessageId:l(`adapter_message_id`),timestamp:p(`timestamp`).notNull(),editOf:l(`edit_of`).references(()=>h.messageId),origin:l(`origin`,{enum:[`voice`,`text`,`compact`]}),contentTsv:m(`content_tsv`).generatedAlwaysAs(f`to_tsvector('english', coalesce(content_text, ''))`)},e=>[s(`idx_messages_session`).on(e.sessionId,e.timestamp),s(`idx_messages_turn`).on(e.turnId,e.timestamp),s(`idx_messages_agent`).on(e.agentId,e.timestamp),s(`idx_messages_adapter_message_id`).on(e.adapterMessageId),s(`idx_messages_content_tsv`).using(`gin`,e.contentTsv)]),g=u({messages:n},{messages:h}),_=()=>({sqlite:n.messageId,postgres:h.messageId}),v=d(`session_events`,t=>({id:t.autoPk(`id`),sessionId:t.text(`session_id`).notNull().references(()=>e.columnPair(`sessionId`),{onDelete:`cascade`}),eventId:t.text(`event_id`).notNull().unique(),timestamp:t.epochMs(`timestamp`).notNull(),type:t.text(`type`).notNull(),agentId:t.text(`agent_id`),adapterId:t.text(`adapter_id`),originatingMessageId:t.text(`originating_message_id`),messageId:t.text(`message_id`).references(_,{onDelete:`cascade`}),turnId:t.text(`turn_id`),contentText:t.text(`content_text`),payload:t.text(`payload`).notNull()}),{sqlite:e=>[a(`idx_events_session_ts`).on(e.sessionId,e.timestamp),a(`idx_events_session_type`).on(e.sessionId,e.type),a(`idx_events_turn`).on(e.turnId),a(`idx_events_originating_message`).on(e.originatingMessageId)],postgres:e=>[s(`idx_events_session_ts`).on(e.sessionId,e.timestamp),s(`idx_events_session_type`).on(e.sessionId,e.type),s(`idx_events_turn`).on(e.turnId),s(`idx_events_originating_message`).on(e.originatingMessageId)]}),y=v.sqlite,b={...r,extensions:{drizzle:{sessionEvents:y}}};export{_ as a,v as i,i as n,g as o,y as r,b as t};
|
|
@@ -62,8 +62,8 @@ declare const ExecutionTargetNamespace: _$_makaio_core0.BusNamespaceDefinition<"
|
|
|
62
62
|
id: _$zod.ZodString;
|
|
63
63
|
description: _$zod.ZodOptional<_$zod.ZodString>;
|
|
64
64
|
name: _$zod.ZodString;
|
|
65
|
-
enabled: _$zod.ZodBoolean;
|
|
66
65
|
scope: _$zod.ZodString;
|
|
66
|
+
enabled: _$zod.ZodBoolean;
|
|
67
67
|
}, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
|
|
68
68
|
type: _$zod.ZodLiteral<"container-local">;
|
|
69
69
|
id: _$zod.ZodString;
|
|
@@ -71,8 +71,8 @@ declare const ExecutionTargetNamespace: _$_makaio_core0.BusNamespaceDefinition<"
|
|
|
71
71
|
env: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodString>>;
|
|
72
72
|
name: _$zod.ZodString;
|
|
73
73
|
image: _$zod.ZodOptional<_$zod.ZodString>;
|
|
74
|
-
enabled: _$zod.ZodBoolean;
|
|
75
74
|
scope: _$zod.ZodString;
|
|
75
|
+
enabled: _$zod.ZodBoolean;
|
|
76
76
|
busUrl: _$zod.ZodOptional<_$zod.ZodString>;
|
|
77
77
|
}, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
|
|
78
78
|
type: _$zod.ZodLiteral<"container-isolated">;
|
|
@@ -81,8 +81,8 @@ declare const ExecutionTargetNamespace: _$_makaio_core0.BusNamespaceDefinition<"
|
|
|
81
81
|
env: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodString>>;
|
|
82
82
|
name: _$zod.ZodString;
|
|
83
83
|
image: _$zod.ZodOptional<_$zod.ZodString>;
|
|
84
|
-
enabled: _$zod.ZodBoolean;
|
|
85
84
|
scope: _$zod.ZodString;
|
|
85
|
+
enabled: _$zod.ZodBoolean;
|
|
86
86
|
busMode: _$zod.ZodEnum<{
|
|
87
87
|
relay: "relay";
|
|
88
88
|
host: "host";
|
|
@@ -363,8 +363,8 @@ declare const ExecutionTargetSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
|
|
|
363
363
|
id: _$zod.ZodString;
|
|
364
364
|
description: _$zod.ZodOptional<_$zod.ZodString>;
|
|
365
365
|
name: _$zod.ZodString;
|
|
366
|
-
enabled: _$zod.ZodBoolean;
|
|
367
366
|
scope: _$zod.ZodString;
|
|
367
|
+
enabled: _$zod.ZodBoolean;
|
|
368
368
|
}, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
|
|
369
369
|
type: _$zod.ZodLiteral<"container-local">;
|
|
370
370
|
id: _$zod.ZodString;
|
|
@@ -372,8 +372,8 @@ declare const ExecutionTargetSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
|
|
|
372
372
|
env: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodString>>;
|
|
373
373
|
name: _$zod.ZodString;
|
|
374
374
|
image: _$zod.ZodOptional<_$zod.ZodString>;
|
|
375
|
-
enabled: _$zod.ZodBoolean;
|
|
376
375
|
scope: _$zod.ZodString;
|
|
376
|
+
enabled: _$zod.ZodBoolean;
|
|
377
377
|
busUrl: _$zod.ZodOptional<_$zod.ZodString>;
|
|
378
378
|
}, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
|
|
379
379
|
type: _$zod.ZodLiteral<"container-isolated">;
|
|
@@ -382,8 +382,8 @@ declare const ExecutionTargetSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
|
|
|
382
382
|
env: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodString>>;
|
|
383
383
|
name: _$zod.ZodString;
|
|
384
384
|
image: _$zod.ZodOptional<_$zod.ZodString>;
|
|
385
|
-
enabled: _$zod.ZodBoolean;
|
|
386
385
|
scope: _$zod.ZodString;
|
|
386
|
+
enabled: _$zod.ZodBoolean;
|
|
387
387
|
busMode: _$zod.ZodEnum<{
|
|
388
388
|
relay: "relay";
|
|
389
389
|
host: "host";
|
|
@@ -164,6 +164,25 @@ declare const TurnStorageNamespace: {
|
|
|
164
164
|
}, {}, {
|
|
165
165
|
length: number | undefined;
|
|
166
166
|
}>;
|
|
167
|
+
initiator: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
168
|
+
name: "initiator";
|
|
169
|
+
tableName: "turns";
|
|
170
|
+
dataType: "string";
|
|
171
|
+
columnType: "SQLiteText";
|
|
172
|
+
data: string;
|
|
173
|
+
driverParam: string;
|
|
174
|
+
notNull: false;
|
|
175
|
+
hasDefault: false;
|
|
176
|
+
isPrimaryKey: false;
|
|
177
|
+
isAutoincrement: false;
|
|
178
|
+
hasRuntimeDefault: false;
|
|
179
|
+
enumValues: [string, ...string[]];
|
|
180
|
+
baseColumn: never;
|
|
181
|
+
identity: undefined;
|
|
182
|
+
generated: undefined;
|
|
183
|
+
}, {}, {
|
|
184
|
+
length: number | undefined;
|
|
185
|
+
}>;
|
|
167
186
|
};
|
|
168
187
|
dialect: "sqlite";
|
|
169
188
|
}>;
|
|
@@ -176,6 +195,14 @@ declare const TurnStorageNamespace: {
|
|
|
176
195
|
request: _$zod.ZodObject<{
|
|
177
196
|
sessionId: _$zod.ZodString;
|
|
178
197
|
turnId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
198
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
199
|
+
source: _$zod.ZodEnum<{
|
|
200
|
+
user: "user";
|
|
201
|
+
system: "system";
|
|
202
|
+
extension: "extension";
|
|
203
|
+
}>;
|
|
204
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
205
|
+
}, _$zod_v4_core0.$strip>>;
|
|
179
206
|
}, _$zod_v4_core0.$strip>;
|
|
180
207
|
response: _$zod.ZodObject<{
|
|
181
208
|
turn: _$zod.ZodObject<{
|
|
@@ -202,6 +229,14 @@ declare const TurnStorageNamespace: {
|
|
|
202
229
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
203
230
|
}, _$zod_v4_core0.$strip>>>;
|
|
204
231
|
}, _$zod_v4_core0.$strip>>;
|
|
232
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
233
|
+
source: _$zod.ZodEnum<{
|
|
234
|
+
user: "user";
|
|
235
|
+
system: "system";
|
|
236
|
+
extension: "extension";
|
|
237
|
+
}>;
|
|
238
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
239
|
+
}, _$zod_v4_core0.$strip>>;
|
|
205
240
|
}, _$zod_v4_core0.$strip>;
|
|
206
241
|
}, _$zod_v4_core0.$strip>;
|
|
207
242
|
};
|
|
@@ -256,6 +291,14 @@ declare const TurnStorageNamespace: {
|
|
|
256
291
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
257
292
|
}, _$zod_v4_core0.$strip>>>;
|
|
258
293
|
}, _$zod_v4_core0.$strip>>;
|
|
294
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
295
|
+
source: _$zod.ZodEnum<{
|
|
296
|
+
user: "user";
|
|
297
|
+
system: "system";
|
|
298
|
+
extension: "extension";
|
|
299
|
+
}>;
|
|
300
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
301
|
+
}, _$zod_v4_core0.$strip>>;
|
|
259
302
|
}, _$zod_v4_core0.$strip>;
|
|
260
303
|
transitioned: _$zod.ZodBoolean;
|
|
261
304
|
}, _$zod_v4_core0.$strip>;
|
|
@@ -286,6 +329,14 @@ declare const TurnStorageNamespace: {
|
|
|
286
329
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
287
330
|
}, _$zod_v4_core0.$strip>>>;
|
|
288
331
|
}, _$zod_v4_core0.$strip>>;
|
|
332
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
333
|
+
source: _$zod.ZodEnum<{
|
|
334
|
+
user: "user";
|
|
335
|
+
system: "system";
|
|
336
|
+
extension: "extension";
|
|
337
|
+
}>;
|
|
338
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
339
|
+
}, _$zod_v4_core0.$strip>>;
|
|
289
340
|
}, _$zod_v4_core0.$strip>;
|
|
290
341
|
}, _$zod_v4_core0.$strip>;
|
|
291
342
|
response: _$zod.ZodObject<{
|
|
@@ -313,6 +364,14 @@ declare const TurnStorageNamespace: {
|
|
|
313
364
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
314
365
|
}, _$zod_v4_core0.$strip>>>;
|
|
315
366
|
}, _$zod_v4_core0.$strip>>;
|
|
367
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
368
|
+
source: _$zod.ZodEnum<{
|
|
369
|
+
user: "user";
|
|
370
|
+
system: "system";
|
|
371
|
+
extension: "extension";
|
|
372
|
+
}>;
|
|
373
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
374
|
+
}, _$zod_v4_core0.$strip>>;
|
|
316
375
|
}, _$zod_v4_core0.$strip>;
|
|
317
376
|
}, _$zod_v4_core0.$strip>;
|
|
318
377
|
};
|
|
@@ -345,6 +404,14 @@ declare const TurnStorageNamespace: {
|
|
|
345
404
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
346
405
|
}, _$zod_v4_core0.$strip>>>;
|
|
347
406
|
}, _$zod_v4_core0.$strip>>;
|
|
407
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
408
|
+
source: _$zod.ZodEnum<{
|
|
409
|
+
user: "user";
|
|
410
|
+
system: "system";
|
|
411
|
+
extension: "extension";
|
|
412
|
+
}>;
|
|
413
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
414
|
+
}, _$zod_v4_core0.$strip>>;
|
|
348
415
|
}, _$zod_v4_core0.$strip>>;
|
|
349
416
|
}, _$zod_v4_core0.$strip>;
|
|
350
417
|
};
|
|
@@ -383,6 +450,14 @@ declare const TurnStorageNamespace: {
|
|
|
383
450
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
384
451
|
}, _$zod_v4_core0.$strip>>>;
|
|
385
452
|
}, _$zod_v4_core0.$strip>>;
|
|
453
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
454
|
+
source: _$zod.ZodEnum<{
|
|
455
|
+
user: "user";
|
|
456
|
+
system: "system";
|
|
457
|
+
extension: "extension";
|
|
458
|
+
}>;
|
|
459
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
460
|
+
}, _$zod_v4_core0.$strip>>;
|
|
386
461
|
}, _$zod_v4_core0.$strip>>;
|
|
387
462
|
}, _$zod_v4_core0.$strip>;
|
|
388
463
|
};
|
|
@@ -415,6 +490,14 @@ declare const TurnStorageNamespace: {
|
|
|
415
490
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
416
491
|
}, _$zod_v4_core0.$strip>>>;
|
|
417
492
|
}, _$zod_v4_core0.$strip>>;
|
|
493
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
494
|
+
source: _$zod.ZodEnum<{
|
|
495
|
+
user: "user";
|
|
496
|
+
system: "system";
|
|
497
|
+
extension: "extension";
|
|
498
|
+
}>;
|
|
499
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
500
|
+
}, _$zod_v4_core0.$strip>>;
|
|
418
501
|
}, _$zod_v4_core0.$strip>>;
|
|
419
502
|
}, _$zod_v4_core0.$strip>;
|
|
420
503
|
};
|
|
@@ -445,6 +528,14 @@ declare const TurnStorageNamespace: {
|
|
|
445
528
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
446
529
|
}, _$zod_v4_core0.$strip>>>;
|
|
447
530
|
}, _$zod_v4_core0.$strip>>;
|
|
531
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
532
|
+
source: _$zod.ZodEnum<{
|
|
533
|
+
user: "user";
|
|
534
|
+
system: "system";
|
|
535
|
+
extension: "extension";
|
|
536
|
+
}>;
|
|
537
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
538
|
+
}, _$zod_v4_core0.$strip>>;
|
|
448
539
|
}, _$zod_v4_core0.$strip>>;
|
|
449
540
|
}, _$zod_v4_core0.$strip>;
|
|
450
541
|
};
|
|
@@ -454,6 +545,14 @@ declare const TurnStorageNamespace: {
|
|
|
454
545
|
request: _$zod.ZodObject<{
|
|
455
546
|
sessionId: _$zod.ZodString;
|
|
456
547
|
turnId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
548
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
549
|
+
source: _$zod.ZodEnum<{
|
|
550
|
+
user: "user";
|
|
551
|
+
system: "system";
|
|
552
|
+
extension: "extension";
|
|
553
|
+
}>;
|
|
554
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
555
|
+
}, _$zod_v4_core0.$strip>>;
|
|
457
556
|
}, _$zod_v4_core0.$strip>;
|
|
458
557
|
response: _$zod.ZodObject<{
|
|
459
558
|
turn: _$zod.ZodObject<{
|
|
@@ -480,6 +579,14 @@ declare const TurnStorageNamespace: {
|
|
|
480
579
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
481
580
|
}, _$zod_v4_core0.$strip>>>;
|
|
482
581
|
}, _$zod_v4_core0.$strip>>;
|
|
582
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
583
|
+
source: _$zod.ZodEnum<{
|
|
584
|
+
user: "user";
|
|
585
|
+
system: "system";
|
|
586
|
+
extension: "extension";
|
|
587
|
+
}>;
|
|
588
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
589
|
+
}, _$zod_v4_core0.$strip>>;
|
|
483
590
|
}, _$zod_v4_core0.$strip>;
|
|
484
591
|
}, _$zod_v4_core0.$strip>;
|
|
485
592
|
};
|
|
@@ -534,6 +641,14 @@ declare const TurnStorageNamespace: {
|
|
|
534
641
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
535
642
|
}, _$zod_v4_core0.$strip>>>;
|
|
536
643
|
}, _$zod_v4_core0.$strip>>;
|
|
644
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
645
|
+
source: _$zod.ZodEnum<{
|
|
646
|
+
user: "user";
|
|
647
|
+
system: "system";
|
|
648
|
+
extension: "extension";
|
|
649
|
+
}>;
|
|
650
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
651
|
+
}, _$zod_v4_core0.$strip>>;
|
|
537
652
|
}, _$zod_v4_core0.$strip>;
|
|
538
653
|
transitioned: _$zod.ZodBoolean;
|
|
539
654
|
}, _$zod_v4_core0.$strip>;
|
|
@@ -564,6 +679,14 @@ declare const TurnStorageNamespace: {
|
|
|
564
679
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
565
680
|
}, _$zod_v4_core0.$strip>>>;
|
|
566
681
|
}, _$zod_v4_core0.$strip>>;
|
|
682
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
683
|
+
source: _$zod.ZodEnum<{
|
|
684
|
+
user: "user";
|
|
685
|
+
system: "system";
|
|
686
|
+
extension: "extension";
|
|
687
|
+
}>;
|
|
688
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
689
|
+
}, _$zod_v4_core0.$strip>>;
|
|
567
690
|
}, _$zod_v4_core0.$strip>;
|
|
568
691
|
}, _$zod_v4_core0.$strip>;
|
|
569
692
|
response: _$zod.ZodObject<{
|
|
@@ -591,6 +714,14 @@ declare const TurnStorageNamespace: {
|
|
|
591
714
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
592
715
|
}, _$zod_v4_core0.$strip>>>;
|
|
593
716
|
}, _$zod_v4_core0.$strip>>;
|
|
717
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
718
|
+
source: _$zod.ZodEnum<{
|
|
719
|
+
user: "user";
|
|
720
|
+
system: "system";
|
|
721
|
+
extension: "extension";
|
|
722
|
+
}>;
|
|
723
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
724
|
+
}, _$zod_v4_core0.$strip>>;
|
|
594
725
|
}, _$zod_v4_core0.$strip>;
|
|
595
726
|
}, _$zod_v4_core0.$strip>;
|
|
596
727
|
};
|
|
@@ -623,6 +754,14 @@ declare const TurnStorageNamespace: {
|
|
|
623
754
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
624
755
|
}, _$zod_v4_core0.$strip>>>;
|
|
625
756
|
}, _$zod_v4_core0.$strip>>;
|
|
757
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
758
|
+
source: _$zod.ZodEnum<{
|
|
759
|
+
user: "user";
|
|
760
|
+
system: "system";
|
|
761
|
+
extension: "extension";
|
|
762
|
+
}>;
|
|
763
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
764
|
+
}, _$zod_v4_core0.$strip>>;
|
|
626
765
|
}, _$zod_v4_core0.$strip>>;
|
|
627
766
|
}, _$zod_v4_core0.$strip>;
|
|
628
767
|
};
|
|
@@ -661,6 +800,14 @@ declare const TurnStorageNamespace: {
|
|
|
661
800
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
662
801
|
}, _$zod_v4_core0.$strip>>>;
|
|
663
802
|
}, _$zod_v4_core0.$strip>>;
|
|
803
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
804
|
+
source: _$zod.ZodEnum<{
|
|
805
|
+
user: "user";
|
|
806
|
+
system: "system";
|
|
807
|
+
extension: "extension";
|
|
808
|
+
}>;
|
|
809
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
810
|
+
}, _$zod_v4_core0.$strip>>;
|
|
664
811
|
}, _$zod_v4_core0.$strip>>;
|
|
665
812
|
}, _$zod_v4_core0.$strip>;
|
|
666
813
|
};
|
|
@@ -693,6 +840,14 @@ declare const TurnStorageNamespace: {
|
|
|
693
840
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
694
841
|
}, _$zod_v4_core0.$strip>>>;
|
|
695
842
|
}, _$zod_v4_core0.$strip>>;
|
|
843
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
844
|
+
source: _$zod.ZodEnum<{
|
|
845
|
+
user: "user";
|
|
846
|
+
system: "system";
|
|
847
|
+
extension: "extension";
|
|
848
|
+
}>;
|
|
849
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
850
|
+
}, _$zod_v4_core0.$strip>>;
|
|
696
851
|
}, _$zod_v4_core0.$strip>>;
|
|
697
852
|
}, _$zod_v4_core0.$strip>;
|
|
698
853
|
};
|
|
@@ -723,6 +878,14 @@ declare const TurnStorageNamespace: {
|
|
|
723
878
|
cost: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
724
879
|
}, _$zod_v4_core0.$strip>>>;
|
|
725
880
|
}, _$zod_v4_core0.$strip>>;
|
|
881
|
+
initiator: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
882
|
+
source: _$zod.ZodEnum<{
|
|
883
|
+
user: "user";
|
|
884
|
+
system: "system";
|
|
885
|
+
extension: "extension";
|
|
886
|
+
}>;
|
|
887
|
+
sourceId: _$zod.ZodOptional<_$zod.ZodString>;
|
|
888
|
+
}, _$zod_v4_core0.$strip>>;
|
|
726
889
|
}, _$zod_v4_core0.$strip>>;
|
|
727
890
|
}, _$zod_v4_core0.$strip>;
|
|
728
891
|
};
|
|
@@ -731,6 +894,9 @@ declare const TurnStorageNamespace: {
|
|
|
731
894
|
defaultTransports?: _$_makaio_core0.TransportRoutingDefault;
|
|
732
895
|
__filterPayload?: {
|
|
733
896
|
[x: string]: string | number | {
|
|
897
|
+
source: "user" | "system" | "extension";
|
|
898
|
+
sourceId?: string | undefined;
|
|
899
|
+
} | {
|
|
734
900
|
total: {
|
|
735
901
|
inputTokens: number;
|
|
736
902
|
outputTokens: number;
|
|
@@ -761,6 +927,10 @@ declare const TurnStorageNamespace: {
|
|
|
761
927
|
cost?: number | undefined;
|
|
762
928
|
}> | undefined;
|
|
763
929
|
} | undefined;
|
|
930
|
+
initiator?: {
|
|
931
|
+
source: "user" | "system" | "extension";
|
|
932
|
+
sourceId?: string | undefined;
|
|
933
|
+
} | undefined;
|
|
764
934
|
};
|
|
765
935
|
} | undefined;
|
|
766
936
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./namespace-
|
|
1
|
+
import{n as e}from"./namespace-Dfq6MDN9.mjs";import{MakaioBus as t}from"@makaio/framework/bus";import{AdapterSubjects as n,AgentSubjects as r,SessionSubjects as i}from"@makaio/framework/contracts";function a(){t.__resetHandlers?.()}function o(e=10){return new Promise(t=>setTimeout(t,e))}function s(e,t){let n=Date.now();return{agentId:e,adapterId:`adapter-${e}`,adapterName:`test-adapter`,sessionId:t?.sessionId??`test-session`,role:`member`,status:`idle`,createdAt:n,lastActivityAt:n,...t}}async function c(e,r=e){await t.emit(n.initialized,{adapterName:e,adapterId:r,capabilities:[]})}async function l(n){return(await t.request(e.getEvents,{sessionId:n})).events}function u(e,n,r){let i=[];return r.push(t.on(e,(e=>{let t=e.payload;i.push(n(t))}))),{received:i,clear:()=>{i.length=0}}}function d(e){return u(i.turn.started,e=>({sessionId:e.sessionId,turnId:e.turnId,messageId:e.messageId,agentIds:[...e.agentIds],initiator:e.initiator}),e)}function f(e){return u(i.turn.completed,e=>({sessionId:e.sessionId,turnId:e.turnId,success:e.success,error:e.error,initiator:e.initiator}),e)}function p(e){return u(i.user_message.sent,e=>({sessionId:e.sessionId,turnId:e.turnId,messageId:e.messageId,content:e.content,agentIds:[...e.agentIds],origin:e.origin}),e)}function m(e){return u(i.user_message.acknowledged,e=>({sessionId:e.sessionId,turnId:e.turnId,messageId:e.messageId,agentId:e.agentId}),e)}function h(e){return u(i.user_message.completed,e=>({sessionId:e.sessionId,turnId:e.turnId,messageId:e.messageId,agentId:e.agentId,outcome:e.outcome,error:e.error}),e)}const g=s;function _(e){let t=Date.now();return{sessionId:e.sessionId,createdAt:t,lastActivityAt:t,status:e.status??`active`,agents:e.agents??[],leadAgentId:e.leadAgentId,targetWorkingDirectory:e.targetWorkingDirectory}}function v(e){return t.on(i.create,t=>{let n=t.payload.sessionId??`session-${crypto.randomUUID().slice(0,8)}`;e.set(n,_({sessionId:n,agents:[]})),t.setResult({sessionId:n})})}function y(e){return t.on(i.agent.added,t=>{let n=e.get(t.payload.sessionId);if(!n)return;let r=n.agents.length===0,i=t.payload.role??(r?`lead`:`member`);r&&(n.adapterSessionId=t.payload.adapterSessionId,n.adapterName=t.payload.adapterName,n.adapterId=t.payload.adapterId);let a=Date.now();n.agents.push({agentId:t.payload.agentId,adapterId:t.payload.adapterId,adapterName:t.payload.adapterName,sessionId:t.payload.sessionId,role:i,status:`idle`,createdAt:a,lastActivityAt:a}),i===`lead`&&(n.leadAgentId=t.payload.agentId),n.lastActivityAt=Date.now()})}function b(e){return t.on(i.get,t=>{t.setResult({session:e.get(t.payload.sessionId)??null})})}function x(e){return t.on(n.getAgent,t=>{for(let n of e.values()){let e=n.agents.find(e=>e.agentId===t.payload.agentId);if(e){t.setResult({agent:{agentId:e.agentId,sessionId:n.sessionId,adapterSessionId:``}});return}}t.setResult({agent:null})})}function S(){return t.on(n.rehydrateAgent,e=>{e.setResult({})})}function C(e=`/previous/cwd`){return t.on(r.cwd.change,t=>{t.setResult({success:!0,previousCwd:e})})}function w(){return t.on(r.model.change,e=>{e.setResult({success:!0,swapped:!1})})}function T(e){return t.on(n.startAgent,t=>{let{adapterId:n,initialMessage:r}=t.payload,i=t.payload.sessionId??`session-${crypto.randomUUID().slice(0,8)}`,a=`agent-${crypto.randomUUID().slice(0,8)}`,o=r?`msg-${crypto.randomUUID().slice(0,8)}`:void 0,s=`adapter-session-${i}`;e?.({adapterId:n,sessionId:i,initialMessage:r}),t.setResult({success:!0,agentId:a,adapterId:n,adapterSessionId:s,sessionId:i,...o&&{messageId:o}}),j({sessionId:i,agentId:a,adapterId:n,adapterSessionId:s})})}function E(e){return t.on(n.startAgent,t=>{t.setResult({success:!1,message:e})})}function D(e){return t.on(r.sendMessage,t=>{let{agentId:n,adapterId:r,message:i,messageId:a,sessionContext:o,responseSchema:s}=t.payload,c=a??`msg-${crypto.randomUUID().slice(0,8)}`;e?.({agentId:n,adapterId:r,message:i,messageId:c,sessionContext:o,responseSchema:s}),t.setResult({messageId:c})})}function O(e,n){return t.on(r.sendMessage,t=>{if(e.has(t.payload.agentId))throw Error(n);t.setResult({messageId:t.payload.messageId??`generated-id`})})}async function k(e,n){await t.emit(r.complete,{agentId:e,adapterId:`adapter-${e}`,adapterName:`test-adapter`,adapterSessionId:`adapter-session-${e}`,messageId:n})}async function A(e,n){await t.emit(r.complete,{agentId:e,adapterId:`adapter-${e}`,adapterName:`test-adapter`,adapterSessionId:`adapter-session-${e}`,messageId:`msg-error-${e}`,outcome:`error`,error:n})}function j(e){setImmediate(()=>{t.emit(i.agent.added,{sessionId:e.sessionId,agentId:e.agentId,adapterId:e.adapterId,adapterName:e.adapterId,adapterSessionId:e.adapterSessionId,role:e.role})})}function M(e,r){let i=new Map,a=t.on(n.startAgent,t=>{r.payload=t.payload;let n=`agent-${crypto.randomUUID().slice(0,8)}`,a=t.payload.initialMessage?`msg-${crypto.randomUUID().slice(0,8)}`:void 0,o=`adapter-session-${e}`;i.set(n,{agentId:n,sessionId:e,adapterSessionId:o,adapterId:t.payload.adapterId}),t.setResult({success:!0,agentId:n,adapterId:t.payload.adapterId,adapterSessionId:o,sessionId:e,...a&&{messageId:a}}),j({sessionId:e,agentId:n,adapterId:t.payload.adapterId,adapterSessionId:o})}),o=t.on(n.getAgent,e=>{let t=i.get(e.payload.agentId);e.setResult({agent:t?{agentId:t.agentId,sessionId:t.sessionId,adapterSessionId:t.adapterSessionId}:null})});return()=>{a(),o()}}export{c as C,o as E,p as S,a as T,T as _,A as a,m as b,v as c,E as d,x as f,D as g,S as h,k as i,C as l,w as m,_ as n,y as o,b as p,j as r,M as s,g as t,O as u,f as v,l as w,h as x,d as y};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IMakaioBus } from "@makaio/framework/bus";
|
|
2
2
|
import * as _$_makaio_contracts0 from "@makaio/framework/contracts";
|
|
3
|
-
import {
|
|
3
|
+
import { IWorkflowRunner, IWorkflowTriggerTypeRegistry, MakaioNodeExtension, StationHandler, StepRunnerBusAuth, StepRunnerPlatformDefaults, WorkflowDefinition } from "@makaio/framework/contracts";
|
|
4
4
|
import { BaseService } from "@makaio/framework/service-base";
|
|
5
5
|
import { MakaioDatabase } from "@makaio/framework/storage/drizzle";
|
|
6
6
|
|
|
@@ -19,10 +19,9 @@ import { MakaioDatabase } from "@makaio/framework/storage/drizzle";
|
|
|
19
19
|
* - WorkLog projection: worklog.get, worklog.list, worklog.changed (event-driven)
|
|
20
20
|
* @param bus - MakaioBus instance for message handling
|
|
21
21
|
* @param db - Drizzle database instance
|
|
22
|
-
* @param _ctx - Extension context (unused; reserved for future use)
|
|
23
22
|
* @returns Cleanup function to unregister all handlers
|
|
24
23
|
*/
|
|
25
|
-
declare function registerDrizzleWorkflowStorage(bus: IMakaioBus, db: MakaioDatabase
|
|
24
|
+
declare function registerDrizzleWorkflowStorage(bus: IMakaioBus, db: MakaioDatabase): () => void;
|
|
26
25
|
//#endregion
|
|
27
26
|
//#region subsystems/workflow-engine/src/types.d.ts
|
|
28
27
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SessionStorageSubjects as e}from"./services/session/storage/namespace.mjs";import{ExecutionTargetSubjects as t}from"./services/execution-target/namespace.mjs";import{MakaioBus as n}from"@makaio/framework/bus";import{AdapterSubjects as r,AgentSubjects as i,DEFAULT_CONSTRAINTS as a,SessionSubjects as o,SpawnSubagentRpcRequestSchema as s,SubagentConfigSchema as c,SubagentError as l,SubagentErrorCode as u,SubagentSubjects as d,dep as f,extensionToken as p}from"@makaio/framework/contracts";import{BaseService as m}from"@makaio/framework/service-base";import{AdapterRuntimeSubjects as h}from"@makaio/framework/services/adapter-runtime";import{activateProviderContext as g,buildProviderContext as _}from"@makaio/framework/services/provider-context";function v(e,t){return`${e}:${t}`}function y(e,t){return e?.authenticated!==!0||!e.id?!1:e.kind===`workflow-execution`?!0:t.size===0?!1:t.has(v(e.kind,e.id))}var b=class{maxSize;items=[];constructor(e=50){this.maxSize=e}push(e){this.items.push(e),this.items.length>this.maxSize&&this.items.shift()}toArray(){return[...this.items]}get length(){return this.items.length}clear(){this.items=[]}};const x=[`completed`,`failed`,`cancelled`];function S(e){return x.includes(e)}var C=class{constraints;subagents=new Map;awaiters=new Map;constructor(e){this.constraints=e}track(e){let t=Date.now(),n={subagentId:e.subagentId,parentSessionId:e.parentSessionId,childSessionId:void 0,status:`spawning`,config:e.config,depth:e.depth,progressUpdates:new b(50),startTime:t,lastActivityAt:t};return this.subagents.set(e.subagentId,n),n}setChildSessionId(e,t){let n=this.subagents.get(e);n&&(n.childSessionId=t,n.lastActivityAt=Date.now(),n.status===`spawning`&&(n.status=`running`))}get(e){return this.subagents.get(e)}getAllNonTerminal(){let e=[];for(let t of this.subagents.values())S(t.status)||e.push(t);return e}countActiveBySession(e){let t=0;for(let n of this.subagents.values())n.parentSessionId===e&&!S(n.status)&&t++;return t}countTotalActive(){let e=0;for(let t of this.subagents.values())S(t.status)||e++;return e}updateStatus(e,t){let n=this.subagents.get(e);if(!n)return;let r=Date.now();n.status=t,n.lastActivityAt=r,S(t)&&(n.endTime=r)}addProgress(e,t){let n=this.subagents.get(e);n&&(n.progressUpdates.push(t),n.lastActivityAt=Date.now())}setPendingRequest(e,t){let n=this.subagents.get(e);if(!n)throw new l(u.NOT_FOUND,`Subagent ${e} not found`);if(n.pendingRequest)throw new l(u.REQUEST_PENDING,`Cannot call request_input while another request is pending`);n.pendingRequest=t,n.status=`waiting_input`,n.lastActivityAt=Date.now()}resolvePendingRequest(e,t){let n=this.subagents.get(e);n?.pendingRequest&&(n.pendingRequest.resolver(t),n.pendingRequest=void 0,n.lastActivityAt=Date.now(),n.status===`waiting_input`&&(n.status=`running`))}markCompleted(e,t,n,r){let i=this.subagents.get(e);if(!i)throw new l(u.NOT_FOUND,`Subagent ${e} not found`);if(S(i.status))throw new l(u.ALREADY_TERMINAL,`Subagent already in terminal state: ${i.status}`);let a=Date.now();i.status=`completed`,i.result=t,i.summary=n,i.completionSource=r,i.endTime=a,i.lastActivityAt=a,this.resolveAwaiters(e)}markFailed(e,t){let n=this.subagents.get(e);if(!n||S(n.status))return;let r=Date.now();n.status=`failed`,n.error=t,n.endTime=r,n.lastActivityAt=r,this.resolveAwaiters(e)}markCancelled(e){let t=this.subagents.get(e);if(!t||S(t.status))return!1;let n=Date.now();return t.status=`cancelled`,t.endTime=n,t.lastActivityAt=n,t.pendingRequest&&=(t.pendingRequest.resolver(null),void 0),this.resolveAwaiters(e),!0}addAwaiter(e,t){let n=this.awaiters.get(e)??[];n.push(t),this.awaiters.set(e,n)}removeAwaiter(e,t){let n=this.awaiters.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),n.length===0&&this.awaiters.delete(e),!0)}resolveAwaiters(e){let t=this.subagents.get(e),n=this.awaiters.get(e);if(!n||!t)return;let r={status:t.status,result:t.result,error:t.error,completionSource:t.completionSource};for(let e of n)e(r);this.awaiters.delete(e)}cleanup(){let e=Date.now(),t=0;for(let[n,r]of this.subagents)S(r.status)&&r.endTime&&e-r.endTime>this.constraints.stateRetentionMs&&(this.subagents.delete(n),t++);return t}sweepHung(e){if(e<=0)return 0;let t=Date.now(),n=0;for(let r of this.subagents.values())S(r.status)||r.status!==`waiting_input`&&r.status!==`hung`&&t-r.lastActivityAt>=e&&(r.status=`hung`,r.lastActivityAt=t,n++);return n}};async function w(e,t,n){let r=n?.trim();if(r)return r;let{session:i}=await e.request(o.get,{sessionId:t});return(i?.agents.find(e=>e.agentId===i.leadAgentId)??i?.agents[0])?.adapterName?.trim()}function T(e,t){let n=e.manager.get(t.subagentId);if(!n)throw Error(`Subagent not found: ${t.subagentId}`);return{status:n.status,childSessionId:n.childSessionId,pendingRequest:n.pendingRequest?{messageId:n.pendingRequest.messageId,question:n.pendingRequest.question,context:n.pendingRequest.context}:void 0,progress:n.progressUpdates.toArray(),result:n.result,summary:n.summary,error:n.error}}async function E(e,t){let{parentSessionId:n,config:r,depth:i,spawningToolCallId:a}=t,{constraints:o}=e.manager,s=Math.min(r.maxDepth??o.maxDepth,o.maxDepth);if(i>s)throw new l(u.DEPTH_EXCEEDED,`Maximum subagent depth (${s}) exceeded`);if(e.manager.countActiveBySession(n)>=o.maxConcurrentPerSession)throw new l(u.SESSION_LIMIT,`Maximum concurrent subagents per session (${o.maxConcurrentPerSession}) reached`);if(e.manager.countTotalActive()>=o.maxTotalActive)throw new l(u.GLOBAL_LIMIT,`Maximum total active subagents (${o.maxTotalActive}) reached`);let c=await w(e.bus,n,r.adapterName);if(!c)throw new l(u.ADAPTER_NOT_ALLOWED,`adapterName is required for subagent spawn when parent session has no inheritable adapter`);if(o.allowedAdapters.length>0&&!o.allowedAdapters.includes(c))throw new l(u.ADAPTER_NOT_ALLOWED,`Adapter '${c}' is not allowed`);if(r.model&&o.allowedModels.length>0&&!o.allowedModels.includes(r.model))throw new l(u.MODEL_NOT_ALLOWED,`Model '${r.model}' is not allowed`);let f={...r,adapterName:c},p=crypto.randomUUID();return e.manager.track({subagentId:p,parentSessionId:n,config:f,depth:i}),await e.bus.emit(d.spawned,{subagentId:p,parentSessionId:n,task:f.task,config:f,depth:i,...a!==void 0&&{spawningToolCallId:a}}),{subagentId:p,status:`spawning`}}async function D(e,t){let{subagentId:n,timeoutMs:r}=t,i=e.manager.get(n);if(!i)throw Error(`Subagent not found: ${n}`);if([`completed`,`failed`,`cancelled`].includes(i.status))return{status:i.status,result:i.result,error:i.error,completionSource:i.completionSource};if(i.status===`waiting_input`&&i.pendingRequest)return{status:`waiting_input`,pendingRequest:{messageId:i.pendingRequest.messageId,question:i.pendingRequest.question,context:i.pendingRequest.context}};let a=r??e.manager.constraints.defaultAwaitTimeoutMs;return new Promise(t=>{let r=!1,i,o=e=>{r||(r=!0,i&&clearTimeout(i),t({status:e.status,result:e.result,error:e.error,pendingRequest:e.pendingRequest,completionSource:e.completionSource}))};e.manager.addAwaiter(n,o),a>0&&(i=setTimeout(()=>{r||(r=!0,e.manager.removeAwaiter(n,o),t({status:`timeout`}))},a))})}async function O(e,t){let{subagentId:n,content:r,inResponseTo:i}=t,a=e.manager.get(n);if(!a)throw Error(`Subagent not found: ${n}`);let o=!1;return i&&a.pendingRequest?.messageId===i&&(e.manager.resolvePendingRequest(n,r),o=!0),await e.bus.emit(d.toChild,{subagentId:n,messageId:crypto.randomUUID(),content:r,inResponseTo:i}),{sent:!0,resolvedPending:o}}async function k(e,t){let{subagentId:n,reason:r}=t,i=e.manager.markCancelled(n);return i&&await e.bus.emit(d.cancelled,{subagentId:n,reason:r??`Killed by parent`}),{killed:i}}async function A(e,t){let{subagentId:n,update:r,percentComplete:i}=t;if(!e.manager.get(n))throw Error(`Subagent not found: ${n}`);let a=i===void 0?r:`[${i}%] ${r}`;return e.manager.addProgress(n,a),await e.bus.emit(d.toParent,{subagentId:n,messageId:crypto.randomUUID(),type:`progress`,content:a}),{reported:!0}}async function j(e,t){let{subagentId:n,question:r,context:i,timeoutMs:a}=t;if(!e.manager.get(n))throw Error(`Subagent not found: ${n}`);let o=crypto.randomUUID(),s=a??e.manager.constraints.defaultRequestTimeoutMs;return await e.bus.emit(d.toParent,{subagentId:n,messageId:o,type:`request_input`,content:r,context:i}),new Promise(t=>{let a=!1,c;e.manager.setPendingRequest(n,{messageId:o,question:r,context:i,resolver:e=>{a||(a=!0,c&&clearTimeout(c),t(e===null?{responded:!1,timedOut:!0}:{responded:!0,response:e,timedOut:!1}))}}),s>0&&(c=setTimeout(()=>{a||e.manager.resolvePendingRequest(n,null)},s))})}async function M(e,t){let{subagentId:n,result:r,summary:i}=t;return e.manager.markCompleted(n,r,i,`tool`),await e.bus.emit(d.completed,{subagentId:n,success:!0,result:i?`${i}\n\n${r}`:r}),{completed:!0}}function N(e,t){let{parentSessionId:n}=t;return{subagents:e.manager.getAllNonTerminal().filter(e=>e.parentSessionId===n).map(e=>({subagentId:e.subagentId,task:e.config.task,status:e.status}))}}const P={id:`system:local`,name:`Local`,description:`Default local process execution`,type:`local`,scope:`default`,enabled:!0,createdAt:Date.now(),updatedAt:Date.now()};var F=class extends m{machineId;delegationAllowSet;manager;pendingChildSessionClose=new Set;constructor(e=n,t=a,r,i=new Set){super(e),this.machineId=r,this.delegationAllowSet=i,this.manager=new C(t)}grantDelegation(e,t){this.delegationAllowSet.add(`${e}:${t}`)}revokeDelegation(e,t){this.delegationAllowSet.delete(`${e}:${t}`)}onInit(){this.registerHandler(d.spawned,async e=>{this.handleSpawned(e.payload).catch(e=>{console.error(`[SubagentService] handleSpawned error:`,e)})}),this.registerHandler(d.execute,async e=>{if(!this.isRemoteDelegationAllowed(e))return;let t=await this.handleExecute(e.payload);e.setResult(t)}),this.registerHandler(d.toChild,async e=>{await this.handleToChild(e.payload)}),this.registerHandler(d.completed,async e=>{await this.handleCompleted(e.payload.subagentId)}),this.registerHandler(d.cancelled,async e=>{await this.handleCancelled(e.payload.subagentId)}),this.registerHandler(r.session.closed,e=>{this.handleAdapterSessionClosed(e.payload.sessionId)}),this.registerHandler(i.complete,async e=>{await this.handleAgentComplete(e.payload)}),this.registerRpcHandlers(),this.wirePeriodicSweep()}wirePeriodicSweep(){let{inactivityTimeoutMs:e,sweepIntervalMs:t}=this.manager.constraints;if(t<=0)return;let n=setInterval(()=>{let t=this.manager.sweepHung(e);t>0&&console.warn(`[SubagentService] Swept ${t} hung subagent(s) due to inactivity`),this.manager.cleanup()},t);this.addCleanup(()=>clearInterval(n))}registerRpcHandlers(){let e={manager:this.manager,bus:this.bus};this.registerHandler(d.getStatus,t=>{let n=T(e,t.payload);t.setResult(n)}),this.registerHandler(d.spawn,async t=>{if(!this.isRemoteDelegationAllowed(t))return;let n=await E(e,s.parse(t.payload));t.setResult(n)}),this.registerHandler(d.await,async t=>{let n=await D(e,t.payload);t.setResult(n)}),this.registerHandler(d.send,async t=>{let n=await O(e,t.payload);t.setResult(n)}),this.registerHandler(d.kill,async t=>{let n=await k(e,t.payload);t.setResult(n)}),this.registerHandler(d.reportProgress,async t=>{let n=await A(e,t.payload);t.setResult(n)}),this.registerHandler(d.requestInput,async t=>{let n=await j(e,t.payload);t.setResult(n)}),this.registerHandler(d.completeTask,async t=>{let n=await M(e,t.payload);t.setResult(n)}),this.registerHandler(d.listBySession,t=>{let n=N(e,t.payload);t.setResult(n)})}onDestroy(){this.pendingChildSessionClose.clear()}async handleSpawned(e){let{subagentId:n,parentSessionId:r,task:i,spawningToolCallId:a}=e,o=c.parse({...e.config,task:i}),s=o.adapterName?.trim();if(!s)return this.failSpawn(n,r,`adapter_start`,`Subagent spawn requires a non-empty adapterName`);this.manager.get(n)||this.manager.track({subagentId:n,parentSessionId:r,config:o,depth:e.depth??1});let l,u;try{u=await this.buildExecutionTargetResolutionParams(r,o.executionTargetId);let e=await this.bus.requestOptional(t.resolve,u),i;if(e.handled)i=e.data.executionTarget;else if(u.executionTargetId!=null)throw Error(`Execution target resolver unavailable for explicit target '${u.executionTargetId}'`);else i=P;if(i.type!==`local`)return this.failSpawn(n,r,`adapter_start`,`Execution target type '${i.type}' is not yet supported for subagents`);l=u.executionTargetId??void 0}catch(e){return this.failSpawn(n,r,`adapter_start`,e)}let d;try{d=await this.createChildSessionForSpawn(n,r,o,l,u,a)}catch(e){return this.failSpawn(n,r,`session_create`,e)}let f=this.manager.get(n);if(!(f&&this.isTerminalSubagentStatus(f.status)))try{await this.startAdapterForSubagent(s,o,d,i)}catch(e){return this.failSpawn(n,r,`adapter_start`,e)}}async createChildSessionForSpawn(e,t,n,r,i,a){let{sessionId:s}=await this.bus.request(o.create,this.buildChildSessionCreatePayload(t,n,r,a));return this.manager.setChildSessionId(e,s),this.pendingChildSessionClose.has(e)&&await this.closeChildSession(e),s}async startAdapterForSubagent(e,t,n,i){let{adapterId:a}=await this.bus.request(h.resolveId,{adapterName:e,...this.machineId!==void 0&&{machineId:this.machineId}}),o=t.providerContext??(t.providerConfigId?await _(this.bus,t.providerConfigId):void 0);o!==void 0&&await g(this.bus,o);let s=await this.bus.request(r.startAgent,{adapterId:a,role:`lead`,...o!==void 0&&{providerContext:o},sessionId:n,initialMessage:i,model:t.model,reasoningEffort:t.reasoningEffort,systemPrompt:t.systemPrompt,responseSchema:t.responseSchema,allowedTools:t.tools,disallowedTools:t.disallowedTools,allowedDirectories:t.allowedDirectories,...t.harnessId!==void 0&&{harnessId:t.harnessId}});if(!s||s.success!==!0)throw Error(s?.message??`Adapter start failed`)}async failSpawn(e,t,n,r){let i=r instanceof Error?r.message:String(r);return this.manager.markFailed(e,i),await this.emitExecutionFailed(e,t,n,r),i}async buildExecutionTargetResolutionParams(t,n){if(n!==void 0)return{executionTargetId:n};let{session:r}=await this.bus.request(e.get,{sessionId:t});if(!r)throw Error(`Parent session not found: ${t}`);return{executionTargetId:r.executionTargetId}}buildChildSessionCreatePayload(e,t,n,r){return{branchKind:`subagent`,parentSessionId:e,contextInheritance:t.contextMode===`fork`?`parent-history`:`none`,...n!==void 0&&{executionTargetId:n},...r!==void 0&&{spawningToolCallId:r}}}async handleExecute(e){let t=c.parse({...e.config,task:e.task});this.manager.track({subagentId:e.subagentId,parentSessionId:e.parentSessionId,config:t,depth:e.depth});let n=await this.handleSpawned({subagentId:e.subagentId,parentSessionId:e.parentSessionId,task:e.task,config:t,depth:e.depth});return n?{success:!1,error:n}:{success:!0}}async handleToChild(e){let{subagentId:t,content:n}=e,r=this.manager.get(t);if(!r){console.warn(`[SubagentService] No subagent found: ${t}`);return}if(!r.childSessionId){console.warn(`[SubagentService] No child session for subagent: ${t}`);return}try{await this.bus.request(o.sendMessage,{sessionId:r.childSessionId,message:n,source:`system`})}catch(e){console.error(`[SubagentService] Failed to route message to child session:`,e)}}async handleCompleted(e){await this.closeChildSession(e)}async handleCancelled(e){await this.closeChildSession(e)}async closeChildSession(e){let t=this.manager.get(e);if(t){if(!t.childSessionId){this.pendingChildSessionClose.add(e);return}this.pendingChildSessionClose.delete(e);try{await this.bus.request(o.close,{sessionId:t.childSessionId})}catch(t){console.error(`[SubagentService] Failed to close child session for subagent ${e}:`,t)}}}isTerminalSubagentStatus(e){return e===`completed`||e===`failed`||e===`cancelled`}handleAdapterSessionClosed(e){for(let t of this.manager.getAllNonTerminal())if(t.childSessionId===e){console.warn(`[SubagentService] Adapter session closed for subagent ${t.subagentId}: ${e}`),this.manager.markFailed(t.subagentId,`adapter-session-closed`);return}}async handleAgentComplete(e){let{sessionId:t,outcome:n,message:r,error:i}=e;if(t)for(let e of this.manager.getAllNonTerminal()){if(e.childSessionId!==t)continue;if((e.config.completion??`tool`)!==`turn`||e.status===`waiting_input`)return;let a=n??`completed`;if(a===`completed`){try{this.manager.markCompleted(e.subagentId,r??``,void 0,`turn`)}catch{return}await this.bus.emit(d.completed,{subagentId:e.subagentId,success:!0,result:r??``})}else if(a===`error`){let t=i??`agent turn error`;this.manager.markFailed(e.subagentId,t),await this.bus.emit(d.completed,{subagentId:e.subagentId,success:!1,error:t})}return}}isRemoteDelegationAllowed(e){return e.origin.local||y(e.transport?.peer,this.delegationAllowSet)}async emitExecutionFailed(e,t,n,r){let i=r instanceof Error?r.message:String(r);await this.bus.emit(d.executionFailed,{subagentId:e,parentSessionId:t,phase:n,error:i}).catch(e=>{console.error(`[SubagentService] Failed to emit executionFailed:`,e)})}};const I=p(`subagent-service`),L={name:I.name,displayName:`Subagent Service`,version:`0.1.0`,critical:!0,surface:`headless`,dependencies:[f(`session`)],create:e=>new F(e.bus,a,e.machineId)};export{y as a,C as i,L as n,F as r,I as t};
|