@makaio/framework 1.0.0-dev-1790599449321 → 1.0.0-dev-1790624115602
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.makaio-build.json +2 -2
- package/dist/clients/hook-subjects.d.mts +124 -0
- package/dist/clients/hook-subjects.mjs +1 -0
- package/dist/clients/index.d.mts +2 -118
- package/dist/clients/index.mjs +1 -1
- package/dist/contracts/artifact/index.d.mts +1 -1
- package/dist/contracts/capabilities/index.d.mts +1 -1
- package/dist/contracts/client/index.d.mts +1 -1
- package/dist/contracts/extension/index.d.mts +2 -2
- package/dist/contracts/index.d.mts +18 -18
- package/dist/contracts/variant/index.d.mts +1 -1
- package/dist/contracts/worker/index.d.mts +1 -1
- package/dist/contracts/workflow/index.d.mts +1 -1
- package/dist/{framework-packages-CLrOCDDK.mjs → framework-packages-D2fycy02.mjs} +1 -1
- package/dist/{index-9O8N514B2.d.mts → index-6UlianLY2.d.mts} +4 -4
- package/dist/{index-CPOJqxrf2.d.mts → index-BUtnnwzK2.d.mts} +7 -7
- package/dist/{index-CcTlPuIg.d.mts → index-BhvXJhTY.d.mts} +17 -17
- package/dist/{index-GlDcAkrf.d.mts → index-BtyeBaw-.d.mts} +31 -31
- package/dist/{index-uusIGFLo.d.mts → index-CQAriG-z.d.mts} +1 -1
- package/dist/{index-BSYu8AXG.d.mts → index-CbVqpQBu.d.mts} +60 -60
- package/dist/{index-xqiInEhj.d.mts → index-DmV9ybgT.d.mts} +24 -2
- package/dist/{index-_CsKmUOy.d.mts → index-DpiNhNHS.d.mts} +11 -11
- package/dist/{index-D9hIDsPr.d.mts → index-DyWD9bfP.d.mts} +46 -2
- package/dist/package.json +1 -1
- package/dist/runtime-node/index.d.mts +1 -1
- package/dist/runtime-node/index.mjs +22 -22
- package/dist/runtime-node/workflow-worker/index.d.mts +1 -1
- package/dist/runtime-node/workflow-worker/index.mjs +1 -1
- package/dist/{schemas-CjFPsYeV.d.mts → schemas-BjhhkGN_.d.mts} +4 -4
- package/dist/{schemas-DnyXA-9o.d.mts → schemas-CYjPZwlQ.d.mts} +2 -2
- package/dist/{schemas-DPtj1sPC2.d.mts → schemas-RwAlAMbq2.d.mts} +7 -7
- package/dist/services/index.d.mts +33 -14
- package/dist/services/index.mjs +1 -1
- package/dist/services/preferences/index.d.mts +2 -2
- package/dist/services/preferences/schemas.d.mts +1 -1
- package/dist/services/preferences/storage-namespace.d.mts +2 -2
- package/dist/services/settings/namespace.d.mts +2 -2
- package/dist/services/settings/storage/extension-configs/namespace.d.mts +3 -3
- 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.d.mts +1 -1
- package/dist/services/tool-approval/index.mjs +1 -1
- package/dist/services/tools/index.mjs +1 -1
- package/dist/services/workflow-transitions/index.mjs +1 -1
- package/dist/{storage-namespace-CwwiV3kt.d.mts → storage-namespace-NHTWAjaX.d.mts} +10 -10
- package/dist/tool-approval-service-BCN4W8eS.mjs +1 -0
- package/dist/tools/index.d.mts +13 -1
- package/dist/tools/index.mjs +1 -1
- package/dist/{tools-nkqlVAQ1.mjs → tools-BCL_dtHe.mjs} +1 -1
- package/dist/ui-kernel/index.d.mts +4 -4
- package/dist/ui-kernel/pages/namespace.d.mts +4 -4
- package/dist/ui-kernel/pages/schemas.d.mts +1 -1
- package/dist/workflow-engine/index.d.mts +23 -23
- package/dist/{workflow-transitions-DEaRIZDU.mjs → workflow-transitions-7d9lGi08.mjs} +1 -1
- package/dist/workflow-worker-BCLy_g_a.mjs +3 -0
- package/package.json +5 -1
- package/dist/tool-approval-service-BRyBObcL.mjs +0 -1
- package/dist/workflow-worker-DXCXb3g-.mjs +0 -3
|
@@ -17,9 +17,9 @@ declare const PreferencesNamespace: _$_makaio_core0.BusNamespaceDefinition<"pref
|
|
|
17
17
|
scope: _$zod.ZodString;
|
|
18
18
|
context: _$zod.ZodOptional<_$zod.ZodString>;
|
|
19
19
|
viewport: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
20
|
+
mobile: "mobile";
|
|
20
21
|
desktop: "desktop";
|
|
21
22
|
tablet: "tablet";
|
|
22
|
-
mobile: "mobile";
|
|
23
23
|
}>>;
|
|
24
24
|
}, _$zod_v4_core0.$strip>;
|
|
25
25
|
category: _$zod.ZodString;
|
|
@@ -38,9 +38,9 @@ declare const PreferencesNamespace: _$_makaio_core0.BusNamespaceDefinition<"pref
|
|
|
38
38
|
scope: _$zod.ZodString;
|
|
39
39
|
context: _$zod.ZodOptional<_$zod.ZodString>;
|
|
40
40
|
viewport: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
41
|
+
mobile: "mobile";
|
|
41
42
|
desktop: "desktop";
|
|
42
43
|
tablet: "tablet";
|
|
43
|
-
mobile: "mobile";
|
|
44
44
|
}>>;
|
|
45
45
|
}, _$zod_v4_core0.$strip>;
|
|
46
46
|
category: _$zod.ZodString;
|
|
@@ -60,9 +60,9 @@ declare const PreferencesNamespace: _$_makaio_core0.BusNamespaceDefinition<"pref
|
|
|
60
60
|
scope: _$zod.ZodString;
|
|
61
61
|
context: _$zod.ZodOptional<_$zod.ZodString>;
|
|
62
62
|
viewport: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
63
|
+
mobile: "mobile";
|
|
63
64
|
desktop: "desktop";
|
|
64
65
|
tablet: "tablet";
|
|
65
|
-
mobile: "mobile";
|
|
66
66
|
}>>;
|
|
67
67
|
}, _$zod_v4_core0.$strip>;
|
|
68
68
|
category: _$zod.ZodString;
|
|
@@ -81,9 +81,9 @@ declare const PreferencesNamespace: _$_makaio_core0.BusNamespaceDefinition<"pref
|
|
|
81
81
|
scope: _$zod.ZodOptional<_$zod.ZodString>;
|
|
82
82
|
context: _$zod.ZodOptional<_$zod.ZodOptional<_$zod.ZodString>>;
|
|
83
83
|
viewport: _$zod.ZodOptional<_$zod.ZodOptional<_$zod.ZodEnum<{
|
|
84
|
+
mobile: "mobile";
|
|
84
85
|
desktop: "desktop";
|
|
85
86
|
tablet: "tablet";
|
|
86
|
-
mobile: "mobile";
|
|
87
87
|
}>>>;
|
|
88
88
|
}, _$zod_v4_core0.$strip>>;
|
|
89
89
|
category: _$zod.ZodOptional<_$zod.ZodString>;
|
|
@@ -98,9 +98,9 @@ declare const PreferencesNamespace: _$_makaio_core0.BusNamespaceDefinition<"pref
|
|
|
98
98
|
scope: _$zod.ZodString;
|
|
99
99
|
context: _$zod.ZodOptional<_$zod.ZodString>;
|
|
100
100
|
viewport: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
101
|
+
mobile: "mobile";
|
|
101
102
|
desktop: "desktop";
|
|
102
103
|
tablet: "tablet";
|
|
103
|
-
mobile: "mobile";
|
|
104
104
|
}>>;
|
|
105
105
|
}, _$zod_v4_core0.$strip>;
|
|
106
106
|
category: _$zod.ZodString;
|
|
@@ -124,9 +124,9 @@ declare const PreferencesSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.F
|
|
|
124
124
|
scope: _$zod.ZodString;
|
|
125
125
|
context: _$zod.ZodOptional<_$zod.ZodString>;
|
|
126
126
|
viewport: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
127
|
+
mobile: "mobile";
|
|
127
128
|
desktop: "desktop";
|
|
128
129
|
tablet: "tablet";
|
|
129
|
-
mobile: "mobile";
|
|
130
130
|
}>>;
|
|
131
131
|
}, _$zod_v4_core0.$strip>;
|
|
132
132
|
category: _$zod.ZodString;
|
|
@@ -145,9 +145,9 @@ declare const PreferencesSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.F
|
|
|
145
145
|
scope: _$zod.ZodString;
|
|
146
146
|
context: _$zod.ZodOptional<_$zod.ZodString>;
|
|
147
147
|
viewport: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
148
|
+
mobile: "mobile";
|
|
148
149
|
desktop: "desktop";
|
|
149
150
|
tablet: "tablet";
|
|
150
|
-
mobile: "mobile";
|
|
151
151
|
}>>;
|
|
152
152
|
}, _$zod_v4_core0.$strip>;
|
|
153
153
|
category: _$zod.ZodString;
|
|
@@ -167,9 +167,9 @@ declare const PreferencesSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.F
|
|
|
167
167
|
scope: _$zod.ZodString;
|
|
168
168
|
context: _$zod.ZodOptional<_$zod.ZodString>;
|
|
169
169
|
viewport: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
170
|
+
mobile: "mobile";
|
|
170
171
|
desktop: "desktop";
|
|
171
172
|
tablet: "tablet";
|
|
172
|
-
mobile: "mobile";
|
|
173
173
|
}>>;
|
|
174
174
|
}, _$zod_v4_core0.$strip>;
|
|
175
175
|
category: _$zod.ZodString;
|
|
@@ -188,9 +188,9 @@ declare const PreferencesSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.F
|
|
|
188
188
|
scope: _$zod.ZodOptional<_$zod.ZodString>;
|
|
189
189
|
context: _$zod.ZodOptional<_$zod.ZodOptional<_$zod.ZodString>>;
|
|
190
190
|
viewport: _$zod.ZodOptional<_$zod.ZodOptional<_$zod.ZodEnum<{
|
|
191
|
+
mobile: "mobile";
|
|
191
192
|
desktop: "desktop";
|
|
192
193
|
tablet: "tablet";
|
|
193
|
-
mobile: "mobile";
|
|
194
194
|
}>>>;
|
|
195
195
|
}, _$zod_v4_core0.$strip>>;
|
|
196
196
|
category: _$zod.ZodOptional<_$zod.ZodString>;
|
|
@@ -205,9 +205,9 @@ declare const PreferencesSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.F
|
|
|
205
205
|
scope: _$zod.ZodString;
|
|
206
206
|
context: _$zod.ZodOptional<_$zod.ZodString>;
|
|
207
207
|
viewport: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
208
|
+
mobile: "mobile";
|
|
208
209
|
desktop: "desktop";
|
|
209
210
|
tablet: "tablet";
|
|
210
|
-
mobile: "mobile";
|
|
211
211
|
}>>;
|
|
212
212
|
}, _$zod_v4_core0.$strip>;
|
|
213
213
|
category: _$zod.ZodString;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./ownership-recovery-guard-C9h8K1jo.mjs";import{SessionStorageSubjects as t}from"./services/session/storage/namespace.mjs";import"./session-Tj_635zr.mjs";import n from"node:path";import{lstatSync as r,realpathSync as i}from"node:fs";import{AgentSubjects as a,ApprovalSubjects as o,HarnessSubjects as s,ToolNameError as c,computeMetaTags as l,resolveToolPolicy as u,toolVocabularyForAdapter as d}from"@makaio/framework/contracts";import{BaseService as f}from"@makaio/framework/service-base";import{extractToolFilePath as p,extractToolRawFilePath as m}from"@makaio/framework/tools";const h={"full-access":0,"always-ask":1,reject:2};function g(){return`apr_${crypto.randomUUID()}`}function _(e){switch(e){case`allow`:return`full-access`;case`deny`:return`reject`;case`ask`:return`always-ask`}}function v(e){if(!e?.length)return`neutral`;let t=l(e);return t.includes(`destructive`)?`destructive`:t.includes(`read-only`)?`safe`:`neutral`}function y(e,t){if(e)return t&&e.toolApprovalOverrides?.[t]!==void 0?e.toolApprovalOverrides[t]:e.approvalPolicy}function b(e,t,n,r){let i=r[t];if(!i?.length)return e;let a=e;for(let e of i){let t=n[e];t&&h[t]>h[a]&&(a=t)}return a}function x(e,t,n){return n.handled?n.data.allowedDirectories??void 0:t?[]:void 0}function S(e,t,n){if(!n||!e?.cwd)return{};let r=E(e,t);return{cwd:e.cwd,...r&&{allowedDirectories:r}}}function C(e,t,n){if(!(!e&&!t))return!n||!n.handled?{policy:`always-ask`}:{policy:_(n.data.action),...n.data.personaName&&{personaName:n.data.personaName},...n.data.profileName&&{profileName:n.data.profileName}}}function w(e,t,n,r){if(!t||!e)return{kind:`none`};let{allowedTools:i,disallowedTools:a}=e;if(i===void 0&&a===void 0)return{kind:`none`};let o=d(e.adapterName);if(o===void 0)return{kind:`none`};let s;try{s=u(o,{allowedTools:i,disallowedTools:a})}catch(e){if(e instanceof c)return{kind:`deny`,message:e.message};throw e}let l=s.checkToolCall(t,n??{});if(!l.allowed)return{kind:`deny`,message:l.reason};if(i===void 0)return{kind:`none`};let f=E(e,r);return f!==void 0&&!k(f,t,n,e.cwd)?{kind:`none`}:{kind:`granted`}}const T=new Set([`Glob`,`Grep`]);function E(e,t){if(e.allowedDirectories!==void 0)return e.allowedDirectories;if((e.personaId||e.profileId)&&t)return x(e.personaId,e.profileId,t)}function D(e){let t=e;for(;;)try{return n.resolve(i(t),n.relative(t,e))}catch(e){if(e.code!==`ENOENT`||r(t,{throwIfNoEntry:!1})!==void 0)return;let i=n.dirname(t);if(i===t)return;t=i}}function O(e,t,r){let i=e=>process.platform===`win32`?e.toLowerCase():e;return e.some(e=>{let a=D(n.resolve(r,e));if(a===void 0)return!1;let o=n.relative(i(a),i(t));return o===``||o!==`..`&&!o.startsWith(`..${n.sep}`)&&!n.isAbsolute(o)})}function k(e,t,r,i){if(!i)return!1;let a=r?.path,o=T.has(t)?n.resolve(i,typeof a==`string`&&a.length>0?a:`.`):p(t,r,i);if(o===null)return!1;let s=D(o);return s===void 0?!1:O(e,s,i)}function A(e,t){let n=t.harness?.toolCapabilityMap&&e.toolName?t.harness.toolCapabilityMap[e.toolName]:void 0;return{requestId:g(),toolCallId:e.toolCallId,toolName:e.toolName,args:e.args,agentId:e.agentId,sessionId:e.sessionId,adapterName:t.resolvedAdapterName,...t.personaName&&{personaName:t.personaName},...t.profileName&&{profileName:t.profileName},capabilities:n,riskLevel:v(n),reasoning:e.reasoning,createdAt:Date.now()}}function j(e,t,n,r){return n===`always-ask`?`always-ask`:e===`reject`?`reject`:r?`always-ask`:t.kind===`granted`?`full-access`:e}var M=class extends f{logger=console;options;constructor(e,t={}){super(e),this.options=t}async onInit(){this.registerHandler(a.toolApprove,async e=>{let t=await this.getAgentMetadata(e.payload.agentId,e.payload.sessionId),n=t.kind===`found`?t.agent:null,r=t.kind===`error`,i=(n?.personaId||n?.profileId)&&e.payload.toolName?await this.fetchRawEnrichedPolicy(n?.personaId,n?.profileId,e.payload.toolName):void 0,a=S(n,i,this.options.fileAccessRuleProvider),o=await this.checkFileAccessDenyReason(e.payload,a);if(o){e.setResult({action:`deny`,message:o,shouldAbort:!1});return}let s=await this.resolveSessionOverride(e.payload.sessionId);if(s===`reject`){e.setResult({action:`deny`,message:`Tool use rejected by session approval policy override`,shouldAbort:!1});return}let c=w(n,e.payload.toolName,e.payload.args,i);if(c.kind===`deny`){e.setResult({action:`deny`,message:c.message,shouldAbort:!1});return}if(s===`full-access`&&!r){e.setResult({action:`allow`});return}let l=await this.resolvePolicyWithContext({adapterName:e.payload.adapterName,toolName:e.payload.toolName},n,i);switch(j(l.policy,c,s,r)){case`full-access`:e.setResult({action:`allow`});return;case`reject`:e.setResult({action:`deny`,message:`Tool use rejected by approval policy`,shouldAbort:!1});return;case`always-ask`:await this.dispatchAlwaysAskApproval(e.payload,e.setResult.bind(e),l);return}})}async dispatchAlwaysAskApproval(e,t,n){let r=A(e,n),i=new AbortController,s=this.bus.on(a.session.closed,()=>{i.abort()},{filter:{agentId:r.agentId,...e.adapterSessionId!==void 0&&{adapterSessionId:e.adapterSessionId}}});try{let e=await this.bus.requestOptional(o.request,r,{timeout:0,signal:i.signal});e.handled&&e.data.action===`allow`?t({action:`allow`,...e.data.updatedInput&&{updatedInput:e.data.updatedInput}}):t({action:`deny`,message:e.handled&&e.data.action===`deny`?e.data.message??`User denied tool execution`:`No approval handler available`,shouldAbort:!1})}catch{t({action:`deny`,message:i.signal.aborted?`Approval cancelled — agent session closed`:`Tool approval request failed`,shouldAbort:!1})}finally{s()}}async checkFileAccessDenyReason(e,t){if(!this.options.fileAccessRuleProvider)return;let r=p(e.toolName,e.args,t.cwd??n.sep);if(!r)return;if(!t.cwd)return`Access denied: file access rules could not be evaluated: agent has no working directory`;let i=m(e.toolName,e.args);if(i?.split(/[\\/]/).includes(`..`))return`Access denied: '${i}' contains a '..' segment; file access rules need a path without parent references`;let a=D(r);try{let e=await this.options.fileAccessRuleProvider(t.cwd,t.allowedDirectories);if(e.isDenied(r)||a!==void 0&&a!==r&&e.isDenied(a))return`Access denied: '${r}' is restricted by .makaioignore rules`}catch{return`Access denied: file access rules could not be evaluated`}if(a===void 0)return`Access denied: file access rules could not be evaluated: '${r}' cannot be resolved safely`;let{allowedDirectories:o}=t;if(o!==void 0&&!O(o,a,t.cwd))return`Access denied: '${r}' is outside the agent's allowed directories`}async fetchRawEnrichedPolicy(e,t,n){try{return await this.bus.requestOptional(o.resolveEnrichedPolicy,{toolName:n,personaId:e,profileId:t})}catch(r){return this.logger.error(`[ToolApprovalService] approval.resolveEnrichedPolicy failed; falling back to fail-closed`,{toolName:n,personaId:e,profileId:t,error:r}),{handled:!1}}}async resolvePolicyWithContext(e,t,n){let r=t?.adapterName??e.adapterName,i=C(t?.personaId,t?.profileId,n),a=await this.resolveHarnessPolicy(r,t?.harnessId,t?.clientId),o=y(a,e.toolName),s=i?.policy??o??`always-ask`,c=s;return a?.capabilityOverrides&&a.toolCapabilityMap&&e.toolName&&(c=b(s,e.toolName,a.capabilityOverrides,a.toolCapabilityMap)),{policy:c,harness:a,agent:t,resolvedAdapterName:r,...i?.personaName&&{personaName:i.personaName},...i?.profileName&&{profileName:i.profileName}}}async getAgentMetadata(t,n){try{let r;if(n){let i=await this.bus.requestOptional(e.listBySession,{sessionId:n});r=i.handled?i.data.agents.find(e=>e.agentId===t):void 0}else{let n=await this.bus.requestOptional(e.get,{agentId:t});r=n.handled?n.data.agent:void 0}return r?{kind:`found`,agent:r}:{kind:`absent`}}catch(e){return this.logger.warn(`[ToolApprovalService] agent lookup failed; forcing always-ask`,{agentId:t,sessionId:n,error:e}),{kind:`error`}}}async resolveSessionOverride(e){if(e)try{let n=await this.bus.requestOptional(t.get,{sessionId:e});return n.handled?n.data.session?.approvalPolicyOverride??void 0:void 0}catch{return}}async resolveHarnessPolicy(e,t,n){try{let r=await this.bus.request(s.resolve,{adapterName:e,...t&&{profileHarnessId:t},...n&&{clientId:n}});return{approvalPolicy:r.approvalPolicy,capabilityOverrides:r.capabilityOverrides,toolCapabilityMap:r.toolCapabilityMap,toolApprovalOverrides:r.toolApprovalOverrides}}catch{return}}};export{M as t};
|
package/dist/tools/index.d.mts
CHANGED
|
@@ -828,6 +828,18 @@ interface FileAccessRules {
|
|
|
828
828
|
type FileAccessRuleProvider = (cwd: string, allowedDirectories?: readonly string[]) => Promise<FileAccessRules>;
|
|
829
829
|
/** Constraints key for FileAccessRules in MakaioContext.constraints. */
|
|
830
830
|
declare const FILE_ACCESS_RULES_KEY: "fileAccessRules";
|
|
831
|
+
/**
|
|
832
|
+
* Extract the raw, unresolved path argument of a filesystem tool call.
|
|
833
|
+
*
|
|
834
|
+
* Returns the path string exactly as the caller wrote it, or `null` if the tool is not a
|
|
835
|
+
* known filesystem tool or the args don't contain the expected path field. Callers that
|
|
836
|
+
* must reject spellings which `path.resolve` would collapse (such as `..` segments behind
|
|
837
|
+
* a symlink) inspect this value.
|
|
838
|
+
* @param toolName - Name of the tool being called
|
|
839
|
+
* @param args - Tool arguments record
|
|
840
|
+
* @returns Raw path argument, or `null` if not applicable
|
|
841
|
+
*/
|
|
842
|
+
declare function extractToolRawFilePath(toolName: string | undefined, args: Record<string, unknown> | undefined): string | null;
|
|
831
843
|
/**
|
|
832
844
|
* Extract the target file path from a filesystem tool call's arguments.
|
|
833
845
|
*
|
|
@@ -840,4 +852,4 @@ declare const FILE_ACCESS_RULES_KEY: "fileAccessRules";
|
|
|
840
852
|
*/
|
|
841
853
|
declare function extractToolFilePath(toolName: string | undefined, args: Record<string, unknown> | undefined, cwd: string): string | null;
|
|
842
854
|
//#endregion
|
|
843
|
-
export { type AnyToolDefinition, type BusLike, type DefineToolConfig, type DefineToolsetConfig, type ExportOptions, FILE_ACCESS_RULES_KEY, type FileAccessRuleProvider, type FileAccessRules, type McpToolDefinition, MemoryStore, type OpenAIFunctionDefinition, type ToolAnnotations, type ToolDefinition, type ToolError, type ToolErrorCode, ToolErrorCodes, type ToolExecutionContext, ToolExecutionError, type ToolFailure, type ToolInfo, type ToolMetadata, type ToolResult, type ToolSuccess, type Toolset, type ToolsetMetadata, defineTool, defineToolset, emitEvent, ensureMcpObjectSchema, errorToToolResult, executeCrudOperation, extractToolFilePath, toMcpTool, toOpenAIFunction, toolError, toolSuccess, toolsetToMcpTools, toolsetToOpenAIFunctions, validateSessionId, widenTool };
|
|
855
|
+
export { type AnyToolDefinition, type BusLike, type DefineToolConfig, type DefineToolsetConfig, type ExportOptions, FILE_ACCESS_RULES_KEY, type FileAccessRuleProvider, type FileAccessRules, type McpToolDefinition, MemoryStore, type OpenAIFunctionDefinition, type ToolAnnotations, type ToolDefinition, type ToolError, type ToolErrorCode, ToolErrorCodes, type ToolExecutionContext, ToolExecutionError, type ToolFailure, type ToolInfo, type ToolMetadata, type ToolResult, type ToolSuccess, type Toolset, type ToolsetMetadata, defineTool, defineToolset, emitEvent, ensureMcpObjectSchema, errorToToolResult, executeCrudOperation, extractToolFilePath, extractToolRawFilePath, toMcpTool, toOpenAIFunction, toolError, toolSuccess, toolsetToMcpTools, toolsetToOpenAIFunctions, validateSessionId, widenTool };
|
package/dist/tools/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"zod";import t from"node:path";const n={TOOL_NOT_FOUND:`TOOL_NOT_FOUND`,VALIDATION_FAILED:`VALIDATION_FAILED`,PERMISSION_DENIED:`PERMISSION_DENIED`,TIMEOUT:`TIMEOUT`,ABORTED:`ABORTED`,EXECUTION_ERROR:`EXECUTION_ERROR`,INVALID_OUTPUT:`INVALID_OUTPUT`,RESOURCE_NOT_FOUND:`RESOURCE_NOT_FOUND`,RESOURCE_EXHAUSTED:`RESOURCE_EXHAUSTED`,INTERNAL_ERROR:`INTERNAL_ERROR`};var r=class extends Error{code;details;constructor(e,t,n){super(t),this.code=e,this.details=n,this.name=`ToolExecutionError`}toToolError(){return{code:this.code,message:this.message,details:this.details}}};function i(e,t,n){return{success:!1,error:{code:e,message:t,details:n}}}function a(e){return{success:!0,data:e}}function o(e,t=n.EXECUTION_ERROR){return e instanceof r?{success:!1,error:e.toToolError()}:e instanceof Error?i(t,e.message,{name:e.name,stack:e.stack}):i(t,String(e))}function s(e){return{metadata:{name:e.name,description:e.description,annotations:e.annotations},inputSchema:e.inputSchema,outputSchema:e.outputSchema,execute:e.execute}}function c(e){if(!Array.isArray(e)&&!(`metadata`in e))return e;if(!Array.isArray(e)&&`metadata`in e){let t=e;return{[t.metadata.name]:t}}let t=e,n={};for(let e of t)n[e.metadata.name]=e;return n}function l(e){return{metadata:{name:e.name,description:e.description,version:e.version},tools:c(e.tools),configSchema:e.configSchema}}function u(e){if(e)return{readOnly:e.readOnly,destructive:e.destructive,idempotent:e.idempotent,openWorldHint:e.requiresApproval}}function d(t){let n=e.toJSONSchema(t.inputSchema);return{name:t.metadata.name,description:t.metadata.description,inputSchema:g(n),annotations:u(t.metadata.annotations)}}function f(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function p(e,t,n){let r=e[0].properties,i=f(r)&&f(r[t])?r[t]:void 0,a=typeof i?.description==`string`?i.description:void 0;return{...i?.type===void 0?{}:{type:i.type},enum:n,...a===void 0?{}:{description:a}}}function m(e){let t=new Map;for(let n of e){let e=n.properties;if(f(e)){for(let[n,r]of Object.entries(e))if(f(r)&&r.const!==void 0){let e=t.get(n)??[];e.push(r.const),t.set(n,e)}}}for(let[n,r]of t){let t=new Set(r.map(e=>JSON.stringify(e)));if(r.length===e.length&&t.size===e.length)return{field:n,values:r}}}function h(e){let t=e.oneOf??e.anyOf;if(!Array.isArray(t)||t.length===0||!t.every(e=>f(e)&&e.type===`object`))return e;let n={},r=m(t);for(let e of t){let t=e.properties;if(f(t))for(let[e,i]of Object.entries(t))f(i)&&e!==r?.field&&(n[e]||(n[e]={...i}))}return r&&(n[r.field]=p(t,r.field,r.values)),{type:`object`,properties:n,required:r?[r.field]:[]}}function g(e){if(!f(e))return{type:`object`};let t=h(e);return`type`in t&&t.type===`object`?t:`oneOf`in e||`anyOf`in e?{...e,type:`object`}:{type:`object`}}function _(t){return{name:t.metadata.name,description:t.metadata.description,parameters:e.toJSONSchema(t.inputSchema)}}function v(e){return Object.values(e.tools).map(e=>d(e))}function y(e){return Object.values(e.tools).map(e=>_(e))}var b=class{factory;sessions=new Map;constructor(e){this.factory=e}get(e,...t){let n=this.sessions.get(e);return n||(n=this.factory(e,...t),this.sessions.set(e,n)),n}has(e){return this.sessions.has(e)}delete(e){return this.sessions.delete(e)}entries(){return this.sessions.entries()}sessionIds(){return Array.from(this.sessions.keys())}get size(){return this.sessions.size}};function x(e,t=`entity`){return e.sessionId?{valid:!0,sessionId:e.sessionId}:{valid:!1,error:i(n.VALIDATION_FAILED,`sessionId is required in context for ${t} operations`)}}async function S(e,t,n){e.bus&&await e.bus.emit(t,n)}async function C(e,t,n,r){let i=x(t,n);if(!i.valid)return i.error;let{sessionId:a}=i,o=r[e.op];return o(e,a,t)}function w(e){return e}const T=`fileAccessRules`,E=new Map([[`read_file`,[`path`,`file_path`]],[`write_file`,[`path`,`file_path`]],[`delete_file`,[`path`]],[`list_directory`,[`path`]],[`Read`,[`path`,`file_path`]],[`Write`,[`path`,`file_path`]],[`Edit`,[`path`,`file_path`]],[`MultiEdit`,[`path`,`file_path`]],[`create_file`,[`path`,`file_path`]]]);function D(e,
|
|
1
|
+
import{z as e}from"zod";import t from"node:path";const n={TOOL_NOT_FOUND:`TOOL_NOT_FOUND`,VALIDATION_FAILED:`VALIDATION_FAILED`,PERMISSION_DENIED:`PERMISSION_DENIED`,TIMEOUT:`TIMEOUT`,ABORTED:`ABORTED`,EXECUTION_ERROR:`EXECUTION_ERROR`,INVALID_OUTPUT:`INVALID_OUTPUT`,RESOURCE_NOT_FOUND:`RESOURCE_NOT_FOUND`,RESOURCE_EXHAUSTED:`RESOURCE_EXHAUSTED`,INTERNAL_ERROR:`INTERNAL_ERROR`};var r=class extends Error{code;details;constructor(e,t,n){super(t),this.code=e,this.details=n,this.name=`ToolExecutionError`}toToolError(){return{code:this.code,message:this.message,details:this.details}}};function i(e,t,n){return{success:!1,error:{code:e,message:t,details:n}}}function a(e){return{success:!0,data:e}}function o(e,t=n.EXECUTION_ERROR){return e instanceof r?{success:!1,error:e.toToolError()}:e instanceof Error?i(t,e.message,{name:e.name,stack:e.stack}):i(t,String(e))}function s(e){return{metadata:{name:e.name,description:e.description,annotations:e.annotations},inputSchema:e.inputSchema,outputSchema:e.outputSchema,execute:e.execute}}function c(e){if(!Array.isArray(e)&&!(`metadata`in e))return e;if(!Array.isArray(e)&&`metadata`in e){let t=e;return{[t.metadata.name]:t}}let t=e,n={};for(let e of t)n[e.metadata.name]=e;return n}function l(e){return{metadata:{name:e.name,description:e.description,version:e.version},tools:c(e.tools),configSchema:e.configSchema}}function u(e){if(e)return{readOnly:e.readOnly,destructive:e.destructive,idempotent:e.idempotent,openWorldHint:e.requiresApproval}}function d(t){let n=e.toJSONSchema(t.inputSchema);return{name:t.metadata.name,description:t.metadata.description,inputSchema:g(n),annotations:u(t.metadata.annotations)}}function f(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function p(e,t,n){let r=e[0].properties,i=f(r)&&f(r[t])?r[t]:void 0,a=typeof i?.description==`string`?i.description:void 0;return{...i?.type===void 0?{}:{type:i.type},enum:n,...a===void 0?{}:{description:a}}}function m(e){let t=new Map;for(let n of e){let e=n.properties;if(f(e)){for(let[n,r]of Object.entries(e))if(f(r)&&r.const!==void 0){let e=t.get(n)??[];e.push(r.const),t.set(n,e)}}}for(let[n,r]of t){let t=new Set(r.map(e=>JSON.stringify(e)));if(r.length===e.length&&t.size===e.length)return{field:n,values:r}}}function h(e){let t=e.oneOf??e.anyOf;if(!Array.isArray(t)||t.length===0||!t.every(e=>f(e)&&e.type===`object`))return e;let n={},r=m(t);for(let e of t){let t=e.properties;if(f(t))for(let[e,i]of Object.entries(t))f(i)&&e!==r?.field&&(n[e]||(n[e]={...i}))}return r&&(n[r.field]=p(t,r.field,r.values)),{type:`object`,properties:n,required:r?[r.field]:[]}}function g(e){if(!f(e))return{type:`object`};let t=h(e);return`type`in t&&t.type===`object`?t:`oneOf`in e||`anyOf`in e?{...e,type:`object`}:{type:`object`}}function _(t){return{name:t.metadata.name,description:t.metadata.description,parameters:e.toJSONSchema(t.inputSchema)}}function v(e){return Object.values(e.tools).map(e=>d(e))}function y(e){return Object.values(e.tools).map(e=>_(e))}var b=class{factory;sessions=new Map;constructor(e){this.factory=e}get(e,...t){let n=this.sessions.get(e);return n||(n=this.factory(e,...t),this.sessions.set(e,n)),n}has(e){return this.sessions.has(e)}delete(e){return this.sessions.delete(e)}entries(){return this.sessions.entries()}sessionIds(){return Array.from(this.sessions.keys())}get size(){return this.sessions.size}};function x(e,t=`entity`){return e.sessionId?{valid:!0,sessionId:e.sessionId}:{valid:!1,error:i(n.VALIDATION_FAILED,`sessionId is required in context for ${t} operations`)}}async function S(e,t,n){e.bus&&await e.bus.emit(t,n)}async function C(e,t,n,r){let i=x(t,n);if(!i.valid)return i.error;let{sessionId:a}=i,o=r[e.op];return o(e,a,t)}function w(e){return e}const T=`fileAccessRules`,E=new Map([[`read_file`,[`path`,`file_path`]],[`write_file`,[`path`,`file_path`]],[`delete_file`,[`path`]],[`list_directory`,[`path`]],[`Read`,[`path`,`file_path`]],[`Write`,[`path`,`file_path`]],[`Edit`,[`path`,`file_path`]],[`MultiEdit`,[`path`,`file_path`]],[`create_file`,[`path`,`file_path`]],[`Glob`,[`path`]],[`Grep`,[`path`]],[`NotebookEdit`,[`notebook_path`]]]);function D(e,t){if(!e||!t)return null;let n=E.get(e);return n?n.map(e=>t[e]).find(e=>typeof e==`string`&&e.length>0)??null:null}function O(e,n,r){let i=D(e,n);return i?t.resolve(r,i):null}export{T as FILE_ACCESS_RULES_KEY,b as MemoryStore,n as ToolErrorCodes,r as ToolExecutionError,s as defineTool,l as defineToolset,S as emitEvent,g as ensureMcpObjectSchema,o as errorToToolResult,C as executeCrudOperation,O as extractToolFilePath,D as extractToolRawFilePath,d as toMcpTool,_ as toOpenAIFunction,i as toolError,a as toolSuccess,v as toolsetToMcpTools,y as toolsetToOpenAIFunctions,x as validateSessionId,w as widenTool};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./framework-packages-
|
|
1
|
+
import{l as e}from"./framework-packages-D2fycy02.mjs";import{FILE_ACCESS_RULES_KEY as t,extractToolFilePath as n}from"@makaio/framework/tools";function r(){let t=new Map;return{filter:e=>!!e.tools?.createToolsets,async processActivated(n,r,i){let a=i.getService(e);if(!a)throw Error(`ToolRegistry is not available. Ensure toolRegistryPackage is included in the composition root.`);let o=r.tools.createToolsets(i),s=[];try{for(let e of o)await a.register(e),s.push(()=>a.deregister(e.metadata.name))}catch(e){for(let e=s.length-1;e>=0;--e)try{await s[e]()}catch(e){console.error(`[ToolContributionProcessor] Rollback error for "${n}":`,e)}throw e}t.set(n,s)},async processStopped(e){let n=t.get(e);if(n){for(let t=n.length-1;t>=0;--t)try{await n[t]()}catch(t){console.error(`[ToolContributionProcessor] Deregister error for "${e}":`,t)}t.delete(e)}}}}export{n,r,t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as PageSurfaceConfig, s as SurfaceId } from "../schemas-
|
|
1
|
+
import { r as PageSurfaceConfig, s as SurfaceId } from "../schemas-BjhhkGN_.mjs";
|
|
2
2
|
import * as _$zod from "zod";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import * as _$_makaio_core0 from "@makaio/framework/core";
|
|
@@ -2309,8 +2309,8 @@ declare const UiSchemas: {
|
|
|
2309
2309
|
ready: z.ZodObject<{
|
|
2310
2310
|
surface: z.ZodEnum<{
|
|
2311
2311
|
tray: "tray";
|
|
2312
|
-
mobile: "mobile";
|
|
2313
2312
|
web: "web";
|
|
2313
|
+
mobile: "mobile";
|
|
2314
2314
|
electron: "electron";
|
|
2315
2315
|
electrobun: "electrobun";
|
|
2316
2316
|
}>;
|
|
@@ -2409,8 +2409,8 @@ declare const UiNamespace: _$_makaio_core0.BusNamespaceDefinition<"ui", {
|
|
|
2409
2409
|
ready: _$zod.ZodObject<{
|
|
2410
2410
|
surface: _$zod.ZodEnum<{
|
|
2411
2411
|
tray: "tray";
|
|
2412
|
-
mobile: "mobile";
|
|
2413
2412
|
web: "web";
|
|
2413
|
+
mobile: "mobile";
|
|
2414
2414
|
electron: "electron";
|
|
2415
2415
|
electrobun: "electrobun";
|
|
2416
2416
|
}>;
|
|
@@ -2450,8 +2450,8 @@ declare const UiSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.FlatSubjec
|
|
|
2450
2450
|
ready: _$zod.ZodObject<{
|
|
2451
2451
|
surface: _$zod.ZodEnum<{
|
|
2452
2452
|
tray: "tray";
|
|
2453
|
-
mobile: "mobile";
|
|
2454
2453
|
web: "web";
|
|
2454
|
+
mobile: "mobile";
|
|
2455
2455
|
electron: "electron";
|
|
2456
2456
|
electrobun: "electrobun";
|
|
2457
2457
|
}>;
|
|
@@ -15,8 +15,8 @@ declare const PageNamespace: _$_makaio_core0.BusNamespaceDefinition<"pages", {
|
|
|
15
15
|
readonly request: _$zod.ZodObject<{
|
|
16
16
|
surface: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
17
17
|
tray: "tray";
|
|
18
|
-
mobile: "mobile";
|
|
19
18
|
web: "web";
|
|
19
|
+
mobile: "mobile";
|
|
20
20
|
electron: "electron";
|
|
21
21
|
electrobun: "electrobun";
|
|
22
22
|
}>>;
|
|
@@ -35,8 +35,8 @@ declare const PageNamespace: _$_makaio_core0.BusNamespaceDefinition<"pages", {
|
|
|
35
35
|
level: _$zod.ZodCustom<_$_makaio_contracts0.UiNavigationLevel, _$_makaio_contracts0.UiNavigationLevel>;
|
|
36
36
|
surfaces: _$zod.ZodOptional<_$zod.ZodUnion<readonly [_$zod.ZodLiteral<"all">, _$zod.ZodArray<_$zod.ZodEnum<{
|
|
37
37
|
tray: "tray";
|
|
38
|
-
mobile: "mobile";
|
|
39
38
|
web: "web";
|
|
39
|
+
mobile: "mobile";
|
|
40
40
|
electron: "electron";
|
|
41
41
|
electrobun: "electrobun";
|
|
42
42
|
}>>]>>;
|
|
@@ -55,8 +55,8 @@ declare const PageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.FlatSubj
|
|
|
55
55
|
readonly request: _$zod.ZodObject<{
|
|
56
56
|
surface: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
57
57
|
tray: "tray";
|
|
58
|
-
mobile: "mobile";
|
|
59
58
|
web: "web";
|
|
59
|
+
mobile: "mobile";
|
|
60
60
|
electron: "electron";
|
|
61
61
|
electrobun: "electrobun";
|
|
62
62
|
}>>;
|
|
@@ -75,8 +75,8 @@ declare const PageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.FlatSubj
|
|
|
75
75
|
level: _$zod.ZodCustom<_$_makaio_contracts0.UiNavigationLevel, _$_makaio_contracts0.UiNavigationLevel>;
|
|
76
76
|
surfaces: _$zod.ZodOptional<_$zod.ZodUnion<readonly [_$zod.ZodLiteral<"all">, _$zod.ZodArray<_$zod.ZodEnum<{
|
|
77
77
|
tray: "tray";
|
|
78
|
-
mobile: "mobile";
|
|
79
78
|
web: "web";
|
|
79
|
+
mobile: "mobile";
|
|
80
80
|
electron: "electron";
|
|
81
81
|
electrobun: "electrobun";
|
|
82
82
|
}>>]>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SurfaceCapabilitySchema, c as SurfaceIdSchema, i as SurfaceCapability, l as isPageVisibleOnSurface, n as PageSchemas, o as SurfaceDeclaration, r as PageSurfaceConfig, s as SurfaceId, t as PageMetadata } from "../../schemas-
|
|
1
|
+
import { a as SurfaceCapabilitySchema, c as SurfaceIdSchema, i as SurfaceCapability, l as isPageVisibleOnSurface, n as PageSchemas, o as SurfaceDeclaration, r as PageSurfaceConfig, s as SurfaceId, t as PageMetadata } from "../../schemas-BjhhkGN_.mjs";
|
|
2
2
|
export { PageMetadata, PageSchemas, PageSurfaceConfig, SurfaceCapability, SurfaceCapabilitySchema, SurfaceDeclaration, SurfaceId, SurfaceIdSchema, isPageVisibleOnSurface };
|
|
@@ -1113,8 +1113,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
1113
1113
|
"exit-and-resume": "exit-and-resume";
|
|
1114
1114
|
}>>;
|
|
1115
1115
|
terminalAuthority: z.ZodOptional<z.ZodEnum<{
|
|
1116
|
-
worker: "worker";
|
|
1117
1116
|
authority: "authority";
|
|
1117
|
+
worker: "worker";
|
|
1118
1118
|
}>>;
|
|
1119
1119
|
materializationSpec: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1120
1120
|
kind: z.ZodLiteral<"local-directory">;
|
|
@@ -1182,10 +1182,10 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
1182
1182
|
frameId: z.ZodString;
|
|
1183
1183
|
nodeId: z.ZodString;
|
|
1184
1184
|
nodeType: z.ZodEnum<{
|
|
1185
|
+
sequence: "sequence";
|
|
1185
1186
|
station: "station";
|
|
1186
1187
|
"delegate-agent": "delegate-agent";
|
|
1187
1188
|
"delegate-role": "delegate-role";
|
|
1188
|
-
sequence: "sequence";
|
|
1189
1189
|
parallel: "parallel";
|
|
1190
1190
|
gate: "gate";
|
|
1191
1191
|
iterate: "iterate";
|
|
@@ -1227,10 +1227,10 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
1227
1227
|
frameId: z.ZodString;
|
|
1228
1228
|
nodeId: z.ZodString;
|
|
1229
1229
|
nodeType: z.ZodEnum<{
|
|
1230
|
+
sequence: "sequence";
|
|
1230
1231
|
station: "station";
|
|
1231
1232
|
"delegate-agent": "delegate-agent";
|
|
1232
1233
|
"delegate-role": "delegate-role";
|
|
1233
|
-
sequence: "sequence";
|
|
1234
1234
|
parallel: "parallel";
|
|
1235
1235
|
gate: "gate";
|
|
1236
1236
|
iterate: "iterate";
|
|
@@ -1586,10 +1586,10 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
1586
1586
|
frameId: z.ZodString;
|
|
1587
1587
|
nodeId: z.ZodString;
|
|
1588
1588
|
nodeType: z.ZodEnum<{
|
|
1589
|
+
sequence: "sequence";
|
|
1589
1590
|
station: "station";
|
|
1590
1591
|
"delegate-agent": "delegate-agent";
|
|
1591
1592
|
"delegate-role": "delegate-role";
|
|
1592
|
-
sequence: "sequence";
|
|
1593
1593
|
parallel: "parallel";
|
|
1594
1594
|
gate: "gate";
|
|
1595
1595
|
iterate: "iterate";
|
|
@@ -1632,10 +1632,10 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
1632
1632
|
frameId: z.ZodString;
|
|
1633
1633
|
nodeId: z.ZodString;
|
|
1634
1634
|
nodeType: z.ZodEnum<{
|
|
1635
|
+
sequence: "sequence";
|
|
1635
1636
|
station: "station";
|
|
1636
1637
|
"delegate-agent": "delegate-agent";
|
|
1637
1638
|
"delegate-role": "delegate-role";
|
|
1638
|
-
sequence: "sequence";
|
|
1639
1639
|
parallel: "parallel";
|
|
1640
1640
|
gate: "gate";
|
|
1641
1641
|
iterate: "iterate";
|
|
@@ -1675,10 +1675,10 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
1675
1675
|
frameId: z.ZodString;
|
|
1676
1676
|
nodeId: z.ZodString;
|
|
1677
1677
|
nodeType: z.ZodEnum<{
|
|
1678
|
+
sequence: "sequence";
|
|
1678
1679
|
station: "station";
|
|
1679
1680
|
"delegate-agent": "delegate-agent";
|
|
1680
1681
|
"delegate-role": "delegate-role";
|
|
1681
|
-
sequence: "sequence";
|
|
1682
1682
|
parallel: "parallel";
|
|
1683
1683
|
gate: "gate";
|
|
1684
1684
|
iterate: "iterate";
|
|
@@ -2215,8 +2215,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
2215
2215
|
"exit-and-resume": "exit-and-resume";
|
|
2216
2216
|
}>>;
|
|
2217
2217
|
terminalAuthority: z.ZodOptional<z.ZodEnum<{
|
|
2218
|
-
worker: "worker";
|
|
2219
2218
|
authority: "authority";
|
|
2219
|
+
worker: "worker";
|
|
2220
2220
|
}>>;
|
|
2221
2221
|
materializationSpec: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2222
2222
|
kind: z.ZodLiteral<"local-directory">;
|
|
@@ -2402,8 +2402,8 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
2402
2402
|
"exit-and-resume": "exit-and-resume";
|
|
2403
2403
|
}>>;
|
|
2404
2404
|
terminalAuthority: z.ZodOptional<z.ZodEnum<{
|
|
2405
|
-
worker: "worker";
|
|
2406
2405
|
authority: "authority";
|
|
2406
|
+
worker: "worker";
|
|
2407
2407
|
}>>;
|
|
2408
2408
|
materializationSpec: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2409
2409
|
kind: z.ZodLiteral<"local-directory">;
|
|
@@ -3334,7 +3334,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
3334
3334
|
tableName: "workflow_execution_frames";
|
|
3335
3335
|
dataType: "string";
|
|
3336
3336
|
columnType: "SQLiteText";
|
|
3337
|
-
data: "station" | "delegate-agent" | "delegate-role" | "
|
|
3337
|
+
data: "sequence" | "station" | "delegate-agent" | "delegate-role" | "parallel" | "gate" | "iterate" | "iterate-chain" | "loop";
|
|
3338
3338
|
driverParam: string;
|
|
3339
3339
|
notNull: true;
|
|
3340
3340
|
hasDefault: false;
|
|
@@ -3347,7 +3347,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
3347
3347
|
generated: undefined;
|
|
3348
3348
|
}, {}, {
|
|
3349
3349
|
length: number | undefined;
|
|
3350
|
-
$type: "station" | "delegate-agent" | "delegate-role" | "
|
|
3350
|
+
$type: "sequence" | "station" | "delegate-agent" | "delegate-role" | "parallel" | "gate" | "iterate" | "iterate-chain" | "loop";
|
|
3351
3351
|
}>;
|
|
3352
3352
|
path: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
3353
3353
|
name: string;
|
|
@@ -4821,7 +4821,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
4821
4821
|
tableName: "workflow_run_contexts";
|
|
4822
4822
|
dataType: "string";
|
|
4823
4823
|
columnType: "SQLiteText";
|
|
4824
|
-
data: "
|
|
4824
|
+
data: "authority" | "worker" | undefined;
|
|
4825
4825
|
driverParam: string;
|
|
4826
4826
|
notNull: false;
|
|
4827
4827
|
hasDefault: false;
|
|
@@ -4834,7 +4834,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
4834
4834
|
generated: undefined;
|
|
4835
4835
|
}, {}, {
|
|
4836
4836
|
length: number | undefined;
|
|
4837
|
-
$type: "
|
|
4837
|
+
$type: "authority" | "worker" | undefined;
|
|
4838
4838
|
}>;
|
|
4839
4839
|
materializationSpec: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
4840
4840
|
name: string;
|
|
@@ -5167,7 +5167,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
5167
5167
|
tableName: "worklog_frame_entries";
|
|
5168
5168
|
dataType: "string";
|
|
5169
5169
|
columnType: "SQLiteText";
|
|
5170
|
-
data: "station" | "delegate-agent" | "delegate-role" | "
|
|
5170
|
+
data: "sequence" | "station" | "delegate-agent" | "delegate-role" | "parallel" | "gate" | "iterate" | "iterate-chain" | "loop";
|
|
5171
5171
|
driverParam: string;
|
|
5172
5172
|
notNull: true;
|
|
5173
5173
|
hasDefault: false;
|
|
@@ -5180,7 +5180,7 @@ declare const WorkflowStorageNamespace: _$_makaio_storage_core0.StorageNamespace
|
|
|
5180
5180
|
generated: undefined;
|
|
5181
5181
|
}, {}, {
|
|
5182
5182
|
length: number | undefined;
|
|
5183
|
-
$type: "station" | "delegate-agent" | "delegate-role" | "
|
|
5183
|
+
$type: "sequence" | "station" | "delegate-agent" | "delegate-role" | "parallel" | "gate" | "iterate" | "iterate-chain" | "loop";
|
|
5184
5184
|
}>;
|
|
5185
5185
|
path: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
5186
5186
|
name: string;
|
|
@@ -6762,8 +6762,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
|
|
|
6762
6762
|
"exit-and-resume": "exit-and-resume";
|
|
6763
6763
|
}>>;
|
|
6764
6764
|
terminalAuthority: z.ZodOptional<z.ZodEnum<{
|
|
6765
|
-
worker: "worker";
|
|
6766
6765
|
authority: "authority";
|
|
6766
|
+
worker: "worker";
|
|
6767
6767
|
}>>;
|
|
6768
6768
|
materializationSpec: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6769
6769
|
kind: z.ZodLiteral<"local-directory">;
|
|
@@ -6831,10 +6831,10 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
|
|
|
6831
6831
|
frameId: z.ZodString;
|
|
6832
6832
|
nodeId: z.ZodString;
|
|
6833
6833
|
nodeType: z.ZodEnum<{
|
|
6834
|
+
sequence: "sequence";
|
|
6834
6835
|
station: "station";
|
|
6835
6836
|
"delegate-agent": "delegate-agent";
|
|
6836
6837
|
"delegate-role": "delegate-role";
|
|
6837
|
-
sequence: "sequence";
|
|
6838
6838
|
parallel: "parallel";
|
|
6839
6839
|
gate: "gate";
|
|
6840
6840
|
iterate: "iterate";
|
|
@@ -6876,10 +6876,10 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
|
|
|
6876
6876
|
frameId: z.ZodString;
|
|
6877
6877
|
nodeId: z.ZodString;
|
|
6878
6878
|
nodeType: z.ZodEnum<{
|
|
6879
|
+
sequence: "sequence";
|
|
6879
6880
|
station: "station";
|
|
6880
6881
|
"delegate-agent": "delegate-agent";
|
|
6881
6882
|
"delegate-role": "delegate-role";
|
|
6882
|
-
sequence: "sequence";
|
|
6883
6883
|
parallel: "parallel";
|
|
6884
6884
|
gate: "gate";
|
|
6885
6885
|
iterate: "iterate";
|
|
@@ -7235,10 +7235,10 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
|
|
|
7235
7235
|
frameId: z.ZodString;
|
|
7236
7236
|
nodeId: z.ZodString;
|
|
7237
7237
|
nodeType: z.ZodEnum<{
|
|
7238
|
+
sequence: "sequence";
|
|
7238
7239
|
station: "station";
|
|
7239
7240
|
"delegate-agent": "delegate-agent";
|
|
7240
7241
|
"delegate-role": "delegate-role";
|
|
7241
|
-
sequence: "sequence";
|
|
7242
7242
|
parallel: "parallel";
|
|
7243
7243
|
gate: "gate";
|
|
7244
7244
|
iterate: "iterate";
|
|
@@ -7281,10 +7281,10 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
|
|
|
7281
7281
|
frameId: z.ZodString;
|
|
7282
7282
|
nodeId: z.ZodString;
|
|
7283
7283
|
nodeType: z.ZodEnum<{
|
|
7284
|
+
sequence: "sequence";
|
|
7284
7285
|
station: "station";
|
|
7285
7286
|
"delegate-agent": "delegate-agent";
|
|
7286
7287
|
"delegate-role": "delegate-role";
|
|
7287
|
-
sequence: "sequence";
|
|
7288
7288
|
parallel: "parallel";
|
|
7289
7289
|
gate: "gate";
|
|
7290
7290
|
iterate: "iterate";
|
|
@@ -7324,10 +7324,10 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
|
|
|
7324
7324
|
frameId: z.ZodString;
|
|
7325
7325
|
nodeId: z.ZodString;
|
|
7326
7326
|
nodeType: z.ZodEnum<{
|
|
7327
|
+
sequence: "sequence";
|
|
7327
7328
|
station: "station";
|
|
7328
7329
|
"delegate-agent": "delegate-agent";
|
|
7329
7330
|
"delegate-role": "delegate-role";
|
|
7330
|
-
sequence: "sequence";
|
|
7331
7331
|
parallel: "parallel";
|
|
7332
7332
|
gate: "gate";
|
|
7333
7333
|
iterate: "iterate";
|
|
@@ -7864,8 +7864,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
|
|
|
7864
7864
|
"exit-and-resume": "exit-and-resume";
|
|
7865
7865
|
}>>;
|
|
7866
7866
|
terminalAuthority: z.ZodOptional<z.ZodEnum<{
|
|
7867
|
-
worker: "worker";
|
|
7868
7867
|
authority: "authority";
|
|
7868
|
+
worker: "worker";
|
|
7869
7869
|
}>>;
|
|
7870
7870
|
materializationSpec: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7871
7871
|
kind: z.ZodLiteral<"local-directory">;
|
|
@@ -8051,8 +8051,8 @@ declare const WorkflowStorageSubjects: _$_makaio_core0.BusSubjects<_$_makaio_cor
|
|
|
8051
8051
|
"exit-and-resume": "exit-and-resume";
|
|
8052
8052
|
}>>;
|
|
8053
8053
|
terminalAuthority: z.ZodOptional<z.ZodEnum<{
|
|
8054
|
-
worker: "worker";
|
|
8055
8054
|
authority: "authority";
|
|
8055
|
+
worker: "worker";
|
|
8056
8056
|
}>>;
|
|
8057
8057
|
materializationSpec: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
8058
8058
|
kind: z.ZodLiteral<"local-directory">;
|
|
@@ -8489,7 +8489,7 @@ declare const worklogFrameEntriesDual: _$_makaio_storage_drizzle0.DualTable<"wor
|
|
|
8489
8489
|
/** Unique frame identifier within the execution. */frameId: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.IsPrimaryKey<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"frame_id", [string, ...string[]], number | undefined>>>, _$drizzle_orm0.IsPrimaryKey<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"frame_id", [string, ...string[]]>>>>; /** Execution this frame belongs to. */
|
|
8490
8490
|
executionId: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"execution_id", [string, ...string[]], number | undefined>>, _$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"execution_id", [string, ...string[]]>>>; /** Node identifier from the workflow definition. */
|
|
8491
8491
|
nodeId: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"node_id", [string, ...string[]], number | undefined>>, _$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"node_id", [string, ...string[]]>>>; /** Node type discriminant. */
|
|
8492
|
-
nodeType: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.$Type<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"node_type", [string, ...string[]], number | undefined>>, "station" | "delegate-agent" | "delegate-role" | "
|
|
8492
|
+
nodeType: _$_makaio_storage_drizzle0.DualBuilder<_$drizzle_orm0.$Type<_$drizzle_orm0.NotNull<_$drizzle_orm_sqlite_core0.SQLiteTextBuilderInitial<"node_type", [string, ...string[]], number | undefined>>, "sequence" | "station" | "delegate-agent" | "delegate-role" | "parallel" | "gate" | "iterate" | "iterate-chain" | "loop">, _$drizzle_orm0.$Type<_$drizzle_orm0.NotNull<_$drizzle_orm_pg_core0.PgTextBuilderInitial<"node_type", [string, ...string[]]>>, "sequence" | "station" | "delegate-agent" | "delegate-role" | "parallel" | "gate" | "iterate" | "iterate-chain" | "loop">>;
|
|
8493
8493
|
/**
|
|
8494
8494
|
* Ordered path of frame IDs from the root frame to this frame (inclusive).
|
|
8495
8495
|
* Stored as a JSON array for tree correlation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e}from"./framework-packages-
|
|
1
|
+
import{u as e}from"./framework-packages-D2fycy02.mjs";function t(){let t=new Map;return{filter:e=>!!(e.transitionRules?.rules?.length||e.transitionActions?.actions),async processActivated(i,a,o){let s=o.getService(e);if(!s)throw Error(`TransitionContributionProcessor: TransitionPipelineService is not available — ensure '${e.name}' is started before extensions with transitionRules or transitionActions.`);let c=a.transitionRules?.rules??[],l=a.transitionActions?.actions,u=c.length>0,d=l!==void 0;u&&n(i,c),d&&r(i,l);let f=!1,p=!1;try{u&&(s.ruleRegistry.register(i,c),f=!0),d&&(s.actionRegistry.register(i,l),p=!0)}catch(e){throw f&&s.ruleRegistry.deregister(i),p&&s.actionRegistry.deregister(i),e}t.set(i,()=>{u&&s.ruleRegistry.deregister(i),d&&s.actionRegistry.deregister(i)})},async processStopped(e){let n=t.get(e);if(n){try{n()}catch(t){console.error(`[TransitionContributionProcessor] Deregister error for "${e}":`,t)}t.delete(e)}}}}function n(e,t){let n=`${e}.`;for(let e of t)if(!e.id.startsWith(n))throw Error(`TransitionContributionProcessor: rule '${e.id}' must be namespaced by extension '${n}'`)}function r(e,t){let n=`${e}.`;for(let e of Object.keys(t))if(!e.startsWith(n))throw Error(`TransitionContributionProcessor: action type '${e}' must be namespaced by extension '${n}'`)}export{t};
|