paseo-dsh 0.2.20 → 0.2.22
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/OVERVIEW.md +4 -4
- package/OVERVIEW.zh-CN.md +15 -0
- package/README.md +6 -6
- package/client/dsh-plugins-page.tsx +960 -0
- package/client/guard.tsx +115 -0
- package/client/i18n.ts +100 -0
- package/client/labels.ts +23 -0
- package/client/locales/en.json +215 -0
- package/client/locales/zh-CN.json +213 -0
- package/client/messages.ts +85 -0
- package/client/react-native.d.ts +3 -0
- package/client/settings-screen.tsx +34 -21
- package/client/stream-stats.tsx +71 -48
- package/client/timeline.tsx +442 -123
- package/index.client.tsx +42 -4
- package/index.server.ts +30 -7
- package/package.json +8 -6
- package/paseo-plugin.json +8 -2
- package/server/bootstrap.ts +8 -2
- package/server/bridge-assets.ts +3 -2
- package/server/dsh-plugins-rpc.ts +45 -0
- package/server/dsh-plugins.ts +970 -0
- package/server/dsh-process.ts +61 -11
- package/server/provider.ts +25 -7
- package/server/session.ts +410 -48
- package/server/timeline.ts +69 -4
- package/shared/dsh-plugins-api.ts +175 -0
- package/shared/image-preview.ts +8 -1
- package/shared/settings.ts +14 -43
package/client/guard.tsx
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Component, type ComponentType, type ReactNode } from "react";
|
|
2
|
+
import { Text, View } from "react-native";
|
|
3
|
+
|
|
4
|
+
export type Cleanup = () => void;
|
|
5
|
+
|
|
6
|
+
/** Never let a diagnostic path throw the app over. */
|
|
7
|
+
export function report(label: string, error: unknown): void {
|
|
8
|
+
try {
|
|
9
|
+
console.error(`[dsh-paseo] ${label}`, error);
|
|
10
|
+
} catch {
|
|
11
|
+
// A host without a working console still has to keep running.
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Run a host-facing call; a throw becomes a logged no-op, not an app abort. */
|
|
16
|
+
export function guard<T>(label: string, run: () => T, fallback: T): T {
|
|
17
|
+
try {
|
|
18
|
+
return run();
|
|
19
|
+
} catch (error) {
|
|
20
|
+
report(label, error);
|
|
21
|
+
return fallback;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Start an async task and absorb both sync throws and rejections. */
|
|
26
|
+
export function guardAsync(label: string, run: () => Promise<unknown>): void {
|
|
27
|
+
try {
|
|
28
|
+
void run().catch((error: unknown) => {
|
|
29
|
+
report(label, error);
|
|
30
|
+
});
|
|
31
|
+
} catch (error) {
|
|
32
|
+
report(label, error);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Catches render failures in one plugin contribution.
|
|
38
|
+
*
|
|
39
|
+
* The host has no boundary around what a plugin draws: an uncaught render error
|
|
40
|
+
* goes through RN's fatal handler, and a release build aborts — the whole app
|
|
41
|
+
* disappears because one tool row could not render. Everything this plugin
|
|
42
|
+
* hands to the host is wrapped here instead.
|
|
43
|
+
*/
|
|
44
|
+
class PluginBoundary extends Component<
|
|
45
|
+
{ fallback: ReactNode; children: ReactNode },
|
|
46
|
+
{ failed: boolean }
|
|
47
|
+
> {
|
|
48
|
+
state = { failed: false };
|
|
49
|
+
|
|
50
|
+
static getDerivedStateFromError(): { failed: boolean } {
|
|
51
|
+
return { failed: true };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
componentDidCatch(error: Error): void {
|
|
55
|
+
report("render", error);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
render(): ReactNode {
|
|
59
|
+
return this.state.failed ? this.props.fallback : this.props.children;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function withPluginBoundary<P extends object>(
|
|
64
|
+
name: string,
|
|
65
|
+
Inner: ComponentType<P>,
|
|
66
|
+
fallback: (props: P) => ReactNode,
|
|
67
|
+
): ComponentType<P> {
|
|
68
|
+
function Guarded(props: P) {
|
|
69
|
+
return (
|
|
70
|
+
<PluginBoundary fallback={fallback(props)}>
|
|
71
|
+
<Inner {...props} />
|
|
72
|
+
</PluginBoundary>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
Guarded.displayName = `Guarded(${name})`;
|
|
76
|
+
return Guarded;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** A one-line failure card, used where the contribution has no room for more. */
|
|
80
|
+
export function FailedRow({
|
|
81
|
+
theme,
|
|
82
|
+
message,
|
|
83
|
+
}: {
|
|
84
|
+
theme: { colors: { statusDanger: string } };
|
|
85
|
+
message: string;
|
|
86
|
+
}) {
|
|
87
|
+
return (
|
|
88
|
+
<View style={{ paddingVertical: 4 }}>
|
|
89
|
+
<Text style={{ color: theme.colors.statusDanger, fontSize: 12, lineHeight: 18 }}>
|
|
90
|
+
{message}
|
|
91
|
+
</Text>
|
|
92
|
+
</View>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Register one contribution. A host that refuses it (unknown icon, unresolvable
|
|
98
|
+
* label, missing surface) loses that entry only; the rest of the plugin and the
|
|
99
|
+
* app keep running. The returned cleanup is safe to call twice.
|
|
100
|
+
*/
|
|
101
|
+
export function guardCleanup(label: string, run: () => Cleanup): Cleanup {
|
|
102
|
+
try {
|
|
103
|
+
const cleanup = run();
|
|
104
|
+
return () => {
|
|
105
|
+
try {
|
|
106
|
+
cleanup();
|
|
107
|
+
} catch (error) {
|
|
108
|
+
report(`${label} cleanup`, error);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
} catch (error) {
|
|
112
|
+
report(label, error);
|
|
113
|
+
return () => {};
|
|
114
|
+
}
|
|
115
|
+
}
|
package/client/i18n.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import * as paseo from "@getpaseo/plugin/client";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { Platform } from "react-native";
|
|
4
|
+
import { messages } from "./messages";
|
|
5
|
+
|
|
6
|
+
export type Translate = (key: string, args?: Record<string, unknown>) => string;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* In the native apps the plugin draws its own strings from the bundled catalogs
|
|
10
|
+
* instead of going through the host's `useTranslation`.
|
|
11
|
+
*
|
|
12
|
+
* Paseo 0.16.0's native plugin runtime is where the i18n API is newest, and a
|
|
13
|
+
* throw from that hook reaches React during render — fatal in a release build.
|
|
14
|
+
* Nothing on this path depends on the host: catalogs ship in the bundle,
|
|
15
|
+
* missing keys already fall back to English, and the app language is read from
|
|
16
|
+
* the system locale, which is what the native clients start with. The desktop
|
|
17
|
+
* (web) host keeps the host hook, including live language switching.
|
|
18
|
+
*/
|
|
19
|
+
const isNativeApp = Platform.OS !== "web";
|
|
20
|
+
|
|
21
|
+
function deviceLocale(): string {
|
|
22
|
+
try {
|
|
23
|
+
const locale = Intl.DateTimeFormat().resolvedOptions().locale;
|
|
24
|
+
if (typeof locale === "string" && locale !== "") return locale;
|
|
25
|
+
} catch {
|
|
26
|
+
// Hermes without Intl falls through to English.
|
|
27
|
+
}
|
|
28
|
+
return "en";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const localLocale = deviceLocale();
|
|
32
|
+
|
|
33
|
+
function catalogFor(locale: string): unknown {
|
|
34
|
+
return locale.toLowerCase().startsWith("zh")
|
|
35
|
+
? messages.resources["zh-CN"]
|
|
36
|
+
: messages.resources.en;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function lookup(resource: unknown, key: string): string | undefined {
|
|
40
|
+
let node: unknown = resource;
|
|
41
|
+
for (const part of key.split(".")) {
|
|
42
|
+
if (typeof node !== "object" || node === null) return undefined;
|
|
43
|
+
node = (node as Record<string, unknown>)[part];
|
|
44
|
+
}
|
|
45
|
+
return typeof node === "string" ? node : undefined;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function interpolate(template: string, args?: Record<string, unknown>): string {
|
|
49
|
+
if (args === undefined) return template;
|
|
50
|
+
return template.replace(/\{\{\s*([^{}]+?)\s*\}\}/g, (_match, name: string) => {
|
|
51
|
+
const value = args[name];
|
|
52
|
+
if (value === undefined) return "";
|
|
53
|
+
if (value instanceof Date) return value.toLocaleString();
|
|
54
|
+
return String(value);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function pluralCategory(locale: string, count: number): "one" | "other" {
|
|
59
|
+
// Both catalogs only ever need English's one/other split; Chinese is `other`.
|
|
60
|
+
if (locale.toLowerCase().startsWith("zh")) return "other";
|
|
61
|
+
return Math.abs(count) === 1 ? "one" : "other";
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Resolve one catalog key for a locale, with `{{name}}` and count support. */
|
|
65
|
+
export function translate(locale: string, key: string, args?: Record<string, unknown>): string {
|
|
66
|
+
const catalog = catalogFor(locale);
|
|
67
|
+
const count = typeof args?.count === "number" ? args.count : undefined;
|
|
68
|
+
if (count !== undefined) {
|
|
69
|
+
const plural = lookup(catalog, `${key}_${pluralCategory(locale, count)}`);
|
|
70
|
+
if (plural !== undefined) return interpolate(plural, args);
|
|
71
|
+
}
|
|
72
|
+
return interpolate(lookup(catalog, key) ?? key, args);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** The label a host-owned registration takes: resolved on iOS, persistent elsewhere. */
|
|
76
|
+
export function translateForLabel(key: string): string {
|
|
77
|
+
return translate(localLocale, key);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function useLocalTranslation() {
|
|
81
|
+
const locale = localLocale;
|
|
82
|
+
const t = useCallback<Translate>((key, args) => translate(locale, key, args), [locale]);
|
|
83
|
+
return { locale, t };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const hostUseTranslation = (paseo as unknown as {
|
|
87
|
+
useTranslation?: (resources: unknown) => { locale: string; t: unknown };
|
|
88
|
+
}).useTranslation;
|
|
89
|
+
|
|
90
|
+
function useHostTranslation() {
|
|
91
|
+
if (hostUseTranslation === undefined) {
|
|
92
|
+
throw new Error("This Paseo client does not provide useTranslation");
|
|
93
|
+
}
|
|
94
|
+
const { locale, t } = hostUseTranslation(messages);
|
|
95
|
+
return { locale, t: t as unknown as Translate };
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export const useTranslation: () => { locale: string; t: Translate } = isNativeApp
|
|
99
|
+
? useLocalTranslation
|
|
100
|
+
: useHostTranslation;
|
package/client/labels.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Platform } from "react-native";
|
|
2
|
+
import { translateForLabel } from "./i18n";
|
|
3
|
+
import { messages } from "./messages";
|
|
4
|
+
|
|
5
|
+
/** Host-owned labels this plugin registers; each is a key in every catalog. */
|
|
6
|
+
export type PersistentKey = "plugins.page.title" | "settings.title";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The screen, sidebar and settings labels are persistent host-owned
|
|
10
|
+
* registrations, so they take a catalog message rather than a string: a `t()`
|
|
11
|
+
* result is a snapshot and would keep the language the plugin loaded with.
|
|
12
|
+
*
|
|
13
|
+
* Paseo 0.16.0's native apps are the exception. Their host registers and draws
|
|
14
|
+
* these labels before resolving a `PluginMessage`, so the object is either
|
|
15
|
+
* rejected while the contribution registers or reaches React as a child.
|
|
16
|
+
* Either path ends in an uncaught JS error, and release Hermes turns that into
|
|
17
|
+
* an abort of the whole app. Resolve the entry from the bundled catalog there;
|
|
18
|
+
* the desktop (web) host keeps the persistent message.
|
|
19
|
+
*/
|
|
20
|
+
export function persistentLabel(key: PersistentKey) {
|
|
21
|
+
if (Platform.OS === "web") return messages.message(key);
|
|
22
|
+
return translateForLabel(key);
|
|
23
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
{
|
|
2
|
+
"timeline": {
|
|
3
|
+
"thinking": {
|
|
4
|
+
"verb": "Thought",
|
|
5
|
+
"live": "Thinking…",
|
|
6
|
+
"done": "Thought"
|
|
7
|
+
},
|
|
8
|
+
"status": {
|
|
9
|
+
"running": "Running",
|
|
10
|
+
"failed": "Failed",
|
|
11
|
+
"canceled": "Canceled",
|
|
12
|
+
"done": "Done"
|
|
13
|
+
},
|
|
14
|
+
"row": {
|
|
15
|
+
"running": "Running",
|
|
16
|
+
"imagePreview": "Image preview",
|
|
17
|
+
"loadingImage": "Loading image…",
|
|
18
|
+
"loadAnyway": "Load anyway",
|
|
19
|
+
"copy": "Copy",
|
|
20
|
+
"copied": "Copied",
|
|
21
|
+
"copyFailed": "Copy failed",
|
|
22
|
+
"fullscreen": "Fullscreen",
|
|
23
|
+
"exitFullscreen": "Exit fullscreen",
|
|
24
|
+
"close": "Close",
|
|
25
|
+
"wrap": "Wrap",
|
|
26
|
+
"noWrap": "No wrap",
|
|
27
|
+
"renderFailed": "This row could not be rendered."
|
|
28
|
+
},
|
|
29
|
+
"tool": {
|
|
30
|
+
"command": "Command",
|
|
31
|
+
"image": "Image",
|
|
32
|
+
"read": "Read",
|
|
33
|
+
"write": "Write",
|
|
34
|
+
"edit": "Edit",
|
|
35
|
+
"search": "Search",
|
|
36
|
+
"webSearch": "Web search",
|
|
37
|
+
"fetch": "Fetch",
|
|
38
|
+
"browser": "Browser",
|
|
39
|
+
"code": "Code",
|
|
40
|
+
"tasks": "Tasks",
|
|
41
|
+
"question": "Asked"
|
|
42
|
+
},
|
|
43
|
+
"browser": {
|
|
44
|
+
"open": "Open",
|
|
45
|
+
"click": "Click",
|
|
46
|
+
"type": "Type",
|
|
47
|
+
"snapshot": "Snapshot",
|
|
48
|
+
"scroll": "Scroll",
|
|
49
|
+
"navigate": "Navigate",
|
|
50
|
+
"wait": "Wait",
|
|
51
|
+
"close": "Close",
|
|
52
|
+
"run": "Run",
|
|
53
|
+
"find": "Find"
|
|
54
|
+
},
|
|
55
|
+
"image": {
|
|
56
|
+
"unsupportedFormat": "Unsupported image format",
|
|
57
|
+
"notFile": "Not a file",
|
|
58
|
+
"tooLarge": "Large image ({{size}} MB, above the {{limit}} MB preview limit)",
|
|
59
|
+
"tooLargeHard": "Image is above the 64 MB hard limit and cannot be previewed",
|
|
60
|
+
"unreadable": "Could not read the image",
|
|
61
|
+
"detail": "{{message}}"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"streamStats": {
|
|
65
|
+
"turnsSteps": "{{turns}} turns · {{steps}} steps",
|
|
66
|
+
"firstToken": "First token {{latency}}",
|
|
67
|
+
"contextPercent": "Context {{percent}}%",
|
|
68
|
+
"cacheHit": "Cache hit {{percent}}%",
|
|
69
|
+
"expand": "Expand answer stats",
|
|
70
|
+
"collapse": "Collapse answer stats",
|
|
71
|
+
"contextLine": "Context {{used}} / {{max}} {{bar}} {{percent}}%",
|
|
72
|
+
"tokensLine": "Tokens {{parts}}",
|
|
73
|
+
"tokenInput": "in {{tokens}}",
|
|
74
|
+
"tokenCached": "cached {{tokens}}",
|
|
75
|
+
"tokenOutput": "out {{tokens}}",
|
|
76
|
+
"routeLine": "Route {{route}}",
|
|
77
|
+
"routeWithThinking": "Route {{route}} · thinking {{option}}",
|
|
78
|
+
"toolsLine": "Tools {{calls}}{{duration}}",
|
|
79
|
+
"tools_one": "{{count}} call",
|
|
80
|
+
"tools_other": "{{count}} calls"
|
|
81
|
+
},
|
|
82
|
+
"settings": {
|
|
83
|
+
"title": "Timeline style",
|
|
84
|
+
"intro": "Tool row spacing, row height and command drawer height. Changes apply as soon as you save, without restarting Paseo.",
|
|
85
|
+
"save": "Save",
|
|
86
|
+
"saving": "Saving…",
|
|
87
|
+
"reset": "Restore defaults",
|
|
88
|
+
"saved": "Saved",
|
|
89
|
+
"saveFailed": "Could not save",
|
|
90
|
+
"resetDone": "Defaults restored",
|
|
91
|
+
"resetFailed": "Could not restore defaults",
|
|
92
|
+
"invalidNumber": "“{{label}}” is not a valid number",
|
|
93
|
+
"field": {
|
|
94
|
+
"toolRowMarginY": {
|
|
95
|
+
"label": "Extra spacing between tools",
|
|
96
|
+
"hint": "Added on top of the host's fixed 16px. Negative values are allowed: 8 → about 24px, -8 → about 8px, -16 → about 0px. Range -16 to 24."
|
|
97
|
+
},
|
|
98
|
+
"liveReasoningRowMarginY": {
|
|
99
|
+
"label": "Extra spacing for the streaming thinking row",
|
|
100
|
+
"hint": "Applies only to the thinking row that is still streaming. Default 8; negative values can overlap."
|
|
101
|
+
},
|
|
102
|
+
"toolRowPaddingY": {
|
|
103
|
+
"label": "Tool row vertical padding (inside the row)",
|
|
104
|
+
"hint": "Changes only the padding inside a row, not the gap between tools. To tighten the gap, edit “Extra spacing between tools” above. Range 0 to 12."
|
|
105
|
+
},
|
|
106
|
+
"toolRowMinHeight": {
|
|
107
|
+
"label": "Tool row minimum height",
|
|
108
|
+
"hint": "How tall a row is at minimum; with padding 0 it can shrink to about the icon height (about 17px). Range 12 to 64."
|
|
109
|
+
},
|
|
110
|
+
"toolRowGap": {
|
|
111
|
+
"label": "Horizontal gap between icon and text",
|
|
112
|
+
"hint": "Between the icon, the verb and the target. Range 0 to 24."
|
|
113
|
+
},
|
|
114
|
+
"commandMaxHeightRatio": {
|
|
115
|
+
"label": "Command block maximum height (share of the window)",
|
|
116
|
+
"hint": "0.25 means at most a quarter of the window height; beyond that the command block scrolls internally and the output area stays visible. Range 0.1 to 0.6."
|
|
117
|
+
},
|
|
118
|
+
"commandMinHeight": {
|
|
119
|
+
"label": "Command block minimum height cap",
|
|
120
|
+
"hint": "The height the command block keeps even in a very small window, in pixels. Range 60 to 360."
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"renderFailed": "This screen could not be rendered."
|
|
124
|
+
},
|
|
125
|
+
"plugins": {
|
|
126
|
+
"page": {
|
|
127
|
+
"title": "DSH Plugins"
|
|
128
|
+
},
|
|
129
|
+
"header": {
|
|
130
|
+
"refresh": "Refresh",
|
|
131
|
+
"refreshing": "Refreshing…",
|
|
132
|
+
"checkUpdates": "Check for updates",
|
|
133
|
+
"checkingUpdates": "Checking…",
|
|
134
|
+
"notice": "Changes apply to new sessions; running sessions keep their current state.",
|
|
135
|
+
"retry": "Retry",
|
|
136
|
+
"profile": "{{profile}} · {{host}}"
|
|
137
|
+
},
|
|
138
|
+
"groups": {
|
|
139
|
+
"enabled": "Enabled",
|
|
140
|
+
"disabled": "Disabled",
|
|
141
|
+
"dependencies": "Plain dependencies"
|
|
142
|
+
},
|
|
143
|
+
"badges": {
|
|
144
|
+
"official": "Built in",
|
|
145
|
+
"protected": "Protected",
|
|
146
|
+
"client": "Web UI",
|
|
147
|
+
"platformUnsupported": "Not supported here",
|
|
148
|
+
"missing": "Missing",
|
|
149
|
+
"updateAvailable": "Update to {{version}}"
|
|
150
|
+
},
|
|
151
|
+
"bundle": {
|
|
152
|
+
"dependencyNote": "This is a plain dependency, not a DSH bundle; it does not become a profile layer.",
|
|
153
|
+
"clientNote": "Its UI only appears in DSH Web/Desktop.",
|
|
154
|
+
"platforms": "Supported platforms: {{platforms}}",
|
|
155
|
+
"remove": "Remove",
|
|
156
|
+
"confirmRemove": "Confirm removal",
|
|
157
|
+
"cancel": "Cancel",
|
|
158
|
+
"update": "Update to {{version}}",
|
|
159
|
+
"confirmUpdate": "Confirm update to {{version}}",
|
|
160
|
+
"platformsUnknown": "This bundle does not list support for the current platform."
|
|
161
|
+
},
|
|
162
|
+
"install": {
|
|
163
|
+
"title": "Install a DSH plugin",
|
|
164
|
+
"hint": "Only npm registry package names are accepted. The package is checked for dsh.bundle before installation.",
|
|
165
|
+
"placeholder": "Package name or name@version",
|
|
166
|
+
"check": "Check",
|
|
167
|
+
"checking": "Checking…",
|
|
168
|
+
"confirm": "Install",
|
|
169
|
+
"unknown": "Unknown package",
|
|
170
|
+
"trust": "This is third-party code. It runs inside every new DSH session. Install only packages you trust.",
|
|
171
|
+
"notBundle": "This package does not declare dsh.bundle, so it would not take effect in this profile."
|
|
172
|
+
},
|
|
173
|
+
"job": {
|
|
174
|
+
"installAction": "Installation",
|
|
175
|
+
"removeAction": "Removal",
|
|
176
|
+
"updateAction": "Update",
|
|
177
|
+
"checkAction": "Update check",
|
|
178
|
+
"running": "{{action}} in progress…",
|
|
179
|
+
"failed": "{{action}} failed",
|
|
180
|
+
"succeeded": "{{action}} finished",
|
|
181
|
+
"failedBadge": "Failed",
|
|
182
|
+
"doneBadge": "Done",
|
|
183
|
+
"updatesFound_one": "{{count}} update available.",
|
|
184
|
+
"updatesFound_other": "{{count}} updates available."
|
|
185
|
+
},
|
|
186
|
+
"status": {
|
|
187
|
+
"loadingProfile": "Reading the profile…"
|
|
188
|
+
},
|
|
189
|
+
"errors": {
|
|
190
|
+
"profile-unreadable": "Could not read the profile's package.json.",
|
|
191
|
+
"profile-invalid": "The profile's package.json is not valid JSON.",
|
|
192
|
+
"invalid-platform": "This bundle does not support the current platform.",
|
|
193
|
+
"lock-timeout": "Timed out waiting for the profile write lock.",
|
|
194
|
+
"invalid-name": "The bundle name is empty.",
|
|
195
|
+
"protected": "This bundle is protected.",
|
|
196
|
+
"not-installed": "This package is not installed.",
|
|
197
|
+
"not-a-bundle": "This package does not declare dsh.bundle.",
|
|
198
|
+
"invalid-spec": "Only npm registry package names are supported.",
|
|
199
|
+
"registry-unreadable": "Could not read the registry response.",
|
|
200
|
+
"registry-invalid": "The registry returned no usable package information.",
|
|
201
|
+
"already-installed": "This package is already installed. Enable it in the list instead.",
|
|
202
|
+
"not-removable": "Only packages in the profile dependencies can be removed.",
|
|
203
|
+
"not-in-dependencies": "This package is not a profile dependency.",
|
|
204
|
+
"invalid-version": "This is not a valid registry version.",
|
|
205
|
+
"check-failed": "Some bundles could not be checked.",
|
|
206
|
+
"disposed": "The plugin was unloaded.",
|
|
207
|
+
"busy": "Another management task is running.",
|
|
208
|
+
"job-missing": "The task is no longer available.",
|
|
209
|
+
"spawn-failed": "Could not start dsh.",
|
|
210
|
+
"command-failed": "The dsh command failed.",
|
|
211
|
+
"request-failed": "The request failed.",
|
|
212
|
+
"render": "This screen failed to render. Reopen it; if it happens again, check the daemon log."
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
{
|
|
2
|
+
"timeline": {
|
|
3
|
+
"thinking": {
|
|
4
|
+
"verb": "思考",
|
|
5
|
+
"live": "思考中…",
|
|
6
|
+
"done": "已思考"
|
|
7
|
+
},
|
|
8
|
+
"status": {
|
|
9
|
+
"running": "运行中",
|
|
10
|
+
"failed": "失败",
|
|
11
|
+
"canceled": "已取消",
|
|
12
|
+
"done": "完成"
|
|
13
|
+
},
|
|
14
|
+
"row": {
|
|
15
|
+
"running": "运行中",
|
|
16
|
+
"imagePreview": "图片预览",
|
|
17
|
+
"loadingImage": "载入图片…",
|
|
18
|
+
"loadAnyway": "仍要加载",
|
|
19
|
+
"copy": "复制",
|
|
20
|
+
"copied": "已复制",
|
|
21
|
+
"copyFailed": "复制失败",
|
|
22
|
+
"fullscreen": "全屏",
|
|
23
|
+
"exitFullscreen": "退出全屏",
|
|
24
|
+
"close": "关闭",
|
|
25
|
+
"wrap": "换行",
|
|
26
|
+
"noWrap": "不换行",
|
|
27
|
+
"renderFailed": "这一行渲染失败。"
|
|
28
|
+
},
|
|
29
|
+
"tool": {
|
|
30
|
+
"command": "命令",
|
|
31
|
+
"image": "看图",
|
|
32
|
+
"read": "读取",
|
|
33
|
+
"write": "写入",
|
|
34
|
+
"edit": "编辑",
|
|
35
|
+
"search": "搜索",
|
|
36
|
+
"webSearch": "网页搜索",
|
|
37
|
+
"fetch": "抓取",
|
|
38
|
+
"browser": "浏览器",
|
|
39
|
+
"code": "运行代码",
|
|
40
|
+
"tasks": "任务",
|
|
41
|
+
"question": "提问"
|
|
42
|
+
},
|
|
43
|
+
"browser": {
|
|
44
|
+
"open": "打开网页",
|
|
45
|
+
"click": "点击",
|
|
46
|
+
"type": "输入",
|
|
47
|
+
"snapshot": "截图",
|
|
48
|
+
"scroll": "滚动",
|
|
49
|
+
"navigate": "导航",
|
|
50
|
+
"wait": "等待",
|
|
51
|
+
"close": "关闭",
|
|
52
|
+
"run": "执行",
|
|
53
|
+
"find": "查找"
|
|
54
|
+
},
|
|
55
|
+
"image": {
|
|
56
|
+
"unsupportedFormat": "不支持的图片格式",
|
|
57
|
+
"notFile": "不是文件",
|
|
58
|
+
"tooLarge": "图片较大({{size}}MB,超过 {{limit}}MB 预览上限)",
|
|
59
|
+
"tooLargeHard": "图片超过 64MB 硬上限,无法预览",
|
|
60
|
+
"unreadable": "无法读取图片",
|
|
61
|
+
"detail": "{{message}}"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"streamStats": {
|
|
65
|
+
"turnsSteps": "{{turns}} 轮 · {{steps}} 步",
|
|
66
|
+
"firstToken": "首字 {{latency}}",
|
|
67
|
+
"contextPercent": "上下文 {{percent}}%",
|
|
68
|
+
"cacheHit": "缓存命中 {{percent}}%",
|
|
69
|
+
"expand": "展开回答统计",
|
|
70
|
+
"collapse": "收起回答统计",
|
|
71
|
+
"contextLine": "上下文 {{used}} / {{max}} {{bar}} {{percent}}%",
|
|
72
|
+
"tokensLine": "Tokens {{parts}}",
|
|
73
|
+
"tokenInput": "输入 {{tokens}}",
|
|
74
|
+
"tokenCached": "缓存 {{tokens}}",
|
|
75
|
+
"tokenOutput": "输出 {{tokens}}",
|
|
76
|
+
"routeLine": "路由 {{route}}",
|
|
77
|
+
"routeWithThinking": "路由 {{route}} · 思考 {{option}}",
|
|
78
|
+
"toolsLine": "工具 {{calls}}{{duration}}",
|
|
79
|
+
"tools_other": "{{count}} 次"
|
|
80
|
+
},
|
|
81
|
+
"settings": {
|
|
82
|
+
"title": "时间线样式",
|
|
83
|
+
"intro": "工具行间距、行高和命令抽屉高度。保存后立即生效,不需要重启 Paseo。",
|
|
84
|
+
"save": "保存",
|
|
85
|
+
"saving": "保存中…",
|
|
86
|
+
"reset": "恢复默认",
|
|
87
|
+
"saved": "已保存",
|
|
88
|
+
"saveFailed": "保存失败",
|
|
89
|
+
"resetDone": "已恢复默认值",
|
|
90
|
+
"resetFailed": "重置失败",
|
|
91
|
+
"invalidNumber": "「{{label}}」不是有效数字",
|
|
92
|
+
"field": {
|
|
93
|
+
"toolRowMarginY": {
|
|
94
|
+
"label": "工具之间的额外间距",
|
|
95
|
+
"hint": "叠加在宿主固定 16px 之上,可填负数:8 → 约 24px,-8 → 约 8px,-16 → 约 0px。范围 -16 ~ 24。"
|
|
96
|
+
},
|
|
97
|
+
"liveReasoningRowMarginY": {
|
|
98
|
+
"label": "正在输出的思考行额外间距",
|
|
99
|
+
"hint": "只作用于正在流式输出的思考行。默认 8,负值可能重叠。"
|
|
100
|
+
},
|
|
101
|
+
"toolRowPaddingY": {
|
|
102
|
+
"label": "工具行上下内边距(行内留白)",
|
|
103
|
+
"hint": "只改行内留白,不改工具之间的距离;要缩小行间距请改上面的“工具之间的额外间距”。范围 0 ~ 12。"
|
|
104
|
+
},
|
|
105
|
+
"toolRowMinHeight": {
|
|
106
|
+
"label": "工具行最小高度",
|
|
107
|
+
"hint": "整行至少多高;配合内边距 0 可压到接近图标高度(约 17px)。范围 12 ~ 64。"
|
|
108
|
+
},
|
|
109
|
+
"toolRowGap": {
|
|
110
|
+
"label": "图标与文字的水平间距",
|
|
111
|
+
"hint": "图标、动词、目标之间。范围 0 ~ 24。"
|
|
112
|
+
},
|
|
113
|
+
"commandMaxHeightRatio": {
|
|
114
|
+
"label": "命令块最大高度(窗口占比)",
|
|
115
|
+
"hint": "0.25 表示最多占窗口高度的四分之一;超过后命令块内部滚动,输出区始终保留。范围 0.1 ~ 0.6。"
|
|
116
|
+
},
|
|
117
|
+
"commandMinHeight": {
|
|
118
|
+
"label": "命令块最小高度上限",
|
|
119
|
+
"hint": "窗口很小时仍给命令块保留的高度(像素)。范围 60 ~ 360。"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"renderFailed": "这个页面渲染失败。"
|
|
123
|
+
},
|
|
124
|
+
"plugins": {
|
|
125
|
+
"page": {
|
|
126
|
+
"title": "DSH 插件"
|
|
127
|
+
},
|
|
128
|
+
"header": {
|
|
129
|
+
"refresh": "刷新",
|
|
130
|
+
"refreshing": "刷新中…",
|
|
131
|
+
"checkUpdates": "检查更新",
|
|
132
|
+
"checkingUpdates": "检查中…",
|
|
133
|
+
"notice": "改动只影响新建会话;正在运行的会话保持原样。",
|
|
134
|
+
"retry": "重试",
|
|
135
|
+
"profile": "{{profile}} · {{host}}"
|
|
136
|
+
},
|
|
137
|
+
"groups": {
|
|
138
|
+
"enabled": "已启用",
|
|
139
|
+
"disabled": "未启用",
|
|
140
|
+
"dependencies": "普通依赖"
|
|
141
|
+
},
|
|
142
|
+
"badges": {
|
|
143
|
+
"official": "内置",
|
|
144
|
+
"protected": "受保护",
|
|
145
|
+
"client": "客户端界面",
|
|
146
|
+
"platformUnsupported": "当前平台不支持",
|
|
147
|
+
"missing": "缺失",
|
|
148
|
+
"updateAvailable": "可更新到 {{version}}"
|
|
149
|
+
},
|
|
150
|
+
"bundle": {
|
|
151
|
+
"dependencyNote": "普通依赖,不是 DSH bundle,不会成为 profile 层。",
|
|
152
|
+
"clientNote": "界面只在 DSH Web/Desktop 显示。",
|
|
153
|
+
"platforms": "支持的平台:{{platforms}}",
|
|
154
|
+
"remove": "卸载",
|
|
155
|
+
"confirmRemove": "确认卸载",
|
|
156
|
+
"cancel": "取消",
|
|
157
|
+
"update": "更新到 {{version}}",
|
|
158
|
+
"confirmUpdate": "确认更新到 {{version}}",
|
|
159
|
+
"platformsUnknown": "这个 bundle 没有声明支持当前平台。"
|
|
160
|
+
},
|
|
161
|
+
"install": {
|
|
162
|
+
"title": "安装 DSH 插件",
|
|
163
|
+
"hint": "只接受 npm registry 包名。安装前会检查它是否声明 dsh.bundle。",
|
|
164
|
+
"placeholder": "包名或包名@版本",
|
|
165
|
+
"check": "检查",
|
|
166
|
+
"checking": "检查中…",
|
|
167
|
+
"confirm": "确认安装",
|
|
168
|
+
"unknown": "未知包",
|
|
169
|
+
"trust": "这是第三方代码,会在每个新会话的 DSH 进程里运行。只安装你信任的包。",
|
|
170
|
+
"notBundle": "这个包没有声明 dsh.bundle,装进 profile 不会生效。"
|
|
171
|
+
},
|
|
172
|
+
"job": {
|
|
173
|
+
"installAction": "安装",
|
|
174
|
+
"removeAction": "卸载",
|
|
175
|
+
"updateAction": "更新",
|
|
176
|
+
"checkAction": "检查更新",
|
|
177
|
+
"running": "正在{{action}}…",
|
|
178
|
+
"failed": "{{action}}失败",
|
|
179
|
+
"succeeded": "{{action}}完成",
|
|
180
|
+
"failedBadge": "失败",
|
|
181
|
+
"doneBadge": "完成",
|
|
182
|
+
"updatesFound_other": "发现 {{count}} 个可更新项。"
|
|
183
|
+
},
|
|
184
|
+
"status": {
|
|
185
|
+
"loadingProfile": "正在读取 profile…"
|
|
186
|
+
},
|
|
187
|
+
"errors": {
|
|
188
|
+
"profile-unreadable": "读不到 profile 的 package.json。",
|
|
189
|
+
"profile-invalid": "profile 的 package.json 不是有效 JSON。",
|
|
190
|
+
"invalid-platform": "这个 bundle 不支持当前平台。",
|
|
191
|
+
"lock-timeout": "等待 profile 写锁超时。",
|
|
192
|
+
"invalid-name": "bundle 名称不能为空。",
|
|
193
|
+
"protected": "这个 bundle 受保护。",
|
|
194
|
+
"not-installed": "这个包没有安装。",
|
|
195
|
+
"not-a-bundle": "这个包没有声明 dsh.bundle。",
|
|
196
|
+
"invalid-spec": "只支持 npm registry 包名。",
|
|
197
|
+
"registry-unreadable": "无法解析 registry 返回的信息。",
|
|
198
|
+
"registry-invalid": "registry 没有返回有效的包信息。",
|
|
199
|
+
"already-installed": "这个包已经安装,请在列表里启用它。",
|
|
200
|
+
"not-removable": "只有 profile 依赖里的包可以卸载。",
|
|
201
|
+
"not-in-dependencies": "这个包不在 profile 依赖里。",
|
|
202
|
+
"invalid-version": "这不是有效的 registry 版本。",
|
|
203
|
+
"check-failed": "部分 bundle 检查失败。",
|
|
204
|
+
"disposed": "插件已卸载。",
|
|
205
|
+
"busy": "已有管理任务在运行。",
|
|
206
|
+
"job-missing": "任务不存在或已过期。",
|
|
207
|
+
"spawn-failed": "无法启动 dsh。",
|
|
208
|
+
"command-failed": "dsh 命令执行失败。",
|
|
209
|
+
"request-failed": "请求失败。",
|
|
210
|
+
"render": "这个页面渲染失败。重新打开试试;如果反复出现,请检查 daemon 日志。"
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|