@codemieai/code 0.4.1 → 0.5.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.
- package/README.md +7 -1
- package/bin/codemie-kimi-acp.js +18 -0
- package/bin/codemie-kimi.js +18 -0
- package/dist/agents/core/AgentCLI.d.ts.map +1 -1
- package/dist/agents/core/AgentCLI.js +4 -0
- package/dist/agents/core/AgentCLI.js.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.js +26 -6
- package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
- package/dist/agents/core/metrics/types.d.ts +4 -1
- package/dist/agents/core/metrics/types.d.ts.map +1 -1
- package/dist/agents/core/session/BaseProcessor.d.ts +2 -0
- package/dist/agents/core/session/BaseProcessor.d.ts.map +1 -1
- package/dist/agents/core/session/BaseSessionAdapter.d.ts +10 -0
- package/dist/agents/core/session/BaseSessionAdapter.d.ts.map +1 -1
- package/dist/agents/core/types.d.ts +30 -0
- package/dist/agents/core/types.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +3 -3
- package/dist/agents/plugins/claude/claude.session.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.session.js +29 -7
- package/dist/agents/plugins/claude/claude.session.js.map +1 -1
- package/dist/agents/plugins/claude/session/claude-named-invocations.d.ts +28 -0
- package/dist/agents/plugins/claude/session/claude-named-invocations.d.ts.map +1 -0
- package/dist/agents/plugins/claude/session/claude-named-invocations.js +78 -0
- package/dist/agents/plugins/claude/session/claude-named-invocations.js.map +1 -0
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.d.ts.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js +10 -1
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js.map +1 -1
- package/dist/agents/plugins/gemini/gemini.plugin.js.map +1 -1
- package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.d.ts.map +1 -1
- package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.js +3 -0
- package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.js.map +1 -1
- package/dist/agents/plugins/kimi/extension/SKILL.md +6 -0
- package/dist/agents/plugins/kimi/extension/manifest.json +8 -0
- package/dist/agents/plugins/kimi/kimi-acp.plugin.d.ts +7 -0
- package/dist/agents/plugins/kimi/kimi-acp.plugin.d.ts.map +1 -0
- package/dist/agents/plugins/kimi/kimi-acp.plugin.js +28 -0
- package/dist/agents/plugins/kimi/kimi-acp.plugin.js.map +1 -0
- package/dist/agents/plugins/kimi/kimi.extension-installer.d.ts +56 -0
- package/dist/agents/plugins/kimi/kimi.extension-installer.d.ts.map +1 -0
- package/dist/agents/plugins/kimi/kimi.extension-installer.js +79 -0
- package/dist/agents/plugins/kimi/kimi.extension-installer.js.map +1 -0
- package/dist/agents/plugins/kimi/kimi.hook-config-injector.d.ts +34 -0
- package/dist/agents/plugins/kimi/kimi.hook-config-injector.d.ts.map +1 -0
- package/dist/agents/plugins/kimi/kimi.hook-config-injector.js +158 -0
- package/dist/agents/plugins/kimi/kimi.hook-config-injector.js.map +1 -0
- package/dist/agents/plugins/kimi/kimi.hook-transformer.d.ts +23 -0
- package/dist/agents/plugins/kimi/kimi.hook-transformer.d.ts.map +1 -0
- package/dist/agents/plugins/kimi/kimi.hook-transformer.js +46 -0
- package/dist/agents/plugins/kimi/kimi.hook-transformer.js.map +1 -0
- package/dist/agents/plugins/kimi/kimi.models.d.ts +8 -0
- package/dist/agents/plugins/kimi/kimi.models.d.ts.map +1 -0
- package/dist/agents/plugins/kimi/kimi.models.js +174 -0
- package/dist/agents/plugins/kimi/kimi.models.js.map +1 -0
- package/dist/agents/plugins/kimi/kimi.paths.d.ts +65 -0
- package/dist/agents/plugins/kimi/kimi.paths.d.ts.map +1 -0
- package/dist/agents/plugins/kimi/kimi.paths.js +95 -0
- package/dist/agents/plugins/kimi/kimi.paths.js.map +1 -0
- package/dist/agents/plugins/kimi/kimi.plugin.d.ts +37 -0
- package/dist/agents/plugins/kimi/kimi.plugin.d.ts.map +1 -0
- package/dist/agents/plugins/kimi/kimi.plugin.js +318 -0
- package/dist/agents/plugins/kimi/kimi.plugin.js.map +1 -0
- package/dist/agents/plugins/kimi/kimi.session.d.ts +40 -0
- package/dist/agents/plugins/kimi/kimi.session.d.ts.map +1 -0
- package/dist/agents/plugins/kimi/kimi.session.js +191 -0
- package/dist/agents/plugins/kimi/kimi.session.js.map +1 -0
- package/dist/agents/plugins/kimi/session/processors/kimi.metrics-processor.d.ts +43 -0
- package/dist/agents/plugins/kimi/session/processors/kimi.metrics-processor.d.ts.map +1 -0
- package/dist/agents/plugins/kimi/session/processors/kimi.metrics-processor.js +421 -0
- package/dist/agents/plugins/kimi/session/processors/kimi.metrics-processor.js.map +1 -0
- package/dist/agents/plugins/kimi/session/types.d.ts +81 -0
- package/dist/agents/plugins/kimi/session/types.d.ts.map +1 -0
- package/dist/agents/plugins/kimi/session/types.js +5 -0
- package/dist/agents/plugins/kimi/session/types.js.map +1 -0
- package/dist/agents/registry.d.ts.map +1 -1
- package/dist/agents/registry.js +4 -0
- package/dist/agents/registry.js.map +1 -1
- package/dist/cli/commands/analytics/aggregator.d.ts +14 -0
- package/dist/cli/commands/analytics/aggregator.d.ts.map +1 -1
- package/dist/cli/commands/analytics/aggregator.js +81 -1
- package/dist/cli/commands/analytics/aggregator.js.map +1 -1
- package/dist/cli/commands/analytics/cost/cost-calculator.d.ts +10 -0
- package/dist/cli/commands/analytics/cost/cost-calculator.d.ts.map +1 -1
- package/dist/cli/commands/analytics/cost/cost-calculator.js +9 -5
- package/dist/cli/commands/analytics/cost/cost-calculator.js.map +1 -1
- package/dist/cli/commands/analytics/cost/cost-enricher.d.ts +9 -1
- package/dist/cli/commands/analytics/cost/cost-enricher.d.ts.map +1 -1
- package/dist/cli/commands/analytics/cost/cost-enricher.js +141 -7
- package/dist/cli/commands/analytics/cost/cost-enricher.js.map +1 -1
- package/dist/cli/commands/analytics/cost/dispatch-extractor.d.ts +17 -0
- package/dist/cli/commands/analytics/cost/dispatch-extractor.d.ts.map +1 -0
- package/dist/cli/commands/analytics/cost/dispatch-extractor.js +78 -0
- package/dist/cli/commands/analytics/cost/dispatch-extractor.js.map +1 -0
- package/dist/cli/commands/analytics/cost/pricing.json +9 -2
- package/dist/cli/commands/analytics/cost/types.d.ts +33 -0
- package/dist/cli/commands/analytics/cost/types.d.ts.map +1 -1
- package/dist/cli/commands/analytics/cost/types.js +4 -1
- package/dist/cli/commands/analytics/cost/types.js.map +1 -1
- package/dist/cli/commands/analytics/cost/usage-readers.d.ts +22 -1
- package/dist/cli/commands/analytics/cost/usage-readers.d.ts.map +1 -1
- package/dist/cli/commands/analytics/cost/usage-readers.js +147 -21
- package/dist/cli/commands/analytics/cost/usage-readers.js.map +1 -1
- package/dist/cli/commands/analytics/model-normalizer.d.ts +2 -0
- package/dist/cli/commands/analytics/model-normalizer.d.ts.map +1 -1
- package/dist/cli/commands/analytics/model-normalizer.js +8 -0
- package/dist/cli/commands/analytics/model-normalizer.js.map +1 -1
- package/dist/cli/commands/analytics/native-loader.d.ts.map +1 -1
- package/dist/cli/commands/analytics/native-loader.js +35 -0
- package/dist/cli/commands/analytics/native-loader.js.map +1 -1
- package/dist/cli/commands/analytics/report/client/app.js +685 -53
- package/dist/cli/commands/analytics/report/payload-builder.d.ts.map +1 -1
- package/dist/cli/commands/analytics/report/payload-builder.js +13 -0
- package/dist/cli/commands/analytics/report/payload-builder.js.map +1 -1
- package/dist/cli/commands/analytics/report/template.html +108 -8
- package/dist/cli/commands/analytics/report/types.d.ts +13 -2
- package/dist/cli/commands/analytics/report/types.d.ts.map +1 -1
- package/dist/cli/commands/analytics/types.d.ts +18 -0
- package/dist/cli/commands/analytics/types.d.ts.map +1 -1
- package/dist/cli/commands/hook.d.ts.map +1 -1
- package/dist/cli/commands/hook.js +24 -7
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/migrations/004-skills-assistants-top-level.migration.d.ts.map +1 -1
- package/dist/migrations/004-skills-assistants-top-level.migration.js +8 -5
- package/dist/migrations/004-skills-assistants-top-level.migration.js.map +1 -1
- package/dist/migrations/005-skill-slug-format.migration.d.ts.map +1 -1
- package/dist/migrations/005-skill-slug-format.migration.js +14 -11
- package/dist/migrations/005-skill-slug-format.migration.js.map +1 -1
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +2 -0
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/plugins/moonshot-subscription/index.d.ts +9 -0
- package/dist/providers/plugins/moonshot-subscription/index.d.ts.map +1 -0
- package/dist/providers/plugins/moonshot-subscription/index.js +9 -0
- package/dist/providers/plugins/moonshot-subscription/index.js.map +1 -0
- package/dist/providers/plugins/moonshot-subscription/moonshot-subscription.setup-steps.d.ts +8 -0
- package/dist/providers/plugins/moonshot-subscription/moonshot-subscription.setup-steps.d.ts.map +1 -0
- package/dist/providers/plugins/moonshot-subscription/moonshot-subscription.setup-steps.js +80 -0
- package/dist/providers/plugins/moonshot-subscription/moonshot-subscription.setup-steps.js.map +1 -0
- package/dist/providers/plugins/moonshot-subscription/moonshot-subscription.template.d.ts +11 -0
- package/dist/providers/plugins/moonshot-subscription/moonshot-subscription.template.d.ts.map +1 -0
- package/dist/providers/plugins/moonshot-subscription/moonshot-subscription.template.js +111 -0
- package/dist/providers/plugins/moonshot-subscription/moonshot-subscription.template.js.map +1 -0
- package/dist/providers/plugins/sso/proxy/plugins/index.d.ts +2 -1
- package/dist/providers/plugins/sso/proxy/plugins/index.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/index.js +3 -1
- package/dist/providers/plugins/sso/proxy/plugins/index.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/kimi-request-normalizer.plugin.d.ts +18 -0
- package/dist/providers/plugins/sso/proxy/plugins/kimi-request-normalizer.plugin.d.ts.map +1 -0
- package/dist/providers/plugins/sso/proxy/plugins/kimi-request-normalizer.plugin.js +56 -0
- package/dist/providers/plugins/sso/proxy/plugins/kimi-request-normalizer.plugin.js.map +1 -0
- package/dist/providers/plugins/sso/session/processors/conversations/constants.d.ts +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/constants.js +1 -1
- package/dist/providers/plugins/sso/sso.auth.d.ts +5 -0
- package/dist/providers/plugins/sso/sso.auth.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.auth.js +23 -1
- package/dist/providers/plugins/sso/sso.auth.js.map +1 -1
- package/dist/utils/config.d.ts +24 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +83 -8
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/native-installer.d.ts.map +1 -1
- package/dist/utils/native-installer.js +6 -3
- package/dist/utils/native-installer.js.map +1 -1
- package/package.json +5 -1
- package/scripts/copy-plugins.js +5 -0
- package/scripts/test-desktop-telemetry.js +1 -1
|
@@ -6,11 +6,14 @@ class SkillsAssistantsTopLevelMigration {
|
|
|
6
6
|
async up() {
|
|
7
7
|
const workingDir = process.cwd();
|
|
8
8
|
let migrated = false;
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const hasGlobal = await ConfigLoader.hasGlobalConfig();
|
|
10
|
+
if (hasGlobal) {
|
|
11
|
+
const globalConfig = await ConfigLoader.loadMultiProviderConfig();
|
|
12
|
+
const migratedGlobal = this.migrate(globalConfig);
|
|
13
|
+
if (migratedGlobal !== globalConfig) {
|
|
14
|
+
await ConfigLoader.saveMultiProviderConfig(migratedGlobal);
|
|
15
|
+
migrated = true;
|
|
16
|
+
}
|
|
14
17
|
}
|
|
15
18
|
const hasLocal = await ConfigLoader.hasProjectConfig(workingDir);
|
|
16
19
|
if (hasLocal) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"004-skills-assistants-top-level.migration.js","sourceRoot":"","sources":["../../src/migrations/004-skills-assistants-top-level.migration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,iCAAiC;IACrC,EAAE,GAAG,iCAAiC,CAAC;IACvC,WAAW,GAAG,iFAAiF,CAAC;IAEhG,KAAK,CAAC,EAAE;QACN,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QACjC,IAAI,QAAQ,GAAG,KAAK,CAAC;QAErB,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC,uBAAuB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"004-skills-assistants-top-level.migration.js","sourceRoot":"","sources":["../../src/migrations/004-skills-assistants-top-level.migration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,iCAAiC;IACrC,EAAE,GAAG,iCAAiC,CAAC;IACvC,WAAW,GAAG,iFAAiF,CAAC;IAEhG,KAAK,CAAC,EAAE;QACN,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QACjC,IAAI,QAAQ,GAAG,KAAK,CAAC;QAErB,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAC;QACvD,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC,uBAAuB,EAAE,CAAC;YAClE,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAClD,IAAI,cAAc,KAAK,YAAY,EAAE,CAAC;gBACpC,MAAM,YAAY,CAAC,uBAAuB,CAAC,cAAc,CAAC,CAAC;gBAC3D,QAAQ,GAAG,IAAI,CAAC;YAClB,CAAC;QACH,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,gBAAgB,CAAC,UAAU,CAAC,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/005-skill-slug-format.migration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAS7D,cAAM,wBAAyB,YAAW,SAAS;IACjD,EAAE,SAA2B;IAC7B,WAAW,SAAiF;IAEtF,EAAE,IAAI,OAAO,CAAC,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"005-skill-slug-format.migration.d.ts","sourceRoot":"","sources":["../../src/migrations/005-skill-slug-format.migration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAS7D,cAAM,wBAAyB,YAAW,SAAS;IACjD,EAAE,SAA2B;IAC7B,WAAW,SAAiF;IAEtF,EAAE,IAAI,OAAO,CAAC,eAAe,CAAC;YA0CtB,iBAAiB;IAwC/B,OAAO,CAAC,cAAc;CAKvB;AAID,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -13,17 +13,20 @@ class SkillSlugFormatMigration {
|
|
|
13
13
|
async up() {
|
|
14
14
|
const workingDir = process.cwd();
|
|
15
15
|
let migrated = false;
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
await
|
|
26
|
-
|
|
16
|
+
const hasGlobal = await ConfigLoader.hasGlobalConfig();
|
|
17
|
+
if (hasGlobal) {
|
|
18
|
+
const globalConfig = await ConfigLoader.loadMultiProviderConfig();
|
|
19
|
+
const hasProfileLevelSkills = Object.values(globalConfig.profiles).some(p => p.codemieSkills?.length > 0);
|
|
20
|
+
if (hasProfileLevelSkills && !globalConfig.codemieSkills?.length) {
|
|
21
|
+
throw new ConfigurationError('005-skill-slug-format migration requires migration 004 (move-skills-to-top-level) to have run first. ' +
|
|
22
|
+
'Skills are still stored inside profiles rather than at the top-level config.');
|
|
23
|
+
}
|
|
24
|
+
const globalSkillsDir = path.join(os.homedir(), '.claude', 'skills');
|
|
25
|
+
const { config: migratedGlobal, changed: globalChanged } = await this.migrateSkillSlugs(globalConfig, StorageScope.GLOBAL, globalSkillsDir);
|
|
26
|
+
if (globalChanged) {
|
|
27
|
+
await ConfigLoader.saveMultiProviderConfig(migratedGlobal);
|
|
28
|
+
migrated = true;
|
|
29
|
+
}
|
|
27
30
|
}
|
|
28
31
|
const hasLocal = await ConfigLoader.hasProjectConfig(workingDir);
|
|
29
32
|
if (hasLocal) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"005-skill-slug-format.migration.js","sourceRoot":"","sources":["../../src/migrations/005-skill-slug-format.migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,MAAM,wBAAwB;IAC5B,EAAE,GAAG,uBAAuB,CAAC;IAC7B,WAAW,GAAG,6EAA6E,CAAC;IAE5F,KAAK,CAAC,EAAE;QACN,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QACjC,IAAI,QAAQ,GAAG,KAAK,CAAC;QAErB,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC,uBAAuB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"005-skill-slug-format.migration.js","sourceRoot":"","sources":["../../src/migrations/005-skill-slug-format.migration.ts"],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AI,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACpE,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/E,OAAO,GAAG,IAAI,GAAG,aAAa,IAAI,KAAK,EAAE,CAAC;IAC5C,CAAC;CACF;AAED,MAAM,SAAS,GAAG,IAAI,wBAAwB,EAAE,CAAC;AACjD,iBAAiB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -17,10 +17,12 @@ import './plugins/jwt/index.js';
|
|
|
17
17
|
import './plugins/litellm/index.js';
|
|
18
18
|
import './plugins/bedrock/index.js';
|
|
19
19
|
import './plugins/anthropic-subscription/index.js';
|
|
20
|
+
import './plugins/moonshot-subscription/index.js';
|
|
20
21
|
export * as Ollama from './plugins/ollama/index.js';
|
|
21
22
|
export * as SSO from './plugins/sso/index.js';
|
|
22
23
|
export * as JWT from './plugins/jwt/index.js';
|
|
23
24
|
export * as LiteLLM from './plugins/litellm/index.js';
|
|
24
25
|
export * as Bedrock from './plugins/bedrock/index.js';
|
|
25
26
|
export * as AnthropicSubscription from './plugins/anthropic-subscription/index.js';
|
|
27
|
+
export * as MoonshotSubscription from './plugins/moonshot-subscription/index.js';
|
|
26
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EACjB,iBAA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;AACnC,OAAO,wBAAwB,CAAC;AAChC,OAAO,wBAAwB,CAAC;AAChC,OAAO,4BAA4B,CAAC;AACpC,OAAO,4BAA4B,CAAC;AACpC,OAAO,2CAA2C,CAAC;AACnD,OAAO,0CAA0C,CAAC;AAGlD,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,KAAK,GAAG,MAAM,wBAAwB,CAAC;AAC9C,OAAO,KAAK,GAAG,MAAM,wBAAwB,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,qBAAqB,MAAM,2CAA2C,CAAC;AACnF,OAAO,KAAK,oBAAoB,MAAM,0CAA0C,CAAC"}
|
package/dist/providers/index.js
CHANGED
|
@@ -18,6 +18,7 @@ import './plugins/jwt/index.js';
|
|
|
18
18
|
import './plugins/litellm/index.js';
|
|
19
19
|
import './plugins/bedrock/index.js';
|
|
20
20
|
import './plugins/anthropic-subscription/index.js';
|
|
21
|
+
import './plugins/moonshot-subscription/index.js';
|
|
21
22
|
// Re-export plugin modules for direct access if needed
|
|
22
23
|
export * as Ollama from './plugins/ollama/index.js';
|
|
23
24
|
export * as SSO from './plugins/sso/index.js';
|
|
@@ -25,4 +26,5 @@ export * as JWT from './plugins/jwt/index.js';
|
|
|
25
26
|
export * as LiteLLM from './plugins/litellm/index.js';
|
|
26
27
|
export * as Bedrock from './plugins/bedrock/index.js';
|
|
27
28
|
export * as AnthropicSubscription from './plugins/anthropic-subscription/index.js';
|
|
29
|
+
export * as MoonshotSubscription from './plugins/moonshot-subscription/index.js';
|
|
28
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAe;AACf,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC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AAK,qBAAqB,MAAM,2CAA2C,CAAC;AACnF,OAAO,KAAK,oBAAoB,MAAM,0CAA0C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Moonshot Subscription Provider - Complete Provider Implementation
|
|
3
|
+
*
|
|
4
|
+
* Native Kimi Code authentication via an existing Moonshot subscription.
|
|
5
|
+
* Auto-registers with ProviderRegistry on import.
|
|
6
|
+
*/
|
|
7
|
+
export { MoonshotSubscriptionTemplate } from './moonshot-subscription.template.js';
|
|
8
|
+
export { MoonshotSubscriptionSetupSteps } from './moonshot-subscription.setup-steps.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/providers/plugins/moonshot-subscription/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Moonshot Subscription Provider - Complete Provider Implementation
|
|
3
|
+
*
|
|
4
|
+
* Native Kimi Code authentication via an existing Moonshot subscription.
|
|
5
|
+
* Auto-registers with ProviderRegistry on import.
|
|
6
|
+
*/
|
|
7
|
+
export { MoonshotSubscriptionTemplate } from './moonshot-subscription.template.js';
|
|
8
|
+
export { MoonshotSubscriptionSetupSteps } from './moonshot-subscription.setup-steps.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/providers/plugins/moonshot-subscription/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Moonshot Subscription Setup Steps
|
|
3
|
+
*
|
|
4
|
+
* Interactive setup flow for native Kimi Code authentication.
|
|
5
|
+
*/
|
|
6
|
+
import type { ProviderSetupSteps } from '../../core/types.js';
|
|
7
|
+
export declare const MoonshotSubscriptionSetupSteps: ProviderSetupSteps;
|
|
8
|
+
//# sourceMappingURL=moonshot-subscription.setup-steps.d.ts.map
|
package/dist/providers/plugins/moonshot-subscription/moonshot-subscription.setup-steps.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moonshot-subscription.setup-steps.d.ts","sourceRoot":"","sources":["../../../../src/providers/plugins/moonshot-subscription/moonshot-subscription.setup-steps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAuB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAcnF,eAAO,MAAM,8BAA8B,EAAE,kBA0F5C,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Moonshot Subscription Setup Steps
|
|
3
|
+
*
|
|
4
|
+
* Interactive setup flow for native Kimi Code authentication.
|
|
5
|
+
*/
|
|
6
|
+
import inquirer from 'inquirer';
|
|
7
|
+
import { ProviderRegistry } from '../../core/registry.js';
|
|
8
|
+
import { logger } from '../../../utils/logger.js';
|
|
9
|
+
import { ConfigurationError } from '../../../utils/errors.js';
|
|
10
|
+
import { MoonshotSubscriptionTemplate } from './moonshot-subscription.template.js';
|
|
11
|
+
import { DEFAULT_CODEMIE_BASE_URL, authenticateWithCodeMie, promptForCodeMieUrl, selectCodeMieProject } from '../../core/codemie-auth-helpers.js';
|
|
12
|
+
import { commandExists } from '../../../utils/processes.js';
|
|
13
|
+
export const MoonshotSubscriptionSetupSteps = {
|
|
14
|
+
name: 'moonshot-subscription',
|
|
15
|
+
async getCredentials(_isUpdate = false) {
|
|
16
|
+
logger.info('Moonshot Subscription Setup');
|
|
17
|
+
logger.info('This provider uses Kimi Code native browser authentication.');
|
|
18
|
+
logger.info('CodeMie will not store a Moonshot API key for this profile.');
|
|
19
|
+
const kimiInstalled = await commandExists('kimi');
|
|
20
|
+
if (!kimiInstalled) {
|
|
21
|
+
throw new ConfigurationError('Kimi Code CLI (kimi) was not found on PATH. Install Kimi Code and authenticate before running this setup.');
|
|
22
|
+
}
|
|
23
|
+
logger.success('Kimi Code CLI detected');
|
|
24
|
+
const answers = await inquirer.prompt([
|
|
25
|
+
{
|
|
26
|
+
type: 'confirm',
|
|
27
|
+
name: 'enableCodeMieAnalytics',
|
|
28
|
+
message: 'Login to CodeMie platform to enable analytics sync?',
|
|
29
|
+
default: false
|
|
30
|
+
}
|
|
31
|
+
]);
|
|
32
|
+
let codeMieUrl;
|
|
33
|
+
let codeMieProject;
|
|
34
|
+
let userEmail;
|
|
35
|
+
if (answers.enableCodeMieAnalytics) {
|
|
36
|
+
codeMieUrl = await promptForCodeMieUrl(DEFAULT_CODEMIE_BASE_URL, 'CodeMie platform URL for analytics sync:');
|
|
37
|
+
logger.info('Authenticating to CodeMie platform...');
|
|
38
|
+
const authResult = await authenticateWithCodeMie(codeMieUrl, 120000);
|
|
39
|
+
if (!authResult.success) {
|
|
40
|
+
throw new ConfigurationError(`CodeMie authentication failed: ${authResult.error || 'Unknown error'}`);
|
|
41
|
+
}
|
|
42
|
+
logger.success('CodeMie authentication successful');
|
|
43
|
+
logger.info('Fetching available projects...');
|
|
44
|
+
({ project: codeMieProject, userEmail } = await selectCodeMieProject(authResult));
|
|
45
|
+
logger.success('Analytics sync enabled for CodeMie platform');
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
baseUrl: MoonshotSubscriptionTemplate.defaultBaseUrl,
|
|
49
|
+
apiKey: '',
|
|
50
|
+
additionalConfig: {
|
|
51
|
+
authMethod: 'manual',
|
|
52
|
+
codeMieUrl,
|
|
53
|
+
codeMieProject,
|
|
54
|
+
userEmail
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
async fetchModels(_credentials) {
|
|
59
|
+
return [...MoonshotSubscriptionTemplate.recommendedModels];
|
|
60
|
+
},
|
|
61
|
+
async selectModel(credentials, models) {
|
|
62
|
+
if (credentials.additionalConfig?.codeMieUrl) {
|
|
63
|
+
return models[0] || MoonshotSubscriptionTemplate.recommendedModels[0] || null;
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
},
|
|
67
|
+
buildConfig(credentials, selectedModel) {
|
|
68
|
+
return {
|
|
69
|
+
provider: 'moonshot-subscription',
|
|
70
|
+
baseUrl: credentials.baseUrl || MoonshotSubscriptionTemplate.defaultBaseUrl,
|
|
71
|
+
apiKey: '',
|
|
72
|
+
model: selectedModel,
|
|
73
|
+
authMethod: 'manual',
|
|
74
|
+
codeMieUrl: credentials.additionalConfig?.codeMieUrl,
|
|
75
|
+
codeMieProject: credentials.additionalConfig?.codeMieProject,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
ProviderRegistry.registerSetupSteps('moonshot-subscription', MoonshotSubscriptionSetupSteps);
|
|
80
|
+
//# sourceMappingURL=moonshot-subscription.setup-steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moonshot-subscription.setup-steps.js","sourceRoot":"","sources":["../../../../src/providers/plugins/moonshot-subscription/moonshot-subscription.setup-steps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EACL,wBAAwB,EACxB,uBAAuB,E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8BAA8B,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Moonshot Subscription Provider Template
|
|
3
|
+
*
|
|
4
|
+
* Template definition for native Kimi Code authentication using
|
|
5
|
+
* an existing Moonshot subscription login.
|
|
6
|
+
*
|
|
7
|
+
* Auto-registers on import via registerProvider().
|
|
8
|
+
*/
|
|
9
|
+
import type { ProviderTemplate } from '../../core/types.js';
|
|
10
|
+
export declare const MoonshotSubscriptionTemplate: ProviderTemplate;
|
|
11
|
+
//# sourceMappingURL=moonshot-subscription.template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moonshot-subscription.template.d.ts","sourceRoot":"","sources":["../../../../src/providers/plugins/moonshot-subscription/moonshot-subscription.template.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAK5D,eAAO,MAAM,4BAA4B,kBA+GvC,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Moonshot Subscription Provider Template
|
|
3
|
+
*
|
|
4
|
+
* Template definition for native Kimi Code authentication using
|
|
5
|
+
* an existing Moonshot subscription login.
|
|
6
|
+
*
|
|
7
|
+
* Auto-registers on import via registerProvider().
|
|
8
|
+
*/
|
|
9
|
+
import { registerProvider } from '../../core/decorators.js';
|
|
10
|
+
import { ensureApiBase } from '../../core/codemie-auth-helpers.js';
|
|
11
|
+
export const MoonshotSubscriptionTemplate = registerProvider({
|
|
12
|
+
name: 'moonshot-subscription',
|
|
13
|
+
displayName: 'Moonshot Subscription',
|
|
14
|
+
description: 'Native Kimi Code CLI authentication using your Moonshot subscription',
|
|
15
|
+
defaultBaseUrl: 'https://api.moonshot.ai/v1',
|
|
16
|
+
requiresAuth: false,
|
|
17
|
+
authType: 'none',
|
|
18
|
+
priority: 16,
|
|
19
|
+
defaultProfileName: 'moonshot-subscription',
|
|
20
|
+
recommendedModels: ['kimi-for-coding', 'kimi-k2'],
|
|
21
|
+
capabilities: ['streaming', 'tools', 'function-calling', 'vision'],
|
|
22
|
+
supportsModelInstallation: false,
|
|
23
|
+
supportsStreaming: true,
|
|
24
|
+
agentHooks: {
|
|
25
|
+
'*': {
|
|
26
|
+
async beforeRun(env, config) {
|
|
27
|
+
if (config.agent !== 'kimi') {
|
|
28
|
+
return env;
|
|
29
|
+
}
|
|
30
|
+
// Return a copy so callers that hold a reference to the original env are not affected.
|
|
31
|
+
const updated = { ...env };
|
|
32
|
+
// Native Kimi subscription auth relies on Kimi Code's stored login in
|
|
33
|
+
// ~/.kimi-code/config.toml. Explicit Moonshot API/proxy env vars override
|
|
34
|
+
// that flow and can cause 401s.
|
|
35
|
+
delete updated.KIMI_MODEL_API_KEY;
|
|
36
|
+
delete updated.KIMI_MODEL_BASE_URL;
|
|
37
|
+
delete updated.KIMI_MODEL_NAME;
|
|
38
|
+
// Inject CodeMie lifecycle hooks into Kimi config so local metrics and
|
|
39
|
+
// conversation files are produced even though model traffic is not
|
|
40
|
+
// proxied through CodeMie.
|
|
41
|
+
//
|
|
42
|
+
// Dynamic import avoids a circular dependency: AgentRegistry imports all
|
|
43
|
+
// plugins (including this provider template) as side effects, so a
|
|
44
|
+
// static top-level import here would form a cycle. The dynamic import
|
|
45
|
+
// defers resolution until runtime when the registry is fully initialised.
|
|
46
|
+
try {
|
|
47
|
+
const { AgentRegistry } = await import('../../../agents/registry.js');
|
|
48
|
+
const { KimiHookConfigInjector } = await import('../../../agents/plugins/kimi/kimi.hook-config-injector.js');
|
|
49
|
+
const agent = AgentRegistry.getAgent('kimi');
|
|
50
|
+
if (!agent) {
|
|
51
|
+
const { logger } = await import('../../../utils/logger.js');
|
|
52
|
+
logger.warn('[moonshot-subscription] Kimi agent not found in registry; skipping hook injection');
|
|
53
|
+
logger.warn('[moonshot-subscription] Continuing without hooks - metrics may not be captured');
|
|
54
|
+
return updated;
|
|
55
|
+
}
|
|
56
|
+
const injector = new KimiHookConfigInjector();
|
|
57
|
+
const result = await injector.inject();
|
|
58
|
+
if (!result.success) {
|
|
59
|
+
const { logger } = await import('../../../utils/logger.js');
|
|
60
|
+
logger.warn(`[moonshot-subscription] Hook injection returned failure: ${result.error || 'unknown error'}`);
|
|
61
|
+
logger.warn('[moonshot-subscription] Continuing without hooks - metrics may not be captured');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
const { logger } = await import('../../../utils/logger.js');
|
|
66
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
67
|
+
logger.error(`[moonshot-subscription] Hook injection threw exception: ${errorMsg}`);
|
|
68
|
+
logger.warn('[moonshot-subscription] Continuing without hooks - metrics may not be captured');
|
|
69
|
+
}
|
|
70
|
+
return updated;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
// Kimi Code should use its own stored login/session instead of a placeholder token.
|
|
75
|
+
exportEnvVars: (config) => {
|
|
76
|
+
const env = {
|
|
77
|
+
CODEMIE_API_KEY: ''
|
|
78
|
+
};
|
|
79
|
+
if (config.codeMieUrl) {
|
|
80
|
+
env.CODEMIE_URL = config.codeMieUrl;
|
|
81
|
+
env.CODEMIE_SYNC_API_URL = ensureApiBase(config.codeMieUrl);
|
|
82
|
+
}
|
|
83
|
+
if (config.codeMieProject) {
|
|
84
|
+
env.CODEMIE_PROJECT = config.codeMieProject;
|
|
85
|
+
}
|
|
86
|
+
return env;
|
|
87
|
+
},
|
|
88
|
+
setupInstructions: `
|
|
89
|
+
# Moonshot Subscription Setup Instructions
|
|
90
|
+
|
|
91
|
+
Use this option when Kimi Code is already authenticated with your Moonshot account
|
|
92
|
+
and you want CodeMie to use that native login flow directly.
|
|
93
|
+
|
|
94
|
+
## Prerequisites
|
|
95
|
+
|
|
96
|
+
1. Install Kimi Code
|
|
97
|
+
2. Authenticate Kimi Code with your Moonshot subscription
|
|
98
|
+
|
|
99
|
+
\`\`\`bash
|
|
100
|
+
kimi auth login
|
|
101
|
+
\`\`\`
|
|
102
|
+
|
|
103
|
+
## Notes
|
|
104
|
+
|
|
105
|
+
- No API key is stored in CodeMie for this provider
|
|
106
|
+
- Kimi Code uses its existing local authentication/session from \`~/.kimi-code/config.toml\`
|
|
107
|
+
- CodeMie injects lifecycle hooks into Kimi config to capture metrics locally
|
|
108
|
+
- This provider is intended for native \`kimi\` usage
|
|
109
|
+
`
|
|
110
|
+
});
|
|
111
|
+
//# sourceMappingURL=moonshot-subscription.template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moonshot-subscription.template.js","sourceRoot":"","sources":["../../../../src/providers/plugins/moonshot-subscription/moonshot-subscription.template.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnE,MAAM,CAAC,MAAM,4BAA4B,GAAG,gBAAgB,CAAmB;IAC7E,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,sEAAsE;IACnF,cAAc,EAAE,4BAA4B;IAC5C,YAAY,EAAE,KAAK;IACnB,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,EAAE;IACZ,kBAAkB,EAAE,uBAAuB;IAC3C,iBAAiB,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC;IACjD,YAAY,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,CAAC;IAClE,yBAAyB,EAAE,KAAK;IAChC,iBAAiB,EAAE,IAAI;IAEvB,UAAU,EAAE;QACV,GAAG,EAAE;YACH,KAAK,CAAC,SAAS,CAAC,GAAsB,EAAE,MAAmB;gBACzD,IAAI,MAAM,CAAC,KAAK,KAAK,MAAM,EAAE,CAAC;oBAC5B,OAAO,GAAG,CAAC;gBACb,CAAC;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CAAC,CAAC;oBAChG,CAAC;gBACH,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;oBAC5D,MAAM,QAAQ,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;oBACxE,MAAM,CAAC,KAAK,CAAC,2DAA2D,QAAQ,EAAE,CAAC,CAAC;oBACpF,MAAM,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;gBAChG,CAAC;gBAED,OAAO,OAAO,CAAC;YACjB,CAAC;SACF;KACF;IAED,oFAAoF;IACpF,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE;QACxB,MAAM,GAAG,GAA2B;YAClC,eAAe,EAAE,EAAE;SACpB,CAAC;QAEF,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;YACtB,GAAG,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;YACpC,GAAG,CAAC,oBAAoB,GAAG,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC9D,CAAC;QAED,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;YAC1B,GAAG,CAAC,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC;QAC9C,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;IAED,iBAAiB,EAAE;;;;;;;;;;;;;;;;;;;;;CAqBpB;CACA,CAAC,CAAC"}
|
|
@@ -12,6 +12,7 @@ import { JWTAuthPlugin } from "./jwt-auth.plugin.js";
|
|
|
12
12
|
import { HeaderInjectionPlugin } from "./header-injection.plugin.js";
|
|
13
13
|
import { RequestSanitizerPlugin } from "./request-sanitizer.plugin.js";
|
|
14
14
|
import { ClaudeRequestNormalizerPlugin } from "./claude-request-normalizer.plugin.js";
|
|
15
|
+
import { KimiRequestNormalizerPlugin } from "./kimi-request-normalizer.plugin.js";
|
|
15
16
|
import { CodexEncryptedContentSanitizerPlugin } from "./codex-encrypted-content-sanitizer.plugin.js";
|
|
16
17
|
import { LoggingPlugin } from "./logging.plugin.js";
|
|
17
18
|
/**
|
|
@@ -19,7 +20,7 @@ import { LoggingPlugin } from "./logging.plugin.js";
|
|
|
19
20
|
* Called at app startup
|
|
20
21
|
*/
|
|
21
22
|
export declare function registerCorePlugins(): void;
|
|
22
|
-
export { MCPAuthPlugin, EndpointBlockerPlugin, GatewayKeyPlugin, SSOAuthPlugin, JWTAuthPlugin, HeaderInjectionPlugin, RequestSanitizerPlugin, ClaudeRequestNormalizerPlugin, CodexEncryptedContentSanitizerPlugin, LoggingPlugin, };
|
|
23
|
+
export { MCPAuthPlugin, EndpointBlockerPlugin, GatewayKeyPlugin, SSOAuthPlugin, JWTAuthPlugin, HeaderInjectionPlugin, RequestSanitizerPlugin, ClaudeRequestNormalizerPlugin, KimiRequestNormalizerPlugin, CodexEncryptedContentSanitizerPlugin, LoggingPlugin, };
|
|
23
24
|
export { SSOSessionSyncPlugin } from "./sso.session-sync.plugin.js";
|
|
24
25
|
export { getPluginRegistry, resetPluginRegistry } from "./registry.js";
|
|
25
26
|
export * from "./types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/providers/plugins/sso/proxy/plugins/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AACrG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/providers/plugins/sso/proxy/plugins/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AACrG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAgB1C;AAMD,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,EAC3B,oCAAoC,EACpC,aAAa,GACd,CAAC;AACF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACvE,cAAc,YAAY,CAAC"}
|
|
@@ -13,6 +13,7 @@ import { JWTAuthPlugin } from "./jwt-auth.plugin.js";
|
|
|
13
13
|
import { HeaderInjectionPlugin } from "./header-injection.plugin.js";
|
|
14
14
|
import { RequestSanitizerPlugin } from "./request-sanitizer.plugin.js";
|
|
15
15
|
import { ClaudeRequestNormalizerPlugin } from "./claude-request-normalizer.plugin.js";
|
|
16
|
+
import { KimiRequestNormalizerPlugin } from "./kimi-request-normalizer.plugin.js";
|
|
16
17
|
import { CodexEncryptedContentSanitizerPlugin } from "./codex-encrypted-content-sanitizer.plugin.js";
|
|
17
18
|
import { LoggingPlugin } from "./logging.plugin.js";
|
|
18
19
|
import { SSOSessionSyncPlugin } from "./sso.session-sync.plugin.js";
|
|
@@ -29,6 +30,7 @@ export function registerCorePlugins() {
|
|
|
29
30
|
registry.register(new SSOAuthPlugin());
|
|
30
31
|
registry.register(new JWTAuthPlugin());
|
|
31
32
|
registry.register(new ClaudeRequestNormalizerPlugin()); // Priority 14 - normalizes thinking params for claude models
|
|
33
|
+
registry.register(new KimiRequestNormalizerPlugin()); // Priority 14 - caps Kimi output token requests for upstream limits
|
|
32
34
|
registry.register(new RequestSanitizerPlugin()); // Priority 15 - strips unsupported reasoning params
|
|
33
35
|
registry.register(new CodexEncryptedContentSanitizerPlugin()); // Priority 16 - strips encrypted reasoning state for Codex
|
|
34
36
|
registry.register(new HeaderInjectionPlugin());
|
|
@@ -38,7 +40,7 @@ export function registerCorePlugins() {
|
|
|
38
40
|
// Auto-register on import
|
|
39
41
|
registerCorePlugins();
|
|
40
42
|
// Re-export for convenience
|
|
41
|
-
export { MCPAuthPlugin, EndpointBlockerPlugin, GatewayKeyPlugin, SSOAuthPlugin, JWTAuthPlugin, HeaderInjectionPlugin, RequestSanitizerPlugin, ClaudeRequestNormalizerPlugin, CodexEncryptedContentSanitizerPlugin, LoggingPlugin, };
|
|
43
|
+
export { MCPAuthPlugin, EndpointBlockerPlugin, GatewayKeyPlugin, SSOAuthPlugin, JWTAuthPlugin, HeaderInjectionPlugin, RequestSanitizerPlugin, ClaudeRequestNormalizerPlugin, KimiRequestNormalizerPlugin, CodexEncryptedContentSanitizerPlugin, LoggingPlugin, };
|
|
42
44
|
export { SSOSessionSyncPlugin } from "./sso.session-sync.plugin.js";
|
|
43
45
|
export { getPluginRegistry, resetPluginRegistry } from "./registry.js";
|
|
44
46
|
export * from "./types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/providers/plugins/sso/proxy/plugins/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AACrG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,QAAQ,GAAG,iBAAiB,EAAE,CAAC;IAErC,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC,CAAC,s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AAQ,CAAC,QAAQ,CAAC,IAAI,2BAA2B,EAAE,CAAC,CAAC,CAAC,oEAAoE;IAC1H,QAAQ,CAAC,QAAQ,CAAC,IAAI,sBAAsB,EAAE,CAAC,CAAC,CAAC,oDAAoD;IACrG,QAAQ,CAAC,QAAQ,CAAC,IAAI,oCAAoC,EAAE,CAAC,CAAC,CAAC,2DAA2D;IAC1H,QAAQ,CAAC,QAAQ,CAAC,IAAI,qBAAqB,EAAE,CAAC,CAAC;IAC/C,QAAQ,CAAC,QAAQ,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC,CAAC,mDAAmD;IAC3F,QAAQ,CAAC,QAAQ,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC,CAAC,wDAAwD;AACzG,CAAC;AAED,0BAA0B;AAC1B,mBAAmB,EAAE,CAAC;AAEtB,4BAA4B;AAC5B,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,EAC3B,oCAAoC,EACpC,aAAa,GACd,CAAC;AACF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACvE,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kimi Request Normalizer Plugin
|
|
3
|
+
* Priority: 14 (runs before generic request sanitization)
|
|
4
|
+
*
|
|
5
|
+
* Kimi Code can request very large output token limits for long-context Kimi
|
|
6
|
+
* models. Some CodeMie upstream routes, especially Bedrock-backed deployments,
|
|
7
|
+
* reject those values before the model can respond. Cap output-token fields for
|
|
8
|
+
* Kimi clients while leaving other agents untouched.
|
|
9
|
+
*/
|
|
10
|
+
import { ProxyPlugin, PluginContext, ProxyInterceptor } from './types.js';
|
|
11
|
+
export declare class KimiRequestNormalizerPlugin implements ProxyPlugin {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
version: string;
|
|
15
|
+
priority: number;
|
|
16
|
+
createInterceptor(context: PluginContext): Promise<ProxyInterceptor>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=kimi-request-normalizer.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kimi-request-normalizer.plugin.d.ts","sourceRoot":"","sources":["../../../../../../src/providers/plugins/sso/proxy/plugins/kimi-request-normalizer.plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAQ1E,qBAAa,2BAA4B,YAAW,WAAW;IAC7D,EAAE,SAA4C;IAC9C,IAAI,SAA6B;IACjC,OAAO,SAAW;IAClB,QAAQ,SAAM;IAER,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAQ3E"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kimi Request Normalizer Plugin
|
|
3
|
+
* Priority: 14 (runs before generic request sanitization)
|
|
4
|
+
*
|
|
5
|
+
* Kimi Code can request very large output token limits for long-context Kimi
|
|
6
|
+
* models. Some CodeMie upstream routes, especially Bedrock-backed deployments,
|
|
7
|
+
* reject those values before the model can respond. Cap output-token fields for
|
|
8
|
+
* Kimi clients while leaving other agents untouched.
|
|
9
|
+
*/
|
|
10
|
+
import { logger } from '../../../../../utils/logger.js';
|
|
11
|
+
const ALLOWED_AGENTS = ['codemie-kimi', 'codemie-kimi-acp'];
|
|
12
|
+
const MAX_KIMI_OUTPUT_TOKENS = 64000;
|
|
13
|
+
const TOKEN_FIELDS = ['max_tokens', 'max_completion_tokens', 'maxTokens'];
|
|
14
|
+
export class KimiRequestNormalizerPlugin {
|
|
15
|
+
id = '@codemie/proxy-kimi-request-normalizer';
|
|
16
|
+
name = 'Kimi Request Normalizer';
|
|
17
|
+
version = '1.0.0';
|
|
18
|
+
priority = 14;
|
|
19
|
+
async createInterceptor(context) {
|
|
20
|
+
const clientType = context.config.clientType;
|
|
21
|
+
if (!clientType || !ALLOWED_AGENTS.includes(clientType)) {
|
|
22
|
+
throw new Error(`Plugin disabled for agent: ${clientType}`);
|
|
23
|
+
}
|
|
24
|
+
return new KimiRequestNormalizerInterceptor();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
class KimiRequestNormalizerInterceptor {
|
|
28
|
+
name = 'kimi-request-normalizer';
|
|
29
|
+
async onRequest(context) {
|
|
30
|
+
if (!context.requestBody || !context.headers['content-type']?.includes('application/json')) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
const bodyStr = context.requestBody.toString('utf-8');
|
|
35
|
+
const body = JSON.parse(bodyStr);
|
|
36
|
+
const capped = [];
|
|
37
|
+
for (const field of TOKEN_FIELDS) {
|
|
38
|
+
if (typeof body[field] === 'number' && body[field] > MAX_KIMI_OUTPUT_TOKENS) {
|
|
39
|
+
body[field] = MAX_KIMI_OUTPUT_TOKENS;
|
|
40
|
+
capped.push(field);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (capped.length === 0) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const newBodyStr = JSON.stringify(body);
|
|
47
|
+
context.requestBody = Buffer.from(newBodyStr, 'utf-8');
|
|
48
|
+
context.headers['content-length'] = String(context.requestBody.length);
|
|
49
|
+
logger.debug(`[${this.name}] Capped output token fields to ${MAX_KIMI_OUTPUT_TOKENS}: ${capped.join(', ')}`);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// Not valid JSON or unexpected structure — pass through unchanged.
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=kimi-request-normalizer.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kimi-request-normalizer.plugin.js","sourceRoot":"","sources":["../../../../../../src/providers/plugins/sso/proxy/plugins/kimi-request-normalizer.plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAExD,MAAM,cAAc,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;AAC5D,MAAM,sBAAsB,GAAG,KAAK,CAAC;AACrC,MAAM,YAAY,GAAG,CAAC,YAAY,EAAE,uBAAuB,EAAE,WAAW,CAAC,CAAC;AAE1E,MAAM,OAAO,2BAA2B;IACtC,EAAE,GAAG,wCAAwC,CAAC;IAC9C,IAAI,GAAG,yBAAyB,CAAC;IACjC,OAAO,GAAG,OAAO,CAAC;IAClB,QAAQ,GAAG,EAAE,CAAC;IAEd,KAAK,CAAC,iBAAiB,CAAC,OAAsB;QAC5C,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;QAC7C,IAAI,CAAC,UAAU,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YACxD,MAAM,IAAI,KAAK,CAAC,8BAA8B,UAAU,EAAE,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO,IAAI,gCAAgC,EAAE,CAAC;IAChD,CAAC;CACF;AAED,MAAM,gCAAgC;IACpC,IAAI,GAAG,yBAAyB,CAAC;IAEjC,KAAK,CAAC,SAAS,CAAC,OAAqB;QACnC,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;YAC3F,OAAO;QACT,CAAC;QAED,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACtD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACjC,MAAM,MAAM,GAAa,EAAE,CAAC;YAE5B,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE,CAAC;gBACjC,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,sBAAsB,EAAE,CAAC;oBAC5E,IAAI,CAAC,KAAK,CAAC,GAAG,sBAAsB,CAAC;oBACrC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACrB,CAAC;YACH,CAAC;YAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACxB,OAAO;YACT,CAAC;YAED,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACxC,OAAO,CAAC,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YACvD,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAEvE,MAAM,CAAC,KAAK,CACV,IAAI,IAAI,CAAC,IAAI,mCAAmC,sBAAsB,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC/F,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,mEAAmE;QACrE,CAAC;IACH,CAAC;CACF"}
|
|
@@ -14,7 +14,7 @@ export declare const CODEMIE_ASSISTANT_ID: string;
|
|
|
14
14
|
/** API endpoint path for conversation history */
|
|
15
15
|
export declare const CONVERSATIONS_API_PATH = "v1/conversations";
|
|
16
16
|
/** Default folder name for imported conversations */
|
|
17
|
-
export declare const DEFAULT_CONVERSATION_FOLDER = "Claude
|
|
17
|
+
export declare const DEFAULT_CONVERSATION_FOLDER = "Claude Desktop";
|
|
18
18
|
/** HTTP status codes that should NOT trigger retry logic */
|
|
19
19
|
export declare const NON_RETRYABLE_HTTP_CODES: readonly [400, 401, 403, 422];
|
|
20
20
|
/** Priority of conversation sync processor (lower runs first) */
|
|
@@ -20,7 +20,7 @@ export const CODEMIE_ASSISTANT_ID = process.env.CODEMIE_CONVERSATION_ASSISTANT_I
|
|
|
20
20
|
/** API endpoint path for conversation history */
|
|
21
21
|
export const CONVERSATIONS_API_PATH = 'v1/conversations';
|
|
22
22
|
/** Default folder name for imported conversations */
|
|
23
|
-
export const DEFAULT_CONVERSATION_FOLDER = 'Claude
|
|
23
|
+
export const DEFAULT_CONVERSATION_FOLDER = 'Claude Desktop';
|
|
24
24
|
// ============================================================================
|
|
25
25
|
// HTTP Status Codes
|
|
26
26
|
// ============================================================================
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
* Manages credential storage and session lifecycle.
|
|
6
6
|
*/
|
|
7
7
|
import type { SSOAuthConfig, SSOAuthResult, SSOCredentials } from '../../core/types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Derive credential expiresAt from codemie_access_token JWT exp claim.
|
|
10
|
+
* Falls back to 24h when the cookie is absent or the JWT cannot be decoded.
|
|
11
|
+
*/
|
|
12
|
+
export declare function deriveExpiresAt(cookies: Record<string, string>): number;
|
|
8
13
|
/**
|
|
9
14
|
* CodeMie SSO Authentication
|
|
10
15
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sso.auth.d.ts","sourceRoot":"","sources":["../../../../src/providers/plugins/sso/sso.auth.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA0BxF;;;;GAIG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,OAAO,CAAC,UAAU,CAAU;IAC5B,OAAO,CAAC,eAAe,CAAC,CAAkB;IAC1C,OAAO,CAAC,gBAAgB,CAAS;IAEjC;;OAEG;I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