@ethisyscore/extension-runtime 1.123.0 → 1.124.0

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.
@@ -1,4 +1,4 @@
1
- import { d as BridgePushThemeEnvelope, c as BridgePushLocaleEnvelope, b as BridgePushDensityEnvelope, a as BridgePushA11yEnvelope, B as BridgeNavPushEnvelope, e as BridgeSessionTokenPushEnvelope } from './bridge-envelopes-DAuew-fU.cjs';
1
+ import { d as BridgePushThemeEnvelope, c as BridgePushLocaleEnvelope, b as BridgePushDensityEnvelope, a as BridgePushA11yEnvelope, B as BridgeNavPushEnvelope, e as BridgeSessionTokenPushEnvelope } from './bridge-envelopes-M5a42rAy.cjs';
2
2
 
3
3
  /**
4
4
  * Plugin-side bridge client for the host ↔ plugin platform contract
@@ -1,4 +1,4 @@
1
- import { d as BridgePushThemeEnvelope, c as BridgePushLocaleEnvelope, b as BridgePushDensityEnvelope, a as BridgePushA11yEnvelope, B as BridgeNavPushEnvelope, e as BridgeSessionTokenPushEnvelope } from './bridge-envelopes-DAuew-fU.js';
1
+ import { d as BridgePushThemeEnvelope, c as BridgePushLocaleEnvelope, b as BridgePushDensityEnvelope, a as BridgePushA11yEnvelope, B as BridgeNavPushEnvelope, e as BridgeSessionTokenPushEnvelope } from './bridge-envelopes-M5a42rAy.js';
2
2
 
3
3
  /**
4
4
  * Plugin-side bridge client for the host ↔ plugin platform contract
@@ -59,8 +59,31 @@ interface McpTransport {
59
59
  * DEFAULT provider rather than dead metadata, which is what makes every
60
60
  * conversion a no-op until an operator chooses something.
61
61
  * @param args Canonical field values, keyed by canonical name.
62
+ * @param fallbackArgs Arguments for the FALLBACK rung only, used verbatim in
63
+ * place of `args` when `fallbackToolName` answers. Omit it and the fallback
64
+ * receives `args`, which is what every call did before this parameter
65
+ * existed.
66
+ *
67
+ * This is the browser twin of `ModuleFallback`'s second argument on the
68
+ * backend: `InvokeOrFallbackAsync(catalogue, key, new ModuleFallback(tool,
69
+ * new { employeeIds = ordered }), canonicalArgs, ct)`. It exists because an
70
+ * in-house fallback tool does not have to take canonical field names -
71
+ * `hr:get-employee-absences` wants `employeeIds` where the canonical
72
+ * operation says `personIds`, and `finance:get-generated-reports` wants
73
+ * `relatedEntityId`/`type` where the operation says `projectId`/`reportType`.
74
+ * Without this, a converted surface sends canonical names to a tool that
75
+ * declares none of them, and since no organisation has chosen a provider
76
+ * the fallback rung is the production path for every call.
77
+ *
78
+ * It carries no authority and cannot change which tool runs: the tool NAME
79
+ * is still `fallbackToolName`, still checked against the calling
80
+ * extension's installed manifest by the host before the rung runs.
81
+ *
82
+ * It trails `signal` so that a transport written against the earlier
83
+ * signature stays assignable and a host that predates it simply drops the
84
+ * value, leaving the fallback with the canonical arguments it had before.
62
85
  */
