@sentry/junior 0.11.1 → 0.12.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,13 +1,12 @@
1
1
  import {
2
2
  getPluginCapabilityProviders,
3
+ getPluginCatalogSignature,
3
4
  getPluginForSkillPath,
4
5
  getPluginSkillRoots,
5
6
  logInfo,
6
- logWarn
7
- } from "./chunk-ZYB3U7Q4.js";
8
- import {
7
+ logWarn,
9
8
  skillRoots
10
- } from "./chunk-XH7TV4JS.js";
9
+ } from "./chunk-Y2LVMCQ3.js";
11
10
 
12
11
  // src/chat/skills.ts
13
12
  import fs from "fs/promises";
@@ -16,7 +15,18 @@ import { z } from "zod";
16
15
  import { parse as parseYaml } from "yaml";
17
16
 
18
17
  // src/chat/capabilities/catalog.ts
18
+ var cachedCatalog;
19
+ function cloneProviderDefinition(provider) {
20
+ return {
21
+ ...provider,
22
+ capabilities: [...provider.capabilities],
23
+ configKeys: [...provider.configKeys],
24
+ ...provider.target ? { target: { ...provider.target } } : {}
25
+ };
26
+ }
19
27
  function getCapabilityCatalog() {
28
+ const signature = getPluginCatalogSignature();
29
+ if (cachedCatalog?.signature === signature) return cachedCatalog;
20
30
  const providers = getPluginCapabilityProviders();
21
31
  const capabilityToProvider = /* @__PURE__ */ new Map();
22
32
  const configKeys = /* @__PURE__ */ new Set();
@@ -33,14 +43,12 @@ function getCapabilityCatalog() {
33
43
  configKeys.add(configKey);
34
44
  }
35
45
  }
36
- return {
37
- providers,
38
- capabilityToProvider,
39
- configKeys
40
- };
46
+ cachedCatalog = { signature, providers, capabilityToProvider, configKeys };
47
+ return cachedCatalog;
41
48
  }
42
49
  function getCapabilityProvider(capability) {
43
- return getCapabilityCatalog().capabilityToProvider.get(capability);
50
+ const provider = getCapabilityCatalog().capabilityToProvider.get(capability);
51
+ return provider ? cloneProviderDefinition(provider) : void 0;
44
52
  }
45
53
  function isKnownCapability(capability) {
46
54
  return getCapabilityCatalog().capabilityToProvider.has(capability);
@@ -49,38 +57,22 @@ function isKnownConfigKey(key) {
49
57
  return getCapabilityCatalog().configKeys.has(key);
50
58
  }
51
59
  function listCapabilityProviders() {
52
- return getCapabilityCatalog().providers.map((provider) => ({
53
- ...provider,
54
- capabilities: [...provider.capabilities],
55
- configKeys: [...provider.configKeys]
56
- }));
60
+ return getCapabilityCatalog().providers.map(cloneProviderDefinition);
57
61
  }
58
- var startupCatalogSignature = null;
62
+ var catalogLogged = false;
59
63
  function logCapabilityCatalogLoadedOnce() {
60
- const providers = listCapabilityProviders();
61
- const signature = JSON.stringify(
62
- providers.map((provider) => ({
63
- provider: provider.provider,
64
- capabilities: provider.capabilities,
65
- configKeys: provider.configKeys,
66
- target: provider.target
67
- }))
68
- );
69
- if (startupCatalogSignature === signature) {
70
- return;
71
- }
72
- startupCatalogSignature = signature;
73
- const capabilityNames = providers.flatMap((provider) => provider.capabilities).sort();
64
+ if (catalogLogged) return;
65
+ catalogLogged = true;
66
+ const { providers } = getCapabilityCatalog();
67
+ const capabilityNames = providers.flatMap((p) => p.capabilities).sort();
74
68
  const configKeys = [
75
- ...new Set(providers.flatMap((provider) => provider.configKeys))
69
+ ...new Set(providers.flatMap((p) => p.configKeys))
76
70
  ].sort();
77
71
  logInfo(
78
72
  "capability_catalog_loaded",
79
73
  {},
80
74
  {
81
- "app.capability.providers": providers.map(
82
- (provider) => provider.provider
83
- ),
75
+ "app.capability.providers": providers.map((p) => p.provider),
84
76
  "app.capability.count": capabilityNames.length,
85
77
  "app.capability.names": capabilityNames,
86
78
  "app.config.key_count": configKeys.length,
@@ -2,7 +2,7 @@ import {
2
2
  getPluginRuntimeDependencies,
3
3
  getPluginRuntimePostinstall,
4
4
  withSpan
5
- } from "./chunk-ZYB3U7Q4.js";
5
+ } from "./chunk-Y2LVMCQ3.js";
6
6
 
7
7
  // src/chat/state/adapter.ts
8
8
  import { createMemoryState } from "@chat-adapter/state-memory";