@dudko.dev/agent-web 0.0.43 → 0.0.44

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.
Files changed (34) hide show
  1. package/README.md +55 -2
  2. package/dist/agent-web.js +158 -158
  3. package/dist/agent-web.js.map +1 -1
  4. package/dist/{chunk-DAREMCXF.js → chunk-236RCVAZ.js} +40 -8
  5. package/dist/chunk-236RCVAZ.js.map +1 -0
  6. package/dist/{chunk-2MLHZ6LQ.js → chunk-Y4MIIBPB.js} +2 -2
  7. package/dist/{chunk-ZSZSSJS4.js → chunk-Y6CD3WOK.js} +176 -10
  8. package/dist/chunk-Y6CD3WOK.js.map +1 -0
  9. package/dist/{chunk-YPCHD6DV.js → chunk-YGWIOO27.js} +31 -12
  10. package/dist/chunk-YGWIOO27.js.map +1 -0
  11. package/dist/index.cjs +1052 -93
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +1724 -1464
  14. package/dist/index.d.ts +1724 -1464
  15. package/dist/index.js +806 -74
  16. package/dist/index.js.map +1 -1
  17. package/dist/mcp.cjs +136 -5
  18. package/dist/mcp.cjs.map +1 -1
  19. package/dist/mcp.d.cts +5 -2
  20. package/dist/mcp.d.ts +5 -2
  21. package/dist/mcp.js +19 -8
  22. package/dist/mcp.js.map +1 -1
  23. package/dist/{sandbox-3VRX47UY.js → sandbox-7CGSIIIZ.js} +4 -4
  24. package/dist/sandbox-worker.cjs +30 -11
  25. package/dist/sandbox-worker.cjs.map +1 -1
  26. package/dist/sandbox-worker.js +1 -1
  27. package/dist/{elicitation-DS-84_bF.d.cts → vault-Mar2CY0J.d.cts} +526 -526
  28. package/dist/{elicitation-DS-84_bF.d.ts → vault-Mar2CY0J.d.ts} +526 -526
  29. package/package.json +1 -1
  30. package/dist/chunk-DAREMCXF.js.map +0 -1
  31. package/dist/chunk-YPCHD6DV.js.map +0 -1
  32. package/dist/chunk-ZSZSSJS4.js.map +0 -1
  33. /package/dist/{chunk-2MLHZ6LQ.js.map → chunk-Y4MIIBPB.js.map} +0 -0
  34. /package/dist/{sandbox-3VRX47UY.js.map → sandbox-7CGSIIIZ.js.map} +0 -0
package/dist/mcp.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { OAuthClientProvider, FetchLike, StreamableHTTPReconnectionOptions, OAuthClientMetadata, OAuthClientInformationMixed, OAuthTokens, OAuthDiscoveryState } from '@modelcontextprotocol/client';
2
2
  export { UnauthorizedError } from '@modelcontextprotocol/client';
3
3
  import { ToolSet } from 'ai';
4
- import { O as McpElicitationHandler, P as McpElicitationOptions, D as McpAppResource, E as McpAppVisibility, Q as McpAppDownloadResource, h as McpAppToolResult } from './elicitation-DS-84_bF.cjs';
4
+ import { O as McpElicitationHandler, P as McpElicitationOptions, D as McpAppResource, E as McpAppVisibility, Q as McpAppDownloadResource, c as McpAppToolResult } from './vault-Mar2CY0J.cjs';
5
5
  import { McpSkillsSetting, VaultOptions } from './index.cjs';
