@prohost/cli 0.16.5 → 0.16.7
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 +34 -0
- package/README.md +7 -3
- package/dist/codehost/filelock.d.ts +44 -0
- package/dist/codehost/filelock.js +239 -0
- package/dist/codehost/folders.d.ts +5 -10
- package/dist/codehost/folders.js +17 -81
- package/dist/codehost/ready.d.ts +69 -6
- package/dist/codehost/ready.js +212 -11
- package/dist/codehost/terminals.js +31 -13
- package/dist/host/api.js +1 -1
- package/dist/host/command.d.ts +8 -1
- package/dist/host/command.js +107 -3
- package/dist/host/service.d.ts +4 -0
- package/dist/host/service.js +25 -4
- package/dist/host/status.d.ts +6 -2
- package/dist/host/status.js +26 -8
- package/dist/version.d.ts +2 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/host/status.js
CHANGED
|
@@ -69,16 +69,32 @@ export function hostStatsBody(stats) {
|
|
|
69
69
|
battery_pct: stats?.batteryPct ?? null,
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
+
function clip(value, max) {
|
|
73
|
+
if (value === null || value === undefined)
|
|
74
|
+
return null;
|
|
75
|
+
// By code point, as the server counts (`len()` of a Python str): never half a surrogate pair,
|
|
76
|
+
// which it would refuse as invalid Unicode.
|
|
77
|
+
const points = Array.from(value);
|
|
78
|
+
return points.length > max ? points.slice(0, max).join('') : value;
|
|
79
|
+
}
|
|
72
80
|
/** A login as the status body names it: no email, no directory. */
|
|
73
81
|
export function loginBody(login, conversations) {
|
|
74
82
|
return {
|
|
75
83
|
account_key: login.account_key,
|
|
76
|
-
label: login.label,
|
|
77
|
-
runtime: login.runtime,
|
|
78
|
-
subscription_type: login.subscription_type,
|
|
79
|
-
plan_label: login.plan_label,
|
|
84
|
+
label: clip(login.label, 120) || 'login',
|
|
85
|
+
runtime: clip(login.runtime, 40),
|
|
86
|
+
subscription_type: clip(login.subscription_type, 40),
|
|
87
|
+
plan_label: clip(login.plan_label, 80),
|
|
80
88
|
auth_state: login.auth_state,
|
|
81
|
-
quota_windows: login.quota_windows
|
|
89
|
+
quota_windows: login.quota_windows
|
|
90
|
+
.filter((w) => typeof w.kind === 'string' && w.kind.length > 0)
|
|
91
|
+
.slice(0, 16)
|
|
92
|
+
.map((w) => ({
|
|
93
|
+
kind: clip(w.kind, 40),
|
|
94
|
+
used_percent: Math.min(100, Math.max(0, w.used_percent)),
|
|
95
|
+
resets_at: w.resets_at,
|
|
96
|
+
...(w.model_label ? { model_label: clip(w.model_label, 40) } : {}),
|
|
97
|
+
})),
|
|
82
98
|
conversations,
|
|
83
99
|
};
|
|
84
100
|
}
|
|
@@ -89,11 +105,13 @@ export function buildStatusBody(inputs) {
|
|
|
89
105
|
slots: { ...inputs.slots },
|
|
90
106
|
logins: inputs.logins.map((login) => loginBody(login, inputs.conversationsPerLogin.get(login.account_key) ?? 0)),
|
|
91
107
|
running: inputs.running.map((entry) => ({
|
|
92
|
-
run_id: entry.run_id,
|
|
108
|
+
run_id: clip(entry.run_id, 128),
|
|
93
109
|
agent_id: entry.agent_id,
|
|
94
|
-
|
|
110
|
+
...(entry.runtime ? { runtime: clip(entry.runtime, 40) } : {}),
|
|
111
|
+
conversation_key: clip(entry.conversation_key, 256),
|
|
95
112
|
kind: entry.kind,
|
|
96
|
-
|
|
113
|
+
// Never '' (the server reads it as a date): a time, or null.
|
|
114
|
+
started_at: entry.started_at || null,
|
|
97
115
|
peak_mem_mb: entry.peak_mem_mb ?? null,
|
|
98
116
|
...(entry.started_by_user_id ? { started_by_user_id: entry.started_by_user_id } : {}),
|
|
99
117
|
})),
|
package/dist/version.d.ts
CHANGED
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
* `package.json`, so a release bump that forgets this file fails the suite
|
|
8
8
|
* instead of shipping a `User-Agent` that lies about which build is calling.
|
|
9
9
|
*/
|
|
10
|
-
export declare const CLI_VERSION = "0.16.
|
|
10
|
+
export declare const CLI_VERSION = "0.16.7";
|
|
11
11
|
/** Sent on every HTTP request the CLI makes back into ProhostAI. */
|
|
12
|
-
export declare const USER_AGENT = "prohost-cli/0.16.
|
|
12
|
+
export declare const USER_AGENT = "prohost-cli/0.16.7";
|
package/dist/version.js
CHANGED
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
* `package.json`, so a release bump that forgets this file fails the suite
|
|
8
8
|
* instead of shipping a `User-Agent` that lies about which build is calling.
|
|
9
9
|
*/
|
|
10
|
-
export const CLI_VERSION = '0.16.
|
|
10
|
+
export const CLI_VERSION = '0.16.7';
|
|
11
11
|
/** Sent on every HTTP request the CLI makes back into ProhostAI. */
|
|
12
12
|
export const USER_AGENT = `prohost-cli/${CLI_VERSION}`;
|