@sema-agent/cli 1.0.26 → 1.0.27
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/npm-shrinkwrap.json +9 -9
- package/package.json +4 -4
- package/sema.js +134 -29
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@sema-agent/cli",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.27",
|
|
10
10
|
"license": "BUSL-1.1",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@sema-agent/sdk": "0.0.57",
|
|
13
|
-
"@sema-agent/server": "1.
|
|
13
|
+
"@sema-agent/server": "1.229.0"
|
|
14
14
|
},
|
|
15
15
|
"bin": {
|
|
16
16
|
"sema": "sema.js"
|
|
@@ -629,9 +629,9 @@
|
|
|
629
629
|
}
|
|
630
630
|
},
|
|
631
631
|
"node_modules/@sema-agent/core": {
|
|
632
|
-
"version": "1.
|
|
633
|
-
"resolved": "https://registry.npmjs.org/@sema-agent/core/-/core-1.
|
|
634
|
-
"integrity": "sha512-
|
|
632
|
+
"version": "1.332.0",
|
|
633
|
+
"resolved": "https://registry.npmjs.org/@sema-agent/core/-/core-1.332.0.tgz",
|
|
634
|
+
"integrity": "sha512-qVwRaPmKXnhlechgcLfD7QM/qrO0DYjn3nE/zQfNiT6sobsH4aOthlvtvJaPQN7efkQsw2Yi7lijneiu9k//Gw==",
|
|
635
635
|
"license": "BUSL-1.1",
|
|
636
636
|
"dependencies": {
|
|
637
637
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
@@ -678,9 +678,9 @@
|
|
|
678
678
|
}
|
|
679
679
|
},
|
|
680
680
|
"node_modules/@sema-agent/server": {
|
|
681
|
-
"version": "1.
|
|
682
|
-
"resolved": "https://registry.npmjs.org/@sema-agent/server/-/server-1.
|
|
683
|
-
"integrity": "sha512-
|
|
681
|
+
"version": "1.229.0",
|
|
682
|
+
"resolved": "https://registry.npmjs.org/@sema-agent/server/-/server-1.229.0.tgz",
|
|
683
|
+
"integrity": "sha512-IXBD3PIHyCkcerzEI0cajyD80dll8itTzZ6UMED09Vu+r5L/FSywYNvlI66abut8s0sQKi0QHz4kJGOJ0lwobQ==",
|
|
684
684
|
"license": "BUSL-1.1",
|
|
685
685
|
"dependencies": {
|
|
686
686
|
"@sema-agent/core": "^1.329.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"description": "Sema — your own Claude Code-grade coding agent, in the terminal.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"bin": {
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@sema-agent/sdk": "0.0.57",
|
|
25
|
-
"@sema-agent/server": "1.
|
|
25
|
+
"@sema-agent/server": "1.229.0"
|
|
26
26
|
},
|
|
27
27
|
"overrides": {
|
|
28
|
-
"@sema-agent/core": "1.
|
|
28
|
+
"@sema-agent/core": "1.332.0",
|
|
29
29
|
"@sema-agent/registry-core": "0.10.19"
|
|
30
30
|
},
|
|
31
|
-
"semaEngineVersion": "server 1.
|
|
31
|
+
"semaEngineVersion": "server 1.229.0 / core 1.332.0 / registry-core 0.10.19",
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": ">=18"
|
|
34
34
|
}
|
package/sema.js
CHANGED
|
@@ -331916,9 +331916,9 @@ function streamingTailWrap(unstableSuffix) {
|
|
|
331916
331916
|
var import_compiler_runtime43, import_react43, import_jsx_runtime53, TOKEN_CACHE_MAX, tokenCache, MD_SYNTAX_RE;
|
|
331917
331917
|
var init_Markdown = __esm({
|
|
331918
331918
|
"build-src/src/components/Markdown.tsx"() {
|
|
331919
|
-
import_compiler_runtime43 = __toESM(require_compiler_runtime());
|
|
331919
|
+
import_compiler_runtime43 = __toESM(require_compiler_runtime(), 1);
|
|
331920
331920
|
init_marked_esm();
|
|
331921
|
-
import_react43 = __toESM(require_react());
|
|
331921
|
+
import_react43 = __toESM(require_react(), 1);
|
|
331922
331922
|
init_useSettings();
|
|
331923
331923
|
init_ink2();
|
|
331924
331924
|
init_cliHighlight();
|
|
@@ -331926,7 +331926,7 @@ var init_Markdown = __esm({
|
|
|
331926
331926
|
init_markdown();
|
|
331927
331927
|
init_messages4();
|
|
331928
331928
|
init_MarkdownTable();
|
|
331929
|
-
import_jsx_runtime53 = __toESM(require_jsx_runtime());
|
|
331929
|
+
import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1);
|
|
331930
331930
|
TOKEN_CACHE_MAX = 500;
|
|
331931
331931
|
tokenCache = /* @__PURE__ */ new Map();
|
|
331932
331932
|
MD_SYNTAX_RE = /[#*`|[>\-_~]|\n\n|^\d+\. |\n\d+\. /;
|
|
@@ -479612,8 +479612,8 @@ var init_sema_brand = __esm({
|
|
|
479612
479612
|
"Slash-command gating wired to the fleet capability handshake"
|
|
479613
479613
|
]
|
|
479614
479614
|
},
|
|
479615
|
-
productVersion: "1.0.
|
|
479616
|
-
announcement: "sema 1.0.
|
|
479615
|
+
productVersion: "1.0.27",
|
|
479616
|
+
announcement: "sema 1.0.27 \u2014 named sub-agents grow a full lifecycle: messages to a resumed agent now deliver for real (honest queued/parked receipts), stopping one kills the right incarnation, and no stale output leaks across resume cycles."
|
|
479617
479617
|
};
|
|
479618
479618
|
}
|
|
479619
479619
|
});
|
|
@@ -482547,8 +482547,8 @@ var require_sema_brand = __commonJS({
|
|
|
482547
482547
|
"Slash-command gating wired to the fleet capability handshake"
|
|
482548
482548
|
]
|
|
482549
482549
|
},
|
|
482550
|
-
productVersion: "1.0.
|
|
482551
|
-
announcement: "sema 1.0.
|
|
482550
|
+
productVersion: "1.0.27",
|
|
482551
|
+
announcement: "sema 1.0.27 \u2014 named sub-agents grow a full lifecycle: messages to a resumed agent now deliver for real (honest queued/parked receipts), stopping one kills the right incarnation, and no stale output leaks across resume cycles."
|
|
482552
482552
|
};
|
|
482553
482553
|
}
|
|
482554
482554
|
});
|
|
@@ -554628,6 +554628,7 @@ var init_task_registry = __esm({
|
|
|
554628
554628
|
...input.description !== void 0 ? { description: input.description } : {},
|
|
554629
554629
|
...input.name !== void 0 ? { name: input.name } : {},
|
|
554630
554630
|
...input.deliveryChannel !== void 0 ? { channelState: input.deliveryChannel } : {},
|
|
554631
|
+
...input.retainedContinuation !== void 0 ? { retainedContinuation: input.retainedContinuation } : {},
|
|
554631
554632
|
...input.owner !== void 0 ? { owner: input.owner } : {},
|
|
554632
554633
|
...input.scope !== void 0 ? { scope: input.scope } : {},
|
|
554633
554634
|
...input.toolUseId !== void 0 ? { toolUseId: input.toolUseId } : {},
|
|
@@ -554726,7 +554727,12 @@ var init_task_registry = __esm({
|
|
|
554726
554727
|
}
|
|
554727
554728
|
handle.status = outcome.status;
|
|
554728
554729
|
handle.notify = void 0;
|
|
554730
|
+
for (const [, , qResolve] of handle.preAttachQueue ?? [])
|
|
554731
|
+
qResolve?.({ ok: false, reason: "not_running" });
|
|
554729
554732
|
handle.preAttachQueue = void 0;
|
|
554733
|
+
for (const r of [...handle.inFlightDirect ?? []])
|
|
554734
|
+
r({ ok: false, reason: "not_running" });
|
|
554735
|
+
handle.inFlightDirect = void 0;
|
|
554730
554736
|
if (outcome.status === "killed" && handle.stoppedBy === void 0) {
|
|
554731
554737
|
handle.stoppedBy = outcome.stoppedBy ?? handle.stopSource ?? "system";
|
|
554732
554738
|
}
|
|
@@ -555502,44 +555508,137 @@ var init_task_registry = __esm({
|
|
|
555502
555508
|
const closest = closestName(key, byKey.keys());
|
|
555503
555509
|
return { status: "not_found", ...closest !== void 0 ? { suggestion: byKey.get(closest) } : {} };
|
|
555504
555510
|
}
|
|
555505
|
-
|
|
555511
|
+
markRetainedContinuation(id) {
|
|
555512
|
+
const handle = this.handles.get(id);
|
|
555513
|
+
if (handle && handle.type === "background_agent")
|
|
555514
|
+
handle.retainedContinuation = true;
|
|
555515
|
+
}
|
|
555516
|
+
reviveBackgroundAgent(id, access7, abort) {
|
|
555517
|
+
const handle = this.handles.get(id);
|
|
555518
|
+
if (!handle || handle.type !== "background_agent" || !canAccess(handle, access7))
|
|
555519
|
+
return { ok: false, reason: "not_found" };
|
|
555520
|
+
if (handle.status === "running" || handle.status === "pending")
|
|
555521
|
+
return { ok: false, reason: "still_running" };
|
|
555522
|
+
handle.status = "running";
|
|
555523
|
+
handle.channelState = "attaching";
|
|
555524
|
+
handle.notify = void 0;
|
|
555525
|
+
if (abort !== void 0)
|
|
555526
|
+
handle.abort = abort;
|
|
555527
|
+
handle.result = void 0;
|
|
555528
|
+
handle.error = void 0;
|
|
555529
|
+
handle.resultIsPartial = void 0;
|
|
555530
|
+
handle.stopSource = void 0;
|
|
555531
|
+
handle.reviveCycle = (handle.reviveCycle ?? 0) + 1;
|
|
555532
|
+
handle.updatedAt = Date.now();
|
|
555533
|
+
return { ok: true, cycle: handle.reviveCycle };
|
|
555534
|
+
}
|
|
555535
|
+
settleRevivedAgent(id, cycle, outcome) {
|
|
555536
|
+
const handle = this.handles.get(id);
|
|
555537
|
+
if (!handle || handle.type !== "background_agent")
|
|
555538
|
+
return void 0;
|
|
555539
|
+
if ((handle.reviveCycle ?? 0) !== cycle)
|
|
555540
|
+
return void 0;
|
|
555541
|
+
return this.settleBackgroundAgent(id, outcome);
|
|
555542
|
+
}
|
|
555543
|
+
unmarkRetainedContinuation(id) {
|
|
555544
|
+
const handle = this.handles.get(id);
|
|
555545
|
+
if (handle && handle.type === "background_agent")
|
|
555546
|
+
handle.retainedContinuation = false;
|
|
555547
|
+
}
|
|
555548
|
+
attachAgentNotify(id, notify4, cycle) {
|
|
555506
555549
|
const handle = this.handles.get(id);
|
|
555507
555550
|
if (!handle || handle.type !== "background_agent" || handle.status !== "running")
|
|
555508
555551
|
return;
|
|
555552
|
+
if (cycle !== void 0 && (handle.reviveCycle ?? 0) !== cycle)
|
|
555553
|
+
return;
|
|
555509
555554
|
handle.notify = notify4;
|
|
555510
|
-
handle.channelState = "
|
|
555511
|
-
const
|
|
555512
|
-
|
|
555513
|
-
|
|
555514
|
-
|
|
555515
|
-
|
|
555516
|
-
|
|
555517
|
-
|
|
555555
|
+
handle.channelState = "attaching";
|
|
555556
|
+
const live = handle.preAttachQueue;
|
|
555557
|
+
if (live !== void 0 && live.length > 0) {
|
|
555558
|
+
void (async () => {
|
|
555559
|
+
while (handle.preAttachQueue === live && live.length > 0) {
|
|
555560
|
+
const [qPayload, qOpts, qResolve] = live[0];
|
|
555561
|
+
let result;
|
|
555562
|
+
try {
|
|
555563
|
+
const d4 = await notify4(qPayload, qOpts);
|
|
555564
|
+
result = d4 === "parked" && handle.retainedContinuation !== true ? { ok: false, reason: "not_running" } : d4 === "parked" ? { ok: true, disposition: "parked" } : { ok: true, disposition: "queued" };
|
|
555565
|
+
} catch {
|
|
555566
|
+
result = { ok: false, reason: "not_running" };
|
|
555567
|
+
}
|
|
555568
|
+
if (handle.preAttachQueue !== live)
|
|
555569
|
+
return;
|
|
555570
|
+
live.shift();
|
|
555571
|
+
qResolve?.(result);
|
|
555518
555572
|
}
|
|
555519
|
-
|
|
555573
|
+
if (handle.preAttachQueue === live) {
|
|
555574
|
+
handle.preAttachQueue = void 0;
|
|
555575
|
+
handle.channelState = "attached";
|
|
555576
|
+
}
|
|
555577
|
+
})();
|
|
555578
|
+
} else {
|
|
555579
|
+
handle.preAttachQueue = void 0;
|
|
555580
|
+
handle.channelState = "attached";
|
|
555520
555581
|
}
|
|
555521
555582
|
}
|
|
555522
|
-
deliverToRunningAgent(id, access7, notification, opts) {
|
|
555583
|
+
async deliverToRunningAgent(id, access7, notification, opts) {
|
|
555523
555584
|
const handle = this.handles.get(id);
|
|
555524
555585
|
if (!handle || handle.type !== "background_agent" || !canAccess(handle, access7))
|
|
555525
555586
|
return { ok: false, reason: "not_found" };
|
|
555526
555587
|
if (handle.status !== "running")
|
|
555527
555588
|
return { ok: false, reason: "not_running" };
|
|
555528
|
-
|
|
555589
|
+
const bounded = (p, fallback, onTimeout) => new Promise((resolve53) => {
|
|
555590
|
+
const t2 = setTimeout(() => {
|
|
555591
|
+
try {
|
|
555592
|
+
onTimeout?.();
|
|
555593
|
+
} catch {
|
|
555594
|
+
}
|
|
555595
|
+
resolve53(fallback);
|
|
555596
|
+
}, this.deliverConfirmTimeoutMs);
|
|
555597
|
+
t2.unref?.();
|
|
555598
|
+
void p.then((v2) => {
|
|
555599
|
+
clearTimeout(t2);
|
|
555600
|
+
resolve53(v2);
|
|
555601
|
+
}, () => {
|
|
555602
|
+
clearTimeout(t2);
|
|
555603
|
+
resolve53(fallback);
|
|
555604
|
+
});
|
|
555605
|
+
});
|
|
555606
|
+
if (handle.notify === void 0 || handle.channelState === "attaching") {
|
|
555529
555607
|
if (handle.channelState !== "attaching")
|
|
555530
555608
|
return { ok: false, reason: "no_channel" };
|
|
555531
555609
|
const q2 = handle.preAttachQueue ??= [];
|
|
555532
555610
|
if (q2.length >= 8)
|
|
555533
555611
|
return { ok: false, reason: "no_channel" };
|
|
555534
|
-
|
|
555535
|
-
|
|
555536
|
-
|
|
555537
|
-
|
|
555538
|
-
|
|
555539
|
-
|
|
555540
|
-
|
|
555541
|
-
|
|
555542
|
-
|
|
555612
|
+
return bounded(new Promise((resolve53) => {
|
|
555613
|
+
q2.push([notification, opts, resolve53]);
|
|
555614
|
+
}), { ok: true, disposition: "pending" });
|
|
555615
|
+
}
|
|
555616
|
+
let detachOnTimeout;
|
|
555617
|
+
return await bounded(new Promise((resolve53) => {
|
|
555618
|
+
const inflight4 = handle.inFlightDirect ??= /* @__PURE__ */ new Set();
|
|
555619
|
+
const settleOnce = (r) => {
|
|
555620
|
+
if (!inflight4.has(settleOnce))
|
|
555621
|
+
return;
|
|
555622
|
+
inflight4.delete(settleOnce);
|
|
555623
|
+
resolve53(r);
|
|
555624
|
+
};
|
|
555625
|
+
inflight4.add(settleOnce);
|
|
555626
|
+
detachOnTimeout = () => inflight4.delete(settleOnce);
|
|
555627
|
+
void (async () => {
|
|
555628
|
+
let result;
|
|
555629
|
+
try {
|
|
555630
|
+
const d4 = await handle.notify?.(notification, opts);
|
|
555631
|
+
if (d4 === "parked") {
|
|
555632
|
+
result = handle.retainedContinuation === true ? { ok: true, disposition: "parked" } : { ok: false, reason: "not_running" };
|
|
555633
|
+
} else {
|
|
555634
|
+
result = { ok: true, disposition: "queued" };
|
|
555635
|
+
}
|
|
555636
|
+
} catch {
|
|
555637
|
+
result = { ok: false, reason: "not_running" };
|
|
555638
|
+
}
|
|
555639
|
+
settleOnce(result);
|
|
555640
|
+
})();
|
|
555641
|
+
}), { ok: true, disposition: "pending" }, () => detachOnTimeout?.());
|
|
555543
555642
|
}
|
|
555544
555643
|
runningBackgroundAgentLabels(access7) {
|
|
555545
555644
|
const out6 = [];
|
|
@@ -555551,6 +555650,7 @@ var init_task_registry = __esm({
|
|
|
555551
555650
|
}
|
|
555552
555651
|
return out6;
|
|
555553
555652
|
}
|
|
555653
|
+
deliverConfirmTimeoutMs = 1e4;
|
|
555554
555654
|
lastGcAt = 0;
|
|
555555
555655
|
list(access7, opts = {}) {
|
|
555556
555656
|
const limit2 = Math.min(500, Math.max(1, Math.floor(opts.limit ?? 50)));
|
|
@@ -555977,7 +556077,12 @@ ${clipTaskOutput(handle.result, handle.outputFile)}` : "(no result text)"}`;
|
|
|
555977
556077
|
handle.stoppedBy = handle.stopSource ?? "parent";
|
|
555978
556078
|
handle.updatedAt = Date.now();
|
|
555979
556079
|
handle.notify = void 0;
|
|
556080
|
+
for (const [, , qResolve] of handle.preAttachQueue ?? [])
|
|
556081
|
+
qResolve?.({ ok: false, reason: "not_running" });
|
|
555980
556082
|
handle.preAttachQueue = void 0;
|
|
556083
|
+
for (const r of [...handle.inFlightDirect ?? []])
|
|
556084
|
+
r({ ok: false, reason: "not_running" });
|
|
556085
|
+
handle.inFlightDirect = void 0;
|
|
555981
556086
|
this.pokeBgQuiescence(handle.owner);
|
|
555982
556087
|
}
|
|
555983
556088
|
return {
|
|
@@ -654084,7 +654189,7 @@ Auth: unix socket -R \u2192 local proxy`, "info");
|
|
|
654084
654189
|
pendingHookMessages
|
|
654085
654190
|
}, renderAndRun);
|
|
654086
654191
|
}
|
|
654087
|
-
}).version("sema 1.0.
|
|
654192
|
+
}).version("sema 1.0.27", "-v, --version", "Output the version number");
|
|
654088
654193
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
654089
654194
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
654090
654195
|
if (canUserConfigureAdvisor()) {
|