63
- invokeOperation?<TReq, TRes>(moduleKey: string, operationKey: string, fallbackToolName: string, args: TReq, signal?: AbortSignal): Promise<TRes>;
86
+ invokeOperation?<TReq, TRes>(moduleKey: string, operationKey: string, fallbackToolName: string, args: TReq, signal?: AbortSignal, fallbackArgs?: unknown): Promise<TRes>;
64
87
  /**
65
88
  * Upload a binary document to CORE storage via the host shell and resolve
66
89
  * the resulting {@link UploadDocumentResult} (a `StoredDocumentId` plus the
@@ -59,8 +59,31 @@ interface McpTransport {
59
59
  * DEFAULT provider rather than dead metadata, which is what makes every
60
60
  * conversion a no-op until an operator chooses something.
61
61
  * @param args Canonical field values, keyed by canonical name.
62
+ * @param fallbackArgs Arguments for the FALLBACK rung only, used verbatim in
63
+ * place of `args` when `fallbackToolName` answers. Omit it and the fallback
64
+ * receives `args`, which is what every call did before this parameter
65
+ * existed.
66
+ *
67
+ * This is the browser twin of `ModuleFallback`'s second argument on the
68
+ * backend: `InvokeOrFallbackAsync(catalogue, key, new ModuleFallback(tool,
69
+ * new { employeeIds = ordered }), canonicalArgs, ct)`. It exists because an
70
+ * in-house fallback tool does not have to take canonical field names -
71
+ * `hr:get-employee-absences` wants `employeeIds` where the canonical
72
+ * operation says `personIds`, and `finance:get-generated-reports` wants
73
+ * `relatedEntityId`/`type` where the operation says `projectId`/`reportType`.
74
+ * Without this, a converted surface sends canonical names to a tool that
75
+ * declares none of them, and since no organisation has chosen a provider
76
+ * the fallback rung is the production path for every call.
77
+ *
78
+ * It carries no authority and cannot change which tool runs: the tool NAME
79
+ * is still `fallbackToolName`, still checked against the calling
80
+ * extension's installed manifest by the host before the rung runs.
81
+ *
82
+ * It trails `signal` so that a transport written against the earlier
83
+ * signature stays assignable and a host that predates it simply drops the
84
+ * value, leaving the fallback with the canonical arguments it had before.
62
85
  */
63
- invokeOperation?<TReq, TRes>(moduleKey: string, operationKey: string, fallbackToolName: string, args: TReq, signal?: AbortSignal): Promise<TRes>;
86
+ invokeOperation?<TReq, TRes>(moduleKey: string, operationKey: string, fallbackToolName: string, args: TReq, signal?: AbortSignal, fallbackArgs?: unknown): Promise<TRes>;
64
87
  /**
65
88
  * Upload a binary document to CORE storage via the host shell and resolve
66
89
  * the resulting {@link UploadDocumentResult} (a `StoredDocumentId` plus the
@@ -810,6 +810,7 @@ var WorkerRemoteDomTransport = class {
810
810
  operationKey: message.operationKey,
811
811
  fallbackToolName: message.fallbackToolName,
812
812
  args: message.args,
813
+ fallbackArgs: message.fallbackArgs,
813
814
  capabilityToken: token,
814
815
  signal: this.requestSignal(message.id)
815
816
  });
@@ -938,7 +939,11 @@ var WorkerRemoteDomTransport = class {
938
939
  var IFRAME_BRIDGE_PROTOCOL = "ethisys.iframe.bridge.v1";
939
940
  var InboundEnvelope = zod.z.discriminatedUnion("type", [
940
941
  zod.z.object({ type: zod.z.literal("ethisys:mcp:invokeTool"), id: zod.z.string().min(1), name: zod.z.string().min(1), args: zod.z.unknown(), nonce: zod.z.string() }),
941
- zod.z.object({ type: zod.z.literal("ethisys:mcp:invokeOperation"), id: zod.z.string().min(1), moduleKey: zod.z.string().min(1), operationKey: zod.z.string().min(1), fallbackToolName: zod.z.string().min(1), args: zod.z.unknown(), nonce: zod.z.string() }),
942
+ // `fallbackArgs` is declared, not merely tolerated: a zod object STRIPS keys it does not
943
+ // declare, so leaving it out would drop the field silently and the fallback tool would keep
944
+ // receiving canonical names it does not declare - the exact defect this field closes, made
945
+ // invisible. Optional, so a plugin built against an earlier SDK still validates.
946
+ zod.z.object({ type: zod.z.literal("ethisys:mcp:invokeOperation"), id: zod.z.string().min(1), moduleKey: zod.z.string().min(1), operationKey: zod.z.string().min(1), fallbackToolName: zod.z.string().min(1), args: zod.z.unknown(), fallbackArgs: zod.z.unknown().optional(), nonce: zod.z.string() }),
942
947
  zod.z.object({ type: zod.z.literal("ethisys:mcp:getResource"), id: zod.z.string().min(1), uri: zod.z.string().min(1), nonce: zod.z.string() }),
943
948
  zod.z.object({ type: zod.z.literal("ethisys:event"), name: zod.z.string().min(1), payload: zod.z.unknown(), nonce: zod.z.string() })
944
949
  ]);
@@ -1142,6 +1147,7 @@ var IframeBridgeTransport = class {
1142
1147
  operationKey: message.operationKey,
1143
1148
  fallbackToolName: message.fallbackToolName,
1144
1149
  args: message.args,
1150
+ fallbackArgs: message.fallbackArgs,
1145
1151
  capabilityToken: token,
1146
1152
  signal: this.abortController.signal
1147
1153
  });