@sentry/junior 0.115.0 → 0.116.1

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 (111) hide show
  1. package/dist/{agent-hooks-4EUUXP2F.js → agent-hooks-GUAAS3XH.js} +9 -9
  2. package/dist/api/conversations/detail.d.ts +18 -0
  3. package/dist/api/conversations/event-page.d.ts +1 -1
  4. package/dist/api/conversations/events.d.ts +1 -1
  5. package/dist/api/people/profile.d.ts +2 -2
  6. package/dist/api/people/shared.d.ts +1 -1
  7. package/dist/api/personal-tokens/create.d.ts +11 -0
  8. package/dist/api/personal-tokens/list.d.ts +12 -0
  9. package/dist/api/personal-tokens/revoke.d.ts +5 -0
  10. package/dist/api/personal-tokens/routes.d.ts +4 -0
  11. package/dist/api/plugins.d.ts +0 -1
  12. package/dist/api/route.d.ts +1 -1
  13. package/dist/api/schema/conversation.d.ts +18 -0
  14. package/dist/api/schema/person.d.ts +3 -3
  15. package/dist/api/schema/personal-token.d.ts +38 -0
  16. package/dist/api/schema.d.ts +2 -0
  17. package/dist/api/schema.js +15 -3
  18. package/dist/api.d.ts +1 -0
  19. package/dist/api.js +179 -39
  20. package/dist/app.js +1035 -853
  21. package/dist/{catalog-runtime-Y32UEQLB.js → catalog-runtime-WMPC4J4U.js} +5 -5
  22. package/dist/chat/agent/request.d.ts +1 -0
  23. package/dist/chat/agent/resume.d.ts +1 -0
  24. package/dist/chat/agent/sandbox.d.ts +1 -0
  25. package/dist/chat/agent/tools.d.ts +1 -0
  26. package/dist/chat/agent-dispatch/context.d.ts +2 -0
  27. package/dist/chat/agent-dispatch/heartbeat.d.ts +11 -5
  28. package/dist/chat/agent-dispatch/signing.d.ts +14 -5
  29. package/dist/chat/agent-dispatch/store.d.ts +36 -15
  30. package/dist/chat/agent-dispatch/types.d.ts +23 -10
  31. package/dist/chat/agent-dispatch/work.d.ts +58 -0
  32. package/dist/chat/app/factory.d.ts +12 -3
  33. package/dist/chat/conversations/history.d.ts +285 -290
  34. package/dist/chat/conversations/projection.d.ts +2 -2
  35. package/dist/chat/mcp/tool-manager.d.ts +2 -1
  36. package/dist/chat/pi/conversation-events.d.ts +6 -2
  37. package/dist/chat/plugins/annotations.d.ts +8 -0
  38. package/dist/chat/plugins/registry.d.ts +0 -3
  39. package/dist/chat/plugins/types.d.ts +0 -2
  40. package/dist/chat/runtime/agent-continue-runner.d.ts +4 -0
  41. package/dist/chat/runtime/reply-executor.d.ts +6 -1
  42. package/dist/chat/runtime/slack-resume.d.ts +5 -1
  43. package/dist/chat/runtime/turn-input.d.ts +3 -0
  44. package/dist/chat/sandbox/sandbox.d.ts +2 -1
  45. package/dist/chat/sandbox/session.d.ts +2 -11
  46. package/dist/chat/sandbox/workspace.d.ts +10 -2
  47. package/dist/chat/services/turn-session-record.d.ts +14 -1
  48. package/dist/chat/slack/dispatch-turn.d.ts +25 -0
  49. package/dist/chat/state/turn-session.d.ts +11 -0
  50. package/dist/chat/tool-support/text-range-result.d.ts +3 -0
  51. package/dist/chat/tool-support/zod-tool.d.ts +1 -0
  52. package/dist/chat/tools/definition.d.ts +3 -10
  53. package/dist/chat/tools/query-conversation-events.d.ts +68 -0
  54. package/dist/chat/tools/sandbox/file-utils.d.ts +8 -1
  55. package/dist/chat/tools/sandbox/find-files.d.ts +2 -1
  56. package/dist/chat/tools/sandbox/grep.d.ts +2 -1
  57. package/dist/{chunk-6V762AB4.js → chunk-2YYPXQNQ.js} +1 -1
  58. package/dist/{chunk-MIAKQNYX.js → chunk-6ZK6FZIV.js} +1 -1
  59. package/dist/{chunk-67CVNDJ7.js → chunk-7CSVG54J.js} +1 -1
  60. package/dist/{chunk-HWCQRGLL.js → chunk-BFYVIOTS.js} +105 -37
  61. package/dist/{chunk-LYA2AB5G.js → chunk-CGXLCMWI.js} +8 -52
  62. package/dist/{chunk-SYJT7AKB.js → chunk-CY7NXM32.js} +1 -1
  63. package/dist/{chunk-2QG4MZQ7.js → chunk-DLLW5ITL.js} +2 -2
  64. package/dist/{chunk-NVUQSFWX.js → chunk-F3SWGSPG.js} +3 -15
  65. package/dist/{chunk-CWEZEPD4.js → chunk-FAEALXEH.js} +68 -2
  66. package/dist/{chunk-43RYMWJ2.js → chunk-GDAXWEIJ.js} +809 -213
  67. package/dist/{chunk-AGLQYELI.js → chunk-H35BDAUS.js} +170 -170
  68. package/dist/{chunk-YCLO7D7M.js → chunk-JPKGW6L6.js} +77 -26
  69. package/dist/{chunk-G5SX4UPR.js → chunk-KNCELO2M.js} +2 -2
  70. package/dist/{chunk-FHC4JUSF.js → chunk-N3C4XCRE.js} +1 -2
  71. package/dist/{chunk-6FKLPVF3.js → chunk-OY2PQQ4P.js} +1 -1
  72. package/dist/{chunk-6OPTF4BQ.js → chunk-PE44LDDQ.js} +0 -1
  73. package/dist/{chunk-JQFJO5WH.js → chunk-RXRQJF7Y.js} +74 -17
  74. package/dist/{chunk-CEYOL62C.js → chunk-RYFAVWP3.js} +120 -20
  75. package/dist/{chunk-G36V2YGB.js → chunk-TC4ZEM2D.js} +33 -1
  76. package/dist/{chunk-PVZHG2XZ.js → chunk-VBMMMVVQ.js} +112 -35
  77. package/dist/{chunk-SG5WAA7H.js → chunk-WKU7TY22.js} +0 -3
  78. package/dist/{chunk-TVE25LPW.js → chunk-WLT72MRP.js} +1 -1
  79. package/dist/{chunk-EW5MLKT5.js → chunk-XA3VLFPK.js} +1 -55
  80. package/dist/{chunk-RAVKCKXA.js → chunk-ZYHLNTC2.js} +20 -5
  81. package/dist/cli/chat.js +23 -23
  82. package/dist/cli/check.js +6 -6
  83. package/dist/cli/plugins.js +13 -13
  84. package/dist/cli/snapshot-warmup.js +8 -8
  85. package/dist/cli/upgrade.js +7 -7
  86. package/dist/db/schema/api-tokens.d.ts +160 -0
  87. package/dist/db/schema/conversation-annotations.d.ts +142 -0
  88. package/dist/db/schema.d.ts +305 -1
  89. package/dist/{db-KBSJHAZU.js → db-FH4R5ZQ4.js} +6 -6
  90. package/dist/handlers/agent-dispatch.d.ts +7 -3
  91. package/dist/instrumentation.js +2 -2
  92. package/dist/nitro.js +5 -5
  93. package/dist/{oauth-callback-server-EYRMJTCS.js → oauth-callback-server-C2SSJ3FQ.js} +18 -18
  94. package/dist/personal-tokens/store.d.ts +27 -0
  95. package/dist/{plugins-PZMDS7AT.js → plugins-IUJA4VBU.js} +1 -1
  96. package/dist/reporting-schema.d.ts +0 -2
  97. package/dist/{runner-RQGZ5Z2S.js → runner-NAALFIXM.js} +12 -12
  98. package/dist/{skills-JJQIE3BT.js → skills-UN2JXYYF.js} +6 -6
  99. package/dist/{validation-MZ47PZP5.js → validation-EEF4ROHR.js} +6 -6
  100. package/dist/version.js +1 -1
  101. package/migrations/0008_sticky_rage.sql +14 -0
  102. package/migrations/0009_slippery_harrier.sql +12 -0
  103. package/migrations/0010_native_conversation_history.sql +142 -0
  104. package/migrations/meta/0008_snapshot.json +1076 -0
  105. package/migrations/meta/0009_snapshot.json +1146 -0
  106. package/migrations/meta/0010_snapshot.json +1190 -0
  107. package/migrations/meta/_journal.json +22 -1
  108. package/package.json +5 -6
  109. package/dist/chat/agent-dispatch/runner.d.ts +0 -13
  110. package/dist/chat/capabilities/catalog.d.ts +0 -16
  111. package/dist/{chunk-KNFROR7R.js → chunk-5I6ORJUY.js} +1 -1
