@codemieai/code 0.15.0 → 0.15.2
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/CHANGELOG.md +75 -0
- package/bin/codemie.js +52 -0
- package/dist/agents/core/AgentCLI.d.ts.map +1 -1
- package/dist/agents/core/AgentCLI.js +6 -0
- package/dist/agents/core/AgentCLI.js.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.d.ts +25 -0
- package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.js +137 -127
- package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
- package/dist/agents/core/session/BaseProcessor.d.ts +10 -0
- package/dist/agents/core/session/BaseProcessor.d.ts.map +1 -1
- package/dist/agents/core/session/BaseProcessor.js +11 -1
- package/dist/agents/core/session/BaseProcessor.js.map +1 -1
- package/dist/agents/core/session/BaseSessionAdapter.d.ts +4 -0
- package/dist/agents/core/session/BaseSessionAdapter.d.ts.map +1 -1
- package/dist/agents/core/types.d.ts +11 -5
- package/dist/agents/core/types.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.models.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.models.js +12 -11
- package/dist/agents/plugins/claude/claude.models.js.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts +3 -3
- package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +26 -13
- package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
- package/dist/agents/plugins/claude/claude.session.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.session.js +27 -1
- package/dist/agents/plugins/claude/claude.session.js.map +1 -1
- package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/agents/plugins/claude/plugin/hooks/hooks.json +7 -7
- package/dist/agents/plugins/codex/codex.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/codex/codex.plugin.js +7 -6
- package/dist/agents/plugins/codex/codex.plugin.js.map +1 -1
- package/dist/agents/plugins/copilot-cli/copilot-cli.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/copilot-cli/copilot-cli.plugin.js +5 -2
- package/dist/agents/plugins/copilot-cli/copilot-cli.plugin.js.map +1 -1
- package/dist/agents/plugins/gemini/extension/gemini-extension.json +1 -1
- package/dist/agents/plugins/gemini/extension/hooks/hooks.json +7 -7
- package/dist/agents/plugins/gemini/gemini.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/gemini/gemini.plugin.js +7 -6
- package/dist/agents/plugins/gemini/gemini.plugin.js.map +1 -1
- package/dist/agents/plugins/gemini/gemini.session-adapter.d.ts +1 -1
- package/dist/agents/plugins/gemini/gemini.session-adapter.d.ts.map +1 -1
- package/dist/agents/plugins/gemini/gemini.session-adapter.js +155 -16
- package/dist/agents/plugins/gemini/gemini.session-adapter.js.map +1 -1
- package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.d.ts.map +1 -1
- package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.js +77 -31
- package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.js.map +1 -1
- package/dist/agents/plugins/gemini/session/utils/turn-detector.d.ts +1 -1
- package/dist/agents/plugins/gemini/session/utils/turn-detector.d.ts.map +1 -1
- package/dist/agents/plugins/gemini/session/utils/turn-detector.js +7 -1
- package/dist/agents/plugins/gemini/session/utils/turn-detector.js.map +1 -1
- package/dist/agents/plugins/kimi/kimi.hook-config-injector.d.ts.map +1 -1
- package/dist/agents/plugins/kimi/kimi.hook-config-injector.js +26 -5
- package/dist/agents/plugins/kimi/kimi.hook-config-injector.js.map +1 -1
- package/dist/agents/plugins/kimi/kimi.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/kimi/kimi.plugin.js +5 -2
- package/dist/agents/plugins/kimi/kimi.plugin.js.map +1 -1
- package/dist/cli/commands/analytics/cost/claude-dispatch-allocation.d.ts +6 -0
- package/dist/cli/commands/analytics/cost/claude-dispatch-allocation.d.ts.map +1 -0
- package/dist/cli/commands/analytics/cost/claude-dispatch-allocation.js +115 -0
- package/dist/cli/commands/analytics/cost/claude-dispatch-allocation.js.map +1 -0
- package/dist/cli/commands/analytics/cost/claude-lifecycle.d.ts +6 -0
- package/dist/cli/commands/analytics/cost/claude-lifecycle.d.ts.map +1 -0
- package/dist/cli/commands/analytics/cost/claude-lifecycle.js +107 -0
- package/dist/cli/commands/analytics/cost/claude-lifecycle.js.map +1 -0
- package/dist/cli/commands/analytics/cost/claude-native.d.ts +54 -0
- package/dist/cli/commands/analytics/cost/claude-native.d.ts.map +1 -0
- package/dist/cli/commands/analytics/cost/claude-native.js +14 -0
- package/dist/cli/commands/analytics/cost/claude-native.js.map +1 -0
- package/dist/cli/commands/analytics/cost/claude-ownership.d.ts +23 -0
- package/dist/cli/commands/analytics/cost/claude-ownership.d.ts.map +1 -0
- package/dist/cli/commands/analytics/cost/claude-ownership.js +99 -0
- package/dist/cli/commands/analytics/cost/claude-ownership.js.map +1 -0
- package/dist/cli/commands/analytics/cost/claude-trace.d.ts +28 -0
- package/dist/cli/commands/analytics/cost/claude-trace.d.ts.map +1 -0
- package/dist/cli/commands/analytics/cost/claude-trace.js +120 -0
- package/dist/cli/commands/analytics/cost/claude-trace.js.map +1 -0
- package/dist/cli/commands/analytics/cost/cost-enricher.d.ts +1 -1
- package/dist/cli/commands/analytics/cost/cost-enricher.d.ts.map +1 -1
- package/dist/cli/commands/analytics/cost/cost-enricher.js +34 -43
- package/dist/cli/commands/analytics/cost/cost-enricher.js.map +1 -1
- package/dist/cli/commands/analytics/cost/dispatch-allocation.d.ts +18 -0
- package/dist/cli/commands/analytics/cost/dispatch-allocation.d.ts.map +1 -0
- package/dist/cli/commands/analytics/cost/dispatch-allocation.js +53 -0
- package/dist/cli/commands/analytics/cost/dispatch-allocation.js.map +1 -0
- package/dist/cli/commands/analytics/cost/dispatch-extractor.d.ts +8 -13
- package/dist/cli/commands/analytics/cost/dispatch-extractor.d.ts.map +1 -1
- package/dist/cli/commands/analytics/cost/dispatch-extractor.js +131 -69
- package/dist/cli/commands/analytics/cost/dispatch-extractor.js.map +1 -1
- package/dist/cli/commands/analytics/cost/types.d.ts +39 -0
- package/dist/cli/commands/analytics/cost/types.d.ts.map +1 -1
- package/dist/cli/commands/analytics/cost/types.js.map +1 -1
- package/dist/cli/commands/analytics/cost/usage-readers.d.ts +2 -0
- package/dist/cli/commands/analytics/cost/usage-readers.d.ts.map +1 -1
- package/dist/cli/commands/analytics/cost/usage-readers.js +14 -3
- package/dist/cli/commands/analytics/cost/usage-readers.js.map +1 -1
- package/dist/cli/commands/analytics/data-loader.d.ts +13 -0
- package/dist/cli/commands/analytics/data-loader.d.ts.map +1 -1
- package/dist/cli/commands/analytics/data-loader.js +6 -0
- package/dist/cli/commands/analytics/data-loader.js.map +1 -1
- package/dist/cli/commands/analytics/native-loader.d.ts +1 -1
- package/dist/cli/commands/analytics/native-loader.d.ts.map +1 -1
- package/dist/cli/commands/analytics/native-loader.js +25 -3
- package/dist/cli/commands/analytics/native-loader.js.map +1 -1
- package/dist/cli/commands/analytics/otel-loader.d.ts.map +1 -1
- package/dist/cli/commands/analytics/otel-loader.js +5 -0
- package/dist/cli/commands/analytics/otel-loader.js.map +1 -1
- package/dist/cli/commands/analytics/report/client/app.js +302 -125
- package/dist/cli/commands/analytics/report/payload-builder.d.ts.map +1 -1
- package/dist/cli/commands/analytics/report/payload-builder.js +64 -13
- package/dist/cli/commands/analytics/report/payload-builder.js.map +1 -1
- package/dist/cli/commands/analytics/report/template.html +50 -2
- package/dist/cli/commands/analytics/report/types.d.ts +16 -0
- package/dist/cli/commands/analytics/report/types.d.ts.map +1 -1
- package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts +6 -0
- package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts.map +1 -1
- package/dist/cli/commands/doctor/checks/AgentsCheck.js +37 -33
- package/dist/cli/commands/doctor/checks/AgentsCheck.js.map +1 -1
- package/dist/cli/commands/doctor/index.d.ts.map +1 -1
- package/dist/cli/commands/doctor/index.js +11 -0
- package/dist/cli/commands/doctor/index.js.map +1 -1
- package/dist/cli/commands/hook.d.ts.map +1 -1
- package/dist/cli/commands/hook.js +72 -12
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +5 -9
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/mcp/index.d.ts.map +1 -1
- package/dist/cli/commands/mcp/index.js +68 -17
- package/dist/cli/commands/mcp/index.js.map +1 -1
- package/dist/cli/commands/proxy/connectors/desktop.d.ts +13 -9
- package/dist/cli/commands/proxy/connectors/desktop.d.ts.map +1 -1
- package/dist/cli/commands/proxy/connectors/desktop.js +27 -13
- package/dist/cli/commands/proxy/connectors/desktop.js.map +1 -1
- package/dist/cli/commands/setup.d.ts +0 -16
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +79 -149
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/tips.d.ts +10 -0
- package/dist/cli/commands/tips.d.ts.map +1 -0
- package/dist/cli/commands/tips.js +142 -0
- package/dist/cli/commands/tips.js.map +1 -0
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +12 -10
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/whatsnew.d.ts +6 -0
- package/dist/cli/commands/whatsnew.d.ts.map +1 -0
- package/dist/cli/commands/whatsnew.js +37 -0
- package/dist/cli/commands/whatsnew.js.map +1 -0
- package/dist/cli/first-time.d.ts.map +1 -1
- package/dist/cli/first-time.js +4 -0
- package/dist/cli/first-time.js.map +1 -1
- package/dist/cli/index.js +4 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/providers/core/codemie-auth-helpers.d.ts +1 -1
- package/dist/providers/core/codemie-auth-helpers.d.ts.map +1 -1
- package/dist/providers/core/codemie-auth-helpers.js +3 -3
- package/dist/providers/core/codemie-auth-helpers.js.map +1 -1
- package/dist/providers/core/types.d.ts +16 -28
- package/dist/providers/core/types.d.ts.map +1 -1
- package/dist/providers/core/types.js.map +1 -1
- package/dist/providers/integration/setup-ui.d.ts +5 -3
- package/dist/providers/integration/setup-ui.d.ts.map +1 -1
- package/dist/providers/integration/setup-ui.js +6 -4
- package/dist/providers/integration/setup-ui.js.map +1 -1
- package/dist/providers/plugins/litellm/litellm.setup-steps.d.ts.map +1 -1
- package/dist/providers/plugins/litellm/litellm.setup-steps.js +4 -23
- package/dist/providers/plugins/litellm/litellm.setup-steps.js.map +1 -1
- package/dist/providers/plugins/ollama/ollama.library.d.ts +37 -0
- package/dist/providers/plugins/ollama/ollama.library.d.ts.map +1 -0
- package/dist/providers/plugins/ollama/ollama.library.js +105 -0
- package/dist/providers/plugins/ollama/ollama.library.js.map +1 -0
- package/dist/providers/plugins/ollama/ollama.models.d.ts +3 -1
- package/dist/providers/plugins/ollama/ollama.models.d.ts.map +1 -1
- package/dist/providers/plugins/ollama/ollama.models.js +5 -39
- package/dist/providers/plugins/ollama/ollama.models.js.map +1 -1
- package/dist/providers/plugins/ollama/ollama.setup-steps.d.ts.map +1 -1
- package/dist/providers/plugins/ollama/ollama.setup-steps.js +196 -6
- package/dist/providers/plugins/ollama/ollama.setup-steps.js.map +1 -1
- package/dist/providers/plugins/ollama/ollama.template.d.ts.map +1 -1
- package/dist/providers/plugins/ollama/ollama.template.js +12 -32
- package/dist/providers/plugins/ollama/ollama.template.js.map +1 -1
- package/dist/providers/plugins/sso/session/BaseProcessor.d.ts +4 -0
- package/dist/providers/plugins/sso/session/BaseProcessor.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/SessionSyncer.d.ts +12 -0
- package/dist/providers/plugins/sso/session/SessionSyncer.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/SessionSyncer.js +89 -0
- package/dist/providers/plugins/sso/session/SessionSyncer.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 +75 -41
- package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.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 +23 -4
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.js.map +1 -1
- package/dist/providers/plugins/sso/sso.auth.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.auth.js +6 -2
- package/dist/providers/plugins/sso/sso.auth.js.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.js +22 -39
- package/dist/providers/plugins/sso/sso.setup-steps.js.map +1 -1
- package/dist/utils/cli-updater.d.ts.map +1 -1
- package/dist/utils/cli-updater.js +2 -8
- package/dist/utils/cli-updater.js.map +1 -1
- package/dist/utils/env.d.ts +12 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/env.js +18 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/hook-command.d.ts +6 -0
- package/dist/utils/hook-command.d.ts.map +1 -1
- package/dist/utils/hook-command.js +52 -6
- package/dist/utils/hook-command.js.map +1 -1
- package/dist/utils/pricing.json +38 -6
- package/dist/utils/security.d.ts +28 -2
- package/dist/utils/security.d.ts.map +1 -1
- package/dist/utils/security.js +84 -24
- package/dist/utils/security.js.map +1 -1
- package/dist/utils/tips.d.ts +103 -0
- package/dist/utils/tips.d.ts.map +1 -0
- package/dist/utils/tips.js +221 -0
- package/dist/utils/tips.js.map +1 -0
- package/dist/utils/version-warnings.d.ts +41 -0
- package/dist/utils/version-warnings.d.ts.map +1 -0
- package/dist/utils/version-warnings.js +93 -0
- package/dist/utils/version-warnings.js.map +1 -0
- package/dist/utils/whatsnew.d.ts +83 -0
- package/dist/utils/whatsnew.d.ts.map +1 -0
- package/dist/utils/whatsnew.js +200 -0
- package/dist/utils/whatsnew.js.map +1 -0
- package/package.json +5 -10
- package/scripts/release.sh +9 -3
- package/src/utils/tips.json +806 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What's New — release notes from CHANGELOG.md
|
|
3
|
+
*
|
|
4
|
+
* CHANGELOG.md (Keep a Changelog format) is the curated source of truth for
|
|
5
|
+
* release notes. It ships inside the npm package and is consumed by:
|
|
6
|
+
* - `codemie whatsnew` — browse notes for the current, one, or all versions
|
|
7
|
+
* - the once-per-upgrade startup notice in bin/codemie.js, which shows the
|
|
8
|
+
* current version's notes once and records a `.last-seen-version` marker
|
|
9
|
+
* under the CodeMie home directory
|
|
10
|
+
*
|
|
11
|
+
* This module must stay safe to import from the bin entry point, so its
|
|
12
|
+
* dependencies are limited to fs/path/chalk plus the logger, paths, and tips
|
|
13
|
+
* utilities — never commander or the CLI layer.
|
|
14
|
+
*
|
|
15
|
+
* Environment Variables:
|
|
16
|
+
* - CODEMIE_TIPS=false|0|no: also suppresses the upgrade notice. The "reduce
|
|
17
|
+
* chatter" switch is shared with feature tips on purpose — see tips.ts.
|
|
18
|
+
*/
|
|
19
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
|
|
20
|
+
import path from 'path';
|
|
21
|
+
import chalk from 'chalk';
|
|
22
|
+
import { logger } from './logger.js';
|
|
23
|
+
import { getCodemiePath, getDirname } from './paths.js';
|
|
24
|
+
import { isTipsEnabled } from './tips.js';
|
|
25
|
+
/**
|
|
26
|
+
* Tolerant Keep-a-Changelog parser. Recognizes `## [x.y.z] - date` headings,
|
|
27
|
+
* `### Section` subheadings, and `- item` bullets; everything else is skipped.
|
|
28
|
+
*/
|
|
29
|
+
export function parseChangelog(content) {
|
|
30
|
+
const entries = [];
|
|
31
|
+
let currentEntry = null;
|
|
32
|
+
let currentSection = null;
|
|
33
|
+
for (const line of content.split(/\r?\n/)) {
|
|
34
|
+
const versionMatch = line.match(/^##\s+\[([^\]]+)\](?:\s*-\s*(.+?))?\s*$/);
|
|
35
|
+
if (versionMatch) {
|
|
36
|
+
currentEntry = {
|
|
37
|
+
version: versionMatch[1].trim(),
|
|
38
|
+
date: versionMatch[2]?.trim(),
|
|
39
|
+
sections: []
|
|
40
|
+
};
|
|
41
|
+
entries.push(currentEntry);
|
|
42
|
+
currentSection = null;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (!currentEntry) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const sectionMatch = line.match(/^###\s+(.+?)\s*$/);
|
|
49
|
+
if (sectionMatch) {
|
|
50
|
+
currentSection = { title: sectionMatch[1].trim(), items: [] };
|
|
51
|
+
currentEntry.sections.push(currentSection);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const itemMatch = line.match(/^\s*[-*]\s+(.+?)\s*$/);
|
|
55
|
+
if (itemMatch && currentSection) {
|
|
56
|
+
currentSection.items.push(itemMatch[1].trim());
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return entries;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Locate CHANGELOG.md at the package root. Works both from src/utils (dev
|
|
63
|
+
* repo) and dist/utils (built/installed package) — the root is two levels up
|
|
64
|
+
* in both layouts.
|
|
65
|
+
*
|
|
66
|
+
* @returns Absolute path to CHANGELOG.md, or null when it is not shipped
|
|
67
|
+
*/
|
|
68
|
+
export function getChangelogPath() {
|
|
69
|
+
const changelogPath = path.resolve(getDirname(import.meta.url), '../../CHANGELOG.md');
|
|
70
|
+
return existsSync(changelogPath) ? changelogPath : null;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Read release notes from the changelog.
|
|
74
|
+
*
|
|
75
|
+
* @param version - When given, the entry for this exact version; if there is
|
|
76
|
+
* no matching heading, falls back to the newest versioned entry (or
|
|
77
|
+
* Unreleased when that is all there is) so the once-per-upgrade notice
|
|
78
|
+
* always has something to show
|
|
79
|
+
* @returns Parsed entries (newest first, as written), or an empty array when
|
|
80
|
+
* the changelog is missing or unparseable
|
|
81
|
+
*/
|
|
82
|
+
export function getReleaseNotes(version) {
|
|
83
|
+
const changelogPath = getChangelogPath();
|
|
84
|
+
if (!changelogPath) {
|
|
85
|
+
logger.debug('[whatsnew] CHANGELOG.md not found at package root');
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
const entries = parseChangelog(readFileSync(changelogPath, 'utf-8'));
|
|
90
|
+
if (entries.length === 0) {
|
|
91
|
+
logger.debug('[whatsnew] CHANGELOG.md parsed to zero release entries', { changelogPath });
|
|
92
|
+
}
|
|
93
|
+
if (!version) {
|
|
94
|
+
return entries;
|
|
95
|
+
}
|
|
96
|
+
const exact = entries.filter(entry => entry.version === version);
|
|
97
|
+
if (exact.length > 0) {
|
|
98
|
+
return exact;
|
|
99
|
+
}
|
|
100
|
+
// No heading for this exact version (changelog not updated for the
|
|
101
|
+
// release) — fall back to the newest versioned entry so the once-per-
|
|
102
|
+
// upgrade notice still shows something before the version is marked seen.
|
|
103
|
+
const fallback = entries.find(entry => entry.version !== 'Unreleased') ?? entries[0];
|
|
104
|
+
if (fallback) {
|
|
105
|
+
logger.debug(`[whatsnew] No changelog entry for ${version} — falling back to ${fallback.version}`);
|
|
106
|
+
return [fallback];
|
|
107
|
+
}
|
|
108
|
+
return [];
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
logger.debug('[whatsnew] Failed to read changelog:', error);
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const lastSeenFilePath = () => getCodemiePath('.last-seen-version');
|
|
116
|
+
/**
|
|
117
|
+
* Version for which the upgrade notice was last shown, or null if never.
|
|
118
|
+
* Best-effort: an unreadable marker is treated as "never seen".
|
|
119
|
+
*/
|
|
120
|
+
export function getLastSeenVersion() {
|
|
121
|
+
try {
|
|
122
|
+
return readFileSync(lastSeenFilePath(), 'utf-8').trim() || null;
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Record that the upgrade notice was shown for a version. Best-effort: write
|
|
130
|
+
* failures are swallowed — worst case the notice shows once more.
|
|
131
|
+
*/
|
|
132
|
+
export function markVersionSeen(version) {
|
|
133
|
+
try {
|
|
134
|
+
const file = lastSeenFilePath();
|
|
135
|
+
mkdirSync(path.dirname(file), { recursive: true });
|
|
136
|
+
writeFileSync(file, version, 'utf-8');
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
logger.debug('[whatsnew] Failed to persist last-seen version (non-fatal):', error);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Render release notes to the console. Never throws.
|
|
144
|
+
*
|
|
145
|
+
* @param options.maxItems - Cap on the total number of bullets printed across
|
|
146
|
+
* all entries; when truncated, a pointer to `codemie whatsnew` is appended
|
|
147
|
+
*/
|
|
148
|
+
export function renderReleaseNotes(entries, options) {
|
|
149
|
+
try {
|
|
150
|
+
if (entries.length === 0) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
let remaining = options?.maxItems ?? Number.POSITIVE_INFINITY;
|
|
154
|
+
let truncated = false;
|
|
155
|
+
console.log();
|
|
156
|
+
for (const entry of entries) {
|
|
157
|
+
if (remaining <= 0) {
|
|
158
|
+
truncated = true;
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
const dateSuffix = entry.date ? ` (${entry.date})` : '';
|
|
162
|
+
console.log(chalk.bold.cyan(`## What's new in ${entry.version}${dateSuffix}`));
|
|
163
|
+
for (const section of entry.sections) {
|
|
164
|
+
if (remaining <= 0) {
|
|
165
|
+
truncated = true;
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
if (section.items.length === 0) {
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
console.log(chalk.dim(` ${section.title}`));
|
|
172
|
+
for (const item of section.items) {
|
|
173
|
+
if (remaining <= 0) {
|
|
174
|
+
truncated = true;
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
console.log(` • ${item}`);
|
|
178
|
+
remaining--;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
console.log();
|
|
182
|
+
}
|
|
183
|
+
if (truncated) {
|
|
184
|
+
console.log(chalk.dim(' … run `codemie whatsnew` for the full notes'));
|
|
185
|
+
console.log();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
logger.debug('[whatsnew] renderReleaseNotes failed (non-fatal):', error);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Whether the once-per-upgrade notice may print. Deliberately shares the
|
|
194
|
+
* CODEMIE_TIPS switch with feature tips — one "reduce chatter" toggle for all
|
|
195
|
+
* informational CLI output.
|
|
196
|
+
*/
|
|
197
|
+
export function isWhatsNewEnabled() {
|
|
198
|
+
return isTipsEnabled();
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=whatsnew.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whatsnew.js","sourceRoot":"","sources":["../../src/utils/whatsnew.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAmB1C;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,MAAM,OAAO,GAAmB,EAAE,CAA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,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,mDAAmD,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,aAAa,EAAE,CAAC;AACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codemieai/code",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "Unified AI coding assistant CLI - Manage Claude Code, Gemini & custom agents. Multi-provider support (OpenAI, Azure, LiteLLM, SSO). Built-in LangGraph agent with file operations & git integration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,7 +26,9 @@
|
|
|
26
26
|
"bin",
|
|
27
27
|
"scripts",
|
|
28
28
|
"src/workflows/templates/**/*.yml",
|
|
29
|
+
"src/utils/tips.json",
|
|
29
30
|
"README.md",
|
|
31
|
+
"CHANGELOG.md",
|
|
30
32
|
"LICENSE"
|
|
31
33
|
],
|
|
32
34
|
"scripts": {
|
|
@@ -35,14 +37,7 @@
|
|
|
35
37
|
"copy-plugin": "node scripts/copy-plugins.js",
|
|
36
38
|
"prepare:install-artifacts": "node scripts/prepare-install-artifacts.mjs",
|
|
37
39
|
"dev": "tsc --watch",
|
|
38
|
-
"test": "vitest",
|
|
39
|
-
"test:unit": "vitest run --project unit",
|
|
40
|
-
"test:integration": "vitest run --project cli",
|
|
41
|
-
"test:integration:cli": "vitest run --project cli",
|
|
42
|
-
"test:integration:vscode-models": "vitest run --project cli tests/integration/vscode-byok.test.ts tests/integration/vscode-models.live.test.ts",
|
|
43
|
-
"test:integration:agent": "vitest run --project agent",
|
|
44
|
-
"test:run": "vitest run --project unit --project cli",
|
|
45
|
-
"test:all": "vitest run --project unit && vitest run --project cli && vitest run --project agent",
|
|
40
|
+
"test": "vitest run --project unit && vitest run --project cli && vitest run --project agent",
|
|
46
41
|
"test:coverage": "vitest run --project unit --coverage",
|
|
47
42
|
"test:watch": "vitest --watch",
|
|
48
43
|
"test:ui": "vitest --ui",
|
|
@@ -55,7 +50,7 @@
|
|
|
55
50
|
"commitlint:last": "commitlint --from HEAD~1 --to HEAD --verbose",
|
|
56
51
|
"validate:secrets": "node scripts/validate-secrets.js",
|
|
57
52
|
"license-check": "node scripts/license-check.js",
|
|
58
|
-
"ci": "npm run license-check && npm run lint && npm run build &&
|
|
53
|
+
"ci": "npm run license-check && npm run lint && npm run build && vitest run --project unit && vitest run --project cli",
|
|
59
54
|
"ci:full": "npm run commitlint:last && npm run ci",
|
|
60
55
|
"prepare": "husky",
|
|
61
56
|
"prepublishOnly": "npm run build",
|
package/scripts/release.sh
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# Designed to be resumable - can continue from failed steps
|
|
7
7
|
#
|
|
8
8
|
# Release flow: version bump → commit → agent tests gate → tag → push → GitHub release
|
|
9
|
-
# Agent tests gate: runs `
|
|
9
|
+
# Agent tests gate: runs `npx vitest run --project agent` before tagging.
|
|
10
10
|
# - Tests pass → continue automatically
|
|
11
11
|
# - Tests fail → release blocked (fix tests first)
|
|
12
12
|
# - Tests cannot run (missing SSO/JWT credentials) → manual confirmation required
|
|
@@ -132,6 +132,12 @@ if ! git diff --quiet || ! git diff --cached --quiet; then
|
|
|
132
132
|
fi
|
|
133
133
|
fi
|
|
134
134
|
|
|
135
|
+
# Remind about release notes in CHANGELOG.md (non-blocking; `codemie whatsnew`
|
|
136
|
+
# and the once-per-upgrade notice read them)
|
|
137
|
+
if [[ ! -f CHANGELOG.md ]] || ! grep -q "^## \[$VERSION\]" CHANGELOG.md; then
|
|
138
|
+
printf "\033[33m⚠️ CHANGELOG.md has no '## [%s]' section — add release notes before publishing.\033[0m\n" "$VERSION"
|
|
139
|
+
fi
|
|
140
|
+
|
|
135
141
|
# Show what will be done
|
|
136
142
|
echo ""
|
|
137
143
|
echo "📋 Actions that will be performed:"
|
|
@@ -207,7 +213,7 @@ echo ""
|
|
|
207
213
|
echo "🧪 Running agent tests..."
|
|
208
214
|
AGENT_TEST_JSON=$(mktemp /tmp/agent-test-XXXXX.json) || { echo "ERROR: mktemp failed, cannot capture agent test results"; exit 1; }
|
|
209
215
|
trap 'rm -f "$AGENT_TEST_JSON"' EXIT INT TERM
|
|
210
|
-
|
|
216
|
+
npx vitest run --project agent --reporter=verbose --reporter=json --outputFile="$AGENT_TEST_JSON"
|
|
211
217
|
AGENT_EXIT_CODE=$?
|
|
212
218
|
|
|
213
219
|
AGENT_PASSED=0
|
|
@@ -237,7 +243,7 @@ else
|
|
|
237
243
|
echo " (check: cat ~/.codemie/codemie-cli.config.json)"
|
|
238
244
|
echo " • CI: set CI_IS_LOCAL_RUN=false and provide tests/.env.test.local"
|
|
239
245
|
echo ""
|
|
240
|
-
echo " To run manually:
|
|
246
|
+
echo " To run manually: npx vitest run --project agent"
|
|
241
247
|
echo ""
|
|
242
248
|
read -p "❓ Have you manually run agent tests and confirmed they pass? (y/N): " -n 1 -r
|
|
243
249
|
echo
|