@codemieai/code 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- 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/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/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 +92 -15
- 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/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 +3 -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,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,CAAC;AAGrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAqBlD,MAAM,mBAAmB,GAAG,MAAM,CAAC;AACnC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEnC,MAAM,YAAY,GAAG,IAAI,GAAG,EAA0B,CAAC;AACvD,MAAM,YAAY,GAA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ACX,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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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"}
|