@@ -1,25 +1,26 @@
1
1
  import {
2
2
  SANDBOX_WORKSPACE_ROOT,
3
3
  getStateAdapter
4
- } from "./chunk-67CVNDJ7.js";
4
+ } from "./chunk-7CSVG54J.js";
5
5
  import {
6
6
  sleep
7
7
  } from "./chunk-4ZNGQH7C.js";
8
8
  import {
9
9
  toOptionalTrimmed
10
- } from "./chunk-SYJT7AKB.js";
10
+ } from "./chunk-CY7NXM32.js";
11
11
  import {
12
12
  pluginCatalogRuntime
13
- } from "./chunk-6FKLPVF3.js";
13
+ } from "./chunk-OY2PQQ4P.js";
14
14
  import {
15
15
  setSpanAttributes,
16
16
  setSpanStatus,
17
17
  withSpan
18
- } from "./chunk-NVUQSFWX.js";
18
+ } from "./chunk-F3SWGSPG.js";
19
19
 
20
20
  // src/chat/sandbox/runtime-dependencies.ts
21
21
  var GLOBAL_RUNTIME_DEPENDENCIES = [
22
- { type: "system", package: "docker" }
22
+ { type: "system", package: "docker" },
23
+ { type: "system", package: "ripgrep" }
23
24
  ];
24
25
 
25
26
  // src/chat/sandbox/runtime-dependency-snapshots.ts
@@ -344,6 +345,29 @@ function throwSandboxOperationError(action, error, includeMissingPath = false) {
344
345
  }
345
346
 
346
347
  // src/chat/sandbox/workspace.ts