6
- export { i as MCP_APPS_EXTENSION, R as MCP_APP_DEFAULT_VISIBILITY, T as MCP_APP_MAX_DOMAINS, U as MCP_APP_MAX_DOWNLOAD_BYTES, j as MCP_APP_MAX_HTML_CHARS, k as MCP_APP_MAX_RESULT_CHARS, l as MCP_APP_MIME_TYPE, W as MCP_ELICITATION_MAX_PER_RUN, X as MCP_ELICITATION_MAX_PER_TOOL_CALL, Y as MCP_ELICITATION_TIMEOUT_MS, B as McpAppCsp, C as McpAppPermissions, Z as McpAppResourceError, _ as McpAppToolMeta, $ as McpAppsMode, a0 as McpElicitationContent, a1 as McpElicitationContext, F as McpElicitationFieldSchema, g as McpElicitationReason, a2 as McpElicitationRequest, a3 as McpElicitationResult, f as McpElicitationSchema, a4 as isMcpAppMimeType, a5 as isMcpAppUri, a6 as mcpAppCspOf, a7 as mcpAppDownloadOf, J as mcpAppOrigin, a8 as mcpAppPermissionsOf, a9 as mcpAppResourceOf, aa as mcpAppToolMeta, ab as mcpAppToolResultOf, ac as mcpAppsModeOf, ad as normalizeMcpElicitationSchema, ae as validateMcpElicitationContent } from './elicitation-DS-84_bF.cjs';
6
+ export { i as MCP_APPS_EXTENSION, R as MCP_APP_DEFAULT_VISIBILITY, T as MCP_APP_MAX_DOMAINS, U as MCP_APP_MAX_DOWNLOAD_BYTES, j as MCP_APP_MAX_HTML_CHARS, k as MCP_APP_MAX_RESULT_CHARS, l as MCP_APP_MIME_TYPE, W as MCP_ELICITATION_MAX_PER_RUN, X as MCP_ELICITATION_MAX_PER_TOOL_CALL, Y as MCP_ELICITATION_TIMEOUT_MS, B as McpAppCsp, C as McpAppPermissions, Z as McpAppResourceError, _ as McpAppToolMeta, $ as McpAppsMode, a0 as McpElicitationContent, a1 as McpElicitationContext, F as McpElicitationFieldSchema, b as McpElicitationReason, a2 as McpElicitationRequest, a3 as McpElicitationResult, a as McpElicitationSchema, a4 as isMcpAppMimeType, a5 as isMcpAppUri, a6 as mcpAppCspOf, a7 as mcpAppDownloadOf, J as mcpAppOrigin, a8 as mcpAppPermissionsOf, a9 as mcpAppResourceOf, aa as mcpAppToolMeta, ab as mcpAppToolResultOf, ac as mcpAppsModeOf, ad as normalizeMcpElicitationSchema, ae as validateMcpElicitationContent } from './vault-Mar2CY0J.cjs';
7
7
 
8
8
  /**
9
9
  * What the MCP connectors of the two agent packages share: how a server's `instructions` reach a
@@ -390,7 +390,10 @@ interface McpOAuthStorage {
390
390
  * `secrets/vault.ts` — this protects tokens at rest, not against active XSS.
391
391
  */
