@sentry/junior 0.166.0 → 0.167.0
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/{agent-hooks-ZIPK2HUF.js → agent-hooks-KEHBR4DB.js} +9 -9
- package/dist/api/schema/workspace.d.ts +14 -0
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +3 -1
- package/dist/api.js +51 -27
- package/dist/app.js +34 -35
- package/dist/{catalog-runtime-GEZAHBUP.js → catalog-runtime-7QFMBU2Q.js} +5 -5
- package/dist/{chunk-OCOGPNHA.js → chunk-2MPO25ZZ.js} +1 -1
- package/dist/{chunk-DTQAMME2.js → chunk-2RSPCWAV.js} +5 -5
- package/dist/{chunk-WX42YNDQ.js → chunk-4KRDL4ZD.js} +5 -5
- package/dist/{chunk-2KV4BAAN.js → chunk-5IR2ABRO.js} +12 -12
- package/dist/{chunk-Q2IPCX7J.js → chunk-5LZVDKQJ.js} +270 -7
- package/dist/{chunk-CDBTQQQ4.js → chunk-6SJN7JZ3.js} +1 -1
- package/dist/{chunk-C3USHSIJ.js → chunk-BGRLZPMI.js} +1 -1
- package/dist/{chunk-SLWGX3G5.js → chunk-CC4EYBUO.js} +35 -35
- package/dist/{chunk-U2UCDSDF.js → chunk-CU7YQNZ3.js} +4 -4
- package/dist/{chunk-P6UQMGM2.js → chunk-EWAG7BNE.js} +1 -1
- package/dist/{chunk-FFE3BMAT.js → chunk-GC3AKBNP.js} +7 -7
- package/dist/{chunk-YTIKGCPC.js → chunk-GIGUXRMY.js} +1 -1
- package/dist/{chunk-OYN45QUQ.js → chunk-HIB3XTKR.js} +6 -6
- package/dist/{chunk-2ZKFLHVP.js → chunk-IHSPBOWG.js} +6 -6
- package/dist/{chunk-ZKJO4K6M.js → chunk-KE5ETKIR.js} +4 -4
- package/dist/{chunk-22RO7IDD.js → chunk-KSQIE2R4.js} +4 -4
- package/dist/{chunk-VNPG55CU.js → chunk-L63FA77C.js} +1 -1
- package/dist/{chunk-AEKBVJMV.js → chunk-MKDIEH3C.js} +2 -2
- package/dist/{chunk-43KLUCAM.js → chunk-MV4LDMRG.js} +17 -17
- package/dist/{chunk-3EZ5V7XQ.js → chunk-O5J556I2.js} +9 -9
- package/dist/{chunk-JDTCQDRU.js → chunk-PMULUKHL.js} +3 -3
- package/dist/{chunk-FEYQVP64.js → chunk-PRV74X7E.js} +5 -5
- package/dist/{chunk-ABNRESX6.js → chunk-TZHLY42G.js} +1 -1
- package/dist/{chunk-BKP3PVKR.js → chunk-UFTE42ZF.js} +1 -1
- package/dist/{chunk-4CMORAHL.js → chunk-UTMP45YM.js} +11 -1
- package/dist/{chunk-JUFZR2LD.js → chunk-V7GGA4LW.js} +1 -1
- package/dist/{chunk-EKBVHDZO.js → chunk-W72TSO24.js} +1 -1
- package/dist/{chunk-LGSGPWYH.js → chunk-WD7PVGMA.js} +1 -1
- package/dist/{chunk-4MDEQNSW.js → chunk-WHMDWHZX.js} +5 -5
- package/dist/{chunk-MDW5YPXW.js → chunk-WRBQL2AW.js} +2 -2
- package/dist/{chunk-KQ5YZGDV.js → chunk-WZGOP5BZ.js} +1 -1
- package/dist/{chunk-65SNO3WK.js → chunk-YVW44V5Y.js} +1 -1
- package/dist/cli/chat.js +29 -30
- package/dist/cli/check.js +6 -6
- package/dist/cli/plugins.js +12 -12
- package/dist/cli/snapshot-create.js +10 -12
- package/dist/cli/upgrade.js +7 -7
- package/dist/{db-TGZBS2CP.js → db-H25MZO65.js} +7 -7
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-Z54WUF5H.js → oauth-callback-server-BX334MQ6.js} +22 -22
- package/dist/{runner-PVFHKKK6.js → runner-GRWCCCKP.js} +12 -12
- package/dist/{skills-BYRH3QWD.js → skills-TG76W7TS.js} +6 -6
- package/dist/spawn-4YBTXAR2.js +37 -0
- package/dist/{validation-VZIE4RHA.js → validation-JY6EXXR3.js} +6 -6
- package/dist/version.js +1 -1
- package/dist/{work-JTHAOPDQ.js → work-53J6P32F.js} +17 -17
- package/dist/worker-WLLGEEQS.js +24 -0
- package/package.json +4 -4
- package/dist/chunk-4DARCEZH.js +0 -274
- package/dist/spawn-RIPWK7EP.js +0 -37
- package/dist/worker-APEVP56Y.js +0 -24
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWebAuthorization,
|
|
3
3
|
deleteWebAuthorization
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2MPO25ZZ.js";
|
|
5
5
|
import {
|
|
6
6
|
appendAndEnqueueInboundMessage
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KE5ETKIR.js";
|
|
8
8
|
import {
|
|
9
9
|
buildDeliveredTurnStatePatch,
|
|
10
10
|
completeAuthPauseTurn,
|
|
@@ -12,20 +12,20 @@ import {
|
|
|
12
12
|
getTurnUserMessage,
|
|
13
13
|
processPluginTask,
|
|
14
14
|
scheduleSessionCompletedPluginTasks
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-O5J556I2.js";
|
|
16
16
|
import {
|
|
17
17
|
ConversationTurnLifecycleService,
|
|
18
18
|
coerceThreadConversationState,
|
|
19
19
|
getPersistedSandboxState,
|
|
20
20
|
getPersistedThreadState,
|
|
21
21
|
persistThreadStateById
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-2RSPCWAV.js";
|
|
23
23
|
import {
|
|
24
24
|
healthReportSchema
|
|
25
25
|
} from "./chunk-UTL3MHPC.js";
|
|
26
26
|
import {
|
|
27
27
|
parseSlackThreadId
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-TZHLY42G.js";
|
|
29
29
|
import {
|
|
30
30
|
TurnInputCommitLostError,
|
|
31
31
|
abandonTurnRecord,
|
|
@@ -49,31 +49,31 @@ import {
|
|
|
49
49
|
saveTurnCheckpoint,
|
|
50
50
|
startActiveTurn,
|
|
51
51
|
upsertConversationMessage
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-KSQIE2R4.js";
|
|
53
53
|
import {
|
|
54
54
|
normalizeSlackConversationId
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-4KRDL4ZD.js";
|
|
56
56
|
import {
|
|
57
57
|
getConversationEventStore,
|
|
58
58
|
getConversationStore,
|
|
59
59
|
getDb
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-PMULUKHL.js";
|
|
61
61
|
import {
|
|
62
62
|
juniorApiTokens,
|
|
63
63
|
juniorConversationParticipants,
|
|
64
64
|
juniorConversations,
|
|
65
65
|
juniorIdentities,
|
|
66
66
|
juniorUsers
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-YVW44V5Y.js";
|
|
68
68
|
import {
|
|
69
69
|
getSlackBotToken
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-MKDIEH3C.js";
|
|
71
71
|
import {
|
|
72
72
|
juniorDestinations
|
|
73
73
|
} from "./chunk-VFUK3X5B.js";
|
|
74
74
|
import {
|
|
75
75
|
canExposeConversationPayload
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-WZGOP5BZ.js";
|
|
77
77
|
import {
|
|
78
78
|
credentialContextForActor
|
|
79
79
|
} from "./chunk-BDUENQD3.js";
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
logWarn,
|
|
83
83
|
setTags,
|
|
84
84
|
withLogContext
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-V7GGA4LW.js";
|
|
86
86
|
|
|
87
87
|
// src/handlers/health.ts
|
|
88
88
|
function readHealthReport() {
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
create,
|
|
3
|
-
isStale
|
|
4
|
-
} from "./chunk-4DARCEZH.js";
|
|
5
1
|
import {
|
|
6
2
|
SANDBOX_WORKSPACE_ROOT,
|
|
7
3
|
runNonInteractiveCommand,
|
|
@@ -9,15 +5,18 @@ import {
|
|
|
9
5
|
} from "./chunk-BVREIWBD.js";
|
|
10
6
|
import {
|
|
11
7
|
getStateAdapter
|
|
12
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-W72TSO24.js";
|
|
13
9
|
import {
|
|
14
10
|
toOptionalTrimmed
|
|
15
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MKDIEH3C.js";
|
|
12
|
+
import {
|
|
13
|
+
pluginCatalogRuntime
|
|
14
|
+
} from "./chunk-L63FA77C.js";
|
|
16
15
|
import {
|
|
17
16
|
setSpanAttributes,
|
|
18
17
|
setSpanStatus,
|
|
19
18
|
withSpan
|
|
20
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-V7GGA4LW.js";
|
|
21
20
|
|
|
22
21
|
// src/chat/sandbox/resources.ts
|
|
23
22
|
var configuredResources;
|
|
@@ -51,6 +50,266 @@ function getSandboxResources() {
|
|
|
51
50
|
return configuredResources ?? resourcesFromEnv();
|
|
52
51
|
}
|
|
53
52
|
|
|
53
|
+
// src/chat/sandbox/snapshot/profile.ts
|
|
54
|
+
import { createHash } from "crypto";
|
|
55
|
+
|
|
56
|
+
// src/chat/sandbox/docker.ts
|
|
57
|
+
var DOCKER_DAEMON_JSON = `{
|
|
58
|
+
"storage-driver": "overlay2",
|
|
59
|
+
"live-restore": false
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
var DOCKER_ENSURE_SCRIPT = `#!/bin/sh
|
|
63
|
+
set -eu
|
|
64
|
+
|
|
65
|
+
if [ "$(id -u)" -ne 0 ]; then
|
|
66
|
+
exec sudo -n "$0" "$@"
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
SOCK=/var/run/docker.sock
|
|
70
|
+
PIDFILE=/var/run/docker.pid
|
|
71
|
+
LOG=/var/log/junior-dockerd.log
|
|
72
|
+
|
|
73
|
+
is_ready() {
|
|
74
|
+
[ -S "$SOCK" ] && /usr/bin/docker info >/dev/null 2>&1
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if is_ready; then
|
|
78
|
+
chmod 666 "$SOCK" 2>/dev/null || true
|
|
79
|
+
exit 0
|
|
80
|
+
fi
|
|
81
|
+
|
|
82
|
+
mkdir -p /etc/docker /var/lib/docker /var/run /var/log
|
|
83
|
+
if [ ! -f /etc/docker/daemon.json ]; then
|
|
84
|
+
cat > /etc/docker/daemon.json <<'EOF'
|
|
85
|
+
{
|
|
86
|
+
"storage-driver": "overlay2",
|
|
87
|
+
"live-restore": false
|
|
88
|
+
}
|
|
89
|
+
EOF
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
if [ -f "$PIDFILE" ]; then
|
|
93
|
+
oldpid="$(cat "$PIDFILE" 2>/dev/null || true)"
|
|
94
|
+
if [ -n "\${oldpid:-}" ] && ! kill -0 "$oldpid" 2>/dev/null; then
|
|
95
|
+
rm -f "$PIDFILE"
|
|
96
|
+
fi
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
if [ ! -f "$PIDFILE" ] || ! kill -0 "$(cat "$PIDFILE" 2>/dev/null)" 2>/dev/null; then
|
|
100
|
+
# dockerd must outlive this helper; nohup + background is intentional.
|
|
101
|
+
nohup dockerd --host="unix://$SOCK" --pidfile="$PIDFILE" >"$LOG" 2>&1 &
|
|
102
|
+
fi
|
|
103
|
+
|
|
104
|
+
i=0
|
|
105
|
+
while [ "$i" -lt 50 ]; do
|
|
106
|
+
if is_ready; then
|
|
107
|
+
chmod 666 "$SOCK" 2>/dev/null || true
|
|
108
|
+
exit 0
|
|
109
|
+
fi
|
|
110
|
+
i=$((i + 1))
|
|
111
|
+
sleep 0.1
|
|
112
|
+
done
|
|
113
|
+
|
|
114
|
+
echo "junior-ensure-docker: dockerd failed to become ready" >&2
|
|
115
|
+
if [ -f "$LOG" ]; then
|
|
116
|
+
tail -n 50 "$LOG" >&2 || true
|
|
117
|
+
fi
|
|
118
|
+
exit 1
|
|
119
|
+
`;
|
|
120
|
+
var DOCKER_CLI_WRAPPER_SCRIPT = `#!/bin/sh
|
|
121
|
+
set -eu
|
|
122
|
+
if command -v junior-ensure-docker >/dev/null 2>&1; then
|
|
123
|
+
junior-ensure-docker
|
|
124
|
+
fi
|
|
125
|
+
exec /usr/bin/docker "$@"
|
|
126
|
+
`;
|
|
127
|
+
var DOCKER_COMPOSE_CLI_WRAPPER_SCRIPT = `#!/bin/sh
|
|
128
|
+
set -eu
|
|
129
|
+
if command -v junior-ensure-docker >/dev/null 2>&1; then
|
|
130
|
+
junior-ensure-docker
|
|
131
|
+
fi
|
|
132
|
+
exec /usr/local/libexec/junior-docker-compose "$@"
|
|
133
|
+
`;
|
|
134
|
+
async function ensureDockerDaemon(sandbox, signal) {
|
|
135
|
+
await runNonInteractiveCommand(sandbox, {
|
|
136
|
+
cmd: "sh",
|
|
137
|
+
args: [
|
|
138
|
+
"-c",
|
|
139
|
+
"command -v junior-ensure-docker >/dev/null 2>&1 && junior-ensure-docker || true"
|
|
140
|
+
],
|
|
141
|
+
signal
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// src/chat/sandbox/runtime-dependencies.ts
|
|
146
|
+
var GLOBAL_RUNTIME_DEPENDENCIES = [
|
|
147
|
+
{ type: "system", package: "docker" },
|
|
148
|
+
{ type: "system", package: "spal-release" },
|
|
149
|
+
{ type: "system", package: "ripgrep" }
|
|
150
|
+
];
|
|
151
|
+
function writeFileCommand(path, contents, mode = "0644") {
|
|
152
|
+
const payload = Buffer.from(contents, "utf8").toString("base64");
|
|
153
|
+
return [
|
|
154
|
+
`printf '%s' '${payload}' | base64 -d > ${path}`,
|
|
155
|
+
`chmod ${mode} ${path}`
|
|
156
|
+
].join("\n");
|
|
157
|
+
}
|
|
158
|
+
function writeExecutableCommand(path, contents) {
|
|
159
|
+
return writeFileCommand(path, contents, "0755");
|
|
160
|
+
}
|
|
161
|
+
var GLOBAL_RUNTIME_POSTINSTALL = [
|
|
162
|
+
{
|
|
163
|
+
cmd: "sh",
|
|
164
|
+
args: [
|
|
165
|
+
"-c",
|
|
166
|
+
[
|
|
167
|
+
"set -eu",
|
|
168
|
+
'case "$(uname -m)" in',
|
|
169
|
+
' x86_64) asset="x86_64"; sha256="7af95166a730b87e172d4fc9aefea8725d3c6c7327d59149267b452114ddb7d4" ;;',
|
|
170
|
+
' aarch64) asset="aarch64"; sha256="49082844b87f03cdcd5f5bbef1ba8c9c897b7a2dfb80cea18d61ec8ca6117e0c" ;;',
|
|
171
|
+
' *) echo "unsupported Docker Compose architecture: $(uname -m)" >&2; exit 1 ;;',
|
|
172
|
+
"esac",
|
|
173
|
+
'tmp="$(mktemp)"',
|
|
174
|
+
`trap 'rm -f "$tmp"' EXIT`,
|
|
175
|
+
'curl --fail --location --silent --show-error "https://github.com/docker/compose/releases/download/v2.39.4/docker-compose-linux-${asset}" --output "$tmp"',
|
|
176
|
+
'echo "${sha256} ${tmp}" | sha256sum --check --status',
|
|
177
|
+
// Keep the real Compose binary off PATH; the wrapper below starts dockerd.
|
|
178
|
+
'install -D -m 0755 "$tmp" /usr/local/libexec/junior-docker-compose',
|
|
179
|
+
"mkdir -p /usr/local/lib/docker/cli-plugins /usr/local/libexec /etc/docker /usr/local/bin",
|
|
180
|
+
`mkdir -p ${SANDBOX_WORKSPACE_ROOT}/.junior/bin`,
|
|
181
|
+
writeFileCommand("/etc/docker/daemon.json", DOCKER_DAEMON_JSON),
|
|
182
|
+
writeExecutableCommand(
|
|
183
|
+
"/usr/local/bin/junior-ensure-docker",
|
|
184
|
+
DOCKER_ENSURE_SCRIPT
|
|
185
|
+
),
|
|
186
|
+
// docker compose plugin delegates to the real Compose binary.
|
|
187
|
+
"ln -sfn /usr/local/libexec/junior-docker-compose /usr/local/lib/docker/cli-plugins/docker-compose",
|
|
188
|
+
// PATH wrappers auto-start dockerd for both CLI entrypoints.
|
|
189
|
+
writeExecutableCommand(
|
|
190
|
+
"/usr/local/bin/docker-compose",
|
|
191
|
+
DOCKER_COMPOSE_CLI_WRAPPER_SCRIPT
|
|
192
|
+
),
|
|
193
|
+
writeExecutableCommand(
|
|
194
|
+
`${SANDBOX_WORKSPACE_ROOT}/.junior/bin/docker`,
|
|
195
|
+
DOCKER_CLI_WRAPPER_SCRIPT
|
|
196
|
+
),
|
|
197
|
+
writeExecutableCommand(
|
|
198
|
+
`${SANDBOX_WORKSPACE_ROOT}/.junior/bin/docker-compose`,
|
|
199
|
+
DOCKER_COMPOSE_CLI_WRAPPER_SCRIPT
|
|
200
|
+
),
|
|
201
|
+
// Prefer the wrapper over /usr/bin/docker for non-login shells too.
|
|
202
|
+
writeExecutableCommand(
|
|
203
|
+
"/usr/local/bin/docker",
|
|
204
|
+
DOCKER_CLI_WRAPPER_SCRIPT
|
|
205
|
+
)
|
|
206
|
+
].join("\n")
|
|
207
|
+
],
|
|
208
|
+
sudo: true
|
|
209
|
+
}
|
|
210
|
+
];
|
|
211
|
+
|
|
212
|
+
// src/chat/sandbox/snapshot/profile.ts
|
|
213
|
+
var VERSION = 1;
|
|
214
|
+
var DEFAULT_FLOATING_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
215
|
+
function isExactNpmVersion(version) {
|
|
216
|
+
return /^\d+\.\d+\.\d+(?:[-+][a-z0-9.]+)?$/i.test(version.trim());
|
|
217
|
+
}
|
|
218
|
+
function isFloating(dep) {
|
|
219
|
+
return dep.type === "npm" && !isExactNpmVersion(dep.version);
|
|
220
|
+
}
|
|
221
|
+
function mergeDependencies(dependencies2) {
|
|
222
|
+
const seen = /* @__PURE__ */ new Set();
|
|
223
|
+
const npmVersions = /* @__PURE__ */ new Map();
|
|
224
|
+
const merged = [];
|
|
225
|
+
for (const dependency of dependencies2) {
|
|
226
|
+
const key = dependency.type === "npm" ? `${dependency.type}:${dependency.package}:${dependency.version}` : "package" in dependency ? `${dependency.type}:package:${dependency.package}` : `${dependency.type}:url:${dependency.url}:${dependency.sha256}`;
|
|
227
|
+
if (seen.has(key)) {
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
seen.add(key);
|
|
231
|
+
if (dependency.type === "npm") {
|
|
232
|
+
const version = npmVersions.get(dependency.package);
|
|
233
|
+
if (version !== void 0 && version !== dependency.version) {
|
|
234
|
+
throw new Error(
|
|
235
|
+
`Conflicting runtime dependency versions for ${dependency.package}: ${version} and ${dependency.version}`
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
npmVersions.set(dependency.package, dependency.version);
|
|
239
|
+
}
|
|
240
|
+
merged.push(dependency);
|
|
241
|
+
}
|
|
242
|
+
return merged;
|
|
243
|
+
}
|
|
244
|
+
function floatingMaxAgeMs() {
|
|
245
|
+
const raw = process.env.SANDBOX_SNAPSHOT_FLOATING_MAX_AGE_MS;
|
|
246
|
+
if (!raw?.trim()) {
|
|
247
|
+
return DEFAULT_FLOATING_MAX_AGE_MS;
|
|
248
|
+
}
|
|
249
|
+
const parsed = Number.parseInt(raw, 10);
|
|
250
|
+
return Number.isFinite(parsed) && parsed >= 0 ? parsed : DEFAULT_FLOATING_MAX_AGE_MS;
|
|
251
|
+
}
|
|
252
|
+
function compareCodePoints(left, right) {
|
|
253
|
+
if (left < right) return -1;
|
|
254
|
+
if (left > right) return 1;
|
|
255
|
+
return 0;
|
|
256
|
+
}
|
|
257
|
+
function workspaceRecipe(workspace) {
|
|
258
|
+
const repos = [...workspace.repos].map(({ provider, repo }) => ({
|
|
259
|
+
provider,
|
|
260
|
+
repo
|
|
261
|
+
})).sort((left, right) => {
|
|
262
|
+
const provider = compareCodePoints(left.provider, right.provider);
|
|
263
|
+
if (provider !== 0) return provider;
|
|
264
|
+
return compareCodePoints(left.repo, right.repo);
|
|
265
|
+
});
|
|
266
|
+
return {
|
|
267
|
+
id: workspace.id,
|
|
268
|
+
repos,
|
|
269
|
+
setupScript: workspace.setupScript
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
function create(runtime, workspace) {
|
|
273
|
+
const dependencies2 = mergeDependencies([
|
|
274
|
+
...GLOBAL_RUNTIME_DEPENDENCIES,
|
|
275
|
+
...pluginCatalogRuntime.getRuntimeDependencies()
|
|
276
|
+
]);
|
|
277
|
+
const pluginPostinstall = pluginCatalogRuntime.getRuntimePostinstall();
|
|
278
|
+
const postinstall2 = [...GLOBAL_RUNTIME_POSTINSTALL, ...pluginPostinstall];
|
|
279
|
+
if (dependencies2.length === 0 && postinstall2.length === 0 && !workspace) {
|
|
280
|
+
return null;
|
|
281
|
+
}
|
|
282
|
+
const rebuildEpoch = process.env.SANDBOX_SNAPSHOT_REBUILD_EPOCH?.trim() ?? "";
|
|
283
|
+
const floating = dependencies2.some((dependency) => isFloating(dependency)) || pluginPostinstall.length > 0 || Boolean(workspace);
|
|
284
|
+
const hash2 = createHash("sha256").update(
|
|
285
|
+
JSON.stringify({
|
|
286
|
+
version: VERSION,
|
|
287
|
+
runtime,
|
|
288
|
+
rebuildEpoch,
|
|
289
|
+
dependencies: dependencies2,
|
|
290
|
+
postinstall: postinstall2,
|
|
291
|
+
...workspace ? { workspace: workspaceRecipe(workspace) } : {}
|
|
292
|
+
})
|
|
293
|
+
).digest("hex");
|
|
294
|
+
return {
|
|
295
|
+
hash: hash2,
|
|
296
|
+
dependencyCount: dependencies2.length,
|
|
297
|
+
floating,
|
|
298
|
+
dependencies: dependencies2,
|
|
299
|
+
postinstall: postinstall2
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
function hash(runtime, workspace) {
|
|
303
|
+
return create(runtime, workspace)?.hash;
|
|
304
|
+
}
|
|
305
|
+
function isStale(profile, createdAtMs) {
|
|
306
|
+
if (!profile.floating) {
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
309
|
+
const maxAgeMs = floatingMaxAgeMs();
|
|
310
|
+
return maxAgeMs === 0 || Date.now() - createdAtMs > maxAgeMs;
|
|
311
|
+
}
|
|
312
|
+
|
|
54
313
|
// src/chat/sandbox/snapshot/resolve.ts
|
|
55
314
|
import { Sandbox } from "@vercel/sandbox";
|
|
56
315
|
import { z } from "zod";
|
|
@@ -927,12 +1186,16 @@ export {
|
|
|
927
1186
|
wrapSandboxSetupError,
|
|
928
1187
|
throwSandboxOperationError,
|
|
929
1188
|
getVercelSandboxCredentials,
|
|
1189
|
+
ensureDockerDaemon,
|
|
930
1190
|
getSandboxResourceConfig,
|
|
931
1191
|
setSandboxResourceConfig,
|
|
932
1192
|
getSandboxResources,
|
|
1193
|
+
create,
|
|
1194
|
+
hash,
|
|
933
1195
|
bindSandboxFileSystem,
|
|
934
1196
|
createSandboxSession,
|
|
935
1197
|
stopSession,
|
|
1198
|
+
getCachedSnapshot,
|
|
936
1199
|
resolve,
|
|
937
1200
|
isMissingError
|
|
938
1201
|
};
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
PluginCredentialFailureError,
|
|
8
8
|
agentNameSchema,
|
|
9
9
|
createPluginAuthOrchestration
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PRV74X7E.js";
|
|
11
11
|
import {
|
|
12
12
|
authorizationId
|
|
13
13
|
} from "./chunk-DIB4GX3G.js";
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
searchSlackUsers,
|
|
33
33
|
selectPluginGrant,
|
|
34
34
|
toMcpProviderError
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-GC3AKBNP.js";
|
|
36
36
|
import {
|
|
37
37
|
RetryableDeliveryError,
|
|
38
38
|
actorFromRun,
|
|
@@ -48,29 +48,13 @@ import {
|
|
|
48
48
|
getSlackMessagePermalink,
|
|
49
49
|
resolveBaseUrl,
|
|
50
50
|
uploadFilesToConversation
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-HIB3XTKR.js";
|
|
52
52
|
import {
|
|
53
53
|
parseSandboxEgressAuthRequiredSignal,
|
|
54
54
|
parseSandboxEgressPermissionDeniedSignal,
|
|
55
55
|
sandboxEgressCredentialContextSchema,
|
|
56
56
|
sandboxEgressCredentialLeaseSchema
|
|
57
57
|
} from "./chunk-7MA4HV4W.js";
|
|
58
|
-
import {
|
|
59
|
-
bindSandboxFileSystem,
|
|
60
|
-
createSandboxSession,
|
|
61
|
-
getSandboxResources,
|
|
62
|
-
getVercelSandboxCredentials,
|
|
63
|
-
isAlreadyExistsError,
|
|
64
|
-
isMissingError,
|
|
65
|
-
isSandboxCommandStreamInterruptedError,
|
|
66
|
-
isSandboxMissingError,
|
|
67
|
-
isSandboxUnavailableError,
|
|
68
|
-
isSnapshottingError,
|
|
69
|
-
resolve,
|
|
70
|
-
stopSession,
|
|
71
|
-
throwSandboxOperationError,
|
|
72
|
-
wrapSandboxSetupError
|
|
73
|
-
} from "./chunk-Q2IPCX7J.js";
|
|
74
58
|
import {
|
|
75
59
|
SANDBOX_RUNTIME,
|
|
76
60
|
SCHEDULED_TASK_SYSTEM_ACTOR,
|
|
@@ -104,10 +88,10 @@ import {
|
|
|
104
88
|
scheduledTaskAttributes,
|
|
105
89
|
storeAttachments,
|
|
106
90
|
writableEventTask
|
|
107
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-WHMDWHZX.js";
|
|
108
92
|
import {
|
|
109
93
|
parseSlackThreadId
|
|
110
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-TZHLY42G.js";
|
|
111
95
|
import {
|
|
112
96
|
AGENTS_REMOVAL_NOTICE,
|
|
113
97
|
AGENTS_REPLACEMENT_NOTICE,
|
|
@@ -178,14 +162,28 @@ import {
|
|
|
178
162
|
stripRuntimeTurnContext,
|
|
179
163
|
trimTrailingAssistantMessages,
|
|
180
164
|
truncateText
|
|
181
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-KSQIE2R4.js";
|
|
182
166
|
import {
|
|
183
167
|
JUNIOR_THREAD_STATE_TTL_MS
|
|
184
168
|
} from "./chunk-3Y47VMHV.js";
|
|
185
169
|
import {
|
|
170
|
+
bindSandboxFileSystem,
|
|
171
|
+
createSandboxSession,
|
|
186
172
|
ensureDockerDaemon,
|
|
187
|
-
|
|
188
|
-
|
|
173
|
+
getSandboxResources,
|
|
174
|
+
getVercelSandboxCredentials,
|
|
175
|
+
hash,
|
|
176
|
+
isAlreadyExistsError,
|
|
177
|
+
isMissingError,
|
|
178
|
+
isSandboxCommandStreamInterruptedError,
|
|
179
|
+
isSandboxMissingError,
|
|
180
|
+
isSandboxUnavailableError,
|
|
181
|
+
isSnapshottingError,
|
|
182
|
+
resolve,
|
|
183
|
+
stopSession,
|
|
184
|
+
throwSandboxOperationError,
|
|
185
|
+
wrapSandboxSetupError
|
|
186
|
+
} from "./chunk-5LZVDKQJ.js";
|
|
189
187
|
import {
|
|
190
188
|
privateTraceResultAttributes
|
|
191
189
|
} from "./chunk-UIE3R5XU.js";
|
|
@@ -211,7 +209,7 @@ import {
|
|
|
211
209
|
tryWorkspaceRepoCheckoutPath,
|
|
212
210
|
withSlackRetries,
|
|
213
211
|
workspaceRepoCheckoutPath
|
|
214
|
-
} from "./chunk-
|
|
212
|
+
} from "./chunk-4KRDL4ZD.js";
|
|
215
213
|
import {
|
|
216
214
|
KNOWN_CONVERSATION_EVENT_TYPES,
|
|
217
215
|
contextProvenance,
|
|
@@ -223,11 +221,11 @@ import {
|
|
|
223
221
|
instructionActors,
|
|
224
222
|
instructionProvenanceFor,
|
|
225
223
|
sameActorIdentity
|
|
226
|
-
} from "./chunk-
|
|
224
|
+
} from "./chunk-PMULUKHL.js";
|
|
227
225
|
import {
|
|
228
226
|
juniorArtifacts,
|
|
229
227
|
juniorIdentities
|
|
230
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-YVW44V5Y.js";
|
|
231
229
|
import {
|
|
232
230
|
SANDBOX_DATA_ROOT,
|
|
233
231
|
SANDBOX_REPOS_ROOT,
|
|
@@ -243,7 +241,7 @@ import {
|
|
|
243
241
|
} from "./chunk-BVREIWBD.js";
|
|
244
242
|
import {
|
|
245
243
|
getStateAdapter
|
|
246
|
-
} from "./chunk-
|
|
244
|
+
} from "./chunk-W72TSO24.js";
|
|
247
245
|
import {
|
|
248
246
|
ACTIVE_TURN_COMPACTION_SUMMARY_PREFIX,
|
|
249
247
|
COMPACTION_SUMMARY_PREFIX,
|
|
@@ -276,7 +274,7 @@ import {
|
|
|
276
274
|
resolveGatewayCredential,
|
|
277
275
|
resolveGatewayModel,
|
|
278
276
|
unwrapCurrentInstruction
|
|
279
|
-
} from "./chunk-
|
|
277
|
+
} from "./chunk-MKDIEH3C.js";
|
|
280
278
|
import {
|
|
281
279
|
canExposeConversationPayload,
|
|
282
280
|
resolveConversationPrivacy,
|
|
@@ -286,16 +284,16 @@ import {
|
|
|
286
284
|
toGenAiMessagesTraceAttributes,
|
|
287
285
|
toGenAiPayloadMetadata,
|
|
288
286
|
toGenAiPayloadTraceAttributes
|
|
289
|
-
} from "./chunk-
|
|
287
|
+
} from "./chunk-WZGOP5BZ.js";
|
|
290
288
|
import {
|
|
291
289
|
discoverSkills,
|
|
292
290
|
findSkillByName,
|
|
293
291
|
loadSkillsByName,
|
|
294
292
|
parseSkillInvocation
|
|
295
|
-
} from "./chunk-
|
|
293
|
+
} from "./chunk-WRBQL2AW.js";
|
|
296
294
|
import {
|
|
297
295
|
pluginCatalogRuntime
|
|
298
|
-
} from "./chunk-
|
|
296
|
+
} from "./chunk-L63FA77C.js";
|
|
299
297
|
import {
|
|
300
298
|
CredentialUnavailableError,
|
|
301
299
|
OAuthProviderError,
|
|
@@ -303,7 +301,7 @@ import {
|
|
|
303
301
|
getOAuthProviderErrorAttributes,
|
|
304
302
|
resolveAuthTokenPlaceholder,
|
|
305
303
|
resolvePluginCommandEnv
|
|
306
|
-
} from "./chunk-
|
|
304
|
+
} from "./chunk-EWAG7BNE.js";
|
|
307
305
|
import {
|
|
308
306
|
credentialUserSubjectId
|
|
309
307
|
} from "./chunk-BDUENQD3.js";
|
|
@@ -331,7 +329,7 @@ import {
|
|
|
331
329
|
summarizeMessageText,
|
|
332
330
|
withLogContext,
|
|
333
331
|
withSpan
|
|
334
|
-
} from "./chunk-
|
|
332
|
+
} from "./chunk-V7GGA4LW.js";
|
|
335
333
|
import {
|
|
336
334
|
startInactiveSpan,
|
|
337
335
|
withActiveSpan
|
|
@@ -13688,12 +13686,14 @@ var repoSchema = z63.object({
|
|
|
13688
13686
|
var workspaceSchema = z63.object({
|
|
13689
13687
|
id: z63.string(),
|
|
13690
13688
|
name: z63.string(),
|
|
13689
|
+
setup_script: z63.string(),
|
|
13691
13690
|
repos: z63.array(repoSchema)
|
|
13692
13691
|
});
|
|
13693
13692
|
function view(workspace) {
|
|
13694
13693
|
return {
|
|
13695
13694
|
id: workspace.id,
|
|
13696
13695
|
name: workspace.name,
|
|
13696
|
+
setup_script: workspace.setupScript,
|
|
13697
13697
|
repos: workspace.repos.map((repo) => ({
|
|
13698
13698
|
provider: repo.provider,
|
|
13699
13699
|
repo: repo.repo,
|
|
@@ -13711,7 +13711,7 @@ function createWorkspaceTools(context) {
|
|
|
13711
13711
|
openWorldHint: false,
|
|
13712
13712
|
readOnlyHint: true
|
|
13713
13713
|
},
|
|
13714
|
-
description: "List named repository workspaces that can replace the current sandbox.",
|
|
13714
|
+
description: "List named repository workspaces that can replace the current sandbox. Manage install-wide Workspace recipes from the authenticated dashboard or `/api/workspaces`.",
|
|
13715
13715
|
inputSchema: z63.object({}).strict(),
|
|
13716
13716
|
outputSchema: juniorToolOutputSchema.extend({
|
|
13717
13717
|
active_workspace_id: z63.string().nullable(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTurnRequestDeadline
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6SJN7JZ3.js";
|
|
4
4
|
import {
|
|
5
5
|
CONVERSATION_WORK_CHECK_IN_INTERVAL_MS,
|
|
6
6
|
CONVERSATION_WORK_MAX_RETRIES,
|
|
@@ -21,20 +21,20 @@ import {
|
|
|
21
21
|
releaseConversationWork,
|
|
22
22
|
requestAnotherSlice,
|
|
23
23
|
startConversationWork
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-KE5ETKIR.js";
|
|
25
25
|
import {
|
|
26
26
|
ConversationQueueMessageRejectedError
|
|
27
27
|
} from "./chunk-JAL3CH4G.js";
|
|
28
28
|
import {
|
|
29
29
|
getChatConfig,
|
|
30
30
|
isProviderRetryError
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-MKDIEH3C.js";
|
|
32
32
|
import {
|
|
33
33
|
logException,
|
|
34
34
|
logInfo,
|
|
35
35
|
logWarn,
|
|
36
36
|
withLogContext
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-V7GGA4LW.js";
|
|
38
38
|
|
|
39
39
|
// src/chat/task-execution/worker.ts
|
|
40
40
|
var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-RF6J3DIO.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveBaseUrl
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HIB3XTKR.js";
|
|
7
7
|
import {
|
|
8
8
|
isExperimentalFeatureEnabled
|
|
9
9
|
} from "./chunk-VRS6WDK5.js";
|
|
@@ -12,27 +12,27 @@ import {
|
|
|
12
12
|
getPlugins,
|
|
13
13
|
getSlackClient,
|
|
14
14
|
withSlackRetries
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4KRDL4ZD.js";
|
|
16
16
|
import {
|
|
17
17
|
getDb,
|
|
18
18
|
parseDestination
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-PMULUKHL.js";
|
|
20
20
|
import {
|
|
21
21
|
sleep
|
|
22
22
|
} from "./chunk-BVREIWBD.js";
|
|
23
23
|
import {
|
|
24
24
|
acquireActiveLock,
|
|
25
25
|
getStateAdapter
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-W72TSO24.js";
|
|
27
27
|
import {
|
|
28
28
|
pluginCatalogRuntime
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-L63FA77C.js";
|
|
30
30
|
import {
|
|
31
31
|
fetchWithBoundedOAuthErrorBodies
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-EWAG7BNE.js";
|
|
33
33
|
import {
|
|
34
34
|
isRecord
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-V7GGA4LW.js";
|
|
36
36
|
|
|
37
37
|
// src/chat/capabilities/router.ts
|
|
38
38
|
var ProviderCredentialRouter = class {
|