@sema-agent/cli 1.0.9 → 1.0.10
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 +13 -13
- package/package.json +4 -4
- package/sema.js +385 -217
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.10",
|
|
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.10",
|
|
10
10
|
"license": "BUSL-1.1",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@sema-agent/sdk": "0.0.51",
|
|
13
|
-
"@sema-agent/server": "1.
|
|
13
|
+
"@sema-agent/server": "1.214.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.300.0",
|
|
633
|
+
"resolved": "https://registry.npmjs.org/@sema-agent/core/-/core-1.300.0.tgz",
|
|
634
|
+
"integrity": "sha512-5u9QQ+sTNLIL54KQ3Jt6vW4kIKo5EfHL3yi3S3Ialu+IjcdBBP2JF1OHGRovhcE7HGkcu2gdGuCtLD7KtWIygQ==",
|
|
635
635
|
"license": "BUSL-1.1",
|
|
636
636
|
"dependencies": {
|
|
637
637
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
@@ -678,12 +678,12 @@
|
|
|
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.214.0",
|
|
682
|
+
"resolved": "https://registry.npmjs.org/@sema-agent/server/-/server-1.214.0.tgz",
|
|
683
|
+
"integrity": "sha512-AWnColBtkE1BG9CS/y7Ls9oOFxRhD9woajkIJVVTEwJiPngQHB0iGe+g4WgYcUhxBUPnW3ZPFQ8SYDugWWDlAw==",
|
|
684
684
|
"license": "BUSL-1.1",
|
|
685
685
|
"dependencies": {
|
|
686
|
-
"@sema-agent/core": "^1.
|
|
686
|
+
"@sema-agent/core": "^1.300.0",
|
|
687
687
|
"@sema-agent/registry-core": "^0.10.12",
|
|
688
688
|
"e2b": "^2.28.0",
|
|
689
689
|
"libsodium-wrappers": "^0.8.4",
|
|
@@ -1077,9 +1077,9 @@
|
|
|
1077
1077
|
}
|
|
1078
1078
|
},
|
|
1079
1079
|
"node_modules/e2b": {
|
|
1080
|
-
"version": "2.
|
|
1081
|
-
"resolved": "https://registry.npmjs.org/e2b/-/e2b-2.
|
|
1082
|
-
"integrity": "sha512-
|
|
1080
|
+
"version": "2.34.0",
|
|
1081
|
+
"resolved": "https://registry.npmjs.org/e2b/-/e2b-2.34.0.tgz",
|
|
1082
|
+
"integrity": "sha512-oQ+5k1WHBEgZEPPx/ziBbFR9fM+x0ywsd74MGRcbUZQuC0XDbL8tVpHrv/gfGLOEwmZwewxTZcLHTg4xVZp5Lg==",
|
|
1083
1083
|
"license": "MIT",
|
|
1084
1084
|
"dependencies": {
|
|
1085
1085
|
"@bufbuild/protobuf": "^2.12.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
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.51",
|
|
25
|
-
"@sema-agent/server": "1.
|
|
25
|
+
"@sema-agent/server": "1.214.0"
|
|
26
26
|
},
|
|
27
27
|
"overrides": {
|
|
28
|
-
"@sema-agent/core": "1.
|
|
28
|
+
"@sema-agent/core": "1.300.0",
|
|
29
29
|
"@sema-agent/registry-core": "0.10.12"
|
|
30
30
|
},
|
|
31
|
-
"semaEngineVersion": "server 1.
|
|
31
|
+
"semaEngineVersion": "server 1.214.0 / core 1.300.0 / registry-core 0.10.12",
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": ">=18"
|
|
34
34
|
}
|
package/sema.js
CHANGED
|
@@ -7076,21 +7076,21 @@ var init_token_cache = __esm({
|
|
|
7076
7076
|
async getToken() {
|
|
7077
7077
|
const force = this.nextForce;
|
|
7078
7078
|
this.nextForce = false;
|
|
7079
|
-
const
|
|
7080
|
-
if (force ||
|
|
7079
|
+
const cached6 = this.cached;
|
|
7080
|
+
if (force || cached6 == null) {
|
|
7081
7081
|
const token2 = await this.refresh(force);
|
|
7082
7082
|
return token2.token;
|
|
7083
7083
|
}
|
|
7084
|
-
if (
|
|
7085
|
-
return
|
|
7084
|
+
if (cached6.expiresAt == null) {
|
|
7085
|
+
return cached6.token;
|
|
7086
7086
|
}
|
|
7087
|
-
const remaining =
|
|
7087
|
+
const remaining = cached6.expiresAt - nowAsSeconds();
|
|
7088
7088
|
if (remaining > ADVISORY_REFRESH_THRESHOLD_IN_SECONDS) {
|
|
7089
|
-
return
|
|
7089
|
+
return cached6.token;
|
|
7090
7090
|
}
|
|
7091
7091
|
if (remaining > MANDATORY_REFRESH_THRESHOLD_IN_SECONDS) {
|
|
7092
7092
|
this.backgroundRefresh();
|
|
7093
|
-
return
|
|
7093
|
+
return cached6.token;
|
|
7094
7094
|
}
|
|
7095
7095
|
const token = await this.refresh();
|
|
7096
7096
|
return token.token;
|
|
@@ -8545,9 +8545,9 @@ function getName(value, stripPath) {
|
|
|
8545
8545
|
}
|
|
8546
8546
|
function supportsFormData(fetchObject) {
|
|
8547
8547
|
const fetch2 = typeof fetchObject === "function" ? fetchObject : fetchObject.fetch;
|
|
8548
|
-
const
|
|
8549
|
-
if (
|
|
8550
|
-
return
|
|
8548
|
+
const cached6 = supportsFormDataMap.get(fetch2);
|
|
8549
|
+
if (cached6)
|
|
8550
|
+
return cached6;
|
|
8551
8551
|
const promise2 = (async () => {
|
|
8552
8552
|
try {
|
|
8553
8553
|
const FetchResponse = "Response" in fetch2 ? fetch2.Response : (await fetch2("data:,")).constructor;
|
|
@@ -22320,9 +22320,9 @@ function clearResolveGitDirCache() {
|
|
|
22320
22320
|
}
|
|
22321
22321
|
async function resolveGitDir(startPath) {
|
|
22322
22322
|
const cwd5 = resolve5(startPath ?? getCwd());
|
|
22323
|
-
const
|
|
22324
|
-
if (
|
|
22325
|
-
return
|
|
22323
|
+
const cached6 = resolveGitDirCache.get(cwd5);
|
|
22324
|
+
if (cached6 !== void 0) {
|
|
22325
|
+
return cached6;
|
|
22326
22326
|
}
|
|
22327
22327
|
const root2 = findGitRoot(cwd5);
|
|
22328
22328
|
if (!root2) {
|
|
@@ -23342,9 +23342,9 @@ function memoizeWithTTLAsync(f, cacheLifetimeMs = 5 * 60 * 1e3) {
|
|
|
23342
23342
|
const inFlight2 = /* @__PURE__ */ new Map();
|
|
23343
23343
|
const memoized = async (...args) => {
|
|
23344
23344
|
const key = jsonStringify(args);
|
|
23345
|
-
const
|
|
23345
|
+
const cached6 = cache6.get(key);
|
|
23346
23346
|
const now2 = Date.now();
|
|
23347
|
-
if (!
|
|
23347
|
+
if (!cached6) {
|
|
23348
23348
|
const pending = inFlight2.get(key);
|
|
23349
23349
|
if (pending) return pending;
|
|
23350
23350
|
const promise2 = f(...args);
|
|
@@ -23365,9 +23365,9 @@ function memoizeWithTTLAsync(f, cacheLifetimeMs = 5 * 60 * 1e3) {
|
|
|
23365
23365
|
}
|
|
23366
23366
|
}
|
|
23367
23367
|
}
|
|
23368
|
-
if (
|
|
23369
|
-
|
|
23370
|
-
const staleEntry =
|
|
23368
|
+
if (cached6 && now2 - cached6.timestamp > cacheLifetimeMs && !cached6.refreshing) {
|
|
23369
|
+
cached6.refreshing = true;
|
|
23370
|
+
const staleEntry = cached6;
|
|
23371
23371
|
f(...args).then((newValue) => {
|
|
23372
23372
|
if (cache6.get(key) === staleEntry) {
|
|
23373
23373
|
cache6.set(key, {
|
|
@@ -23382,7 +23382,7 @@ function memoizeWithTTLAsync(f, cacheLifetimeMs = 5 * 60 * 1e3) {
|
|
|
23382
23382
|
cache6.delete(key);
|
|
23383
23383
|
}
|
|
23384
23384
|
});
|
|
23385
|
-
return
|
|
23385
|
+
return cached6.value;
|
|
23386
23386
|
}
|
|
23387
23387
|
return cache6.get(key).value;
|
|
23388
23388
|
};
|
|
@@ -23400,9 +23400,9 @@ function memoizeWithLRU(f, cacheFn, maxCacheSize = 100) {
|
|
|
23400
23400
|
});
|
|
23401
23401
|
const memoized = (...args) => {
|
|
23402
23402
|
const key = cacheFn(...args);
|
|
23403
|
-
const
|
|
23404
|
-
if (
|
|
23405
|
-
return
|
|
23403
|
+
const cached6 = cache6.get(key);
|
|
23404
|
+
if (cached6 !== void 0) {
|
|
23405
|
+
return cached6;
|
|
23406
23406
|
}
|
|
23407
23407
|
const result = f(...args);
|
|
23408
23408
|
cache6.set(key, result);
|
|
@@ -43733,8 +43733,8 @@ var init_managedPath = __esm({
|
|
|
43733
43733
|
|
|
43734
43734
|
// build-src/src/utils/lazySchema.ts
|
|
43735
43735
|
function lazySchema(factory2) {
|
|
43736
|
-
let
|
|
43737
|
-
return () =>
|
|
43736
|
+
let cached6;
|
|
43737
|
+
return () => cached6 ??= factory2();
|
|
43738
43738
|
}
|
|
43739
43739
|
var init_lazySchema = __esm({
|
|
43740
43740
|
"build-src/src/utils/lazySchema.ts"() {
|
|
@@ -64791,11 +64791,11 @@ function invalidSettingsWarningActive() {
|
|
|
64791
64791
|
return invalidSettingsDetail;
|
|
64792
64792
|
}
|
|
64793
64793
|
function parseSettingsFile(path27) {
|
|
64794
|
-
const
|
|
64795
|
-
if (
|
|
64794
|
+
const cached6 = getCachedParsedFile(path27);
|
|
64795
|
+
if (cached6) {
|
|
64796
64796
|
return {
|
|
64797
|
-
settings:
|
|
64798
|
-
errors:
|
|
64797
|
+
settings: cached6.settings ? clone(cached6.settings) : null,
|
|
64798
|
+
errors: cached6.errors
|
|
64799
64799
|
};
|
|
64800
64800
|
}
|
|
64801
64801
|
const result = parseSettingsFileUncached(path27);
|
|
@@ -64879,8 +64879,8 @@ function getRelativeSettingsFilePathForSource(source) {
|
|
|
64879
64879
|
}
|
|
64880
64880
|
}
|
|
64881
64881
|
function getSettingsForSource(source) {
|
|
64882
|
-
const
|
|
64883
|
-
if (
|
|
64882
|
+
const cached6 = getCachedSettingsForSource(source);
|
|
64883
|
+
if (cached6 !== void 0) return cached6;
|
|
64884
64884
|
const result = getSettingsForSourceUncached(source);
|
|
64885
64885
|
setCachedSettingsForSource(source, result);
|
|
64886
64886
|
return result;
|
|
@@ -65222,9 +65222,9 @@ function getSettingsWithSources() {
|
|
|
65222
65222
|
return { effective: getInitialSettings2(), sources };
|
|
65223
65223
|
}
|
|
65224
65224
|
function getSettingsWithErrors() {
|
|
65225
|
-
const
|
|
65226
|
-
if (
|
|
65227
|
-
return
|
|
65225
|
+
const cached6 = getSessionSettingsCache();
|
|
65226
|
+
if (cached6 !== null) {
|
|
65227
|
+
return cached6;
|
|
65228
65228
|
}
|
|
65229
65229
|
const result = loadSettingsFromDisk();
|
|
65230
65230
|
profileCheckpoint("loadSettingsFromDisk_end");
|
|
@@ -67286,10 +67286,10 @@ function isProjectConfigKey(key) {
|
|
|
67286
67286
|
return PROJECT_CONFIG_KEYS.includes(key);
|
|
67287
67287
|
}
|
|
67288
67288
|
function wouldLoseAuthState(fresh) {
|
|
67289
|
-
const
|
|
67290
|
-
if (!
|
|
67291
|
-
const lostOauth =
|
|
67292
|
-
const lostOnboarding =
|
|
67289
|
+
const cached6 = globalConfigCache.config;
|
|
67290
|
+
if (!cached6) return false;
|
|
67291
|
+
const lostOauth = cached6.oauthAccount !== void 0 && fresh.oauthAccount === void 0;
|
|
67292
|
+
const lostOnboarding = cached6.hasCompletedOnboarding === true && fresh.hasCompletedOnboarding !== true;
|
|
67293
67293
|
return lostOauth || lostOnboarding;
|
|
67294
67294
|
}
|
|
67295
67295
|
function saveGlobalConfig(updater) {
|
|
@@ -95448,8 +95448,8 @@ var init_engine = __esm({
|
|
|
95448
95448
|
|
|
95449
95449
|
// build-src/src/ink/line-width-cache.ts
|
|
95450
95450
|
function lineWidth(line) {
|
|
95451
|
-
const
|
|
95452
|
-
if (
|
|
95451
|
+
const cached6 = cache.get(line);
|
|
95452
|
+
if (cached6 !== void 0) return cached6;
|
|
95453
95453
|
const width = stringWidth(line);
|
|
95454
95454
|
if (cache.size >= MAX_CACHE_SIZE) {
|
|
95455
95455
|
cache.clear();
|
|
@@ -96768,9 +96768,9 @@ function collectRemovedRects(parent2, removed, underAbsolute = false) {
|
|
|
96768
96768
|
if (removed.nodeName === "#text") return;
|
|
96769
96769
|
const elem = removed;
|
|
96770
96770
|
const isAbsolute35 = underAbsolute || elem.style.position === "absolute";
|
|
96771
|
-
const
|
|
96772
|
-
if (
|
|
96773
|
-
addPendingClear(parent2,
|
|
96771
|
+
const cached6 = nodeCache.get(elem);
|
|
96772
|
+
if (cached6) {
|
|
96773
|
+
addPendingClear(parent2, cached6, isAbsolute35);
|
|
96774
96774
|
nodeCache.delete(elem);
|
|
96775
96775
|
}
|
|
96776
96776
|
for (const child of elem.childNodes) {
|
|
@@ -98714,8 +98714,8 @@ var init_screen = __esm({
|
|
|
98714
98714
|
if (char.length === 1) {
|
|
98715
98715
|
const code2 = char.charCodeAt(0);
|
|
98716
98716
|
if (code2 < 128) {
|
|
98717
|
-
const
|
|
98718
|
-
if (
|
|
98717
|
+
const cached6 = this.ascii[code2];
|
|
98718
|
+
if (cached6 !== -1) return cached6;
|
|
98719
98719
|
const index2 = this.strings.length;
|
|
98720
98720
|
this.strings.push(char);
|
|
98721
98721
|
this.ascii[code2] = index2;
|
|
@@ -100369,9 +100369,9 @@ var require_range2 = __commonJS({
|
|
|
100369
100369
|
range = range.replace(BUILDSTRIPRE, "");
|
|
100370
100370
|
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
100371
100371
|
const memoKey = memoOpts + ":" + range;
|
|
100372
|
-
const
|
|
100373
|
-
if (
|
|
100374
|
-
return
|
|
100372
|
+
const cached6 = cache6.get(memoKey);
|
|
100373
|
+
if (cached6) {
|
|
100374
|
+
return cached6;
|
|
100375
100375
|
}
|
|
100376
100376
|
const loose = this.options.loose;
|
|
100377
100377
|
const hr = loose ? re[t2.HYPHENRANGELOOSE] : re[t2.HYPHENRANGE];
|
|
@@ -106083,13 +106083,13 @@ function renderNodeToOutput(node, output, {
|
|
|
106083
106083
|
if (yogaNode) {
|
|
106084
106084
|
if (yogaNode.getDisplay() === LayoutDisplay.None) {
|
|
106085
106085
|
if (node.dirty) {
|
|
106086
|
-
const
|
|
106087
|
-
if (
|
|
106086
|
+
const cached7 = nodeCache.get(node);
|
|
106087
|
+
if (cached7) {
|
|
106088
106088
|
output.clear({
|
|
106089
|
-
x: Math.floor(
|
|
106090
|
-
y: Math.floor(
|
|
106091
|
-
width: Math.floor(
|
|
106092
|
-
height: Math.floor(
|
|
106089
|
+
x: Math.floor(cached7.x),
|
|
106090
|
+
y: Math.floor(cached7.y),
|
|
106091
|
+
width: Math.floor(cached7.width),
|
|
106092
|
+
height: Math.floor(cached7.height)
|
|
106093
106093
|
});
|
|
106094
106094
|
dropSubtreeCache(node);
|
|
106095
106095
|
layoutShifted = true;
|
|
@@ -106105,30 +106105,30 @@ function renderNodeToOutput(node, output, {
|
|
|
106105
106105
|
if (y2 < 0 && node.style.position === "absolute") {
|
|
106106
106106
|
y2 = 0;
|
|
106107
106107
|
}
|
|
106108
|
-
const
|
|
106109
|
-
if (!node.dirty && !skipSelfBlit && node.pendingScrollDelta === void 0 &&
|
|
106108
|
+
const cached6 = nodeCache.get(node);
|
|
106109
|
+
if (!node.dirty && !skipSelfBlit && node.pendingScrollDelta === void 0 && cached6 && cached6.x === x2 && cached6.y === y2 && cached6.width === width && cached6.height === height && prevScreen) {
|
|
106110
106110
|
const fx = Math.floor(x2);
|
|
106111
106111
|
const fy = Math.floor(y2);
|
|
106112
106112
|
const fw = Math.floor(width);
|
|
106113
106113
|
const fh = Math.floor(height);
|
|
106114
106114
|
output.blit(prevScreen, fx, fy, fw, fh);
|
|
106115
106115
|
if (node.style.position === "absolute") {
|
|
106116
|
-
absoluteRectsCur.push(
|
|
106116
|
+
absoluteRectsCur.push(cached6);
|
|
106117
106117
|
}
|
|
106118
106118
|
blitEscapingAbsoluteDescendants(node, output, prevScreen, fx, fy, fw, fh);
|
|
106119
106119
|
return;
|
|
106120
106120
|
}
|
|
106121
|
-
const positionChanged =
|
|
106121
|
+
const positionChanged = cached6 !== void 0 && (cached6.x !== x2 || cached6.y !== y2 || cached6.width !== width || cached6.height !== height);
|
|
106122
106122
|
if (positionChanged) {
|
|
106123
106123
|
layoutShifted = true;
|
|
106124
106124
|
}
|
|
106125
|
-
if (
|
|
106125
|
+
if (cached6 && (node.dirty || positionChanged)) {
|
|
106126
106126
|
output.clear(
|
|
106127
106127
|
{
|
|
106128
|
-
x: Math.floor(
|
|
106129
|
-
y: Math.floor(
|
|
106130
|
-
width: Math.floor(
|
|
106131
|
-
height: Math.floor(
|
|
106128
|
+
x: Math.floor(cached6.x),
|
|
106129
|
+
y: Math.floor(cached6.y),
|
|
106130
|
+
width: Math.floor(cached6.width),
|
|
106131
|
+
height: Math.floor(cached6.height)
|
|
106132
106132
|
},
|
|
106133
106133
|
node.style.position === "absolute"
|
|
106134
106134
|
);
|
|
@@ -106301,7 +106301,7 @@ function renderNodeToOutput(node, output, {
|
|
|
106301
106301
|
const delta = contentCached.y - contentY;
|
|
106302
106302
|
const regionTop = Math.floor(y2 + contentYoga.getComputedTop());
|
|
106303
106303
|
const regionBottom = regionTop + innerHeight - 1;
|
|
106304
|
-
if (
|
|
106304
|
+
if (cached6?.y === y2 && cached6.height === height && innerHeight > 0 && Math.abs(delta) < innerHeight) {
|
|
106305
106305
|
hint = { top: regionTop, bottom: regionBottom, delta };
|
|
106306
106306
|
scrollHint = hint;
|
|
106307
106307
|
} else {
|
|
@@ -106575,13 +106575,13 @@ function blitEscapingAbsoluteDescendants(node, output, prevScreen, px, py, pw, p
|
|
|
106575
106575
|
if (child.nodeName === "#text") continue;
|
|
106576
106576
|
const elem = child;
|
|
106577
106577
|
if (elem.style.position === "absolute") {
|
|
106578
|
-
const
|
|
106579
|
-
if (
|
|
106580
|
-
absoluteRectsCur.push(
|
|
106581
|
-
const cx = Math.floor(
|
|
106582
|
-
const cy = Math.floor(
|
|
106583
|
-
const cw = Math.floor(
|
|
106584
|
-
const ch2 = Math.floor(
|
|
106578
|
+
const cached6 = nodeCache.get(elem);
|
|
106579
|
+
if (cached6) {
|
|
106580
|
+
absoluteRectsCur.push(cached6);
|
|
106581
|
+
const cx = Math.floor(cached6.x);
|
|
106582
|
+
const cy = Math.floor(cached6.y);
|
|
106583
|
+
const cw = Math.floor(cached6.width);
|
|
106584
|
+
const ch2 = Math.floor(cached6.height);
|
|
106585
106585
|
if (cx < px || cy < py || cx + cw > pr || cy + ch2 > pb) {
|
|
106586
106586
|
output.blit(prevScreen, cx, cy, cw, ch2);
|
|
106587
106587
|
}
|
|
@@ -106597,19 +106597,19 @@ function renderScrolledChildren(node, output, offsetX, offsetY, hasRemovedChild,
|
|
|
106597
106597
|
const childElem = childNode;
|
|
106598
106598
|
const cy = childElem.yogaNode;
|
|
106599
106599
|
if (cy) {
|
|
106600
|
-
const
|
|
106600
|
+
const cached6 = nodeCache.get(childElem);
|
|
106601
106601
|
let top;
|
|
106602
106602
|
let height;
|
|
106603
|
-
if (
|
|
106604
|
-
top =
|
|
106605
|
-
height =
|
|
106603
|
+
if (cached6?.top !== void 0 && !childElem.dirty && cumHeightShift === 0) {
|
|
106604
|
+
top = cached6.top;
|
|
106605
|
+
height = cached6.height;
|
|
106606
106606
|
} else {
|
|
106607
106607
|
top = cy.getComputedTop();
|
|
106608
106608
|
height = cy.getComputedHeight();
|
|
106609
106609
|
if (childElem.dirty) {
|
|
106610
|
-
cumHeightShift += height - (
|
|
106610
|
+
cumHeightShift += height - (cached6 ? cached6.height : 0);
|
|
106611
106611
|
}
|
|
106612
|
-
if (
|
|
106612
|
+
if (cached6) cached6.top = top;
|
|
106613
106613
|
}
|
|
106614
106614
|
const bottom = top + height;
|
|
106615
106615
|
if (bottom <= scrollTopY || top >= scrollBottomY) {
|
|
@@ -139533,9 +139533,9 @@ function getCredentialFromFd({
|
|
|
139533
139533
|
getCached,
|
|
139534
139534
|
setCached
|
|
139535
139535
|
}) {
|
|
139536
|
-
const
|
|
139537
|
-
if (
|
|
139538
|
-
return
|
|
139536
|
+
const cached6 = getCached();
|
|
139537
|
+
if (cached6 !== void 0) {
|
|
139538
|
+
return cached6;
|
|
139539
139539
|
}
|
|
139540
139540
|
const fdEnv = process.env[envVar];
|
|
139541
139541
|
if (!fdEnv) {
|
|
@@ -142875,12 +142875,12 @@ function sortForMatching(models) {
|
|
|
142875
142875
|
}
|
|
142876
142876
|
function getModelCapability(model) {
|
|
142877
142877
|
if (!isModelCapabilitiesEligible()) return void 0;
|
|
142878
|
-
const
|
|
142879
|
-
if (!
|
|
142878
|
+
const cached6 = loadCache(getCachePath());
|
|
142879
|
+
if (!cached6 || cached6.length === 0) return void 0;
|
|
142880
142880
|
const m2 = model.toLowerCase();
|
|
142881
|
-
const exact =
|
|
142881
|
+
const exact = cached6.find((c2) => c2.id.toLowerCase() === m2);
|
|
142882
142882
|
if (exact) return exact;
|
|
142883
|
-
return
|
|
142883
|
+
return cached6.find((c2) => m2.includes(c2.id.toLowerCase()));
|
|
142884
142884
|
}
|
|
142885
142885
|
async function refreshModelCapabilities() {
|
|
142886
142886
|
if (!isModelCapabilitiesEligible()) return;
|
|
@@ -185928,9 +185928,9 @@ var require_lib = __commonJS({
|
|
|
185928
185928
|
import { isIP } from "node:net";
|
|
185929
185929
|
import { createSecureContext } from "node:tls";
|
|
185930
185930
|
function mintLeafCert(ca, hostname5) {
|
|
185931
|
-
const
|
|
185932
|
-
if (
|
|
185933
|
-
return
|
|
185931
|
+
const cached6 = ca.leafCerts.get(hostname5);
|
|
185932
|
+
if (cached6)
|
|
185933
|
+
return cached6;
|
|
185934
185934
|
const keys2 = pki.rsa.generateKeyPair(2048);
|
|
185935
185935
|
const cert = pki.createCertificate();
|
|
185936
185936
|
cert.publicKey = keys2.publicKey;
|
|
@@ -185967,9 +185967,9 @@ function mintLeafCert(ca, hostname5) {
|
|
|
185967
185967
|
return leaf;
|
|
185968
185968
|
}
|
|
185969
185969
|
function secureContextFor(ca, hostname5) {
|
|
185970
|
-
const
|
|
185971
|
-
if (
|
|
185972
|
-
return
|
|
185970
|
+
const cached6 = ca.secureContexts.get(hostname5);
|
|
185971
|
+
if (cached6)
|
|
185972
|
+
return cached6;
|
|
185973
185973
|
const { certPem, keyPem } = mintLeafCert(ca, hostname5);
|
|
185974
185974
|
const ctx = createSecureContext({ cert: certPem, key: keyPem });
|
|
185975
185975
|
ca.secureContexts.set(hostname5, ctx);
|
|
@@ -196725,8 +196725,8 @@ function getFeatureValue_CACHED_MAY_BE_STALE3(feature3, defaultValue) {
|
|
|
196725
196725
|
return remoteEvalFeatureValues.get(feature3);
|
|
196726
196726
|
}
|
|
196727
196727
|
try {
|
|
196728
|
-
const
|
|
196729
|
-
return
|
|
196728
|
+
const cached6 = getGlobalConfig().cachedGrowthBookFeatures?.[feature3];
|
|
196729
|
+
return cached6 !== void 0 ? cached6 : defaultValue;
|
|
196730
196730
|
} catch {
|
|
196731
196731
|
return defaultValue;
|
|
196732
196732
|
}
|
|
@@ -205847,26 +205847,26 @@ async function loadPluginFromMarketplaceEntry(entry, marketplaceInstallLocation,
|
|
|
205847
205847
|
`Using seed cache for external plugin ${entry.name} at ${seedPath}`
|
|
205848
205848
|
);
|
|
205849
205849
|
} else {
|
|
205850
|
-
const
|
|
205850
|
+
const cached6 = await cachePlugin(entry.source, {
|
|
205851
205851
|
manifest: { name: entry.name }
|
|
205852
205852
|
});
|
|
205853
205853
|
const actualVersion = version5 !== "unknown" ? version5 : await calculatePluginVersion(
|
|
205854
205854
|
pluginId,
|
|
205855
205855
|
entry.source,
|
|
205856
|
-
|
|
205857
|
-
|
|
205856
|
+
cached6.manifest,
|
|
205857
|
+
cached6.path,
|
|
205858
205858
|
installedVersion2 ?? entry.version,
|
|
205859
|
-
|
|
205859
|
+
cached6.gitCommitSha
|
|
205860
205860
|
);
|
|
205861
205861
|
pluginPath = await copyPluginToVersionedCache(
|
|
205862
|
-
|
|
205862
|
+
cached6.path,
|
|
205863
205863
|
pluginId,
|
|
205864
205864
|
actualVersion,
|
|
205865
205865
|
entry,
|
|
205866
205866
|
void 0
|
|
205867
205867
|
);
|
|
205868
|
-
if (
|
|
205869
|
-
await rm6(
|
|
205868
|
+
if (cached6.path !== pluginPath) {
|
|
205869
|
+
await rm6(cached6.path, { recursive: true, force: true });
|
|
205870
205870
|
}
|
|
205871
205871
|
}
|
|
205872
205872
|
}
|
|
@@ -222839,8 +222839,8 @@ function computeNewLimitsFromHeaders(headers) {
|
|
|
222839
222839
|
}
|
|
222840
222840
|
function cacheExtraUsageDisabledReason(headers) {
|
|
222841
222841
|
const reason = headers.get("anthropic-ratelimit-unified-overage-disabled-reason") ?? null;
|
|
222842
|
-
const
|
|
222843
|
-
if (
|
|
222842
|
+
const cached6 = getGlobalConfig().cachedExtraUsageDisabledReason;
|
|
222843
|
+
if (cached6 !== reason) {
|
|
222844
222844
|
saveGlobalConfig((current3) => ({
|
|
222845
222845
|
...current3,
|
|
222846
222846
|
cachedExtraUsageDisabledReason: reason
|
|
@@ -231845,11 +231845,11 @@ function OffscreenFreeze({
|
|
|
231845
231845
|
const [ref, {
|
|
231846
231846
|
isVisible
|
|
231847
231847
|
}] = useTerminalViewport();
|
|
231848
|
-
const
|
|
231848
|
+
const cached6 = (0, import_react38.useRef)(children);
|
|
231849
231849
|
if (isVisible || inVirtualList) {
|
|
231850
|
-
|
|
231850
|
+
cached6.current = children;
|
|
231851
231851
|
}
|
|
231852
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ThemedBox_default, { ref, children:
|
|
231852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ThemedBox_default, { ref, children: cached6.current });
|
|
231853
231853
|
}
|
|
231854
231854
|
var import_react38, import_jsx_runtime29;
|
|
231855
231855
|
var init_OffscreenFreeze = __esm({
|
|
@@ -239895,12 +239895,12 @@ var init_promptShellExecution = __esm({
|
|
|
239895
239895
|
init_toolResultStorage();
|
|
239896
239896
|
init_shellToolUtils();
|
|
239897
239897
|
getPowerShellTool = /* @__PURE__ */ (() => {
|
|
239898
|
-
let
|
|
239898
|
+
let cached6;
|
|
239899
239899
|
return () => {
|
|
239900
|
-
if (!
|
|
239901
|
-
|
|
239900
|
+
if (!cached6) {
|
|
239901
|
+
cached6 = (init_PowerShellTool(), __toCommonJS(PowerShellTool_exports)).PowerShellTool;
|
|
239902
239902
|
}
|
|
239903
|
-
return
|
|
239903
|
+
return cached6;
|
|
239904
239904
|
};
|
|
239905
239905
|
})();
|
|
239906
239906
|
BLOCK_PATTERN = /```!\s*\n?([\s\S]*?)\n?```/g;
|
|
@@ -242020,10 +242020,10 @@ async function withFixture(input, fixtureName, f) {
|
|
|
242020
242020
|
`fixtures/${fixtureName}-${hash2}.json`
|
|
242021
242021
|
);
|
|
242022
242022
|
try {
|
|
242023
|
-
const
|
|
242023
|
+
const cached6 = jsonParse(
|
|
242024
242024
|
await readFile20(filename, { encoding: "utf8" })
|
|
242025
242025
|
);
|
|
242026
|
-
return
|
|
242026
|
+
return cached6;
|
|
242027
242027
|
} catch (e) {
|
|
242028
242028
|
const code2 = getErrnoCode(e);
|
|
242029
242029
|
if (code2 !== "ENOENT") {
|
|
@@ -242066,11 +242066,11 @@ async function withVCR(messages, f) {
|
|
|
242066
242066
|
`fixtures/${dehydratedInput.map((_2) => createHash11("sha1").update(jsonStringify(_2)).digest("hex").slice(0, 6)).join("-")}.json`
|
|
242067
242067
|
);
|
|
242068
242068
|
try {
|
|
242069
|
-
const
|
|
242069
|
+
const cached6 = jsonParse(
|
|
242070
242070
|
await readFile20(filename, { encoding: "utf8" })
|
|
242071
242071
|
);
|
|
242072
|
-
|
|
242073
|
-
return
|
|
242072
|
+
cached6.output.forEach(addCachedCostToTotalSessionCost);
|
|
242073
|
+
return cached6.output.map(
|
|
242074
242074
|
(message, index) => mapMessage(message, hydrateValue, index, randomUUID9())
|
|
242075
242075
|
);
|
|
242076
242076
|
} catch (e) {
|
|
@@ -257488,7 +257488,7 @@ function getRemoteSessionUrl(sessionId, ingressUrl) {
|
|
|
257488
257488
|
var PRODUCT_URL, SEMA_AI_BASE_URL, SEMA_AI_STAGING_BASE_URL, SEMA_AI_LOCAL_BASE_URL;
|
|
257489
257489
|
var init_product = __esm({
|
|
257490
257490
|
"build-src/src/constants/product.ts"() {
|
|
257491
|
-
PRODUCT_URL = "https://
|
|
257491
|
+
PRODUCT_URL = "https://github.com/sema-agent/sema";
|
|
257492
257492
|
SEMA_AI_BASE_URL = "https://claude.ai";
|
|
257493
257493
|
SEMA_AI_STAGING_BASE_URL = "https://claude-ai.staging.ant.dev";
|
|
257494
257494
|
SEMA_AI_LOCAL_BASE_URL = "http://localhost:4000";
|
|
@@ -262204,10 +262204,10 @@ function waitForCallback(port, expectedState, abortSignal, onListening) {
|
|
|
262204
262204
|
}
|
|
262205
262205
|
async function acquireIdpIdToken(opts) {
|
|
262206
262206
|
const { idpIssuer, idpClientId } = opts;
|
|
262207
|
-
const
|
|
262208
|
-
if (
|
|
262207
|
+
const cached6 = getCachedIdpIdToken(idpIssuer);
|
|
262208
|
+
if (cached6) {
|
|
262209
262209
|
logMCPDebug("xaa", `Using cached id_token for ${idpIssuer}`);
|
|
262210
|
-
return
|
|
262210
|
+
return cached6;
|
|
262211
262211
|
}
|
|
262212
262212
|
logMCPDebug("xaa", `No cached id_token for ${idpIssuer}; starting OIDC login`);
|
|
262213
262213
|
const metadata2 = await discoverOidc(idpIssuer);
|
|
@@ -263720,17 +263720,17 @@ var init_auth5 = __esm({
|
|
|
263720
263720
|
const storage = getSecureStorage();
|
|
263721
263721
|
const data = storage.read();
|
|
263722
263722
|
const serverKey = getServerKey(this.serverName, this.serverConfig);
|
|
263723
|
-
const
|
|
263724
|
-
if (
|
|
263723
|
+
const cached6 = data?.mcpOAuth?.[serverKey]?.discoveryState;
|
|
263724
|
+
if (cached6?.authorizationServerUrl) {
|
|
263725
263725
|
logMCPDebug(
|
|
263726
263726
|
this.serverName,
|
|
263727
|
-
`Returning cached discovery state (authServer: ${
|
|
263727
|
+
`Returning cached discovery state (authServer: ${cached6.authorizationServerUrl})`
|
|
263728
263728
|
);
|
|
263729
263729
|
return {
|
|
263730
|
-
authorizationServerUrl:
|
|
263731
|
-
resourceMetadataUrl:
|
|
263732
|
-
resourceMetadata:
|
|
263733
|
-
authorizationServerMetadata:
|
|
263730
|
+
authorizationServerUrl: cached6.authorizationServerUrl,
|
|
263731
|
+
resourceMetadataUrl: cached6.resourceMetadataUrl,
|
|
263732
|
+
resourceMetadata: cached6.resourceMetadata,
|
|
263733
|
+
authorizationServerMetadata: cached6.authorizationServerMetadata
|
|
263734
263734
|
};
|
|
263735
263735
|
}
|
|
263736
263736
|
const metadataUrl = this.serverConfig.oauth?.authServerMetadataUrl;
|
|
@@ -263863,20 +263863,20 @@ var init_auth5 = __esm({
|
|
|
263863
263863
|
const authFetch = createAuthFetch();
|
|
263864
263864
|
let metadata2 = this._metadata;
|
|
263865
263865
|
if (!metadata2) {
|
|
263866
|
-
const
|
|
263867
|
-
if (
|
|
263866
|
+
const cached6 = await this.discoveryState();
|
|
263867
|
+
if (cached6?.authorizationServerMetadata) {
|
|
263868
263868
|
logMCPDebug(
|
|
263869
263869
|
this.serverName,
|
|
263870
263870
|
`Using persisted auth server metadata for refresh`
|
|
263871
263871
|
);
|
|
263872
|
-
metadata2 =
|
|
263873
|
-
} else if (
|
|
263872
|
+
metadata2 = cached6.authorizationServerMetadata;
|
|
263873
|
+
} else if (cached6?.authorizationServerUrl) {
|
|
263874
263874
|
logMCPDebug(
|
|
263875
263875
|
this.serverName,
|
|
263876
|
-
`Re-discovering metadata from persisted auth server URL: ${
|
|
263876
|
+
`Re-discovering metadata from persisted auth server URL: ${cached6.authorizationServerUrl}`
|
|
263877
263877
|
);
|
|
263878
263878
|
metadata2 = await discoverAuthorizationServerMetadata(
|
|
263879
|
-
|
|
263879
|
+
cached6.authorizationServerUrl,
|
|
263880
263880
|
{ fetchFn: authFetch }
|
|
263881
263881
|
);
|
|
263882
263882
|
}
|
|
@@ -275166,8 +275166,8 @@ function isSyntheticOutputToolEnabled(opts) {
|
|
|
275166
275166
|
return opts.isNonInteractiveSession;
|
|
275167
275167
|
}
|
|
275168
275168
|
function createSyntheticOutputTool(jsonSchema) {
|
|
275169
|
-
const
|
|
275170
|
-
if (
|
|
275169
|
+
const cached6 = toolCache.get(jsonSchema);
|
|
275170
|
+
if (cached6) return cached6;
|
|
275171
275171
|
const result = buildSyntheticOutputTool(jsonSchema);
|
|
275172
275172
|
toolCache.set(jsonSchema, result);
|
|
275173
275173
|
return result;
|
|
@@ -336998,9 +336998,9 @@ async function refreshMetricsStatus() {
|
|
|
336998
336998
|
if (result.hasError) {
|
|
336999
336999
|
return result;
|
|
337000
337000
|
}
|
|
337001
|
-
const
|
|
337002
|
-
const unchanged =
|
|
337003
|
-
if (unchanged && Date.now() -
|
|
337001
|
+
const cached6 = getGlobalConfig().metricsStatusCache;
|
|
337002
|
+
const unchanged = cached6 !== void 0 && cached6.enabled === result.enabled;
|
|
337003
|
+
if (unchanged && Date.now() - cached6.timestamp < DISK_CACHE_TTL_MS) {
|
|
337004
337004
|
return result;
|
|
337005
337005
|
}
|
|
337006
337006
|
saveGlobalConfig((current3) => ({
|
|
@@ -337016,13 +337016,13 @@ async function checkMetricsEnabled() {
|
|
|
337016
337016
|
if (isClaudeAISubscriber() && !hasProfileScope()) {
|
|
337017
337017
|
return { enabled: false, hasError: false };
|
|
337018
337018
|
}
|
|
337019
|
-
const
|
|
337020
|
-
if (
|
|
337021
|
-
if (Date.now() -
|
|
337019
|
+
const cached6 = getGlobalConfig().metricsStatusCache;
|
|
337020
|
+
if (cached6) {
|
|
337021
|
+
if (Date.now() - cached6.timestamp > DISK_CACHE_TTL_MS) {
|
|
337022
337022
|
void refreshMetricsStatus().catch(logError);
|
|
337023
337023
|
}
|
|
337024
337024
|
return {
|
|
337025
|
-
enabled:
|
|
337025
|
+
enabled: cached6.enabled,
|
|
337026
337026
|
hasError: false
|
|
337027
337027
|
};
|
|
337028
337028
|
}
|
|
@@ -343396,8 +343396,8 @@ function hueToRgb(hue) {
|
|
|
343396
343396
|
};
|
|
343397
343397
|
}
|
|
343398
343398
|
function parseRGB(colorStr) {
|
|
343399
|
-
const
|
|
343400
|
-
if (
|
|
343399
|
+
const cached6 = RGB_CACHE.get(colorStr);
|
|
343400
|
+
if (cached6 !== void 0) return cached6;
|
|
343401
343401
|
const match = colorStr.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);
|
|
343402
343402
|
const result = match ? {
|
|
343403
343403
|
r: parseInt(match[1], 10),
|
|
@@ -352694,10 +352694,10 @@ async function fetchOverageCreditGrant() {
|
|
|
352694
352694
|
function getCachedOverageCreditGrant() {
|
|
352695
352695
|
const orgId = getOauthAccountInfo()?.organizationUuid;
|
|
352696
352696
|
if (!orgId) return null;
|
|
352697
|
-
const
|
|
352698
|
-
if (!
|
|
352699
|
-
if (Date.now() -
|
|
352700
|
-
return
|
|
352697
|
+
const cached6 = getGlobalConfig().overageCreditGrantCache?.[orgId];
|
|
352698
|
+
if (!cached6) return null;
|
|
352699
|
+
if (Date.now() - cached6.timestamp > CACHE_TTL_MS2) return null;
|
|
352700
|
+
return cached6.info;
|
|
352701
352701
|
}
|
|
352702
352702
|
function invalidateOverageCreditGrantCache() {
|
|
352703
352703
|
const orgId = getOauthAccountInfo()?.organizationUuid;
|
|
@@ -352984,7 +352984,7 @@ function useClaudeAiLimits() {
|
|
|
352984
352984
|
var import_react64;
|
|
352985
352985
|
var init_claudeAiLimitsHook = __esm({
|
|
352986
352986
|
"build-src/src/services/claudeAiLimitsHook.ts"() {
|
|
352987
|
-
import_react64 = __toESM(require_react());
|
|
352987
|
+
import_react64 = __toESM(require_react(), 1);
|
|
352988
352988
|
init_claudeAiLimits();
|
|
352989
352989
|
}
|
|
352990
352990
|
});
|
|
@@ -353508,7 +353508,7 @@ var init_classifierApprovalsHook = __esm({
|
|
|
353508
353508
|
var React29, SentryErrorBoundary;
|
|
353509
353509
|
var init_SentryErrorBoundary = __esm({
|
|
353510
353510
|
"build-src/src/components/SentryErrorBoundary.ts"() {
|
|
353511
|
-
React29 = __toESM(require_react());
|
|
353511
|
+
React29 = __toESM(require_react(), 1);
|
|
353512
353512
|
SentryErrorBoundary = class extends React29.Component {
|
|
353513
353513
|
constructor(props) {
|
|
353514
353514
|
super(props);
|
|
@@ -375181,8 +375181,8 @@ var init_StructuredDiff = __esm({
|
|
|
375181
375181
|
} else {
|
|
375182
375182
|
t2 = $3[9];
|
|
375183
375183
|
}
|
|
375184
|
-
const
|
|
375185
|
-
if (!
|
|
375184
|
+
const cached6 = t2;
|
|
375185
|
+
if (!cached6) {
|
|
375186
375186
|
let t32;
|
|
375187
375187
|
if ($3[10] !== dim || $3[11] !== patch2 || $3[12] !== width) {
|
|
375188
375188
|
t32 = /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(ThemedBox_default, { children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(StructuredDiffFallback, { patch: patch2, dim, width }) });
|
|
@@ -375200,7 +375200,7 @@ var init_StructuredDiff = __esm({
|
|
|
375200
375200
|
gutterWidth,
|
|
375201
375201
|
gutters,
|
|
375202
375202
|
contents
|
|
375203
|
-
} =
|
|
375203
|
+
} = cached6;
|
|
375204
375204
|
if (gutterWidth > 0 && gutters && contents) {
|
|
375205
375205
|
let t32;
|
|
375206
375206
|
if ($3[14] !== gutterWidth || $3[15] !== gutters) {
|
|
@@ -401656,7 +401656,7 @@ function getEnterWorktreeToolPrompt() {
|
|
|
401656
401656
|
|
|
401657
401657
|
## Behavior
|
|
401658
401658
|
|
|
401659
|
-
- In a git repository: creates a new git worktree inside \`.sema/worktrees/\`
|
|
401659
|
+
- In a git repository: creates a new git worktree inside \`.sema/worktrees/\` on a new branch based on the default branch tip (origin/<default-branch>; falls back to local HEAD when no remote base is resolvable)
|
|
401660
401660
|
- Outside a git repository: delegates to WorktreeCreate/WorktreeRemove hooks for VCS-agnostic isolation
|
|
401661
401661
|
- Switches the session's working directory to the new worktree
|
|
401662
401662
|
- Use ExitWorktree to leave the worktree mid-session (keep or remove). On session exit, if still in the worktree, the user will be prompted to keep or remove it
|
|
@@ -416688,9 +416688,9 @@ async function getPluginByIdCacheOnly(pluginId) {
|
|
|
416688
416688
|
}
|
|
416689
416689
|
}
|
|
416690
416690
|
async function getPluginById(pluginId) {
|
|
416691
|
-
const
|
|
416692
|
-
if (
|
|
416693
|
-
return
|
|
416691
|
+
const cached6 = await getPluginByIdCacheOnly(pluginId);
|
|
416692
|
+
if (cached6) {
|
|
416693
|
+
return cached6;
|
|
416694
416694
|
}
|
|
416695
416695
|
const { name: pluginName, marketplace: marketplaceName } = parsePluginIdentifier(pluginId);
|
|
416696
416696
|
if (!pluginName || !marketplaceName) {
|
|
@@ -418856,11 +418856,8 @@ function getAttributionTexts() {
|
|
|
418856
418856
|
}
|
|
418857
418857
|
return { commit: "", pr: "" };
|
|
418858
418858
|
}
|
|
418859
|
-
const model = getMainLoopModel();
|
|
418860
|
-
const isKnownPublicModel = getPublicModelDisplayName(model) !== null;
|
|
418861
|
-
const modelName = isInternalModelRepoCached() || isKnownPublicModel ? getPublicModelName(model) : "Claude Opus 4.6";
|
|
418862
418859
|
const defaultAttribution = `\u{1F916} Generated with [Sema](${PRODUCT_URL})`;
|
|
418863
|
-
const defaultCommit =
|
|
418860
|
+
const defaultCommit = "Co-Authored-By: Sema <noreply@vivi-ai.com>";
|
|
418864
418861
|
const settings2 = getInitialSettings2();
|
|
418865
418862
|
if (settings2.attribution) {
|
|
418866
418863
|
return {
|
|
@@ -429647,7 +429644,7 @@ async function getJson(url4, accessToken, headers = {}) {
|
|
|
429647
429644
|
}
|
|
429648
429645
|
return { status: res.status, etag: res.headers.get("etag") ?? void 0, json: json2 };
|
|
429649
429646
|
}
|
|
429650
|
-
async function resolveSkillBodies(registryUrl, accessToken, scope, body,
|
|
429647
|
+
async function resolveSkillBodies(registryUrl, accessToken, scope, body, cached6) {
|
|
429651
429648
|
const wanted = /* @__PURE__ */ new Set();
|
|
429652
429649
|
const cfg = body?.config;
|
|
429653
429650
|
for (const raw2 of Array.isArray(cfg?.skills?.skills) ? cfg.skills.skills : []) {
|
|
@@ -429655,7 +429652,7 @@ async function resolveSkillBodies(registryUrl, accessToken, scope, body, cached5
|
|
|
429655
429652
|
if (typeof h === "string" && h) wanted.add(h);
|
|
429656
429653
|
}
|
|
429657
429654
|
const out6 = {};
|
|
429658
|
-
for (const h of wanted) if (
|
|
429655
|
+
for (const h of wanted) if (cached6[h] !== void 0) out6[h] = cached6[h];
|
|
429659
429656
|
if ([...wanted].every((h) => out6[h] !== void 0)) return out6;
|
|
429660
429657
|
try {
|
|
429661
429658
|
const r = await getJson(
|
|
@@ -429706,12 +429703,12 @@ async function refreshCloudConfigNow() {
|
|
|
429706
429703
|
}
|
|
429707
429704
|
async function refreshCloudConfig(profileName, profile) {
|
|
429708
429705
|
const cache6 = readCache();
|
|
429709
|
-
const
|
|
429706
|
+
const cached6 = cache6.profiles[profileName];
|
|
429710
429707
|
const env5 = process.env;
|
|
429711
429708
|
let body;
|
|
429712
429709
|
let etag;
|
|
429713
|
-
let skillBodies =
|
|
429714
|
-
let rostersValue =
|
|
429710
|
+
let skillBodies = cached6?.skillBodies ?? {};
|
|
429711
|
+
let rostersValue = cached6?.rostersValue;
|
|
429715
429712
|
let fromCache = false;
|
|
429716
429713
|
try {
|
|
429717
429714
|
const { getValidAccessToken: getValidAccessToken2 } = await Promise.resolve().then(() => (init_cloudAuth(), cloudAuth_exports));
|
|
@@ -429719,11 +429716,11 @@ async function refreshCloudConfig(profileName, profile) {
|
|
|
429719
429716
|
const r = await getJson(
|
|
429720
429717
|
`${registryUrl}/api/v1/effective`,
|
|
429721
429718
|
accessToken,
|
|
429722
|
-
|
|
429719
|
+
cached6?.etag && cached6.registryUrl === registryUrl ? { "if-none-match": cached6.etag } : {}
|
|
429723
429720
|
);
|
|
429724
|
-
if (r.status === 304 &&
|
|
429725
|
-
body =
|
|
429726
|
-
etag =
|
|
429721
|
+
if (r.status === 304 && cached6) {
|
|
429722
|
+
body = cached6.body;
|
|
429723
|
+
etag = cached6.etag;
|
|
429727
429724
|
} else if (r.status === 200 && r.json && typeof r.json === "object") {
|
|
429728
429725
|
body = r.json;
|
|
429729
429726
|
etag = r.etag;
|
|
@@ -429745,7 +429742,7 @@ async function refreshCloudConfig(profileName, profile) {
|
|
|
429745
429742
|
};
|
|
429746
429743
|
writeCache(cache6);
|
|
429747
429744
|
} catch (e) {
|
|
429748
|
-
if (!
|
|
429745
|
+
if (!cached6) {
|
|
429749
429746
|
console.error(
|
|
429750
429747
|
`[sema] cloud config-source is ON but the registry is unreachable and no cache exists \u2014 falling back to LOCAL config (${e instanceof Error ? e.message : String(e)})`
|
|
429751
429748
|
);
|
|
@@ -429754,11 +429751,11 @@ async function refreshCloudConfig(profileName, profile) {
|
|
|
429754
429751
|
return null;
|
|
429755
429752
|
}
|
|
429756
429753
|
console.error(
|
|
429757
|
-
`[sema] cloud config: registry unreachable \u2014 using the CACHED cloud config from ${new Date(
|
|
429754
|
+
`[sema] cloud config: registry unreachable \u2014 using the CACHED cloud config from ${new Date(cached6.fetchedAt).toISOString()} (${e instanceof Error ? e.message : String(e)})`
|
|
429758
429755
|
);
|
|
429759
|
-
body =
|
|
429760
|
-
skillBodies =
|
|
429761
|
-
rostersValue =
|
|
429756
|
+
body = cached6.body;
|
|
429757
|
+
skillBodies = cached6.skillBodies ?? {};
|
|
429758
|
+
rostersValue = cached6.rostersValue;
|
|
429762
429759
|
fromCache = true;
|
|
429763
429760
|
}
|
|
429764
429761
|
const projection = projectEffectiveBody(body, skillBodies, env5, rostersValue);
|
|
@@ -429768,9 +429765,9 @@ async function refreshCloudConfig(profileName, profile) {
|
|
|
429768
429765
|
lastState = {
|
|
429769
429766
|
projection,
|
|
429770
429767
|
profileName,
|
|
429771
|
-
registryUrl: (
|
|
429768
|
+
registryUrl: (cached6?.registryUrl ?? profile.registryUrl) || profile.registryUrl,
|
|
429772
429769
|
fromCache,
|
|
429773
|
-
fetchedAt: fromCache ?
|
|
429770
|
+
fetchedAt: fromCache ? cached6.fetchedAt : Date.now()
|
|
429774
429771
|
};
|
|
429775
429772
|
return lastState;
|
|
429776
429773
|
}
|
|
@@ -436471,8 +436468,8 @@ var init_Cursor = __esm({
|
|
|
436471
436468
|
return this.wrappedLines.length;
|
|
436472
436469
|
}
|
|
436473
436470
|
withCache(key, compute) {
|
|
436474
|
-
const
|
|
436475
|
-
if (
|
|
436471
|
+
const cached6 = this.navigationCache.get(key);
|
|
436472
|
+
if (cached6 !== void 0) return cached6;
|
|
436476
436473
|
const result = compute();
|
|
436477
436474
|
this.navigationCache.set(key, result);
|
|
436478
436475
|
return result;
|
|
@@ -437685,9 +437682,9 @@ function parsePartialPath(partialPath, basePath) {
|
|
|
437685
437682
|
return { directory, prefix };
|
|
437686
437683
|
}
|
|
437687
437684
|
async function scanDirectory(dirPath) {
|
|
437688
|
-
const
|
|
437689
|
-
if (
|
|
437690
|
-
return
|
|
437685
|
+
const cached6 = directoryCache.get(dirPath);
|
|
437686
|
+
if (cached6) {
|
|
437687
|
+
return cached6;
|
|
437691
437688
|
}
|
|
437692
437689
|
try {
|
|
437693
437690
|
const fs15 = getFsImplementation();
|
|
@@ -437722,9 +437719,9 @@ function isPathLikeToken(token) {
|
|
|
437722
437719
|
}
|
|
437723
437720
|
async function scanDirectoryForPaths(dirPath, includeHidden = false) {
|
|
437724
437721
|
const cacheKey = `${dirPath}:${includeHidden}`;
|
|
437725
|
-
const
|
|
437726
|
-
if (
|
|
437727
|
-
return
|
|
437722
|
+
const cached6 = pathCache.get(cacheKey);
|
|
437723
|
+
if (cached6) {
|
|
437724
|
+
return cached6;
|
|
437728
437725
|
}
|
|
437729
437726
|
try {
|
|
437730
437727
|
const fs15 = getFsImplementation();
|
|
@@ -463649,8 +463646,8 @@ async function evaluateRelevanceMatcher(matcher, context3) {
|
|
|
463649
463646
|
for (const filePath of readFiles) {
|
|
463650
463647
|
if (!fileRe.test(filePath)) continue;
|
|
463651
463648
|
try {
|
|
463652
|
-
const
|
|
463653
|
-
let content =
|
|
463649
|
+
const cached6 = snapshot2.get(filePath);
|
|
463650
|
+
let content = cached6 && cached6.limit === void 0 && (cached6.offset ?? 1) <= 1 && !cached6.isPartialView ? cached6.content : void 0;
|
|
463654
463651
|
if (!content) {
|
|
463655
463652
|
if ((await stat38(filePath)).size > MANIFEST_DEP_MAX_FILE_SIZE) {
|
|
463656
463653
|
continue;
|
|
@@ -475909,12 +475906,12 @@ var init_collapseTeammateShutdowns = __esm({
|
|
|
475909
475906
|
|
|
475910
475907
|
// build-src/src/utils/groupToolUses.ts
|
|
475911
475908
|
function getToolsWithGrouping(tools) {
|
|
475912
|
-
let
|
|
475913
|
-
if (!
|
|
475914
|
-
|
|
475915
|
-
GROUPING_CACHE.set(tools,
|
|
475909
|
+
let cached6 = GROUPING_CACHE.get(tools);
|
|
475910
|
+
if (!cached6) {
|
|
475911
|
+
cached6 = new Set(tools.filter((t2) => t2.renderGroupedToolUse).map((t2) => t2.name));
|
|
475912
|
+
GROUPING_CACHE.set(tools, cached6);
|
|
475916
475913
|
}
|
|
475917
|
-
return
|
|
475914
|
+
return cached6;
|
|
475918
475915
|
}
|
|
475919
475916
|
function getToolUseInfo(msg) {
|
|
475920
475917
|
if (msg.type === "assistant" && msg.message.content[0]?.type === "tool_use") {
|
|
@@ -476027,8 +476024,8 @@ var init_groupToolUses = __esm({
|
|
|
476027
476024
|
|
|
476028
476025
|
// build-src/src/utils/transcriptSearch.ts
|
|
476029
476026
|
function renderableSearchText(msg) {
|
|
476030
|
-
const
|
|
476031
|
-
if (
|
|
476027
|
+
const cached6 = searchTextCache.get(msg);
|
|
476028
|
+
if (cached6 !== void 0) return cached6;
|
|
476032
476029
|
const result = computeSearchText(msg).toLowerCase();
|
|
476033
476030
|
searchTextCache.set(msg, result);
|
|
476034
476031
|
return result;
|
|
@@ -478374,8 +478371,8 @@ var init_sema_brand = __esm({
|
|
|
478374
478371
|
"Slash-command gating wired to the fleet capability handshake"
|
|
478375
478372
|
]
|
|
478376
478373
|
},
|
|
478377
|
-
productVersion: "1.0.
|
|
478378
|
-
announcement: "sema 1.0.
|
|
478374
|
+
productVersion: "1.0.10",
|
|
478375
|
+
announcement: "sema 1.0.10 \u2014 the -p init frame now reports the tools actually mounted on the engine (no more phantom TodoWrite), engine commits carry the Sema co-author signature, and tool-policy typos surface as config advisories instead of failing silently"
|
|
478379
478376
|
};
|
|
478380
478377
|
}
|
|
478381
478378
|
});
|
|
@@ -480558,15 +480555,15 @@ var init_FullscreenLayout = __esm({
|
|
|
480558
480555
|
|
|
480559
480556
|
// build-src/src/components/VirtualMessageList.tsx
|
|
480560
480557
|
function defaultExtractSearchText(msg) {
|
|
480561
|
-
const
|
|
480562
|
-
if (
|
|
480558
|
+
const cached6 = fallbackLowerCache.get(msg);
|
|
480559
|
+
if (cached6 !== void 0) return cached6;
|
|
480563
480560
|
const lowered = renderableSearchText(msg);
|
|
480564
480561
|
fallbackLowerCache.set(msg, lowered);
|
|
480565
480562
|
return lowered;
|
|
480566
480563
|
}
|
|
480567
480564
|
function stickyPromptText(msg) {
|
|
480568
|
-
const
|
|
480569
|
-
if (
|
|
480565
|
+
const cached6 = promptTextCache.get(msg);
|
|
480566
|
+
if (cached6 !== void 0) return cached6;
|
|
480570
480567
|
const result = computeStickyPromptText(msg);
|
|
480571
480568
|
promptTextCache.set(msg, result);
|
|
480572
480569
|
return result;
|
|
@@ -481314,8 +481311,8 @@ var require_sema_brand = __commonJS({
|
|
|
481314
481311
|
"Slash-command gating wired to the fleet capability handshake"
|
|
481315
481312
|
]
|
|
481316
481313
|
},
|
|
481317
|
-
productVersion: "1.0.
|
|
481318
|
-
announcement: "sema 1.0.
|
|
481314
|
+
productVersion: "1.0.10",
|
|
481315
|
+
announcement: "sema 1.0.10 \u2014 the -p init frame now reports the tools actually mounted on the engine (no more phantom TodoWrite), engine commits carry the Sema co-author signature, and tool-policy typos surface as config advisories instead of failing silently"
|
|
481319
481316
|
};
|
|
481320
481317
|
}
|
|
481321
481318
|
});
|
|
@@ -481736,8 +481733,8 @@ var init_Messages = __esm({
|
|
|
481736
481733
|
};
|
|
481737
481734
|
const searchTextCache2 = (0, import_react162.useRef)(/* @__PURE__ */ new WeakMap());
|
|
481738
481735
|
const extractSearchText = (0, import_react162.useCallback)((msg_9) => {
|
|
481739
|
-
const
|
|
481740
|
-
if (
|
|
481736
|
+
const cached6 = searchTextCache2.current.get(msg_9);
|
|
481737
|
+
if (cached6 !== void 0) return cached6;
|
|
481741
481738
|
let text_0 = renderableSearchText(msg_9);
|
|
481742
481739
|
if (msg_9.type === "user" && msg_9.toolUseResult && Array.isArray(msg_9.message.content)) {
|
|
481743
481740
|
const tr = msg_9.message.content.find((b_1) => b_1.type === "tool_result");
|
|
@@ -509945,8 +509942,8 @@ function isChromeExtensionInstalled_CACHED_MAY_BE_STALE() {
|
|
|
509945
509942
|
}));
|
|
509946
509943
|
}
|
|
509947
509944
|
});
|
|
509948
|
-
const
|
|
509949
|
-
return
|
|
509945
|
+
const cached6 = getGlobalConfig().cachedChromeExtensionInstalled;
|
|
509946
|
+
return cached6 ?? false;
|
|
509950
509947
|
}
|
|
509951
509948
|
async function isChromeExtensionInstalled() {
|
|
509952
509949
|
const browserPaths = getAllBrowserDataPaths();
|
|
@@ -515254,9 +515251,9 @@ async function generateUsageReport(options) {
|
|
|
515254
515251
|
cached: await loadCachedSessionMeta(sessionInfo.sessionId)
|
|
515255
515252
|
}))
|
|
515256
515253
|
);
|
|
515257
|
-
for (const { sessionInfo, cached:
|
|
515258
|
-
if (
|
|
515259
|
-
allMetas.push(
|
|
515254
|
+
for (const { sessionInfo, cached: cached6 } of results) {
|
|
515255
|
+
if (cached6) {
|
|
515256
|
+
allMetas.push(cached6);
|
|
515260
515257
|
} else if (uncachedSessions.length < MAX_SESSIONS_TO_LOAD) {
|
|
515261
515258
|
uncachedSessions.push(sessionInfo);
|
|
515262
515259
|
}
|
|
@@ -515330,9 +515327,9 @@ async function generateUsageReport(options) {
|
|
|
515330
515327
|
cached: await loadCachedFacets(meta4.session_id)
|
|
515331
515328
|
}))
|
|
515332
515329
|
);
|
|
515333
|
-
for (const { sessionId, cached:
|
|
515334
|
-
if (
|
|
515335
|
-
facets.set(sessionId,
|
|
515330
|
+
for (const { sessionId, cached: cached6 } of cachedFacetResults) {
|
|
515331
|
+
if (cached6) {
|
|
515332
|
+
facets.set(sessionId, cached6);
|
|
515336
515333
|
} else {
|
|
515337
515334
|
const log2 = logsForFacets.get(sessionId);
|
|
515338
515335
|
if (log2 && toExtract.length < MAX_FACET_EXTRACTIONS) {
|
|
@@ -519793,8 +519790,8 @@ var init_sessionStorage = __esm({
|
|
|
519793
519790
|
*/
|
|
519794
519791
|
existingSessionFiles = /* @__PURE__ */ new Map();
|
|
519795
519792
|
async getExistingSessionFile(sessionId) {
|
|
519796
|
-
const
|
|
519797
|
-
if (
|
|
519793
|
+
const cached6 = this.existingSessionFiles.get(sessionId);
|
|
519794
|
+
if (cached6) return cached6;
|
|
519798
519795
|
const targetFile = getTranscriptPathForSession(sessionId);
|
|
519799
519796
|
try {
|
|
519800
519797
|
await stat41(targetFile);
|
|
@@ -595122,7 +595119,7 @@ var init_chrome_context_window_warning = __esm({
|
|
|
595122
595119
|
init_autoCompact();
|
|
595123
595120
|
init_compactWarningHook();
|
|
595124
595121
|
init_contextWindowUpgradeCheck();
|
|
595125
|
-
import_jsx_runtime410 = __toESM(require_jsx_runtime()
|
|
595122
|
+
import_jsx_runtime410 = __toESM(require_jsx_runtime());
|
|
595126
595123
|
}
|
|
595127
595124
|
});
|
|
595128
595125
|
|
|
@@ -621168,12 +621165,12 @@ async function isBinaryInstalled(command8) {
|
|
|
621168
621165
|
return false;
|
|
621169
621166
|
}
|
|
621170
621167
|
const trimmedCommand = command8.trim();
|
|
621171
|
-
const
|
|
621172
|
-
if (
|
|
621168
|
+
const cached6 = binaryCache.get(trimmedCommand);
|
|
621169
|
+
if (cached6 !== void 0) {
|
|
621173
621170
|
logForDebugging(
|
|
621174
|
-
`[binaryCheck] Cache hit for '${trimmedCommand}': ${
|
|
621171
|
+
`[binaryCheck] Cache hit for '${trimmedCommand}': ${cached6}`
|
|
621175
621172
|
);
|
|
621176
|
-
return
|
|
621173
|
+
return cached6;
|
|
621177
621174
|
}
|
|
621178
621175
|
let exists = false;
|
|
621179
621176
|
if (await which(trimmedCommand).catch(() => null)) {
|
|
@@ -642119,6 +642116,168 @@ var init_interactiveToolsWire = __esm({
|
|
|
642119
642116
|
}
|
|
642120
642117
|
});
|
|
642121
642118
|
|
|
642119
|
+
// build-src/src/sema/liveInitToolFace.ts
|
|
642120
|
+
var liveInitToolFace_exports = {};
|
|
642121
|
+
__export(liveInitToolFace_exports, {
|
|
642122
|
+
ENGINE_HANDS_BAND: () => ENGINE_HANDS_BAND,
|
|
642123
|
+
ENGINE_RUNNER_FACE: () => ENGINE_RUNNER_FACE,
|
|
642124
|
+
ENGINE_SCENARIO_EXTRAS_DEFAULT: () => ENGINE_SCENARIO_EXTRAS_DEFAULT,
|
|
642125
|
+
_resetLiveInitToolFaceForTest: () => _resetLiveInitToolFaceForTest,
|
|
642126
|
+
probeScenarioTools: () => probeScenarioTools,
|
|
642127
|
+
resolveLiveInitToolFace: () => resolveLiveInitToolFace
|
|
642128
|
+
});
|
|
642129
|
+
function _resetLiveInitToolFaceForTest() {
|
|
642130
|
+
cached5 = null;
|
|
642131
|
+
}
|
|
642132
|
+
async function probeScenarioTools(baseUrl, scenario2, opts) {
|
|
642133
|
+
const fetchImpl = opts?.fetchImpl ?? fetch;
|
|
642134
|
+
const controller = new AbortController();
|
|
642135
|
+
const timer2 = setTimeout(() => controller.abort(), opts?.timeoutMs ?? 2e3);
|
|
642136
|
+
try {
|
|
642137
|
+
const res = await fetchImpl(
|
|
642138
|
+
`${baseUrl.replace(/\/+$/, "")}/v1/capabilities/scenarios/${encodeURIComponent(scenario2)}`,
|
|
642139
|
+
{
|
|
642140
|
+
method: "GET",
|
|
642141
|
+
signal: controller.signal,
|
|
642142
|
+
headers: {
|
|
642143
|
+
...opts?.principal ? { "x-agent-principal": opts.principal } : {},
|
|
642144
|
+
...opts?.authToken ? { authorization: `Bearer ${opts.authToken}` } : {}
|
|
642145
|
+
}
|
|
642146
|
+
}
|
|
642147
|
+
);
|
|
642148
|
+
if (!res.ok) return null;
|
|
642149
|
+
const body = await res.json();
|
|
642150
|
+
if (!Array.isArray(body?.tools)) return null;
|
|
642151
|
+
const names = body.tools.filter((t2) => typeof t2 === "string" && t2.length > 0);
|
|
642152
|
+
if (names.length === 0) return null;
|
|
642153
|
+
return {
|
|
642154
|
+
tools: names,
|
|
642155
|
+
...typeof body.toolset === "string" ? { toolset: body.toolset } : {}
|
|
642156
|
+
};
|
|
642157
|
+
} catch {
|
|
642158
|
+
return null;
|
|
642159
|
+
} finally {
|
|
642160
|
+
clearTimeout(timer2);
|
|
642161
|
+
}
|
|
642162
|
+
}
|
|
642163
|
+
async function resolveLiveInitToolFace(argv, env5, opts) {
|
|
642164
|
+
const baseUrl = env5.SEMA_LIVE_BASEURL;
|
|
642165
|
+
if (!baseUrl) return null;
|
|
642166
|
+
try {
|
|
642167
|
+
let scenario2;
|
|
642168
|
+
try {
|
|
642169
|
+
const { scenarioForPrint: scenarioForPrint2 } = await Promise.resolve().then(() => (init_scenarioWire(), scenarioWire_exports));
|
|
642170
|
+
const sc = scenarioForPrint2([...argv], env5);
|
|
642171
|
+
if (sc.ok && sc.scenario) scenario2 = sc.scenario;
|
|
642172
|
+
} catch {
|
|
642173
|
+
}
|
|
642174
|
+
let askUserQuestion = false;
|
|
642175
|
+
try {
|
|
642176
|
+
const { resolveHeadlessInteractiveTools: resolveHeadlessInteractiveTools2 } = await Promise.resolve().then(() => (init_interactiveToolsWire(), interactiveToolsWire_exports));
|
|
642177
|
+
const r = resolveHeadlessInteractiveTools2([...argv], env5);
|
|
642178
|
+
askUserQuestion = r.fields.interactiveTools !== false;
|
|
642179
|
+
} catch {
|
|
642180
|
+
}
|
|
642181
|
+
let webSearch = false;
|
|
642182
|
+
try {
|
|
642183
|
+
const { webSearchFromEnv: webSearchFromEnv2 } = await Promise.resolve().then(() => (init_webSearchWireCaps(), webSearchWireCaps_exports));
|
|
642184
|
+
webSearch = webSearchFromEnv2(env5) !== void 0;
|
|
642185
|
+
} catch {
|
|
642186
|
+
}
|
|
642187
|
+
const knobTools = [
|
|
642188
|
+
...askUserQuestion ? ["AskUserQuestion"] : [],
|
|
642189
|
+
...webSearch ? ["WebSearch"] : []
|
|
642190
|
+
];
|
|
642191
|
+
const key = `${baseUrl}::${scenario2 ?? ""}::${askUserQuestion ? "q" : ""}${webSearch ? "w" : ""}`;
|
|
642192
|
+
if (cached5 && cached5.key === key) return cached5.face;
|
|
642193
|
+
let names;
|
|
642194
|
+
let source = "wire-vocabulary";
|
|
642195
|
+
if (scenario2) {
|
|
642196
|
+
let authToken;
|
|
642197
|
+
try {
|
|
642198
|
+
const { resolveLiveAuthToken: resolveLiveAuthToken2 } = await Promise.resolve().then(() => (init_engineTarget(), engineTarget_exports));
|
|
642199
|
+
const t2 = resolveLiveAuthToken2(baseUrl);
|
|
642200
|
+
authToken = typeof t2 === "string" ? t2 : void 0;
|
|
642201
|
+
} catch {
|
|
642202
|
+
}
|
|
642203
|
+
const probed = await probeScenarioTools(baseUrl, scenario2, {
|
|
642204
|
+
...opts?.fetchImpl ? { fetchImpl: opts.fetchImpl } : {},
|
|
642205
|
+
...opts?.timeoutMs !== void 0 ? { timeoutMs: opts.timeoutMs } : {},
|
|
642206
|
+
...authToken ? { authToken } : {},
|
|
642207
|
+
...env5.SEMA_LIVE_PRINCIPAL ? { principal: env5.SEMA_LIVE_PRINCIPAL } : {}
|
|
642208
|
+
});
|
|
642209
|
+
if (probed) {
|
|
642210
|
+
const handsBand = probed.toolset === "full-body" ? ENGINE_HANDS_BAND : [];
|
|
642211
|
+
names = [.../* @__PURE__ */ new Set([...probed.tools, ...handsBand, ...ENGINE_RUNNER_FACE, ...knobTools])];
|
|
642212
|
+
source = "scenario-probe";
|
|
642213
|
+
if (env5.SEMA_DEBUG) {
|
|
642214
|
+
console.error(
|
|
642215
|
+
`[sema] init tool face: scenario "${scenario2}" detail probe ok (toolset=${probed.toolset ?? "unknown"}) \u2014 reporting scenario tools + runner face${handsBand.length > 0 ? " + hands band" : " (hands band not claimed for a non-full-body toolset)"}`
|
|
642216
|
+
);
|
|
642217
|
+
}
|
|
642218
|
+
} else {
|
|
642219
|
+
names = [...ENGINE_HANDS_BAND, ...ENGINE_SCENARIO_EXTRAS_DEFAULT, ...ENGINE_RUNNER_FACE, ...knobTools];
|
|
642220
|
+
if (env5.SEMA_DEBUG) {
|
|
642221
|
+
console.error(
|
|
642222
|
+
`[sema] init tool face: scenario "${scenario2}" detail probe unavailable \u2014 falling back to the default wire vocabulary (may not match this scenario's roster)`
|
|
642223
|
+
);
|
|
642224
|
+
}
|
|
642225
|
+
}
|
|
642226
|
+
} else {
|
|
642227
|
+
names = [...ENGINE_HANDS_BAND, ...ENGINE_SCENARIO_EXTRAS_DEFAULT, ...ENGINE_RUNNER_FACE, ...knobTools];
|
|
642228
|
+
}
|
|
642229
|
+
const face = { tools: names.map((name) => ({ name })), source };
|
|
642230
|
+
cached5 = { key, face };
|
|
642231
|
+
return face;
|
|
642232
|
+
} catch {
|
|
642233
|
+
return null;
|
|
642234
|
+
}
|
|
642235
|
+
}
|
|
642236
|
+
var ENGINE_HANDS_BAND, ENGINE_SCENARIO_EXTRAS_DEFAULT, ENGINE_RUNNER_FACE, cached5;
|
|
642237
|
+
var init_liveInitToolFace = __esm({
|
|
642238
|
+
"build-src/src/sema/liveInitToolFace.ts"() {
|
|
642239
|
+
ENGINE_HANDS_BAND = [
|
|
642240
|
+
"Bash",
|
|
642241
|
+
"Read",
|
|
642242
|
+
"Edit",
|
|
642243
|
+
"Write",
|
|
642244
|
+
"Glob",
|
|
642245
|
+
"Grep",
|
|
642246
|
+
"NotebookEdit",
|
|
642247
|
+
"LSP",
|
|
642248
|
+
"RepoMap",
|
|
642249
|
+
"EnterWorktree",
|
|
642250
|
+
"ExitWorktree",
|
|
642251
|
+
"Monitor"
|
|
642252
|
+
];
|
|
642253
|
+
ENGINE_SCENARIO_EXTRAS_DEFAULT = [
|
|
642254
|
+
"Now",
|
|
642255
|
+
"WebFetch",
|
|
642256
|
+
"Agent",
|
|
642257
|
+
"TaskCreate",
|
|
642258
|
+
"TaskGet",
|
|
642259
|
+
"TaskUpdate",
|
|
642260
|
+
"TaskList"
|
|
642261
|
+
];
|
|
642262
|
+
ENGINE_RUNNER_FACE = [
|
|
642263
|
+
"AgentTranscript",
|
|
642264
|
+
"CronCreate",
|
|
642265
|
+
"CronDelete",
|
|
642266
|
+
"CronList",
|
|
642267
|
+
"ReadToolResult",
|
|
642268
|
+
"ReportBlocked",
|
|
642269
|
+
"ReportFindings",
|
|
642270
|
+
"ScheduleWakeup",
|
|
642271
|
+
"SendMessage",
|
|
642272
|
+
"Skill",
|
|
642273
|
+
"TaskOutput",
|
|
642274
|
+
"TaskStop",
|
|
642275
|
+
"Workflow"
|
|
642276
|
+
];
|
|
642277
|
+
cached5 = null;
|
|
642278
|
+
}
|
|
642279
|
+
});
|
|
642280
|
+
|
|
642122
642281
|
// build-src/src/sema/printStreamJsonContract.ts
|
|
642123
642282
|
var printStreamJsonContract_exports = {};
|
|
642124
642283
|
__export(printStreamJsonContract_exports, {
|
|
@@ -642146,8 +642305,17 @@ async function buildPrintInitMessage(params, sessionId) {
|
|
|
642146
642305
|
plugins = (await loadAllPluginsCacheOnly2()).enabled;
|
|
642147
642306
|
} catch {
|
|
642148
642307
|
}
|
|
642308
|
+
let initTools = params.tools ?? [];
|
|
642309
|
+
if (process.env.SEMA_LIVE_BASEURL) {
|
|
642310
|
+
try {
|
|
642311
|
+
const { resolveLiveInitToolFace: resolveLiveInitToolFace2 } = await Promise.resolve().then(() => (init_liveInitToolFace(), liveInitToolFace_exports));
|
|
642312
|
+
const face = await resolveLiveInitToolFace2(process.argv.slice(2), process.env);
|
|
642313
|
+
if (face) initTools = face.tools;
|
|
642314
|
+
} catch {
|
|
642315
|
+
}
|
|
642316
|
+
}
|
|
642149
642317
|
const init2 = buildSystemInitMessage3({
|
|
642150
|
-
tools:
|
|
642318
|
+
tools: initTools,
|
|
642151
642319
|
mcpClients: params.mcpClients ?? [],
|
|
642152
642320
|
model,
|
|
642153
642321
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- CC's own ask does the same cast
|
|
@@ -666809,7 +666977,7 @@ Auth: unix socket -R \u2192 local proxy`, "info");
|
|
|
666809
666977
|
pendingHookMessages
|
|
666810
666978
|
}, renderAndRun);
|
|
666811
666979
|
}
|
|
666812
|
-
}).version("sema 1.0.
|
|
666980
|
+
}).version("sema 1.0.10", "-v, --version", "Output the version number");
|
|
666813
666981
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
666814
666982
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
666815
666983
|
if (canUserConfigureAdvisor()) {
|