@codemieai/code 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -6
- package/bin/codebase-memory-ui-daemon.js +10 -0
- package/bin/codemie-codex.js +18 -0
- package/dist/agents/core/AgentCLI.d.ts +1 -0
- package/dist/agents/core/AgentCLI.d.ts.map +1 -1
- package/dist/agents/core/AgentCLI.js +29 -4
- package/dist/agents/core/AgentCLI.js.map +1 -1
- package/dist/agents/core/session/sync-state-utils.d.ts +11 -0
- package/dist/agents/core/session/sync-state-utils.d.ts.map +1 -0
- package/dist/agents/core/session/sync-state-utils.js +99 -0
- package/dist/agents/core/session/sync-state-utils.js.map +1 -0
- package/dist/agents/core/session/types.d.ts +8 -0
- package/dist/agents/core/session/types.d.ts.map +1 -1
- package/dist/agents/core/session/utils/jsonl-reader.d.ts +8 -0
- package/dist/agents/core/session/utils/jsonl-reader.d.ts.map +1 -1
- package/dist/agents/core/session/utils/jsonl-reader.js +37 -0
- package/dist/agents/core/session/utils/jsonl-reader.js.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +1 -1
- package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/agents/plugins/claude/plugin/hooks/hooks.json +0 -15
- package/dist/agents/plugins/claude/plugin/skills/codemie-analytics/SKILL.md +641 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-analytics/references/leaderboard-dashboard-report.md +225 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-analytics/references/people-spending-dashboard-report.md +746 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-analytics/references/people-spending-dashboard-template.html +3270 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-analytics/scripts/analytics-cli.js +893 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-analytics/scripts/inspect-schema.js +211 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-html-report/README.md +39 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-html-report/SKILL.md +117 -26
- package/dist/agents/plugins/claude/plugin/skills/codemie-html-report/scripts/inject-css.js +40 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-html-report/scripts/inject-data.js +68 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-html-report/style-guide/css/bundle.css +1 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/SKILL.md +240 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/examples/assistants.md +256 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/examples/categories.md +101 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/examples/datasources.md +401 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/examples/integrations.md +242 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/examples/skills.md +191 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/examples/users.md +38 -0
- package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/examples/workflows.md +151 -0
- 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 +2 -0
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js.map +1 -1
- package/dist/agents/plugins/codex/codex-message-types.d.ts +80 -0
- package/dist/agents/plugins/codex/codex-message-types.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex-message-types.js +36 -0
- package/dist/agents/plugins/codex/codex-message-types.js.map +1 -0
- package/dist/agents/plugins/codex/codex-models.d.ts +9 -0
- package/dist/agents/plugins/codex/codex-models.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex-models.js +227 -0
- package/dist/agents/plugins/codex/codex-models.js.map +1 -0
- package/dist/agents/plugins/codex/codex.incremental-sync.d.ts +39 -0
- package/dist/agents/plugins/codex/codex.incremental-sync.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex.incremental-sync.js +147 -0
- package/dist/agents/plugins/codex/codex.incremental-sync.js.map +1 -0
- package/dist/agents/plugins/codex/codex.paths.d.ts +29 -0
- package/dist/agents/plugins/codex/codex.paths.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex.paths.js +43 -0
- package/dist/agents/plugins/codex/codex.paths.js.map +1 -0
- package/dist/agents/plugins/codex/codex.plugin.d.ts +80 -0
- package/dist/agents/plugins/codex/codex.plugin.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex.plugin.js +474 -0
- package/dist/agents/plugins/codex/codex.plugin.js.map +1 -0
- package/dist/agents/plugins/codex/codex.reconciliation.d.ts +43 -0
- package/dist/agents/plugins/codex/codex.reconciliation.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex.reconciliation.js +141 -0
- package/dist/agents/plugins/codex/codex.reconciliation.js.map +1 -0
- package/dist/agents/plugins/codex/codex.session.d.ts +58 -0
- package/dist/agents/plugins/codex/codex.session.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex.session.js +326 -0
- package/dist/agents/plugins/codex/codex.session.js.map +1 -0
- package/dist/agents/plugins/codex/codex.storage-utils.d.ts +15 -0
- package/dist/agents/plugins/codex/codex.storage-utils.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex.storage-utils.js +19 -0
- package/dist/agents/plugins/codex/codex.storage-utils.js.map +1 -0
- package/dist/agents/plugins/codex/index.d.ts +7 -0
- package/dist/agents/plugins/codex/index.d.ts.map +1 -0
- package/dist/agents/plugins/codex/index.js +9 -0
- package/dist/agents/plugins/codex/index.js.map +1 -0
- package/dist/agents/plugins/codex/session/processors/codex.conversations-processor.d.ts +24 -0
- package/dist/agents/plugins/codex/session/processors/codex.conversations-processor.d.ts.map +1 -0
- package/dist/agents/plugins/codex/session/processors/codex.conversations-processor.js +613 -0
- package/dist/agents/plugins/codex/session/processors/codex.conversations-processor.js.map +1 -0
- package/dist/agents/plugins/codex/session/processors/codex.metrics-processor.d.ts +21 -0
- package/dist/agents/plugins/codex/session/processors/codex.metrics-processor.d.ts.map +1 -0
- package/dist/agents/plugins/codex/session/processors/codex.metrics-processor.js +124 -0
- package/dist/agents/plugins/codex/session/processors/codex.metrics-processor.js.map +1 -0
- package/dist/agents/plugins/gemini/session/processors/gemini.conversations-processor.d.ts.map +1 -1
- package/dist/agents/plugins/gemini/session/processors/gemini.conversations-processor.js +1 -0
- package/dist/agents/plugins/gemini/session/processors/gemini.conversations-processor.js.map +1 -1
- package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/opencode.storage-utils.js +2 -29
- package/dist/agents/plugins/opencode/opencode.storage-utils.js.map +1 -1
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js.map +1 -1
- package/dist/agents/registry.d.ts.map +1 -1
- package/dist/agents/registry.js +2 -0
- package/dist/agents/registry.js.map +1 -1
- package/dist/bin/codebase-memory-ui-daemon.d.ts +2 -0
- package/dist/bin/codebase-memory-ui-daemon.d.ts.map +1 -0
- package/dist/bin/codebase-memory-ui-daemon.js +141 -0
- package/dist/bin/codebase-memory-ui-daemon.js.map +1 -0
- package/dist/bin/proxy-daemon.js +4 -0
- package/dist/bin/proxy-daemon.js.map +1 -1
- package/dist/cli/commands/assistants/constants.js +2 -2
- package/dist/cli/commands/assistants/constants.js.map +1 -1
- package/dist/cli/commands/assistants/setup/configuration/constants.js +4 -4
- package/dist/cli/commands/assistants/setup/configuration/constants.js.map +1 -1
- package/dist/cli/commands/assistants/setup/configuration/ui.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/configuration/ui.js +10 -13
- package/dist/cli/commands/assistants/setup/configuration/ui.js.map +1 -1
- package/dist/cli/commands/assistants/setup/generators/codex-skill-generator.d.ts +4 -0
- package/dist/cli/commands/assistants/setup/generators/codex-skill-generator.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/generators/codex-skill-generator.js +76 -0
- package/dist/cli/commands/assistants/setup/generators/codex-skill-generator.js.map +1 -0
- package/dist/cli/commands/assistants/setup/generators/gemini-skill-generator.d.ts +4 -0
- package/dist/cli/commands/assistants/setup/generators/gemini-skill-generator.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/generators/gemini-skill-generator.js +68 -0
- package/dist/cli/commands/assistants/setup/generators/gemini-skill-generator.js.map +1 -0
- package/dist/cli/commands/assistants/setup/helpers.d.ts +3 -2
- package/dist/cli/commands/assistants/setup/helpers.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/helpers.js +43 -8
- package/dist/cli/commands/assistants/setup/helpers.js.map +1 -1
- package/dist/cli/commands/assistants/setup/index.d.ts +3 -1
- package/dist/cli/commands/assistants/setup/index.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/index.js +15 -12
- package/dist/cli/commands/assistants/setup/index.js.map +1 -1
- package/dist/cli/commands/assistants/setup/manualConfiguration/types.d.ts +2 -2
- package/dist/cli/commands/assistants/setup/manualConfiguration/ui.js +2 -2
- package/dist/cli/commands/assistants/setup/manualConfiguration/ui.js.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/ui.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/ui.js +8 -13
- package/dist/cli/commands/assistants/setup/selection/ui.js.map +1 -1
- package/dist/cli/commands/assistants/setup/summary/index.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/summary/index.js +14 -8
- package/dist/cli/commands/assistants/setup/summary/index.js.map +1 -1
- package/dist/cli/commands/codebase/daemon-manager.d.ts +24 -0
- package/dist/cli/commands/codebase/daemon-manager.d.ts.map +1 -0
- package/dist/cli/commands/codebase/daemon-manager.js +112 -0
- package/dist/cli/commands/codebase/daemon-manager.js.map +1 -0
- package/dist/cli/commands/codebase/index.d.ts +3 -0
- package/dist/cli/commands/codebase/index.d.ts.map +1 -0
- package/dist/cli/commands/codebase/index.js +130 -0
- package/dist/cli/commands/codebase/index.js.map +1 -0
- package/dist/cli/commands/hook.d.ts.map +1 -1
- package/dist/cli/commands/hook.js +15 -2
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/install.js +2 -2
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/profile/display.d.ts.map +1 -1
- package/dist/cli/commands/profile/display.js +1 -0
- package/dist/cli/commands/profile/display.js.map +1 -1
- package/dist/cli/commands/profile/index.d.ts +14 -0
- package/dist/cli/commands/profile/index.d.ts.map +1 -1
- package/dist/cli/commands/profile/index.js +110 -27
- package/dist/cli/commands/profile/index.js.map +1 -1
- package/dist/cli/commands/proxy/connectors/desktop-managed-mcp-servers.json +1 -1
- package/dist/cli/commands/proxy/connectors/desktop.d.ts +4 -6
- package/dist/cli/commands/proxy/connectors/desktop.d.ts.map +1 -1
- package/dist/cli/commands/proxy/connectors/desktop.js +112 -25
- package/dist/cli/commands/proxy/connectors/desktop.js.map +1 -1
- package/dist/cli/commands/proxy/daemon-manager.d.ts +1 -0
- package/dist/cli/commands/proxy/daemon-manager.d.ts.map +1 -1
- package/dist/cli/commands/proxy/daemon-manager.js +2 -0
- package/dist/cli/commands/proxy/daemon-manager.js.map +1 -1
- package/dist/cli/commands/proxy/index.d.ts.map +1 -1
- package/dist/cli/commands/proxy/index.js +42 -0
- package/dist/cli/commands/proxy/index.js.map +1 -1
- package/dist/cli/commands/sdk/assistants.d.ts +3 -0
- package/dist/cli/commands/sdk/assistants.d.ts.map +1 -0
- package/dist/cli/commands/sdk/assistants.js +211 -0
- package/dist/cli/commands/sdk/assistants.js.map +1 -0
- package/dist/cli/commands/sdk/categories.d.ts +3 -0
- package/dist/cli/commands/sdk/categories.d.ts.map +1 -0
- package/dist/cli/commands/sdk/categories.js +186 -0
- package/dist/cli/commands/sdk/categories.js.map +1 -0
- package/dist/cli/commands/sdk/datasources.d.ts +3 -0
- package/dist/cli/commands/sdk/datasources.d.ts.map +1 -0
- package/dist/cli/commands/sdk/datasources.js +276 -0
- package/dist/cli/commands/sdk/datasources.js.map +1 -0
- package/dist/cli/commands/sdk/index.d.ts +3 -0
- package/dist/cli/commands/sdk/index.d.ts.map +1 -0
- package/dist/cli/commands/sdk/index.js +23 -0
- package/dist/cli/commands/sdk/index.js.map +1 -0
- package/dist/cli/commands/sdk/integrations.d.ts +3 -0
- package/dist/cli/commands/sdk/integrations.d.ts.map +1 -0
- package/dist/cli/commands/sdk/integrations.js +220 -0
- package/dist/cli/commands/sdk/integrations.js.map +1 -0
- package/dist/cli/commands/sdk/llm.d.ts +3 -0
- package/dist/cli/commands/sdk/llm.d.ts.map +1 -0
- package/dist/cli/commands/sdk/llm.js +48 -0
- package/dist/cli/commands/sdk/llm.js.map +1 -0
- package/dist/cli/commands/sdk/services/assistants.d.ts +13 -0
- package/dist/cli/commands/sdk/services/assistants.d.ts.map +1 -0
- package/dist/cli/commands/sdk/services/assistants.js +60 -0
- package/dist/cli/commands/sdk/services/assistants.js.map +1 -0
- package/dist/cli/commands/sdk/services/categories.d.ts +8 -0
- package/dist/cli/commands/sdk/services/categories.d.ts.map +1 -0
- package/dist/cli/commands/sdk/services/categories.js +19 -0
- package/dist/cli/commands/sdk/services/categories.js.map +1 -0
- package/dist/cli/commands/sdk/services/datasources.d.ts +33 -0
- package/dist/cli/commands/sdk/services/datasources.d.ts.map +1 -0
- package/dist/cli/commands/sdk/services/datasources.js +268 -0
- package/dist/cli/commands/sdk/services/datasources.js.map +1 -0
- package/dist/cli/commands/sdk/services/index.d.ts +6 -0
- package/dist/cli/commands/sdk/services/index.d.ts.map +1 -0
- package/dist/cli/commands/sdk/services/index.js +6 -0
- package/dist/cli/commands/sdk/services/index.js.map +1 -0
- package/dist/cli/commands/sdk/services/integrations.d.ts +27 -0
- package/dist/cli/commands/sdk/services/integrations.d.ts.map +1 -0
- package/dist/cli/commands/sdk/services/integrations.js +59 -0
- package/dist/cli/commands/sdk/services/integrations.js.map +1 -0
- package/dist/cli/commands/sdk/services/llm.d.ts +4 -0
- package/dist/cli/commands/sdk/services/llm.d.ts.map +1 -0
- package/dist/cli/commands/sdk/services/llm.js +7 -0
- package/dist/cli/commands/sdk/services/llm.js.map +1 -0
- package/dist/cli/commands/sdk/services/skills.d.ts +23 -0
- package/dist/cli/commands/sdk/services/skills.d.ts.map +1 -0
- package/dist/cli/commands/sdk/services/skills.js +69 -0
- package/dist/cli/commands/sdk/services/skills.js.map +1 -0
- package/dist/cli/commands/sdk/services/users.d.ts +4 -0
- package/dist/cli/commands/sdk/services/users.d.ts.map +1 -0
- package/dist/cli/commands/sdk/services/users.js +7 -0
- package/dist/cli/commands/sdk/services/users.js.map +1 -0
- package/dist/cli/commands/sdk/services/workflows.d.ts +7 -0
- package/dist/cli/commands/sdk/services/workflows.d.ts.map +1 -0
- package/dist/cli/commands/sdk/services/workflows.js +34 -0
- package/dist/cli/commands/sdk/services/workflows.js.map +1 -0
- package/dist/cli/commands/sdk/skills.d.ts +3 -0
- package/dist/cli/commands/sdk/skills.d.ts.map +1 -0
- package/dist/cli/commands/sdk/skills.js +492 -0
- package/dist/cli/commands/sdk/skills.js.map +1 -0
- package/dist/cli/commands/sdk/users.d.ts +3 -0
- package/dist/cli/commands/sdk/users.d.ts.map +1 -0
- package/dist/cli/commands/sdk/users.js +81 -0
- package/dist/cli/commands/sdk/users.js.map +1 -0
- package/dist/cli/commands/sdk/utils/cli-utils.d.ts +35 -0
- package/dist/cli/commands/sdk/utils/cli-utils.d.ts.map +1 -0
- package/dist/cli/commands/sdk/utils/cli-utils.js +110 -0
- package/dist/cli/commands/sdk/utils/cli-utils.js.map +1 -0
- package/dist/cli/commands/sdk/utils/datasource-types.d.ts +9 -0
- package/dist/cli/commands/sdk/utils/datasource-types.d.ts.map +1 -0
- package/dist/cli/commands/sdk/utils/datasource-types.js +61 -0
- package/dist/cli/commands/sdk/utils/datasource-types.js.map +1 -0
- package/dist/cli/commands/sdk/utils/file-utils.d.ts +8 -0
- package/dist/cli/commands/sdk/utils/file-utils.d.ts.map +1 -0
- package/dist/cli/commands/sdk/utils/file-utils.js +21 -0
- package/dist/cli/commands/sdk/utils/file-utils.js.map +1 -0
- package/dist/cli/commands/sdk/utils/render.d.ts +82 -0
- package/dist/cli/commands/sdk/utils/render.d.ts.map +1 -0
- package/dist/cli/commands/sdk/utils/render.js +149 -0
- package/dist/cli/commands/sdk/utils/render.js.map +1 -0
- package/dist/cli/commands/sdk/workflows.d.ts +3 -0
- package/dist/cli/commands/sdk/workflows.d.ts.map +1 -0
- package/dist/cli/commands/sdk/workflows.js +170 -0
- package/dist/cli/commands/sdk/workflows.js.map +1 -0
- package/dist/cli/commands/setup.js +1 -1
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/shared/agent-targets.d.ts +10 -0
- package/dist/cli/commands/shared/agent-targets.d.ts.map +1 -0
- package/dist/cli/commands/shared/agent-targets.js +220 -0
- package/dist/cli/commands/shared/agent-targets.js.map +1 -0
- package/dist/cli/commands/shared/prompts/storage-scope.d.ts.map +1 -1
- package/dist/cli/commands/shared/prompts/storage-scope.js +9 -2
- package/dist/cli/commands/shared/prompts/storage-scope.js.map +1 -1
- package/dist/cli/commands/shared/selection/ui.d.ts +22 -0
- package/dist/cli/commands/shared/selection/ui.d.ts.map +1 -1
- package/dist/cli/commands/shared/selection/ui.js +34 -0
- package/dist/cli/commands/shared/selection/ui.js.map +1 -1
- package/dist/cli/commands/skills/lib/skills-metrics.d.ts.map +1 -1
- package/dist/cli/commands/skills/lib/skills-metrics.js +47 -11
- package/dist/cli/commands/skills/lib/skills-metrics.js.map +1 -1
- package/dist/cli/commands/skills/setup/generators/codex-skill-generator.d.ts +4 -0
- package/dist/cli/commands/skills/setup/generators/codex-skill-generator.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/generators/codex-skill-generator.js +51 -0
- package/dist/cli/commands/skills/setup/generators/codex-skill-generator.js.map +1 -0
- package/dist/cli/commands/skills/setup/generators/gemini-skill-generator.d.ts +4 -0
- package/dist/cli/commands/skills/setup/generators/gemini-skill-generator.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/generators/gemini-skill-generator.js +51 -0
- package/dist/cli/commands/skills/setup/generators/gemini-skill-generator.js.map +1 -0
- package/dist/cli/commands/skills/setup/helpers.d.ts +3 -2
- package/dist/cli/commands/skills/setup/helpers.d.ts.map +1 -1
- package/dist/cli/commands/skills/setup/helpers.js +31 -6
- package/dist/cli/commands/skills/setup/helpers.js.map +1 -1
- package/dist/cli/commands/skills/setup/index.d.ts +2 -1
- package/dist/cli/commands/skills/setup/index.d.ts.map +1 -1
- package/dist/cli/commands/skills/setup/index.js +14 -11
- package/dist/cli/commands/skills/setup/index.js.map +1 -1
- package/dist/cli/commands/skills/setup/selection/ui.d.ts.map +1 -1
- package/dist/cli/commands/skills/setup/selection/ui.js +8 -13
- package/dist/cli/commands/skills/setup/selection/ui.js.map +1 -1
- package/dist/cli/commands/test-metrics.js +3 -4
- package/dist/cli/commands/test-metrics.js.map +1 -1
- package/dist/cli/index.js +5 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/env/types.d.ts +2 -0
- package/dist/env/types.d.ts.map +1 -1
- package/dist/env/types.js.map +1 -1
- package/dist/frameworks/plugins/bmad.plugin.d.ts +10 -1
- package/dist/frameworks/plugins/bmad.plugin.d.ts.map +1 -1
- package/dist/frameworks/plugins/bmad.plugin.js +108 -9
- package/dist/frameworks/plugins/bmad.plugin.js.map +1 -1
- package/dist/frameworks/plugins/codebase-memory.plugin.d.ts +18 -0
- package/dist/frameworks/plugins/codebase-memory.plugin.d.ts.map +1 -0
- package/dist/frameworks/plugins/codebase-memory.plugin.js +131 -0
- package/dist/frameworks/plugins/codebase-memory.plugin.js.map +1 -0
- package/dist/frameworks/plugins/index.d.ts +1 -0
- package/dist/frameworks/plugins/index.d.ts.map +1 -1
- package/dist/frameworks/plugins/index.js +3 -0
- package/dist/frameworks/plugins/index.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.d.ts +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.js +4 -4
- package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.d.ts +20 -0
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.d.ts.map +1 -0
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.js +104 -0
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.js.map +1 -0
- package/dist/providers/plugins/sso/proxy/plugins/gateway-key.plugin.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/gateway-key.plugin.js +24 -3
- package/dist/providers/plugins/sso/proxy/plugins/gateway-key.plugin.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/header-injection.plugin.js +5 -0
- package/dist/providers/plugins/sso/proxy/plugins/header-injection.plugin.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/index.d.ts +3 -1
- package/dist/providers/plugins/sso/proxy/plugins/index.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/index.js +5 -1
- package/dist/providers/plugins/sso/proxy/plugins/index.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/logging.plugin.js +10 -3
- package/dist/providers/plugins/sso/proxy/plugins/logging.plugin.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/sso.session-sync.plugin.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/sso.session-sync.plugin.js +26 -8
- package/dist/providers/plugins/sso/proxy/plugins/sso.session-sync.plugin.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/sso.proxy.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/sso.proxy.js +21 -4
- package/dist/providers/plugins/sso/proxy/sso.proxy.js.map +1 -1
- package/dist/providers/plugins/sso/session/SessionSyncer.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/SessionSyncer.js +5 -72
- package/dist/providers/plugins/sso/session/SessionSyncer.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/apiClient.d.ts +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/apiClient.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/apiClient.js +95 -4
- package/dist/providers/plugins/sso/session/processors/conversations/apiClient.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/constants.d.ts +2 -2
- package/dist/providers/plugins/sso/session/processors/conversations/constants.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/constants.js +2 -2
- package/dist/providers/plugins/sso/session/processors/conversations/constants.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.js +85 -21
- package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/types.d.ts +10 -2
- package/dist/providers/plugins/sso/session/processors/conversations/types.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-aggregator.d.ts +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-aggregator.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-aggregator.js +80 -46
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-aggregator.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.d.ts +1 -9
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.js +94 -30
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-post-processor.d.ts +4 -6
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-post-processor.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-post-processor.js +24 -25
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-post-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 +140 -99
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-types.d.ts +11 -3
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-types.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.auth.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.auth.js +22 -4
- package/dist/providers/plugins/sso/sso.auth.js.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.js +2 -2
- package/dist/providers/plugins/sso/sso.setup-steps.js.map +1 -1
- package/dist/telemetry/clients/claude-desktop/claude-desktop.paths.d.ts.map +1 -1
- package/dist/telemetry/clients/claude-desktop/claude-desktop.paths.js +4 -1
- package/dist/telemetry/clients/claude-desktop/claude-desktop.paths.js.map +1 -1
- package/dist/telemetry/runtime/DesktopTelemetryRuntime.d.ts.map +1 -1
- package/dist/telemetry/runtime/DesktopTelemetryRuntime.js +1 -3
- package/dist/telemetry/runtime/DesktopTelemetryRuntime.js.map +1 -1
- package/dist/utils/browser.d.ts +7 -0
- package/dist/utils/browser.d.ts.map +1 -0
- package/dist/utils/browser.js +10 -0
- package/dist/utils/browser.js.map +1 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +7 -1
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/paths.d.ts +8 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +15 -0
- package/dist/utils/paths.js.map +1 -1
- package/package.json +2 -1
- package/scripts/compare-codex-conversations.mjs +894 -0
- package/scripts/validate-secrets.js +7 -3
- package/dist/agents/plugins/claude/plugin/claude-templates/README.md +0 -539
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/CLAUDE.md.template +0 -252
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/code-review-agent-template.md.template +0 -433
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/refactor-cleaner-agent.md.template +0 -337
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/solution-architect-agent.md.template +0 -197
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/unit-tester-agent.md.template +0 -258
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/api/api-patterns.md.template +0 -179
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/architecture.md.template +0 -197
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/data/database-patterns.md.template +0 -248
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/development/development-practices.md.template +0 -298
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/integration/external-integrations.md.template +0 -160
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/security/security-practices.md.template +0 -295
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/standards/code-quality.md.template +0 -186
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/standards/git-workflow.md.template +0 -177
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/testing/testing-patterns.md.template +0 -315
- package/dist/agents/plugins/claude/plugin/commands/codemie-init.md +0 -522
- package/dist/agents/plugins/claude/plugin/commands/handoff.md +0 -56
- package/dist/agents/plugins/claude/plugin/commands/memory-refresh.md +0 -549
- package/dist/agents/plugins/claude/plugin/scripts/bash/rtk-baseline.sh +0 -39
- package/dist/agents/plugins/claude/plugin/scripts/bash/rtk-rewrite.sh +0 -101
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/SKILL.md +0 -206
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-agent.md +0 -45
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-claude-md-snippet.md +0 -40
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-command.md +0 -30
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-hooks.json +0 -23
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-skill.md +0 -48
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-agent.md +0 -145
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-claude-md-snippet.md +0 -126
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-command.md +0 -170
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-hooks.json +0 -46
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-skill.md +0 -144
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/sample-report.md +0 -223
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/references/best-practices.md +0 -510
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/references/component-checklists.md +0 -413
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/scripts/scan-repo.sh +0 -162
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface CodexModelResolution {
|
|
2
|
+
selectedModel: string;
|
|
3
|
+
catalogPath?: string;
|
|
4
|
+
availableModels: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare function isCodexCompatibleModelName(modelName: string | undefined): modelName is string;
|
|
7
|
+
export declare function resolveCodexModel(env: NodeJS.ProcessEnv): Promise<CodexModelResolution>;
|
|
8
|
+
export declare function assertExplicitCodexModelAllowed(model: string, availableModels: string[]): void;
|
|
9
|
+
//# sourceMappingURL=codex-models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-models.d.ts","sourceRoot":"","sources":["../../../../src/agents/plugins/codex/codex-models.ts"],"names":[],"mappings":"AAqDA,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAgDD,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,IAAI,MAAM,CAI7F;AAkJD,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAkD7F;AAED,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,CAc9F"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { mkdir, writeFile } from 'fs/promises';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { fetchCodeMieLlmModels } from '../../../providers/plugins/sso/sso.http-client.js';
|
|
4
|
+
import { CodeMieSSO } from '../../../providers/plugins/sso/sso.auth.js';
|
|
5
|
+
import { ConfigurationError } from '../../../utils/errors.js';
|
|
6
|
+
import { logger } from '../../../utils/logger.js';
|
|
7
|
+
import { resolveHomeDir } from '../../../utils/paths.js';
|
|
8
|
+
const INCOMPATIBLE_MODEL_PATTERNS = [
|
|
9
|
+
/claude/i,
|
|
10
|
+
/sonnet/i,
|
|
11
|
+
/opus/i,
|
|
12
|
+
/haiku/i,
|
|
13
|
+
/anthropic/i,
|
|
14
|
+
/gemini/i,
|
|
15
|
+
/qwen/i,
|
|
16
|
+
/deepseek/i,
|
|
17
|
+
/llama/i,
|
|
18
|
+
/mistral/i,
|
|
19
|
+
/grok/i,
|
|
20
|
+
];
|
|
21
|
+
const COMPATIBLE_CODEX_MODEL_PATTERNS = [
|
|
22
|
+
/codex/i,
|
|
23
|
+
/^gpt[-.]?5(?:[-.]|\b)/i,
|
|
24
|
+
/^gpt[-.]?6(?:[-.]|\b)/i,
|
|
25
|
+
];
|
|
26
|
+
const REASONING_LEVELS = [
|
|
27
|
+
{ effort: 'low', description: 'Fast responses with lighter reasoning' },
|
|
28
|
+
{ effort: 'medium', description: 'Balances speed and reasoning depth for everyday tasks' },
|
|
29
|
+
{ effort: 'high', description: 'Greater reasoning depth for complex problems' },
|
|
30
|
+
{ effort: 'xhigh', description: 'Extra high reasoning depth for complex problems' },
|
|
31
|
+
];
|
|
32
|
+
function getModelId(model) {
|
|
33
|
+
return model.deployment_name || model.base_name || model.label;
|
|
34
|
+
}
|
|
35
|
+
function getSearchText(model) {
|
|
36
|
+
return [
|
|
37
|
+
model.deployment_name,
|
|
38
|
+
model.base_name,
|
|
39
|
+
model.label,
|
|
40
|
+
model.provider,
|
|
41
|
+
].filter(Boolean).join(' ').toLowerCase();
|
|
42
|
+
}
|
|
43
|
+
export function isCodexCompatibleModelName(modelName) {
|
|
44
|
+
if (!modelName)
|
|
45
|
+
return false;
|
|
46
|
+
if (INCOMPATIBLE_MODEL_PATTERNS.some(pattern => pattern.test(modelName)))
|
|
47
|
+
return false;
|
|
48
|
+
return COMPATIBLE_CODEX_MODEL_PATTERNS.some(pattern => pattern.test(modelName));
|
|
49
|
+
}
|
|
50
|
+
function isCodexCompatibleModel(model) {
|
|
51
|
+
if (!model.enabled)
|
|
52
|
+
return false;
|
|
53
|
+
const id = getModelId(model);
|
|
54
|
+
if (!id)
|
|
55
|
+
return false;
|
|
56
|
+
const searchText = getSearchText(model);
|
|
57
|
+
if (INCOMPATIBLE_MODEL_PATTERNS.some(pattern => pattern.test(searchText))) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
return COMPATIBLE_CODEX_MODEL_PATTERNS.some(pattern => pattern.test(searchText));
|
|
61
|
+
}
|
|
62
|
+
function extractVersionParts(text) {
|
|
63
|
+
const lower = text.toLowerCase();
|
|
64
|
+
const gptMatch = lower.match(/gpt[-.]?(\d+)(?:[-.](\d+))?(?:[-.](\d+))?/);
|
|
65
|
+
const dateMatch = lower.match(/(20\d{2})[-.]?(\d{2})[-.]?(\d{2})/);
|
|
66
|
+
const version = [
|
|
67
|
+
gptMatch?.[1],
|
|
68
|
+
gptMatch?.[2],
|
|
69
|
+
gptMatch?.[3],
|
|
70
|
+
].map(part => part ? Number(part) : 0);
|
|
71
|
+
if (dateMatch) {
|
|
72
|
+
version.push(Number(dateMatch[1]), Number(dateMatch[2]), Number(dateMatch[3]));
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
version.push(0, 0, 0);
|
|
76
|
+
}
|
|
77
|
+
return version;
|
|
78
|
+
}
|
|
79
|
+
function rankModel(model) {
|
|
80
|
+
const id = getModelId(model);
|
|
81
|
+
const searchText = getSearchText(model);
|
|
82
|
+
const preferredDefaultBonus = /gpt[-.]?5[-.]?4(?:[-.]|\b)/i.test(searchText) ? 1 : 0;
|
|
83
|
+
const codexBonus = /codex/i.test(searchText) ? 1 : 0;
|
|
84
|
+
const defaultBonus = model.default ? 1 : 0;
|
|
85
|
+
const toolBonus = model.features?.tools === false ? 0 : 1;
|
|
86
|
+
const streamingBonus = model.features?.streaming === false ? 0 : 1;
|
|
87
|
+
return {
|
|
88
|
+
model,
|
|
89
|
+
id,
|
|
90
|
+
score: [
|
|
91
|
+
preferredDefaultBonus,
|
|
92
|
+
...extractVersionParts(searchText),
|
|
93
|
+
codexBonus,
|
|
94
|
+
toolBonus,
|
|
95
|
+
streamingBonus,
|
|
96
|
+
defaultBonus,
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function compareRankedModels(a, b) {
|
|
101
|
+
const max = Math.max(a.score.length, b.score.length);
|
|
102
|
+
for (let i = 0; i < max; i++) {
|
|
103
|
+
const diff = (b.score[i] ?? 0) - (a.score[i] ?? 0);
|
|
104
|
+
if (diff !== 0)
|
|
105
|
+
return diff;
|
|
106
|
+
}
|
|
107
|
+
return a.id.localeCompare(b.id);
|
|
108
|
+
}
|
|
109
|
+
function buildCodexCatalog(models) {
|
|
110
|
+
return {
|
|
111
|
+
models: models.map((entry, index) => ({
|
|
112
|
+
slug: entry.id,
|
|
113
|
+
display_name: entry.model.label || entry.id,
|
|
114
|
+
description: 'CodeMie model available for Codex through the Responses API.',
|
|
115
|
+
default_reasoning_level: 'medium',
|
|
116
|
+
supported_reasoning_levels: REASONING_LEVELS,
|
|
117
|
+
shell_type: 'shell_command',
|
|
118
|
+
visibility: 'list',
|
|
119
|
+
supported_in_api: true,
|
|
120
|
+
priority: index,
|
|
121
|
+
additional_speed_tiers: [],
|
|
122
|
+
service_tiers: [],
|
|
123
|
+
availability_nux: null,
|
|
124
|
+
upgrade: null,
|
|
125
|
+
base_instructions: '',
|
|
126
|
+
supports_reasoning_summaries: true,
|
|
127
|
+
default_reasoning_summary: 'none',
|
|
128
|
+
support_verbosity: true,
|
|
129
|
+
default_verbosity: 'medium',
|
|
130
|
+
apply_patch_tool_type: 'freeform',
|
|
131
|
+
web_search_tool_type: 'text_and_image',
|
|
132
|
+
truncation_policy: {
|
|
133
|
+
mode: 'tokens',
|
|
134
|
+
limit: 10000,
|
|
135
|
+
},
|
|
136
|
+
supports_parallel_tool_calls: true,
|
|
137
|
+
supports_image_detail_original: true,
|
|
138
|
+
context_window: 400000,
|
|
139
|
+
max_context_window: 400000,
|
|
140
|
+
effective_context_window_percent: 95,
|
|
141
|
+
experimental_supported_tools: [],
|
|
142
|
+
input_modalities: entry.model.multimodal ? ['text', 'image'] : ['text'],
|
|
143
|
+
supports_search_tool: true,
|
|
144
|
+
})),
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
async function fetchCodeMieModelsForCodex(env) {
|
|
148
|
+
const jwtToken = env.CODEMIE_JWT_TOKEN;
|
|
149
|
+
const baseUrl = env.CODEMIE_BASE_URL;
|
|
150
|
+
if (jwtToken && baseUrl) {
|
|
151
|
+
logger.debug('[codex-models] Fetching CodeMie model list via JWT auth');
|
|
152
|
+
return fetchCodeMieLlmModels(baseUrl, jwtToken);
|
|
153
|
+
}
|
|
154
|
+
const codeMieUrl = env.CODEMIE_URL;
|
|
155
|
+
if (codeMieUrl) {
|
|
156
|
+
const sso = new CodeMieSSO();
|
|
157
|
+
const credentials = await sso.getStoredCredentials(codeMieUrl);
|
|
158
|
+
if (!credentials) {
|
|
159
|
+
throw new ConfigurationError(`SSO credentials not found for ${codeMieUrl}. Run: codemie profile login --url ${codeMieUrl}`);
|
|
160
|
+
}
|
|
161
|
+
logger.debug('[codex-models] Fetching CodeMie model list via SSO auth');
|
|
162
|
+
return fetchCodeMieLlmModels(credentials.apiUrl, credentials.cookies);
|
|
163
|
+
}
|
|
164
|
+
return [];
|
|
165
|
+
}
|
|
166
|
+
async function writeCatalogFile(catalog) {
|
|
167
|
+
const dir = resolveHomeDir('.codex/codemie');
|
|
168
|
+
await mkdir(dir, { recursive: true });
|
|
169
|
+
const catalogPath = join(dir, 'models.json');
|
|
170
|
+
await writeFile(catalogPath, `${JSON.stringify(catalog, null, 2)}\n`, 'utf-8');
|
|
171
|
+
return catalogPath;
|
|
172
|
+
}
|
|
173
|
+
function formatAvailableModelIds(modelIds) {
|
|
174
|
+
return modelIds.join(', ');
|
|
175
|
+
}
|
|
176
|
+
export async function resolveCodexModel(env) {
|
|
177
|
+
const currentModel = env.CODEMIE_MODEL;
|
|
178
|
+
let rawModels = [];
|
|
179
|
+
try {
|
|
180
|
+
rawModels = await fetchCodeMieModelsForCodex(env);
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
if (isCodexCompatibleModelName(currentModel)) {
|
|
184
|
+
const configuredModel = currentModel;
|
|
185
|
+
logger.debug('[codex-models] Failed to fetch CodeMie models; keeping compatible configured model', {
|
|
186
|
+
error: error instanceof Error ? error.message : String(error),
|
|
187
|
+
model: configuredModel,
|
|
188
|
+
});
|
|
189
|
+
return { selectedModel: configuredModel, availableModels: [configuredModel] };
|
|
190
|
+
}
|
|
191
|
+
throw error;
|
|
192
|
+
}
|
|
193
|
+
const rankedModels = rawModels
|
|
194
|
+
.filter(isCodexCompatibleModel)
|
|
195
|
+
.map(rankModel)
|
|
196
|
+
.sort(compareRankedModels);
|
|
197
|
+
if (rankedModels.length === 0) {
|
|
198
|
+
if (isCodexCompatibleModelName(currentModel)) {
|
|
199
|
+
const configuredModel = currentModel;
|
|
200
|
+
logger.debug('[codex-models] CodeMie returned no compatible Codex models; keeping configured GPT/Codex model');
|
|
201
|
+
return { selectedModel: configuredModel, availableModels: [configuredModel] };
|
|
202
|
+
}
|
|
203
|
+
throw new ConfigurationError('No CodeMie GPT/Codex model is available for codemie-codex. ' +
|
|
204
|
+
'Enable a GPT-5/Codex deployment in CodeMie before running Codex.');
|
|
205
|
+
}
|
|
206
|
+
const selectedModel = rankedModels[0].id;
|
|
207
|
+
const catalogPath = await writeCatalogFile(buildCodexCatalog(rankedModels));
|
|
208
|
+
if (currentModel && currentModel !== selectedModel) {
|
|
209
|
+
logger.info(`[codex-models] Using ${selectedModel} for Codex instead of profile model ${currentModel}`);
|
|
210
|
+
}
|
|
211
|
+
return {
|
|
212
|
+
selectedModel,
|
|
213
|
+
catalogPath,
|
|
214
|
+
availableModels: rankedModels.map(entry => entry.id),
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
export function assertExplicitCodexModelAllowed(model, availableModels) {
|
|
218
|
+
if (!isCodexCompatibleModelName(model)) {
|
|
219
|
+
throw new ConfigurationError(`Model "${model}" is not compatible with codemie-codex. ` +
|
|
220
|
+
`Use a GPT/Codex model${availableModels.length ? ` such as: ${formatAvailableModelIds(availableModels)}` : '.'}`);
|
|
221
|
+
}
|
|
222
|
+
if (availableModels.length > 0 && !availableModels.includes(model)) {
|
|
223
|
+
throw new ConfigurationError(`Model "${model}" is not available in CodeMie for codemie-codex. ` +
|
|
224
|
+
`Available models: ${availableModels.join(', ')}`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=codex-models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-models.js","sourceRoot":"","sources":["../../../../src/agents/plugins/codex/codex-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO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AC,CAAC,aAAa,uBAAuB,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CACjH,CAAC;IACJ,CAAC;IAED,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACnE,MAAM,IAAI,kBAAkB,CAC1B,UAAU,KAAK,mDAAmD;YAClE,qBAAqB,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAClD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex Incremental Sync Timer
|
|
3
|
+
*
|
|
4
|
+
* In-process timer that periodically re-parses the active Codex rollout file
|
|
5
|
+
* and writes per-call_id metric deltas + new conversation slices to JSONL.
|
|
6
|
+
*
|
|
7
|
+
* Why this exists: Codex 0.129.0 advertises a `hooks` feature, but on
|
|
8
|
+
* 2026-05-09 smoke tests on `codex exec` neither -c overrides
|
|
9
|
+
* (`-c 'hooks.SessionStart=[...]'`) nor a direct `[[hooks.SessionStart]]`
|
|
10
|
+
* block in `~/.codex/config.toml` fired the configured command. See
|
|
11
|
+
* docs/superpowers/plans/2026-05-09-codex-hooks-incremental-sync.md.
|
|
12
|
+
*
|
|
13
|
+
* The incremental sync timer writes per-call_id metric deltas + new
|
|
14
|
+
* conversation slices to JSONL on every tick, then uploads PENDING payloads
|
|
15
|
+
* to the CodeMie API via SessionSyncer when SSO credentials are available.
|
|
16
|
+
*/
|
|
17
|
+
import type { AgentMetadata } from '../../core/types.js';
|
|
18
|
+
import type { ProcessingContext } from '../../core/session/BaseProcessor.js';
|
|
19
|
+
export interface StartCodexIncrementalSyncOptions {
|
|
20
|
+
/** CodeMie session id (file naming key). */
|
|
21
|
+
sessionId: string;
|
|
22
|
+
/** ms-since-epoch lower bound used to ignore stale rollouts. */
|
|
23
|
+
startedAt: number;
|
|
24
|
+
/** Working directory to match the rollout's projectPath against. */
|
|
25
|
+
cwd: string;
|
|
26
|
+
/** Codex agent metadata (passed straight to CodexSessionAdapter). */
|
|
27
|
+
metadata: AgentMetadata;
|
|
28
|
+
/** Builds a fresh ProcessingContext on each tick (cookies/version may rotate). */
|
|
29
|
+
buildContext: () => ProcessingContext;
|
|
30
|
+
/** CodeMie SSO URL used to load stored credentials (e.g. env.CODEMIE_URL). */
|
|
31
|
+
ssoUrl?: string;
|
|
32
|
+
/** Sync API base URL for the upload context (env.CODEMIE_SYNC_API_URL ?? env.CODEMIE_BASE_URL). */
|
|
33
|
+
syncApiUrl?: string;
|
|
34
|
+
/** CLI version string forwarded to the upload context. */
|
|
35
|
+
cliVersion?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function startCodexIncrementalSync(options: StartCodexIncrementalSyncOptions): void;
|
|
38
|
+
export declare function stopCodexIncrementalSync(sessionId: string): void;
|
|
39
|
+
//# sourceMappingURL=codex.incremental-sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.incremental-sync.d.ts","sourceRoot":"","sources":["../../../../src/agents/plugins/codex/codex.incremental-sync.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAI7E,MAAM,WAAW,gCAAgC;IAC/C,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ,qEAAqE;IACrE,QAAQ,EAAE,aAAa,CAAC;IACxB,kFAAkF;IAClF,YAAY,EAAE,MAAM,iBAAiB,CAAC;IACtC,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mGAAmG;IACnG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAQD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,gCAAgC,GAAG,IAAI,CA+FzF;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAQhE"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// src/agents/plugins/codex/codex.incremental-sync.ts
|
|
2
|
+
/**
|
|
3
|
+
* Codex Incremental Sync Timer
|
|
4
|
+
*
|
|
5
|
+
* In-process timer that periodically re-parses the active Codex rollout file
|
|
6
|
+
* and writes per-call_id metric deltas + new conversation slices to JSONL.
|
|
7
|
+
*
|
|
8
|
+
* Why this exists: Codex 0.129.0 advertises a `hooks` feature, but on
|
|
9
|
+
* 2026-05-09 smoke tests on `codex exec` neither -c overrides
|
|
10
|
+
* (`-c 'hooks.SessionStart=[...]'`) nor a direct `[[hooks.SessionStart]]`
|
|
11
|
+
* block in `~/.codex/config.toml` fired the configured command. See
|
|
12
|
+
* docs/superpowers/plans/2026-05-09-codex-hooks-incremental-sync.md.
|
|
13
|
+
*
|
|
14
|
+
* The incremental sync timer writes per-call_id metric deltas + new
|
|
15
|
+
* conversation slices to JSONL on every tick, then uploads PENDING payloads
|
|
16
|
+
* to the CodeMie API via SessionSyncer when SSO credentials are available.
|
|
17
|
+
*/
|
|
18
|
+
import { realpath as fsRealpath } from 'fs/promises';
|
|
19
|
+
import { CodexSessionAdapter } from './codex.session.js';
|
|
20
|
+
import { logger } from '../../../utils/logger.js';
|
|
21
|
+
const DEFAULT_INTERVAL_MS = 30_000;
|
|
22
|
+
const STARTED_AT_GRACE_MS = 10_000;
|
|
23
|
+
const activeTimers = new Map();
|
|
24
|
+
const tickInFlight = new Map();
|
|
25
|
+
export function startCodexIncrementalSync(options) {
|
|
26
|
+
if (process.env.CODEMIE_CODEX_SYNC_ENABLED === 'false') {
|
|
27
|
+
logger.debug('[codex-incremental-sync] Disabled by CODEMIE_CODEX_SYNC_ENABLED=false');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (activeTimers.has(options.sessionId)) {
|
|
31
|
+
logger.debug(`[codex-incremental-sync] Already running for session ${options.sessionId}`);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const intervalMs = Number(process.env.CODEMIE_CODEX_SYNC_INTERVAL_MS) || DEFAULT_INTERVAL_MS;
|
|
35
|
+
const tick = async () => {
|
|
36
|
+
if (tickInFlight.get(options.sessionId))
|
|
37
|
+
return;
|
|
38
|
+
tickInFlight.set(options.sessionId, true);
|
|
39
|
+
try {
|
|
40
|
+
const adapter = new CodexSessionAdapter(options.metadata);
|
|
41
|
+
const sessions = await adapter.discoverSessions({ maxAgeDays: 1, limit: 10 });
|
|
42
|
+
if (sessions.length === 0)
|
|
43
|
+
return;
|
|
44
|
+
const cwdReal = await safeRealpath(options.cwd);
|
|
45
|
+
for (const descriptor of sessions) {
|
|
46
|
+
if (descriptor.createdAt < options.startedAt - STARTED_AT_GRACE_MS)
|
|
47
|
+
continue;
|
|
48
|
+
let parsed;
|
|
49
|
+
try {
|
|
50
|
+
parsed = await adapter.parseSessionFile(descriptor.filePath, options.sessionId);
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
logger.debug('[codex-incremental-sync] parse failed, skipping', error);
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
const projectPath = parsed.metadata?.projectPath;
|
|
57
|
+
if (!projectPath)
|
|
58
|
+
continue;
|
|
59
|
+
const projectReal = await safeRealpath(projectPath);
|
|
60
|
+
if (projectReal !== cwdReal)
|
|
61
|
+
continue;
|
|
62
|
+
try {
|
|
63
|
+
const result = await adapter.processSession(descriptor.filePath, options.sessionId, options.buildContext());
|
|
64
|
+
logger.debug(`[codex-incremental-sync] tick ok session=${options.sessionId} records=${result.totalRecords}`);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
logger.error('[codex-incremental-sync] processSession failed:', error);
|
|
68
|
+
}
|
|
69
|
+
if (options.ssoUrl && options.syncApiUrl) {
|
|
70
|
+
try {
|
|
71
|
+
const uploadContext = await buildUploadContext(options.sessionId, options.ssoUrl, options.syncApiUrl, options.cliVersion);
|
|
72
|
+
if (uploadContext) {
|
|
73
|
+
const { SessionSyncer } = await import('../../../providers/plugins/sso/session/SessionSyncer.js');
|
|
74
|
+
const syncer = new SessionSyncer();
|
|
75
|
+
const syncResult = await syncer.sync(options.sessionId, uploadContext);
|
|
76
|
+
logger.debug(`[codex-incremental-sync] upload ${syncResult.success ? 'ok' : 'partial'}: ${syncResult.message}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
logger.error('[codex-incremental-sync] upload failed:', error);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return; // Only the most recent matching rollout per tick.
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
logger.error('[codex-incremental-sync] tick failed:', error);
|
|
88
|
+
}
|
|
89
|
+
finally {
|
|
90
|
+
tickInFlight.set(options.sessionId, false);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const timer = setInterval(() => {
|
|
94
|
+
void tick();
|
|
95
|
+
}, intervalMs);
|
|
96
|
+
// Don't pin the Node event loop alive solely on this timer; if the parent
|
|
97
|
+
// process is otherwise idle we want it to exit cleanly when Codex finishes.
|
|
98
|
+
if (typeof timer.unref === 'function') {
|
|
99
|
+
timer.unref();
|
|
100
|
+
}
|
|
101
|
+
activeTimers.set(options.sessionId, timer);
|
|
102
|
+
logger.debug(`[codex-incremental-sync] Started (session=${options.sessionId}, intervalMs=${intervalMs})`);
|
|
103
|
+
}
|
|
104
|
+
export function stopCodexIncrementalSync(sessionId) {
|
|
105
|
+
const timer = activeTimers.get(sessionId);
|
|
106
|
+
if (!timer)
|
|
107
|
+
return;
|
|
108
|
+
clearInterval(timer);
|
|
109
|
+
activeTimers.delete(sessionId);
|
|
110
|
+
tickInFlight.delete(sessionId);
|
|
111
|
+
logger.debug(`[codex-incremental-sync] Stopped (session=${sessionId})`);
|
|
112
|
+
}
|
|
113
|
+
async function buildUploadContext(sessionId, ssoUrl, syncApiUrl, version = '0.0.0') {
|
|
114
|
+
try {
|
|
115
|
+
const { CodeMieSSO } = await import('../../../providers/plugins/sso/sso.auth.js');
|
|
116
|
+
const sso = new CodeMieSSO();
|
|
117
|
+
const credentials = await sso.getStoredCredentials(ssoUrl);
|
|
118
|
+
if (!credentials?.cookies) {
|
|
119
|
+
logger.debug('[codex-incremental-sync] No SSO credentials available, skipping upload');
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
const cookies = Object.entries(credentials.cookies)
|
|
123
|
+
.map(([k, v]) => `${k}=${v}`)
|
|
124
|
+
.join('; ');
|
|
125
|
+
return {
|
|
126
|
+
apiBaseUrl: syncApiUrl,
|
|
127
|
+
cookies,
|
|
128
|
+
clientType: 'codemie-codex',
|
|
129
|
+
version,
|
|
130
|
+
dryRun: false,
|
|
131
|
+
sessionId,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
logger.debug('[codex-incremental-sync] Failed to build upload context:', error);
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
async function safeRealpath(p) {
|
|
140
|
+
try {
|
|
141
|
+
return await fsRealpath(p);
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
return p;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=codex.incremental-sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.incremental-sync.js","sourceRoot":"","sources":["../../../../src/agents/plugins/codex/codex.incremental-sync.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,aAAa,C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ACf,MAAM,CAAC,KAAK,CAAC,0DAA0D,EAAE,KAAK,CAAC,CAAC;QAChF,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,CAAS;IACnC,IAAI,CAAC;QACH,OAAO,MAAM,UAAU,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex path utilities.
|
|
3
|
+
*
|
|
4
|
+
* Codex stores rollout files at:
|
|
5
|
+
* ${CODEX_HOME:-~/.codex}/sessions/YYYY/MM/DD/rollout-{ISO8601}-{uuid}.jsonl
|
|
6
|
+
*
|
|
7
|
+
* Codex does not use XDG conventions by default, but it supports CODEX_HOME
|
|
8
|
+
* for isolating local state.
|
|
9
|
+
*
|
|
10
|
+
* References:
|
|
11
|
+
* - https://developers.openai.com/codex/config-advanced
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Returns the Codex home directory.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getCodexHomePath(): string;
|
|
17
|
+
/**
|
|
18
|
+
* Returns the Codex sessions base directory.
|
|
19
|
+
* Returns null if the directory does not exist (Codex not run yet).
|
|
20
|
+
*/
|
|
21
|
+
export declare function getCodexSessionsPath(): string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the day-specific session directory for a given date:
|
|
24
|
+
* ${CODEX_HOME:-~/.codex}/sessions/YYYY/MM/DD
|
|
25
|
+
*
|
|
26
|
+
* Note: This directory may not exist yet.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getCodexSessionDayPath(date: Date): string;
|
|
29
|
+
//# sourceMappingURL=codex.paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.paths.d.ts","sourceRoot":"","sources":["../../../../src/agents/plugins/codex/codex.paths.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;AAMH;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,IAAI,CAGpD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAKzD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// src/agents/plugins/codex/codex.paths.ts
|
|
2
|
+
/**
|
|
3
|
+
* Codex path utilities.
|
|
4
|
+
*
|
|
5
|
+
* Codex stores rollout files at:
|
|
6
|
+
* ${CODEX_HOME:-~/.codex}/sessions/YYYY/MM/DD/rollout-{ISO8601}-{uuid}.jsonl
|
|
7
|
+
*
|
|
8
|
+
* Codex does not use XDG conventions by default, but it supports CODEX_HOME
|
|
9
|
+
* for isolating local state.
|
|
10
|
+
*
|
|
11
|
+
* References:
|
|
12
|
+
* - https://developers.openai.com/codex/config-advanced
|
|
13
|
+
*/
|
|
14
|
+
import { homedir } from 'os';
|
|
15
|
+
import { join } from 'path';
|
|
16
|
+
import { existsSync } from 'fs';
|
|
17
|
+
/**
|
|
18
|
+
* Returns the Codex home directory.
|
|
19
|
+
*/
|
|
20
|
+
export function getCodexHomePath() {
|
|
21
|
+
return process.env.CODEX_HOME || join(homedir(), '.codex');
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Returns the Codex sessions base directory.
|
|
25
|
+
* Returns null if the directory does not exist (Codex not run yet).
|
|
26
|
+
*/
|
|
27
|
+
export function getCodexSessionsPath() {
|
|
28
|
+
const sessionsPath = join(getCodexHomePath(), 'sessions');
|
|
29
|
+
return existsSync(sessionsPath) ? sessionsPath : null;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Returns the day-specific session directory for a given date:
|
|
33
|
+
* ${CODEX_HOME:-~/.codex}/sessions/YYYY/MM/DD
|
|
34
|
+
*
|
|
35
|
+
* Note: This directory may not exist yet.
|
|
36
|
+
*/
|
|
37
|
+
export function getCodexSessionDayPath(date) {
|
|
38
|
+
const year = date.getFullYear().toString();
|
|
39
|
+
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
40
|
+
const day = date.getDate().toString().padStart(2, '0');
|
|
41
|
+
return join(getCodexHomePath(), 'sessions', year, month, day);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=codex.paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.paths.js","sourceRoot":"","sources":["../../../../src/agents/plugins/codex/codex.paths.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAEhC;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC7D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,EAAE,EAAE,UAAU,CAAC,CAAC;IAC1D,OAAO,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC;AACxD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAU;IAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAC;IAC3C,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAChE,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACvD,OAAO,IAAI,CAAC,gBAAgB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex Agent Plugin
|
|
3
|
+
*
|
|
4
|
+
* Registers OpenAI Codex CLI (@openai/codex) as a selectable agent in CodeMie.
|
|
5
|
+
*
|
|
6
|
+
* Config injection strategy:
|
|
7
|
+
* - CODEMIE_BASE_URL → OPENAI_BASE_URL (env var, picked up natively by Codex)
|
|
8
|
+
* - CODEMIE_API_KEY → OPENAI_API_KEY + CODEMIE_API_KEY (env vars via transformEnvVars)
|
|
9
|
+
* - Model injected via: --model <model>
|
|
10
|
+
* - Provider: model_providers.codemie with env_key=CODEMIE_API_KEY (bypasses ~/.codex/auth.json)
|
|
11
|
+
* auth.json has highest priority for the default openai provider; a custom provider with
|
|
12
|
+
* env_key pointing to CODEMIE_API_KEY bypasses it since auth.json only covers openai.
|
|
13
|
+
*
|
|
14
|
+
* Session lifecycle (CLI-level via processEvent):
|
|
15
|
+
* 1. onSessionStart → processEvent(SessionStart) — creates session record + sends start metrics
|
|
16
|
+
* → startCodexIncrementalSync — kicks off the in-process timer
|
|
17
|
+
* 2. enrichArgs → transform --task, inject --model + model_providers.codemie + tuning flags
|
|
18
|
+
* 3. [Codex runs]
|
|
19
|
+
* 4. onSessionEnd → stopCodexIncrementalSync → process rollout → processEvent(SessionEnd)
|
|
20
|
+
*
|
|
21
|
+
* Why no Codex hooks?
|
|
22
|
+
* Codex 0.129.0 advertises a `hooks` feature (stable per `codex features list`),
|
|
23
|
+
* but smoke tests on 2026-05-09 showed that neither -c overrides
|
|
24
|
+
* (`-c 'hooks.SessionStart=[...]'`) nor a direct `[[hooks.SessionStart]]` block
|
|
25
|
+
* in `~/.codex/config.toml` fired the configured command in `codex exec`.
|
|
26
|
+
* See docs/superpowers/plans/2026-05-09-codex-hooks-incremental-sync.md
|
|
27
|
+
* and https://github.com/openai/codex/issues/17532.
|
|
28
|
+
*
|
|
29
|
+
* Until the actual hook delivery mechanism is documented (likely tied to the
|
|
30
|
+
* `~/.codex/plugins/<name>/.codex-plugin/plugin.json` plugin manifest format),
|
|
31
|
+
* we run an in-process timer (codex.incremental-sync.ts) inside `codemie-cli`
|
|
32
|
+
* to keep `_metrics.jsonl` and `_conversation.jsonl` warm. The SSO proxy timer
|
|
33
|
+
* (sso.session-sync.plugin.ts) handles the API push as usual.
|
|
34
|
+
*
|
|
35
|
+
* References:
|
|
36
|
+
* - OpenAI Codex CLI: https://github.com/openai/codex
|
|
37
|
+
* - Configuration: https://github.com/openai/codex/blob/main/codex-rs/docs/configuration.md
|
|
38
|
+
* - Advanced config: https://developers.openai.com/codex/config-advanced
|
|
39
|
+
* - CLI Reference: https://github.com/openai/codex/blob/main/codex-rs/docs/cli-reference.md
|
|
40
|
+
* - Hooks (deferred): https://developers.openai.com/codex/hooks
|
|
41
|
+
*/
|
|
42
|
+
import type { AgentMetadata } from '../../core/types.js';
|
|
43
|
+
import { BaseAgentAdapter } from '../../core/BaseAgentAdapter.js';
|
|
44
|
+
import type { SessionAdapter } from '../../core/session/BaseSessionAdapter.js';
|
|
45
|
+
import type { BaseExtensionInstaller } from '../../core/extension/BaseExtensionInstaller.js';
|
|
46
|
+
export declare const CodexPluginMetadata: AgentMetadata;
|
|
47
|
+
/**
|
|
48
|
+
* Codex agent plugin
|
|
49
|
+
*
|
|
50
|
+
* Phase 1: Core plugin with CLI wrapping and session tracking.
|
|
51
|
+
* Phase 2: Rollout file analytics — discovery, parsing, MetricDelta writing.
|
|
52
|
+
*/
|
|
53
|
+
export declare class CodexPlugin extends BaseAgentAdapter {
|
|
54
|
+
private readonly sessionAdapter;
|
|
55
|
+
constructor();
|
|
56
|
+
/**
|
|
57
|
+
* Check whether the `codex` binary is available on PATH.
|
|
58
|
+
* Respects CODEMIE_CODEX_BIN environment variable override.
|
|
59
|
+
*/
|
|
60
|
+
isInstalled(): Promise<boolean>;
|
|
61
|
+
/**
|
|
62
|
+
* Get Codex version (override from BaseAgentAdapter).
|
|
63
|
+
* Codex versions can be emitted as plain semver or with a command prefix,
|
|
64
|
+
* for example: '0.129.0', 'codex 0.129.0', or 'codex-cli 0.129.0'.
|
|
65
|
+
* Base compatibility checks require just the semantic version.
|
|
66
|
+
*
|
|
67
|
+
* @returns Version string or null if not installed
|
|
68
|
+
*/
|
|
69
|
+
getVersion(): Promise<string | null>;
|
|
70
|
+
protected setupProxy(env: NodeJS.ProcessEnv): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Return session adapter for rollout analytics.
|
|
73
|
+
*/
|
|
74
|
+
getSessionAdapter(): SessionAdapter;
|
|
75
|
+
/**
|
|
76
|
+
* No extension installer — Codex is installed directly via npm.
|
|
77
|
+
*/
|
|
78
|
+
getExtensionInstaller(): BaseExtensionInstaller | undefined;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=codex.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.plugin.d.ts","sourceRoot":"","sources":["../../../../src/agents/plugins/codex/codex.plugin.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAyD7F,eAAO,MAAM,mBAAmB,EAAE,aA4SjC,CAAC;AA6BF;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,gBAAgB;IAC/C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;;IAOhD;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAerC;;;;;;;OAOG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;cAejB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB1E;;OAEG;IACH,iBAAiB,IAAI,cAAc;IAInC;;OAEG;IACH,qBAAqB,IAAI,sBAAsB,GAAG,SAAS;CAG5D"}
|