svamp-cli 0.2.275 → 0.2.277
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/dist/{agentCommands-DGT-1wjo.mjs → agentCommands-DN7hb_oL.mjs} +5 -5
- package/dist/{auth-CT55Rse4.mjs → auth-Ci70oWRc.mjs} +1 -1
- package/dist/{cli-DYTmO9JL.mjs → cli-Cgzvydbh.mjs} +97 -65
- package/dist/cli.mjs +2 -2
- package/dist/{commands-D7fIWAgz.mjs → commands-BryGjm3r.mjs} +1 -1
- package/dist/{commands-CVPcbtWV.mjs → commands-CT7m_PBV.mjs} +1 -1
- package/dist/{commands-C8Zc5axO.mjs → commands-CWVq7FHR.mjs} +7 -7
- package/dist/{commands-CXHZapLH.mjs → commands-Cc2BZW1I.mjs} +8 -7
- package/dist/{commands-C0rRjhMD.mjs → commands-CgQ3wXOd.mjs} +2 -2
- package/dist/{commands-BvmFXAmu.mjs → commands-Dx-uU1hc.mjs} +2 -2
- package/dist/{commands-BV_9mFkz.mjs → commands-KWZkSbXH.mjs} +2 -2
- package/dist/{fleet-BCel6ZVc.mjs → fleet-w3MI6ljI.mjs} +2 -2
- package/dist/{frpc-D3faR6iR.mjs → frpc-DnxvF_Mx.mjs} +7 -5
- package/dist/{headlessCli-DVBFm7og.mjs → headlessCli-CqxD6lTs.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/notifyCommands-D8tYXxPA.mjs +128 -0
- package/dist/package-D5iaKvt5.mjs +64 -0
- package/dist/{pinnedClaudeCode-CgEtGkX2.mjs → pinnedClaudeCode-BaMR97BE.mjs} +1 -1
- package/dist/{rpc-xlV-4-BG.mjs → rpc-BKDKqllr.mjs} +1 -3
- package/dist/{rpc-BQ8zLSUc.mjs → rpc-BvXiNu-z.mjs} +1 -1
- package/dist/{run-C3Fcbk-H.mjs → run-CzXwL-ig.mjs} +277 -55
- package/dist/{run-DMPVho7i.mjs → run-pAWQPn46.mjs} +4 -3
- package/dist/{scheduler-DaFZY2ob.mjs → scheduler-D-25wsin.mjs} +1 -1
- package/dist/{serveCommands-B9Yhx1fl.mjs → serveCommands-DIckIiqD.mjs} +5 -5
- package/dist/{sideband-CYqmMG_m.mjs → sideband-Bk0GhfIX.mjs} +1 -1
- package/package.json +2 -2
- package/dist/package-DIuZ7Wfp.mjs +0 -64
|
@@ -60,7 +60,7 @@ async function serviceExpose(args) {
|
|
|
60
60
|
process.exit(1);
|
|
61
61
|
}
|
|
62
62
|
if (foreground) {
|
|
63
|
-
const { runFrpcTunnel } = await import('./frpc-
|
|
63
|
+
const { runFrpcTunnel } = await import('./frpc-DnxvF_Mx.mjs');
|
|
64
64
|
await runFrpcTunnel(name, ports, void 0, {
|
|
65
65
|
group,
|
|
66
66
|
groupKey,
|
|
@@ -70,7 +70,7 @@ async function serviceExpose(args) {
|
|
|
70
70
|
});
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
73
|
+
const { connectAndGetMachine } = await import('./commands-BryGjm3r.mjs');
|
|
74
74
|
const { server, machine } = await connectAndGetMachine();
|
|
75
75
|
try {
|
|
76
76
|
const status = await machine.tunnelStart({
|
|
@@ -92,7 +92,7 @@ async function serviceExpose(args) {
|
|
|
92
92
|
console.log(` port ${port}: ${url}`);
|
|
93
93
|
}
|
|
94
94
|
if (process.env.SVAMP_SESSION_ID) {
|
|
95
|
-
const { autoAddSessionLink } = await import('./agentCommands-
|
|
95
|
+
const { autoAddSessionLink } = await import('./agentCommands-DN7hb_oL.mjs');
|
|
96
96
|
let added = 0;
|
|
97
97
|
for (const [port, url] of urlEntries) {
|
|
98
98
|
const label = urlEntries.length > 1 ? `${name}:${port}` : name;
|
|
@@ -129,7 +129,7 @@ async function serviceServe(args) {
|
|
|
129
129
|
console.log(`Serving ${resolvedDir}`);
|
|
130
130
|
const servePort = 18080;
|
|
131
131
|
const http = await import('http');
|
|
132
|
-
const { serveStaticMount } = await import('./run-
|
|
132
|
+
const { serveStaticMount } = await import('./run-CzXwL-ig.mjs').then(function (n) { return n.aj; });
|
|
133
133
|
const server = http.createServer((req, res) => {
|
|
134
134
|
const u = new URL(req.url || "/", "http://127.0.0.1");
|
|
135
135
|
let rel = u.pathname;
|
|
@@ -140,7 +140,7 @@ async function serviceServe(args) {
|
|
|
140
140
|
server.once("error", reject);
|
|
141
141
|
server.listen(servePort, "127.0.0.1", () => resolve());
|
|
142
142
|
});
|
|
143
|
-
const { runFrpcTunnel } = await import('./frpc-
|
|
143
|
+
const { runFrpcTunnel } = await import('./frpc-DnxvF_Mx.mjs');
|
|
144
144
|
void server;
|
|
145
145
|
await runFrpcTunnel(name, [servePort]);
|
|
146
146
|
} catch (err) {
|
|
@@ -150,7 +150,7 @@ async function serviceServe(args) {
|
|
|
150
150
|
}
|
|
151
151
|
async function serviceList(_args) {
|
|
152
152
|
try {
|
|
153
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
153
|
+
const { connectAndGetMachine } = await import('./commands-BryGjm3r.mjs');
|
|
154
154
|
const { server, machine } = await connectAndGetMachine();
|
|
155
155
|
try {
|
|
156
156
|
const tunnels = await machine.tunnelList({});
|
|
@@ -190,7 +190,7 @@ async function serviceDelete(args) {
|
|
|
190
190
|
process.exit(1);
|
|
191
191
|
}
|
|
192
192
|
try {
|
|
193
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
193
|
+
const { connectAndGetMachine } = await import('./commands-BryGjm3r.mjs');
|
|
194
194
|
const { server, machine } = await connectAndGetMachine();
|
|
195
195
|
try {
|
|
196
196
|
await machine.tunnelStop({ name });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
|
-
import { j as resolveProjectRoot, I as workflowSteps, z as setWorkflowEnabled, E as isWorkflowEnabled, A as removeWorkflow, x as getWorkflow, D as listWorkflows, B as saveWorkflow, C as rawWorkflow } from './run-
|
|
2
|
+
import { j as resolveProjectRoot, I as workflowSteps, z as setWorkflowEnabled, E as isWorkflowEnabled, A as removeWorkflow, x as getWorkflow, D as listWorkflows, B as saveWorkflow, C as rawWorkflow } from './run-CzXwL-ig.mjs';
|
|
3
3
|
import 'os';
|
|
4
4
|
import 'fs/promises';
|
|
5
5
|
import 'fs';
|
|
@@ -60,7 +60,7 @@ async function workflowCommand(args) {
|
|
|
60
60
|
const name = positional(rest)[0];
|
|
61
61
|
const runs = allFlags(rest, "--run");
|
|
62
62
|
if (!name || !runs.length) {
|
|
63
|
-
console.error('usage: svamp workflow add <name> --run "<cmd>" [--run "<cmd2>"] [--on schedule|dispatch|
|
|
63
|
+
console.error('usage: svamp workflow add <name> --run "<cmd>" [--run "<cmd2>"] [--on schedule|dispatch|idle] [--cron "* * * * *"]');
|
|
64
64
|
process.exit(1);
|
|
65
65
|
}
|
|
66
66
|
const onKinds = allFlags(rest, "--on");
|
|
@@ -68,8 +68,9 @@ async function workflowCommand(args) {
|
|
|
68
68
|
const on = {};
|
|
69
69
|
if (onKinds.includes("schedule") || crons.length) on.schedule = (crons.length ? crons : ["0 * * * *"]).map((c) => ({ cron: c }));
|
|
70
70
|
if (onKinds.includes("dispatch") || onKinds.includes("workflow_dispatch")) on.workflow_dispatch = true;
|
|
71
|
-
if (onKinds.includes("channel") || flag(rest, "--channel")
|
|
72
|
-
|
|
71
|
+
if (onKinds.includes("channel") || flag(rest, "--channel") || onKinds.includes("issue") || flag(rest, "--issue")) {
|
|
72
|
+
console.error('Warning: --on channel / --on issue triggers are not yet wired to a firing engine and would never run \u2014 ignoring them. Use --on schedule (--cron "<expr>"), --on idle, or --on dispatch.');
|
|
73
|
+
}
|
|
73
74
|
if (onKinds.includes("idle")) on.idle = true;
|
|
74
75
|
const owner = flag(rest, "--session") || process.env.SVAMP_SESSION_ID || null;
|
|
75
76
|
const wf = { name, on: Object.keys(on).length ? on : void 0, jobs: { run: { steps: runs.map((r) => ({ run: r })) } }, session: owner };
|
|
@@ -158,7 +159,7 @@ async function workflowCommand(args) {
|
|
|
158
159
|
console.log([
|
|
159
160
|
"CREATE an automation WORKFLOW from a request (GitHub-Actions-style, .svamp/workflows/<name>.yaml):",
|
|
160
161
|
" svamp workflow add <kebab-name> \\",
|
|
161
|
-
' [--on schedule --cron "<expr>" | --on dispatch | --on
|
|
162
|
+
' [--on schedule --cron "<expr>" | --on dispatch | --on idle] \\',
|
|
162
163
|
' --run "<shell/svamp command>" [--run "<cmd2>"]...',
|
|
163
164
|
" - A step is any shell or svamp command. To start a self-verifying loop on a schedule:",
|
|
164
165
|
` --run "svamp session loop <session-id> '<task>' --until '<done criteria>' [--max N]"`,
|
|
@@ -175,8 +176,8 @@ async function workflowCommand(args) {
|
|
|
175
176
|
console.log([
|
|
176
177
|
"svamp workflow \u2014 GitHub-Actions-style automation as .svamp/workflows/<name>.yaml",
|
|
177
178
|
"",
|
|
178
|
-
' add <name> --run "<cmd>" [--run "<cmd2>"] [--on schedule|dispatch|
|
|
179
|
-
' [--cron "0 9 * * 1-5"]
|
|
179
|
+
' add <name> --run "<cmd>" [--run "<cmd2>"] [--on schedule|dispatch|idle]',
|
|
180
|
+
' [--cron "0 9 * * 1-5"] # channel/issue triggers are not yet wired',
|
|
180
181
|
" list | show <name> | remove <name>",
|
|
181
182
|
" enable <name> | disable <name> # toggle active/disabled (scheduler skips disabled)",
|
|
182
183
|
" run <name> # execute the workflow's run-only steps now",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
|
-
import { connectAndGetMachine, resolveSessionId, createWorktree, connectAndResolveSession } from './commands-
|
|
3
|
+
import { connectAndGetMachine, resolveSessionId, createWorktree, connectAndResolveSession } from './commands-BryGjm3r.mjs';
|
|
4
4
|
import { execFileSync } from 'node:child_process';
|
|
5
|
-
import { u as updateIssue, m as addComment, n as addIssue, i as shortId } from './run-
|
|
5
|
+
import { u as updateIssue, m as addComment, n as addIssue, i as shortId } from './run-CzXwL-ig.mjs';
|
|
6
6
|
import 'node:os';
|
|
7
7
|
import 'os';
|
|
8
8
|
import 'fs/promises';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { execSync } from 'node:child_process';
|
|
2
2
|
import { existsSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
-
import { f as flushAndExit } from './cli-
|
|
5
|
-
import { j as resolveProjectRoot, q as searchIssues, o as listIssues, l as resumeIssue, p as pauseIssue, m as addComment, u as updateIssue, k as getIssue, t as isVisibleTo, H as summarize, n as addIssue } from './run-
|
|
4
|
+
import { f as flushAndExit } from './cli-Cgzvydbh.mjs';
|
|
5
|
+
import { j as resolveProjectRoot, q as searchIssues, o as listIssues, l as resumeIssue, p as pauseIssue, m as addComment, u as updateIssue, k as getIssue, t as isVisibleTo, H as summarize, n as addIssue } from './run-CzXwL-ig.mjs';
|
|
6
6
|
import './serviceManager-hlOVxkhW.mjs';
|
|
7
7
|
import 'os';
|
|
8
8
|
import 'fs/promises';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { writeFileSync, readFileSync } from 'fs';
|
|
2
2
|
import { resolve } from 'path';
|
|
3
|
-
import { connectAndGetMachine } from './commands-
|
|
3
|
+
import { connectAndGetMachine } from './commands-BryGjm3r.mjs';
|
|
4
4
|
import 'node:fs';
|
|
5
5
|
import 'node:child_process';
|
|
6
6
|
import 'node:path';
|
|
7
7
|
import 'node:os';
|
|
8
|
-
import './run-
|
|
8
|
+
import './run-CzXwL-ig.mjs';
|
|
9
9
|
import 'os';
|
|
10
10
|
import 'fs/promises';
|
|
11
11
|
import 'url';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import os from 'node:os';
|
|
4
|
-
import { c as connectToHypha } from './run-
|
|
5
|
-
import { PINNED_CLAUDE_CODE_VERSION } from './pinnedClaudeCode-
|
|
4
|
+
import { c as connectToHypha } from './run-CzXwL-ig.mjs';
|
|
5
|
+
import { PINNED_CLAUDE_CODE_VERSION } from './pinnedClaudeCode-BaMR97BE.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'fs';
|
|
@@ -4,7 +4,7 @@ import { mkdirSync, chmodSync, writeFileSync, unlinkSync, existsSync, readFileSy
|
|
|
4
4
|
import { join } from 'path';
|
|
5
5
|
import { homedir, platform, arch } from 'os';
|
|
6
6
|
import { randomUUID, createHash } from 'crypto';
|
|
7
|
-
import { e as getFrpsSubdomainHost, f as getFrpsServerPort, h as getFrpsServerAddr } from './run-
|
|
7
|
+
import { e as getFrpsSubdomainHost, f as getFrpsServerPort, h as getFrpsServerAddr } from './run-CzXwL-ig.mjs';
|
|
8
8
|
import 'fs/promises';
|
|
9
9
|
import 'url';
|
|
10
10
|
import 'node:crypto';
|
|
@@ -306,10 +306,11 @@ class FrpcTunnel {
|
|
|
306
306
|
}
|
|
307
307
|
const machineFingerprint = getMachineFingerprint();
|
|
308
308
|
const machineHash = createHash("sha256").update(machineFingerprint).digest("hex").slice(0, 6);
|
|
309
|
+
const multiPort = options.ports.length > 1;
|
|
309
310
|
this.proxies = options.ports.map((port) => {
|
|
310
|
-
const standaloneHash = createHash("sha256").update(`${options.name}|${machineFingerprint}`).digest("hex").slice(0, 8);
|
|
311
|
+
const standaloneHash = createHash("sha256").update(multiPort ? `${options.name}|${port}|${machineFingerprint}` : `${options.name}|${machineFingerprint}`).digest("hex").slice(0, 8);
|
|
311
312
|
const subdomain = options.subdomains?.get(port) || (options.group ? `${options.group}-${createHash("sha256").update(options.group).digest("hex").slice(0, 8)}` : `${options.name}-${standaloneHash}`);
|
|
312
|
-
const proxyName =
|
|
313
|
+
const proxyName = `${options.name}-${port}-${machineHash}`;
|
|
313
314
|
return {
|
|
314
315
|
name: proxyName,
|
|
315
316
|
type: "http",
|
|
@@ -393,11 +394,12 @@ class FrpcTunnel {
|
|
|
393
394
|
}
|
|
394
395
|
}
|
|
395
396
|
}
|
|
396
|
-
|
|
397
|
+
const errorLine = text.split("\n").find((line) => line.includes("[E]"));
|
|
398
|
+
if (errorLine) {
|
|
397
399
|
this._consecutiveErrors++;
|
|
398
400
|
this._lastErrorAt = Date.now();
|
|
399
401
|
if (this._firstErrorAt === 0) this._firstErrorAt = Date.now();
|
|
400
|
-
this.options.onError?.(new Error(
|
|
402
|
+
this.options.onError?.(new Error(errorLine));
|
|
401
403
|
}
|
|
402
404
|
};
|
|
403
405
|
child.stdout?.on("data", onOutput);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-
|
|
1
|
+
import { _ as resolveModel, ad as describeMisconfiguration, ae as buildMachineDeps } from './run-CzXwL-ig.mjs';
|
|
2
|
+
import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-Bk0GhfIX.mjs';
|
|
3
3
|
import { WebSocket } from 'ws';
|
|
4
4
|
import { execSync, spawn } from 'child_process';
|
|
5
5
|
import 'os';
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as connectToHypha, a as createSessionStore, d as daemonStatus, g as getHyphaServerUrl, r as registerMachineService, s as startDaemon, b as stopDaemon } from './run-
|
|
1
|
+
export { c as connectToHypha, a as createSessionStore, d as daemonStatus, g as getHyphaServerUrl, r as registerMachineService, s as startDaemon, b as stopDaemon } from './run-CzXwL-ig.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { c as connectToHypha, S as SharingNotificationSync, J as parseJwtEmail } from './run-CzXwL-ig.mjs';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import 'os';
|
|
7
|
+
import 'fs/promises';
|
|
8
|
+
import 'fs';
|
|
9
|
+
import 'path';
|
|
10
|
+
import 'url';
|
|
11
|
+
import 'child_process';
|
|
12
|
+
import 'crypto';
|
|
13
|
+
import 'node:child_process';
|
|
14
|
+
import 'util';
|
|
15
|
+
import 'http';
|
|
16
|
+
import 'net';
|
|
17
|
+
import 'node:events';
|
|
18
|
+
import '@agentclientprotocol/sdk';
|
|
19
|
+
import 'node:readline';
|
|
20
|
+
import 'node:fs/promises';
|
|
21
|
+
import 'node:util';
|
|
22
|
+
import 'yaml';
|
|
23
|
+
|
|
24
|
+
function loadEnv() {
|
|
25
|
+
const SVAMP_HOME = process.env.SVAMP_HOME || join(os.homedir(), ".svamp");
|
|
26
|
+
for (const f of [join(SVAMP_HOME, ".env"), join(os.homedir(), ".hypha", ".env")]) {
|
|
27
|
+
if (!existsSync(f)) continue;
|
|
28
|
+
try {
|
|
29
|
+
for (const line of readFileSync(f, "utf-8").split("\n")) {
|
|
30
|
+
const m = line.match(/^\s*([A-Za-z0-9_]+)\s*=\s*(.*)\s*$/);
|
|
31
|
+
if (m && process.env[m[1]] === void 0) {
|
|
32
|
+
process.env[m[1]] = m[2].replace(/^["']|["']$/g, "");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
} catch {
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function connect() {
|
|
40
|
+
loadEnv();
|
|
41
|
+
const serverUrl = process.env.HYPHA_SERVER_URL;
|
|
42
|
+
const token = process.env.HYPHA_TOKEN;
|
|
43
|
+
if (!serverUrl || !token) {
|
|
44
|
+
console.error('Not logged in. Run "svamp login <url>" first.');
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
const server = await connectToHypha({ serverUrl, token, name: "svamp-notify-cli" });
|
|
48
|
+
const sync = new SharingNotificationSync(server, () => {
|
|
49
|
+
});
|
|
50
|
+
await sync.init();
|
|
51
|
+
return { server, sync, callerEmail: (parseJwtEmail(token) || "").toLowerCase() };
|
|
52
|
+
}
|
|
53
|
+
async function done(server) {
|
|
54
|
+
try {
|
|
55
|
+
await server.disconnect?.();
|
|
56
|
+
} catch {
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async function notifyUser(email, opts) {
|
|
60
|
+
if (!email) {
|
|
61
|
+
console.error("Usage: svamp notify <email> --title <t> --body <b> [--action <json>] [--level info|warning|error]");
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
let action;
|
|
65
|
+
if (opts.action) {
|
|
66
|
+
try {
|
|
67
|
+
action = JSON.parse(opts.action);
|
|
68
|
+
} catch {
|
|
69
|
+
console.error("--action must be valid JSON");
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const level = ["info", "warning", "error"].includes(opts.level || "") ? opts.level : "info";
|
|
74
|
+
const { server, sync, callerEmail } = await connect();
|
|
75
|
+
await sync.publishUserEvent({
|
|
76
|
+
id: randomUUID(),
|
|
77
|
+
recipientEmail: email.toLowerCase(),
|
|
78
|
+
type: "notification",
|
|
79
|
+
source: { service: "svamp-cli", workspace: server.config?.workspace || "", userEmail: callerEmail || void 0 },
|
|
80
|
+
title: opts.title || "Notification",
|
|
81
|
+
body: opts.body || "",
|
|
82
|
+
level,
|
|
83
|
+
...action ? { action } : {},
|
|
84
|
+
createdAt: Date.now(),
|
|
85
|
+
expiresAt: Date.now() + 30 * 24 * 60 * 60 * 1e3
|
|
86
|
+
// 30 days
|
|
87
|
+
});
|
|
88
|
+
console.log(`\u2713 Notified ${email}${callerEmail ? ` (from ${callerEmail})` : ""}`);
|
|
89
|
+
await done(server);
|
|
90
|
+
}
|
|
91
|
+
async function listEvents(opts) {
|
|
92
|
+
const { server, sync, callerEmail } = await connect();
|
|
93
|
+
const email = (opts.email || callerEmail).toLowerCase();
|
|
94
|
+
if (!email) {
|
|
95
|
+
console.error("No recipient email (your token has none) \u2014 pass --email <you@example.com>");
|
|
96
|
+
await done(server);
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
const events = await sync.listUserEvents(email);
|
|
100
|
+
if (opts.json) {
|
|
101
|
+
console.log(JSON.stringify(events, null, 2));
|
|
102
|
+
} else if (events.length === 0) {
|
|
103
|
+
console.log(`No events for ${email}.`);
|
|
104
|
+
} else {
|
|
105
|
+
console.log(`${events.length} event(s) for ${email}:
|
|
106
|
+
`);
|
|
107
|
+
for (const e of events) {
|
|
108
|
+
const when = new Date(e.createdAt || 0).toISOString().slice(0, 16).replace("T", " ");
|
|
109
|
+
console.log(` [${e.level}] ${e.title} (${(e.id || "").slice(0, 8)}, ${when})`);
|
|
110
|
+
if (e.body) console.log(` ${e.body}`);
|
|
111
|
+
if (e.source?.userEmail) console.log(` from: ${e.source.userEmail}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
await done(server);
|
|
115
|
+
}
|
|
116
|
+
async function ackEvent(eventId, opts) {
|
|
117
|
+
if (!eventId) {
|
|
118
|
+
console.error("Usage: svamp events ack <event-id> [--email <e>]");
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
121
|
+
const { server, sync, callerEmail } = await connect();
|
|
122
|
+
const email = (opts.email || callerEmail).toLowerCase();
|
|
123
|
+
const ok = await sync.ackUserEvent(eventId, email);
|
|
124
|
+
console.log(ok ? `\u2713 Dismissed event ${eventId.slice(0, 8)}` : `Event ${eventId.slice(0, 8)} not found for ${email}`);
|
|
125
|
+
await done(server);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export { ackEvent, listEvents, notifyUser };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var name = "svamp-cli";
|
|
2
|
+
var version = "0.2.277";
|
|
3
|
+
var description = "Svamp CLI — AI workspace daemon on Hypha Cloud";
|
|
4
|
+
var author = "Amun AI AB";
|
|
5
|
+
var license = "SEE LICENSE IN LICENSE";
|
|
6
|
+
var type = "module";
|
|
7
|
+
var bin = {
|
|
8
|
+
svamp: "./bin/svamp.mjs"
|
|
9
|
+
};
|
|
10
|
+
var files = [
|
|
11
|
+
"dist",
|
|
12
|
+
"bin"
|
|
13
|
+
];
|
|
14
|
+
var main = "./dist/index.mjs";
|
|
15
|
+
var exports$1 = {
|
|
16
|
+
".": "./dist/index.mjs",
|
|
17
|
+
"./cli": "./dist/cli.mjs"
|
|
18
|
+
};
|
|
19
|
+
var scripts = {
|
|
20
|
+
build: "rm -rf dist bin/skills bin/commands && mkdir -p bin/skills && cp -r ../../skills/artifact bin/skills/artifact && cp -r ../../skills/crew bin/skills/crew && cp -r ../../commands bin/commands && tsc --noEmit && pkgroll",
|
|
21
|
+
typecheck: "tsc --noEmit",
|
|
22
|
+
test: "npx tsx test/test-context-window.mjs && npx tsx test/test-ratelimit-retry.mjs && npx tsx test/test-instance-config.mjs && npx tsx test/test-authorize.mjs && npx tsx test/test-normalize-allowed-user.mjs && npx tsx test/test-share-url.mjs && npx tsx test/test-update-sharing-normalization.mjs && npx tsx test/test-sharing-notify-sync.mjs && npx tsx test/test-staged-homes-sweep.mjs && npx tsx test/test-session-helpers.mjs && npx tsx test/test-cli-routing.mjs && npx tsx test/test-security-context.mjs && npx tsx test/test-isolation-decision.mjs && npx tsx test/test-message-helpers.mjs && npx tsx test/test-agent-config.mjs && npx tsx test/test-wrap-command.mjs && npx tsx test/test-credential-staging.mjs && npx tsx test/test-claude-auth.mjs && npx tsx test/test-backend-accounts.mjs && npx tsx test/test-backend-oauth.mjs && npx tsx test/test-btw-proxy-env.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-inbox-guard.mjs && npx tsx test/test-user-events.mjs && npx tsx test/test-inbox-reconcile.mjs && npx tsx test/test-auto-topic.mjs && npx tsx test/test-project-info.mjs && npx tsx test/test-agent-types.mjs && npx tsx test/test-transport.mjs && npx tsx test/test-session-update-handlers.mjs && npx tsx test/test-session-scanner.mjs && npx tsx test/test-hypha-client.mjs && npx tsx test/test-hook-settings.mjs && npx tsx test/test-session-service-logic.mjs && npx tsx test/test-daemon-persistence.mjs && npx tsx test/test-detect-isolation.mjs && npx tsx test/test-isolation-disable.mjs && npx tsx test/test-machine-service-logic.mjs && npx tsx test/test-session-access-fallback.mjs && npx tsx test/test-interactive-helpers.mjs && npx tsx test/test-codex-app-server.mjs && npx tsx test/test-acp-backend.mjs && npx tsx test/test-acp-bridge.mjs && npx tsx test/test-hook-server.mjs && npx tsx test/test-session-commands.mjs && npx tsx test/test-interactive-console.mjs && npx tsx test/test-session-messages.mjs && npx tsx test/test-session-send-query.mjs && npx tsx test/test-skills.mjs && npx tsx test/test-agent-grouping.mjs && npx tsx test/test-machine-list-directory.mjs && npx tsx test/test-service-commands.mjs && npx tsx test/test-supervisor.mjs && npx tsx test/test-supervisor-lock.mjs && node test/test-supervisor-restart.mjs && npx tsx test/test-clear-detection.mjs && npx tsx test/test-compact-detect.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox-store.mjs && npx tsx test/test-inbox.mjs && npx tsx test/test-inbox-cross-machine.mjs && npx tsx test/test-issue-store.mjs && npx tsx test/test-issue-close-gate.mjs && npx tsx test/test-loop-verify.mjs && npx tsx test/test-issue-rpc.mjs && npx tsx test/test-issue-pause.mjs && npx tsx test/test-workflow-store.mjs && npx tsx test/test-workflow-rpc.mjs && npx tsx test/test-workflow-scheduler.mjs && npx tsx test/test-cron.mjs && npx tsx test/test-workflow-runs.mjs && npx tsx test/test-workflow-idle.mjs && npx tsx test/test-serve-link-subdomain.mjs && npx tsx test/test-short-id.mjs && npx tsx test/test-transcript-edit.mjs && npx tsx test/test-edit-history.mjs && npx tsx test/test-friendly-name.mjs && npx tsx test/test-session-rpc-dispatch.mjs && npx tsx test/test-sandbox-cli.mjs && npx tsx test/test-serve-manager.mjs && npx tsx test/test-serve-ws-upgrade.mjs && npx tsx test/test-serve-auth.mjs && npx tsx test/test-static-file-server.mjs && npx tsx test/test-serve-stability.mjs && npx tsx test/test-frpc-e2e.mjs --unit-only && npx tsx test/test-frpc-status.mjs && node test/pinnedClaudeCode.test.mjs && node test/fleet.test.mjs && npx tsx test/test-session-file.mjs && npx tsx test/test-channel-rpc.mjs && npx tsx test/test-wise-agent.mjs && npx tsx test/test-channel-agent.mjs && npx tsx test/test-channels-service.mjs && npx tsx test/test-hotreload-seam.mjs && npx tsx test/test-hot-reload.mjs && npx tsx test/test-hot-reload-live.mjs && npx tsx test/test-session-core.mjs && npx tsx test/test-channel-async-reply.mjs && npx tsx test/test-outbox-reload.mjs && npx tsx test/test-channel-binding.mjs && npx tsx test/test-channel-identity.mjs && npx tsx test/test-shared-session-identity.mjs && npx tsx test/test-wise-agent-auth.mjs && npx tsx test/test-channel-http.mjs && npx tsx test/test-channel-upload.mjs && npx tsx test/test-wise-voice.mjs && npx tsx test/test-wise-headless.mjs && npx tsx test/test-wise-machine.mjs && npx tsx test/test-crew-merge.mjs && npx tsx test/test-crew-verdict-routing.mjs && npx tsx test/test-crew-standalone.mjs && npx tsx test/test-session-links.mjs && npx tsx test/test-issue-loop-pause-guard.mjs && npx tsx test/test-artifact-guard.mjs && npx tsx test/test-graceful-restart.mjs && npx tsx test/test-flush-exit.mjs",
|
|
23
|
+
"test:hypha": "node --no-warnings test/test-hypha-service.mjs",
|
|
24
|
+
dev: "tsx src/cli.ts",
|
|
25
|
+
"dev:daemon": "tsx src/cli.ts daemon start-sync",
|
|
26
|
+
"test:e2e": "node --no-warnings test/e2e-session-tests.mjs",
|
|
27
|
+
"test:frpc": "npx tsx test/test-frpc-e2e.mjs",
|
|
28
|
+
prepublishOnly: "yarn build"
|
|
29
|
+
};
|
|
30
|
+
var dependencies = {
|
|
31
|
+
"@agentclientprotocol/sdk": "^0.14.1",
|
|
32
|
+
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
33
|
+
"hypha-rpc": "0.21.42",
|
|
34
|
+
"node-pty": "1.2.0-beta.11",
|
|
35
|
+
ws: "^8.18.0",
|
|
36
|
+
yaml: "^2.8.2",
|
|
37
|
+
zod: "^3.24.4"
|
|
38
|
+
};
|
|
39
|
+
var devDependencies = {
|
|
40
|
+
"@types/node": ">=20",
|
|
41
|
+
"@types/ws": "^8.5.14",
|
|
42
|
+
pkgroll: "^2.14.2",
|
|
43
|
+
tsx: "^4.20.6",
|
|
44
|
+
typescript: "5.9.3"
|
|
45
|
+
};
|
|
46
|
+
var packageManager = "yarn@1.22.22";
|
|
47
|
+
var _package = {
|
|
48
|
+
name: name,
|
|
49
|
+
version: version,
|
|
50
|
+
description: description,
|
|
51
|
+
author: author,
|
|
52
|
+
license: license,
|
|
53
|
+
type: type,
|
|
54
|
+
bin: bin,
|
|
55
|
+
files: files,
|
|
56
|
+
main: main,
|
|
57
|
+
exports: exports$1,
|
|
58
|
+
scripts: scripts,
|
|
59
|
+
dependencies: dependencies,
|
|
60
|
+
devDependencies: devDependencies,
|
|
61
|
+
packageManager: packageManager
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export { author, bin, _package as default, dependencies, description, devDependencies, exports$1 as exports, files, license, main, name, packageManager, scripts, type, version };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { spawn, exec as exec$1 } from 'node:child_process';
|
|
2
2
|
import { promisify } from 'node:util';
|
|
3
3
|
|
|
4
|
-
const PINNED_CLAUDE_CODE_VERSION = "2.1.
|
|
4
|
+
const PINNED_CLAUDE_CODE_VERSION = "2.1.217";
|
|
5
5
|
const exec = promisify(exec$1);
|
|
6
6
|
let _reconcile = null;
|
|
7
7
|
function beginClaudeVersionReconcile(log) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as resolveProjectRoot, v as getRun, w as listRuns, x as getWorkflow, y as runWorkflow, z as setWorkflowEnabled, A as removeWorkflow, B as saveWorkflow, C as rawWorkflow, D as listWorkflows } from './run-
|
|
1
|
+
import { j as resolveProjectRoot, v as getRun, w as listRuns, x as getWorkflow, y as runWorkflow, z as setWorkflowEnabled, A as removeWorkflow, B as saveWorkflow, C as rawWorkflow, D as listWorkflows } from './run-CzXwL-ig.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -36,8 +36,6 @@ async function workflowRpc(cwd, params) {
|
|
|
36
36
|
const crons = Array.isArray(params.cron) ? params.cron.map(String) : params.cron ? [String(params.cron)] : [];
|
|
37
37
|
if (crons.length) on.schedule = crons.map((c) => ({ cron: c }));
|
|
38
38
|
if (params.dispatch || params.workflow_dispatch) on.workflow_dispatch = true;
|
|
39
|
-
if (params.channel) on.channel = String(params.channel);
|
|
40
|
-
if (Array.isArray(params.issue) && params.issue.length) on.issue = params.issue.map(String);
|
|
41
39
|
const runs = Array.isArray(params.runs) ? params.runs.map(String).filter(Boolean) : [];
|
|
42
40
|
if (!params.name || !runs.length) throw new Error("workflow add: name and at least one run step required");
|
|
43
41
|
const wf = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as resolveProjectRoot, u as updateIssue, k as getIssue, l as resumeIssue, p as pauseIssue, m as addComment, n as addIssue, o as listIssues, q as searchIssues, t as isVisibleTo } from './run-
|
|
1
|
+
import { j as resolveProjectRoot, u as updateIssue, k as getIssue, l as resumeIssue, p as pauseIssue, m as addComment, n as addIssue, o as listIssues, q as searchIssues, t as isVisibleTo } from './run-CzXwL-ig.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|