348
+ function bindSandboxFileSystem(fs, signal) {
349
+ if (!signal) {
350
+ return fs;
351
+ }
352
+ return {
353
+ readFile(filePath, options) {
354
+ signal.throwIfAborted();
355
+ return fs.readFile(filePath, { ...options, signal });
356
+ },
357
+ writeFile(filePath, content, options) {
358
+ signal.throwIfAborted();
359
+ return fs.writeFile(filePath, content, { ...options, signal });
360
+ },
361
+ readdir(filePath) {
362
+ signal.throwIfAborted();
363
+ return fs.readdir(filePath, { signal });
364
+ },
365
+ stat(filePath) {
366
+ signal.throwIfAborted();
367
+ return fs.stat(filePath, { signal });
368
+ }
369
+ };
370
+ }
347
371
  function createSandboxSession(sandbox, options) {
348
372
  const session = sandbox.currentSession();
349
373
  const fileSystem = new FileSystem(session);
@@ -362,8 +386,8 @@ function createSandboxSession(sandbox, options) {
362
386
  writeFile: async (filePath, content, writeOptions) => await run(
363
387
  async () => await fileSystem.writeFile(filePath, content, writeOptions)
364
388
  ),
365
- readdir: async (filePath) => await run(async () => await fileSystem.readdir(filePath)),
366
- stat: async (filePath) => await run(async () => await fileSystem.stat(filePath))
389
+ readdir: async (filePath, readOptions) => await run(async () => await fileSystem.readdir(filePath, readOptions)),
390
+ stat: async (filePath, statOptions) => await run(async () => await fileSystem.stat(filePath, statOptions))
367
391
  };
368
392
  return {
369
393
  sandboxId: sandbox.name,
@@ -424,11 +448,14 @@ function getSandboxResources() {
424
448
  // src/chat/sandbox/runtime-dependency-snapshots.ts
425
449
  var SNAPSHOT_CACHE_PREFIX = "junior:sandbox_snapshot_profile";
426
450
  var SNAPSHOT_LOCK_PREFIX = "junior:sandbox_snapshot_lock";
427
- var SNAPSHOT_PROFILE_VERSION = 1;
451
+ var SNAPSHOT_PROFILE_VERSION = 2;
428
452
  var SNAPSHOT_CACHE_TTL_MS = 30 * 24 * 60 * 60 * 1e3;
429
453
  var SNAPSHOT_BUILD_LOCK_TTL_MS = 10 * 60 * 1e3;
430
454
  var SNAPSHOT_WAIT_FOR_LOCK_MS = SNAPSHOT_BUILD_LOCK_TTL_MS + 30 * 1e3;
431
455
  var DEFAULT_FLOATING_DEP_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1e3;
456
+ var RIPGREP_VERSION = "15.1.0";
457
+ var RIPGREP_ARCHIVE_SHA256 = "1c9297be4a084eea7ecaedf93eb03d058d6faae29bbc57ecdaf5063921491599";
458
+ var RIPGREP_ARCHIVE_URL = `https://github.com/BurntSushi/ripgrep/releases/download/${RIPGREP_VERSION}/ripgrep-${RIPGREP_VERSION}-x86_64-unknown-linux-musl.tar.gz`;
432
459
  function profileCacheKey(profileHash) {
433
460
  return `${SNAPSHOT_CACHE_PREFIX}:${profileHash}`;
434
461
  }
@@ -606,6 +633,75 @@ function runtimeDependencyFilePath(url, sha256) {
606
633
  const sanitizedBasename = urlBasename.replace(/[^a-zA-Z0-9._-]/g, "_");
607
634
  return `/tmp/junior-runtime-${sha256.slice(0, 12)}-${sanitizedBasename}`;
608
635
  }
636
+ async function downloadVerifiedRuntimeDependency(sandbox, url, sha256) {
637
+ const filePath = runtimeDependencyFilePath(url, sha256);
638
+ await runOrThrow(
639
+ sandbox,
640
+ {
641
+ cmd: "curl",
642
+ args: ["-fsSL", url, "-o", filePath]
643
+ },
644
+ `curl download ${url}`
645
+ );
646
+ const checksumResult = await runNonInteractiveCommand(sandbox, {
647
+ cmd: "sha256sum",
648
+ args: [filePath]
649
+ });
650
+ const checksumStdout = checksumResult.stdout.trim();
651
+ const checksumStderr = checksumResult.stderr.trim();
652
+ if (checksumResult.exitCode !== 0) {
653
+ throw new Error(
654
+ `sha256sum failed: ${checksumStderr || checksumStdout || "command failed"}`
655
+ );
656
+ }
657
+ const actualChecksum = checksumStdout.split(/\s+/)[0]?.toLowerCase();
658
+ if (!actualChecksum) {
659
+ throw new Error("sha256sum produced empty output");
660
+ }
661
+ if (actualChecksum !== sha256) {
662
+ throw new Error(
663
+ `checksum mismatch for ${url}: expected ${sha256}, got ${actualChecksum}`
664
+ );
665
+ }
666
+ return filePath;
667
+ }
668
+ async function installRipgrep(sandbox) {
669
+ const archivePath = await downloadVerifiedRuntimeDependency(
670
+ sandbox,
671
+ RIPGREP_ARCHIVE_URL,
672
+ RIPGREP_ARCHIVE_SHA256
673
+ );
674
+ const extractedDir = `/tmp/ripgrep-${RIPGREP_VERSION}-x86_64-unknown-linux-musl`;
675
+ await runOrThrow(
676
+ sandbox,
677
+ {
678
+ cmd: "tar",
679
+ args: ["-xzf", archivePath, "-C", "/tmp"]
680
+ },
681
+ "extract ripgrep"
682
+ );
683
+ await runOrThrow(
684
+ sandbox,
685
+ {
686
+ cmd: "mkdir",
687
+ args: ["-p", `${SANDBOX_WORKSPACE_ROOT}/.junior/bin`]
688
+ },
689
+ "create sandbox bin directory"
690
+ );
691
+ await runOrThrow(
692
+ sandbox,
693
+ {
694
+ cmd: "install",
695
+ args: [
696
+ "-m",
697
+ "0755",
698
+ `${extractedDir}/rg`,
699
+ `${SANDBOX_WORKSPACE_ROOT}/.junior/bin/rg`
700
+ ]
701
+ },
702
+ "install ripgrep"
703
+ );
704
+ }
609
705
  async function installRuntimeDependencies(sandbox, deps) {
610
706
  const systemDeps = deps.filter(
611
707
  (dep) => dep.type === "system"
@@ -623,35 +719,11 @@ async function installRuntimeDependencies(sandbox, deps) {
623
719
  async () => {
624
720
  for (const dep of systemDeps) {
625
721
  if ("url" in dep) {
626
- const rpmPath = runtimeDependencyFilePath(dep.url, dep.sha256);
627
- await runOrThrow(
722
+ const rpmPath = await downloadVerifiedRuntimeDependency(
628
723
  sandbox,
629
- {
630
- cmd: "curl",
631
- args: ["-fsSL", dep.url, "-o", rpmPath]
632
- },
633
- `curl download ${dep.url}`
724
+ dep.url,
725
+ dep.sha256
634
726
  );
635
- const checksumResult = await runNonInteractiveCommand(sandbox, {
636
- cmd: "sha256sum",
637
- args: [rpmPath]
638
- });
639
- const checksumStdout = checksumResult.stdout.trim();
640
- const checksumStderr = checksumResult.stderr.trim();
641
- if (checksumResult.exitCode !== 0) {
642
- throw new Error(
643
- `sha256sum failed: ${checksumStderr || checksumStdout || "command failed"}`
644
- );
645
- }
646
- const actualChecksum = checksumStdout.split(/\s+/)[0]?.toLowerCase();
647
- if (!actualChecksum) {
648
- throw new Error("sha256sum produced empty output");
649
- }
650
- if (actualChecksum !== dep.sha256) {
651
- throw new Error(
652
- `checksum mismatch for ${dep.url}: expected ${dep.sha256}, got ${actualChecksum}`
653
- );
654
- }
655
727
  await runOrThrow(
656
728
  sandbox,
657
729
  {
@@ -663,6 +735,10 @@ async function installRuntimeDependencies(sandbox, deps) {
663
735
  );
664
736
  continue;
665
737
  }
738
+ if (dep.package === "ripgrep") {
739
+ await installRipgrep(sandbox);
740
+ continue;
741
+ }
666
742
  if (dep.package === "gh") {
667
743
  await installGhCliViaDnf(sandbox);
668
744
  continue;
@@ -977,6 +1053,7 @@ export {
977
1053
  runNonInteractiveCommand,
978
1054
  getSandboxResources,
979
1055
  GLOBAL_RUNTIME_DEPENDENCIES,
1056
+ bindSandboxFileSystem,
980
1057
  createSandboxSession,
981
1058
  getRuntimeDependencyProfileHash,
982
1059
  resolveRuntimeDependencySnapshot,
@@ -8,9 +8,6 @@ function cloneInlineManifests(registrations) {
8
8
  {
9
9
  manifest: {
10
10
  ...structuredClone(plugin.manifest),
11
- capabilities: plugin.manifest.capabilities?.map(
12
- (capability) => capability.includes(".") ? capability : `${plugin.manifest.name}.${capability}`
13
- ) ?? [],
14
11
  configKeys: plugin.manifest.configKeys?.map(
15
12
  (key) => key.includes(".") ? key : `${plugin.manifest.name}.${key}`
16
13
  ) ?? [],
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JUNIOR_VERSION
3
- } from "./chunk-FHC4JUSF.js";
3
+ } from "./chunk-N3C4XCRE.js";
4
4
 
5
5
  // src/deployment.ts
6
6
  var JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";
@@ -5,7 +5,7 @@ import {
5
5
  logInfo,
6
6
  logWarn,
7
7
  setSpanAttributes
8
- } from "./chunk-NVUQSFWX.js";
8
+ } from "./chunk-F3SWGSPG.js";
9
9
  import {
10
10
  discoverInstalledPluginPackageContent,
11
11
  normalizePluginPackageNames
@@ -105,11 +105,6 @@ function inlineManifestSource(manifest) {
105
105
  setDefined(result, "name", manifest.name);
106
106
  setDefined(result, "display-name", manifest.displayName);
107
107
  setDefined(result, "description", manifest.description);
108
- setDefined(
109
- result,
110
- "capabilities",
111
- inlineTokenListSource(manifest.name, manifest.capabilities)
112
- );
113
108
  setDefined(
114
109
  result,
115
110
  "config-keys",
@@ -138,7 +133,6 @@ function inlineManifestSource(manifest) {
138
133
 
139
134
  // src/chat/plugins/manifest.ts
140
135
  var PLUGIN_NAME_RE = /^[a-z][a-z0-9-]*$/;
141
- var SHORT_CAPABILITY_RE = /^[a-z0-9-]+(\.[a-z0-9-]+)*$/;
142
136
  var SHORT_CONFIG_KEY_RE = /^[a-z0-9]+(\.[a-z0-9-]+)*$/;
143
137
  var TARGET_FLAG_RE = /^-{1,2}[A-Za-z0-9][A-Za-z0-9-]*$/;
144
138
  var AUTH_TOKEN_ENV_RE = /^[A-Z][A-Z0-9_]*$/;
@@ -321,9 +315,6 @@ var manifestSourceSchema = z.object({
321
315
  }),
322
316
  "display-name": nonEmptyTrimmedString,
323
317
  description: nonEmptyTrimmedString,
324
- capabilities: z.array(z.string(), {
325
- error: "must be an array when provided"
326
- }).optional(),
327
318
  "config-keys": z.array(z.string(), {
328
319
  error: "must be an array when provided"
329
320
  }).optional(),
@@ -361,7 +352,6 @@ function manifestConfigPatch(config) {
361
352
  const result = {};
362
353
  setDefined2(result, "display-name", config.displayName);
363
354
  setDefined2(result, "description", config.description);
364
- setDefined2(result, "capabilities", config.capabilities);
365
355
  setDefined2(result, "config-keys", config.configKeys);
366
356
  setDefined2(result, "domains", config.domains);
367
357
  setDefined2(result, "api-headers", config.apiHeaders);
@@ -854,11 +844,6 @@ function parseManifestSource(parsedSource, dir, config, options) {
854
844
  if (path2 === "description") {
855
845
  throw new Error(`Invalid plugin description in ${dir}`);
856
846
  }
857
- if (path2 === "capabilities") {
858
- throw new Error(
859
- `Plugin ${String(parsedSource.name ?? "unknown")} capabilities must be an array when provided`
860
- );
861
- }
862
847
  if (path2 === "config-keys") {
863
848
  throw new Error(
864
849
  `Plugin ${String(parsedSource.name ?? "unknown")} config-keys must be an array when provided`
@@ -917,14 +902,6 @@ function parseManifestSource(parsedSource, dir, config, options) {
917
902
  throw new Error(issue?.message ?? `Invalid plugin manifest in ${dir}`);
918
903
  }
919
904
  const data = sourceResult.data;
920
- const capabilities = (data.capabilities ?? []).map((cap) => {
921
- if (!SHORT_CAPABILITY_RE.test(cap)) {
922
- throw new Error(
923
- `Invalid capability token "${cap}" in plugin ${data.name}`
924
- );
925
- }
926
- return `${data.name}.${cap}`;
927
- });
928
905
  const configKeys = (data["config-keys"] ?? []).map((key) => {
929
906
  if (!SHORT_CONFIG_KEY_RE.test(key)) {
930
907
  throw new Error(`Invalid config key "${key}" in plugin ${data.name}`);
@@ -959,7 +936,6 @@ function parseManifestSource(parsedSource, dir, config, options) {
959
936
  name: data.name,
960
937
  displayName: data["display-name"],
961
938
  description: data.description,
962
- capabilities,
963
939
  configKeys,
964
940
  ...domains ? { domains } : {},
965
941
  ...apiHeaders ? { apiHeaders } : {},
@@ -1550,7 +1526,6 @@ function createLoadedPluginState(signature) {
1550
1526
  signature,
1551
1527
  pluginDefinitions: [],
1552
1528
  pluginMigrationRoots: /* @__PURE__ */ new Map(),
1553
- capabilityToPlugin: /* @__PURE__ */ new Map(),
1554
1529
  domainToPlugin: /* @__PURE__ */ new Map(),
1555
1530
  pluginConfigKeys: /* @__PURE__ */ new Set(),
1556
1531
  pluginsByName: /* @__PURE__ */ new Map(),
@@ -1569,13 +1544,6 @@ function registerPluginManifest(state, manifest, pluginDir, skillsDir, migration
1569
1544
  if (state.pluginsByName.has(manifest.name)) {
1570
1545
  throw new Error(`Duplicate plugin name "${manifest.name}"`);
1571
1546
  }
1572
- for (const cap of manifest.capabilities) {
1573
- if (state.capabilityToPlugin.has(cap)) {
1574
- throw new Error(
1575
- `Duplicate capability "${cap}" in plugin "${manifest.name}"`
1576
- );
1577
- }
1578
- }
1579
1547
  for (const domain of providerDomains(manifest)) {
1580
1548
  const owner = state.domainToPlugin.get(domain);
1581
1549
  if (owner) {
@@ -1595,9 +1563,6 @@ function registerPluginManifest(state, manifest, pluginDir, skillsDir, migration
1595
1563
  if (definition.migrationsDir) {
1596
1564
  state.pluginMigrationRoots.set(manifest.name, definition.migrationsDir);
1597
1565
  }
1598
- for (const cap of manifest.capabilities) {
1599
- state.capabilityToPlugin.set(cap, definition);
1600
- }
1601
1566
  for (const key of manifest.configKeys) {
1602
1567
  state.pluginConfigKeys.add(key);
1603
1568
  }
@@ -1817,7 +1782,6 @@ function logLoadedPlugins(state) {
1817
1782
  {},
1818
1783
  {
1819
1784
  "app.plugin.name": plugin.manifest.name,
1820
- "app.plugin.capability_count": plugin.manifest.capabilities.length,
1821
1785
  "app.plugin.config_key_count": plugin.manifest.configKeys.length,
1822
1786
  "app.plugin.has_mcp": Boolean(plugin.manifest.mcp),
1823
1787
  "file.directory": plugin.dir,
@@ -1854,20 +1818,6 @@ function createPluginCatalogRuntime() {
1854
1818
  getSignature() {
1855
1819
  return ensurePluginsLoaded(runtime).signature;
1856
1820
  },
1857
- getCapabilityProviders() {
1858
- const state = ensurePluginsLoaded(runtime);
1859
- return state.pluginDefinitions.map((plugin) => ({
1860
- provider: plugin.manifest.name,
1861
- capabilities: [...plugin.manifest.capabilities],
1862
- configKeys: [...plugin.manifest.configKeys],
1863
- ...plugin.manifest.target ? {
1864
- target: {
1865
- ...plugin.manifest.target,
1866
- ...plugin.manifest.target.commandFlags ? { commandFlags: [...plugin.manifest.target.commandFlags] } : {}
1867
- }
1868
- } : {}
1869
- }));
1870
- },
1871
1821
  getProviders() {
1872
1822
  return [...ensurePluginsLoaded(runtime).pluginDefinitions];
1873
1823
  },
@@ -1971,9 +1921,6 @@ function createPluginCatalogRuntime() {
1971
1921
  isProvider(provider) {
1972
1922
  return ensurePluginsLoaded(runtime).pluginsByName.has(provider);
1973
1923
  },
1974
- isCapability(capability) {
1975
- return ensurePluginsLoaded(runtime).capabilityToPlugin.has(capability);
1976
- },
1977
1924
  isConfigKey(key) {
1978
1925
  return ensurePluginsLoaded(runtime).pluginConfigKeys.has(key);
1979
1926
  },
@@ -1996,7 +1943,6 @@ function createPluginCatalogRuntime() {
1996
1943
  }
1997
1944
  setSpanAttributes({
1998
1945
  "app.plugin.name": name,
1999
- "app.plugin.capabilities": plugin.manifest.capabilities,
2000
1946
  "app.plugin.has_oauth": Boolean(plugin.manifest.oauth)
2001
1947
  });
2002
1948
  return broker;
@@ -1,22 +1,23 @@
1
1
  import {
2
2
  SANDBOX_WORKSPACE_ROOT,
3
3
  getStateAdapter
4
- } from "./chunk-67CVNDJ7.js";
4
+ } from "./chunk-7CSVG54J.js";
5
5
  import {
6
+ createPluginAnnotations,
6
7
  isConversationChannel,
7
8
  isConversationScopedChannel,
8
9
  isDmChannel,
9
10
  normalizeSlackConversationId
10
- } from "./chunk-CWEZEPD4.js";
11
+ } from "./chunk-FAEALXEH.js";
11
12
  import {
12
13
  getDb
13
- } from "./chunk-HWCQRGLL.js";
14
+ } from "./chunk-BFYVIOTS.js";
14
15
  import {
15
16
  botConfig,
16
17
  completeObject,
17
18
  embedTexts,
18
19
  standardModelId
19
- } from "./chunk-SYJT7AKB.js";
20
+ } from "./chunk-CY7NXM32.js";
20
21
  import {
21
22
  isActorUserId,
22
23
  parseActorUserId
@@ -25,7 +26,7 @@ import {
25
26
  logException,
26
27
  logInfo,
27
28
  logWarn
28
- } from "./chunk-NVUQSFWX.js";
29
+ } from "./chunk-F3SWGSPG.js";
29
30
  import {
30
31
  parseSlackChannelReferenceId,
31
32
  parseSlackMessageTs,
@@ -687,6 +688,11 @@ function getPluginTools(context) {
687
688
  ...dashboardConversationUrl ? { conversationLink: { url: dashboardConversationUrl } } : {},
688
689
  ...credentialSubject ? { credentialSubject } : {}
689
690
  } : void 0;
691
+ const annotations = context.conversationId ? createPluginAnnotations({
692
+ conversationId: context.conversationId,
693
+ db: getDb(),
694
+ plugin: pluginName
695
+ }) : void 0;
690
696
  let pluginContext;
691
697
  if (context.source.platform === "slack") {
692
698
  if (context.destination.platform !== "slack") {
@@ -698,6 +704,7 @@ function getPluginTools(context) {
698
704
  ...basePluginContext(plugin),
699
705
  actor: context.actor?.platform === "slack" ? context.actor : void 0,
700
706
  conversationId: context.conversationId,
707
+ ...annotations ? { annotations } : {},
701
708
  destination: context.destination,
702
709
  slack: slackContext,
703
710
  source: context.source,
@@ -717,6 +724,7 @@ function getPluginTools(context) {
717
724
  ...basePluginContext(plugin),
718
725
  actor: context.actor?.platform === "local" ? context.actor : void 0,
719
726
  conversationId: context.conversationId,
727
+ ...annotations ? { annotations } : {},
720
728
  destination: context.destination,
721
729
  source: context.source,
722
730
  userText: context.userText,
@@ -789,6 +797,13 @@ function getPluginRoutes(options) {
789
797
  }
790
798
  const pluginRoutes = hook({
791
799
  ...basePluginContext(plugin),
800
+ annotations: {
801
+ forConversation: (conversationId) => createPluginAnnotations({
802
+ conversationId,
803
+ db: getDb(),
804
+ plugin: pluginName
805
+ })
806
+ },
792
807
  resourceEvents: {
793
808
  async publish(event) {
794
809
  const parsed = resourceEventSchema.parse(event);
package/dist/cli/chat.js CHANGED
@@ -1,40 +1,40 @@
1
1
  import {
2
2
  createAgentRunner,
3
3
  executeAgentRun
4
- } from "../chunk-43RYMWJ2.js";
4
+ } from "../chunk-GDAXWEIJ.js";
5
5
  import "../chunk-DIB4GX3G.js";
6
- import "../chunk-LYA2AB5G.js";
7
- import "../chunk-CEYOL62C.js";
6
+ import "../chunk-CGXLCMWI.js";
7
+ import "../chunk-RYFAVWP3.js";
8
8
  import "../chunk-HDSDCEPK.js";
9
- import "../chunk-PVZHG2XZ.js";
9
+ import "../chunk-VBMMMVVQ.js";
10
10
  import "../chunk-MU6HHZEN.js";
11
11
  import "../chunk-PDO5BLNM.js";
12
12
  import "../chunk-UIE3R5XU.js";
13
13
  import {
14
14
  loadAppPluginSet
15
15
  } from "../chunk-Y2CM7HXH.js";
16
- import "../chunk-RAVKCKXA.js";
17
- import "../chunk-67CVNDJ7.js";
18
- import "../chunk-CWEZEPD4.js";
19
- import "../chunk-HWCQRGLL.js";
20
- import "../chunk-JQFJO5WH.js";
16
+ import "../chunk-ZYHLNTC2.js";
17
+ import "../chunk-7CSVG54J.js";
18
+ import "../chunk-FAEALXEH.js";
19
+ import "../chunk-BFYVIOTS.js";
20
+ import "../chunk-RXRQJF7Y.js";
21
21
  import "../chunk-4ZNGQH7C.js";
22
- import "../chunk-SYJT7AKB.js";
22
+ import "../chunk-CY7NXM32.js";
23
23
  import "../chunk-VFUK3X5B.js";
24
24
  import "../chunk-FXOYURO4.js";
25
- import "../chunk-2QG4MZQ7.js";
26
- import "../chunk-6FKLPVF3.js";
27
- import "../chunk-EW5MLKT5.js";
25
+ import "../chunk-DLLW5ITL.js";
26
+ import "../chunk-OY2PQQ4P.js";
27
+ import "../chunk-XA3VLFPK.js";
28
28
  import "../chunk-W3U3YQYI.js";
29
29
  import "../chunk-HZF5P5UN.js";
30
- import "../chunk-NVUQSFWX.js";
30
+ import "../chunk-F3SWGSPG.js";
31
31
  import "../chunk-OB42YVAE.js";
32
32
  import "../chunk-F3B2YJ76.js";
33
33
  import "../chunk-6GWA276C.js";
34
34
  import "../chunk-B3IT5END.js";
35
35
  import "../chunk-3V7OFJZC.js";
36
- import "../chunk-TVE25LPW.js";
37
- import "../chunk-FHC4JUSF.js";
36
+ import "../chunk-WLT72MRP.js";
37
+ import "../chunk-N3C4XCRE.js";
38
38
  import "../chunk-MLKGABMK.js";
39
39
 
40
40
  // src/cli/chat.ts
@@ -156,11 +156,11 @@ async function configureLocalChatPlugins(pluginSet) {
156
156
  validationModule,
157
157
  databaseModule
158
158
  ] = await Promise.all([
159
- import("../plugins-PZMDS7AT.js"),
160
- import("../agent-hooks-4EUUXP2F.js"),
161
- import("../catalog-runtime-Y32UEQLB.js"),
162
- import("../validation-MZ47PZP5.js"),
163
- import("../db-KBSJHAZU.js")
159
+ import("../plugins-IUJA4VBU.js"),
160
+ import("../agent-hooks-GUAAS3XH.js"),
161
+ import("../catalog-runtime-WMPC4J4U.js"),
162
+ import("../validation-EEF4ROHR.js"),
163
+ import("../db-FH4R5ZQ4.js")
164
164
  ]);
165
165
  const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
166
166
  const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
@@ -224,8 +224,8 @@ function localDevServerUrl() {
224
224
  async function prepareLocalChatRun(io, pluginSet) {
225
225
  defaultStateAdapterForLocalChat();
226
226
  await configureLocalChatPlugins(pluginSet);
227
- const { runLocalAgentTurn } = await import("../runner-RQGZ5Z2S.js");
228
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-EYRMJTCS.js");
227
+ const { runLocalAgentTurn } = await import("../runner-NAALFIXM.js");
228
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-C2SSJ3FQ.js");
229
229
  const { createLocalOAuthState } = await import("../oauth-relay-3ZU72UGL.js");
230
230
  const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-CDFAP67O.js");
231
231
  const agentRunner = createAgentRunner(executeAgentRun);
package/dist/cli/check.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  parseSkillFile
3
- } from "../chunk-2QG4MZQ7.js";
4
- import "../chunk-6FKLPVF3.js";
3
+ } from "../chunk-DLLW5ITL.js";
4
+ import "../chunk-OY2PQQ4P.js";
5
5
  import {
6
6
  parseInlinePluginManifest,
7
7
  parsePluginManifest
8
- } from "../chunk-EW5MLKT5.js";
8
+ } from "../chunk-XA3VLFPK.js";
9
9
  import "../chunk-W3U3YQYI.js";
10
10
  import "../chunk-HZF5P5UN.js";
11
- import "../chunk-NVUQSFWX.js";
11
+ import "../chunk-F3SWGSPG.js";
12
12
  import "../chunk-OB42YVAE.js";
13
13
  import "../chunk-F3B2YJ76.js";
14
14
  import "../chunk-6GWA276C.js";
@@ -18,8 +18,8 @@ import {
18
18
  JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE,
19
19
  JUNIOR_HEARTBEAT_ROUTE,
20
20
  LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION
21
- } from "../chunk-TVE25LPW.js";
22
- import "../chunk-FHC4JUSF.js";
21
+ } from "../chunk-WLT72MRP.js";
22
+ import "../chunk-N3C4XCRE.js";
23
23
  import "../chunk-MLKGABMK.js";
24
24
 
25
25
  // src/cli/check.ts
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  validatePluginEgressCredentialHooks,
3
3
  validatePluginRegistrations
4
- } from "../chunk-6V762AB4.js";
4
+ } from "../chunk-2YYPXQNQ.js";
5
5
  import {
6
6
  pluginCatalogConfigFromPluginSet,
7
7
  pluginCliRegistrationsFromPluginSet,
8
8
  pluginRuntimeRegistrationsFromPluginSet
9
- } from "../chunk-SG5WAA7H.js";
9
+ } from "../chunk-WKU7TY22.js";
10
10
  import {
11
11
  loadAppPluginSet
12
12
  } from "../chunk-Y2CM7HXH.js";
@@ -14,31 +14,31 @@ import {
14
14
  createPluginLogger,
15
15
  setPlugins,
16
16
  validatePlugins
17
- } from "../chunk-RAVKCKXA.js";
18
- import "../chunk-67CVNDJ7.js";
19
- import "../chunk-CWEZEPD4.js";
17
+ } from "../chunk-ZYHLNTC2.js";
18
+ import "../chunk-7CSVG54J.js";
19
+ import "../chunk-FAEALXEH.js";
20
20
  import {
21
21
  getDb
22
- } from "../chunk-HWCQRGLL.js";
23
- import "../chunk-JQFJO5WH.js";
22
+ } from "../chunk-BFYVIOTS.js";
23
+ import "../chunk-RXRQJF7Y.js";
24
24
  import "../chunk-4ZNGQH7C.js";
25
- import "../chunk-SYJT7AKB.js";
25
+ import "../chunk-CY7NXM32.js";
26
26
  import "../chunk-VFUK3X5B.js";
27
27
  import "../chunk-FXOYURO4.js";
28
28
  import {
29
29
  pluginCatalogRuntime
30
- } from "../chunk-6FKLPVF3.js";
31
- import "../chunk-EW5MLKT5.js";
30
+ } from "../chunk-OY2PQQ4P.js";
31
+ import "../chunk-XA3VLFPK.js";
32
32
  import "../chunk-W3U3YQYI.js";
33
33
  import "../chunk-HZF5P5UN.js";
34
- import "../chunk-NVUQSFWX.js";
34
+ import "../chunk-F3SWGSPG.js";
35
35
  import "../chunk-OB42YVAE.js";
36
36
  import "../chunk-F3B2YJ76.js";
37
37
  import "../chunk-6GWA276C.js";
38
38
  import "../chunk-B3IT5END.js";
39
39
  import "../chunk-3V7OFJZC.js";
40
- import "../chunk-TVE25LPW.js";
41
- import "../chunk-FHC4JUSF.js";
40
+ import "../chunk-WLT72MRP.js";
41
+ import "../chunk-N3C4XCRE.js";
42
42
  import "../chunk-MLKGABMK.js";
43
43
 
44
44
  // src/cli/plugins.ts
@@ -1,27 +1,27 @@
1
1
  import {
2
2
  GLOBAL_RUNTIME_DEPENDENCIES,
3
3
  resolveRuntimeDependencySnapshot
4
- } from "../chunk-PVZHG2XZ.js";
4
+ } from "../chunk-VBMMMVVQ.js";
5
5
  import {
6
6
  disconnectStateAdapter
7
- } from "../chunk-67CVNDJ7.js";
7
+ } from "../chunk-7CSVG54J.js";
8
8
  import "../chunk-4ZNGQH7C.js";
9
- import "../chunk-SYJT7AKB.js";
9
+ import "../chunk-CY7NXM32.js";
10
10
  import "../chunk-FXOYURO4.js";
11
11
  import {
12
12
  pluginCatalogRuntime
13
- } from "../chunk-6FKLPVF3.js";
14
- import "../chunk-EW5MLKT5.js";
13
+ } from "../chunk-OY2PQQ4P.js";
14
+ import "../chunk-XA3VLFPK.js";
15
15
  import "../chunk-W3U3YQYI.js";
16
16
  import "../chunk-HZF5P5UN.js";
17
- import "../chunk-NVUQSFWX.js";
17
+ import "../chunk-F3SWGSPG.js";
18
18
  import "../chunk-OB42YVAE.js";
19
19
  import "../chunk-F3B2YJ76.js";
20
20
  import "../chunk-6GWA276C.js";
21
21
  import "../chunk-B3IT5END.js";
22
22
  import "../chunk-3V7OFJZC.js";
23
- import "../chunk-TVE25LPW.js";
24
- import "../chunk-FHC4JUSF.js";
23
+ import "../chunk-WLT72MRP.js";
24
+ import "../chunk-N3C4XCRE.js";
25
25
  import "../chunk-MLKGABMK.js";
26
26
 
27
27
  // src/cli/snapshot-warmup.ts