@best-agent/cli 0.0.2-beta.8 → 0.0.3-beta.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/LICENSE +21 -0
- package/README.md +44 -181
- package/dist/launcher.js +32 -0
- package/package.json +15 -27
- package/dist/best-agent-native-bridge.d.ts +0 -389
- package/dist/best-agent-native-bridge.js +0 -4645
- package/dist/cli-storage.d.ts +0 -5
- package/dist/cli-storage.js +0 -7
- package/dist/dimsdk/ask-user.d.ts +0 -21
- package/dist/dimsdk/ask-user.js +0 -131
- package/dist/dimsdk/cli/version.d.ts +0 -6
- package/dist/dimsdk/cli/version.js +0 -36
- package/dist/dimsdk/compat/archships/dim-agent/runtime-host.d.ts +0 -49
- package/dist/dimsdk/compat/archships/dim-agent/runtime-host.js +0 -215
- package/dist/dimsdk/compat/runtime-host.d.ts +0 -2
- package/dist/dimsdk/compat/runtime-host.js +0 -2
- package/dist/dimsdk/core/debug-log.d.ts +0 -8
- package/dist/dimsdk/core/debug-log.js +0 -100
- package/dist/dimsdk/core/env.d.ts +0 -26
- package/dist/dimsdk/core/env.js +0 -130
- package/dist/dimsdk/core/markdown/sanitize.d.ts +0 -2
- package/dist/dimsdk/core/markdown/sanitize.js +0 -43
- package/dist/dimsdk/core/markdown/wrap.d.ts +0 -9
- package/dist/dimsdk/core/markdown/wrap.js +0 -139
- package/dist/dimsdk/core/markdown.d.ts +0 -18
- package/dist/dimsdk/core/markdown.js +0 -62
- package/dist/dimsdk/core/model.d.ts +0 -273
- package/dist/dimsdk/core/model.js +0 -16
- package/dist/dimsdk/core/observability/perf-log.d.ts +0 -18
- package/dist/dimsdk/core/observability/perf-log.js +0 -236
- package/dist/dimsdk/core/store/agent-event-mappers.d.ts +0 -26
- package/dist/dimsdk/core/store/agent-event-mappers.js +0 -109
- package/dist/dimsdk/core/store/message-mutations.d.ts +0 -105
- package/dist/dimsdk/core/store/message-mutations.js +0 -1528
- package/dist/dimsdk/core/store/semantic-readers.d.ts +0 -2
- package/dist/dimsdk/core/store/semantic-readers.js +0 -4
- package/dist/dimsdk/core/store/transcript-projector.d.ts +0 -164
- package/dist/dimsdk/core/store/transcript-projector.js +0 -580
- package/dist/dimsdk/core/tool-metadata.d.ts +0 -12
- package/dist/dimsdk/core/tool-metadata.js +0 -70
- package/dist/dimsdk/core/transcript-part-id.d.ts +0 -6
- package/dist/dimsdk/core/transcript-part-id.js +0 -22
- package/dist/dimsdk/i18n/index.d.ts +0 -18
- package/dist/dimsdk/i18n/index.js +0 -141
- package/dist/dimsdk/i18n/locales/en.d.ts +0 -988
- package/dist/dimsdk/i18n/locales/en.js +0 -987
- package/dist/dimsdk/i18n/locales/index.d.ts +0 -1976
- package/dist/dimsdk/i18n/locales/index.js +0 -8
- package/dist/dimsdk/i18n/locales/zh-CN.d.ts +0 -988
- package/dist/dimsdk/i18n/locales/zh-CN.js +0 -987
- package/dist/dimsdk/i18n/types.d.ts +0 -13
- package/dist/dimsdk/i18n/types.js +0 -2
- package/dist/dimsdk/shared/value-normalizers.d.ts +0 -7
- package/dist/dimsdk/shared/value-normalizers.js +0 -48
- package/dist/dimsdk-tui.bundle-size.json +0 -169
- package/dist/dimsdk-tui.bundle.js +0 -330756
- package/dist/goatchain-adapter.d.ts +0 -41
- package/dist/goatchain-adapter.js +0 -499
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -1405
- package/dist/native-runtime-bridge.d.ts +0 -387
- package/dist/native-runtime-bridge.js +0 -4624
- package/dist/provider-config-env.d.ts +0 -7
- package/dist/provider-config-env.js +0 -286
- package/dist/provider-model-limit-index.generated.d.ts +0 -3
- package/dist/provider-model-limit-index.generated.js +0 -7818
- package/dist/provider-model-limits.d.ts +0 -8
- package/dist/provider-model-limits.js +0 -43
- package/dist/runtime.d.ts +0 -47
- package/dist/runtime.js +0 -516
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
function normalizeSegment(value) {
|
|
2
|
-
return String(value ?? '').trim();
|
|
3
|
-
}
|
|
4
|
-
function joinPartId(prefix, ...segments) {
|
|
5
|
-
return [prefix, ...segments.map(normalizeSegment)].join(':');
|
|
6
|
-
}
|
|
7
|
-
export function createLocalInteractivePartId(kind, ownerId, blockOrdinal) {
|
|
8
|
-
return joinPartId(kind, 'local', ownerId, Math.max(0, Math.floor(Number(blockOrdinal) || 0)));
|
|
9
|
-
}
|
|
10
|
-
export function createThinkingPartIdFromReasoningItem(itemId) {
|
|
11
|
-
return joinPartId('thinking', 'item', itemId);
|
|
12
|
-
}
|
|
13
|
-
export function createThinkingPartIdFromStream(turnId, streamId) {
|
|
14
|
-
return joinPartId('thinking', 'stream', turnId, streamId);
|
|
15
|
-
}
|
|
16
|
-
export function createLocalThinkingPartId(ownerId, blockOrdinal) {
|
|
17
|
-
return createLocalInteractivePartId('thinking', ownerId, blockOrdinal);
|
|
18
|
-
}
|
|
19
|
-
export function createChecklistPartId(kind, toolCallId) {
|
|
20
|
-
return joinPartId(kind, 'tool', toolCallId);
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=transcript-part-id.js.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Locale, TranslationKey, Translations } from './types.js';
|
|
2
|
-
export declare function getLocale(): Locale;
|
|
3
|
-
export declare function setLocale(locale: Locale): void;
|
|
4
|
-
export declare function normalizeLocale(input: unknown): Locale | null;
|
|
5
|
-
export declare function resolveLocalePreference(opts?: Readonly<{
|
|
6
|
-
explicit?: string | null | undefined;
|
|
7
|
-
saved?: string | null | undefined;
|
|
8
|
-
env?: Record<string, string | undefined>;
|
|
9
|
-
}>): Locale;
|
|
10
|
-
export declare function t(key: TranslationKey, params?: Record<string, string | number>): string;
|
|
11
|
-
export declare function getTranslations(locale: Locale): Translations;
|
|
12
|
-
export declare function isTerminalStatusText(text: string): boolean;
|
|
13
|
-
export declare function isDoneStatusText(text: string): boolean;
|
|
14
|
-
export declare function isErrorStatusText(text: string): boolean;
|
|
15
|
-
export declare function isInterruptedStatusText(text: string): boolean;
|
|
16
|
-
export declare function isAwaitingStatusText(text: string): boolean;
|
|
17
|
-
export declare function isInterruptedMarkdownText(text: string): boolean;
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { defaultLocale, locales } from './locales/index.js';
|
|
2
|
-
let currentLocale = defaultLocale;
|
|
3
|
-
function currentTranslations() {
|
|
4
|
-
return locales[currentLocale] ?? locales[defaultLocale];
|
|
5
|
-
}
|
|
6
|
-
const statusTextSets = (() => {
|
|
7
|
-
const terminal = new Set();
|
|
8
|
-
const done = new Set();
|
|
9
|
-
const error = new Set();
|
|
10
|
-
const interrupted = new Set();
|
|
11
|
-
const awaitingPrefixes = new Set();
|
|
12
|
-
const interruptedMarkdownLines = new Set();
|
|
13
|
-
for (const locale of Object.keys(locales)) {
|
|
14
|
-
const bundle = locales[locale];
|
|
15
|
-
const status = bundle?.chatStatus ?? {};
|
|
16
|
-
if (typeof status.done === 'string') {
|
|
17
|
-
terminal.add(status.done);
|
|
18
|
-
done.add(status.done);
|
|
19
|
-
}
|
|
20
|
-
if (typeof status.error === 'string') {
|
|
21
|
-
terminal.add(status.error);
|
|
22
|
-
error.add(status.error);
|
|
23
|
-
}
|
|
24
|
-
if (typeof status.interrupted === 'string') {
|
|
25
|
-
terminal.add(status.interrupted);
|
|
26
|
-
interrupted.add(status.interrupted);
|
|
27
|
-
}
|
|
28
|
-
if (typeof status.permissionDenied === 'string')
|
|
29
|
-
error.add(status.permissionDenied);
|
|
30
|
-
if (typeof status.resumingDenied === 'string')
|
|
31
|
-
error.add(status.resumingDenied);
|
|
32
|
-
if (typeof status.awaitingApprovalPrefix === 'string')
|
|
33
|
-
awaitingPrefixes.add(status.awaitingApprovalPrefix);
|
|
34
|
-
if (typeof status.awaitingAnswersPrefix === 'string')
|
|
35
|
-
awaitingPrefixes.add(status.awaitingAnswersPrefix);
|
|
36
|
-
if (typeof status.approvalPendingPrefix === 'string')
|
|
37
|
-
awaitingPrefixes.add(status.approvalPendingPrefix);
|
|
38
|
-
if (typeof status.autoApprovingPrefix === 'string')
|
|
39
|
-
awaitingPrefixes.add(status.autoApprovingPrefix);
|
|
40
|
-
if (typeof status.interruptedMarkdown === 'string')
|
|
41
|
-
interruptedMarkdownLines.add(status.interruptedMarkdown);
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
terminal,
|
|
45
|
-
done,
|
|
46
|
-
error,
|
|
47
|
-
interrupted,
|
|
48
|
-
awaitingPrefixes,
|
|
49
|
-
interruptedMarkdownLines,
|
|
50
|
-
};
|
|
51
|
-
})();
|
|
52
|
-
export function getLocale() {
|
|
53
|
-
return currentLocale;
|
|
54
|
-
}
|
|
55
|
-
export function setLocale(locale) {
|
|
56
|
-
if (currentLocale !== locale)
|
|
57
|
-
currentLocale = locale;
|
|
58
|
-
}
|
|
59
|
-
export function normalizeLocale(input) {
|
|
60
|
-
const raw = String(input ?? '').trim();
|
|
61
|
-
if (!raw)
|
|
62
|
-
return null;
|
|
63
|
-
const base = raw.split('.')[0]?.replace('_', '-').trim().toLowerCase();
|
|
64
|
-
if (!base)
|
|
65
|
-
return null;
|
|
66
|
-
if (base === 'en' || base.startsWith('en-'))
|
|
67
|
-
return 'en';
|
|
68
|
-
if (base === 'zh' || base.startsWith('zh-'))
|
|
69
|
-
return 'zh-CN';
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
export function resolveLocalePreference(opts) {
|
|
73
|
-
const env = opts?.env
|
|
74
|
-
?? globalThis?.process?.env
|
|
75
|
-
?? {};
|
|
76
|
-
const fromExplicit = normalizeLocale(opts?.explicit);
|
|
77
|
-
if (fromExplicit)
|
|
78
|
-
return fromExplicit;
|
|
79
|
-
const fromSaved = normalizeLocale(opts?.saved);
|
|
80
|
-
if (fromSaved)
|
|
81
|
-
return fromSaved;
|
|
82
|
-
const fromEnv = normalizeLocale(env.DIMCODE_LANG ?? env.LC_ALL ?? env.LC_MESSAGES ?? env.LANG);
|
|
83
|
-
return fromEnv ?? defaultLocale;
|
|
84
|
-
}
|
|
85
|
-
function readPath(obj, key) {
|
|
86
|
-
const parts = key.split('.');
|
|
87
|
-
let cur = obj;
|
|
88
|
-
for (const part of parts) {
|
|
89
|
-
if (!cur || typeof cur !== 'object')
|
|
90
|
-
return undefined;
|
|
91
|
-
cur = cur[part];
|
|
92
|
-
}
|
|
93
|
-
return cur;
|
|
94
|
-
}
|
|
95
|
-
function applyParams(template, params) {
|
|
96
|
-
let out = template;
|
|
97
|
-
for (const [key, value] of Object.entries(params))
|
|
98
|
-
out = out.replace(new RegExp(`\\{${key}\\}`, 'g'), String(value));
|
|
99
|
-
return out;
|
|
100
|
-
}
|
|
101
|
-
export function t(key, params) {
|
|
102
|
-
const raw = readPath(currentTranslations(), key);
|
|
103
|
-
const text = typeof raw === 'string' ? raw : key;
|
|
104
|
-
return params ? applyParams(text, params) : text;
|
|
105
|
-
}
|
|
106
|
-
export function getTranslations(locale) {
|
|
107
|
-
return locales[locale] ?? locales[defaultLocale];
|
|
108
|
-
}
|
|
109
|
-
export function isTerminalStatusText(text) {
|
|
110
|
-
return statusTextSets.terminal.has(String(text ?? '').trim());
|
|
111
|
-
}
|
|
112
|
-
export function isDoneStatusText(text) {
|
|
113
|
-
return statusTextSets.done.has(String(text ?? '').trim());
|
|
114
|
-
}
|
|
115
|
-
export function isErrorStatusText(text) {
|
|
116
|
-
return statusTextSets.error.has(String(text ?? '').trim());
|
|
117
|
-
}
|
|
118
|
-
export function isInterruptedStatusText(text) {
|
|
119
|
-
return statusTextSets.interrupted.has(String(text ?? '').trim());
|
|
120
|
-
}
|
|
121
|
-
export function isAwaitingStatusText(text) {
|
|
122
|
-
const trimmed = String(text ?? '').trim();
|
|
123
|
-
if (!trimmed)
|
|
124
|
-
return false;
|
|
125
|
-
for (const prefix of statusTextSets.awaitingPrefixes) {
|
|
126
|
-
if (prefix && trimmed.startsWith(prefix))
|
|
127
|
-
return true;
|
|
128
|
-
}
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
export function isInterruptedMarkdownText(text) {
|
|
132
|
-
const raw = String(text ?? '');
|
|
133
|
-
if (!raw)
|
|
134
|
-
return false;
|
|
135
|
-
for (const line of statusTextSets.interruptedMarkdownLines) {
|
|
136
|
-
if (line && raw.includes(line))
|
|
137
|
-
return true;
|
|
138
|
-
}
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
//# sourceMappingURL=index.js.map
|