tesseract-agent 0.11.16 → 0.11.18
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-bundle/cli.js +120 -156
- package/dist-bundle/mesh-core/package.json +1 -1
- package/package.json +1 -1
package/dist-bundle/cli.js
CHANGED
|
@@ -20222,6 +20222,21 @@ Rules:
|
|
|
20222
20222
|
- Plain words a non-expert understands. No jargon, no file paths, no command names unless the suggestion itself names them.
|
|
20223
20223
|
- Address the developer directly ("This would\u2026"). Never answer the suggestion, never do the work, never ask a question.
|
|
20224
20224
|
- Two sentences maximum. Stop.`
|
|
20225
|
+
},
|
|
20226
|
+
{
|
|
20227
|
+
id: "side-llm.summarize-turn",
|
|
20228
|
+
group: "side-llm",
|
|
20229
|
+
label: "Conversation tab summariser",
|
|
20230
|
+
help: "One short line describing what the conversation has DONE so far, shown in the tab's hover tooltip under the title. Rebuilt after each turn. The \u226412-word / one-sentence limit is the whole contract \u2014 it sits in a small tooltip, so anything longer is clipped; and it must read as a status of work done, never as a reply to the developer.",
|
|
20231
|
+
vars: [],
|
|
20232
|
+
content: `A developer is working with an AI coding agent. Summarise, in ONE short sentence, what this conversation has accomplished SO FAR \u2014 the kind of line that belongs under a browser-tab title.
|
|
20233
|
+
Rules:
|
|
20234
|
+
- Output ONLY the sentence. No markdown, no quotes, no preamble, no trailing period.
|
|
20235
|
+
- 12 words MAXIMUM. Shorter is better.
|
|
20236
|
+
- Describe the WORK DONE, not what is planned or being asked. Past/perfect or a noun phrase ("Added tab tooltips and per-turn summaries", "Debugging the failing image upload").
|
|
20237
|
+
- Weight the MOST RECENT messages most heavily: if the topic shifted, describe where it is now, not where it started.
|
|
20238
|
+
- Plain, concrete words. Name the real feature/file/thing when it is clear. No filler like "The agent\u2026" or "This conversation\u2026".
|
|
20239
|
+
- Never answer the developer, never do the work, never ask a question.`
|
|
20225
20240
|
},
|
|
20226
20241
|
{
|
|
20227
20242
|
id: "side-llm.project-inspect",
|
|
@@ -23061,7 +23076,7 @@ var init_capabilities = __esm({
|
|
|
23061
23076
|
label: "Create a presentation",
|
|
23062
23077
|
help: "What the model is told the `present.create_deck` App-Control capability does (present domain, write).",
|
|
23063
23078
|
vars: [],
|
|
23064
|
-
content: `Make a new, empty Tesseract Stage presentation in the user
|
|
23079
|
+
content: `Make a new, empty Tesseract Stage presentation and return its deck handle. It lands in the project the user has open \u2014 beside the files it is about \u2014 or in their library (~/Documents/Tesseract/Presentations) when no project is open. This is how you make a presentation \u2014 NOT a PowerPoint file, NOT markdown, NOT an HTML canvas. Pass the title in the user's own words and language. Optionally set a theme: CSS custom properties every slide inherits, e.g. { "--bg": "#FFFFFF", "--ink": "#16130F", "--accent": "#D97757" }. Then write slides with write_slide.`
|
|
23065
23080
|
},
|
|
23066
23081
|
{
|
|
23067
23082
|
id: "capability.present.write_slide",
|
|
@@ -26821,38 +26836,7 @@ function recordFailure(creds3, id, errorCode, now2, opts) {
|
|
|
26821
26836
|
return c;
|
|
26822
26837
|
advanced = true;
|
|
26823
26838
|
const consecutiveFailures = (c.consecutiveFailures ?? 0) + 1;
|
|
26824
|
-
|
|
26825
|
-
return {
|
|
26826
|
-
...c,
|
|
26827
|
-
status: "expired",
|
|
26828
|
-
quarantineUntil: now2 + QUARANTINE_MS,
|
|
26829
|
-
lastErrorCode: errorCode,
|
|
26830
|
-
consecutiveFailures
|
|
26831
|
-
};
|
|
26832
|
-
}
|
|
26833
|
-
if (errorCode === "invalid_key") {
|
|
26834
|
-
return {
|
|
26835
|
-
...c,
|
|
26836
|
-
status: "revoked",
|
|
26837
|
-
quarantineUntil: now2 + QUARANTINE_MS,
|
|
26838
|
-
lastErrorCode: errorCode,
|
|
26839
|
-
consecutiveFailures
|
|
26840
|
-
};
|
|
26841
|
-
}
|
|
26842
|
-
if (errorCode === "credit_exhausted") {
|
|
26843
|
-
const until = opts?.cooldownUntil && opts.cooldownUntil > now2 ? opts.cooldownUntil : now2 + QUARANTINE_MS;
|
|
26844
|
-
return {
|
|
26845
|
-
...c,
|
|
26846
|
-
status: "cooldown",
|
|
26847
|
-
cooldownUntil: until,
|
|
26848
|
-
quarantineUntil: until,
|
|
26849
|
-
lastErrorCode: errorCode,
|
|
26850
|
-
consecutiveFailures
|
|
26851
|
-
};
|
|
26852
|
-
}
|
|
26853
|
-
const backoff3 = Math.min(COOLDOWN_BASE_MS * 2 ** (consecutiveFailures - 1), COOLDOWN_MAX_MS);
|
|
26854
|
-
const cooldownUntil = opts?.cooldownUntil && opts.cooldownUntil > now2 ? opts.cooldownUntil : now2 + backoff3;
|
|
26855
|
-
return { ...c, status: "cooldown", cooldownUntil, lastErrorCode: errorCode, consecutiveFailures };
|
|
26839
|
+
return { ...c, lastErrorCode: errorCode, consecutiveFailures };
|
|
26856
26840
|
});
|
|
26857
26841
|
return { next, advanced };
|
|
26858
26842
|
}
|
|
@@ -26869,12 +26853,10 @@ function recordSuccess(creds3, id, now2) {
|
|
|
26869
26853
|
lastErrorCode: void 0
|
|
26870
26854
|
} : c);
|
|
26871
26855
|
}
|
|
26872
|
-
var
|
|
26856
|
+
var QUARANTINE_MS;
|
|
26873
26857
|
var init_rotation = __esm({
|
|
26874
26858
|
"../../packages/shared/dist/rotation.js"() {
|
|
26875
26859
|
"use strict";
|
|
26876
|
-
COOLDOWN_BASE_MS = 6e4;
|
|
26877
|
-
COOLDOWN_MAX_MS = 36e5;
|
|
26878
26860
|
QUARANTINE_MS = 24 * 60 * 60 * 1e3;
|
|
26879
26861
|
}
|
|
26880
26862
|
});
|
|
@@ -32986,8 +32968,9 @@ ${JSON.stringify(r, null, 2)}`
|
|
|
32986
32968
|
domain: "present",
|
|
32987
32969
|
title: "Create a presentation",
|
|
32988
32970
|
input: external_exports.object({
|
|
32989
|
-
title: external_exports.string().describe("What the presentation is called.
|
|
32971
|
+
title: external_exports.string().describe("What the presentation is called. Used for its folder name; keep the user's own wording and language."),
|
|
32990
32972
|
description: external_exports.string().optional().describe("One line about what it is for."),
|
|
32973
|
+
root: external_exports.string().optional().describe("Folder to create it in. Leave unset \u2014 it then lands in the project the user has open, which is almost always what they want. Only set this if they asked for somewhere specific."),
|
|
32991
32974
|
theme: external_exports.record(external_exports.string(), external_exports.string()).optional().describe('CSS custom properties applied to every slide, e.g. { "--bg": "#FFFFFF", "--ink": "#16130F", "--accent": "#D97757" }.')
|
|
32992
32975
|
}),
|
|
32993
32976
|
mutation: "write",
|
|
@@ -33000,7 +32983,7 @@ ${JSON.stringify(r, null, 2)}`
|
|
|
33000
32983
|
domain: "present",
|
|
33001
32984
|
title: "Write a slide",
|
|
33002
32985
|
input: external_exports.object({
|
|
33003
|
-
deck: external_exports.string().describe("The deck
|
|
32986
|
+
deck: external_exports.string().describe("The deck handle, exactly as `list_decks` or `create_deck` returned it. Either a folder name or an absolute path, both ending in .tessdeck \u2014 pass it back unchanged rather than rebuilding it."),
|
|
33004
32987
|
path: external_exports.string().describe('Path inside the presentation, e.g. "slides/03-pricing.tsx". Filename order IS slide order, so number the prefixes. Helper files may live anywhere in the package.'),
|
|
33005
32988
|
source: external_exports.string().describe("The whole file. A slide exports `meta` ({ id, title, summary?, notes?, transition?, builds? }) and a default React component.")
|
|
33006
32989
|
}),
|
|
@@ -33014,7 +32997,7 @@ ${JSON.stringify(r, null, 2)}`
|
|
|
33014
32997
|
domain: "present",
|
|
33015
32998
|
title: "Read a slide",
|
|
33016
32999
|
input: external_exports.object({
|
|
33017
|
-
deck: external_exports.string().describe("The deck
|
|
33000
|
+
deck: external_exports.string().describe("The deck handle, exactly as it was returned to you."),
|
|
33018
33001
|
path: external_exports.string().describe('Path inside the presentation, e.g. "slides/03-pricing.tsx".')
|
|
33019
33002
|
}),
|
|
33020
33003
|
mutation: "read",
|
|
@@ -33026,7 +33009,7 @@ ${JSON.stringify(r, null, 2)}`
|
|
|
33026
33009
|
domain: "present",
|
|
33027
33010
|
title: "Delete a slide",
|
|
33028
33011
|
input: external_exports.object({
|
|
33029
|
-
deck: external_exports.string().describe("The deck
|
|
33012
|
+
deck: external_exports.string().describe("The deck handle, exactly as it was returned to you."),
|
|
33030
33013
|
path: external_exports.string().describe("Path inside the presentation.")
|
|
33031
33014
|
}),
|
|
33032
33015
|
mutation: "write",
|
|
@@ -33038,7 +33021,7 @@ ${JSON.stringify(r, null, 2)}`
|
|
|
33038
33021
|
id: "present.validate_deck",
|
|
33039
33022
|
domain: "present",
|
|
33040
33023
|
title: "Check a presentation",
|
|
33041
|
-
input: external_exports.object({ deck: external_exports.string().describe("The deck
|
|
33024
|
+
input: external_exports.object({ deck: external_exports.string().describe("The deck handle, exactly as it was returned to you.") }),
|
|
33042
33025
|
mutation: "read",
|
|
33043
33026
|
availability: "desktop",
|
|
33044
33027
|
binding: { kind: "ipc", channel: "decklib", verb: "validate" },
|
|
@@ -33049,7 +33032,7 @@ ${JSON.stringify(r, null, 2)}`
|
|
|
33049
33032
|
domain: "present",
|
|
33050
33033
|
title: "Set a presentation\u2019s theme",
|
|
33051
33034
|
input: external_exports.object({
|
|
33052
|
-
deck: external_exports.string().describe("The deck
|
|
33035
|
+
deck: external_exports.string().describe("The deck handle, exactly as it was returned to you."),
|
|
33053
33036
|
theme: external_exports.record(external_exports.string(), external_exports.string()).describe(`CSS custom properties, e.g. { "--bg": "#0C0A14", "--ink": "#FFFFFF" }. Replaces the deck's current theme.`)
|
|
33054
33037
|
}),
|
|
33055
33038
|
mutation: "write",
|
|
@@ -33062,7 +33045,7 @@ ${JSON.stringify(r, null, 2)}`
|
|
|
33062
33045
|
domain: "present",
|
|
33063
33046
|
title: "Add an image to a presentation",
|
|
33064
33047
|
input: external_exports.object({
|
|
33065
|
-
deck: external_exports.string().describe("The deck
|
|
33048
|
+
deck: external_exports.string().describe("The deck handle, exactly as it was returned to you."),
|
|
33066
33049
|
source_path: external_exports.string().describe("Absolute path of the file to copy in \u2014 a generated image, a photo, an audio clip."),
|
|
33067
33050
|
name: external_exports.string().optional().describe("Filename to use inside the presentation.")
|
|
33068
33051
|
}),
|
|
@@ -33075,7 +33058,7 @@ ${JSON.stringify(r, null, 2)}`
|
|
|
33075
33058
|
id: "present.open_deck",
|
|
33076
33059
|
domain: "present",
|
|
33077
33060
|
title: "Open a presentation",
|
|
33078
|
-
input: external_exports.object({ deck: external_exports.string().describe("The deck
|
|
33061
|
+
input: external_exports.object({ deck: external_exports.string().describe("The deck handle, exactly as it was returned to you.") }),
|
|
33079
33062
|
mutation: "write",
|
|
33080
33063
|
availability: "desktop",
|
|
33081
33064
|
binding: { kind: "ipc", channel: "decklib", verb: "open" },
|
|
@@ -33085,7 +33068,7 @@ ${JSON.stringify(r, null, 2)}`
|
|
|
33085
33068
|
id: "present.delete_deck",
|
|
33086
33069
|
domain: "present",
|
|
33087
33070
|
title: "Delete a presentation",
|
|
33088
|
-
input: external_exports.object({ deck: external_exports.string().describe("The deck
|
|
33071
|
+
input: external_exports.object({ deck: external_exports.string().describe("The deck handle, exactly as it was returned to you.") }),
|
|
33089
33072
|
mutation: "write",
|
|
33090
33073
|
availability: "desktop",
|
|
33091
33074
|
binding: { kind: "ipc", channel: "decklib", verb: "delete" },
|
|
@@ -48164,29 +48147,6 @@ function readDaemonAgentSettings() {
|
|
|
48164
48147
|
return snap;
|
|
48165
48148
|
}
|
|
48166
48149
|
}
|
|
48167
|
-
function gatewayCanCall(model, snapshot4) {
|
|
48168
|
-
const tiers2 = snapshot4.gatewayTiers;
|
|
48169
|
-
if (!tiers2?.length)
|
|
48170
|
-
return true;
|
|
48171
|
-
return tiers2.includes(model) || snapshot4.gatewayDirectNaming === true;
|
|
48172
|
-
}
|
|
48173
|
-
function gatewayTierRejection(model) {
|
|
48174
|
-
if (!model)
|
|
48175
|
-
return null;
|
|
48176
|
-
const snap = readDaemonAgentSettings();
|
|
48177
|
-
if (gatewayCanCall(model, snap))
|
|
48178
|
-
return null;
|
|
48179
|
-
return { model, tiers: [...snap.gatewayTiers ?? []] };
|
|
48180
|
-
}
|
|
48181
|
-
function gatewayTierClamp(model) {
|
|
48182
|
-
if (!model)
|
|
48183
|
-
return model;
|
|
48184
|
-
const snap = readDaemonAgentSettings();
|
|
48185
|
-
if (gatewayCanCall(model, snap))
|
|
48186
|
-
return model;
|
|
48187
|
-
console.warn(`[gateway] Model "${model}" isn't served by this device's gateway key (${(snap.gatewayTiers ?? []).join(", ")}) \u2014 dropping it so the gateway picks one it can reach.`);
|
|
48188
|
-
return void 0;
|
|
48189
|
-
}
|
|
48190
48150
|
function chatSendToParams(msg, defaults) {
|
|
48191
48151
|
return mergeDaemonAgentSettings({
|
|
48192
48152
|
message: msg.message,
|
|
@@ -48227,7 +48187,6 @@ function chatSendToParams(msg, defaults) {
|
|
|
48227
48187
|
function mergeDaemonAgentSettings(params) {
|
|
48228
48188
|
const s = readDaemonAgentSettings();
|
|
48229
48189
|
const hostModel = poolActiveModel() ?? s.model;
|
|
48230
|
-
const clampToGatewayTier = gatewayTierClamp;
|
|
48231
48190
|
return {
|
|
48232
48191
|
...params,
|
|
48233
48192
|
mcpServers: params.mcpServers ?? s.mcpServers,
|
|
@@ -48237,16 +48196,15 @@ function mergeDaemonAgentSettings(params) {
|
|
|
48237
48196
|
settingSources: params.settingSources ?? s.settingSources,
|
|
48238
48197
|
maxTurns: params.maxTurns ?? s.maxTurns,
|
|
48239
48198
|
maxBudgetUsd: params.maxBudgetUsd ?? s.maxBudgetUsd,
|
|
48240
|
-
model:
|
|
48199
|
+
model: params.model ?? hostModel,
|
|
48241
48200
|
hostInjectedModel: params.hostInjectedModel ?? (params.model === void 0 && hostModel !== void 0),
|
|
48242
48201
|
permissionMode: params.permissionMode ?? s.permissionMode,
|
|
48243
48202
|
effort: params.effort ?? s.effort,
|
|
48244
48203
|
ultracode: params.ultracode ?? s.ultracode,
|
|
48245
48204
|
// Model-level fallback: the engine switches models BEFORE the turn fails. Our runner
|
|
48246
48205
|
// rotation works one level up (credential/config) and only AFTER a failure, so the two
|
|
48247
|
-
// compose rather than compete.
|
|
48248
|
-
|
|
48249
|
-
fallbackModel: clampToGatewayTier(params.fallbackModel ?? s.fallbackModel),
|
|
48206
|
+
// compose rather than compete. Sent as named, like `model`.
|
|
48207
|
+
fallbackModel: params.fallbackModel ?? s.fallbackModel,
|
|
48250
48208
|
// Token budget the MODEL is told about, so it paces tool use and wraps up instead of
|
|
48251
48209
|
// being cut off mid-thought (distinct from maxBudgetUsd, which is dollars and hard).
|
|
48252
48210
|
taskBudget: params.taskBudget ?? s.taskBudget,
|
|
@@ -52206,7 +52164,7 @@ var require_deflate2 = __commonJS({
|
|
|
52206
52164
|
options.raw = true;
|
|
52207
52165
|
return deflate(input, options);
|
|
52208
52166
|
}
|
|
52209
|
-
function
|
|
52167
|
+
function gzip2(input, options) {
|
|
52210
52168
|
options = options || {};
|
|
52211
52169
|
options.gzip = true;
|
|
52212
52170
|
return deflate(input, options);
|
|
@@ -52214,7 +52172,7 @@ var require_deflate2 = __commonJS({
|
|
|
52214
52172
|
module.exports.Deflate = Deflate;
|
|
52215
52173
|
module.exports.deflate = deflate;
|
|
52216
52174
|
module.exports.deflateRaw = deflateRaw;
|
|
52217
|
-
module.exports.gzip =
|
|
52175
|
+
module.exports.gzip = gzip2;
|
|
52218
52176
|
module.exports.constants = require_constants2();
|
|
52219
52177
|
}
|
|
52220
52178
|
});
|
|
@@ -54223,13 +54181,13 @@ var require_inflate2 = __commonJS({
|
|
|
54223
54181
|
var require_pako = __commonJS({
|
|
54224
54182
|
"../../node_modules/fast-png/node_modules/pako/index.js"(exports, module) {
|
|
54225
54183
|
"use strict";
|
|
54226
|
-
var { Deflate, deflate, deflateRaw, gzip } = require_deflate2();
|
|
54184
|
+
var { Deflate, deflate, deflateRaw, gzip: gzip2 } = require_deflate2();
|
|
54227
54185
|
var { Inflate, inflate, inflateRaw, ungzip } = require_inflate2();
|
|
54228
54186
|
var constants = require_constants2();
|
|
54229
54187
|
module.exports.Deflate = Deflate;
|
|
54230
54188
|
module.exports.deflate = deflate;
|
|
54231
54189
|
module.exports.deflateRaw = deflateRaw;
|
|
54232
|
-
module.exports.gzip =
|
|
54190
|
+
module.exports.gzip = gzip2;
|
|
54233
54191
|
module.exports.Inflate = Inflate;
|
|
54234
54192
|
module.exports.inflate = inflate;
|
|
54235
54193
|
module.exports.inflateRaw = inflateRaw;
|
|
@@ -84115,7 +84073,6 @@ function toRewindOutcome(res, noHistory) {
|
|
|
84115
84073
|
|
|
84116
84074
|
// ../../packages/host-core/dist/control-link.js
|
|
84117
84075
|
import { join as join67, basename as basename12 } from "node:path";
|
|
84118
|
-
import { randomUUID as randomUUID28 } from "node:crypto";
|
|
84119
84076
|
import { mkdirSync as mkdirSync31 } from "node:fs";
|
|
84120
84077
|
|
|
84121
84078
|
// ../../node_modules/ws/wrapper.mjs
|
|
@@ -101450,6 +101407,8 @@ function createDaemonVideoEditRunner() {
|
|
|
101450
101407
|
// ../../packages/host-core/dist/support-submit.js
|
|
101451
101408
|
init_credentials();
|
|
101452
101409
|
import { openSync as openSync6, fstatSync, readSync as readSync5, closeSync as closeSync6 } from "node:fs";
|
|
101410
|
+
import { promisify as promisify2 } from "node:util";
|
|
101411
|
+
import { gzip } from "node:zlib";
|
|
101453
101412
|
import { join as join49 } from "node:path";
|
|
101454
101413
|
|
|
101455
101414
|
// ../../packages/host-core/dist/host-metrics.js
|
|
@@ -101485,7 +101444,7 @@ function dynamicMetrics() {
|
|
|
101485
101444
|
}
|
|
101486
101445
|
|
|
101487
101446
|
// ../../packages/host-core/dist/support-submit.js
|
|
101488
|
-
var LOG_TAIL_BYTES =
|
|
101447
|
+
var LOG_TAIL_BYTES = 4 * 1024 * 1024;
|
|
101489
101448
|
function tail2(path6, bytes3 = LOG_TAIL_BYTES) {
|
|
101490
101449
|
let fd = null;
|
|
101491
101450
|
try {
|
|
@@ -101524,20 +101483,25 @@ function createDaemonSupportSubmit() {
|
|
|
101524
101483
|
userId: creds3.userId,
|
|
101525
101484
|
logs: { daemon: daemonLog }
|
|
101526
101485
|
};
|
|
101486
|
+
const payload = await promisify2(gzip)(Buffer.from(JSON.stringify({
|
|
101487
|
+
type: input.type === "feature" ? "feature" : "issue",
|
|
101488
|
+
title: input.title,
|
|
101489
|
+
description: input.description,
|
|
101490
|
+
// NEVER route logs to the PUBLIC issue on the agent path: they're auto-collected
|
|
101491
|
+
// (not human-reviewed) and can carry usernames/paths/ids. The daemon log is already
|
|
101492
|
+
// attached PRIVATELY via `diagnostics` above. Public logs are the desktop form's
|
|
101493
|
+
// job (human-reviewed opt-in) only.
|
|
101494
|
+
includeLogsInIssue: false,
|
|
101495
|
+
diagnostics
|
|
101496
|
+
}), "utf8"));
|
|
101527
101497
|
const res = await fetch(`${creds3.apiOrigin.replace(/\/$/, "")}/api/core/tesseract/support/issue`, {
|
|
101528
101498
|
method: "POST",
|
|
101529
|
-
headers: {
|
|
101530
|
-
|
|
101531
|
-
|
|
101532
|
-
|
|
101533
|
-
|
|
101534
|
-
|
|
101535
|
-
// (not human-reviewed) and can carry usernames/paths/ids. The daemon log is already
|
|
101536
|
-
// attached PRIVATELY via `diagnostics` above. Public logs are the desktop form's
|
|
101537
|
-
// job (human-reviewed opt-in) only.
|
|
101538
|
-
includeLogsInIssue: false,
|
|
101539
|
-
diagnostics
|
|
101540
|
-
}),
|
|
101499
|
+
headers: {
|
|
101500
|
+
"Content-Type": "application/json",
|
|
101501
|
+
"Content-Encoding": "gzip",
|
|
101502
|
+
Authorization: `Bearer ${creds3.accessToken}`
|
|
101503
|
+
},
|
|
101504
|
+
body: payload,
|
|
101541
101505
|
signal: AbortSignal.timeout(3e4)
|
|
101542
101506
|
});
|
|
101543
101507
|
if (!res.ok) {
|
|
@@ -102883,7 +102847,7 @@ import { openSync as openSync7, readSync as readSync6, writeSync as writeSync2,
|
|
|
102883
102847
|
import { tmpdir as tmpdir5 } from "node:os";
|
|
102884
102848
|
import { basename as basename8, dirname as dirname21, join as join53, relative as relative6, resolve as resolve8, sep as sep7, isAbsolute as isAbsolute7 } from "node:path";
|
|
102885
102849
|
import { execFile as execFile6 } from "node:child_process";
|
|
102886
|
-
import { promisify as
|
|
102850
|
+
import { promisify as promisify3 } from "node:util";
|
|
102887
102851
|
|
|
102888
102852
|
// ../../packages/host-core/dist/os-favorites.js
|
|
102889
102853
|
init_base_paths();
|
|
@@ -103275,7 +103239,7 @@ async function codeStats(root) {
|
|
|
103275
103239
|
}
|
|
103276
103240
|
|
|
103277
103241
|
// ../../packages/host-core/dist/fs-remote.js
|
|
103278
|
-
var execFileAsync =
|
|
103242
|
+
var execFileAsync = promisify3(execFile6);
|
|
103279
103243
|
function insideOk(p) {
|
|
103280
103244
|
const c = resolveContainmentRoot();
|
|
103281
103245
|
return c ? isInsideRoot(p, c) : true;
|
|
@@ -104948,7 +104912,25 @@ var PeerLinkManager = class {
|
|
|
104948
104912
|
const socket2 = await q.makeQuicSocket(this.udpPort);
|
|
104949
104913
|
this.quicSocket = socket2;
|
|
104950
104914
|
await q.startQuicServerOnSocket({ socket: socket2, identity, onStream: (bs5) => this.acceptInbound(bs5, "punch") });
|
|
104915
|
+
const disableQuicTier = (why) => {
|
|
104916
|
+
if (this.quicUnavailable)
|
|
104917
|
+
return;
|
|
104918
|
+
this.quicUnavailable = true;
|
|
104919
|
+
if (this.quicKeepalive) {
|
|
104920
|
+
clearInterval(this.quicKeepalive);
|
|
104921
|
+
this.quicKeepalive = null;
|
|
104922
|
+
}
|
|
104923
|
+
this.quicSocket = null;
|
|
104924
|
+
try {
|
|
104925
|
+
void socket2.stop({ force: true });
|
|
104926
|
+
} catch {
|
|
104927
|
+
}
|
|
104928
|
+
console.warn(`[peer-link] QUIC tier disabled at runtime \u2014 ${why}. Using TCP tiers; a sandbox-safe @matrixai/quic rebuild re-enables it.`);
|
|
104929
|
+
};
|
|
104930
|
+
const isSandboxFailure = (m) => /create external arraybuffer failed/i.test(m);
|
|
104951
104931
|
const refresh = async () => {
|
|
104932
|
+
if (this.quicUnavailable)
|
|
104933
|
+
return;
|
|
104952
104934
|
const found = [];
|
|
104953
104935
|
for (const { host, port } of resolveStunServers()) {
|
|
104954
104936
|
try {
|
|
@@ -104958,7 +104940,12 @@ var PeerLinkManager = class {
|
|
|
104958
104940
|
if (!found.some((c) => c.ip === cand.ip && c.port === cand.port))
|
|
104959
104941
|
found.push(cand);
|
|
104960
104942
|
} catch (e) {
|
|
104961
|
-
|
|
104943
|
+
const detail = e.message;
|
|
104944
|
+
if (isSandboxFailure(detail)) {
|
|
104945
|
+
disableQuicTier(`the native binding rejects this runtime's ArrayBuffers (${detail})`);
|
|
104946
|
+
return;
|
|
104947
|
+
}
|
|
104948
|
+
console.warn(`[peer-link] srflx FAILED via ${host}:${port}: ${detail}`);
|
|
104962
104949
|
}
|
|
104963
104950
|
}
|
|
104964
104951
|
if (found.length && JSON.stringify(found) !== JSON.stringify(this.quicSrflxList)) {
|
|
@@ -104966,6 +104953,14 @@ var PeerLinkManager = class {
|
|
|
104966
104953
|
console.log(`[peer-link] srflx candidates: ${found.map((c) => `${c.ip}:${c.port}`).join(", ")}`);
|
|
104967
104954
|
}
|
|
104968
104955
|
};
|
|
104956
|
+
const onUnhandled = (reason) => {
|
|
104957
|
+
const m = reason instanceof Error ? reason.message : String(reason);
|
|
104958
|
+
if (!isSandboxFailure(m))
|
|
104959
|
+
return;
|
|
104960
|
+
process.off("unhandledRejection", onUnhandled);
|
|
104961
|
+
disableQuicTier(`the native binding rejects this runtime's ArrayBuffers (${m})`);
|
|
104962
|
+
};
|
|
104963
|
+
process.on("unhandledRejection", onUnhandled);
|
|
104969
104964
|
await refresh();
|
|
104970
104965
|
this.quicKeepalive = setInterval(() => {
|
|
104971
104966
|
void refresh();
|
|
@@ -105938,8 +105933,8 @@ function absOf(root, rel) {
|
|
|
105938
105933
|
|
|
105939
105934
|
// ../../packages/host-core/dist/active-link/gitignore.js
|
|
105940
105935
|
import { execFile as execFile7 } from "node:child_process";
|
|
105941
|
-
import { promisify as
|
|
105942
|
-
var execFileAsync2 =
|
|
105936
|
+
import { promisify as promisify4 } from "node:util";
|
|
105937
|
+
var execFileAsync2 = promisify4(execFile7);
|
|
105943
105938
|
async function gitSyncedFiles(root) {
|
|
105944
105939
|
try {
|
|
105945
105940
|
const { stdout } = await execFileAsync2("git", ["ls-files", "-z", "--cached", "--others", "--exclude-standard"], { cwd: root, maxBuffer: 128 * 1024 * 1024, windowsHide: true });
|
|
@@ -110532,23 +110527,7 @@ async function handleInboundAgent(msg, driverClientId) {
|
|
|
110532
110527
|
void b.backgroundTask?.(msg.sessionId, msg.toolUseId, origin);
|
|
110533
110528
|
break;
|
|
110534
110529
|
case "agent:set_mode":
|
|
110535
|
-
{
|
|
110536
|
-
const rejected = gatewayTierRejection(msg.model);
|
|
110537
|
-
if (rejected) {
|
|
110538
|
-
send3("agent", {
|
|
110539
|
-
type: "agent:notice",
|
|
110540
|
-
sessionId: msg.sessionId,
|
|
110541
|
-
noticeId: randomUUID28(),
|
|
110542
|
-
category: "model",
|
|
110543
|
-
level: "warning",
|
|
110544
|
-
title: "That model is not available on this device",
|
|
110545
|
-
body: `The gateway key on this machine serves ${rejected.tiers.join(", ")}, so "${rejected.model}" was not applied \u2014 the conversation is still on its previous model.`,
|
|
110546
|
-
toast: true,
|
|
110547
|
-
inline: true
|
|
110548
|
-
}, route3);
|
|
110549
|
-
}
|
|
110550
|
-
}
|
|
110551
|
-
void b.setRunMode?.(msg.sessionId, { permissionMode: msg.permissionMode, model: gatewayTierClamp(msg.model), maxThinkingTokens: msg.maxThinkingTokens, unattended: msg.unattended, reinforcedVerification: msg.reinforcedVerification, effort: msg.effort, ultracode: msg.ultracode });
|
|
110530
|
+
void b.setRunMode?.(msg.sessionId, { permissionMode: msg.permissionMode, model: msg.model, maxThinkingTokens: msg.maxThinkingTokens, unattended: msg.unattended, reinforcedVerification: msg.reinforcedVerification, effort: msg.effort, ultracode: msg.ultracode });
|
|
110552
110531
|
break;
|
|
110553
110532
|
case "chat:permission":
|
|
110554
110533
|
b.respondToPermission?.(msg.requestId, { behavior: msg.behavior, updatedInput: msg.updatedInput, persist: msg.persist, message: msg.message, interrupt: msg.interrupt }, origin);
|
|
@@ -111359,7 +111338,7 @@ init_base_paths();
|
|
|
111359
111338
|
init_credentials();
|
|
111360
111339
|
init_dist5();
|
|
111361
111340
|
import { mkdirSync as mkdirSync32, readFileSync as readFileSync42, writeFileSync as writeFileSync28 } from "node:fs";
|
|
111362
|
-
import { randomUUID as
|
|
111341
|
+
import { randomUUID as randomUUID28 } from "node:crypto";
|
|
111363
111342
|
import { dirname as dirname28 } from "node:path";
|
|
111364
111343
|
var REFRESH_MS = 24 * 60 * 60 * 1e3;
|
|
111365
111344
|
var TIMEOUT_MS2 = 1e4;
|
|
@@ -111375,7 +111354,7 @@ function deviceId2() {
|
|
|
111375
111354
|
return raw.deviceId;
|
|
111376
111355
|
} catch {
|
|
111377
111356
|
}
|
|
111378
|
-
const fresh =
|
|
111357
|
+
const fresh = randomUUID28().slice(0, 8);
|
|
111379
111358
|
try {
|
|
111380
111359
|
mkdirSync32(dirname28(DEVICE_ID()), { recursive: true });
|
|
111381
111360
|
writeFileSync28(DEVICE_ID(), JSON.stringify({ deviceId: fresh }), { mode: 384 });
|
|
@@ -113456,7 +113435,6 @@ function stopSystemEvents() {
|
|
|
113456
113435
|
}
|
|
113457
113436
|
|
|
113458
113437
|
// ../../packages/host-core/dist/local-server.js
|
|
113459
|
-
import { randomUUID as randomUUID31 } from "node:crypto";
|
|
113460
113438
|
init_daemon_settings();
|
|
113461
113439
|
|
|
113462
113440
|
// ../../packages/host-core/dist/vault/manager.js
|
|
@@ -114052,7 +114030,7 @@ var XJSON_AAD = utf8("tesseract-vault-encrypted-json-v1");
|
|
|
114052
114030
|
init_credentials();
|
|
114053
114031
|
|
|
114054
114032
|
// ../../packages/host-core/dist/vault/store.js
|
|
114055
|
-
import { randomUUID as
|
|
114033
|
+
import { randomUUID as randomUUID29 } from "node:crypto";
|
|
114056
114034
|
var b64 = (u) => Buffer.from(u).toString("base64");
|
|
114057
114035
|
var u82 = (s) => new Uint8Array(Buffer.from(s, "base64"));
|
|
114058
114036
|
var isServerRecoverableMeta = (m) => !m.wrappedVaultKey;
|
|
@@ -114354,7 +114332,7 @@ var VaultStore = class {
|
|
|
114354
114332
|
const existing = input.id ? items.get(input.id) : void 0;
|
|
114355
114333
|
const { id: _drop, name, folderId, favorite, reprompt, notes, tags, ...content } = input;
|
|
114356
114334
|
const item = {
|
|
114357
|
-
id: input.id ??
|
|
114335
|
+
id: input.id ?? randomUUID29(),
|
|
114358
114336
|
name,
|
|
114359
114337
|
folderId,
|
|
114360
114338
|
favorite,
|
|
@@ -114383,7 +114361,7 @@ var VaultStore = class {
|
|
|
114383
114361
|
const now2 = this.now();
|
|
114384
114362
|
for (const d of drafts) {
|
|
114385
114363
|
const { name, notes, favorite, tags, ...content } = d;
|
|
114386
|
-
const item = { id:
|
|
114364
|
+
const item = { id: randomUUID29(), name, notes, favorite, tags, createdAt: now2, updatedAt: now2, ...content };
|
|
114387
114365
|
items.set(item.id, item);
|
|
114388
114366
|
this.enc.set(item.id, await encryptItem(key2, item));
|
|
114389
114367
|
this.dirty.add(item.id);
|
|
@@ -115426,21 +115404,7 @@ async function startLocalServer(opts) {
|
|
|
115426
115404
|
void b.backgroundTask?.(msg.sessionId, msg.toolUseId, loopbackOrigin);
|
|
115427
115405
|
break;
|
|
115428
115406
|
case "agent:set_mode": {
|
|
115429
|
-
|
|
115430
|
-
if (rejected) {
|
|
115431
|
-
send5("agent", {
|
|
115432
|
-
type: "agent:notice",
|
|
115433
|
-
sessionId: msg.sessionId,
|
|
115434
|
-
noticeId: randomUUID31(),
|
|
115435
|
-
category: "model",
|
|
115436
|
-
level: "warning",
|
|
115437
|
-
title: "That model is not available on this device",
|
|
115438
|
-
body: `Your gateway key serves ${rejected.tiers.join(", ")}, so "${rejected.model}" was not applied \u2014 the conversation is still on its previous model.`,
|
|
115439
|
-
toast: true,
|
|
115440
|
-
inline: true
|
|
115441
|
-
});
|
|
115442
|
-
}
|
|
115443
|
-
void b.setRunMode?.(msg.sessionId, { permissionMode: msg.permissionMode, model: gatewayTierClamp(msg.model), maxThinkingTokens: msg.maxThinkingTokens, unattended: msg.unattended, reinforcedVerification: msg.reinforcedVerification, effort: msg.effort, ultracode: msg.ultracode });
|
|
115407
|
+
void b.setRunMode?.(msg.sessionId, { permissionMode: msg.permissionMode, model: msg.model, maxThinkingTokens: msg.maxThinkingTokens, unattended: msg.unattended, reinforcedVerification: msg.reinforcedVerification, effort: msg.effort, ultracode: msg.ultracode });
|
|
115444
115408
|
break;
|
|
115445
115409
|
}
|
|
115446
115410
|
case "chat:permission":
|
|
@@ -119391,8 +119355,8 @@ function decryptStream(source, keyRaw) {
|
|
|
119391
119355
|
// ../../packages/host-core/dist/drops/quarantine.js
|
|
119392
119356
|
import { execFile as execFile9 } from "node:child_process";
|
|
119393
119357
|
import { writeFile as writeFile15 } from "node:fs/promises";
|
|
119394
|
-
import { promisify as
|
|
119395
|
-
var exec =
|
|
119358
|
+
import { promisify as promisify5 } from "node:util";
|
|
119359
|
+
var exec = promisify5(execFile9);
|
|
119396
119360
|
async function markQuarantined(path6, sourceLabel) {
|
|
119397
119361
|
try {
|
|
119398
119362
|
if (process.platform === "darwin") {
|
|
@@ -119489,7 +119453,7 @@ async function fetchBlobDrop(opts) {
|
|
|
119489
119453
|
}
|
|
119490
119454
|
|
|
119491
119455
|
// ../../packages/host-core/dist/chat-agent.js
|
|
119492
|
-
import { randomUUID as
|
|
119456
|
+
import { randomUUID as randomUUID30 } from "node:crypto";
|
|
119493
119457
|
init_prompts();
|
|
119494
119458
|
var TURN_TIMEOUT_MS = 4 * 6e4;
|
|
119495
119459
|
var PARTIAL_INTERVAL_MS = 700;
|
|
@@ -119518,7 +119482,7 @@ function createChatAgentRunner(deps) {
|
|
|
119518
119482
|
}
|
|
119519
119483
|
async function runTurn(prompt2, onPartial) {
|
|
119520
119484
|
const backend2 = await getSharedBackend();
|
|
119521
|
-
const clientRequestId = `chat-agent-${
|
|
119485
|
+
const clientRequestId = `chat-agent-${randomUUID30()}`;
|
|
119522
119486
|
return new Promise((resolve16, reject) => {
|
|
119523
119487
|
let text13 = "";
|
|
119524
119488
|
let settled = false;
|
|
@@ -120809,11 +120773,11 @@ function fileShareToken() {
|
|
|
120809
120773
|
|
|
120810
120774
|
// ../../packages/host-core/dist/file-share-mount.js
|
|
120811
120775
|
import { execFile as execFile10 } from "node:child_process";
|
|
120812
|
-
import { promisify as
|
|
120776
|
+
import { promisify as promisify6 } from "node:util";
|
|
120813
120777
|
import { homedir as homedir13 } from "node:os";
|
|
120814
120778
|
import { existsSync as existsSync43, readFileSync as readFileSync56, appendFileSync as appendFileSync5, mkdirSync as mkdirSync42 } from "node:fs";
|
|
120815
120779
|
import { join as join84, dirname as dirname37 } from "node:path";
|
|
120816
|
-
var run3 =
|
|
120780
|
+
var run3 = promisify6(execFile10);
|
|
120817
120781
|
var OPTS = { timeout: 2e4, windowsHide: true };
|
|
120818
120782
|
var mounted = false;
|
|
120819
120783
|
var mountedAt = null;
|
|
@@ -120917,8 +120881,8 @@ import { join as join85 } from "node:path";
|
|
|
120917
120881
|
|
|
120918
120882
|
// ../../packages/host-core/dist/vault/peer-verify.js
|
|
120919
120883
|
import { execFile as execFile11 } from "node:child_process";
|
|
120920
|
-
import { promisify as
|
|
120921
|
-
var run4 =
|
|
120884
|
+
import { promisify as promisify7 } from "node:util";
|
|
120885
|
+
var run4 = promisify7(execFile11);
|
|
120922
120886
|
var APPEX_IDENTIFIER = "dev.tesseract.AutoFill";
|
|
120923
120887
|
async function teamIdOf(path6) {
|
|
120924
120888
|
try {
|
|
@@ -121544,7 +121508,7 @@ init_credentials();
|
|
|
121544
121508
|
init_base_paths();
|
|
121545
121509
|
import { existsSync as existsSync47, mkdirSync as mkdirSync46, readFileSync as readFileSync57, writeFileSync as writeFileSync43 } from "node:fs";
|
|
121546
121510
|
import { dirname as dirname39, join as join88 } from "node:path";
|
|
121547
|
-
import { randomUUID as
|
|
121511
|
+
import { randomUUID as randomUUID31 } from "node:crypto";
|
|
121548
121512
|
function deviceIdFile() {
|
|
121549
121513
|
return join88(tesseractHome(), "device-id.json");
|
|
121550
121514
|
}
|
|
@@ -121560,7 +121524,7 @@ function persistentDeviceId() {
|
|
|
121560
121524
|
const cur = readPersistedDeviceId();
|
|
121561
121525
|
if (cur)
|
|
121562
121526
|
return cur;
|
|
121563
|
-
const id =
|
|
121527
|
+
const id = randomUUID31().slice(0, 8);
|
|
121564
121528
|
try {
|
|
121565
121529
|
const f = deviceIdFile();
|
|
121566
121530
|
const dir2 = dirname39(f);
|
|
@@ -121575,7 +121539,7 @@ function persistentDeviceId() {
|
|
|
121575
121539
|
// ../../packages/host-core/dist/error-report.js
|
|
121576
121540
|
init_dist2();
|
|
121577
121541
|
init_credentials();
|
|
121578
|
-
import { randomUUID as
|
|
121542
|
+
import { randomUUID as randomUUID32 } from "node:crypto";
|
|
121579
121543
|
import { release as osRelease, arch as osArch } from "node:os";
|
|
121580
121544
|
var MAX_QUEUE = 100;
|
|
121581
121545
|
var FLUSH_INTERVAL_MS = 3e4;
|
|
@@ -121627,7 +121591,7 @@ function captureDaemonError(error51, opts = {}) {
|
|
|
121627
121591
|
return;
|
|
121628
121592
|
const creds3 = readCredentials();
|
|
121629
121593
|
const report = {
|
|
121630
|
-
reportId:
|
|
121594
|
+
reportId: randomUUID32(),
|
|
121631
121595
|
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
121632
121596
|
schemaVersion: 1,
|
|
121633
121597
|
surface,
|
|
@@ -123071,7 +123035,7 @@ init_credentials();
|
|
|
123071
123035
|
import { execFile as execFile16 } from "node:child_process";
|
|
123072
123036
|
import { existsSync as existsSync52, readFileSync as readFileSync61, statSync as statSync21 } from "node:fs";
|
|
123073
123037
|
import { dirname as dirname41, join as join93 } from "node:path";
|
|
123074
|
-
import { promisify as
|
|
123038
|
+
import { promisify as promisify12 } from "node:util";
|
|
123075
123039
|
|
|
123076
123040
|
// ../../packages/host-core/dist/net-service/launchd-system.js
|
|
123077
123041
|
import { spawn as spawn9 } from "node:child_process";
|
|
@@ -123103,8 +123067,8 @@ function parseOwnerUid(text13) {
|
|
|
123103
123067
|
|
|
123104
123068
|
// ../../packages/host-core/dist/net-service/elevation.js
|
|
123105
123069
|
import { execFile as execFile12 } from "node:child_process";
|
|
123106
|
-
import { promisify as
|
|
123107
|
-
var run5 =
|
|
123070
|
+
import { promisify as promisify8 } from "node:util";
|
|
123071
|
+
var run5 = promisify8(execFile12);
|
|
123108
123072
|
async function alreadyElevated() {
|
|
123109
123073
|
if (process.platform === "win32") {
|
|
123110
123074
|
try {
|
|
@@ -123344,8 +123308,8 @@ import { existsSync as existsSync51, readFileSync as readFileSync60 } from "node
|
|
|
123344
123308
|
|
|
123345
123309
|
// ../../packages/host-core/dist/service/exec.js
|
|
123346
123310
|
import { execFile as execFile13, spawn as spawn10 } from "node:child_process";
|
|
123347
|
-
import { promisify as
|
|
123348
|
-
var run6 =
|
|
123311
|
+
import { promisify as promisify9 } from "node:util";
|
|
123312
|
+
var run6 = promisify9(execFile13);
|
|
123349
123313
|
function runInherit(cmd, args) {
|
|
123350
123314
|
return new Promise((resolve16) => {
|
|
123351
123315
|
const p = spawn10(cmd, args, { stdio: "inherit" });
|
|
@@ -123547,8 +123511,8 @@ import { execFile as execFile14, spawn as spawn12 } from "node:child_process";
|
|
|
123547
123511
|
import { mkdtempSync as mkdtempSync3, writeFileSync as writeFileSync46, rmSync as rmSync12 } from "node:fs";
|
|
123548
123512
|
import { tmpdir as tmpdir7 } from "node:os";
|
|
123549
123513
|
import { join as join92, win32 } from "node:path";
|
|
123550
|
-
import { promisify as
|
|
123551
|
-
var run7 =
|
|
123514
|
+
import { promisify as promisify10 } from "node:util";
|
|
123515
|
+
var run7 = promisify10(execFile14);
|
|
123552
123516
|
var SERVICE = "TesseractNetd";
|
|
123553
123517
|
var DISPLAY = "Tesseract network helper";
|
|
123554
123518
|
function windowsHelperDir() {
|
|
@@ -123727,8 +123691,8 @@ function makeWindowsService() {
|
|
|
123727
123691
|
|
|
123728
123692
|
// ../../packages/host-core/dist/net-service/windows-nat.js
|
|
123729
123693
|
import { execFile as execFile15 } from "node:child_process";
|
|
123730
|
-
import { promisify as
|
|
123731
|
-
var run8 =
|
|
123694
|
+
import { promisify as promisify11 } from "node:util";
|
|
123695
|
+
var run8 = promisify11(execFile15);
|
|
123732
123696
|
var NAT_FEATURE = "Containers-HNS";
|
|
123733
123697
|
async function natCapability() {
|
|
123734
123698
|
if (process.platform !== "win32") {
|
|
@@ -123842,7 +123806,7 @@ async function ownerSid() {
|
|
|
123842
123806
|
if (process.platform !== "win32")
|
|
123843
123807
|
return void 0;
|
|
123844
123808
|
try {
|
|
123845
|
-
const { stdout } = await
|
|
123809
|
+
const { stdout } = await promisify12(execFile16)("whoami", ["/user", "/fo", "csv", "/nh"]);
|
|
123846
123810
|
const m = /"(S-1-[0-9-]+)"/.exec(String(stdout));
|
|
123847
123811
|
return m?.[1];
|
|
123848
123812
|
} catch {
|