@codemieai/code 0.0.36 → 0.0.38
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 +33 -0
- package/dist/agents/codemie-code/tools/assistant-invocation.d.ts.map +1 -1
- package/dist/agents/codemie-code/tools/assistant-invocation.js +2 -2
- package/dist/agents/codemie-code/tools/assistant-invocation.js.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.js +23 -9
- package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
- package/dist/agents/core/extension/BaseExtensionInstaller.d.ts.map +1 -1
- package/dist/agents/core/extension/BaseExtensionInstaller.js +11 -4
- package/dist/agents/core/extension/BaseExtensionInstaller.js.map +1 -1
- package/dist/agents/core/session/BaseProcessor.d.ts +22 -1
- package/dist/agents/core/session/BaseProcessor.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude-acp.plugin.d.ts +5 -0
- package/dist/agents/plugins/claude/claude-acp.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude-acp.plugin.js +12 -2
- package/dist/agents/plugins/claude/claude-acp.plugin.js.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts +11 -0
- package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +59 -2
- package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
- package/dist/agents/plugins/claude/claude.session.d.ts +5 -0
- package/dist/agents/plugins/claude/claude.session.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.session.js +101 -2
- package/dist/agents/plugins/claude/claude.session.js.map +1 -1
- package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/agents/plugins/claude/plugin/commands/README.md +103 -22
- package/dist/agents/plugins/claude/plugin/commands/memory-refresh.md +329 -18
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts +0 -1
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js +13 -19
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js.map +1 -1
- 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 +29 -4
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js.map +1 -1
- package/dist/cli/commands/assistants/chat.js +9 -6
- package/dist/cli/commands/assistants/chat.js.map +1 -1
- package/dist/cli/commands/assistants/constants.d.ts +2 -6
- package/dist/cli/commands/assistants/constants.d.ts.map +1 -1
- package/dist/cli/commands/assistants/constants.js +2 -5
- package/dist/cli/commands/assistants/constants.js.map +1 -1
- package/dist/cli/commands/assistants/index.d.ts.map +1 -1
- package/dist/cli/commands/assistants/index.js +1 -11
- package/dist/cli/commands/assistants/index.js.map +1 -1
- package/dist/cli/commands/assistants/setup/configuration/actions.d.ts +30 -0
- package/dist/cli/commands/assistants/setup/configuration/actions.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/actions.js +63 -0
- package/dist/cli/commands/assistants/setup/configuration/actions.js.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/constants.d.ts +49 -0
- package/dist/cli/commands/assistants/setup/configuration/constants.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/constants.js +56 -0
- package/dist/cli/commands/assistants/setup/configuration/constants.js.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/index.d.ts +9 -0
- package/dist/cli/commands/assistants/setup/configuration/index.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/index.js +8 -0
- package/dist/cli/commands/assistants/setup/configuration/index.js.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/selection.d.ts +12 -0
- package/dist/cli/commands/assistants/setup/configuration/selection.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/selection.js +94 -0
- package/dist/cli/commands/assistants/setup/configuration/selection.js.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/types.d.ts +22 -0
- package/dist/cli/commands/assistants/setup/configuration/types.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/types.js +2 -0
- package/dist/cli/commands/assistants/setup/configuration/types.js.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/ui.d.ts +9 -0
- package/dist/cli/commands/assistants/setup/configuration/ui.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/ui.js +86 -0
- package/dist/cli/commands/assistants/setup/configuration/ui.js.map +1 -0
- package/dist/cli/commands/assistants/setup/constants.d.ts +26 -0
- package/dist/cli/commands/assistants/setup/constants.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/constants.js +21 -0
- package/dist/cli/commands/assistants/setup/constants.js.map +1 -0
- package/dist/cli/commands/assistants/setup/data.d.ts +30 -0
- package/dist/cli/commands/assistants/setup/data.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/data.js +125 -0
- package/dist/cli/commands/assistants/setup/data.js.map +1 -0
- package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.d.ts.map +1 -0
- package/dist/cli/commands/assistants/{generators → setup/generators}/claude-agent-generator.js +6 -2
- package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.js.map +1 -0
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.d.ts +12 -0
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js +94 -0
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js.map +1 -0
- package/dist/cli/commands/assistants/setup/helpers.d.ts +27 -0
- package/dist/cli/commands/assistants/setup/helpers.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/helpers.js +94 -0
- package/dist/cli/commands/assistants/setup/helpers.js.map +1 -0
- package/dist/cli/commands/assistants/setup/index.d.ts +17 -0
- package/dist/cli/commands/assistants/setup/index.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/index.js +193 -0
- package/dist/cli/commands/assistants/setup/index.js.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/actions.d.ts +47 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/actions.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/actions.js +140 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/actions.js.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/constants.d.ts +56 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/constants.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/constants.js +61 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/constants.js.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/index.d.ts +12 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/index.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/index.js +48 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/index.js.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/interactive-prompt.d.ts +6 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/interactive-prompt.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/interactive-prompt.js +90 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/interactive-prompt.js.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/types.d.ts +37 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/types.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/types.js +2 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/types.js.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/ui.d.ts +6 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/ui.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/ui.js +103 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/ui.js.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/actions.d.ts +31 -0
- package/dist/cli/commands/assistants/setup/selection/actions.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/actions.js +321 -0
- package/dist/cli/commands/assistants/setup/selection/actions.js.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/constants.d.ts +79 -0
- package/dist/cli/commands/assistants/setup/selection/constants.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/constants.js +90 -0
- package/dist/cli/commands/assistants/setup/selection/constants.js.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/index.d.ts +25 -0
- package/dist/cli/commands/assistants/setup/selection/index.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/index.js +127 -0
- package/dist/cli/commands/assistants/setup/selection/index.js.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.d.ts +20 -0
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js +328 -0
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/types.d.ts +27 -0
- package/dist/cli/commands/assistants/setup/selection/types.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/types.js +2 -0
- package/dist/cli/commands/assistants/setup/selection/types.js.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/ui.d.ts +11 -0
- package/dist/cli/commands/assistants/setup/selection/ui.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/ui.js +189 -0
- package/dist/cli/commands/assistants/setup/selection/ui.js.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/utils.d.ts +36 -0
- package/dist/cli/commands/assistants/setup/selection/utils.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/utils.js +55 -0
- package/dist/cli/commands/assistants/setup/selection/utils.js.map +1 -0
- package/dist/cli/commands/assistants/setup/summary/index.d.ts +16 -0
- package/dist/cli/commands/assistants/setup/summary/index.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/summary/index.js +48 -0
- package/dist/cli/commands/assistants/setup/summary/index.js.map +1 -0
- package/dist/cli/commands/hook.d.ts +72 -0
- package/dist/cli/commands/hook.d.ts.map +1 -1
- package/dist/cli/commands/hook.js +290 -110
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/log/cleaner.d.ts +37 -0
- package/dist/cli/commands/log/cleaner.d.ts.map +1 -0
- package/dist/cli/commands/log/cleaner.js +218 -0
- package/dist/cli/commands/log/cleaner.js.map +1 -0
- package/dist/cli/commands/log/filter.d.ts +55 -0
- package/dist/cli/commands/log/filter.d.ts.map +1 -0
- package/dist/cli/commands/log/filter.js +128 -0
- package/dist/cli/commands/log/filter.js.map +1 -0
- package/dist/cli/commands/log/follower.d.ts +36 -0
- package/dist/cli/commands/log/follower.d.ts.map +1 -0
- package/dist/cli/commands/log/follower.js +151 -0
- package/dist/cli/commands/log/follower.js.map +1 -0
- package/dist/cli/commands/log/formatter.d.ts +76 -0
- package/dist/cli/commands/log/formatter.d.ts.map +1 -0
- package/dist/cli/commands/log/formatter.js +261 -0
- package/dist/cli/commands/log/formatter.js.map +1 -0
- package/dist/cli/commands/log/index.d.ts +6 -0
- package/dist/cli/commands/log/index.d.ts.map +1 -0
- package/dist/cli/commands/log/index.js +400 -0
- package/dist/cli/commands/log/index.js.map +1 -0
- package/dist/cli/commands/log/parser.d.ts +20 -0
- package/dist/cli/commands/log/parser.d.ts.map +1 -0
- package/dist/cli/commands/log/parser.js +111 -0
- package/dist/cli/commands/log/parser.js.map +1 -0
- package/dist/cli/commands/log/reader.d.ts +66 -0
- package/dist/cli/commands/log/reader.d.ts.map +1 -0
- package/dist/cli/commands/log/reader.js +364 -0
- package/dist/cli/commands/log/reader.js.map +1 -0
- package/dist/cli/commands/log/types.d.ts +100 -0
- package/dist/cli/commands/log/types.d.ts.map +1 -0
- package/dist/cli/commands/log/types.js +5 -0
- package/dist/cli/commands/log/types.js.map +1 -0
- package/dist/cli/commands/profile/display.d.ts +1 -0
- package/dist/cli/commands/profile/display.d.ts.map +1 -1
- package/dist/cli/commands/profile/display.js +10 -2
- package/dist/cli/commands/profile/display.js.map +1 -1
- package/dist/cli/commands/profile/index.js +58 -22
- package/dist/cli/commands/profile/index.js.map +1 -1
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +143 -24
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/env/types.d.ts +10 -1
- package/dist/env/types.d.ts.map +1 -1
- package/dist/env/types.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/providers/plugins/sso/session/SessionSyncer.d.ts +5 -0
- package/dist/providers/plugins/sso/session/SessionSyncer.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/SessionSyncer.js +102 -3
- package/dist/providers/plugins/sso/session/SessionSyncer.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.d.ts +0 -1
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.js +25 -48
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.js +8 -34
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.js.map +1 -1
- package/dist/utils/config.d.ts +35 -8
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +243 -33
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/logger.d.ts +8 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +42 -0
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/native-installer.d.ts +1 -0
- package/dist/utils/native-installer.d.ts.map +1 -1
- package/dist/utils/native-installer.js +21 -7
- package/dist/utils/native-installer.js.map +1 -1
- package/package.json +2 -2
- package/dist/agents/plugins/claude/plugin/commands/memory-add.md +0 -325
- package/dist/agents/plugins/claude/plugin/commands/memory-init.md +0 -18
- package/dist/cli/commands/assistants/generators/claude-agent-generator.d.ts.map +0 -1
- package/dist/cli/commands/assistants/generators/claude-agent-generator.js.map +0 -1
- package/dist/cli/commands/assistants/list.d.ts +0 -11
- package/dist/cli/commands/assistants/list.d.ts.map +0 -1
- package/dist/cli/commands/assistants/list.js +0 -323
- package/dist/cli/commands/assistants/list.js.map +0 -1
- /package/dist/cli/commands/assistants/{generators → setup/generators}/claude-agent-generator.d.ts +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -4,4 +4,9 @@ export { logger } from './utils/logger.js';
|
|
|
4
4
|
export { exec } from './utils/processes.js';
|
|
5
5
|
export * from './utils/errors.js';
|
|
6
6
|
export { EnvManager } from './env/manager.js';
|
|
7
|
+
export { CodeMieSSO } from './providers/plugins/sso/sso.auth.js';
|
|
8
|
+
export { CodeMieProxy } from './providers/plugins/sso/proxy/sso.proxy.js';
|
|
9
|
+
export { getPluginRegistry } from './providers/plugins/sso/proxy/plugins/index.js';
|
|
10
|
+
export { processEvent, HookProcessingConfig } from './cli/commands/hook.js';
|
|
11
|
+
export { ConfigLoader } from './utils/config.js';
|
|
7
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAG1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAGnF,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG5E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,4 +7,14 @@ export { exec } from './utils/processes.js';
|
|
|
7
7
|
export * from './utils/errors.js';
|
|
8
8
|
// Environment
|
|
9
9
|
export { EnvManager } from './env/manager.js';
|
|
10
|
+
// SSO Authentication
|
|
11
|
+
export { CodeMieSSO } from './providers/plugins/sso/sso.auth.js';
|
|
12
|
+
// Proxy
|
|
13
|
+
export { CodeMieProxy } from './providers/plugins/sso/proxy/sso.proxy.js';
|
|
14
|
+
// Proxy Plugins (for external plugin registration)
|
|
15
|
+
export { getPluginRegistry } from './providers/plugins/sso/proxy/plugins/index.js';
|
|
16
|
+
// Hook Event Processing (for programmatic usage)
|
|
17
|
+
export { processEvent } from './cli/commands/hook.js';
|
|
18
|
+
// Configuration
|
|
19
|
+
export { ConfigLoader } from './utils/config.js';
|
|
10
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC,SAAS;AACT,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,QAAQ;AACR,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAElC,cAAc;AACd,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC,SAAS;AACT,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,QAAQ;AACR,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAElC,cAAc;AACd,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,qBAAqB;AACrB,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEjE,QAAQ;AACR,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAE1E,mDAAmD;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAEnF,iDAAiD;AACjD,OAAO,EAAE,YAAY,EAAwB,MAAM,wBAAwB,CAAC;AAE5E,gBAAgB;AAChB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -23,6 +23,11 @@ export declare class SessionSyncer {
|
|
|
23
23
|
private sessionStore;
|
|
24
24
|
private processors;
|
|
25
25
|
constructor();
|
|
26
|
+
/**
|
|
27
|
+
* Apply processor sync updates to session metadata.
|
|
28
|
+
* Merges updates from all processors into session state.
|
|
29
|
+
*/
|
|
30
|
+
private applySyncUpdates;
|
|
26
31
|
/**
|
|
27
32
|
* Sync pending data to API
|
|
28
33
|
* Iterates through processors (same logic as plugin)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionSyncer.d.ts","sourceRoot":"","sources":["../../../../../src/providers/plugins/sso/session/SessionSyncer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAoB,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAO9H,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACnD,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,YAAY,CAAsB;IAC1C,OAAO,CAAC,UAAU,CAAqB;;IAUvC;;;;;;;OAOG;IACG,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"SessionSyncer.d.ts","sourceRoot":"","sources":["../../../../../src/providers/plugins/sso/session/SessionSyncer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAoB,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAO9H,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACnD,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,YAAY,CAAsB;IAC1C,OAAO,CAAC,UAAU,CAAqB;;IAUvC;;;OAGG;YACW,gBAAgB;IAyG9B;;;;;;;OAOG;IACG,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;CA2HtF"}
|
|
@@ -26,6 +26,99 @@ export class SessionSyncer {
|
|
|
26
26
|
new ConversationSyncProcessor()
|
|
27
27
|
].sort((a, b) => a.priority - b.priority);
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Apply processor sync updates to session metadata.
|
|
31
|
+
* Merges updates from all processors into session state.
|
|
32
|
+
*/
|
|
33
|
+
async applySyncUpdates(sessionId, results) {
|
|
34
|
+
try {
|
|
35
|
+
const session = await this.sessionStore.loadSession(sessionId);
|
|
36
|
+
if (!session) {
|
|
37
|
+
logger.warn(`[SessionSyncer] Session not found for sync updates: ${sessionId}`);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
for (const result of results) {
|
|
41
|
+
if (!result.metadata?.syncUpdates)
|
|
42
|
+
continue;
|
|
43
|
+
const { syncUpdates } = result.metadata;
|
|
44
|
+
// Apply metrics updates
|
|
45
|
+
if (syncUpdates.metrics) {
|
|
46
|
+
session.sync ??= {};
|
|
47
|
+
session.sync.metrics ??= {
|
|
48
|
+
lastProcessedTimestamp: Date.now(),
|
|
49
|
+
processedRecordIds: [],
|
|
50
|
+
totalDeltas: 0,
|
|
51
|
+
totalSynced: 0,
|
|
52
|
+
totalFailed: 0
|
|
53
|
+
};
|
|
54
|
+
// Merge processedRecordIds (deduplicate)
|
|
55
|
+
if (syncUpdates.metrics.processedRecordIds) {
|
|
56
|
+
const existing = new Set(session.sync.metrics.processedRecordIds || []);
|
|
57
|
+
for (const id of syncUpdates.metrics.processedRecordIds) {
|
|
58
|
+
existing.add(id);
|
|
59
|
+
}
|
|
60
|
+
session.sync.metrics.processedRecordIds = Array.from(existing);
|
|
61
|
+
}
|
|
62
|
+
// Update counters (increment, don't overwrite)
|
|
63
|
+
if (syncUpdates.metrics.totalDeltas !== undefined) {
|
|
64
|
+
session.sync.metrics.totalDeltas = syncUpdates.metrics.totalDeltas;
|
|
65
|
+
}
|
|
66
|
+
if (syncUpdates.metrics.totalSynced !== undefined) {
|
|
67
|
+
session.sync.metrics.totalSynced = (session.sync.metrics.totalSynced || 0) + syncUpdates.metrics.totalSynced;
|
|
68
|
+
}
|
|
69
|
+
if (syncUpdates.metrics.totalFailed !== undefined) {
|
|
70
|
+
session.sync.metrics.totalFailed = (session.sync.metrics.totalFailed || 0) + syncUpdates.metrics.totalFailed;
|
|
71
|
+
}
|
|
72
|
+
if (syncUpdates.metrics.lastProcessedTimestamp !== undefined) {
|
|
73
|
+
session.sync.metrics.lastProcessedTimestamp = syncUpdates.metrics.lastProcessedTimestamp;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Apply conversations updates
|
|
77
|
+
if (syncUpdates.conversations) {
|
|
78
|
+
session.sync ??= {};
|
|
79
|
+
session.sync.conversations ??= {
|
|
80
|
+
lastSyncedMessageUuid: undefined,
|
|
81
|
+
lastSyncedHistoryIndex: -1,
|
|
82
|
+
totalMessagesSynced: 0,
|
|
83
|
+
totalSyncAttempts: 0
|
|
84
|
+
};
|
|
85
|
+
// Update conversation tracking (latest wins)
|
|
86
|
+
if (syncUpdates.conversations.lastSyncedMessageUuid !== undefined) {
|
|
87
|
+
session.sync.conversations.lastSyncedMessageUuid =
|
|
88
|
+
syncUpdates.conversations.lastSyncedMessageUuid;
|
|
89
|
+
}
|
|
90
|
+
if (syncUpdates.conversations.lastSyncedHistoryIndex !== undefined) {
|
|
91
|
+
session.sync.conversations.lastSyncedHistoryIndex =
|
|
92
|
+
Math.max(session.sync.conversations.lastSyncedHistoryIndex ?? -1, syncUpdates.conversations.lastSyncedHistoryIndex);
|
|
93
|
+
}
|
|
94
|
+
if (syncUpdates.conversations.conversationId !== undefined) {
|
|
95
|
+
session.sync.conversations.conversationId = syncUpdates.conversations.conversationId;
|
|
96
|
+
}
|
|
97
|
+
if (syncUpdates.conversations.lastSyncAt !== undefined) {
|
|
98
|
+
session.sync.conversations.lastSyncAt = syncUpdates.conversations.lastSyncAt;
|
|
99
|
+
}
|
|
100
|
+
// Update counters (increment, don't overwrite)
|
|
101
|
+
if (syncUpdates.conversations.totalMessagesSynced !== undefined) {
|
|
102
|
+
session.sync.conversations.totalMessagesSynced =
|
|
103
|
+
(session.sync.conversations.totalMessagesSynced || 0) +
|
|
104
|
+
syncUpdates.conversations.totalMessagesSynced;
|
|
105
|
+
}
|
|
106
|
+
if (syncUpdates.conversations.totalSyncAttempts !== undefined) {
|
|
107
|
+
session.sync.conversations.totalSyncAttempts =
|
|
108
|
+
(session.sync.conversations.totalSyncAttempts || 0) +
|
|
109
|
+
syncUpdates.conversations.totalSyncAttempts;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// Persist session ONCE after all updates applied
|
|
114
|
+
await this.sessionStore.saveSession(session);
|
|
115
|
+
logger.debug(`[SessionSyncer] Session persisted after all processors completed`);
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
logger.error(`[SessionSyncer] Failed to apply sync updates:`, error);
|
|
119
|
+
throw error;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
29
122
|
/**
|
|
30
123
|
* Sync pending data to API
|
|
31
124
|
* Iterates through processors (same logic as plugin)
|
|
@@ -70,9 +163,10 @@ export class SessionSyncer {
|
|
|
70
163
|
}
|
|
71
164
|
};
|
|
72
165
|
logger.debug(`[SessionSyncer] Processing session ${sessionId} with ${this.processors.length} processor${this.processors.length !== 1 ? 's' : ''}`);
|
|
73
|
-
// 3. Iterate through processors
|
|
166
|
+
// 3. Iterate through processors and collect results
|
|
74
167
|
const processorResults = {};
|
|
75
168
|
const failedProcessors = [];
|
|
169
|
+
const allResults = [];
|
|
76
170
|
for (const processor of this.processors) {
|
|
77
171
|
try {
|
|
78
172
|
// Check if processor should run for this session
|
|
@@ -84,6 +178,7 @@ export class SessionSyncer {
|
|
|
84
178
|
// Process session
|
|
85
179
|
const result = await processor.process(emptySession, context);
|
|
86
180
|
processorResults[processor.name] = result;
|
|
181
|
+
allResults.push(result);
|
|
87
182
|
if (result.success) {
|
|
88
183
|
logger.debug(`[SessionSyncer] Processor ${processor.name} succeeded: ${result.message || 'OK'}`);
|
|
89
184
|
}
|
|
@@ -95,14 +190,18 @@ export class SessionSyncer {
|
|
|
95
190
|
catch (error) {
|
|
96
191
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
97
192
|
logger.error(`[SessionSyncer] Processor ${processor.name} threw error:`, error);
|
|
98
|
-
|
|
193
|
+
const failedResult = {
|
|
99
194
|
success: false,
|
|
100
195
|
message: errorMessage
|
|
101
196
|
};
|
|
197
|
+
processorResults[processor.name] = failedResult;
|
|
198
|
+
allResults.push(failedResult);
|
|
102
199
|
failedProcessors.push(processor.name);
|
|
103
200
|
}
|
|
104
201
|
}
|
|
105
|
-
// 4.
|
|
202
|
+
// 4. Apply all sync updates and persist session ONCE
|
|
203
|
+
await this.applySyncUpdates(sessionId, allResults);
|
|
204
|
+
// 5. Build result message
|
|
106
205
|
// Extract detailed stats
|
|
107
206
|
const parts = [];
|
|
108
207
|
const metricsResult = processorResults['metrics-sync'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionSyncer.js","sourceRoot":"","sources":["../../../../../src/providers/plugins/sso/session/SessionSyncer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2DAA2D,CAAC;AAStG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BAAgB,CAAC,CAAC;YAC7E,CAAC;YAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC;YACxD,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,KAAK,CAAC;gBAC3C,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,yBAAyB;gBAC7E,CAAC,CAAC,uBAAuB,gBAAgB,CAAC,MAAM,IAAI,UAAU,WAAW,CAAC;YAE5E,MAAM,CAAC,IAAI,CAAC,mBAAmB,OAAO,EAAE,CAAC,CAAC;YAE1C,OAAO;gBACL,OAAO,EAAE,gBAAgB,CAAC,MAAM,KAAK,CAAC;gBACtC,OAAO;gBACP,gBAAgB;gBAChB,gBAAgB;aACjB,CAAC;QAEJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5E,MAAM,CAAC,KAAK,CAAC,gCAAgC,YAAY,EAAE,CAAC,CAAC;YAC7D,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,YAAY;gBACrB,gBAAgB,EAAE,EAAE;gBACpB,gBAAgB,EAAE,EAAE;aACrB,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ import type { ParsedSession } from '../../BaseSessionAdapter.js';
|
|
|
15
15
|
export declare class ConversationSyncProcessor implements SessionProcessor {
|
|
16
16
|
readonly name = "conversation-sync";
|
|
17
17
|
readonly priority = 2;
|
|
18
|
-
private sessionStore;
|
|
19
18
|
private isSyncing;
|
|
20
19
|
shouldProcess(_session: ParsedSession): boolean;
|
|
21
20
|
process(session: ParsedSession, context: ProcessingContext): Promise<ProcessingResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-sync-processor.d.ts","sourceRoot":"","sources":["../../../../../../../src/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACpG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"conversation-sync-processor.d.ts","sourceRoot":"","sources":["../../../../../../../src/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACpG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAQjE,qBAAa,yBAA0B,YAAW,gBAAgB;IAChE,QAAQ,CAAC,IAAI,uBAAuB;IACpC,QAAQ,CAAC,QAAQ,KAAK;IAEtB,OAAO,CAAC,SAAS,CAAS;IAE1B,aAAa,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO;IAKzC,OAAO,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAsJ7F"}
|
package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.js
CHANGED
|
@@ -15,11 +15,9 @@ import { ConversationApiClient } from './conversation-api-client.js';
|
|
|
15
15
|
import { getSessionConversationPath } from '../../../../../../agents/core/session/session-config.js';
|
|
16
16
|
import { readJSONL } from '../../utils/jsonl-reader.js';
|
|
17
17
|
import { writeJSONLAtomic } from '../../utils/jsonl-writer.js';
|
|
18
|
-
import { SessionStore } from '../../../../../../agents/core/session/SessionStore.js';
|
|
19
18
|
export class ConversationSyncProcessor {
|
|
20
19
|
name = 'conversation-sync';
|
|
21
20
|
priority = 2; // Run after metrics (priority 1)
|
|
22
|
-
sessionStore = new SessionStore();
|
|
23
21
|
isSyncing = false; // Concurrency guard
|
|
24
22
|
shouldProcess(_session) {
|
|
25
23
|
// Always try to process - will check for pending payloads inside
|
|
@@ -90,54 +88,24 @@ export class ConversationSyncProcessor {
|
|
|
90
88
|
}
|
|
91
89
|
: p);
|
|
92
90
|
await writeJSONLAtomic(conversationsFile, updatedPayloads);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
};
|
|
105
|
-
// Update sync state based on synced payloads
|
|
106
|
-
if (successCount > 0) {
|
|
107
|
-
// Find the highest history index from successfully synced payloads
|
|
108
|
-
let maxHistoryIndex = currentSession.sync.conversations.lastSyncedHistoryIndex ?? -1;
|
|
109
|
-
for (const payload of pendingPayloads) {
|
|
110
|
-
const historyIndices = payload.historyIndices || [];
|
|
111
|
-
if (historyIndices.length > 0) {
|
|
112
|
-
const payloadMaxIndex = Math.max(...historyIndices);
|
|
113
|
-
maxHistoryIndex = Math.max(maxHistoryIndex, payloadMaxIndex);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
currentSession.sync.conversations.lastSyncedHistoryIndex = maxHistoryIndex;
|
|
117
|
-
// Update conversation ID (from first payload)
|
|
118
|
-
if (pendingPayloads.length > 0) {
|
|
119
|
-
currentSession.sync.conversations.conversationId = pendingPayloads[0].payload.conversationId;
|
|
120
|
-
}
|
|
121
|
-
// Update counters
|
|
122
|
-
currentSession.sync.conversations.totalMessagesSynced =
|
|
123
|
-
(currentSession.sync.conversations.totalMessagesSynced || 0) + totalMessages;
|
|
124
|
-
currentSession.sync.conversations.lastSyncAt = syncedAt;
|
|
91
|
+
logger.info(`[${this.name}] Successfully synced ${successCount}/${pendingPayloads.length} conversations (${totalMessages} messages)`);
|
|
92
|
+
// Calculate sync updates for the adapter to persist
|
|
93
|
+
let maxHistoryIndex = -1;
|
|
94
|
+
let conversationId;
|
|
95
|
+
if (successCount > 0) {
|
|
96
|
+
// Find the highest history index from successfully synced payloads
|
|
97
|
+
for (const payload of pendingPayloads) {
|
|
98
|
+
const historyIndices = payload.historyIndices || [];
|
|
99
|
+
if (historyIndices.length > 0) {
|
|
100
|
+
const payloadMaxIndex = Math.max(...historyIndices);
|
|
101
|
+
maxHistoryIndex = Math.max(maxHistoryIndex, payloadMaxIndex);
|
|
125
102
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
logger.debug(`[${this.name}] Updated session metadata: ` +
|
|
131
|
-
`lastSyncedHistoryIndex=${currentSession.sync.conversations.lastSyncedHistoryIndex}, ` +
|
|
132
|
-
`totalMessagesSynced=${currentSession.sync.conversations.totalMessagesSynced}, ` +
|
|
133
|
-
`totalSyncAttempts=${currentSession.sync.conversations.totalSyncAttempts}`);
|
|
103
|
+
}
|
|
104
|
+
// Get conversation ID from first payload
|
|
105
|
+
if (pendingPayloads.length > 0) {
|
|
106
|
+
conversationId = pendingPayloads[0].payload.conversationId;
|
|
134
107
|
}
|
|
135
108
|
}
|
|
136
|
-
catch (error) {
|
|
137
|
-
// Non-critical - log but don't fail the sync
|
|
138
|
-
logger.warn(`[${this.name}] Failed to update session metadata:`, error);
|
|
139
|
-
}
|
|
140
|
-
logger.info(`[${this.name}] Successfully synced ${successCount}/${pendingPayloads.length} conversations (${totalMessages} messages)`);
|
|
141
109
|
// Debug: Log which payloads were marked as synced
|
|
142
110
|
logger.debug(`[${this.name}] Marked payloads as synced:`, {
|
|
143
111
|
syncedAt: new Date(syncedAt).toISOString(),
|
|
@@ -152,7 +120,16 @@ export class ConversationSyncProcessor {
|
|
|
152
120
|
metadata: {
|
|
153
121
|
conversationId: session.sessionId,
|
|
154
122
|
messagesProcessed: totalMessages,
|
|
155
|
-
payloadsSynced: successCount
|
|
123
|
+
payloadsSynced: successCount,
|
|
124
|
+
syncUpdates: successCount > 0 ? {
|
|
125
|
+
conversations: {
|
|
126
|
+
lastSyncedHistoryIndex: maxHistoryIndex,
|
|
127
|
+
conversationId,
|
|
128
|
+
totalMessagesSynced: totalMessages,
|
|
129
|
+
totalSyncAttempts: 1,
|
|
130
|
+
lastSyncAt: syncedAt
|
|
131
|
+
}
|
|
132
|
+
} : undefined
|
|
156
133
|
}
|
|
157
134
|
};
|
|
158
135
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-sync-processor.js","sourceRoot":"","sources":["../../../../../../../src/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAC;AACrG,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"conversation-sync-processor.js","sourceRoot":"","sources":["../../../../../../../src/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAC;AACrG,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM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;qBACF,CAAC,CAAC,CAAC,SAAS;iBACd;aACF,CAAC;QAEJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,sBAAsB,EAAE,KAAK,CAAC,CAAC;YACzD,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;aAClE,CAAC;QACJ,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACzB,CAAC;IACH,CAAC;CACF"}
|
package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-sync-processor.d.ts","sourceRoot":"","sources":["../../../../../../../src/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACpG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAUjE,qBAAa,oBAAqB,YAAW,gBAAgB;IAC3D,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,QAAQ,KAAK;IAEtB,OAAO,CAAC,YAAY,CAAsB;IAC1C,OAAO,CAAC,SAAS,CAAS;IAE1B,aAAa,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO;IAKzC,OAAO,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"metrics-sync-processor.d.ts","sourceRoot":"","sources":["../../../../../../../src/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACpG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAUjE,qBAAa,oBAAqB,YAAW,gBAAgB;IAC3D,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,QAAQ,KAAK;IAEtB,OAAO,CAAC,YAAY,CAAsB;IAC1C,OAAO,CAAC,SAAS,CAAS;IAE1B,aAAa,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO;IAKzC,OAAO,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;CA0N7F"}
|
|
@@ -176,39 +176,6 @@ export class MetricsSyncProcessor {
|
|
|
176
176
|
}
|
|
177
177
|
: d);
|
|
178
178
|
await writeJSONLAtomic(metricsFile, updatedDeltas);
|
|
179
|
-
// 9. Update session metadata to reflect sync state
|
|
180
|
-
try {
|
|
181
|
-
const currentSession = await this.sessionStore.loadSession(session.sessionId);
|
|
182
|
-
if (currentSession) {
|
|
183
|
-
// Ensure sync structure exists
|
|
184
|
-
currentSession.sync ??= {};
|
|
185
|
-
// Initialize metrics sync state if not present
|
|
186
|
-
currentSession.sync.metrics ??= {
|
|
187
|
-
lastProcessedTimestamp: 0,
|
|
188
|
-
processedRecordIds: [],
|
|
189
|
-
attachedUserPromptTexts: [],
|
|
190
|
-
totalDeltas: 0,
|
|
191
|
-
totalSynced: 0,
|
|
192
|
-
totalFailed: 0
|
|
193
|
-
};
|
|
194
|
-
// Add newly synced record IDs to processed records
|
|
195
|
-
const existingRecordIds = new Set(currentSession.sync.metrics.processedRecordIds);
|
|
196
|
-
for (const recordId of pendingRecordIds) {
|
|
197
|
-
existingRecordIds.add(recordId);
|
|
198
|
-
}
|
|
199
|
-
currentSession.sync.metrics.processedRecordIds = Array.from(existingRecordIds);
|
|
200
|
-
// Update sync counters
|
|
201
|
-
currentSession.sync.metrics.totalSynced = currentSession.sync.metrics.totalSynced + pendingDeltas.length;
|
|
202
|
-
// Ensure totalDeltas reflects actual file state
|
|
203
|
-
currentSession.sync.metrics.totalDeltas = updatedDeltas.length;
|
|
204
|
-
await this.sessionStore.saveSession(currentSession);
|
|
205
|
-
logger.debug(`[${this.name}] Updated session metadata: totalSynced=${currentSession.sync.metrics.totalSynced}, totalDeltas=${currentSession.sync.metrics.totalDeltas}`);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
catch (error) {
|
|
209
|
-
// Non-critical - log but don't fail the sync
|
|
210
|
-
logger.warn(`[${this.name}] Failed to update session metadata:`, error);
|
|
211
|
-
}
|
|
212
179
|
logger.info(`[${this.name}] Successfully synced ${pendingDeltas.length} deltas across ${metrics.length} branches`);
|
|
213
180
|
// Debug: Log which deltas were marked as synced
|
|
214
181
|
logger.debug(`[${this.name}] Marked deltas as synced:`, {
|
|
@@ -223,7 +190,14 @@ export class MetricsSyncProcessor {
|
|
|
223
190
|
message: `Synced ${pendingDeltas.length} deltas across ${metrics.length} branches`,
|
|
224
191
|
metadata: {
|
|
225
192
|
deltasProcessed: pendingDeltas.length,
|
|
226
|
-
branchCount: metrics.length
|
|
193
|
+
branchCount: metrics.length,
|
|
194
|
+
syncUpdates: {
|
|
195
|
+
metrics: {
|
|
196
|
+
processedRecordIds: Array.from(pendingRecordIds),
|
|
197
|
+
totalSynced: pendingDeltas.length,
|
|
198
|
+
totalDeltas: updatedDeltas.length
|
|
199
|
+
}
|
|
200
|
+
}
|
|
227
201
|
}
|
|
228
202
|
};
|
|
229
203
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-sync-processor.js","sourceRoot":"","sources":["../../../../../../../src/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM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AC,CAAC;oBACE,GAAG,CAAC;oBACJ,UAAU,EAAE,QAAiB;oBAC7B,YAAY,EAAE,CAAC,CAAC,YAAY,GAAG,CAAC;oBAChC,QAAQ;iBACT;gBACH,CAAC,CAAC,CAAC,CACN,CAAC;YAEF,MAAM,gBAAgB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;YAEnD,
|
|
1
|
+
{"version":3,"file":"metrics-sync-processor.js","sourceRoot":"","sources":["../../../../../../../src/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,uDAAuD,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D,MAAM,OAAO,oBAAoB;IACtB,IAAI,GAAG,cAAc,CAAC;IACtB,QAAQ,GAAG,CAAC,CAAC,CAAC,gDAAgD;IAE/D,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;IAClC,SAAS,GAAG,KAAK,CAAC,CAAC,oBAAoB;IAE/C,aAAa,CAAC,QAAuB;QACnC,+DAA+D;QAC/D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAsB,EAAE,OAA0B;QAC9D,qDAAqD;QACrD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,sCAAsC,CAAC,CAAC;YAClE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE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3E,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,UAAU,aAAa,CAAC,MAAM,kBAAkB,OAAO,CAAC,MAAM,WAAW;gBAClF,QAAQ,EAAE;oBACR,eAAe,EAAE,aAAa,CAAC,MAAM;oBACrC,WAAW,EAAE,OAAO,CAAC,MAAM;oBAC3B,WAAW,EAAE;wBACX,OAAO,EAAE;4BACP,kBAAkB,EAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC;4BAChD,WAAW,EAAE,aAAa,CAAC,MAAM;4BACjC,WAAW,EAAE,aAAa,CAAC,MAAM;yBAClC;qBACF;iBACF;aACF,CAAC;QAEJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,gBAAgB,EAAE,KAAK,CAAC,CAAC;YACnD,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;aAClE,CAAC;QAEJ,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACzB,CAAC;IACH,CAAC;CACF"}
|
package/dist/utils/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CodeMieConfigOptions, ProviderProfile, MultiProviderConfig, CodeMieIntegrationInfo, ConfigWithSource, CodemieAssistant } from '../env/types.js';
|
|
2
|
-
export type { CodeMieConfigOptions, CodeMieIntegrationInfo, ConfigWithSource };
|
|
1
|
+
import { CodeMieConfigOptions, ProviderProfile, MultiProviderConfig, CodeMieIntegrationInfo, ConfigWithSource, ConfigWithSources, CodemieAssistant } from '../env/types.js';
|
|
2
|
+
export type { CodeMieConfigOptions, CodeMieIntegrationInfo, ConfigWithSource, ConfigWithSources };
|
|
3
3
|
/**
|
|
4
4
|
* Unified configuration loader with priority system:
|
|
5
5
|
* CLI args > Env vars > Project config > Global config > Defaults
|
|
@@ -29,6 +29,11 @@ export declare class ConfigLoader {
|
|
|
29
29
|
* Load global config and extract active profile if multi-provider
|
|
30
30
|
*/
|
|
31
31
|
private static loadGlobalConfigProfile;
|
|
32
|
+
/**
|
|
33
|
+
* Load local (project) config and extract active profile if multi-provider
|
|
34
|
+
* Returns ONLY the fields defined in local config (for overlay on top of global)
|
|
35
|
+
*/
|
|
36
|
+
private static loadLocalConfigProfile;
|
|
32
37
|
/**
|
|
33
38
|
* Load configuration with validation (throws if required fields missing)
|
|
34
39
|
*/
|
|
@@ -60,36 +65,53 @@ export declare class ConfigLoader {
|
|
|
60
65
|
static saveProfile(profileName: string, profile: ProviderProfile): Promise<void>;
|
|
61
66
|
/**
|
|
62
67
|
* Delete a profile
|
|
68
|
+
* Works with local config if it exists, otherwise global
|
|
63
69
|
*/
|
|
64
|
-
static deleteProfile(profileName: string): Promise<void>;
|
|
70
|
+
static deleteProfile(profileName: string, workingDir?: string): Promise<void>;
|
|
65
71
|
/**
|
|
66
72
|
* Switch active profile
|
|
73
|
+
* Sets the active profile in local config if it exists, otherwise in global config
|
|
74
|
+
* The profile can be from either local or global - just sets the activeProfile reference
|
|
67
75
|
*/
|
|
68
|
-
static switchProfile(profileName: string): Promise<void>;
|
|
76
|
+
static switchProfile(profileName: string, workingDir?: string): Promise<void>;
|
|
69
77
|
/**
|
|
70
78
|
* List all profiles
|
|
79
|
+
* Returns profiles from both local (if exists) and global configs
|
|
71
80
|
*/
|
|
72
|
-
static listProfiles(): Promise<{
|
|
81
|
+
static listProfiles(workingDir?: string): Promise<{
|
|
73
82
|
name: string;
|
|
74
83
|
active: boolean;
|
|
75
84
|
profile: ProviderProfile;
|
|
85
|
+
source: 'local' | 'global';
|
|
76
86
|
}[]>;
|
|
77
87
|
/**
|
|
78
88
|
* Get a specific profile
|
|
89
|
+
* Checks local config first, then falls back to global
|
|
79
90
|
*/
|
|
80
|
-
static getProfile(profileName: string): Promise<ProviderProfile | null>;
|
|
91
|
+
static getProfile(profileName: string, workingDir?: string): Promise<ProviderProfile | null>;
|
|
81
92
|
/**
|
|
82
93
|
* Rename a profile
|
|
83
94
|
*/
|
|
84
95
|
static renameProfile(oldName: string, newName: string): Promise<void>;
|
|
85
96
|
/**
|
|
86
97
|
* Get active profile name
|
|
98
|
+
* Checks local config first, then global
|
|
87
99
|
*/
|
|
88
|
-
static getActiveProfileName(): Promise<string | null>;
|
|
100
|
+
static getActiveProfileName(workingDir?: string): Promise<string | null>;
|
|
89
101
|
/**
|
|
90
102
|
* Save configuration to project config file
|
|
91
103
|
*/
|
|
92
104
|
static saveProjectConfig(workingDir: string, config: Partial<CodeMieConfigOptions>): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Initialize project config with optional overrides
|
|
107
|
+
* Creates .codemie/ directory and initial multi-provider config file
|
|
108
|
+
*/
|
|
109
|
+
static initProjectConfig(workingDir: string, overrides?: {
|
|
110
|
+
profileName?: string;
|
|
111
|
+
codeMieProject?: string;
|
|
112
|
+
codeMieIntegration?: CodeMieIntegrationInfo;
|
|
113
|
+
[key: string]: any;
|
|
114
|
+
}): Promise<void>;
|
|
93
115
|
/**
|
|
94
116
|
* Delete global config file
|
|
95
117
|
*/
|
|
@@ -106,6 +128,10 @@ export declare class ConfigLoader {
|
|
|
106
128
|
* Check if project config exists
|
|
107
129
|
*/
|
|
108
130
|
static hasProjectConfig(workingDir?: string): Promise<boolean>;
|
|
131
|
+
/**
|
|
132
|
+
* Check if local config exists (alias for hasProjectConfig)
|
|
133
|
+
*/
|
|
134
|
+
static hasLocalConfig(workingDir?: string): Promise<boolean>;
|
|
109
135
|
/**
|
|
110
136
|
* Remove undefined values from object
|
|
111
137
|
*/
|
|
@@ -121,8 +147,9 @@ export declare class ConfigLoader {
|
|
|
121
147
|
private static validateHooksConfiguration;
|
|
122
148
|
/**
|
|
123
149
|
* Load configuration with source tracking
|
|
150
|
+
* Returns full config with source information for each field
|
|
124
151
|
*/
|
|
125
|
-
static loadWithSources(workingDir?: string): Promise<
|
|
152
|
+
static loadWithSources(workingDir?: string, cliOverrides?: Partial<CodeMieConfigOptions>): Promise<ConfigWithSources>;
|
|
126
153
|
/**
|
|
127
154
|
* Show configuration with source attribution
|
|
128
155
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAGjB,MAAM,iBAAiB,CAAC;AAKzB,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAGjB,MAAM,iBAAiB,CAAC;AAKzB,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC;AAElG;;;;;;;GAOG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAoB;IACpD,OAAO,CAAC,MAAM,CAAC,aAAa,CAA6C;IACzE,OAAO,CAAC,MAAM,CAAC,YAAY,CAAsC;IAGjE,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAoC;IAErE;;;OAGG;WACU,IAAI,CACf,UAAU,GAAE,MAAsB,EAClC,YAAY,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAC3C,OAAO,CAAC,oBAAoB,CAAC;IAyEhC;;;OAGG;WACU,QAAQ,CACnB,UAAU,GAAE,MAAsB,EAClC,YAAY,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;K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