392
392
  declare class VaultOAuthStorage implements McpOAuthStorage {
393
+ /** The database the vault lives in, and the name its change notices go out under. */
394
+ readonly dbName: string;
393
395
  private readonly vault;
396
+ private readonly tab;
394
397
  constructor(opts?: VaultOptions);
395
398
  get(key: string): Promise<string | undefined>;
396
399
  set(key: string, value: string): Promise<void>;
package/dist/mcp.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { OAuthClientProvider, FetchLike, StreamableHTTPReconnectionOptions, OAuthClientMetadata, OAuthClientInformationMixed, OAuthTokens, OAuthDiscoveryState } from '@modelcontextprotocol/client';
2
2
  export { UnauthorizedError } from '@modelcontextprotocol/client';
3
3
  import { ToolSet } from 'ai';
4
- import { O as McpElicitationHandler, P as McpElicitationOptions, D as McpAppResource, E as McpAppVisibility, Q as McpAppDownloadResource, h as McpAppToolResult } from './elicitation-DS-84_bF.js';
4
+ import { O as McpElicitationHandler, P as McpElicitationOptions, D as McpAppResource, E as McpAppVisibility, Q as McpAppDownloadResource, c as McpAppToolResult } from './vault-Mar2CY0J.js';
5
5
  import { McpSkillsSetting, VaultOptions } from './index.js';
6
- export { i as MCP_APPS_EXTENSION, R as MCP_APP_DEFAULT_VISIBILITY, T as MCP_APP_MAX_DOMAINS, U as MCP_APP_MAX_DOWNLOAD_BYTES, j as MCP_APP_MAX_HTML_CHARS, k as MCP_APP_MAX_RESULT_CHARS, l as MCP_APP_MIME_TYPE, W as MCP_ELICITATION_MAX_PER_RUN, X as MCP_ELICITATION_MAX_PER_TOOL_CALL, Y as MCP_ELICITATION_TIMEOUT_MS, B as McpAppCsp, C as McpAppPermissions, Z as McpAppResourceError, _ as McpAppToolMeta, $ as McpAppsMode, a0 as McpElicitationContent, a1 as McpElicitationContext, F as McpElicitationFieldSchema, g as McpElicitationReason, a2 as McpElicitationRequest, a3 as McpElicitationResult, f as McpElicitationSchema, a4 as isMcpAppMimeType, a5 as isMcpAppUri, a6 as mcpAppCspOf, a7 as mcpAppDownloadOf, J as mcpAppOrigin, a8 as mcpAppPermissionsOf, a9 as mcpAppResourceOf, aa as mcpAppToolMeta, ab as mcpAppToolResultOf, ac as mcpAppsModeOf, ad as normalizeMcpElicitationSchema, ae as validateMcpElicitationContent } from './elicitation-DS-84_bF.js';
6
+ export { i as MCP_APPS_EXTENSION, R as MCP_APP_DEFAULT_VISIBILITY, T as MCP_APP_MAX_DOMAINS, U as MCP_APP_MAX_DOWNLOAD_BYTES, j as MCP_APP_MAX_HTML_CHARS, k as MCP_APP_MAX_RESULT_CHARS, l as MCP_APP_MIME_TYPE, W as MCP_ELICITATION_MAX_PER_RUN, X as MCP_ELICITATION_MAX_PER_TOOL_CALL, Y as MCP_ELICITATION_TIMEOUT_MS, B as McpAppCsp, C as McpAppPermissions, Z as McpAppResourceError, _ as McpAppToolMeta, $ as McpAppsMode, a0 as McpElicitationContent, a1 as McpElicitationContext, F as McpElicitationFieldSchema, b as McpElicitationReason, a2 as McpElicitationRequest, a3 as McpElicitationResult, a as McpElicitationSchema, a4 as isMcpAppMimeType, a5 as isMcpAppUri, a6 as mcpAppCspOf, a7 as mcpAppDownloadOf, J as mcpAppOrigin, a8 as mcpAppPermissionsOf, a9 as mcpAppResourceOf, aa as mcpAppToolMeta, ab as mcpAppToolResultOf, ac as mcpAppsModeOf, ad as normalizeMcpElicitationSchema, ae as validateMcpElicitationContent } from './vault-Mar2CY0J.js';
7
7
 
8
8
  /**
9
9
  * What the MCP connectors of the two agent packages share: how a server's `instructions` reach a
@@ -390,7 +390,10 @@ interface McpOAuthStorage {
390
390
  * `secrets/vault.ts` — this protects tokens at rest, not against active XSS.
391
391
  */
392
392
  declare class VaultOAuthStorage implements McpOAuthStorage {
393
+ /** The database the vault lives in, and the name its change notices go out under. */
394
+ readonly dbName: string;
393
395
  private readonly vault;
396
+ private readonly tab;
394
397
  constructor(opts?: VaultOptions);
395
398
  get(key: string): Promise<string | undefined>;
396
399
  set(key: string, value: string): Promise<void>;
package/dist/mcp.js CHANGED
@@ -35,13 +35,15 @@ import {
35
35
  outputSchemaNote,
36
36
  renderMcpInstructions,
37
37
  withStructuredContent
38
- } from "./chunk-2MLHZ6LQ.js";
38
+ } from "./chunk-Y4MIIBPB.js";
39
39
  import {
40
40
  MCP_SKILLS_EXTENSION,
41
41
  createMcpSkillCatalog,
42
+ currentTab,
42
43
  markMcpSkills,
43
- mcpSkillsSettingOf
44
- } from "./chunk-ZSZSSJS4.js";
44
+ mcpSkillsSettingOf,
45
+ postStorageChangeFrom
46
+ } from "./chunk-Y6CD3WOK.js";
45
47
 
46
48
  // src/mcp/http.ts
47
49
  import {
@@ -970,18 +972,27 @@ import {
970
972
  auth
971
973
  } from "@modelcontextprotocol/client";
972
974
  var VaultOAuthStorage = class {
975
+ /** The database the vault lives in, and the name its change notices go out under. */
976
+ dbName;
973
977
  vault;
978
+ tab;
974
979
  constructor(opts = {}) {
975
- this.vault = new IndexedDBVault(opts);
980
+ this.dbName = opts.dbName ?? "agent-web";
981
+ this.vault = new IndexedDBVault({ ...opts, dbName: this.dbName });
982
+ this.tab = currentTab();
976
983
  }
977
984
  get(key) {
978
985
  return this.vault.getSecret(key);
979
986
  }
980
- set(key, value) {
981
- return this.vault.setSecret(key, value);
987
+ // An `oauth` notice to the other tabs once written: no key (a record's id holds the server's
988
+ // URL), never a token.
989
+ async set(key, value) {
990
+ await this.vault.setSecret(key, value);
991
+ postStorageChangeFrom(this.tab, this.dbName, { kind: "oauth", op: "put" });
982
992
  }
983
- delete(key) {
984
- return this.vault.deleteSecret(key);
993
+ async delete(key) {
994
+ await this.vault.deleteSecret(key);
995
+ postStorageChangeFrom(this.tab, this.dbName, { kind: "oauth", op: "delete" });
985
996
  }
986
997
  };
987
998
  var MemoryOAuthStorage = class {