blun-king-cli 9.1.622 → 9.1.623
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/CHANGELOG.md +4 -0
- package/LIESMICH.txt +1 -1
- package/README.md +1 -1
- package/blun.mjs +2827 -973
- package/package.json +1 -1
- package/worker-host.mjs +483 -483
package/worker-host.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// BLUN_BUILD_INPUT_SHA256:
|
|
2
|
+
// BLUN_BUILD_INPUT_SHA256:52a3c121d3165f9366bef14c0c17d1ee081bdf7d7b033d8e2e05747961576125
|
|
3
3
|
import { fileURLToPath as __cjsShimFileURLToPath } from 'node:url';
|
|
4
4
|
import { dirname as __cjsShimDirname } from 'node:path';
|
|
5
5
|
const __filename = __cjsShimFileURLToPath(import.meta.url);
|
|
@@ -520,7 +520,7 @@ const mix$1 = (del = delimiter) => {
|
|
|
520
520
|
const posix$2 = /* @__PURE__ */ mix$1(":");
|
|
521
521
|
const win32$1 = /* @__PURE__ */ mix$1(";");
|
|
522
522
|
//#endregion
|
|
523
|
-
//#region
|
|
523
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/errors/codes.ts
|
|
524
524
|
/**
|
|
525
525
|
* Error codes for Blun Core's public error protocol.
|
|
526
526
|
*
|
|
@@ -1047,7 +1047,7 @@ const BLUN_ERROR_INFO = {
|
|
|
1047
1047
|
}
|
|
1048
1048
|
};
|
|
1049
1049
|
//#endregion
|
|
1050
|
-
//#region
|
|
1050
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/errors/classes.ts
|
|
1051
1051
|
/**
|
|
1052
1052
|
* The single Blun error class.
|
|
1053
1053
|
*
|
|
@@ -1067,7 +1067,7 @@ var BlunError = class extends Error {
|
|
|
1067
1067
|
}
|
|
1068
1068
|
};
|
|
1069
1069
|
//#endregion
|
|
1070
|
-
//#region
|
|
1070
|
+
//#region ../../../../hm623s/r/packages/kosong/src/message.ts
|
|
1071
1071
|
/** Check if a streamed part is a ContentPart (text, think, image_url, audio_url, video_url). */
|
|
1072
1072
|
function isContentPart(part) {
|
|
1073
1073
|
const t = part.type;
|
|
@@ -1149,7 +1149,7 @@ function createToolMessage(toolCallId, output) {
|
|
|
1149
1149
|
};
|
|
1150
1150
|
}
|
|
1151
1151
|
//#endregion
|
|
1152
|
-
//#region
|
|
1152
|
+
//#region ../../../../hm623s/r/packages/kosong/src/capability.ts
|
|
1153
1153
|
const UNKNOWN_CAPABILITY_MARKER = Symbol.for("blun-ai.kosong.UNKNOWN_CAPABILITY");
|
|
1154
1154
|
/**
|
|
1155
1155
|
* Shared read-only default returned when a provider has not catalogued a
|
|
@@ -1170,7 +1170,7 @@ function isUnknownCapability(capability) {
|
|
|
1170
1170
|
return !capability.image_in && !capability.video_in && !capability.audio_in && !capability.thinking && !capability.tool_use && capability.max_context_tokens === 0;
|
|
1171
1171
|
}
|
|
1172
1172
|
//#endregion
|
|
1173
|
-
//#region
|
|
1173
|
+
//#region ../../../../hm623s/r/packages/kosong/src/providers/blun-schema.ts
|
|
1174
1174
|
/**
|
|
1175
1175
|
* Dereference all `$ref` references in a JSON Schema by inlining definitions
|
|
1176
1176
|
* from local JSON pointers such as `$defs` and draft-7 `definitions`. Resolved
|
|
@@ -1553,7 +1553,7 @@ function hasOwn$1(obj, key) {
|
|
|
1553
1553
|
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
1554
1554
|
}
|
|
1555
1555
|
//#endregion
|
|
1556
|
-
//#region
|
|
1556
|
+
//#region ../../../../hm623s/r/packages/kosong/src/errors.ts
|
|
1557
1557
|
/**
|
|
1558
1558
|
* Base error for all chat provider errors.
|
|
1559
1559
|
*/
|
|
@@ -1829,7 +1829,7 @@ function errorMessage$5(error) {
|
|
|
1829
1829
|
return error instanceof Error ? error.message : String(error);
|
|
1830
1830
|
}
|
|
1831
1831
|
//#endregion
|
|
1832
|
-
//#region
|
|
1832
|
+
//#region ../../../../hm623s/r/packages/kosong/src/providers/fetch-http-client.ts
|
|
1833
1833
|
const DEFAULT_MAX_RETRIES = 2;
|
|
1834
1834
|
const MAX_RETRY_TIMER_MS$1 = 2147483647;
|
|
1835
1835
|
function createFetchHttpClient(options) {
|
|
@@ -2194,7 +2194,7 @@ function getString(value) {
|
|
|
2194
2194
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
2195
2195
|
}
|
|
2196
2196
|
//#endregion
|
|
2197
|
-
//#region
|
|
2197
|
+
//#region ../../../../hm623s/r/packages/kosong/src/providers/request-auth.ts
|
|
2198
2198
|
function requireProviderApiKey(providerName, auth, defaultApiKey) {
|
|
2199
2199
|
const apiKey = auth?.apiKey ?? defaultApiKey;
|
|
2200
2200
|
if (apiKey === void 0 || apiKey.length === 0) throw new ChatProviderError(`${providerName}: apiKey is required. Provide it via the constructor options, the provider's API-key environment variable, options.auth.apiKey on each request, or an OAuth login.`);
|
|
@@ -2234,7 +2234,7 @@ function resolveAuthBackedClient(state, auth, build) {
|
|
|
2234
2234
|
return build(auth);
|
|
2235
2235
|
}
|
|
2236
2236
|
//#endregion
|
|
2237
|
-
//#region
|
|
2237
|
+
//#region ../../../../hm623s/r/packages/kosong/src/providers/blun-files.ts
|
|
2238
2238
|
/**
|
|
2239
2239
|
* Blun-specific file upload client.
|
|
2240
2240
|
*
|
|
@@ -2351,7 +2351,7 @@ function guessMimeTypeFromExt(filename) {
|
|
|
2351
2351
|
return EXT_TO_MIME$2[filename.slice(dot + 1).toLowerCase()];
|
|
2352
2352
|
}
|
|
2353
2353
|
//#endregion
|
|
2354
|
-
//#region
|
|
2354
|
+
//#region ../../../../hm623s/r/packages/kosong/src/providers/chat-completions-wire.ts
|
|
2355
2355
|
function convertChatCompletionContentPart$1(part) {
|
|
2356
2356
|
switch (part.type) {
|
|
2357
2357
|
case "text": return {
|
|
@@ -2448,7 +2448,7 @@ function normalizeChatCompletionFinishReason(raw) {
|
|
|
2448
2448
|
}
|
|
2449
2449
|
}
|
|
2450
2450
|
//#endregion
|
|
2451
|
-
//#region
|
|
2451
|
+
//#region ../../../../hm623s/r/packages/kosong/src/providers/chat-completions-stream.ts
|
|
2452
2452
|
/**
|
|
2453
2453
|
* Convert a chat-completion-style streamed tool-call delta into the
|
|
2454
2454
|
* normalized kosong stream part protocol.
|
|
@@ -2509,7 +2509,7 @@ function convertChatCompletionStreamToolCall(toolCall, bufferedByIndex) {
|
|
|
2509
2509
|
}];
|
|
2510
2510
|
}
|
|
2511
2511
|
//#endregion
|
|
2512
|
-
//#region
|
|
2512
|
+
//#region ../../../../hm623s/r/packages/kosong/src/providers/tool-call-id.ts
|
|
2513
2513
|
const EMPTY_TOOL_CALL_ID$1 = "tool_call";
|
|
2514
2514
|
const TOOL_CALL_ID_SAFE_CHARS$1 = /[^a-zA-Z0-9_-]/g;
|
|
2515
2515
|
function sanitizeToolCallId$1(id, maxLength) {
|
|
@@ -2593,7 +2593,7 @@ function truncateToolCallId$1(base, maxLength, suffix) {
|
|
|
2593
2593
|
return `${base.slice(0, baseLength)}${suffix}`;
|
|
2594
2594
|
}
|
|
2595
2595
|
//#endregion
|
|
2596
|
-
//#region
|
|
2596
|
+
//#region ../../../../hm623s/r/packages/kosong/src/providers/blun.ts
|
|
2597
2597
|
const BLUN_TOOL_CALL_ID_POLICY$1 = {
|
|
2598
2598
|
normalize: (id) => sanitizeToolCallId$1(id, 64),
|
|
2599
2599
|
maxLength: 64
|
|
@@ -3120,7 +3120,7 @@ var BlunChatProvider = class {
|
|
|
3120
3120
|
}
|
|
3121
3121
|
};
|
|
3122
3122
|
//#endregion
|
|
3123
|
-
//#region
|
|
3123
|
+
//#region ../../../../hm623s/r/packages/kosong/src/providers/index.ts
|
|
3124
3124
|
function createProvider(config) {
|
|
3125
3125
|
if (config.type !== "blun") throw new Error("The product factory only supports the \"blun\" provider.");
|
|
3126
3126
|
return new BlunChatProvider(config);
|
|
@@ -3133,7 +3133,7 @@ function getModelCapability(_wire, _modelName) {
|
|
|
3133
3133
|
return UNKNOWN_CAPABILITY;
|
|
3134
3134
|
}
|
|
3135
3135
|
//#endregion
|
|
3136
|
-
//#region
|
|
3136
|
+
//#region ../../../../hm623s/r/packages/kosong/src/generate.ts
|
|
3137
3137
|
/**
|
|
3138
3138
|
* Generate one assistant message by streaming from the given provider.
|
|
3139
3139
|
*
|
|
@@ -3386,7 +3386,7 @@ function deepCopyPart(part) {
|
|
|
3386
3386
|
return structuredClone(part);
|
|
3387
3387
|
}
|
|
3388
3388
|
//#endregion
|
|
3389
|
-
//#region
|
|
3389
|
+
//#region ../../../../hm623s/r/packages/kosong/src/usage.ts
|
|
3390
3390
|
/**
|
|
3391
3391
|
* Compute total input tokens (other + cache read + cache creation).
|
|
3392
3392
|
*/
|
|
@@ -3424,7 +3424,7 @@ function addUsage(a, b) {
|
|
|
3424
3424
|
};
|
|
3425
3425
|
}
|
|
3426
3426
|
//#endregion
|
|
3427
|
-
//#region
|
|
3427
|
+
//#region ../../../../hm623s/r/packages/kosong/src/complete.ts
|
|
3428
3428
|
const DEFAULT_MAX_TOKENS = 32;
|
|
3429
3429
|
/**
|
|
3430
3430
|
* Generate a fill-in-the-middle (FIM) completion.
|
|
@@ -3470,13 +3470,13 @@ function trimCompletion(text, stop) {
|
|
|
3470
3470
|
return result;
|
|
3471
3471
|
}
|
|
3472
3472
|
//#endregion
|
|
3473
|
-
//#region
|
|
3473
|
+
//#region ../../../../hm623s/r/packages/kosong/src/index.ts
|
|
3474
3474
|
/**
|
|
3475
3475
|
* Legacy provider adapters stay off the product barrel and release entries.
|
|
3476
3476
|
* Library tests can still import their source subpaths directly.
|
|
3477
3477
|
*/
|
|
3478
3478
|
//#endregion
|
|
3479
|
-
//#region
|
|
3479
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/errors/serialize.ts
|
|
3480
3480
|
/** Type guard for BlunError. */
|
|
3481
3481
|
function isBlunError(error) {
|
|
3482
3482
|
return error instanceof BlunError;
|
|
@@ -3593,7 +3593,7 @@ function fromBlunErrorPayload(payload) {
|
|
|
3593
3593
|
return new BlunError(payload.code, payload.message, { details: payload.details });
|
|
3594
3594
|
}
|
|
3595
3595
|
//#endregion
|
|
3596
|
-
//#region
|
|
3596
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/errors/unexpectedError.ts
|
|
3597
3597
|
/**
|
|
3598
3598
|
* Default handler. NOTE: do not touch `ILogService` here — this module is
|
|
3599
3599
|
* imported eagerly and the DI container has no logger registered at module-
|
|
@@ -3628,7 +3628,7 @@ function safelyCallListener(listener) {
|
|
|
3628
3628
|
}
|
|
3629
3629
|
}
|
|
3630
3630
|
//#endregion
|
|
3631
|
-
//#region
|
|
3631
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/hooks/types.ts
|
|
3632
3632
|
const HOOK_EVENT_TYPES = [
|
|
3633
3633
|
"PreToolUse",
|
|
3634
3634
|
"PostToolUse",
|
|
@@ -5509,7 +5509,7 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5509
5509
|
module.exports = picomatch;
|
|
5510
5510
|
}));
|
|
5511
5511
|
//#endregion
|
|
5512
|
-
//#region
|
|
5512
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/matches-rule.ts
|
|
5513
5513
|
var import_picomatch = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5514
5514
|
const pico = require_picomatch$1();
|
|
5515
5515
|
const utils = require_utils$4();
|
|
@@ -9817,7 +9817,7 @@ function boolean(params) {
|
|
|
9817
9817
|
return /* @__PURE__ */ _coercedBoolean(ZodBoolean$1, params);
|
|
9818
9818
|
}
|
|
9819
9819
|
//#endregion
|
|
9820
|
-
//#region
|
|
9820
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/config/schema.ts
|
|
9821
9821
|
const ProviderTypeSchema = literal("blun");
|
|
9822
9822
|
const OAuthRefSchema = object({
|
|
9823
9823
|
storage: _enum(["file", "keyring"]),
|
|
@@ -10115,7 +10115,7 @@ function isPrivateVisionReaderIpv4(hostname) {
|
|
|
10115
10115
|
return a === 10 || a === 127 || a === 172 && b >= 16 && b <= 31 || a === 192 && b === 168 || a === 100 && b >= 64 && b <= 127;
|
|
10116
10116
|
}
|
|
10117
10117
|
//#endregion
|
|
10118
|
-
//#region
|
|
10118
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/config/merge.ts
|
|
10119
10119
|
function mergeConfigPatch(config, patch) {
|
|
10120
10120
|
const base = validateConfig(config);
|
|
10121
10121
|
const parsedPatch = parsePatch(patch);
|
|
@@ -10151,7 +10151,7 @@ function isPlainObject$3(value) {
|
|
|
10151
10151
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10152
10152
|
}
|
|
10153
10153
|
//#endregion
|
|
10154
|
-
//#region
|
|
10154
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/config/resolve.ts
|
|
10155
10155
|
const TRUE_BOOLEAN_ENV_VALUES = new Set([
|
|
10156
10156
|
"1",
|
|
10157
10157
|
"true",
|
|
@@ -10187,7 +10187,7 @@ function parseFloatEnv(value, varName) {
|
|
|
10187
10187
|
return parsed;
|
|
10188
10188
|
}
|
|
10189
10189
|
//#endregion
|
|
10190
|
-
//#region
|
|
10190
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/config/env-model.ts
|
|
10191
10191
|
/** Reserved keys for the env-driven synthetic provider / model alias. */
|
|
10192
10192
|
const ENV_MODEL_PROVIDER_KEY = "__blun_env__";
|
|
10193
10193
|
const ENV_MODEL_ALIAS_KEY = "__blun_env_model__";
|
|
@@ -10325,7 +10325,7 @@ function rawThinking(config) {
|
|
|
10325
10325
|
return typeof raw === "object" && raw !== null && !Array.isArray(raw) ? raw : void 0;
|
|
10326
10326
|
}
|
|
10327
10327
|
//#endregion
|
|
10328
|
-
//#region
|
|
10328
|
+
//#region ../../../../hm623s/r/packages/oauth/src/errors.ts
|
|
10329
10329
|
/**
|
|
10330
10330
|
* OAuth error classes.
|
|
10331
10331
|
*
|
|
@@ -10373,7 +10373,7 @@ var RetryableRefreshError = class extends OAuthError$1 {
|
|
|
10373
10373
|
}
|
|
10374
10374
|
};
|
|
10375
10375
|
//#endregion
|
|
10376
|
-
//#region
|
|
10376
|
+
//#region ../../../../hm623s/r/packages/oauth/src/types.ts
|
|
10377
10377
|
function tokenToWire(token) {
|
|
10378
10378
|
return {
|
|
10379
10379
|
access_token: token.accessToken,
|
|
@@ -10397,7 +10397,7 @@ function tokenFromWire(wire) {
|
|
|
10397
10397
|
};
|
|
10398
10398
|
}
|
|
10399
10399
|
//#endregion
|
|
10400
|
-
//#region
|
|
10400
|
+
//#region ../../../../hm623s/r/packages/oauth/src/private-path-writer.ts
|
|
10401
10401
|
var PrivatePathWriterError = class extends Error {
|
|
10402
10402
|
failure;
|
|
10403
10403
|
code;
|
|
@@ -10604,12 +10604,12 @@ async function acquirePrivatePathWriter(targetPath, options = {}) {
|
|
|
10604
10604
|
}
|
|
10605
10605
|
}
|
|
10606
10606
|
//#endregion
|
|
10607
|
-
//#region
|
|
10607
|
+
//#region ../../../../hm623s/r/packages/oauth/src/utils.ts
|
|
10608
10608
|
function isRecord$10(value) {
|
|
10609
10609
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10610
10610
|
}
|
|
10611
10611
|
//#endregion
|
|
10612
|
-
//#region
|
|
10612
|
+
//#region ../../../../hm623s/r/packages/oauth/src/windows-command-worker.ts
|
|
10613
10613
|
function prepareWindowsCommand(executable, args, platform = process.platform) {
|
|
10614
10614
|
const target = args[0];
|
|
10615
10615
|
if (platform !== "win32" || win32.basename(executable).toLowerCase() !== "icacls.exe" || !target || !win32.isAbsolute(target) || !win32.basename(target)) return { args };
|
|
@@ -10708,7 +10708,7 @@ function runWindowsCommand(executable, args) {
|
|
|
10708
10708
|
});
|
|
10709
10709
|
}
|
|
10710
10710
|
//#endregion
|
|
10711
|
-
//#region
|
|
10711
|
+
//#region ../../../../hm623s/r/packages/oauth/src/windows-private-acl.ts
|
|
10712
10712
|
const WINDOWS_SYSTEM_SID = "S-1-5-18";
|
|
10713
10713
|
const WINDOWS_ADMINISTRATORS_SID = "S-1-5-32-544";
|
|
10714
10714
|
const WINDOWS_SID_PATTERN = /S-\d-\d+(?:-\d+)+/gi;
|
|
@@ -11100,7 +11100,7 @@ var WindowsPrivateAcl = class {
|
|
|
11100
11100
|
}
|
|
11101
11101
|
};
|
|
11102
11102
|
//#endregion
|
|
11103
|
-
//#region
|
|
11103
|
+
//#region ../../../../hm623s/r/packages/oauth/src/storage.ts
|
|
11104
11104
|
/**
|
|
11105
11105
|
* File-based OAuth token storage.
|
|
11106
11106
|
*
|
|
@@ -11287,7 +11287,7 @@ var FileTokenStorage = class {
|
|
|
11287
11287
|
}
|
|
11288
11288
|
};
|
|
11289
11289
|
//#endregion
|
|
11290
|
-
//#region
|
|
11290
|
+
//#region ../../../../hm623s/r/packages/oauth/src/api-error.ts
|
|
11291
11291
|
const DIRECT_ERROR_KEYS = [
|
|
11292
11292
|
"error_description",
|
|
11293
11293
|
"message",
|
|
@@ -11344,7 +11344,7 @@ function nonEmptyString$6(value) {
|
|
|
11344
11344
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
11345
11345
|
}
|
|
11346
11346
|
//#endregion
|
|
11347
|
-
//#region
|
|
11347
|
+
//#region ../../../../hm623s/r/packages/oauth/src/oauth.ts
|
|
11348
11348
|
/**
|
|
11349
11349
|
* Device Code OAuth flow — pure HTTP wrappers.
|
|
11350
11350
|
*
|
|
@@ -12828,7 +12828,7 @@ var require_adapter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
12828
12828
|
};
|
|
12829
12829
|
}));
|
|
12830
12830
|
//#endregion
|
|
12831
|
-
//#region
|
|
12831
|
+
//#region ../../../../hm623s/r/packages/oauth/src/token-state.ts
|
|
12832
12832
|
var import_proper_lockfile = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12833
12833
|
const lockfile = require_lockfile();
|
|
12834
12834
|
const { toPromise, toSync, toSyncOptions } = require_adapter();
|
|
@@ -12881,7 +12881,7 @@ function revokedTombstone(prior) {
|
|
|
12881
12881
|
};
|
|
12882
12882
|
}
|
|
12883
12883
|
//#endregion
|
|
12884
|
-
//#region
|
|
12884
|
+
//#region ../../../../hm623s/r/packages/oauth/src/oauth-manager.ts
|
|
12885
12885
|
/**
|
|
12886
12886
|
* OAuthManager — per-provider token lifecycle (load / refresh / login / logout).
|
|
12887
12887
|
*
|
|
@@ -13204,7 +13204,7 @@ var OAuthManager = class {
|
|
|
13204
13204
|
}
|
|
13205
13205
|
};
|
|
13206
13206
|
//#endregion
|
|
13207
|
-
//#region
|
|
13207
|
+
//#region ../../../../hm623s/r/packages/oauth/src/identity.ts
|
|
13208
13208
|
/**
|
|
13209
13209
|
* Blun host and device identity header factories.
|
|
13210
13210
|
*
|
|
@@ -13331,7 +13331,7 @@ function requiredAsciiHeader(value, fieldName) {
|
|
|
13331
13331
|
return cleaned;
|
|
13332
13332
|
}
|
|
13333
13333
|
//#endregion
|
|
13334
|
-
//#region
|
|
13334
|
+
//#region ../../../../hm623s/r/packages/oauth/src/constants.ts
|
|
13335
13335
|
const DEFAULT_BLUN_OAUTH_HOST = "https://account.blun.ai";
|
|
13336
13336
|
const BLUN_FLOW_CONFIG = {
|
|
13337
13337
|
name: "blun",
|
|
@@ -13339,7 +13339,7 @@ const BLUN_FLOW_CONFIG = {
|
|
|
13339
13339
|
clientId: "blun-code"
|
|
13340
13340
|
};
|
|
13341
13341
|
//#endregion
|
|
13342
|
-
//#region
|
|
13342
|
+
//#region ../../../../hm623s/r/packages/oauth/src/managed-usage.ts
|
|
13343
13343
|
/**
|
|
13344
13344
|
* Managed-platform usage fetch / parse.
|
|
13345
13345
|
*
|
|
@@ -13697,7 +13697,7 @@ async function fetchManagedUsage(url, accessToken, opts = {}) {
|
|
|
13697
13697
|
}
|
|
13698
13698
|
}
|
|
13699
13699
|
//#endregion
|
|
13700
|
-
//#region
|
|
13700
|
+
//#region ../../../../hm623s/r/packages/oauth/src/model-alias-merge.ts
|
|
13701
13701
|
const MANAGED_BLUN_MODEL_FIELDS = new Set([
|
|
13702
13702
|
"provider",
|
|
13703
13703
|
"model",
|
|
@@ -13732,7 +13732,7 @@ function mergeRefreshedModelAlias(existing, remote, remoteOwnedFields) {
|
|
|
13732
13732
|
};
|
|
13733
13733
|
}
|
|
13734
13734
|
//#endregion
|
|
13735
|
-
//#region
|
|
13735
|
+
//#region ../../../../hm623s/r/packages/oauth/src/managed-blun.ts
|
|
13736
13736
|
const BLUN_PLATFORM_ID = "blun";
|
|
13737
13737
|
const BLUN_PROVIDER_NAME$1 = "managed:blun";
|
|
13738
13738
|
const BLUN_OAUTH_KEY = "oauth/blun";
|
|
@@ -14180,7 +14180,7 @@ async function provisionManagedBlunCodeConfig(options) {
|
|
|
14180
14180
|
};
|
|
14181
14181
|
}
|
|
14182
14182
|
//#endregion
|
|
14183
|
-
//#region
|
|
14183
|
+
//#region ../../../../hm623s/r/packages/oauth/src/managed-quota.ts
|
|
14184
14184
|
const MANAGED_QUOTA_PATH = "/api/verbrauch/mein-stand";
|
|
14185
14185
|
const REQUIRED_WINDOWS = [
|
|
14186
14186
|
["fuenf_stunden", "five_hours"],
|
|
@@ -14289,7 +14289,7 @@ function hasValidResetAt(value) {
|
|
|
14289
14289
|
return /(?:Z|[+-]\d{2}:\d{2})$/i.test(value) && Number.isFinite(Date.parse(value));
|
|
14290
14290
|
}
|
|
14291
14291
|
//#endregion
|
|
14292
|
-
//#region
|
|
14292
|
+
//#region ../../../../hm623s/r/packages/oauth/src/managed-feedback.ts
|
|
14293
14293
|
/**
|
|
14294
14294
|
* Submit user feedback to the managed BLUN King platform.
|
|
14295
14295
|
*
|
|
@@ -14355,7 +14355,7 @@ function readFeedbackId(payload) {
|
|
|
14355
14355
|
return typeof value === "number" && Number.isInteger(value) ? value : void 0;
|
|
14356
14356
|
}
|
|
14357
14357
|
//#endregion
|
|
14358
|
-
//#region
|
|
14358
|
+
//#region ../../../../hm623s/r/packages/oauth/src/managed-feedback-upload.ts
|
|
14359
14359
|
function blunCodeFeedbackUploadUrl(baseUrl) {
|
|
14360
14360
|
return `${feedbackBaseUrl(baseUrl)}/feedback/upload_url`;
|
|
14361
14361
|
}
|
|
@@ -14470,7 +14470,7 @@ function readStringField(payload, key) {
|
|
|
14470
14470
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
14471
14471
|
}
|
|
14472
14472
|
//#endregion
|
|
14473
|
-
//#region
|
|
14473
|
+
//#region ../../../../hm623s/r/packages/oauth/src/toolkit.ts
|
|
14474
14474
|
var BlunOAuthToolkit = class {
|
|
14475
14475
|
homeDir;
|
|
14476
14476
|
identity;
|
|
@@ -14800,7 +14800,7 @@ function normalizeOAuthHost(oauthHost) {
|
|
|
14800
14800
|
return oauthHost.trim().replace(/\/+$/, "");
|
|
14801
14801
|
}
|
|
14802
14802
|
//#endregion
|
|
14803
|
-
//#region
|
|
14803
|
+
//#region ../../../../hm623s/r/packages/oauth/src/refreshProviderModels.ts
|
|
14804
14804
|
const BLUN_LOCAL_PROVIDER_NAME = "king-blun";
|
|
14805
14805
|
function readProvider(config, providerId) {
|
|
14806
14806
|
const provider = config.providers[providerId];
|
|
@@ -15020,7 +15020,7 @@ async function refreshProviderModels(host, options = {}) {
|
|
|
15020
15020
|
};
|
|
15021
15021
|
}
|
|
15022
15022
|
//#endregion
|
|
15023
|
-
//#region
|
|
15023
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/writer-lease.ts
|
|
15024
15024
|
const canonicalWriterPath = canonicalPrivateWriterPath;
|
|
15025
15025
|
function sessionError(error) {
|
|
15026
15026
|
if (!(error instanceof PrivatePathWriterError)) return error;
|
|
@@ -15057,7 +15057,7 @@ async function acquireSessionWriter(sessionDirectory, options = {}) {
|
|
|
15057
15057
|
}
|
|
15058
15058
|
}
|
|
15059
15059
|
//#endregion
|
|
15060
|
-
//#region
|
|
15060
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/utils/fs.ts
|
|
15061
15061
|
/**
|
|
15062
15062
|
* Low-level POSIX durability primitives.
|
|
15063
15063
|
*
|
|
@@ -15219,7 +15219,7 @@ async function atomicWriteWithMode(filePath, content, syncOverride, renameOverri
|
|
|
15219
15219
|
}
|
|
15220
15220
|
}
|
|
15221
15221
|
//#endregion
|
|
15222
|
-
//#region
|
|
15222
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/config/write-ownership.ts
|
|
15223
15223
|
const writeScope = new AsyncLocalStorage();
|
|
15224
15224
|
async function canonicalConfigPath(filePath, options) {
|
|
15225
15225
|
const absolute = resolve(filePath);
|
|
@@ -16220,7 +16220,7 @@ function stringify$1(obj, { maxDepth = 1e3, numbersAsFloat = false } = {}) {
|
|
|
16220
16220
|
return str;
|
|
16221
16221
|
}
|
|
16222
16222
|
//#endregion
|
|
16223
|
-
//#region
|
|
16223
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/config/toml.ts
|
|
16224
16224
|
function snakeToCamel$1(str) {
|
|
16225
16225
|
return str.replaceAll(/_([a-z])/g, (_, ch) => ch.toUpperCase());
|
|
16226
16226
|
}
|
|
@@ -16695,7 +16695,7 @@ function isFileExistsError(error) {
|
|
|
16695
16695
|
return typeof error === "object" && error !== null && error.code === "EEXIST";
|
|
16696
16696
|
}
|
|
16697
16697
|
//#endregion
|
|
16698
|
-
//#region
|
|
16698
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/config/mutate.ts
|
|
16699
16699
|
/** Keep transforms synchronous; credential validation and discovery belong before this boundary. */
|
|
16700
16700
|
async function mutateConfigFile(filePath, transform) {
|
|
16701
16701
|
return withConfigWriter(filePath, async (canonical, writer) => {
|
|
@@ -16718,7 +16718,7 @@ async function mutateConfigFile(filePath, transform) {
|
|
|
16718
16718
|
});
|
|
16719
16719
|
}
|
|
16720
16720
|
//#endregion
|
|
16721
|
-
//#region
|
|
16721
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/config/model.ts
|
|
16722
16722
|
function resolveCompactionModelAlias(configuredAlias, activeAlias) {
|
|
16723
16723
|
const alias = configuredAlias?.trim();
|
|
16724
16724
|
return alias === void 0 || alias.length === 0 ? activeAlias : alias;
|
|
@@ -16734,7 +16734,7 @@ function effectiveModelAlias(alias) {
|
|
|
16734
16734
|
return effective;
|
|
16735
16735
|
}
|
|
16736
16736
|
//#endregion
|
|
16737
|
-
//#region
|
|
16737
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/config/path.ts
|
|
16738
16738
|
/**
|
|
16739
16739
|
* Resolve the BLUN home directory (config.toml, sessions, skills, themes).
|
|
16740
16740
|
*
|
|
@@ -16757,7 +16757,7 @@ function ensureBlunHome(homeDir) {
|
|
|
16757
16757
|
}
|
|
16758
16758
|
resolve(homedir(), ".blun-code", "trusted-projects.json");
|
|
16759
16759
|
//#endregion
|
|
16760
|
-
//#region
|
|
16760
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/config/workspace-local.ts
|
|
16761
16761
|
const S_IFMT$5 = 61440;
|
|
16762
16762
|
const S_IFDIR$3 = 16384;
|
|
16763
16763
|
const WorkspaceLocalTomlSchema = object({ workspace: object({ additional_dir: array(string()) }).optional() });
|
|
@@ -17085,7 +17085,7 @@ function extractError(value) {
|
|
|
17085
17085
|
} : { message: value.message };
|
|
17086
17086
|
}
|
|
17087
17087
|
//#endregion
|
|
17088
|
-
//#region
|
|
17088
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/logging/sinks.ts
|
|
17089
17089
|
const PENDING_MAX = 1e3;
|
|
17090
17090
|
const STDERR_NOTICE_INTERVAL_MS = 3e4;
|
|
17091
17091
|
var AsyncSerialQueue = class {
|
|
@@ -17251,7 +17251,7 @@ var RotatingFileSink = class {
|
|
|
17251
17251
|
}
|
|
17252
17252
|
};
|
|
17253
17253
|
//#endregion
|
|
17254
|
-
//#region
|
|
17254
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/logging/types.ts
|
|
17255
17255
|
const LOG_LEVEL_RANK = {
|
|
17256
17256
|
off: 0,
|
|
17257
17257
|
error: 1,
|
|
@@ -17263,7 +17263,7 @@ function levelEnabled(threshold, level) {
|
|
|
17263
17263
|
return LOG_LEVEL_RANK[threshold] >= LOG_LEVEL_RANK[level];
|
|
17264
17264
|
}
|
|
17265
17265
|
//#endregion
|
|
17266
|
-
//#region
|
|
17266
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/logging/logger.ts
|
|
17267
17267
|
const ROOT_SYMBOL = Symbol.for("blun.logger.root");
|
|
17268
17268
|
const SESSION_LOG_ID = Symbol("blun.logger.sessionLogId");
|
|
17269
17269
|
const LLM_REQUEST_SESSION_LOG_OMITTED_CONTEXT_KEYS = ["sessionId"];
|
|
@@ -22078,7 +22078,7 @@ var require_shim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
22078
22078
|
};
|
|
22079
22079
|
}));
|
|
22080
22080
|
//#endregion
|
|
22081
|
-
//#region
|
|
22081
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/types.ts
|
|
22082
22082
|
var import_regexp_escape = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
22083
22083
|
var define = require_define_properties();
|
|
22084
22084
|
var callBind = require_call_bind();
|
|
@@ -22118,7 +22118,7 @@ function summarizeSkill(skill) {
|
|
|
22118
22118
|
};
|
|
22119
22119
|
}
|
|
22120
22120
|
//#endregion
|
|
22121
|
-
//#region
|
|
22121
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/utils/xml-escape.ts
|
|
22122
22122
|
/** Escape XML content — escapes both tag and attribute boundary chars (& < > ") */
|
|
22123
22123
|
function escapeXml$1(input) {
|
|
22124
22124
|
return input.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """);
|
|
@@ -22132,7 +22132,7 @@ function escapeXmlTags(input) {
|
|
|
22132
22132
|
return input.replaceAll("<", "<").replaceAll(">", ">");
|
|
22133
22133
|
}
|
|
22134
22134
|
//#endregion
|
|
22135
|
-
//#region
|
|
22135
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/parser.ts
|
|
22136
22136
|
var FrontmatterError = class extends Error {
|
|
22137
22137
|
constructor(message, cause) {
|
|
22138
22138
|
super(message);
|
|
@@ -22329,7 +22329,7 @@ function isRecord$8(value) {
|
|
|
22329
22329
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
22330
22330
|
}
|
|
22331
22331
|
//#endregion
|
|
22332
|
-
//#region
|
|
22332
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/plugin/commands.ts
|
|
22333
22333
|
function parseCommandText(input) {
|
|
22334
22334
|
const { text, commandPath, pluginId } = input;
|
|
22335
22335
|
const parsed = parseFrontmatter(text);
|
|
@@ -22379,7 +22379,7 @@ function isRecord$7(value) {
|
|
|
22379
22379
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
22380
22380
|
}
|
|
22381
22381
|
//#endregion
|
|
22382
|
-
//#region
|
|
22382
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/flags/registry.ts
|
|
22383
22383
|
/**
|
|
22384
22384
|
* Experimental feature flags.
|
|
22385
22385
|
*
|
|
@@ -22480,7 +22480,7 @@ var FlagResolver = class {
|
|
|
22480
22480
|
};
|
|
22481
22481
|
new FlagResolver();
|
|
22482
22482
|
//#endregion
|
|
22483
|
-
//#region
|
|
22483
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/profile/types.ts
|
|
22484
22484
|
const RawSubagentProfileSchema = object({ description: string().optional() });
|
|
22485
22485
|
const RawAgentProfileSchema = object({
|
|
22486
22486
|
extends: string().optional(),
|
|
@@ -22567,7 +22567,7 @@ async function listDirectory(kaos, workDir = kaos.getcwd(), options = {}) {
|
|
|
22567
22567
|
return lines.length > 0 ? lines.join("\n") : "(empty directory)";
|
|
22568
22568
|
}
|
|
22569
22569
|
//#endregion
|
|
22570
|
-
//#region
|
|
22570
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/profile/instruction-provenance.ts
|
|
22571
22571
|
function copyInstructionFileBytes(file, copies = 1) {
|
|
22572
22572
|
const size = file.sourceTextBytes;
|
|
22573
22573
|
return {
|
|
@@ -22678,7 +22678,7 @@ var InstructionText = class InstructionText {
|
|
|
22678
22678
|
}
|
|
22679
22679
|
};
|
|
22680
22680
|
//#endregion
|
|
22681
|
-
//#region
|
|
22681
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/profile/context.ts
|
|
22682
22682
|
const AGENTS_MD_RECOMMENDED_MAX_BYTES = 32 * 1024;
|
|
22683
22683
|
const IMPORT_MAX_DEPTH = 4;
|
|
22684
22684
|
const IMPORT_LINE_RE = /^@import\s+(.+)$/gm;
|
|
@@ -29324,7 +29324,7 @@ var require_jinja_compat = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
29324
29324
|
module.exports = installCompat;
|
|
29325
29325
|
}));
|
|
29326
29326
|
//#endregion
|
|
29327
|
-
//#region
|
|
29327
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/utils/render-prompt.ts
|
|
29328
29328
|
var import_nunjucks = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
29329
29329
|
var lib = require_lib$4();
|
|
29330
29330
|
var _require = require_environment(), Environment = _require.Environment, Template = _require.Template;
|
|
@@ -29412,7 +29412,7 @@ function renderPrompt(template, vars) {
|
|
|
29412
29412
|
return env.renderString(template, vars);
|
|
29413
29413
|
}
|
|
29414
29414
|
//#endregion
|
|
29415
|
-
//#region
|
|
29415
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/profile/conduct.ts
|
|
29416
29416
|
/**
|
|
29417
29417
|
* Conduct layer — distilled behavioural standard for King.
|
|
29418
29418
|
*
|
|
@@ -29469,7 +29469,7 @@ function conductSystemBlock() {
|
|
|
29469
29469
|
- For large, parallelizable, or multi-part tasks, actively consider fanning out to subagents or swarm mode (/swarm) instead of grinding through everything sequentially yourself. Delegate independent workstreams, keep the synthesis and final quality gate with you.`;
|
|
29470
29470
|
}
|
|
29471
29471
|
//#endregion
|
|
29472
|
-
//#region
|
|
29472
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/profile/persona.ts
|
|
29473
29473
|
/**
|
|
29474
29474
|
* Persona layer — the personal identity the user gives their BLUN agent.
|
|
29475
29475
|
*
|
|
@@ -29543,7 +29543,7 @@ function personaSystemBlock(env = process.env, onMeasurement) {
|
|
|
29543
29543
|
return block;
|
|
29544
29544
|
}
|
|
29545
29545
|
//#endregion
|
|
29546
|
-
//#region
|
|
29546
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/profile/soul.ts
|
|
29547
29547
|
/**
|
|
29548
29548
|
* Soul layer — King's self-written personality file.
|
|
29549
29549
|
*
|
|
@@ -29603,7 +29603,7 @@ function soulSystemBlock(env = process.env, onSource) {
|
|
|
29603
29603
|
return lines.join("\n");
|
|
29604
29604
|
}
|
|
29605
29605
|
//#endregion
|
|
29606
|
-
//#region
|
|
29606
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/profile/render-contributions.ts
|
|
29607
29607
|
const tracked = new Set(["BLUN_AGENTS_MD", "BLUN_SKILLS"]);
|
|
29608
29608
|
const trackedWithRole = new Set([...tracked, "ROLE_ADDITIONAL"]);
|
|
29609
29609
|
const filterName = "__blun_source_bytes_v1";
|
|
@@ -29704,7 +29704,7 @@ function renderPromptContributions(template, vars, rendered, includeRole = false
|
|
|
29704
29704
|
}
|
|
29705
29705
|
}
|
|
29706
29706
|
//#endregion
|
|
29707
|
-
//#region
|
|
29707
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/profile/resolve.ts
|
|
29708
29708
|
/**
|
|
29709
29709
|
* Resolve agent profiles with extends inheritance.
|
|
29710
29710
|
*
|
|
@@ -29921,7 +29921,7 @@ function cloneSubagents(subagents) {
|
|
|
29921
29921
|
return Object.fromEntries(Object.entries(subagents).map(([name, subagent]) => [name, { ...subagent }]));
|
|
29922
29922
|
}
|
|
29923
29923
|
//#endregion
|
|
29924
|
-
//#region
|
|
29924
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/profile/load.ts
|
|
29925
29925
|
function loadAgentProfilesFromSources(paths, sources) {
|
|
29926
29926
|
return resolveAgentProfiles(paths.map((profilePath) => finalizeRawAgentProfileSource(readRequiredSource(sources, profilePath), profilePath, sources)));
|
|
29927
29927
|
}
|
|
@@ -29958,19 +29958,19 @@ function normalizeSourcePath(path) {
|
|
|
29958
29958
|
return normalize$3(path.replaceAll("\\", "/")).replace(/^\.\//, "");
|
|
29959
29959
|
}
|
|
29960
29960
|
//#endregion
|
|
29961
|
-
//#region
|
|
29961
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/profile/default/agent.yaml?raw
|
|
29962
29962
|
var agent_default$1 = "name: agent\r\ndescription: Default BLUN King agent\r\n\r\nsystemPromptPath: ./system.md\r\npromptVars:\r\n roleAdditional: ''\r\n\r\ntools:\r\n - Read\r\n - ReadBatch\r\n - ProgrammaticTool\r\n - Write\r\n - Edit\r\n - Grep\r\n - Glob\r\n - Bash\r\n - TaskList\r\n - TaskOutput\r\n - TaskStop\r\n - TaskUpdate\r\n - TaskResume\r\n - CronCreate\r\n - CronList\r\n - CronRunList\r\n - CronRunOutput\r\n - CronDelete\r\n - ReadMediaFile\r\n - TodoList\r\n - CompactConversation\r\n - Skill\r\n - WebSearch\r\n - Agent\r\n - AgentSwarm\r\n - FetchURL\r\n - GenerateImage\r\n - GenerateVideo\r\n - GenerateSpeech\r\n - GetMedia\r\n - AskUserQuestion\r\n - MistakeRecord\r\n - CodebaseSearch\r\n - EnterPlanMode\r\n - ExitPlanMode\r\n - CreateGoal\r\n - GetGoal\r\n - SetGoalBudget\r\n - UpdateGoal\r\n - mcp__*\r\n\r\nsubagents:\r\n coder:\r\n description: General software engineering agent — the only subagent type with file-editing tools; use it for any delegated task that must modify code.\r\n explore:\r\n description: Fast codebase exploration with prompt-enforced read-only behavior.\r\n plan:\r\n description: Read-only implementation planning and architecture design.\r\n";
|
|
29963
29963
|
//#endregion
|
|
29964
|
-
//#region
|
|
29964
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/profile/default/coder.yaml?raw
|
|
29965
29965
|
var coder_default = "extends: agent\r\nname: coder\r\npromptVars:\r\n roleAdditional: |\r\n You are now running as a subagent. All the `user` messages are sent by the main agent. The main agent cannot see your context, it can only see your last message when you finish the task. You must treat the parent agent as your caller. Do not directly ask the end user questions. If something is unclear, explain the ambiguity in your final summary to the parent agent.\r\n\r\n Your final message is the entire handoff — the parent sees nothing else from your run. Make it technically complete: what you changed and why, the path of every file you touched, how you verified the change (tests or commands run, with results), and anything left undone or worth follow-up. A final message of only a sentence or two is treated as too brief and sent back to you for expansion, costing an extra turn.\r\nwhenToUse: |\r\n Use this agent for non-trivial software engineering work that may require reading files, editing code, running commands, and returning a compact but technically complete summary to the parent agent.\r\ntools:\r\n - Bash\r\n - Read\r\n - ReadBatch\r\n - ProgrammaticTool\r\n - ReadMediaFile\r\n - Glob\r\n - Grep\r\n - Write\r\n - Edit\r\n - MistakeRecord\r\n - WebSearch\r\n - FetchURL\r\n - mcp__*\r\n";
|
|
29966
29966
|
//#endregion
|
|
29967
|
-
//#region
|
|
29967
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/profile/default/explore.yaml?raw
|
|
29968
29968
|
var explore_default = "extends: agent\r\nname: explore\r\npromptVars:\r\n roleAdditional: |\r\n You are now running as a subagent. All the `user` messages are sent by the main agent. The main agent cannot see your context, it can only see your last message when you finish the task. You must treat the parent agent as your caller. Do not directly ask the end user questions. If something is unclear, explain the ambiguity in your final summary to the parent agent.\r\n\r\n You are a codebase exploration specialist. Your role is EXCLUSIVELY to search, read, and analyze existing code and resources. You do NOT have access to project file editing tools. MistakeRecord is the sole write-capable exception: it may record a concrete refutation in shared BLUN learning memory, never modify project files.\r\n\r\n Your strengths:\r\n - Rapidly finding files using glob patterns\r\n - Searching code and text with powerful regex patterns\r\n - Reading and analyzing file contents\r\n - Running read-only shell commands (git log, git diff, ls, find, etc.)\r\n\r\n Guidelines:\r\n - Use Glob for broad file pattern matching. Prefer patterns with a literal anchor (extension or subdirectory); pure wildcards like `*` or `**/*` are allowed but usually truncate at the match cap.\r\n - Use Grep for searching file contents with regex\r\n - Use Read when you know the specific file path\r\n - Use Bash ONLY for read-only operations (ls, git status, git log, git diff, find)\r\n - NEVER use Bash for any file creation or modification commands\r\n - Use WebSearch or FetchURL when a question needs external context (library documentation, error messages, upstream APIs); the local codebase remains your primary domain\r\n - Adapt your search depth based on the thoroughness level specified by the caller\r\n - Wherever possible, spawn multiple parallel tool calls for grepping and reading files to maximize speed\r\n\r\n If the prompt includes a <git-context> block, use it to orient yourself about the repository state before starting your investigation.\r\n\r\n You are meant to be a fast agent. Complete the search request efficiently and report your findings clearly in a structured format.\r\nwhenToUse: |\r\n Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (e.g. \"src/**/*.yaml\"), search code for keywords (e.g. \"database connection\"), or answer questions about the codebase (e.g. \"how does the auth module work?\"). When calling this agent, specify the desired thoroughness level: \"quick\" for basic searches, \"medium\" for moderate exploration, or \"thorough\" for comprehensive analysis across multiple locations and naming conventions. Use this agent for any read-only exploration that will clearly require more than 3 search queries. Prefer launching multiple explore agents concurrently when investigating independent questions.\r\ntools:\r\n - Bash\r\n - Read\r\n - ReadBatch\r\n - ProgrammaticTool\r\n - ReadMediaFile\r\n - Glob\r\n - Grep\r\n - MistakeRecord\r\n - WebSearch\r\n - FetchURL\r\n";
|
|
29969
29969
|
//#endregion
|
|
29970
|
-
//#region
|
|
29970
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/profile/default/init.md?raw
|
|
29971
29971
|
var init_default = "You are a software engineering expert with many years of programming experience. Please explore the current project directory to understand the project's architecture and main details.\n\nTask requirements:\n1. Analyze the project structure and identify key configuration files (such as pyproject.toml, package.json, Cargo.toml, etc.).\n2. Understand the project's technology stack, build process and runtime architecture.\n3. Identify how the code is organized and main module divisions.\n4. Discover project-specific development conventions, testing strategies, and deployment processes.\n\nAfter the exploration, do a thorough summary of your findings and write it to the `AGENTS.md` file in the project root, replacing the file's previous content. If the file already exists, read it first and carry forward whatever is still accurate — the result should be one coherent, up-to-date file, not an append.\n\nFor your information, `AGENTS.md` is a file intended to be read by AI coding agents. Expect the reader of this file to know nothing about the project.\n\nYou should compose this file according to the actual project content. Do not make any assumptions or generalizations. Ensure the information is accurate and useful. You must use the natural language that is mainly used in the project's comments and documentation.\n\nPopular sections that people usually write in `AGENTS.md` are:\n\n- Project overview\n- Build and test commands\n- Code style guidelines\n- Testing instructions\n- Security considerations\n";
|
|
29972
29972
|
//#endregion
|
|
29973
|
-
//#region
|
|
29973
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/profile/default.ts
|
|
29974
29974
|
const PROFILE_SOURCES = {
|
|
29975
29975
|
"profile/default/agent.yaml": agent_default$1,
|
|
29976
29976
|
"profile/default/coder.yaml": coder_default,
|
|
@@ -29986,7 +29986,7 @@ const DEFAULT_AGENT_PROFILES = loadAgentProfilesFromSources([
|
|
|
29986
29986
|
"plan.yaml"
|
|
29987
29987
|
].map((file) => `profile/default/${file}`), PROFILE_SOURCES);
|
|
29988
29988
|
//#endregion
|
|
29989
|
-
//#region
|
|
29989
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/telemetry.ts
|
|
29990
29990
|
const noopTelemetryClient = {
|
|
29991
29991
|
track: () => {},
|
|
29992
29992
|
withContext: () => noopTelemetryClient,
|
|
@@ -30033,7 +30033,7 @@ function createControlledPromise() {
|
|
|
30033
30033
|
return promise;
|
|
30034
30034
|
}
|
|
30035
30035
|
//#endregion
|
|
30036
|
-
//#region
|
|
30036
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/loop/errors.ts
|
|
30037
30037
|
/**
|
|
30038
30038
|
* Loop-local error helpers.
|
|
30039
30039
|
*/
|
|
@@ -30052,7 +30052,7 @@ function errorMessage$4(err) {
|
|
|
30052
30052
|
return String(err);
|
|
30053
30053
|
}
|
|
30054
30054
|
//#endregion
|
|
30055
|
-
//#region
|
|
30055
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/utils/promise.ts
|
|
30056
30056
|
const NEVER$1 = new Promise(() => {});
|
|
30057
30057
|
function timeoutOutcome(timeoutMs, outcome) {
|
|
30058
30058
|
let timeout;
|
|
@@ -30100,7 +30100,7 @@ function resettableTimeoutOutcome(initialMs, outcome) {
|
|
|
30100
30100
|
});
|
|
30101
30101
|
}
|
|
30102
30102
|
//#endregion
|
|
30103
|
-
//#region
|
|
30103
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/utils/quiescence.ts
|
|
30104
30104
|
/** A reservation can release only itself; permanent shutdown always wins. */
|
|
30105
30105
|
var AdmissionGate = class {
|
|
30106
30106
|
state = null;
|
|
@@ -30250,7 +30250,7 @@ var ExecutionLedger = class {
|
|
|
30250
30250
|
}
|
|
30251
30251
|
};
|
|
30252
30252
|
//#endregion
|
|
30253
|
-
//#region
|
|
30253
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/context/notification-xml.ts
|
|
30254
30254
|
/**
|
|
30255
30255
|
* Notification XML rendering — produces the chat-history injection text
|
|
30256
30256
|
* shared between the live ContextMemory and the projector.
|
|
@@ -30308,7 +30308,7 @@ function childBlocks(value) {
|
|
|
30308
30308
|
return value.filter((item) => typeof item === "string" && item.length > 0);
|
|
30309
30309
|
}
|
|
30310
30310
|
//#endregion
|
|
30311
|
-
//#region
|
|
30311
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/utils/per-id-json-store.ts
|
|
30312
30312
|
/**
|
|
30313
30313
|
* Per-id JSON record store — write each value as `<rootDir>/<subdir>/<id>.json`.
|
|
30314
30314
|
*
|
|
@@ -30397,7 +30397,7 @@ function createPerIdJsonStore(opts) {
|
|
|
30397
30397
|
};
|
|
30398
30398
|
}
|
|
30399
30399
|
//#endregion
|
|
30400
|
-
//#region
|
|
30400
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/background/resume-store.ts
|
|
30401
30401
|
const BACKGROUND_TASK_ID = /^[a-z0-9]+(?:-[a-z0-9]+)*-[0-9a-z]{8}$/;
|
|
30402
30402
|
const id = string().max(128).regex(BACKGROUND_TASK_ID);
|
|
30403
30403
|
const digest$2 = string().regex(/^[0-9a-f]{64}$/);
|
|
@@ -30532,7 +30532,7 @@ var TaskResumeStore = class {
|
|
|
30532
30532
|
}
|
|
30533
30533
|
};
|
|
30534
30534
|
//#endregion
|
|
30535
|
-
//#region
|
|
30535
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/background/persist.ts
|
|
30536
30536
|
/**
|
|
30537
30537
|
* Background task persistence helpers.
|
|
30538
30538
|
*
|
|
@@ -30744,7 +30744,7 @@ function optionalNonEmptyString(value) {
|
|
|
30744
30744
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
30745
30745
|
}
|
|
30746
30746
|
//#endregion
|
|
30747
|
-
//#region
|
|
30747
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/background/task.ts
|
|
30748
30748
|
const TERMINAL_STATUSES = new Set([
|
|
30749
30749
|
"completed",
|
|
30750
30750
|
"failed",
|
|
@@ -30753,7 +30753,7 @@ const TERMINAL_STATUSES = new Set([
|
|
|
30753
30753
|
"lost"
|
|
30754
30754
|
]);
|
|
30755
30755
|
//#endregion
|
|
30756
|
-
//#region
|
|
30756
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/deny-all.ts
|
|
30757
30757
|
var DenyAllPermissionPolicy = class {
|
|
30758
30758
|
message;
|
|
30759
30759
|
name = "deny-all";
|
|
@@ -30769,7 +30769,7 @@ var DenyAllPermissionPolicy = class {
|
|
|
30769
30769
|
}
|
|
30770
30770
|
};
|
|
30771
30771
|
//#endregion
|
|
30772
|
-
//#region
|
|
30772
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/records/migration/v1.1.ts
|
|
30773
30773
|
function migrateToolCall(toolCall) {
|
|
30774
30774
|
const { function: fn, ...rest } = toolCall;
|
|
30775
30775
|
return {
|
|
@@ -30794,7 +30794,7 @@ const migrateV1_0ToV1_1 = {
|
|
|
30794
30794
|
}
|
|
30795
30795
|
};
|
|
30796
30796
|
//#endregion
|
|
30797
|
-
//#region
|
|
30797
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/records/migration/v1.2.ts
|
|
30798
30798
|
const LEGACY_SESSION_APPROVAL_ACTION_TO_PATTERN = {
|
|
30799
30799
|
"run command": "Bash",
|
|
30800
30800
|
"stop background task": "TaskStop",
|
|
@@ -30820,7 +30820,7 @@ const migrateV1_1ToV1_2 = {
|
|
|
30820
30820
|
}
|
|
30821
30821
|
};
|
|
30822
30822
|
//#endregion
|
|
30823
|
-
//#region
|
|
30823
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/records/migration/v1.3.ts
|
|
30824
30824
|
/**
|
|
30825
30825
|
* v1.2 -> v1.3 is a bump-only migration.
|
|
30826
30826
|
*
|
|
@@ -30838,7 +30838,7 @@ const migrateV1_2ToV1_3 = {
|
|
|
30838
30838
|
}
|
|
30839
30839
|
};
|
|
30840
30840
|
//#endregion
|
|
30841
|
-
//#region
|
|
30841
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/records/migration/v1.4.ts
|
|
30842
30842
|
const migrateV1_3ToV1_4 = {
|
|
30843
30843
|
sourceVersion: "1.3",
|
|
30844
30844
|
targetVersion: "1.4",
|
|
@@ -30933,7 +30933,7 @@ function compareWireVersions(a, b) {
|
|
|
30933
30933
|
return 0;
|
|
30934
30934
|
}
|
|
30935
30935
|
//#endregion
|
|
30936
|
-
//#region
|
|
30936
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/records/persistence.ts
|
|
30937
30937
|
var InMemoryAgentRecordPersistence = class {
|
|
30938
30938
|
options;
|
|
30939
30939
|
records = [];
|
|
@@ -31102,7 +31102,7 @@ function parseRecordLine(line, lineNumber, filePath, allowTruncated) {
|
|
|
31102
31102
|
}
|
|
31103
31103
|
}
|
|
31104
31104
|
//#endregion
|
|
31105
|
-
//#region
|
|
31105
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/attrappen-selbstpruefung/scanner.ts
|
|
31106
31106
|
/**
|
|
31107
31107
|
* Attrappen-Selbstpruefung v4 — Workspace-Scanner.
|
|
31108
31108
|
* Liest Code-Dateien rekursiv, normalisiert Pfade workspace-relativ mit Forward-Slashes.
|
|
@@ -181193,7 +181193,7 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
181193
181193
|
});
|
|
181194
181194
|
}));
|
|
181195
181195
|
//#endregion
|
|
181196
|
-
//#region
|
|
181196
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/attrappen-selbstpruefung/handlers.ts
|
|
181197
181197
|
/** Liefert 'prefix' fuer UI-Handler-Namen, 'action' fuer reine Aktionsverben, sonst null. */
|
|
181198
181198
|
function handlerKind(name) {
|
|
181199
181199
|
const lower = name.toLowerCase();
|
|
@@ -181405,7 +181405,7 @@ var init_handlers = __esmMin((() => {
|
|
|
181405
181405
|
];
|
|
181406
181406
|
}));
|
|
181407
181407
|
//#endregion
|
|
181408
|
-
//#region
|
|
181408
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/attrappen-selbstpruefung/audio.ts
|
|
181409
181409
|
/** Findet Setter auf state-Properties die Audio-relevant sind. */
|
|
181410
181410
|
function findAudioSetters(file) {
|
|
181411
181411
|
const sf = import_typescript$2.default.createSourceFile(file.path, file.content, import_typescript$2.default.ScriptTarget.Latest, true);
|
|
@@ -181486,7 +181486,7 @@ var init_audio = __esmMin((() => {
|
|
|
181486
181486
|
];
|
|
181487
181487
|
}));
|
|
181488
181488
|
//#endregion
|
|
181489
|
-
//#region
|
|
181489
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/attrappen-selbstpruefung/exports.ts
|
|
181490
181490
|
/** Findet alle exportierten Symbole in einem File (functions, consts, classes, interfaces excluded). */
|
|
181491
181491
|
function findExports(file) {
|
|
181492
181492
|
const sf = import_typescript$1.default.createSourceFile(file.path, file.content, import_typescript$1.default.ScriptTarget.Latest, true);
|
|
@@ -181635,7 +181635,7 @@ var init_exports = __esmMin((() => {
|
|
|
181635
181635
|
import_typescript$1 = /* @__PURE__ */ __toESM(require_typescript(), 1);
|
|
181636
181636
|
}));
|
|
181637
181637
|
//#endregion
|
|
181638
|
-
//#region
|
|
181638
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/attrappen-selbstpruefung/file-size.ts
|
|
181639
181639
|
/**
|
|
181640
181640
|
* Klassifiziert Zeilen als Daten oder Logik.
|
|
181641
181641
|
* Datenzeilen sind: const/let/export mit Objekt- oder Array-Literal als Initialisierung,
|
|
@@ -181693,7 +181693,7 @@ var init_file_size = __esmMin((() => {
|
|
|
181693
181693
|
MAX_LOGIC_LINES = 300;
|
|
181694
181694
|
}));
|
|
181695
181695
|
//#endregion
|
|
181696
|
-
//#region
|
|
181696
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/attrappen-selbstpruefung/runner.ts
|
|
181697
181697
|
function runAttrappenCheck(files, scanErrors) {
|
|
181698
181698
|
if (scanErrors && scanErrors.length > 0) return {
|
|
181699
181699
|
passed: false,
|
|
@@ -181723,7 +181723,7 @@ var init_runner = __esmMin((() => {
|
|
|
181723
181723
|
init_file_size();
|
|
181724
181724
|
}));
|
|
181725
181725
|
//#endregion
|
|
181726
|
-
//#region
|
|
181726
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/attrappen-selbstpruefung/index.ts
|
|
181727
181727
|
var init_attrappen_selbstpruefung$1 = __esmMin((() => {
|
|
181728
181728
|
init_scanner();
|
|
181729
181729
|
init_runner();
|
|
@@ -181733,7 +181733,7 @@ var init_attrappen_selbstpruefung$1 = __esmMin((() => {
|
|
|
181733
181733
|
init_file_size();
|
|
181734
181734
|
}));
|
|
181735
181735
|
//#endregion
|
|
181736
|
-
//#region
|
|
181736
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/attrappen-selbstpruefung.ts
|
|
181737
181737
|
var attrappen_selbstpruefung_exports = /* @__PURE__ */ __exportAll({
|
|
181738
181738
|
findControlsWithoutEffect: () => findControlsWithoutEffect,
|
|
181739
181739
|
findDeadExports: () => findDeadExports,
|
|
@@ -181746,7 +181746,7 @@ var init_attrappen_selbstpruefung = __esmMin((() => {
|
|
|
181746
181746
|
init_attrappen_selbstpruefung$1();
|
|
181747
181747
|
}));
|
|
181748
181748
|
//#endregion
|
|
181749
|
-
//#region
|
|
181749
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/goal/index.ts
|
|
181750
181750
|
/**
|
|
181751
181751
|
* Durable goal-mode state owned by {@link GoalMode}.
|
|
181752
181752
|
*
|
|
@@ -182473,7 +182473,7 @@ var require_retry$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
182473
182473
|
};
|
|
182474
182474
|
}));
|
|
182475
182475
|
//#endregion
|
|
182476
|
-
//#region
|
|
182476
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/utils/completion-budget.ts
|
|
182477
182477
|
var import_retry = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
182478
182478
|
module.exports = require_retry$2();
|
|
182479
182479
|
})))(), 1);
|
|
@@ -182693,7 +182693,7 @@ function maybeStatusCode(error) {
|
|
|
182693
182693
|
return typeof statusCode === "number" ? statusCode : void 0;
|
|
182694
182694
|
}
|
|
182695
182695
|
//#endregion
|
|
182696
|
-
//#region
|
|
182696
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/provider-retry-wait.ts
|
|
182697
182697
|
const providerRetryWaitSchema = object({
|
|
182698
182698
|
scope: string().regex(/^[0-9a-f]{64}$/),
|
|
182699
182699
|
notBefore: number$1().int().nonnegative().max(Number.MAX_SAFE_INTEGER)
|
|
@@ -183141,7 +183141,7 @@ function detectFileType(path, header, type = "text") {
|
|
|
183141
183141
|
};
|
|
183142
183142
|
}
|
|
183143
183143
|
//#endregion
|
|
183144
|
-
//#region
|
|
183144
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/utils/tokens.ts
|
|
183145
183145
|
const messageTokenEstimateCache = /* @__PURE__ */ new WeakMap();
|
|
183146
183146
|
/** Open assistant messages grow while streaming; completed history stays cached. */
|
|
183147
183147
|
function invalidateMessageTokenEstimate(message) {
|
|
@@ -183364,7 +183364,7 @@ function fitToolContinuity(value, additionalTokenBudget) {
|
|
|
183364
183364
|
}
|
|
183365
183365
|
}
|
|
183366
183366
|
//#endregion
|
|
183367
|
-
//#region
|
|
183367
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/records/resume-snapshot.ts
|
|
183368
183368
|
const integer$1 = number$1().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
183369
183369
|
const finite = number$1().finite().nonnegative();
|
|
183370
183370
|
const strings = array(string());
|
|
@@ -183878,7 +183878,7 @@ async function writeResumeCheckpoint(wirePath, position, snapshot) {
|
|
|
183878
183878
|
}
|
|
183879
183879
|
}
|
|
183880
183880
|
//#endregion
|
|
183881
|
-
//#region
|
|
183881
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/records/blobref.ts
|
|
183882
183882
|
const DEFAULT_THRESHOLD = 4096;
|
|
183883
183883
|
const DEFAULT_MAX_CACHE_SIZE = 50 * 1024 * 1024;
|
|
183884
183884
|
const BLOBREF_PROTOCOL$1 = "blobref:";
|
|
@@ -184077,7 +184077,7 @@ function asMediaContainer(value) {
|
|
|
184077
184077
|
return "url" in obj ? obj : void 0;
|
|
184078
184078
|
}
|
|
184079
184079
|
//#endregion
|
|
184080
|
-
//#region
|
|
184080
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/records/index.ts
|
|
184081
184081
|
function restoreAgentRecord(agent, input) {
|
|
184082
184082
|
switch (input.type) {
|
|
184083
184083
|
case "metadata": return;
|
|
@@ -184412,7 +184412,7 @@ var AgentRecords = class {
|
|
|
184412
184412
|
}
|
|
184413
184413
|
};
|
|
184414
184414
|
//#endregion
|
|
184415
|
-
//#region
|
|
184415
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/utils/abort.ts
|
|
184416
184416
|
function abortError(message = "Aborted") {
|
|
184417
184417
|
const error = new Error(message);
|
|
184418
184418
|
error.name = "AbortError";
|
|
@@ -184493,7 +184493,7 @@ function createDeadlineAbortSignal(source, timeoutMs) {
|
|
|
184493
184493
|
};
|
|
184494
184494
|
}
|
|
184495
184495
|
//#endregion
|
|
184496
|
-
//#region
|
|
184496
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/utils/git-porcelain.ts
|
|
184497
184497
|
function parseGitPorcelainZ(stdout) {
|
|
184498
184498
|
const fields = stdout.split("\0");
|
|
184499
184499
|
const entries = [];
|
|
@@ -184523,7 +184523,7 @@ function parseGitPorcelainZ(stdout) {
|
|
|
184523
184523
|
};
|
|
184524
184524
|
}
|
|
184525
184525
|
//#endregion
|
|
184526
|
-
//#region
|
|
184526
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/git-context.ts
|
|
184527
184527
|
const GIT_TIMEOUT_MS = 5e3;
|
|
184528
184528
|
const MAX_DIRTY_FILES = 20;
|
|
184529
184529
|
const MAX_COMMIT_LINE_LENGTH = 200;
|
|
@@ -184751,7 +184751,7 @@ async function collectStream(stream) {
|
|
|
184751
184751
|
return Buffer.concat(chunks).toString("utf-8");
|
|
184752
184752
|
}
|
|
184753
184753
|
//#endregion
|
|
184754
|
-
//#region
|
|
184754
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/subagent-resume-reference.ts
|
|
184755
184755
|
const MAX_RECORD_BYTES$1 = 16 * 1024 * 1024;
|
|
184756
184756
|
const sameIdentity$1 = (a, b) => a.dev === b.dev && a.ino === b.ino && a.birthtimeNs === b.birthtimeNs;
|
|
184757
184757
|
const sameRevision$1 = (a, b) => sameIdentity$1(a, b) && a.size === b.size && a.mtimeNs === b.mtimeNs && a.ctimeNs === b.ctimeNs;
|
|
@@ -184849,7 +184849,7 @@ var SubagentResumeReference = class SubagentResumeReference {
|
|
|
184849
184849
|
}
|
|
184850
184850
|
};
|
|
184851
184851
|
//#endregion
|
|
184852
|
-
//#region
|
|
184852
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/subagent-batch.ts
|
|
184853
184853
|
const INITIAL_LAUNCH_LIMIT = 5;
|
|
184854
184854
|
const INITIAL_LAUNCH_INTERVAL_MS = 700;
|
|
184855
184855
|
const RATE_LIMIT_RETRY_BASE_MS = 3e3;
|
|
@@ -185256,10 +185256,10 @@ function resolveSwarmMaxConcurrency(env = process.env) {
|
|
|
185256
185256
|
return value;
|
|
185257
185257
|
}
|
|
185258
185258
|
//#endregion
|
|
185259
|
-
//#region
|
|
185259
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/summary-continuation.md?raw
|
|
185260
185260
|
var summary_continuation_default = "Your previous response was too brief. Please provide a more comprehensive summary that includes:\n\n1. Specific technical details and implementations\n2. Detailed findings and analysis\n3. All important information that the parent agent should know";
|
|
185261
185261
|
//#endregion
|
|
185262
|
-
//#region
|
|
185262
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/subagent-host.ts
|
|
185263
185263
|
const DEFAULT_SUBAGENT_TIMEOUT_MS = 1800 * 1e3;
|
|
185264
185264
|
const DEFAULT_SUBAGENT_TIMEOUT_DESCRIPTION = "30 minutes";
|
|
185265
185265
|
/**
|
|
@@ -185844,7 +185844,7 @@ function shouldSuppressQueuedAttemptFailureEvent(options, error) {
|
|
|
185844
185844
|
return isAbortError(error) || options.signal.aborted;
|
|
185845
185845
|
}
|
|
185846
185846
|
//#endregion
|
|
185847
|
-
//#region
|
|
185847
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/background/agent-task.ts
|
|
185848
185848
|
var AgentBackgroundTask = class {
|
|
185849
185849
|
handle;
|
|
185850
185850
|
description;
|
|
@@ -185914,7 +185914,7 @@ var AgentBackgroundTask = class {
|
|
|
185914
185914
|
}
|
|
185915
185915
|
};
|
|
185916
185916
|
//#endregion
|
|
185917
|
-
//#region
|
|
185917
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/background/process-task.ts
|
|
185918
185918
|
const STREAM_DRAIN_GRACE_MS = 250;
|
|
185919
185919
|
var ProcessBackgroundTask = class {
|
|
185920
185920
|
proc;
|
|
@@ -186048,7 +186048,7 @@ function createPrematureCloseError() {
|
|
|
186048
186048
|
return error;
|
|
186049
186049
|
}
|
|
186050
186050
|
//#endregion
|
|
186051
|
-
//#region
|
|
186051
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/background/resume.ts
|
|
186052
186052
|
const taskId = string().max(128).regex(BACKGROUND_TASK_ID);
|
|
186053
186053
|
const RequestSchema$1 = object({
|
|
186054
186054
|
taskId,
|
|
@@ -186178,7 +186178,7 @@ var TaskResumeRuntime = class {
|
|
|
186178
186178
|
}
|
|
186179
186179
|
};
|
|
186180
186180
|
//#endregion
|
|
186181
|
-
//#region
|
|
186181
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/background/question-task.ts
|
|
186182
186182
|
var QuestionBackgroundTask = class {
|
|
186183
186183
|
run;
|
|
186184
186184
|
description;
|
|
@@ -186231,7 +186231,7 @@ function errorStopReason(result) {
|
|
|
186231
186231
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
186232
186232
|
}
|
|
186233
186233
|
//#endregion
|
|
186234
|
-
//#region
|
|
186234
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/background/index.ts
|
|
186235
186235
|
/**
|
|
186236
186236
|
* BackgroundManager — manages background tasks for an agent.
|
|
186237
186237
|
*
|
|
@@ -187098,7 +187098,7 @@ function buildBackgroundTaskNotificationBody(info) {
|
|
|
187098
187098
|
].join("\n")}`;
|
|
187099
187099
|
}
|
|
187100
187100
|
//#endregion
|
|
187101
|
-
//#region
|
|
187101
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/support/input-schema.ts
|
|
187102
187102
|
/**
|
|
187103
187103
|
* Shared helper for deriving the JSON Schema that a tool advertises to the
|
|
187104
187104
|
* model for its parameters.
|
|
@@ -187154,10 +187154,10 @@ function closeObjectNodes(value) {
|
|
|
187154
187154
|
for (const child of Object.values(node)) closeObjectNodes(child);
|
|
187155
187155
|
}
|
|
187156
187156
|
//#endregion
|
|
187157
|
-
//#region
|
|
187157
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/state/todo-list.md?raw
|
|
187158
187158
|
var todo_list_default = "Use this tool to maintain a structured TODO list as you work through a multi-step task. Use it proactively and often when progress tracking helps the current work. This is especially useful in long-running investigations and implementation tasks with several tool calls; in plan mode, write the plan to the plan file rather than tracking it here.\n\n**When to use:**\n- Multi-step tasks that span several tool calls\n- Tracking investigation progress across a large codebase search\n- Planning a sequence of edits before making them\n- After receiving new multi-step instructions, capture the requirements as todos\n- Before starting a tracked task, mark exactly one item as `in_progress`\n- Immediately after finishing a tracked task, mark it `done`; do not batch completions at the end\n\n**When NOT to use:**\n- Single-shot answers that complete in one or two tool calls\n- Trivial requests where tracking adds no clarity\n- Purely conversational or informational replies\n\n**Avoid churn:**\n- Do not re-call this tool when nothing meaningful has changed since the last call — update the list only after real progress.\n- When unsure of the current state, call query mode first (omit `todos`) to check the list before deciding what to update.\n- If no available tool can move any task forward, tell the user where you are stuck instead of repeatedly re-ordering the same todos.\n\n**How to use:**\n- Call with `todos: [...]` to replace the full list. Statuses: `pending` / `in_progress` / `done` / `blocked` / `waiting_approval` / `aborted`.\n- Call with no `todos` argument to retrieve the current list without changing it.\n- Call with `todos: []` to clear the list.\n- Keep titles short and actionable (e.g. \"Read session-control.ts\", \"Add planMode flag to TurnManager\").\n- Update statuses as you make progress.\n- When work is underway, keep exactly one task `in_progress`.\n- Only mark a task `done` when it is fully accomplished.\n- Never mark a task `done` if tests are failing, implementation is partial, unresolved errors remain, or required files/dependencies could not be found.\n- Use `blocked` when progress requires a missing dependency or unresolved condition; include the reason and what would unblock the task in its title.\n- Use `waiting_approval` when the next action requires the user's approval; include the prepared result and the approval needed in its title.\n- Use `aborted` for work that has been stopped without completion; retain its last reached state in the title.\n";
|
|
187159
187159
|
//#endregion
|
|
187160
|
-
//#region
|
|
187160
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/state/todo-list.ts
|
|
187161
187161
|
/**
|
|
187162
187162
|
* TodoListTool — structured TODO list management tool.
|
|
187163
187163
|
*
|
|
@@ -230114,7 +230114,7 @@ function normalizeMime(mimeType) {
|
|
|
230114
230114
|
return lower === "image/jpg" ? "image/jpeg" : lower;
|
|
230115
230115
|
}
|
|
230116
230116
|
//#endregion
|
|
230117
|
-
//#region
|
|
230117
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/turn/vision-reader.ts
|
|
230118
230118
|
const SUPPORTED_IMAGE_MIME_TYPES = new Set([
|
|
230119
230119
|
"image/png",
|
|
230120
230120
|
"image/jpeg",
|
|
@@ -230736,7 +230736,7 @@ function waitForAbort(promise, signal) {
|
|
|
230736
230736
|
});
|
|
230737
230737
|
}
|
|
230738
230738
|
//#endregion
|
|
230739
|
-
//#region
|
|
230739
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/turn/kosong-llm.ts
|
|
230740
230740
|
/**
|
|
230741
230741
|
* Kosong-backed implementation of the loop `LLM` interface.
|
|
230742
230742
|
*
|
|
@@ -231082,10 +231082,10 @@ function readTypicalCompactionDuration(provider, model, home) {
|
|
|
231082
231082
|
};
|
|
231083
231083
|
}
|
|
231084
231084
|
//#endregion
|
|
231085
|
-
//#region
|
|
231085
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/compaction/compaction-instruction.md?raw
|
|
231086
231086
|
var compaction_instruction_default = "You are about to run out of context. Write a first-person handoff note to\nyourself so you can seamlessly continue this task after the earlier\nconversation is cleared.\n\n--- This message is a direct task, not part of the above conversation ---\n\nWrite the note as your own continuing train of thought — first person, present\ntense, the way you would reason through the next move. Do not write a\nthird-party report about someone else's work, and do not impose rigid section\nheadings; let the shape follow the task. Write the note in the same language the\nconversation has been using — do not switch to English just because these\ninstructions happen to be in English.\n\nMake the note self-sufficient: the next turn will see only your most recent user\nmessages and this note — every assistant message, tool call, and tool result\nabove will be gone. In your own words, preserve what you genuinely need to\ncontinue:\n\n- What the latest request is actually asking for: your reading of its intent and\n any ambiguity you have already resolved — not a re-transcription, since what\n fits is kept verbatim in your most recent messages. But those kept messages are\n size-capped, so a long request is truncated there: if the latest request is\n large (a big paste or file), preserve the parts at risk of being dropped —\n above all the actual ask. If several requests are in play, say which one governs\n the next move, and re-quote any still-relevant earlier request that may have\n scrolled out of the kept messages.\n- The instructions and constraints currently in force (user preferences,\n project rules, environment and tooling limits) — condensed to what still\n matters, keeping decisions you have already settled (what you chose and why)\n separate from questions still open, so you neither silently reopen a closed\n choice nor treat an undecided point as decided.\n- What has actually been done, at high fidelity: keep the exact commands that\n were run, the exact file paths touched, and whether each succeeded or failed —\n and the results themselves, not just the commands: the concrete values\n returned, the key lines or error text, the schema or signature a lookup\n revealed, since re-running to recover them may be slow or impossible. Keep only\n the final working version of any code; drop intermediate attempts and\n already-resolved errors.\n- What you still don't know: context the next step depends on that this\n conversation never established — files or paths referenced but not yet read,\n schemas or APIs assumed but unseen, questions the user has not answered. Name\n these gaps so the next turn goes and checks them instead of assuming.\n- The forward plan — and this is the moment to invest in it. Right now you\n hold more context on this task than you ever will again; the next turn\n resumes with less, so the plan you commit here is the one it will follow.\n Give the exact next command or tool call, but don't stop at the next step:\n set out the remaining sequence to finish, the decisions you have already\n made for those upcoming steps (so the next turn doesn't reopen them), the\n obstacles or edge cases you can already foresee and how you mean to handle\n them, and any work you can commit to now — the exact patch, query, or shape\n of the final answer you already know you will produce. Anything you settle\n here is one less thing the next turn must rediscover. Include any required\n format for the final answer.\n\nYour TODO list is re-attached automatically below this note from its live\nsource, so do not transcribe it — copying it wastes space and can contradict the\nlive version. What that list cannot hold is the reasoning between tasks — why one\nwas reordered or dropped, or a decision on one that constrains another — so\nrecord that instead.\n\nBe honest about uncertainty. If an earlier step claimed something was done but\nwas never verified (tests \"passing\", a fix \"working\", a file \"created\"), say so\nplainly and treat it as unverified rather than fact — re-check before relying\non it.\n\nBe concise, and keep the note proportional to the task: a long multi-step task\nwarrants detail, but a trivial or nearly finished exchange needs only a sentence\nor two — do not pad it out. Include the critical data, identifiers, and\nreferences needed to continue, and omit anything that does not change the next\nmove.\n\nRespond with text only. Do not call any tools — you already have everything you\nneed in the conversation history.\n\n{% if customInstruction %}\nOptional user instruction:\n{{ customInstruction }}\n{% endif %}\n";
|
|
231087
231087
|
//#endregion
|
|
231088
|
-
//#region
|
|
231088
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/compaction/strategy.ts
|
|
231089
231089
|
/**
|
|
231090
231090
|
* Resolve ratios against the provider window. Legacy working-budget caps are
|
|
231091
231091
|
* opt-in because fixed prompts and tools may already exceed those caps.
|
|
@@ -231137,7 +231137,7 @@ var DefaultCompactionStrategy = class {
|
|
|
231137
231137
|
}
|
|
231138
231138
|
};
|
|
231139
231139
|
//#endregion
|
|
231140
|
-
//#region
|
|
231140
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/compaction/handoff.ts
|
|
231141
231141
|
/**
|
|
231142
231142
|
* Compaction handoff helpers.
|
|
231143
231143
|
*
|
|
@@ -232554,7 +232554,7 @@ function extractCompactionSummary(response) {
|
|
|
232554
232554
|
return summary;
|
|
232555
232555
|
}
|
|
232556
232556
|
//#endregion
|
|
232557
|
-
//#region
|
|
232557
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/compaction/micro-policy.ts
|
|
232558
232558
|
const PRESSURE_RATIO = .75;
|
|
232559
232559
|
const MIN_ADVANCE_MESSAGES = 20;
|
|
232560
232560
|
function microHistoricalCutoff(historyLength, keepRecentMessages) {
|
|
@@ -232619,7 +232619,7 @@ function redundantToolResultReferences(messages, cutoff, referenceBoundary = mes
|
|
|
232619
232619
|
return references;
|
|
232620
232620
|
}
|
|
232621
232621
|
//#endregion
|
|
232622
|
-
//#region
|
|
232622
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/compaction/micro.ts
|
|
232623
232623
|
const DEFAULT_CONFIG = {
|
|
232624
232624
|
keepRecentMessages: 4,
|
|
232625
232625
|
minContentTokens: 100,
|
|
@@ -232837,7 +232837,7 @@ function publicCronRun(run) {
|
|
|
232837
232837
|
};
|
|
232838
232838
|
}
|
|
232839
232839
|
//#endregion
|
|
232840
|
-
//#region
|
|
232840
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/run-store.ts
|
|
232841
232841
|
const envelopeSchema = object({
|
|
232842
232842
|
version: literal(1),
|
|
232843
232843
|
scope: string().regex(/^[0-9a-f]{64}$/),
|
|
@@ -233010,7 +233010,7 @@ var CronRunStore = class {
|
|
|
233010
233010
|
}
|
|
233011
233011
|
};
|
|
233012
233012
|
//#endregion
|
|
233013
|
-
//#region
|
|
233013
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/run-output.ts
|
|
233014
233014
|
function clean(text) {
|
|
233015
233015
|
return stripVTControlCharacters(text).replaceAll(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F]/g, "");
|
|
233016
233016
|
}
|
|
@@ -233185,7 +233185,7 @@ var CronRunOutputCollector = class {
|
|
|
233185
233185
|
}
|
|
233186
233186
|
};
|
|
233187
233187
|
//#endregion
|
|
233188
|
-
//#region
|
|
233188
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/clock.ts
|
|
233189
233189
|
/**
|
|
233190
233190
|
* Clock sources for the cron scheduler.
|
|
233191
233191
|
*
|
|
@@ -233295,7 +233295,7 @@ function debugInvalidSpec(spec, reason) {
|
|
|
233295
233295
|
if (process.env["BLUN_CRON_DEBUG"] === "1") process.stderr.write(`[cron/clock] invalid BLUN_CRON_CLOCK spec ${JSON.stringify(spec)}: ${reason} — falling back to system clock\n`);
|
|
233296
233296
|
}
|
|
233297
233297
|
//#endregion
|
|
233298
|
-
//#region
|
|
233298
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/cron-fire-xml.ts
|
|
233299
233299
|
function renderCronFireXml(origin, prompt) {
|
|
233300
233300
|
return [
|
|
233301
233301
|
`<cron-fire jobId="${stringAttr(origin.jobId, "unknown")}" cron="${stringAttr(origin.cron, "unknown")}" recurring="${origin.recurring ? "true" : "false"}" coalescedCount="${String(origin.coalescedCount)}" stale="${origin.stale ? "true" : "false"}">`,
|
|
@@ -233310,7 +233310,7 @@ function stringAttr(value, fallback) {
|
|
|
233310
233310
|
return value.replaceAll("&", "&").replaceAll("\"", """);
|
|
233311
233311
|
}
|
|
233312
233312
|
//#endregion
|
|
233313
|
-
//#region
|
|
233313
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/persist.ts
|
|
233314
233314
|
/**
|
|
233315
233315
|
* Cron task persistence.
|
|
233316
233316
|
*
|
|
@@ -233371,7 +233371,7 @@ function createCronPersistStore(sessionDir) {
|
|
|
233371
233371
|
});
|
|
233372
233372
|
}
|
|
233373
233373
|
//#endregion
|
|
233374
|
-
//#region
|
|
233374
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/session-store.ts
|
|
233375
233375
|
/**
|
|
233376
233376
|
* SessionCronStore — in-memory cron task store for a single CLI session.
|
|
233377
233377
|
*
|
|
@@ -233517,7 +233517,7 @@ var SessionCronStore = class {
|
|
|
233517
233517
|
}
|
|
233518
233518
|
};
|
|
233519
233519
|
//#endregion
|
|
233520
|
-
//#region
|
|
233520
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/cron-expr.ts
|
|
233521
233521
|
const MINUTE_RANGE = {
|
|
233522
233522
|
min: 0,
|
|
233523
233523
|
max: 59
|
|
@@ -233810,7 +233810,7 @@ function pad$1(n) {
|
|
|
233810
233810
|
return n < 10 ? `0${n}` : String(n);
|
|
233811
233811
|
}
|
|
233812
233812
|
//#endregion
|
|
233813
|
-
//#region
|
|
233813
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/jitter.ts
|
|
233814
233814
|
const DEFAULT_CRON_JITTER_CONFIG = {
|
|
233815
233815
|
recurringMaxFractionOfPeriod: .1,
|
|
233816
233816
|
recurringMaxMs: 15 * 6e4,
|
|
@@ -233889,7 +233889,7 @@ function oneShotJitteredNextCronRunMs(task, idealMs, config = DEFAULT_CRON_JITTE
|
|
|
233889
233889
|
return shifted;
|
|
233890
233890
|
}
|
|
233891
233891
|
//#endregion
|
|
233892
|
-
//#region
|
|
233892
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/scheduler.ts
|
|
233893
233893
|
const DEFAULT_POLL_INTERVAL_MS = 1e3;
|
|
233894
233894
|
/**
|
|
233895
233895
|
* Cap on how many ideal fires we attempt to enumerate when computing
|
|
@@ -234084,14 +234084,14 @@ function createCronScheduler(opts) {
|
|
|
234084
234084
|
};
|
|
234085
234085
|
}
|
|
234086
234086
|
//#endregion
|
|
234087
|
-
//#region
|
|
234087
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/telemetry-events.ts
|
|
234088
234088
|
/** Telemetry event names emitted by the cron subsystem. Centralised so a typo can't drift a metric. */
|
|
234089
234089
|
const CRON_SCHEDULED = "cron_scheduled";
|
|
234090
234090
|
const CRON_FIRED = "cron_fired";
|
|
234091
234091
|
const CRON_MISSED = "cron_missed";
|
|
234092
234092
|
const CRON_DELETED = "cron_deleted";
|
|
234093
234093
|
//#endregion
|
|
234094
|
-
//#region
|
|
234094
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/cron/manager.ts
|
|
234095
234095
|
/**
|
|
234096
234096
|
* Threshold past which a recurring task is flagged `stale: true` on its
|
|
234097
234097
|
* fire `origin`. One-shot tasks never carry the stale flag — they are
|
|
@@ -234741,7 +234741,7 @@ function cronRunId(origin) {
|
|
|
234741
234741
|
if (origin.kind === "system_trigger" && origin.name === "goal_continuation") return origin.cronRunId;
|
|
234742
234742
|
}
|
|
234743
234743
|
//#endregion
|
|
234744
|
-
//#region
|
|
234744
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/policies/sensitive.ts
|
|
234745
234745
|
/**
|
|
234746
234746
|
* Sensitive-file detection.
|
|
234747
234747
|
*
|
|
@@ -234814,7 +234814,7 @@ function isSensitiveFile(path) {
|
|
|
234814
234814
|
return false;
|
|
234815
234815
|
}
|
|
234816
234816
|
//#endregion
|
|
234817
|
-
//#region
|
|
234817
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/policies/path-access.ts
|
|
234818
234818
|
/**
|
|
234819
234819
|
* Path safety guards used by Read/Write/Edit/Grep/Glob.
|
|
234820
234820
|
*
|
|
@@ -234937,7 +234937,7 @@ function resolvePathAccessPath(path, options) {
|
|
|
234937
234937
|
}).path;
|
|
234938
234938
|
}
|
|
234939
234939
|
//#endregion
|
|
234940
|
-
//#region
|
|
234940
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/support/path-glob-match.ts
|
|
234941
234941
|
/**
|
|
234942
234942
|
* Match ordinary string fields, like command text or search patterns.
|
|
234943
234943
|
* `*` and `**` work as wildcards, but the value is not treated as a file path.
|
|
@@ -235016,7 +235016,7 @@ function stripLeadingDotPath(value, pathClass) {
|
|
|
235016
235016
|
return value;
|
|
235017
235017
|
}
|
|
235018
235018
|
//#endregion
|
|
235019
|
-
//#region
|
|
235019
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/support/rule-match.ts
|
|
235020
235020
|
const GLOB_LITERAL_SPECIAL = /[\\*?[\]{}()!+@|]/g;
|
|
235021
235021
|
function literalRulePattern(toolName, subject) {
|
|
235022
235022
|
return `${toolName}(${escapeRuleSubjectLiteral(subject)})`;
|
|
@@ -235038,7 +235038,7 @@ function matchRuleSubjects(ruleArgs, subjects, matchesPositivePattern) {
|
|
|
235038
235038
|
return negated ? !hit : hit;
|
|
235039
235039
|
}
|
|
235040
235040
|
//#endregion
|
|
235041
|
-
//#region
|
|
235041
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/time-format.ts
|
|
235042
235042
|
/**
|
|
235043
235043
|
* Render cron-facing timestamps in local wall time with an explicit
|
|
235044
235044
|
* numeric offset. Cron expressions are evaluated in local time, so the
|
|
@@ -235057,7 +235057,7 @@ function pad(n) {
|
|
|
235057
235057
|
return String(n).padStart(2, "0");
|
|
235058
235058
|
}
|
|
235059
235059
|
//#endregion
|
|
235060
|
-
//#region
|
|
235060
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/cron-create.md?raw
|
|
235061
235061
|
var cron_create_default = "Schedule a prompt to be enqueued at a future time. Use for both recurring schedules and one-shot reminders.\n\nUses standard 5-field cron in the user's local timezone: minute hour day-of-month month day-of-week. `0 9 * * *` means 9am local — no timezone conversion needed.\n\n## One-shot tasks (recurring: false)\n\nFor \"remind me at X\" or \"at <time>, do Y\" requests — fire once then auto-delete.\nPin minute/hour/day-of-month/month to specific values:\n \"remind me at 2:30pm today to check the deploy\" → cron: \"30 14 <today_dom> <today_month> *\", recurring: false\n \"tomorrow morning, run the smoke test\" → cron: \"57 8 <tomorrow_dom> <tomorrow_month> *\", recurring: false\n\nOne-shots are best for near-term reminders. A task only fires while its session is still alive (see Session lifetime below), so favor near times — within hours or a few days — rather than scheduling weeks or months ahead.\n\n## Recurring jobs (recurring: true, the default)\n\nA new recurring job replaces previous recurring jobs in this session, including paused jobs and loops created with `/loop`. One-shot reminders and other sessions are unchanged. Replacement happens only after the new request is validated and approved; rejected requests leave the previous loop intact.\n\nFor \"every N minutes\" / \"every hour\" / \"weekdays at 9am\" requests:\n \"*/5 * * * *\" (every 5 min), \"0 * * * *\" (hourly), \"0 9 * * 1-5\" (weekdays at 9am local)\n\n## Avoid the :00 and :30 minute marks when the task allows it\n\nEvery user who asks for \"9am\" gets `0 9`, and every user who asks for \"hourly\" gets `0 *` — which means requests from across the planet land on the API at the same instant. When the user's request is approximate, pick a minute that is NOT 0 or 30:\n \"every morning around 9\" → \"57 8 * * *\" or \"3 9 * * *\" (not \"0 9 * * *\")\n \"hourly\" → \"7 * * * *\" (not \"0 * * * *\")\n \"in an hour or so, remind me to...\" → pick whatever minute you land on, don't round\n\nOnly use minute 0 or 30 when the user names that exact time and clearly means it (\"at 9:00 sharp\", \"at half past\", coordinating with a meeting). When in doubt, nudge a few minutes early or late — the user will not notice, and the fleet will.\n\n## Coalesce semantics\n\nFires are delivered only while the session is idle: a fire that comes due during an active turn is held and delivered at the next idle moment, never injected mid-turn.\n\nIf the scheduler slept past multiple ideal fire times (laptop closed, long-running turn, etc.), only **one** fire is delivered when it wakes up. The origin carries `coalescedCount` showing how many ideal fires were collapsed into this single delivery. You should treat `coalescedCount > 1` as \"I missed some checks; only the latest state matters\" rather than running the prompt that many times.\n\n## Cron-fire envelope\n\nWhen a cron task fires, the prompt you scheduled is re-injected wrapped in an XML envelope that exposes the fire context:\n\n```\n<cron-fire jobId=\"...\" cron=\"...\" recurring=\"true|false\" coalescedCount=\"N\" stale=\"true|false\">\n<prompt>\nyour original prompt text, verbatim\n</prompt>\n</cron-fire>\n```\n\nThe envelope is parseable. Use `coalescedCount > 1` to know multiple ideal fires were collapsed into a single delivery (treat as \"only the latest state matters\"), and `stale=\"true\"` as a cue that the task is past its 7-day threshold.\n\n## 7-day stale behavior\n\nRecurring tasks that have been alive for more than 7 days fire one\nfinal time with `stale: true` on the envelope, and the system then\nauto-deletes the task. The flag is the model's notice that this is\nthe last delivery. If the schedule is still wanted, call `CronCreate`\nagain with the same `cron` and `prompt` — that resets `createdAt` and\nstarts a fresh 7-day window. One-shot tasks are never marked stale.\n\n## Jitter behavior\n\nAnti-herd jitter is applied deterministically per task id:\n - Recurring: ideal fire time is shifted **forward** by an offset ≤ min(10% of the cron period, 15 minutes). A `*/5 * * * *` task can drift up to 30s; a `0 9 * * *` task can drift up to 15 minutes.\n - One-shot: only when the ideal fire lands on `:00` or `:30` of the hour, the fire is pulled **earlier** by ≤ 90 seconds. Other minutes pass through unchanged.\n\n## One-shot vs recurring — when to pick which\n\nUse `recurring: false` for \"remind me at X\" style requests, single deadlines, \"in N minutes do Y\", and any task that should not repeat. Use `recurring: true` for periodic polling (CI status, build watchers, scheduled reports), workday rituals, and anything the user explicitly described as recurring.\n\n## Session lifetime\n\nCron tasks live in the current blun CLI session. When you exit, they\nare persisted under the session homedir; the next `blun resume` of the\nsame session reloads them and the scheduler resumes from each task's\n`createdAt`. Fire times that fell during the offline window are\ncollapsed into a single delivery via `coalescedCount` (and recurring\ntasks past their 7-day window arrive with `stale: true` as their final\ndelivery).\n\nTasks do **not** carry over into a brand-new session — they are scoped\nto the resumed session id, not to the working directory.\n\n## Limits\n\nA session holds at most 50 live cron tasks; creating one beyond that is rejected. (The `prompt` body is also capped — see its parameter description.) Expressions that never fire within the next 5 years (e.g. `0 0 31 2 *`, an impossible date) are rejected at create time.\n\n## Returned fields\n\n`id` (8-hex), `cron` (the normalized expression), `humanSchedule` (English summary), `recurring`,\n`nextFireAt` (local ISO timestamp with numeric offset, or null). `id` is needed by `CronDelete`.\n\n## Tell the user how to cancel or modify\n\nAfter successfully creating a task, proactively tell the user how they can cancel or modify it later. Users have no direct `/cron` command or self-service UI to manage reminders themselves; they must ask the model to make changes (e.g. \"cancel my 9am reminder\" or \"change my daily check to 10am\"). Include the task `id` in your message so the user can reference it.\n";
|
|
235062
235062
|
/**
|
|
235063
235063
|
* Hard ceiling on `prompt` byte length (UTF-8). The zod `.max(...)`
|
|
@@ -235179,7 +235179,7 @@ function formatOutput(o) {
|
|
|
235179
235179
|
].join("\n");
|
|
235180
235180
|
}
|
|
235181
235181
|
//#endregion
|
|
235182
|
-
//#region
|
|
235182
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/session-loop.ts
|
|
235183
235183
|
const MAX_LOOP_PROMPT_BYTES = 8 * 1024;
|
|
235184
235184
|
const LOOP_INTERVAL_PATTERN = /^([1-9]\d*)(m|h|d)$/i;
|
|
235185
235185
|
var SessionLoopMode = class {
|
|
@@ -235294,7 +235294,7 @@ function invalidLoopInterval(rawInterval) {
|
|
|
235294
235294
|
return new BlunError(ErrorCodes.LOOP_INTERVAL_INVALID, `Invalid loop interval ${JSON.stringify(rawInterval)}; use an exact cron cadence such as 1m, 5m, 15m, 1h, 6h, or 1d`);
|
|
235295
235295
|
}
|
|
235296
235296
|
//#endregion
|
|
235297
|
-
//#region
|
|
235297
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/config/blun-env-params.ts
|
|
235298
235298
|
function thinkingIsDisabled(effort) {
|
|
235299
235299
|
return effort === "off" || effort === "none";
|
|
235300
235300
|
}
|
|
@@ -235350,7 +235350,7 @@ function applyBlunEnvThinkingKeep(provider, thinkingEffort, env = process.env) {
|
|
|
235350
235350
|
return provider.withExtraBody({ thinking: { keep } });
|
|
235351
235351
|
}
|
|
235352
235352
|
//#endregion
|
|
235353
|
-
//#region
|
|
235353
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/config/thinking.ts
|
|
235354
235354
|
function supportsThinking(model) {
|
|
235355
235355
|
if (model === void 0) return false;
|
|
235356
235356
|
const caps = model.capabilities ?? [];
|
|
@@ -235398,7 +235398,7 @@ function resolveThinkingEffort(requested, config, model) {
|
|
|
235398
235398
|
return effort;
|
|
235399
235399
|
}
|
|
235400
235400
|
//#endregion
|
|
235401
|
-
//#region
|
|
235401
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/config/index.ts
|
|
235402
235402
|
var ConfigState = class {
|
|
235403
235403
|
agent;
|
|
235404
235404
|
_cwd;
|
|
@@ -235526,7 +235526,7 @@ var ConfigState = class {
|
|
|
235526
235526
|
}
|
|
235527
235527
|
};
|
|
235528
235528
|
//#endregion
|
|
235529
|
-
//#region
|
|
235529
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/context/request-text-origins.ts
|
|
235530
235530
|
const kinds = new Set([
|
|
235531
235531
|
"user",
|
|
235532
235532
|
"skill_activation",
|
|
@@ -235599,7 +235599,7 @@ function summarizeRequestTextOrigins(messages) {
|
|
|
235599
235599
|
};
|
|
235600
235600
|
}
|
|
235601
235601
|
//#endregion
|
|
235602
|
-
//#region
|
|
235602
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/context/projector.ts
|
|
235603
235603
|
function project(history, options) {
|
|
235604
235604
|
let result = mergeAdjacentUserMessages(history, options?.onAnomaly);
|
|
235605
235605
|
if (options?.dedupeDuplicateToolCalls === true) result = dedupeDuplicateToolCalls(result, options.onAnomaly);
|
|
@@ -235863,10 +235863,10 @@ function trimTrailingOpenToolExchange(history) {
|
|
|
235863
235863
|
return assistant.toolCalls.every((toolCall) => trailingToolCallIds.has(toolCall.id)) ? [...history] : history.slice(0, lastNonToolIndex);
|
|
235864
235864
|
}
|
|
235865
235865
|
//#endregion
|
|
235866
|
-
//#region
|
|
235866
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/context/types.ts
|
|
235867
235867
|
const USER_PROMPT_ORIGIN = { kind: "user" };
|
|
235868
235868
|
//#endregion
|
|
235869
|
-
//#region
|
|
235869
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/context/index.ts
|
|
235870
235870
|
const TOOL_ERROR_STATUS$1 = "<system>ERROR: Tool execution failed.</system>";
|
|
235871
235871
|
const TOOL_EMPTY_STATUS$1 = "<system>Tool output is empty.</system>";
|
|
235872
235872
|
const TOOL_EMPTY_ERROR_STATUS$1 = "<system>ERROR: Tool execution failed. Tool output is empty.</system>";
|
|
@@ -236707,7 +236707,7 @@ function formatUndoUnavailableMessage(requestedCount, undoableCount, stoppedAtCo
|
|
|
236707
236707
|
}
|
|
236708
236708
|
}
|
|
236709
236709
|
//#endregion
|
|
236710
|
-
//#region
|
|
236710
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/injector.ts
|
|
236711
236711
|
function latestMatchingSystemReminderIndex(history, variant, injection) {
|
|
236712
236712
|
const latestIndex = history.findLastIndex((message) => message.origin?.kind === "injection" && message.origin.variant === variant);
|
|
236713
236713
|
const latest = history[latestIndex];
|
|
@@ -236757,7 +236757,7 @@ var init_injector = __esmMin((() => {
|
|
|
236757
236757
|
};
|
|
236758
236758
|
}));
|
|
236759
236759
|
//#endregion
|
|
236760
|
-
//#region
|
|
236760
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/error-memory.ts
|
|
236761
236761
|
init_injector();
|
|
236762
236762
|
/**
|
|
236763
236763
|
* Error-memory injector.
|
|
@@ -236880,7 +236880,7 @@ const SEEDED_ERROR_MEMORY_PATTERNS = [
|
|
|
236880
236880
|
}
|
|
236881
236881
|
];
|
|
236882
236882
|
//#endregion
|
|
236883
|
-
//#region
|
|
236883
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/error-memory.ts
|
|
236884
236884
|
/**
|
|
236885
236885
|
* Error-memory manager.
|
|
236886
236886
|
*
|
|
@@ -236942,7 +236942,7 @@ var ErrorMemory = class {
|
|
|
236942
236942
|
}
|
|
236943
236943
|
};
|
|
236944
236944
|
//#endregion
|
|
236945
|
-
//#region
|
|
236945
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/utils/runtime-env.ts
|
|
236946
236946
|
/** Overlay host runtime values without mutating or retaining the shared environment. */
|
|
236947
236947
|
function overlayRuntimeEnv(base, runtime) {
|
|
236948
236948
|
const result = {};
|
|
@@ -236956,7 +236956,7 @@ function overlayRuntimeEnv(base, runtime) {
|
|
|
236956
236956
|
return result;
|
|
236957
236957
|
}
|
|
236958
236958
|
//#endregion
|
|
236959
|
-
//#region
|
|
236959
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/hooks/runner.ts
|
|
236960
236960
|
const DEFAULT_TIMEOUT_SECONDS = 30;
|
|
236961
236961
|
const KILL_GRACE_MS = 100;
|
|
236962
236962
|
const OptionalStringSchema = preprocess((value) => {
|
|
@@ -237192,7 +237192,7 @@ function errorMessage$3(error) {
|
|
|
237192
237192
|
return error instanceof Error ? error.message : String(error);
|
|
237193
237193
|
}
|
|
237194
237194
|
//#endregion
|
|
237195
|
-
//#region
|
|
237195
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/hooks/engine.ts
|
|
237196
237196
|
const DEFAULT_HOOK_TIMEOUT_SECONDS = 30;
|
|
237197
237197
|
var HookEngine = class {
|
|
237198
237198
|
options;
|
|
@@ -237406,7 +237406,7 @@ function camelToSnake(value) {
|
|
|
237406
237406
|
return value.replaceAll(/[A-Z]/g, (ch) => `_${ch.toLowerCase()}`);
|
|
237407
237407
|
}
|
|
237408
237408
|
//#endregion
|
|
237409
|
-
//#region
|
|
237409
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/hooks/user-prompt.ts
|
|
237410
237410
|
function renderHookResult(event, message) {
|
|
237411
237411
|
return `<hook_result hook_event="${event}">\n${message}\n</hook_result>`;
|
|
237412
237412
|
}
|
|
@@ -237451,7 +237451,7 @@ function isNonEmptyString(value) {
|
|
|
237451
237451
|
return value !== void 0 && value.length > 0;
|
|
237452
237452
|
}
|
|
237453
237453
|
//#endregion
|
|
237454
|
-
//#region
|
|
237454
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/background/format.ts
|
|
237455
237455
|
function formatValue(value) {
|
|
237456
237456
|
return typeof value === "string" ? value : String(value);
|
|
237457
237457
|
}
|
|
@@ -237462,10 +237462,10 @@ function formatPlainObject(record) {
|
|
|
237462
237462
|
return Object.entries(record).filter(([, value]) => value !== void 0 && value !== null).map(([key, value]) => `${fieldName(key)}: ${formatValue(value)}`).join("\n");
|
|
237463
237463
|
}
|
|
237464
237464
|
//#endregion
|
|
237465
|
-
//#region
|
|
237465
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/background/task-list.md?raw
|
|
237466
237466
|
var task_list_default = "List background tasks and their current status.\n\nUse this tool to discover which background tasks exist and where each one\nstands. It is the entry point for inspecting background work: it returns a\ntask ID, status, and description for every task it reports, plus the command,\nPID, and (once finished) exit code for shell tasks, and a stop reason for any\ntask that ended early.\n\nGuidelines:\n\n- After a context compaction, or whenever you are unsure which background\n tasks are running or what their task IDs are, call this tool to\n re-enumerate them instead of guessing a task ID.\n- Prefer the default `active_only=true`, which lists only non-terminal tasks.\n Pass `active_only=false` only when you specifically need to see tasks that\n have already finished. With `active_only=false` the result may also include\n `lost` tasks — tasks left over from a previous process that can no longer be\n inspected or controlled; treat them as already terminated.\n- `limit` caps how many tasks are returned. It accepts a value between 1 and\n 100 and defaults to 20 when omitted.\n- This tool only lists tasks; it does not return their output. Use it first\n to locate the task ID you need, then call `TaskOutput` with that ID to read\n the task's output and details.\n- This tool is read-only and does not change any state, so it is always safe\n to call, including in plan mode.\n";
|
|
237467
237467
|
//#endregion
|
|
237468
|
-
//#region
|
|
237468
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/background/task-list.ts
|
|
237469
237469
|
/**
|
|
237470
237470
|
* TaskListTool — list background tasks.
|
|
237471
237471
|
*/
|
|
@@ -237503,7 +237503,7 @@ var TaskListTool = class {
|
|
|
237503
237503
|
}
|
|
237504
237504
|
};
|
|
237505
237505
|
//#endregion
|
|
237506
|
-
//#region
|
|
237506
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/action-style.ts
|
|
237507
237507
|
init_injector();
|
|
237508
237508
|
const STYLE_GUIDANCE = {
|
|
237509
237509
|
default: "Complete coding tasks efficiently. Keep responses concise while still reporting concrete results, blockers, and decisions.",
|
|
@@ -237550,7 +237550,7 @@ function wrapSystemReminder(content) {
|
|
|
237550
237550
|
return `<system-reminder>\n${content.trim()}\n</system-reminder>`;
|
|
237551
237551
|
}
|
|
237552
237552
|
//#endregion
|
|
237553
|
-
//#region
|
|
237553
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/goal.ts
|
|
237554
237554
|
init_injector();
|
|
237555
237555
|
/**
|
|
237556
237556
|
* Injects the current goal into the main agent's context once per turn, at the
|
|
@@ -237658,7 +237658,7 @@ function formatElapsed$1(ms) {
|
|
|
237658
237658
|
return `${Math.floor(totalSeconds / 60)}m${(totalSeconds % 60).toString().padStart(2, "0")}s`;
|
|
237659
237659
|
}
|
|
237660
237660
|
//#endregion
|
|
237661
|
-
//#region
|
|
237661
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/learning/mistake-relevance.ts
|
|
237662
237662
|
const MAX_CHARS = 3e3;
|
|
237663
237663
|
const MAX_SECTIONS = 5;
|
|
237664
237664
|
const STOP_WORDS = new Set("aber alle alles auch das dem den der des die ein eine einem einen einer eines fuer haben hier immer jetzt kann machen mehr mich nicht noch oder sein sind soll und uns von was wenn werden wie with that this from have into your you the and for are not but all can".split(" "));
|
|
@@ -237863,7 +237863,7 @@ function selectRelevantMistakeSources(sources, query) {
|
|
|
237863
237863
|
};
|
|
237864
237864
|
}
|
|
237865
237865
|
//#endregion
|
|
237866
|
-
//#region
|
|
237866
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/mistake-md-register.ts
|
|
237867
237867
|
/**
|
|
237868
237868
|
* Mistake.md Zaehler-Register (D1 aus dem Sollverhalten).
|
|
237869
237869
|
*
|
|
@@ -238019,7 +238019,7 @@ function handEntryCount(register) {
|
|
|
238019
238019
|
return register.entries.filter((e) => e.origin === "hand").length;
|
|
238020
238020
|
}
|
|
238021
238021
|
//#endregion
|
|
238022
|
-
//#region
|
|
238022
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/mistake-md-writer.ts
|
|
238023
238023
|
/**
|
|
238024
238024
|
* Mistake.md Rueckkanal — Writer (B1-B3, A4, C1-C3 aus dem Sollverhalten).
|
|
238025
238025
|
*
|
|
@@ -238251,7 +238251,7 @@ async function appendMistakeEntry(errorTextOrDir, originOrErrorText = "program",
|
|
|
238251
238251
|
});
|
|
238252
238252
|
}
|
|
238253
238253
|
//#endregion
|
|
238254
|
-
//#region
|
|
238254
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/mistake-md.ts
|
|
238255
238255
|
/**
|
|
238256
238256
|
* Stufe 2b: Re-reads project-local Mistake.md before every turn and injects
|
|
238257
238257
|
* it as a system-reminder when the content has changed since the last injection.
|
|
@@ -238399,7 +238399,7 @@ async function readProjectMistakeSources(agent) {
|
|
|
238399
238399
|
return sources;
|
|
238400
238400
|
}
|
|
238401
238401
|
//#endregion
|
|
238402
|
-
//#region
|
|
238402
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/permission-mode.ts
|
|
238403
238403
|
init_injector();
|
|
238404
238404
|
const AUTO_MODE_ENTER_REMINDER = [
|
|
238405
238405
|
"Auto permission mode is active. Tool approvals will be handled automatically while this mode remains enabled.",
|
|
@@ -238426,7 +238426,7 @@ var PermissionModeInjector = class extends DynamicInjector {
|
|
|
238426
238426
|
}
|
|
238427
238427
|
};
|
|
238428
238428
|
//#endregion
|
|
238429
|
-
//#region
|
|
238429
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/personal-memory-recall.ts
|
|
238430
238430
|
const PERSONAL_MEMORY_HOST_RECALL_HANDLER = "__blun_personal_memory_recall";
|
|
238431
238431
|
const RECALL_LIMIT = 8;
|
|
238432
238432
|
const RECALL_TIMEOUT_MS = 2e3;
|
|
@@ -238711,7 +238711,7 @@ function isRecord$2(value) {
|
|
|
238711
238711
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
238712
238712
|
}
|
|
238713
238713
|
//#endregion
|
|
238714
|
-
//#region
|
|
238714
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/plugin-session-start.ts
|
|
238715
238715
|
init_injector();
|
|
238716
238716
|
/**
|
|
238717
238717
|
* Renders the `<plugin_session_start>` reminder blocks for the currently enabled
|
|
@@ -238760,7 +238760,7 @@ function renderSessionStartBlock(sessionStart, skill, skillContent) {
|
|
|
238760
238760
|
return `<plugin_session_start plugin="${escapeXmlAttr(sessionStart.pluginId)}" skill="${escapeXmlAttr(skill.name)}">\n${skillContent}\n</plugin_session_start>`;
|
|
238761
238761
|
}
|
|
238762
238762
|
//#endregion
|
|
238763
|
-
//#region
|
|
238763
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/tool-naming.ts
|
|
238764
238764
|
const MCP_NAME_PREFIX = "mcp__";
|
|
238765
238765
|
const MCP_NAME_SEPARATOR = "__";
|
|
238766
238766
|
/**
|
|
@@ -238802,7 +238802,7 @@ function stableHash8(input) {
|
|
|
238802
238802
|
return hash.toString(16).padStart(8, "0");
|
|
238803
238803
|
}
|
|
238804
238804
|
//#endregion
|
|
238805
|
-
//#region
|
|
238805
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/language-guard.ts
|
|
238806
238806
|
init_injector();
|
|
238807
238807
|
const SERVER_NAME$1 = "blun-language-guard";
|
|
238808
238808
|
const REVIEW_TOOLS = [
|
|
@@ -238843,7 +238843,7 @@ var LanguageGuardInjector = class extends DynamicInjector {
|
|
|
238843
238843
|
}
|
|
238844
238844
|
};
|
|
238845
238845
|
//#endregion
|
|
238846
|
-
//#region
|
|
238846
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/plan-mode.ts
|
|
238847
238847
|
init_injector();
|
|
238848
238848
|
const PLAN_MODE_DEDUP_MIN_TURNS = 2;
|
|
238849
238849
|
const PLAN_MODE_FULL_REFRESH_TURNS = 5;
|
|
@@ -238990,7 +238990,7 @@ function exitReminder() {
|
|
|
238990
238990
|
return `Plan mode is no longer active. The read-only and plan-file-only restrictions from plan mode no longer apply. Continue with the approved plan using the normal tool and permission rules.`;
|
|
238991
238991
|
}
|
|
238992
238992
|
//#endregion
|
|
238993
|
-
//#region
|
|
238993
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/tool-awareness.ts
|
|
238994
238994
|
init_injector();
|
|
238995
238995
|
/**
|
|
238996
238996
|
* App-independent tool-awareness reminder for every BLUN Code model.
|
|
@@ -239036,7 +239036,7 @@ function buildToolAwarenessReminder() {
|
|
|
239036
239036
|
].join("\n");
|
|
239037
239037
|
}
|
|
239038
239038
|
//#endregion
|
|
239039
|
-
//#region
|
|
239039
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/loop/tool-args-parse.ts
|
|
239040
239040
|
function parseToolCallArguments(raw) {
|
|
239041
239041
|
if (raw === null || raw.length === 0) return {
|
|
239042
239042
|
success: true,
|
|
@@ -239059,7 +239059,7 @@ function parseToolCallArguments(raw) {
|
|
|
239059
239059
|
}
|
|
239060
239060
|
}
|
|
239061
239061
|
//#endregion
|
|
239062
|
-
//#region
|
|
239062
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/learning/validated-learning.ts
|
|
239063
239063
|
const CANDIDATE_TTL_MS = 1440 * 60 * 1e3;
|
|
239064
239064
|
const MAX_RECORD_BYTES = 64 * 1024;
|
|
239065
239065
|
const MAX_CANDIDATES = 1e4;
|
|
@@ -239609,7 +239609,7 @@ function syncValidatedLearningCandidate(history, options) {
|
|
|
239609
239609
|
}
|
|
239610
239610
|
}
|
|
239611
239611
|
//#endregion
|
|
239612
|
-
//#region
|
|
239612
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/validated-learning-signal.ts
|
|
239613
239613
|
init_injector();
|
|
239614
239614
|
const GUIDANCE = [
|
|
239615
239615
|
"Use MistakeRecord only when the red-to-green result exposes a reusable lesson.",
|
|
@@ -239667,7 +239667,7 @@ var ValidatedLearningSignalInjector = class extends DynamicInjector {
|
|
|
239667
239667
|
}
|
|
239668
239668
|
};
|
|
239669
239669
|
//#endregion
|
|
239670
|
-
//#region
|
|
239670
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/mission-contract-evidence.js
|
|
239671
239671
|
function createEvidenceApi(dependencies) {
|
|
239672
239672
|
"use strict";
|
|
239673
239673
|
const { COMMAND_TOOL_PATTERN, FILE_TOOL_PATTERN, SCHEMA_VERSION, cleanText, id, normalize, redact, uniqueStrings } = dependencies;
|
|
@@ -240081,7 +240081,7 @@ function createEvidenceApi(dependencies) {
|
|
|
240081
240081
|
}
|
|
240082
240082
|
var init_mission_contract_evidence = __esmMin((() => {}));
|
|
240083
240083
|
//#endregion
|
|
240084
|
-
//#region
|
|
240084
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/mission-contract.js
|
|
240085
240085
|
var missionContractApi, SCHEMA_VERSION, CONTRACT_STATUSES, REQUIREMENT_TYPES, normalize$1, createDraft, validate, publicContract, contractPrompt, redact, createEvidenceState, recordToolStart, recordToolResult, recordFile, recordUrl, recordScreenshot, recordSecurity, recordDecision, recordCheckpoint, evaluateCriteria, canonicalString, sha256, finalizeEvidence;
|
|
240086
240086
|
var init_mission_contract = __esmMin((() => {
|
|
240087
240087
|
init_mission_contract_evidence();
|
|
@@ -240363,7 +240363,7 @@ var init_mission_contract = __esmMin((() => {
|
|
|
240363
240363
|
({SCHEMA_VERSION, CONTRACT_STATUSES, REQUIREMENT_TYPES, normalize: normalize$1, createDraft, validate, publicContract, contractPrompt, redact, createEvidenceState, recordToolStart, recordToolResult, recordFile, recordUrl, recordScreenshot, recordSecurity, recordDecision, recordCheckpoint, evaluateCriteria, canonicalString, sha256, finalizeEvidence} = missionContractApi);
|
|
240364
240364
|
}));
|
|
240365
240365
|
//#endregion
|
|
240366
|
-
//#region
|
|
240366
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/mission-contract-bridge.ts
|
|
240367
240367
|
var mission_contract_bridge_exports = /* @__PURE__ */ __exportAll({
|
|
240368
240368
|
MissionContractInjector: () => MissionContractInjector,
|
|
240369
240369
|
normalize: () => normalize
|
|
@@ -240454,7 +240454,7 @@ var init_mission_contract_bridge = __esmMin((() => {
|
|
|
240454
240454
|
};
|
|
240455
240455
|
}));
|
|
240456
240456
|
//#endregion
|
|
240457
|
-
//#region
|
|
240457
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/injection/manager.ts
|
|
240458
240458
|
const ACTIVE_BACKGROUND_TASK_GUIDANCE = "The conversation was compacted, so the earlier messages that started these background tasks are gone — but the tasks are still running from before. Do not start duplicates. Use TaskOutput to fetch a task’s result, TaskList to list them, and TaskStop to cancel one.";
|
|
240459
240459
|
var InjectionManager = class {
|
|
240460
240460
|
agent;
|
|
@@ -240561,7 +240561,7 @@ var InjectionManager = class {
|
|
|
240561
240561
|
}
|
|
240562
240562
|
};
|
|
240563
240563
|
//#endregion
|
|
240564
|
-
//#region
|
|
240564
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/turn/canonical-args.ts
|
|
240565
240565
|
/**
|
|
240566
240566
|
* JSON canonicalization used by tool-call telemetry and dedup.
|
|
240567
240567
|
* Recursively sorts object keys so semantically-equal args produce identical keys.
|
|
@@ -240582,7 +240582,7 @@ function isPlainRecord(value) {
|
|
|
240582
240582
|
return proto === Object.prototype || proto === null;
|
|
240583
240583
|
}
|
|
240584
240584
|
//#endregion
|
|
240585
|
-
//#region
|
|
240585
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/agent-swarm-exclusive-deny.ts
|
|
240586
240586
|
var AgentSwarmExclusiveDenyPermissionPolicy = class {
|
|
240587
240587
|
name = "agent-swarm-exclusive-deny";
|
|
240588
240588
|
evaluate(context) {
|
|
@@ -240607,7 +240607,7 @@ function mixedAgentSwarmDeniedMessage() {
|
|
|
240607
240607
|
return "AgentSwarm must be the only tool call in a model response. Retry with a single AgentSwarm call by itself, then call any other tools after it returns.";
|
|
240608
240608
|
}
|
|
240609
240609
|
//#endregion
|
|
240610
|
-
//#region
|
|
240610
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/auto-mode-approve.ts
|
|
240611
240611
|
var AutoModeApprovePermissionPolicy = class {
|
|
240612
240612
|
agent;
|
|
240613
240613
|
name = "auto-mode-approve";
|
|
@@ -240620,7 +240620,7 @@ var AutoModeApprovePermissionPolicy = class {
|
|
|
240620
240620
|
}
|
|
240621
240621
|
};
|
|
240622
240622
|
//#endregion
|
|
240623
|
-
//#region
|
|
240623
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/auto-mode-ask-user-question-deny.ts
|
|
240624
240624
|
var AutoModeAskUserQuestionDenyPermissionPolicy = class {
|
|
240625
240625
|
agent;
|
|
240626
240626
|
name = "auto-mode-ask-user-question-deny";
|
|
@@ -240637,7 +240637,7 @@ var AutoModeAskUserQuestionDenyPermissionPolicy = class {
|
|
|
240637
240637
|
}
|
|
240638
240638
|
};
|
|
240639
240639
|
//#endregion
|
|
240640
|
-
//#region
|
|
240640
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/default-tool-approve.ts
|
|
240641
240641
|
var import_turn_tool_performance_policy = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
240642
240642
|
const TOOL_SCHEMA_BUDGET_RATIO = .25;
|
|
240643
240643
|
const TOOL_SCHEMA_MAX_TOKENS = 8e3;
|
|
@@ -241247,7 +241247,7 @@ var DefaultToolApprovePermissionPolicy = class {
|
|
|
241247
241247
|
}
|
|
241248
241248
|
};
|
|
241249
241249
|
//#endregion
|
|
241250
|
-
//#region
|
|
241250
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/desktop-control-always-ask.ts
|
|
241251
241251
|
const WINDOWS_MCP_TOOL_PREFIX = "mcp__windows-mcp__";
|
|
241252
241252
|
/** Desktop automation needs a fresh user decision unless God Mode is active. */
|
|
241253
241253
|
var DesktopControlAlwaysAskPermissionPolicy = class {
|
|
@@ -241263,7 +241263,7 @@ var DesktopControlAlwaysAskPermissionPolicy = class {
|
|
|
241263
241263
|
}
|
|
241264
241264
|
};
|
|
241265
241265
|
//#endregion
|
|
241266
|
-
//#region
|
|
241266
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/exit-plan-mode-review-ask.ts
|
|
241267
241267
|
var ExitPlanModeReviewAskPermissionPolicy = class {
|
|
241268
241268
|
agent;
|
|
241269
241269
|
name = "exit-plan-mode-review-ask";
|
|
@@ -241378,7 +241378,7 @@ function selectedExitPlanModeOption(options, label) {
|
|
|
241378
241378
|
return options.find((option) => option.label === label);
|
|
241379
241379
|
}
|
|
241380
241380
|
//#endregion
|
|
241381
|
-
//#region
|
|
241381
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/fallback-ask.ts
|
|
241382
241382
|
var FallbackAskPermissionPolicy = class {
|
|
241383
241383
|
name = "fallback-ask";
|
|
241384
241384
|
evaluate(_context) {
|
|
@@ -241386,7 +241386,7 @@ var FallbackAskPermissionPolicy = class {
|
|
|
241386
241386
|
}
|
|
241387
241387
|
};
|
|
241388
241388
|
//#endregion
|
|
241389
|
-
//#region
|
|
241389
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/support/git-worktree.ts
|
|
241390
241390
|
/**
|
|
241391
241391
|
* Marker-based git work-tree detection. Never spawns `git`; failures return
|
|
241392
241392
|
* null so callers can fall back to their safer path.
|
|
@@ -241447,7 +241447,7 @@ function parseGitDir(content, markerParent) {
|
|
|
241447
241447
|
return normalize$3(isAbsolute$1(rawPath) ? rawPath : join$1(markerParent, rawPath));
|
|
241448
241448
|
}
|
|
241449
241449
|
//#endregion
|
|
241450
|
-
//#region
|
|
241450
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/file-access-ask.ts
|
|
241451
241451
|
var SensitiveFileAccessAskPermissionPolicy = class {
|
|
241452
241452
|
name = "sensitive-file-access-ask";
|
|
241453
241453
|
evaluate(context) {
|
|
@@ -241516,7 +241516,7 @@ function pathMod(pathClass) {
|
|
|
241516
241516
|
return pathClass === "win32" ? win32Path : posixPath;
|
|
241517
241517
|
}
|
|
241518
241518
|
//#endregion
|
|
241519
|
-
//#region
|
|
241519
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/git-cwd-write-approve.ts
|
|
241520
241520
|
var GitCwdWriteApprovePermissionPolicy = class {
|
|
241521
241521
|
agent;
|
|
241522
241522
|
name = "git-cwd-write-approve";
|
|
@@ -241540,7 +241540,7 @@ var GitCwdWriteApprovePermissionPolicy = class {
|
|
|
241540
241540
|
}
|
|
241541
241541
|
};
|
|
241542
241542
|
//#endregion
|
|
241543
|
-
//#region
|
|
241543
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/goal-start-review-ask.ts
|
|
241544
241544
|
/**
|
|
241545
241545
|
* Starting a goal turns the agent loose on autonomous, multi-turn work, so a
|
|
241546
241546
|
* model-issued `CreateGoal` is confirmed with the same menu the `/goal` command
|
|
@@ -241573,7 +241573,7 @@ function toPermissionMode(label) {
|
|
|
241573
241573
|
if (label === "auto" || label === "yolo" || label === "manual") return label;
|
|
241574
241574
|
}
|
|
241575
241575
|
//#endregion
|
|
241576
|
-
//#region
|
|
241576
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/plan-mode-guard-deny.ts
|
|
241577
241577
|
var PlanModeGuardDenyPermissionPolicy = class {
|
|
241578
241578
|
agent;
|
|
241579
241579
|
name = "plan-mode-guard-deny";
|
|
@@ -241614,7 +241614,7 @@ function planModeWriteDeniedMessage(planFilePath) {
|
|
|
241614
241614
|
return `Plan mode is active. You may only write to the current plan file: ${planFilePath ?? "(no plan file selected yet)"}. Call ExitPlanMode to exit plan mode before editing other files.`;
|
|
241615
241615
|
}
|
|
241616
241616
|
//#endregion
|
|
241617
|
-
//#region
|
|
241617
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/plan-mode-tool-approve.ts
|
|
241618
241618
|
var PlanModeToolApprovePermissionPolicy = class {
|
|
241619
241619
|
agent;
|
|
241620
241620
|
name = "plan-mode-tool-approve";
|
|
@@ -241638,7 +241638,7 @@ function writesOnlyPlanFile(context, planFilePath) {
|
|
|
241638
241638
|
return writeFileAccesses(context).every((access) => access.path === planFilePath);
|
|
241639
241639
|
}
|
|
241640
241640
|
//#endregion
|
|
241641
|
-
//#region
|
|
241641
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/personal-memory-mutation-always-ask.ts
|
|
241642
241642
|
const PERSONAL_MEMORY_MUTATION_TOOLS = new Set(["mcp__personal-memory__memory_settings_update", "mcp__personal-memory__memory_remember"]);
|
|
241643
241643
|
function isPersonalMemoryMutationTool(toolName) {
|
|
241644
241644
|
return PERSONAL_MEMORY_MUTATION_TOOLS.has(toolName.toLowerCase());
|
|
@@ -241652,7 +241652,7 @@ var PersonalMemoryMutationAlwaysAskPermissionPolicy = class {
|
|
|
241652
241652
|
}
|
|
241653
241653
|
};
|
|
241654
241654
|
//#endregion
|
|
241655
|
-
//#region
|
|
241655
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/session-approval-history.ts
|
|
241656
241656
|
var SessionApprovalHistoryPermissionPolicy = class {
|
|
241657
241657
|
agent;
|
|
241658
241658
|
name = "session-approval-history";
|
|
@@ -241687,7 +241687,7 @@ var SessionApprovalHistoryPermissionPolicy = class {
|
|
|
241687
241687
|
}
|
|
241688
241688
|
};
|
|
241689
241689
|
//#endregion
|
|
241690
|
-
//#region
|
|
241690
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/swarm-mode-agent-swarm-approve.ts
|
|
241691
241691
|
var SwarmModeAgentSwarmApprovePermissionPolicy = class {
|
|
241692
241692
|
agent;
|
|
241693
241693
|
name = "swarm-mode-agent-swarm-approve";
|
|
@@ -241701,7 +241701,7 @@ var SwarmModeAgentSwarmApprovePermissionPolicy = class {
|
|
|
241701
241701
|
}
|
|
241702
241702
|
};
|
|
241703
241703
|
//#endregion
|
|
241704
|
-
//#region
|
|
241704
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/user-configured-rules.ts
|
|
241705
241705
|
const USER_CONFIGURED_SCOPES = new Set([
|
|
241706
241706
|
"turn-override",
|
|
241707
241707
|
"project",
|
|
@@ -241772,7 +241772,7 @@ function formatPermissionRuleDenyMessage(tool, reason, agentType) {
|
|
|
241772
241772
|
return `Tool "${tool}" was denied by permission rule.${suffix}`;
|
|
241773
241773
|
}
|
|
241774
241774
|
//#endregion
|
|
241775
|
-
//#region
|
|
241775
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/yolo-mode-approve.ts
|
|
241776
241776
|
var YoloModeApprovePermissionPolicy = class {
|
|
241777
241777
|
agent;
|
|
241778
241778
|
name = "yolo-mode-approve";
|
|
@@ -241785,7 +241785,7 @@ var YoloModeApprovePermissionPolicy = class {
|
|
|
241785
241785
|
}
|
|
241786
241786
|
};
|
|
241787
241787
|
//#endregion
|
|
241788
|
-
//#region
|
|
241788
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/policies/index.ts
|
|
241789
241789
|
/** Permission policies run in order; the first non-undefined result wins. */
|
|
241790
241790
|
function createPermissionDecisionPolicies(agent) {
|
|
241791
241791
|
return [
|
|
@@ -241812,7 +241812,7 @@ function createPermissionDecisionPolicies(agent) {
|
|
|
241812
241812
|
];
|
|
241813
241813
|
}
|
|
241814
241814
|
//#endregion
|
|
241815
|
-
//#region
|
|
241815
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/permission/index.ts
|
|
241816
241816
|
var PermissionManager = class {
|
|
241817
241817
|
agent;
|
|
241818
241818
|
policies;
|
|
@@ -242044,7 +242044,7 @@ var PermissionManager = class {
|
|
|
242044
242044
|
}
|
|
242045
242045
|
};
|
|
242046
242046
|
//#endregion
|
|
242047
|
-
//#region
|
|
242047
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/utils/hero-slug.ts
|
|
242048
242048
|
/** Hero-name slug generator: produces "hero-hero-hero" with collision fallback. */
|
|
242049
242049
|
const HERO_NAMES = [
|
|
242050
242050
|
"iron-man",
|
|
@@ -242302,7 +242302,7 @@ function generateHeroSlug(id, existing) {
|
|
|
242302
242302
|
return slug;
|
|
242303
242303
|
}
|
|
242304
242304
|
//#endregion
|
|
242305
|
-
//#region
|
|
242305
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/plan/index.ts
|
|
242306
242306
|
var PlanMode = class {
|
|
242307
242307
|
agent;
|
|
242308
242308
|
_isActive = false;
|
|
@@ -242421,7 +242421,7 @@ function isMissingFileError(error) {
|
|
|
242421
242421
|
return error.code === "ENOENT";
|
|
242422
242422
|
}
|
|
242423
242423
|
//#endregion
|
|
242424
|
-
//#region
|
|
242424
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/replay/index.ts
|
|
242425
242425
|
const UNDO_BOUNDARY_RECORD_TYPES = new Set(["context.clear", "context.apply_compaction"]);
|
|
242426
242426
|
var ReplayBuilder = class {
|
|
242427
242427
|
agent;
|
|
@@ -242513,10 +242513,10 @@ var ReplayBuilder = class {
|
|
|
242513
242513
|
}
|
|
242514
242514
|
};
|
|
242515
242515
|
//#endregion
|
|
242516
|
-
//#region
|
|
242516
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/builtin/blun-design-dna.md?raw
|
|
242517
242517
|
var blun_design_dna_default = "---\nname: blun-design-dna\ndescription: Mandatory BLUN baseline for distinctive, non-generic interface quality. Loaded silently in every code session, applied when work has a visual or interaction surface, blocks common AI-generated design tropes, and is extended by user-selected skills without replacing its safety, accessibility, privacy, or verification gates.\n---\n\n# BLUN Design DNA\n\nThis is the permanent BLUN baseline for UI, frontend, visual, and interaction work.\nIt is loaded once per agent context and applied silently.\n\nFor non-visual work, keep the visual rules dormant. Do not force a redesign into a backend,\ndata, or infrastructure task.\n\nAdditional user-selected skills are additive. They may specialize the visual direction,\nworkflow, or domain, but they do not replace this baseline.\n\n## 0. Precedence\n\nWhen instructions conflict, use this order:\n\n1. Law, security, privacy, accessibility, and explicit permission boundaries\n2. The user's current request and approved acceptance criteria\n3. Approved references, templates, and the existing project design system\n4. Existing product behavior, information architecture, localization, and platform conventions\n5. This baseline's domain route and quality gates\n6. Additional skill aesthetics and optional inspiration\n\nNever let a majority pattern, trend, or additional skill weaken levels 1 through 4.\n\n## Non-Negotiable Anti-Slop Gate\n\nThe following patterns make visual output fail. They apply to ALL output King generates, not just the BLUN Code app UI.\n\n### Instant-Fail Patterns\n\n**Color and Effects:**\n- Colorful, rainbow, purple-blue, or mesh gradients used as decoration; gradient blobs, decorative orbs, neon glow, and gratuitous glass effects\n- Gradient or glow on logos, brand marks, buttons, or active states\n- Gradient text (background-clip on headings or labels)\n- Glass/blur panels as primary containers\n- Generic violet/indigo as a primary brand color. An approved, documented official brand violet/indigo is allowed only with proven brand-asset provenance.\n- Rainbow status indicators used as decoration\n\n**Typography and Icons:**\n- Emoji used as interface icons, labels, status decoration, bullets, or visual filler\n- Invented logo badges or app marks made from a lightning bolt, isolated letter or initials inside a geometric container, sparkle, robot, circuit, or generic technology symbol\n\n**Layout and Composition:**\n- Interchangeable AI-design fingerprints such as generic hero copy, excessive pills, floating cards, decorative bento grids, fake metrics, and dashboards without an information need\n- Monotone identical card grids without hierarchy variation\n- Generic SaaS hero composition (centered gradient title, three equal feature cards, purple CTA)\n\n### Mandatory Instead (Enforced Quality)\n- Flat bespoke brand mark — use approved assets, or a restrained wordmark if none exist. If no logo asset exists, the space stays empty rather than invented.\n- ONE restrained accent color, used sparingly for semantic meaning only\n- A real typographic scale with clear role names and weight hierarchy (400/500/600/700)\n- Calm surfaces with deliberate whitespace rhythm and breathing room\n- Consistent spacing scale, not random padding values\n- Each visual element earns its place by serving content or interaction\n\n### Exceptions (narrow, per-ban)\n- Emojis: allowed only when the user explicitly asks for them. Never as default.\n- Colorful gradients: remain Instant-Fail. No exception, no override, not even on user request.\n- Generated logo badges: remain Instant-Fail. No exception, no override. Approved templates may only use official brand assets — never AI-generated iconography.\n- Glass/blur panels: remain Instant-Fail. No exception.\n- Generic violet/indigo as primary brand: remain Instant-Fail unless documented as an official brand color with proven provenance.\n\nThese are differentiation requirements, not optional taste preferences. The result must be\nspecific to its product and must not look interchangeable with unrelated AI-generated software.\n\n## 1. Route Before Designing\n\nChoose the smallest matching route. Do not apply every visual recipe to every product.\n\n| Product context | Default direction | Avoid by default |\n| --- | --- | --- |\n| Operational app, dashboard, CRM, IDE, admin, terminal | Quiet, dense, scan-friendly, stable, efficient | Marketing heroes, decorative card grids, oversized type |\n| Branded product, venue, portfolio, object | Brand or subject visible in the first viewport; real primary media | Generic atmosphere, hidden identity, stock-like crops |\n| Landing or campaign page | Clear offer, evidence, action, and a visual hero with a hint of the next section | Split card hero, fake product art, text-only first viewport |\n| Editorial or content experience | Strong reading rhythm, honest hierarchy, restrained navigation | Dashboard chrome, needless controls, decorative containers |\n| Existing product redesign | Preserve mental model and improve measured weaknesses | Re-platforming, route changes, unrelated visual churn |\n| Prototype or design exploration | Two or three concrete directions, then one tested direction | Abstract style lists without a usable prototype |\n| Game or immersive 3D experience | Gameplay or scene first, expressive assets, full-bleed interaction | Dashboard framing around the primary scene |\n\nIf the task spans routes, state the dominant route internally and use secondary routes only\nwhere their content actually appears.\n\n## 2. Read The Existing System\n\nBefore editing:\n\n- Inspect the relevant code, components, tokens, themes, breakpoints, and interaction patterns.\n- Inspect approved screenshots, mockups, brand assets, and real content.\n- Identify the framework, styling method, icon system, localization, and installed dependencies.\n- Preserve routes, analytics hooks, IDs, legal text, copy intent, and keyboard behavior.\n- Determine the audience, primary task, information hierarchy, and data density.\n- Define acceptance criteria that can be verified in behavior and screenshots.\n\nDo not invent a new design language when a binding one already exists.\nDo not add a dependency, font, remote asset, or component system merely because this baseline is active.\n\n## 3. Product Contract\n\nSilently establish:\n\n- Primary user and job to be done\n- Most frequent workflow and fastest path through it\n- Required commands, tools, views, and navigation\n- Loading, empty, error, offline, disabled, permission, and success states\n- Real data and content constraints\n- Dark, light, high-contrast, and reduced-motion behavior where supported\n- Mobile, narrow desktop, standard desktop, and wide desktop behavior\n- Keyboard, pointer, touch, and assistive-technology paths\n- Privacy and network boundaries\n\nFeature-complete controls matter more than decorative novelty.\n\n## 4. Complete Flows And States\n\nEvery relevant workflow must cover:\n\n- Initial, loading, pending, queued, and streaming\n- Empty and first-use\n- Partial data and slow data\n- Success and completion\n- Recoverable and terminal errors\n- Offline and reconnecting\n- Disabled, with an understandable reason\n- Permission and approval\n- Destructive action, with confirmation or undo where appropriate\n- Selected, active, focused, hovered, pressed, and dragged\n- Long text, long paths, localization growth, and missing media\n\nA polished ideal state alone is not finished.\nState changes must not resize or shift fixed-format controls unexpectedly.\n\n## 5. Accessibility And Language\n\nMandatory:\n\n- Semantic structure and correct native controls\n- Complete keyboard path in a logical tab order\n- Visible `:focus-visible` states\n- Accessible names for icons, controls, regions, and status changes\n- Focus trap and focus return for modal surfaces\n- Escape or cancel path from every transient surface\n- No color-only communication\n- WCAG AA contrast at minimum, measured rather than assumed\n- Minimum 44 by 44 CSS pixel touch targets where touch interaction is expected\n- Text scaling and browser zoom at 100%, 125%, 150%, and 200%\n- Reflow at 320 CSS pixels or 400% zoom without two-dimensional page scrolling\n- Reduced motion, reduced transparency, and increased contrast where supported\n- Forced-colors support without hidden controls or lost state meaning\n- Concise, relevant screen-reader announcements for async results, errors, and progress\n- Alt text or an intentional decorative treatment for images\n- Captions or transcripts for meaningful media and accessible playback controls\n- No flashing or strobing that can trigger photosensitive reactions\n- Long German, English, and Czech strings without clipping or overlap\n- Correct Unicode and UTF-8 without mojibake\n\nDo not lock text into fixed-height containers.\nDo not hide required information behind hover-only interaction.\nProvide keyboard and single-pointer alternatives for drag, swipe, hold, and multi-touch gestures.\nKeep focused controls visible, restore focus after transient surfaces, and provide skip navigation\nwhen repeated chrome would otherwise obstruct keyboard users.\nThrottle live-region updates and announce meaningful state changes, not every streamed delta.\n\n## 6. Visual System\n\n### Specificity Check\n\n- Start from the product's real domain, audience, content, tasks, and approved identity. Never assemble an interface from generic AI-design tropes.\n- Do not imitate a fashionable reference mechanically. Translate useful principles into a product-specific system with its own hierarchy, typography, spacing, imagery, and interaction behavior.\n- Every decorative element must support meaning, hierarchy, usability, or an approved identity. Remove anything whose only purpose is to make the interface look \"designed.\"\n- Before completion, scan the rendered product and source for these patterns. Remove or redesign every unrequested occurrence; a polished implementation of a generic pattern still fails this gate.\n\nThe quality signature is specificity, restraint, and behavior that fits the product. It must not\nlook interchangeable with unrelated AI-generated software.\n\n### Typography\n\n- Existing brand and product typography wins when it is licensed and readable.\n- Prefer a restrained type scale with clear role names over arbitrary one-off sizes.\n- Use weight, size, and spacing together for hierarchy; do not rely on muted color alone.\n- Keep `letter-spacing: 0` unless an approved design system explicitly requires otherwise.\n- Do not scale font size continuously with viewport width.\n- Use tabular numerals for counters, timers, prices, and dense data.\n- Keep body line length readable, but allow operational tables and code to use their needed width.\n- Hero-scale type belongs only in true heroes, never compact panels or dashboards.\n\n### Color\n\n- Start from project tokens. Add tokens instead of scattering hard-coded values.\n- Use accent color sparingly and semantic colors consistently.\n- Support more than one semantic hue where status meaning requires it.\n- Avoid a one-note palette dominated by a single fashionable hue family.\n- Never assume a color pair passes contrast; measure it.\n- Dark and light themes must be equally usable, not simple inversions.\n\n### Spacing And Shape\n\n- Use a small, documented spacing scale.\n- Match density to task frequency and information load.\n- Cards use an 8px radius or less unless the existing design system requires otherwise.\n- Do not put cards inside cards.\n- Do not turn page sections into floating cards.\n- Reserve stable dimensions for boards, toolbars, tiles, counters, and repeated controls.\n- Use whitespace to clarify groups, not to make operational tools sparse.\n\n### Icons\n\n- Reuse the project's existing icon library.\n- Use familiar symbols instead of rounded text buttons when the symbol is unambiguous.\n- Add tooltips and accessible names to unfamiliar icons.\n- Keep stroke weight, optical size, and alignment consistent.\n- Do not use emoji as interface icons unless the product language explicitly calls for them.\n\n## 7. Composition By Route\n\n### Operational Interfaces\n\n- Prioritize scanning, comparison, repeated action, and low interaction cost.\n- Keep navigation predictable and information architecture visible.\n- Use tabs for views, segmented controls for modes, toggles for binary settings, and menus for option sets.\n- Use tables or aligned lists for comparable data instead of decorative cards.\n- Keep panels dense but organized; no oversized marketing composition.\n\n### Landing And Branded Surfaces\n\n- Make the product, place, person, object, or literal offer a first-viewport signal.\n- Use a real or generated bitmap image, product state, or immersive scene as primary media.\n- Put hero text over the media without enclosing the primary experience in a card.\n- Leave a visible hint of the next section on mobile and desktop.\n- Use a clear narrative: need, offer, evidence, action.\n- Do not fabricate testimonials, customers, metrics, or product capabilities.\n\n### Games And Immersive Scenes\n\n- Show real gameplay or the primary interactive scene immediately.\n- Keep the main scene full-bleed or unframed.\n- Use a proven engine for established rules, physics, parsing, or AI behavior.\n- Verify that canvases are nonblank, framed correctly, moving, and interactive.\n\n### 3D And Spatial Interfaces\n\n- When a compatible local 3D skill is installed or selected, load the most specific production guidance for the project's engine and framework. It extends this baseline but never weakens the anti-slop, accessibility, privacy, performance, or verification gates.\n- Use 3D only when it improves inspection, spatial understanding, simulation, gameplay, storytelling, or direct manipulation. Do not add an abstract rotating object merely to make a conventional interface look advanced.\n- Follow the existing stack. Prefer Three.js for new web-native scenes, its established React integration in React projects, and an already-adopted engine when the product has one. Do not replace a working engine without a measured reason.\n- Make the scene the actual product surface when 3D is primary. Keep it full-bleed or structurally integrated, not trapped in a decorative preview card.\n- Use inspectable assets and a production asset pipeline. Prefer efficient runtime formats, compressed geometry and textures where supported, correct color handling, bounded texture sizes, and explicit loading, progress, error, and fallback states.\n- Keep one owner and one animation loop for each scene. Use the renderer's supported animation loop for continuously animated or immersive scenes and demand rendering for static scenes; base motion on elapsed time rather than frame count.\n- In declarative React scenes, keep per-frame mutation out of React state, subscribe narrowly, reuse stable objects, and prevent unrelated DOM state from re-rendering the scene tree.\n- Separate scene state, UI state, animation orchestration, and asset loading. Do not let scroll handlers, component renders, or multiple animation libraries compete to write the same camera or object property.\n- Define camera framing, controls, lighting, materials, interaction targets, and world scale deliberately. Avoid default demo lighting, random floating objects, chrome spheres, particle fields, and generic 3D logo reveals.\n- Keep controls predictable and interruptible. Preserve pointer capture, keyboard alternatives, touch behavior, focus visibility, reduced-motion behavior, and a non-3D path to essential information or actions.\n- Cap render resolution for device capability, pause or reduce work when hidden, avoid allocations inside the frame loop, precompile expensive materials where useful, dispose of resources, and recover gracefully from a lost graphics context.\n- Reduce draw calls before chasing shader tricks: share geometry and materials, instance repeated meshes, use culling and level of detail where measured, constrain real-time shadows and post-processing, and profile on representative mobile hardware.\n- Keep DOM overlays and the canvas in one stable coordinate system. Recalculate camera and renderer dimensions on container resize, reserve the scene's aspect ratio, and prevent labels, controls, and loading states from shifting the layout.\n- Treat imported models, shaders, textures, environment maps, and animation clips as untrusted distributable assets. Validate source, license, size, format, bounds, fallback behavior, and network destination.\n- Test realistic low- and mid-range hardware, touch and mouse input, narrow and wide viewports, dark and light surroundings, reduced motion, slow asset loading, and graphics failure.\n- Before completion, use screenshots and canvas-pixel checks at desktop and mobile sizes to prove the scene is nonblank, correctly framed, interactive or moving as intended, and free from overlap, clipping, missing assets, and runaway frame cost.\n\n## 8. Interaction And Motion\n\nMotion is feedback and spatial explanation, not decoration.\n\n- Give immediate visual feedback on pointer down.\n- Commit the action only on click or confirmed release.\n- Let drag-out cancel where expected.\n- Keep direct manipulation attached 1:1 to the pointer and preserve the grab offset.\n- Capture the pointer for drags that may leave the element bounds.\n- Start from the current visible value and allow interruption or reversal.\n- Preserve velocity when a gesture becomes an animation.\n- Anchor popovers, menus, and sheets to their trigger or spatial origin.\n- Use transform and opacity for most animation.\n- Avoid `transition: all`, layout thrashing, and blur on large scrolling surfaces.\n- Skip decorative animation for high-frequency keyboard actions.\n- Use constant-speed motion only when constant progress is the meaning.\n- Apply reduced-motion preferences without removing essential state feedback.\n\nVisual feedback may start on press; destructive or irreversible work must never start on press alone.\n\n## 9. Component Standards\n\n### Commands And Controls\n\n- Icon buttons for familiar tools; icon plus text for important commands when space allows.\n- Swatches for color, sliders or steppers for numeric ranges, and checkboxes or toggles for binary values.\n- Disable controls only when necessary and explain why.\n- Show progress and protect against duplicate submission.\n- Keep labels inside their bounds at all supported widths.\n\n### Forms\n\n- Associate every label, help text, and error with its field.\n- Validate at the useful moment, not on every keystroke without reason.\n- Preserve entered data across recoverable errors.\n- Keep secret values masked and out of logs, toasts, and copied diagnostics.\n\n### Tables And Lists\n\n- Align comparable values and support keyboard focus.\n- Keep headers visible where useful without obscuring content.\n- Provide sorting, filtering, pagination, or virtualization when the data requires it.\n- Use ellipsis only when the full value remains available through a safe detail or tooltip.\n\n### Dialogs, Menus, Popovers, Tooltips\n\n- Use the correct surface for the task; do not turn every choice into a modal.\n- Constrain to the viewport, preserve focus, and support Escape.\n- Menus use roving keyboard focus where appropriate.\n- Tooltips do not contain essential actions.\n\n### Code And Technical Output\n\n- Preserve code exactly, including whitespace and line endings when copying.\n- Keep code within its container with horizontal scrolling where needed.\n- Use readable themed syntax colors in dark and light modes.\n- Keep raw code out of unrelated sidebars or status surfaces.\n\n## 10. Assets, Facts, Privacy\n\n- Prefer real, inspectable product media over atmospheric stock imagery.\n- Verify factual product claims and labels against provided or authoritative material.\n- Mark placeholders honestly and keep them visibly non-production.\n- Never put secrets, credentials, or unnecessary personal data into a prompt, URL, log, or analytics payload.\n- Include local file content in a model request only when the task requires it, the user intentionally supplied or approved it, and the chosen processing boundary permits it; minimize and redact first.\n- Do not send code, content, screenshots, or assets to an external service without user intent and permission.\n- Prefer local assets and installed packages.\n- Do not fetch remote fonts, scripts, component catalogs, or media merely for visual polish.\n- Validate image resolution, crop, license, and fallback behavior.\n- Treat HTML, URLs, uploads, filenames, metadata, and embedded media as untrusted input; validate, sanitize, constrain size and type, and prevent executable interpretation.\n- Enforce authorization, path containment, and permission checks in a trusted process or server, never only in client-side UI.\n- Preserve lockfiles and use pinned, reviewed dependency versions.\n- Check licenses, required notices, integrity, and known vulnerabilities before adding distributable assets or packages.\n- Reject material whose license requires visible attribution that conflicts with the approved product surface.\n- Never fabricate people, customers, metrics, credentials, identities, or factual product claims.\n\n## 11. Optional Component Layer\n\nWhen a compatible component catalog is already installed:\n\n1. Inspect its local manifest, tokens, version, license, and health checks.\n2. Reuse components that match the existing architecture.\n3. Apply project tokens and interaction behavior instead of shipping raw defaults.\n4. Test accessibility independently.\n5. Pin versions and review diffs before upgrades.\n6. Keep a stable local fallback for experimental components.\n\nDo not run networked install, add, upgrade, or migration commands automatically.\nDo not impose a new component layer on an existing project.\n\n## 12. Redesign Protocol\n\nFor existing products:\n\n1. Scan the real implementation and render the current state.\n2. Diagnose concrete usability, consistency, state, accessibility, and responsive defects.\n3. Preserve the information architecture and mental model unless the user asks to change them.\n4. Fix the smallest coherent surface first.\n5. Verify behavior and compare before and after screenshots.\n\nDo not rewrite from scratch to make a redesign easier.\nDo not change the stack, routes, localization keys, analytics hooks, or legal content without need.\n\n## 13. Brand And Attribution\n\nIn visible BLUN surfaces, templates, examples, and user-facing documentation:\n\n- Remove foreign logos, product names, designer personas, watermarks, origin stories, and example identities.\n- Use the approved product or customer identity; use BLUN only on BLUN-owned surfaces and neutral terminology otherwise.\n- Do not expose internal skill names or source slugs in interface activity.\n- Keep legally required license, copyright, and notice text in package metadata and notice files.\n- Independently formulate adopted guidance; do not copy unverified source text into distributable material.\n\nTechnical dependency identifiers may remain only where the implementation requires them.\nApply the neutrality scan to visible responses, DOM text, the accessibility tree, alt and ARIA text,\nmetadata, social previews, distributable examples, source comments, test fixtures, image text, and\noutbound network destinations. Allow legitimate user, customer, product, and dependency names only\nwhen the task or implementation requires them.\n\n## 14. Behavioral Gate\n\nBefore claiming completion:\n\n- Build, typecheck, lint, and relevant tests pass.\n- Render and inspect dark and light themes where supported.\n- Test mobile, 400px narrow desktop, 800 by 600, standard desktop, and wide desktop.\n- Test 100%, 125%, 150%, and 200% zoom.\n- Test reflow at 320 CSS pixels or 400% zoom.\n- Test long localized text and the longest unbroken value.\n- Exercise pointer, keyboard, focus, Escape, loading, empty, error, disabled, and completion paths.\n- Exercise offline, reconnecting, slow, partial, permission, queued, destructive, and missing-media states when relevant.\n- Test equivalent keyboard and single-pointer paths for gesture-driven interactions.\n- Inspect landmarks, accessible names, focus order, dynamic announcements, and forced-colors behavior.\n- For native apps, terminal UIs, email, and embedded surfaces, translate browser-specific checks into the platform's accessibility APIs, scaling modes, navigation model, and realistic host constraints.\n- Confirm no overlap, clipping, horizontal page overflow, blank canvas, broken image, or layout shift.\n- Confirm no console errors, uncaught exceptions, failed required requests, or page errors.\n- Measure contrast and inspect focus visibility.\n- Verify reduced motion.\n- Check primary interaction latency and avoid repeated full-page rendering during streams.\n- Reserve media dimensions to prevent layout shift.\n- For public pages, target LCP below 2.5 seconds, INP below 200 milliseconds, and CLS below 0.1.\n- Compare screenshots with the approved reference.\n- Scan visible text for foreign attribution and raw internal names.\n- Confirm no new network destination or unapproved dependency was introduced.\n- Record the commands, tested viewports, behavior results, screenshots, and relevant accessibility evidence.\n- Mark a gate `N/A` only with a concrete reason; never treat a missing test or script as a pass.\n\nStatic code inspection alone is not a visual acceptance test.\n\n## 15. Silent Application\n\n- Never announce this baseline or name its source material.\n- Never ask whether to use it.\n- Never put its internal reasoning or routing labels into the product UI.\n- Ask one focused question only when a missing decision materially changes the result.\n- Otherwise infer conservatively, implement, verify, and report the actual outcome.\n- Additional user-selected skills may replace aesthetic defaults and refine the route, but cannot weaken precedence levels 1 through 4 or the mandatory security, privacy, permission, and accessibility constraints.\n";
|
|
242518
242518
|
//#endregion
|
|
242519
|
-
//#region
|
|
242519
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/builtin/blun-design-dna.ts
|
|
242520
242520
|
const PSEUDO_PATH$4 = "builtin://blun-design-dna";
|
|
242521
242521
|
const parsed$4 = parseSkillText({
|
|
242522
242522
|
skillMdPath: "/builtin/skills/blun-design-dna.md",
|
|
@@ -242535,10 +242535,10 @@ const BLUN_DESIGN_DNA_SKILL = {
|
|
|
242535
242535
|
}
|
|
242536
242536
|
};
|
|
242537
242537
|
//#endregion
|
|
242538
|
-
//#region
|
|
242538
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/builtin/custom-theme.md?raw
|
|
242539
242539
|
var custom_theme_default = "---\nname: custom-theme\ndescription: Create or edit a blun custom color theme — a JSON file under the resolved BLUN_HOME data directory that recolors the TUI. Use when the user wants their own theme, asks for a specific palette or mood, or wants to tweak an existing custom theme's colors.\n---\n\n# Create a blun custom theme (custom-theme)\n\nHelp the user design, write, and apply a custom color theme for the blun TUI. A theme is a single JSON file; the TUI ships with `dark`, `light`, and `auto`, and any file the user adds becomes selectable alongside them.\n\n## Rules of engagement\n\n- **Never write a theme until the user has explicitly clarified what they want.** This skill may only run after the user has confirmed light vs dark, the style or mood, any specific colors they care about, and the intended filename. If any of these are missing, ask before creating files.\n- **Never assume the data directory is `~/.blun`.** Always resolve `$BLUN_HOME` first with the Bash command below.\n- **Never edit a live theme file in place.** Always create a `.json.new` candidate, validate it, back up the old file, and then `mv` it into place.\n- **Never overwrite an existing theme without reading it first.** Read, back up, then overwrite only after the user confirms.\n\n## Where a theme lives\n\nThe blun runtime resolves the data directory as `BLUN_HOME` first, falling back to `~/.blun`. Theme files live inside the `themes/` subdirectory of that data directory.\n\nBefore doing anything, resolve the actual data root with Bash so you don't write to the wrong place. Check whether `BLUN_HOME` is set and fall back to `~/.blun` when it is empty:\n\n```bash\necho \"$BLUN_HOME\"\necho \"$HOME/.blun\"\n```\n\nUse the first line when it is non-empty; otherwise use the second line. In the rest of this skill, `<BLUN_HOME>` means that resolved data root — **never assume `~/.blun`**. Theme files live at `<BLUN_HOME>/themes/<name>.json`. Create the `themes/` directory if it doesn't exist.\n\n## What a theme is\n\n- A theme lives at `<BLUN_HOME>/themes/<name>.json`.\n- **The filename is the theme name**: `ember.json` shows up in the `/theme` picker as `Custom: ember`.\n- Shape:\n\n ```json\n {\n \"name\": \"ember\",\n \"displayName\": \"Ember\",\n \"colors\": {\n \"primary\": \"#83A598\",\n \"accent\": \"#FE8019\"\n }\n }\n ```\n\n - `name` (required), `displayName` (optional), `base` (optional: `\"dark\"` default, or `\"light\"`), `colors` (each value a 6-digit hex `#RRGGBB`).\n- **Partial themes are fine**: any token you leave out falls back to the **base** palette (`dark` by default; set `\"base\": \"light\"` for a light theme), so you can recolor just a few tokens or all of them.\n\n## Source of truth: the bundled token reference\n\nUse the complete token table below for this installed version. Its token names are checked against both runtime palettes and the packaged theme schema. No network request is required to create or edit a theme.\n\nFor general guidance, **FetchURL** may read the documentation index:\n\n```\nhttps://blun.ai/docs\n```\n\nThat index is not the installed token reference. Only set tokens from the embedded table; unknown keys do not affect rendering. A failed documentation fetch does not prevent using this bundled reference. Keep candidate validation, backup and the reload steps below.\n\n## Color tokens (what each controls)\n\n| Token | Controls |\n| --- | --- |\n| `primary` | The most-used color: links, inline code, the selected item in nearly every dialog, the focused editor border, plan/\"running\" badges, spinners |\n| `accent` | Secondary highlight: approval `▶` prefix, device-code box, image placeholder, BTW / queue panes, registry import |\n| `text` | Body text: dialog bodies, todo titles, footer model label, Markdown headings, assistant/tool message bullets, list bullets |\n| `textStrong` | Emphasized / bold text: input dialogs, status messages |\n| `textDim` | Secondary, dimmed text (the most widely used dim shade): thinking, hints, descriptions, completed todos, Markdown quotes, footer status bar |\n| `textMuted` | Faintest text: counters, scroll info, descriptions, Markdown link URLs, code-block borders |\n| `surface` | Full-width TUI surface when appearance background painting is enabled |\n| `border` | Pane and editor borders, Markdown horizontal rule |\n| `borderFocus` | Focus / attention border (currently only the approval panel) |\n| `success` | Success state: `✓`, \"enabled\", completed |\n| `warning` | Warning state: auto/yolo badges, stale markers, plan-mode hint |\n| `error` | Error state: error messages, failed tool output |\n| `diffAdded` | Diff added lines |\n| `diffRemoved` | Diff removed lines |\n| `diffAddedStrong` | Diff intra-line changed words, added (bold) |\n| `diffRemovedStrong` | Diff intra-line changed words, removed (bold) |\n| `diffGutter` | Diff line-number gutter |\n| `diffMeta` | Diff meta / hunk headers |\n| `roleUser` | User message bullet and skill-activation name (the one role color with its own hue) |\n| `shellMode` | Shell mode (`!`) prompt, editor border, and the echoed `$ command` line |\n\n## Workflow\n\n1. **Ask the user what they want first — before choosing any colors.** Clarify, in one short exchange:\n - **Light or dark?** A light theme (dark text on a light background) or a dark theme (light text on a dark background). This sets the whole direction, so settle it first. For a light theme, set `\"base\": \"light\"` so the tokens you leave out inherit the light palette instead of dark.\n - **What style / mood?** e.g. warm vs cool, vivid vs muted, high vs low contrast, a named vibe (\"nord\", \"solarized\", \"sunset\"), or a base to start from (an existing theme, or `dark` / `light`).\n - **Any specific colors?** Whether they have exact hex values to anchor on (a brand color, a preferred `primary`, etc.).\n\n For the discrete choices (light vs dark, a few style options), prefer **AskUserQuestion** if it is available. If you are running in **auto mode** and `AskUserQuestion` is unavailable, ask the same question as a plain-text message with clear numbered or bulleted options, and wait for the user's reply. Don't start picking colors until you at least know light-vs-dark and the rough style.\n\n2. **Resolve the actual theme directory and current theme(s).**\n - Resolve the data root by checking `echo \"$BLUN_HOME\"`; if empty, use `echo \"$HOME/.blun\"`. Use `<root>/themes` for every subsequent step.\n - If tweaking an existing custom theme, **Read** `<BLUN_HOME>/themes/<name>.json` first — never overwrite a theme you haven't read.\n - Starting fresh: build a `colors` object from the token table. You can `ls <BLUN_HOME>/themes/` and Read one of the user's existing themes as a reference for the format.\n\n3. **Pick a starting point and choose colors deliberately.**\n - Every value is a 6-digit hex `#RRGGBB` (not 3-digit, not a named color).\n - Keep contrast usable against the user's terminal background: don't let `text` / `textDim` sit too close to the background, and keep `success` / `warning` / `error` clearly distinguishable from each other.\n - `primary` is the most-seen color (links, selection, focus) — make it readable and distinct from `text`.\n - `roleUser` is the one role color meant to stand on its own — give it a distinct hue.\n\n4. **Create a candidate file; never edit the live theme in place.**\n - Use Bash to create a candidate. If the target theme already exists, copy it verbatim: `cp <name>.json <name>.json.new` (inside `<BLUN_HOME>/themes/`). If it doesn't exist, use **Write** to create a minimal skeleton named `<name>.json.new`.\n - Use **Edit** on the candidate to change only the intended keys. Keep every existing entry, comment, and formatting intact.\n\n5. **Validate the candidate before overwriting.**\n - Read the candidate with **Read** to visually confirm it is well-formed JSON and that every `colors` value is a full 6-digit hex `#RRGGBB` (not 3-digit, not a named color).\n - Invalid hex values are silently skipped at load (they fall back to the base palette), but fix them so the theme renders as intended.\n\n6. **Back up and overwrite.**\n - Back up the old file first — **always** create a new timestamped backup and never overwrite an existing backup: `cp <name>.json \"<name>.json.$(date +%Y%m%d-%H%M%S).bak\"`.\n - If the target didn't exist, skip the backup.\n - Overwrite with the candidate: `mv <name>.json.new <name>.json`.\n\n7. **Tell the user how to apply it** (next section).\n\n## Applying the theme\n\n- The `/theme` picker re-scans the themes directory every time it opens, so a newly added file shows up **without restarting** — tell the user to run `/theme` and choose `Custom: <name>`.\n- Or set it in `tui.toml`: `theme = \"<name>\"`.\n- **Editing the active theme**: changes to the theme that's *currently in use* are not auto-reloaded. Tell the user to run **`/reload-tui`** (or switch to another theme and back). Re-selecting the **same** theme in `/theme` is a no-op (\"Theme unchanged\").\n\n## Don'ts\n\n- **Don't start creating or editing a theme until the user has clarified light/dark, style/mood, any specific colors, and the filename.** If anything is unclear, ask — don't guess.\n- Don't invent token names — only use the documented set; unknown keys are silently ignored.\n- Don't write 3-digit hex or named colors — use full `#RRGGBB`.\n- Never edit the live theme file in place; work through a candidate and validate before `mv`.\n- Before overwriting an existing theme file, **read it and back it up** so the user can recover.\n- Don't tell the user to restart the app to apply a theme — `/theme` or `/reload-tui` is enough.\n";
|
|
242540
242540
|
//#endregion
|
|
242541
|
-
//#region
|
|
242541
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/builtin/custom-theme.ts
|
|
242542
242542
|
const PSEUDO_PATH$3 = "builtin://custom-theme";
|
|
242543
242543
|
const parsed$3 = parseSkillText({
|
|
242544
242544
|
skillMdPath: "/builtin/skills/custom-theme.md",
|
|
@@ -242557,10 +242557,10 @@ const CUSTOM_THEME_SKILL = {
|
|
|
242557
242557
|
}
|
|
242558
242558
|
};
|
|
242559
242559
|
//#endregion
|
|
242560
|
-
//#region
|
|
242560
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/builtin/mcp-config.md?raw
|
|
242561
242561
|
var mcp_config_default = "---\nname: mcp-config\ndescription: Configure MCP servers and handle MCP OAuth login.\n---\n\n# Interactive MCP server configuration\n\nThe user invoked this skill through `/mcp-config` or `/skill:mcp-config`.\nEither they want to log into an MCP server that asked for OAuth, or they\nwant to edit the `mcp.json` that lists MCP servers. The work is small and\nlocal — handle it on this turn yourself, no agents or planning todos.\n\nPick the flow from the user's message and your tool list:\n\n- An `mcp__<server>__authenticate` tool is in your list, the user says\n \"log in\" / \"auth\" / \"sign in\", they invoke `/mcp-config login\n <server>`, or they quote a `needs-auth` status → **Login**.\n- Add / edit / remove / list of an `mcp.json` entry → **Config edit**.\n- Bare `/mcp-config` with no `authenticate` tool in your list →\n **Config edit**. If there were a pending login, the authenticate tool\n would be in your list.\n\n## Login\n\nEach MCP server in `needs-auth` exposes one `mcp__<server>__authenticate`\ntool. Call it for the server the user means — its own description owns\nthe OAuth UX (printing the URL, blocking on the callback, reconnecting on\nsuccess). Surface its output verbatim, including the authorization URL\nunchanged; the URL contains state and PKCE parameters that break if\nedited.\n\nIf the user named a server that has no authenticate tool, say so in one\nsentence and stop — do **not** fall into config edit. They're trying to\nlog in to a server that isn't currently waiting for login; quietly\nrewriting `mcp.json` would be the wrong fix. If multiple authenticate\ntools exist and the user didn't name one, ask which.\n\n## Config edit\n\nConfig lives in three files; on key collision, later entries in this\nprecedence order override earlier ones.\n\nThe blun runtime resolves the user-global directory as `BLUN_HOME`\nfirst, falling back to `~/.blun`. Before touching the user-global file,\nresolve the actual directory with Bash so you don't read or write the wrong\none. Check whether `BLUN_HOME` is set and fall back to `~/.blun`\nwhen it is empty:\n\n```bash\necho \"$BLUN_HOME\"\necho \"$HOME/.blun\"\n```\n\nUse the first line when it is non-empty; otherwise use the second line. In the\nrest of this skill, `<BLUN_HOME>` means that resolved data root —\n**never assume `~/.blun`**.\n\n- User-global: `<BLUN_HOME>/mcp.json`. Use for servers you want\n everywhere.\n- Project-root: `<project root>/.mcp.json`, where project root is found\n by walking up from `<cwd>` to the nearest `.git`. Use for\n repo-shared or cross-agent servers.\n- Project-local: `<cwd>/.blun/mcp.json`. Use for Blun-specific\n overrides in the current working directory.\n\nMention once that project-root and project-local stdio entries spawn\ncommands at session start, so they should only live in trusted repos.\n\nAll three files wrap their entries the same way:\n\n```json\n{ \"mcpServers\": { \"<name>\": { /* entry */ } } }\n```\n\nA minimal stdio entry needs `command` (+ optional `args`, `env`, `cwd`).\nFor project-root `.mcp.json`, stdio entries run from the project root by\ndefault; relative `cwd` values are resolved against the directory that\ncontains `.mcp.json`.\nA minimal http entry needs `url`; add `bearerTokenEnvVar: \"ENV_NAME\"` for\nservers that authenticate with a static bearer token from the\nenvironment. Servers that use OAuth take no token field — the login flow\nabove handles them. `transport` is inferred from `command` vs `url`, so\nomit it. For less common fields (`enabled`, `startupTimeoutMs`,\n`toolTimeoutMs`, `enabledTools`, `disabledTools`, `headers`) the source of\ntruth is `McpServerStdioConfigSchema` / `McpServerHttpConfigSchema` in\n`packages/agent-core/src/config/schema.ts`.\n\nIf the user only wants to **see** what's configured, read all three files,\nshow a merged view with enough source-path context to inspect or remove a\nserver from the file that actually declared it, and stop — no scope\nprompt, no write.\n\nFor changes, the flow is:\n\n1. **Pick a scope.** Infer it from the user's words when you can\n (global / everywhere / all projects → user-global; root / repo /\n shared / cross-agent / `.mcp.json` → project-root; cwd /\n current directory / Blun-specific / `.blun` → project-local). When\n the request is genuinely scope-less, use one `AskUserQuestion` to ask\n user-global vs project-root vs project-local, defaulting to\n user-global. Use plain text for every other question — `AskUserQuestion`\n is a poor fit for free-form input. If the user dismisses the scope\n question, stop; you can't safely guess where they wanted the change.\n2. **Read and announce.** Read the target file (a missing or empty file\n is fine; you'll create `{ \"mcpServers\": {} }`). If JSON parsing fails,\n surface the error verbatim and stop — silently overwriting a broken\n file could destroy work. Then show the user the target path, what's\n currently in it, and the entry you're about to write or delete. This\n is for transparency, not a confirmation gate — the Edit/Write\n permission prompt is the real gate, and your message is what gives\n the user context when that prompt appears. In yolo / afk modes there\n is no prompt, which is those modes' explicit contract.\n3. **Write and tell them how to reload MCP servers.** Preserve unrelated\n entries and the `mcpServers` wrapper. MCP servers load at session\n start, so tell the user to start a new session (for example `/new`) or\n restart `blun` for the change to take effect.\n\n## Secrets\n\nDon't store secrets (tokens, keys, passwords) as literals in\n`mcp.json` — it's a plain config file on disk. http servers should use\n`bearerTokenEnvVar` to reference an env var instead; if a stdio entry\nmust inline one in `env`, warn the user before writing.\n";
|
|
242562
242562
|
//#endregion
|
|
242563
|
-
//#region
|
|
242563
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/builtin/mcp-config.ts
|
|
242564
242564
|
const PSEUDO_PATH$2 = "builtin://mcp-config";
|
|
242565
242565
|
const parsed$2 = parseSkillText({
|
|
242566
242566
|
skillMdPath: "/builtin/skills/mcp-config.md",
|
|
@@ -242579,16 +242579,16 @@ const MCP_CONFIG_SKILL = {
|
|
|
242579
242579
|
}
|
|
242580
242580
|
};
|
|
242581
242581
|
//#endregion
|
|
242582
|
-
//#region
|
|
242582
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/builtin/sub-skill/consolidate/SKILL.md?raw
|
|
242583
242583
|
var SKILL_default$2 = "---\nname: consolidate\ndescription: Apply an approved sub-skill grouping by moving user-specified skills into a parent bundle, with timestamped backups of every modified directory.\ndisable-model-invocation: true\n---\n\n# Consolidate sub-skills (`sub-skill.consolidate`)\n\nExecute the reorganization by moving user-specified skills into a parent bundle, forming a sub-skill hierarchy.\n\n## When to use\n\n- The user has approved a grouping proposal (typically from `sub-skill.review`) and wants to apply it.\n- Migrating standalone skills into a new or existing parent bundle.\n\n## Process\n\n1. **Confirm the plan.** Restate which skills will move and where, and ask the user to confirm **before** making any file changes.\n2. **Back up every original skill directory.** Before moving anything, create a timestamped backup of each skill directory that will be modified.\n - For a skill at `<root>/<skill-name>/SKILL.md`, back up the entire `<skill-name>` directory:\n ```bash\n cp -r <skill-name> \"<skill-name>.$(date +%Y%m%d-%H%M%S).bak\"\n ```\n - Keep all backups; never overwrite an existing backup file.\n3. **Create or update the parent bundle.**\n - If the parent does not exist, create `<parent-name>/SKILL.md` with `has-sub-skill: true` in the frontmatter.\n - If the parent already exists, ensure its frontmatter includes `has-sub-skill: true`.\n4. **Move child skills into the parent.** Move each child skill's entire directory under the parent bundle.\n - Example: `web-search/` → `web-research/web-search/`\n5. **Keep documentation directory alignment.** When moving documentation, references, examples, assets, or other payload directories, align them with the new skill directory layout.\n - Preserve relative links from `SKILL.md` to files such as `references/`, `assets/`, `examples/`, or templates.\n - If a child skill moves from `<root>/<child>/` to `<root>/<parent>/<child>/`, its documentation payload should move with that child unless the approved plan says otherwise.\n - Do not leave documentation in the old location or merge unrelated documentation directories together.\n6. **Verify the result.** List the new directory structure and confirm each moved skill still has a valid `SKILL.md` with required frontmatter (`name` and `description`). Check documentation directory alignment and relative links after the move.\n7. **Report the change.** Summarize what was moved, the new structure, any documentation directories that moved, and where backups are located.\n\n## Don'ts\n\n- **Never move skills without backing up first.**\n- **Never overwrite an existing backup** — always use a fresh timestamped suffix.\n- **Don't drop frontmatter or payload files** during the move; the entire directory must be preserved.\n- **Don't break documentation directory alignment** — references, assets, examples, and templates must stay aligned with the skill directory that uses them.\n- **Don't create deeply nested hierarchies** (3+ levels) unless the user explicitly requests it.\n";
|
|
242584
242584
|
//#endregion
|
|
242585
|
-
//#region
|
|
242585
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/builtin/sub-skill/review/SKILL.md?raw
|
|
242586
242586
|
var SKILL_default$1 = "---\nname: review\ndescription: Analyze the available skill set and recommend candidate groups that could be consolidated into sub-skill bundles. Read-only — proposes a plan, does not move files.\ndisable-model-invocation: true\n---\n\n# Review sub-skills (`sub-skill.review`)\n\nAnalyze the current skill inventory and identify candidate groups that could be consolidated into sub-skill bundles. This sub-skill is **read-only**: it produces a proposal for the user to review before any file changes are made by `sub-skill.consolidate`.\n\n## When to use\n\n- The user asks to review, reorganize, or audit the skill inventory.\n- There are many loosely-related skills that might benefit from hierarchical grouping.\n- The user wants to evaluate whether a new skill should be a sub-skill of an existing parent.\n\n## Process\n\n1. **List the current inventory.** Use the skill registry (or scan the configured skill roots) to get a full list of skill names, descriptions, and source scopes.\n2. **Categorize by domain.** Group skills by functional domain — e.g. file operations, web tools, collaboration, observability.\n3. **Detect coupling.** Identify skills that are frequently used together or share similar `whenToUse` conditions.\n4. **Flag granularity issues.** Call out skills that are too fine-grained (e.g. one skill per CLI flag) or too broad to land in any single domain.\n5. **Propose sub-skill structures.** For each candidate group, list:\n - The parent skill name and a one-line description.\n - The children that should move under it.\n - Any documentation, reference, example, asset, or template directories that must move with each child so the final directory layout stays aligned.\n - Whether the parent needs `has-sub-skill: true` (it does, if children should be discovered).\n6. **Output a summary report.** Present findings as a concise grouped list with rationale, and stop. Do **not** edit any file — that's `sub-skill.consolidate`'s job.\n\n## Criteria for a good sub-skill grouping\n\n- **Shared context.** Children operate within the same domain or workflow.\n- **Composable entry point.** The parent gives a natural top-level handle; children handle specifics.\n- **Shallow nesting.** Prefer 2 levels (parent → child). Avoid 3+ unless strictly necessary.\n- **Backward compatibility.** Existing skill names should ideally remain discoverable.\n\n## Example output format\n\n```\nProposed sub-skill: web-research\n - Parent: web-research (has-sub-skill: true)\n - Children:\n - web-search → move under web-research/search\n - fetch-url → move under web-research/fetch\n - Documentation alignment: move each child's references/examples/assets with that child.\n - Rationale: Both deal with online information retrieval and are often chained together.\n```\n";
|
|
242587
242587
|
//#endregion
|
|
242588
|
-
//#region
|
|
242588
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/builtin/sub-skill/SKILL.md?raw
|
|
242589
242589
|
var SKILL_default = "---\nname: sub-skill\ndescription: Discover and reorganize the skill inventory into hierarchical sub-skill bundles. Use when the user asks to review, group, or consolidate skills into a parent bundle.\ndisable-model-invocation: true\nhas-sub-skill: true\n---\n\n# Sub-skill\n\nContainer skill for analyzing the local skill inventory and reorganizing it into hierarchical sub-skill bundles (`has-sub-skill: true` parents with children inside).\n\n## When to use\n\n- The user asks to review, reorganize, or consolidate skills.\n- There are many loosely-related skills that might benefit from hierarchical grouping.\n- The user wants to evaluate whether a new skill should be a sub-skill of an existing one.\n\n## Sub-skills\n\n- **`sub-skill.review`** — Analyze the current inventory and propose candidate sub-skill groupings.\n- **`sub-skill.consolidate`** — Apply an approved grouping by moving skills into a parent bundle, with timestamped backups.\n\nThe usual flow is `sub-skill.review` first (read-only proposal), then `sub-skill.consolidate` after the user approves a plan. Never run consolidate without an explicit go-ahead from the user.\n";
|
|
242590
242590
|
//#endregion
|
|
242591
|
-
//#region
|
|
242591
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/builtin/sub-skill.ts
|
|
242592
242592
|
function makeBuiltin(body, dirName, pseudoPath, extraMetadata = {}) {
|
|
242593
242593
|
const parsed = parseSkillText({
|
|
242594
242594
|
skillMdPath: `/builtin/skills/${dirName}/SKILL.md`,
|
|
@@ -242621,10 +242621,10 @@ const SUB_SKILL_CONSOLIDATE = makeBuiltin(SKILL_default$2, "sub-skill.consolidat
|
|
|
242621
242621
|
isSubSkill: true
|
|
242622
242622
|
});
|
|
242623
242623
|
//#endregion
|
|
242624
|
-
//#region
|
|
242624
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/builtin/update-config.md?raw
|
|
242625
242625
|
var update_config_default = "---\nname: update-config\ndescription: Inspect or edit blun's own config — `config.toml` (model, provider, permission, hooks) and `tui.toml` (theme, editor, notifications, auto-update). Use when the user asks what a setting does or wants to change one.\n---\n\n# Configure blun (update-config)\n\nHelp the user inspect, change, and validate blun's configuration files. The files are **TOML** with **snake_case** keys.\n\n## The two config files\n\nblun has two TOML config files, both under `<BLUN_HOME>/`, both snake_case, but with different ownership — decide which one the user means before doing anything.\n\nThe runtime resolves the data directory as `BLUN_HOME` first, falling back to `~/.blun`. Before doing anything, resolve the actual directory with Bash so you don't write to the wrong place. Check whether `BLUN_HOME` is set and fall back to `~/.blun` when it is empty:\n\n```bash\necho \"$BLUN_HOME\"\necho \"$HOME/.blun\"\n```\n\nUse the first line when it is non-empty; otherwise use the second line. In the rest of this skill, `<BLUN_HOME>` means that resolved root — **never assume `~/.blun`**.\n\n- **`config.toml`** — agent / runtime settings: `default_model`, `providers`, `models`, `thinking`, `permission`, `hooks`, `loop_control`, etc.\n- **`tui.toml`** — terminal-UI / client preferences: `theme`, `[editor].command`, `[notifications]`, `[upgrade].auto_install` (auto-update). These can usually also be changed with the interactive commands `/config`, `/theme`, `/editor`, which is easier — prefer pointing the user at those.\n\nThe \"read → copy → Edit → validate → back up → overwrite\" flow below applies to both files; only **which reload command applies** differs (see Capability 4).\n\n## Prerequisite 1: use the installed field reference\n\nBefore touching any config, use **Bash** to print the field reference from the installed executable. Select the command for the target file:\n\n```\nblun doctor config --schema\nblun doctor tui --schema\n```\n\n- These read-only commands print **JSON Schema**, not a JSON configuration file. The actual configuration remains **TOML**. They do not read user configuration, create a session, or validate a candidate file.\n- Use the declared **snake_case** field names, nesting, types, required fields and bounds. Names inside records (provider/model aliases, environment variables and HTTP headers) and enum values are literal; do not rename them.\n- This reference comes from the installed schemas. It does not enumerate effective runtime defaults, legacy aliases or every custom validation rule. An absent default means **unspecified**, not zero or false. Keep the candidate validation in Capability 3 mandatory.\n- If the installed executable does not support `--schema`, or the command fails, stop before editing and report that failure. Obtain a reference for that exact version; do not guess keys or silently switch to an unrelated version.\n- **FetchURL** and `https://blun.ai/docs` can provide background, but a general documentation index is not the field reference for this installed version.\n\n## Prerequisite 2: read the target file before any change\n\nBefore any modification, use **Read** on the target config file (decide whether it's `config.toml` or `tui.toml` per the above):\n\n- Location: `<BLUN_HOME>/config.toml` or `<BLUN_HOME>/tui.toml`. For other scopes/files, defer to the official docs.\n- A missing or empty file is fine — you'll create a minimal skeleton later.\n- If the file exists but **fails to parse as TOML**, report the error verbatim and **stop** — never overwrite a broken file in place (it could destroy the user's existing config).\n\n---\n\n## Capability 1: explain configuration (read-only, no file changes)\n\nWhen the user asks \"what config is there\", \"what does this setting do\", or \"how do I use it\":\n\n1. Read the installed field reference (Prerequisite 1).\n2. Read the current `config.toml` (Prerequisite 2).\n3. Answer against both: list the relevant sections / keys, what each is for, the **current configured value**, and the allowed-value range; say which file and section each lives in. State defaults only when independently established for this version; the absence of a schema default is not evidence of the effective value.\n4. Present it as a compact grouped list or table. **Stay read-only — write no files.**\n\n## Capability 2: make changes for the user (copy → Edit → validate → back up → overwrite)\n\nDon't edit the target file in place, and **don't rewrite it from scratch** — instead copy it, Edit the copy, and keep the original out of any broken state the whole time:\n\n1. **Clarify intent**: which key, what value, and which file (`config.toml` or `tui.toml`). Ask in one line if ambiguous; for discrete choices (e.g. scope) AskUserQuestion is fine, but use plain questions for free-form input.\n2. **Read the target file** (Prerequisite 2): Read it to understand the current state and confirm it parses.\n3. **Copy out a candidate (do not create from scratch)**: use **Bash** to copy the target verbatim — `cp config.toml config-new.toml` (same directory, `-new` suffix; for tui.toml, `cp tui.toml tui-new.toml`). **Leave the original untouched for now.**\n - Only when the target doesn't exist (nothing to copy) should you use **Write** to create a minimal skeleton candidate (e.g. just the comment line `# <BLUN_HOME>/config.toml`).\n4. **Edit the candidate**: use the **Edit** tool on the candidate to **change/add only the target key** — never rewrite the whole file. That way every existing section, entry, comment, and bit of formatting stays exactly as-is; only what should change changes. The candidate is identical to the original, so use the content you read in step 2 to locate the Edit anchor. Check the change against the installed field reference (key / section / value type / allowed values, snake_case).\n5. **Validate the candidate** (see Capability 3, via `blun doctor`). **If anything fails, keep Editing the candidate and re-validate, looping until it all passes.**\n6. **Back up and overwrite** (only after validation fully passes):\n - **Back up the old file — always create a new timestamped backup, keep all of them, never overwrite an existing backup.** Copy this exactly with **Bash** (for config.toml): `cp config.toml \"config.toml.$(date +%Y%m%d-%H%M%S).bak\"`; for tui.toml: `cp tui.toml \"tui.toml.$(date +%Y%m%d-%H%M%S).bak\"`. Skip the backup only if the target didn't exist.\n - Overwrite with the candidate: `mv config-new.toml config.toml`.\n - If reload errors after the overwrite, the user can recover from **the most recent timestamped backup**.\n7. Tell the user how to apply it (see Capability 4).\n\n## Capability 3: validate the candidate file (must pass before overwrite)\n\nUse **`blun doctor`** to validate the candidate you wrote — it doesn't start the TUI and doesn't modify any file; it runs blun's own parser + schema (syntax and schema together), so it's the authoritative check. Pick the subcommand by which file you changed, and pass the **candidate** path explicitly:\n\n- changed `config.toml` → `blun doctor config <config-new.toml path>`\n- changed `tui.toml` → `blun doctor tui <tui-new.toml path>`\n\nWhen a path is passed explicitly the file must exist (your candidate does, so that's fine). **Exit code 0 = pass (valid or skipped); non-zero = a specified file is missing or the config is invalid** — show the output verbatim, fix the candidate, and re-run, looping until it's 0.\n\nThen do two checks `blun doctor` can't:\n\n1. **Cross-check values against the installed field reference and the user's intent**: are the key / section / enum values correct? Doctor validates syntax and runtime rules; it does not establish that a model alias or a valid value is the one the user intended. Unknown keys may be preserved without taking effect, so successful validation alone is not a spelling check.\n2. **Completeness**: every existing entry is still present (the candidate fully replaces the target — a dropped line is a deletion).\n\n> To also check whether the currently **active** config is OK overall, run `blun doctor` with no path (it checks the default `config.toml` + `tui.toml`, showing a missing one as skipped).\n\n## Capability 4: tell the user how to apply changes\n\nOnce local validation passes, tell the user how to make the change take effect — **the reload command depends on which file you changed**:\n\n- changed **`config.toml`** → run **`/reload`** in the TUI (reloads the session and applies `config.toml`; it also reloads `tui.toml`).\n- changed **`tui.toml`** → run **`/reload-tui`** (reloads only `tui.toml`, lighter); `/reload` works too (reloads both).\n- changed both → a single **`/reload`** covers it.\n\nNote: `/reload` is available **only when idle** — if a reply is streaming, press Esc / Ctrl-C to stop first. `blun doctor` already validated the schema before the overwrite, so reload should apply cleanly; if it still errors, follow the message to fix it or recover from the most recent timestamped backup. If you don't want to reload now, the **next new session** picks it up automatically.\n\n## Don'ts\n\n- **Always back up before overwriting**, with a **timestamped name and all history kept** — don't skip the backup, don't keep only a single `.bak`, don't overwrite an old backup.\n- Don't drop unrelated entries (the candidate fully replaces the target — a dropped line is a deletion).\n- When the installed field reference is unavailable, don't edit by guessing.\n";
|
|
242626
242626
|
//#endregion
|
|
242627
|
-
//#region
|
|
242627
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/builtin/update-config.ts
|
|
242628
242628
|
const PSEUDO_PATH$1 = "builtin://update-config";
|
|
242629
242629
|
const parsed$1 = parseSkillText({
|
|
242630
242630
|
skillMdPath: "/builtin/skills/update-config.md",
|
|
@@ -242642,10 +242642,10 @@ const UPDATE_CONFIG_SKILL = {
|
|
|
242642
242642
|
}
|
|
242643
242643
|
};
|
|
242644
242644
|
//#endregion
|
|
242645
|
-
//#region
|
|
242645
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/builtin/write-goal.md?raw
|
|
242646
242646
|
var write_goal_default = "---\nname: write-goal\ndescription: Help the user craft a well-specified `/goal` objective for goal mode — turn a rough intention into a completion contract with a clear finish line, proof, boundaries, and stop rule. Use when the user asks for help writing, refining, or improving a goal.\n---\n\n# Write a good goal (write-goal)\n\nHelp the user turn a rough intention into a `/goal` objective that goal mode can pursue across many turns without supervision. A goal is not a task description — it is a completion contract. It says what must become *true*, how that truth is *proven*, where the work may and may not *reach*, and when to *stop and report* instead of grinding on.\n\nThis skill is about authoring the objective text together with the user. Drafting and starting are separate steps: you settle the wording first, and only once the user has approved it do you start the goal by calling `CreateGoal`. The user still gets a final confirmation before it runs.\n\n## Ask, don't narrate\n\n**This is the most important rule in this skill. Every decision you put to the user goes through `AskUserQuestion`. No exceptions except one (below).**\n\nGoal authoring is a chain of choices — what to scope, which phrasing, whether to add a budget and how large, which permission mode to start under. For every one of them: **stop and call `AskUserQuestion`.** Do not write a paragraph that lists options and asks the user to reply in prose. Do not say \"let me know if you'd prefer A or B.\" Do not bundle three questions into a wall of text. If you catch yourself typing out choices for the user to answer in free text, delete it and call `AskUserQuestion` instead.\n\nA prose menu is a defect, not a style choice: it is slower for the user, easy to skim past, and usually gets a vague answer that forces another round. The only time you may ask in plain text is when `AskUserQuestion` is genuinely unavailable — auto mode, or a host that does not support it — and only then do you fall back to a short message with clearly labelled options and wait. Plain prose for *open-ended* input (\"what would prove this is done?\") is fine; the rule is about **choices between options**, which always use the tool.\n\n## Rules of engagement\n\n- **Only help when the user has asked for it.** Never volunteer to wrap an ordinary request in a goal, and never start one on your own. A normal \"fix this test\" is a normal request; treat it as a goal only when the user says they want a goal. If a task looks like it would suit goal mode, you may mention that once — but wait for the user to choose.\n- **Write in the user's language.** Draft the objective in whatever language the user is writing to you in. If the project configuration or a saved memory names a preferred language, honor that instead. Keep the surrounding discussion in the same language.\n- **Show before you start.** Always present the full drafted goal back to the user and get their agreement before anything runs. The user should read the exact text that will become the objective, not a paraphrase of it.\n- **Draft with the user, not for them.** Goal-writing is a conversation. Offer a draft, explain the choices you made, invite changes, and fold the feedback in. Expect more than one round.\n- **Respect the user's final call.** If, after you have pointed out what is vague or risky, the user still wants a looser or thinner goal, write the goal they asked for. Note the trade-off once; do not keep relitigating it or quietly \"improve\" the wording against their wishes.\n\n## What makes a goal good\n\nThe strongest goals share one shape: they define **proof, not effort**. \"Keep improving the code\" describes effort and never ends. \"Done when `npm test` exits 0 and no file outside `src/auth` changed\" describes proof and is checkable. Aim for a contract with these parts:\n\n1. **End state** — the condition that must become true. Name the finish line concretely: a passing suite, an empty queue, a search that returns zero matches, a deployed artifact.\n2. **Proof** — the observable evidence that the end state holds. Prefer things the agent can run and you can inspect afterward: a command's exit code, a test count, a `grep`/`rg` with no hits, a file that now exists, a metric over a threshold.\n3. **Boundaries** — what the work may and may not touch. Name the scope (which module, which directory) and the off-limits actions (do not edit the spec, do not change unrelated files, do not make destructive data changes).\n4. **The loop** — when the work is iterative, say how to iterate: rerun the check after each change, work through the queue item by item, replay the failing cases until they pass.\n5. **The stop rule** — how to end honestly when \"done\" is not reachable. A \"stop and ask before widening scope\" clause and an explicit blocked path (\"if an external service is down, record it and move on\") let the agent report instead of faking a pass or looping forever. This is about *honesty*, not a spending limit — keep it separate from any budget (see below).\n\nTwo habits make almost any goal better:\n\n- **Make it queue-shaped.** Goals that shrink a list work best: failing tests, open issues, error traces, files to migrate, rows to process. A queue gives the agent a worklist and gives you a countable definition of done.\n- **Lean on existing verification.** Tests, CI, type-checks, lint, eval suites, browser audits, and zero-match searches are leverage — they are what let a goal run unattended and still be trusted. If a task has no way to prove completion, help the user add one or reconsider whether goal mode fits.\n\nLonger runs are not better runs. A tight contract that finishes in a handful of turns beats an open-ended one that burns hours re-running the whole suite after every edit.\n\n## Budgets are opt-in\n\nGoal mode can run under a turn or token budget, but **do not set one by default, and never bake a turn cap into the objective text.** A well-specified goal already stops on its own — when the proof passes or a blocker is hit — so an arbitrary cap usually does nothing except risk cutting off work midway.\n\nWhen a budget is genuinely useful — typically an open-ended or exploratory goal that could run long unattended — you may suggest one, framed around the number users actually feel: token cost. Let the user choose the value, and sanity-check it against the work. A cap far larger than the task needs (say a thousand turns for a goal that will finish in a few) is not a safety net; it just invites wasted tokens. If the user asks for a value that looks oversized, say so and offer a smaller one, but respect their final call.\n\n## Workflow\n\n1. **Understand the intention.** Ask what outcome the user actually wants and what would prove it is done. If a finish line or a check is missing, that gap is the first thing to resolve together. As soon as the open questions reduce to concrete options, put them to the user with **AskUserQuestion** — do not list the options in prose.\n2. **Draft the goal.** Write a concrete objective in the user's language, covering as many parts of the contract above as the task warrants. Keep it readable — one or a few sentences for simple work, a short structured block (end state, checks, boundaries, stop rule) for larger work.\n3. **Show it and explain.** Present the draft in full and walk through the choices: what you picked as the finish line, what proves it, what you fenced off, when it stops. Point out anything still soft.\n4. **Revise together.** Take the user's edits and produce a new draft. When you are weighing alternative phrasings or scopes, offer them as an **AskUserQuestion** choice instead of describing them. Repeat until they are satisfied. If they want it looser than you would recommend, say so once, then write their version.\n5. **Start it.** Once the user approves the wording, start the goal by calling `CreateGoal` with the agreed objective (and a `completionCriterion` if you settled on one). Do not just print the text for the user to paste, and do not start before they have approved. Starting still surfaces a final confirmation, so the user keeps the last word on whether it runs.\n\n## A reusable shape\n\nFor a non-trivial goal, this fill-in-the-blanks structure covers the contract:\n\n```\n<What must become true.>\nDone when <command/search/state that proves it>.\nScope: only <files/area>; do not <off-limits action>.\nLoop: <how to iterate — rerun the check after each change, etc.>.\nIf <blocking condition>, stop and report instead of forcing a pass.\n```\n\nNot every goal needs every line, and none of them is a turn cap — the goal stops when the proof passes or a blocker is hit. A small, well-scoped task can be a single clear sentence. Add structure as the work grows or the cost of a wrong autonomous run rises.\n\n## Weak to strong\n\n- Weak: `Find all bugs in this codebase.` — no finish line, no proof, no stop. The agent may block at once or run far past what you wanted.\n Strong: `Fix every test in test/auth that currently fails, rerun npm test until it exits 0, change no file outside test/ or src/auth, and report anything you cannot fix with its location and why.`\n- Weak: `Optimize the project.` — no scope, no measure.\n Strong: `Migrate the payment module to the new API, make npm test -- payment exit 0, keep the diff limited to payment-related files, and stop and ask before touching shared infrastructure.`\n- Weak: `Make it faster.`\n Strong: `Make renderFrame at least 3x faster measured by the bench/render benchmark; if you cannot reach 3x after several attempts, report the best result and why.`\n\n## Common mistakes\n\n| Mistake | Better |\n| --- | --- |\n| Starting or suggesting a goal the user did not ask for | Only draft a goal once the user asks; mention the option at most once otherwise |\n| Drafting in English when the user is writing in another language | Match the user's language (or the project / memory preference) |\n| Running the goal before the user has seen the exact text | Show the full draft and get agreement first |\n| Polishing the goal silently against the user's stated wishes | Note the trade-off once, then write the goal they asked for |\n| Burying a discrete choice in prose | Offer the options with AskUserQuestion (plain labelled options if it is unavailable) |\n| Specifying effort (\"keep improving X\") | Specify proof (\"done when check X passes\") |\n| Baking a turn cap into the objective or setting a budget unprompted | Let the goal stop on its proof; suggest a budget only when useful, framed on token cost |\n| No blocked path | Add an explicit \"stop and report\" rule for blockers |\n| A goal with no way to verify completion | Anchor it to tests, a search, a metric, or another inspectable check |\n";
|
|
242647
242647
|
//#endregion
|
|
242648
|
-
//#region
|
|
242648
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/builtin/write-goal.ts
|
|
242649
242649
|
const PSEUDO_PATH = "builtin://write-goal";
|
|
242650
242650
|
const parsed = parseSkillText({
|
|
242651
242651
|
skillMdPath: "/builtin/skills/write-goal.md",
|
|
@@ -242663,7 +242663,7 @@ const WRITE_GOAL_SKILL = {
|
|
|
242663
242663
|
}
|
|
242664
242664
|
};
|
|
242665
242665
|
//#endregion
|
|
242666
|
-
//#region
|
|
242666
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/builtin/index.ts
|
|
242667
242667
|
function registerBuiltinSkills(registry) {
|
|
242668
242668
|
registry.registerBuiltinSkill(BLUN_DESIGN_DNA_SKILL);
|
|
242669
242669
|
registry.registerBuiltinSkill(MCP_CONFIG_SKILL);
|
|
@@ -242675,7 +242675,7 @@ function registerBuiltinSkills(registry) {
|
|
|
242675
242675
|
registry.registerBuiltinSkill(SUB_SKILL_CONSOLIDATE);
|
|
242676
242676
|
}
|
|
242677
242677
|
//#endregion
|
|
242678
|
-
//#region
|
|
242678
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/scanner.ts
|
|
242679
242679
|
const USER_BRAND_DIRS = ["skills"];
|
|
242680
242680
|
const USER_GENERIC_DIRS = [".agents/skills"];
|
|
242681
242681
|
const PROJECT_BRAND_DIRS = [".blun/skills", ".blun/skills"];
|
|
@@ -242929,7 +242929,7 @@ function isWithin$1(child, parent) {
|
|
|
242929
242929
|
return relative === "" || !relative.startsWith("..") && !posix$2.isAbsolute(relative);
|
|
242930
242930
|
}
|
|
242931
242931
|
//#endregion
|
|
242932
|
-
//#region
|
|
242932
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/skill/registry.ts
|
|
242933
242933
|
const LISTING_DESC_MAX = 250;
|
|
242934
242934
|
const MODEL_SKILL_LISTING_MAX_CHARS = 8e3;
|
|
242935
242935
|
var SessionSkillRegistry = class {
|
|
@@ -243176,7 +243176,7 @@ function truncate(value, max) {
|
|
|
243176
243176
|
return `${result}…`;
|
|
243177
243177
|
}
|
|
243178
243178
|
//#endregion
|
|
243179
|
-
//#region
|
|
243179
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/skill/prompt.ts
|
|
243180
243180
|
function renderUserSlashSkillPrompt(input) {
|
|
243181
243181
|
return [
|
|
243182
243182
|
`User activated the skill "${escapeXml$1(input.skillName)}". Follow the loaded skill instructions.`,
|
|
@@ -243225,7 +243225,7 @@ function renderSkillAttributes(input) {
|
|
|
243225
243225
|
].filter((item) => item[1] !== void 0).map(([name, value]) => ` ${name}="${escapeXml$1(value)}"`).join("");
|
|
243226
243226
|
}
|
|
243227
243227
|
//#endregion
|
|
243228
|
-
//#region
|
|
243228
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/skill/index.ts
|
|
243229
243229
|
const BASELINE_SKILL_ORIGIN_PREFIX = "baseline_skill:";
|
|
243230
243230
|
var SkillManager = class {
|
|
243231
243231
|
agent;
|
|
@@ -243298,13 +243298,13 @@ var SkillManager = class {
|
|
|
243298
243298
|
}
|
|
243299
243299
|
};
|
|
243300
243300
|
//#endregion
|
|
243301
|
-
//#region
|
|
243301
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/swarm/enter-reminder.md?raw
|
|
243302
243302
|
var enter_reminder_default = "## Swarm Mode\n\nYou are now in \"agent swarm\" mode. The user may send tasks that require a large number of parallel subagents.\n\n## Workflow\n\nYou do not need to use TodoList to record this workflow.\n\n1. First, you may need to do a small amount of exploratory work before deciding how to divide the task across subagents. You may not need subagents during this exploratory phase.\n\n2. After exploring, if you are convinced no subagent is needed to complete the task, tell the user why and wait for further instructions; otherwise, continue with the appropriate delegation.\n\n3. Once you have enough context, do not handle the main work yourself. Use AgentSwarm with a `prompt_template` containing the `{{item}}` placeholder and an `items` array for the requested or appropriate number of subagents, partitioning the problem so each item gives one subagent a distinct part of the work. Pass `subagent_type` when the whole swarm should use a non-default subagent profile.\n\n## Coordination\n\n- Give each subagent a distinct scope of work.\n- Avoid duplicating work across subagents.\n- Avoid assigning conflicting changes or responsibilities to different subagents.\n- Remember that subagents have your full capabilities. Do not overload their prompts with excessive detail; only describe the necessary background and each subagent's specific task.\n- Unless the user explicitly specifies a lower limit, do not try to conserve the number of agents. AgentSwarm supports up to 128 subagents and queues launches automatically, so decompose work as finely as possible while keeping subagent responsibilities non-conflicting; combine tasks only when they are genuinely inseparable. If the subagents only need to read, inspect, or report back without making changes, their scopes may overlap slightly.\n";
|
|
243303
243303
|
//#endregion
|
|
243304
|
-
//#region
|
|
243304
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/swarm/exit-reminder.md?raw
|
|
243305
243305
|
var exit_reminder_default = "## Swarm Mode Ended\n\nSwarm Mode has ended. You are no longer required to follow the Swarm Mode workflow.\n\nThe user's next request is likely to be a regular request that does not need AgentSwarm. If the request still benefits from parallel subagents, you may call the AgentSwarm tool, but decide from the new request itself rather than the ended Swarm Mode workflow.\n";
|
|
243306
243306
|
//#endregion
|
|
243307
|
-
//#region
|
|
243307
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/swarm/index.ts
|
|
243308
243308
|
var SwarmMode = class {
|
|
243309
243309
|
agent;
|
|
243310
243310
|
active = null;
|
|
@@ -243351,7 +243351,7 @@ var SwarmMode = class {
|
|
|
243351
243351
|
}
|
|
243352
243352
|
};
|
|
243353
243353
|
//#endregion
|
|
243354
|
-
//#region
|
|
243354
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/loop/tool-access.ts
|
|
243355
243355
|
const ToolAccesses = {
|
|
243356
243356
|
none() {
|
|
243357
243357
|
return [];
|
|
@@ -243422,7 +243422,7 @@ function normalizePath$1(path) {
|
|
|
243422
243422
|
return folded;
|
|
243423
243423
|
}
|
|
243424
243424
|
//#endregion
|
|
243425
|
-
//#region
|
|
243425
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/loop/events.ts
|
|
243426
243426
|
function createLoopEventDispatcher(input) {
|
|
243427
243427
|
function dispatchEvent(event) {
|
|
243428
243428
|
if (isRecordedEvent(event)) return recordEvent(input, event);
|
|
@@ -243449,14 +243449,14 @@ function safeEmitLive(emit, event) {
|
|
|
243449
243449
|
if (maybePromise !== void 0 && maybePromise !== null && typeof maybePromise.then === "function" && typeof maybePromise.catch === "function") return maybePromise.catch(() => {});
|
|
243450
243450
|
}
|
|
243451
243451
|
//#endregion
|
|
243452
|
-
//#region
|
|
243452
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/loop/execution-observer.ts
|
|
243453
243453
|
function observeExecution(observer, execution) {
|
|
243454
243454
|
try {
|
|
243455
243455
|
observer?.(execution);
|
|
243456
243456
|
} catch {}
|
|
243457
243457
|
}
|
|
243458
243458
|
//#endregion
|
|
243459
|
-
//#region
|
|
243459
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/loop/thinking-only.ts
|
|
243460
243460
|
const DEFAULT_THINKING_ONLY_LIMIT_MS = 12e4;
|
|
243461
243461
|
const FORCE_ANSWER_PROMPT = ["Stop hidden thinking now and take the next concrete action.", "If a tool is required, call it now; otherwise answer with the concrete finding, blocker, or next action."].join(" ");
|
|
243462
243462
|
var ThinkingOnlyTimeoutError = class extends Error {
|
|
@@ -251005,7 +251005,7 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
251005
251005
|
exports.default = formatsPlugin;
|
|
251006
251006
|
}));
|
|
251007
251007
|
//#endregion
|
|
251008
|
-
//#region
|
|
251008
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/args-validator.ts
|
|
251009
251009
|
var import_ajv = /* @__PURE__ */ __toESM(require_ajv(), 1);
|
|
251010
251010
|
var import__2019 = /* @__PURE__ */ __toESM(require__2019(), 1);
|
|
251011
251011
|
var import__2020 = /* @__PURE__ */ __toESM(require__2020(), 1);
|
|
@@ -251075,7 +251075,7 @@ function validateToolArgs(validator, args) {
|
|
|
251075
251075
|
return errors.map((error) => formatValidationError(error)).join("; ");
|
|
251076
251076
|
}
|
|
251077
251077
|
//#endregion
|
|
251078
|
-
//#region
|
|
251078
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/loop/tool-scheduler.ts
|
|
251079
251079
|
/**
|
|
251080
251080
|
* Stateful execution scheduler for tool calls in one model step.
|
|
251081
251081
|
*
|
|
@@ -251134,7 +251134,7 @@ var ToolScheduler = class {
|
|
|
251134
251134
|
}
|
|
251135
251135
|
};
|
|
251136
251136
|
//#endregion
|
|
251137
|
-
//#region
|
|
251137
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/loop/tool-call.ts
|
|
251138
251138
|
const GRACE_TIMEOUT_MS = 2e3;
|
|
251139
251139
|
const TOOL_OUTPUT_EMPTY = "Tool output is empty.";
|
|
251140
251140
|
const TOOL_OUTPUT_NON_TEXT = "Tool returned non-text content.";
|
|
@@ -251690,7 +251690,7 @@ async function dispatchToolCall(step, call, args, displayFields) {
|
|
|
251690
251690
|
});
|
|
251691
251691
|
}
|
|
251692
251692
|
//#endregion
|
|
251693
|
-
//#region
|
|
251693
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/loop/turn-step.ts
|
|
251694
251694
|
/**
|
|
251695
251695
|
* Executes one provider step.
|
|
251696
251696
|
*
|
|
@@ -252024,7 +252024,7 @@ function createStepEventGate(deps) {
|
|
|
252024
252024
|
};
|
|
252025
252025
|
}
|
|
252026
252026
|
//#endregion
|
|
252027
|
-
//#region
|
|
252027
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/loop/run-turn.ts
|
|
252028
252028
|
/**
|
|
252029
252029
|
* Turn-level loop for a stateless agent run.
|
|
252030
252030
|
*
|
|
@@ -252109,7 +252109,7 @@ function makeInterruptedEvent(reason, attemptedSteps, activeStep, message) {
|
|
|
252109
252109
|
};
|
|
252110
252110
|
}
|
|
252111
252111
|
//#endregion
|
|
252112
|
-
//#region
|
|
252112
|
+
//#region ../../../../hm623s/r/packages/protocol/src/error-codes.ts
|
|
252113
252113
|
/**
|
|
252114
252114
|
* Integer namespaces:
|
|
252115
252115
|
* - 0 success
|
|
@@ -252232,7 +252232,7 @@ const ErrorCode$1 = {
|
|
|
252232
252232
|
};
|
|
252233
252233
|
ErrorCode$1.SUCCESS, ErrorCode$1.VALIDATION_FAILED, ErrorCode$1.REQUEST_MALFORMED, ErrorCode$1.AUTH_PROVISIONING_REQUIRED, ErrorCode$1.AUTH_TOKEN_MISSING, ErrorCode$1.AUTH_TOKEN_UNAUTHORIZED, ErrorCode$1.AUTH_MODEL_NOT_RESOLVED, ErrorCode$1.SESSION_NOT_FOUND, ErrorCode$1.PROMPT_NOT_FOUND, ErrorCode$1.MESSAGE_NOT_FOUND, ErrorCode$1.APPROVAL_NOT_FOUND, ErrorCode$1.QUESTION_NOT_FOUND, ErrorCode$1.TASK_NOT_FOUND, ErrorCode$1.FILE_NOT_FOUND, ErrorCode$1.MCP_SERVER_NOT_FOUND, ErrorCode$1.FS_PATH_NOT_FOUND, ErrorCode$1.WORKSPACE_NOT_FOUND, ErrorCode$1.FS_PERMISSION_DENIED, ErrorCode$1.PROVIDER_NOT_FOUND, ErrorCode$1.MODEL_NOT_FOUND, ErrorCode$1.TERMINAL_NOT_FOUND, ErrorCode$1.SKILL_NOT_FOUND, ErrorCode$1.SESSION_BUSY, ErrorCode$1.APPROVAL_ALREADY_RESOLVED, ErrorCode$1.PROMPT_ALREADY_COMPLETED, ErrorCode$1.TASK_ALREADY_FINISHED, ErrorCode$1.MCP_ALREADY_CONNECTED, ErrorCode$1.FS_IS_DIRECTORY, ErrorCode$1.FS_IS_BINARY, ErrorCode$1.FS_GIT_UNAVAILABLE, ErrorCode$1.QUESTION_DISMISSED, ErrorCode$1.COMPACTION_UNABLE, ErrorCode$1.SESSION_UNDO_UNAVAILABLE, ErrorCode$1.SKILL_NOT_ACTIVATABLE, ErrorCode$1.GOAL_ALREADY_EXISTS, ErrorCode$1.GOAL_NOT_FOUND, ErrorCode$1.GOAL_STATUS_INVALID, ErrorCode$1.GOAL_NOT_RESUMABLE, ErrorCode$1.GOAL_OBJECTIVE_EMPTY, ErrorCode$1.GOAL_OBJECTIVE_TOO_LONG, ErrorCode$1.FS_ALREADY_EXISTS, ErrorCode$1.APPROVAL_EXPIRED, ErrorCode$1.QUESTION_EXPIRED, ErrorCode$1.FILE_EXPIRED, ErrorCode$1.FILE_TOO_LARGE, ErrorCode$1.FS_TOO_LARGE, ErrorCode$1.FS_TOO_MANY_RESULTS, ErrorCode$1.FS_PATH_ESCAPES_SESSION, ErrorCode$1.FS_GREP_TIMEOUT, ErrorCode$1.FS_WATCH_LIMIT_EXCEEDED, ErrorCode$1.INTERNAL_ERROR, ErrorCode$1.PERSISTENCE_FAILURE, ErrorCode$1.TOOL_EXECUTION_FAILED, ErrorCode$1.TOOL_NOT_AVAILABLE;
|
|
252234
252234
|
//#endregion
|
|
252235
|
-
//#region
|
|
252235
|
+
//#region ../../../../hm623s/r/packages/protocol/src/pagination.ts
|
|
252236
252236
|
const cursorQuerySchema = object({
|
|
252237
252237
|
before_id: string().min(1).optional(),
|
|
252238
252238
|
after_id: string().min(1).optional(),
|
|
@@ -252250,7 +252250,7 @@ const pageResponseSchema = (item) => object({
|
|
|
252250
252250
|
has_more: boolean$1()
|
|
252251
252251
|
});
|
|
252252
252252
|
//#endregion
|
|
252253
|
-
//#region
|
|
252253
|
+
//#region ../../../../hm623s/r/packages/protocol/src/time.ts
|
|
252254
252254
|
const ISO_8601_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}(?::?\d{2})?)$/;
|
|
252255
252255
|
const isoDateTimeSchema = string().refine((value) => ISO_8601_REGEX.test(value), { message: "must be an ISO 8601 datetime string" }).transform((value, ctx) => {
|
|
252256
252256
|
const ms = Date.parse(value);
|
|
@@ -252357,7 +252357,7 @@ function ulid(seedTime, prng) {
|
|
|
252357
252357
|
return encodeTime(!seedTime || isNaN(seedTime) ? Date.now() : seedTime, 10) + encodeRandom(RANDOM_LEN, currentPRNG);
|
|
252358
252358
|
}
|
|
252359
252359
|
//#endregion
|
|
252360
|
-
//#region
|
|
252360
|
+
//#region ../../../../hm623s/r/packages/protocol/src/display.ts
|
|
252361
252361
|
const ToolInputDisplaySchema = discriminatedUnion("kind", [
|
|
252362
252362
|
object({
|
|
252363
252363
|
kind: literal("command"),
|
|
@@ -252529,7 +252529,7 @@ discriminatedUnion("kind", [
|
|
|
252529
252529
|
})
|
|
252530
252530
|
]);
|
|
252531
252531
|
//#endregion
|
|
252532
|
-
//#region
|
|
252532
|
+
//#region ../../../../hm623s/r/packages/protocol/src/message.ts
|
|
252533
252533
|
const messageRoleSchema = _enum([
|
|
252534
252534
|
"user",
|
|
252535
252535
|
"assistant",
|
|
@@ -252603,7 +252603,7 @@ const messageSchema = object({
|
|
|
252603
252603
|
metadata: record$2(string(), unknown()).optional()
|
|
252604
252604
|
});
|
|
252605
252605
|
//#endregion
|
|
252606
|
-
//#region
|
|
252606
|
+
//#region ../../../../hm623s/r/packages/protocol/src/rest/prompt.ts
|
|
252607
252607
|
/**
|
|
252608
252608
|
* POST /v1/sessions/{sid}/prompts
|
|
252609
252609
|
* Body: PromptSubmission {
|
|
@@ -252675,7 +252675,7 @@ object({
|
|
|
252675
252675
|
at_seq: number$1().int().nonnegative().optional()
|
|
252676
252676
|
});
|
|
252677
252677
|
//#endregion
|
|
252678
|
-
//#region
|
|
252678
|
+
//#region ../../../../hm623s/r/packages/protocol/src/workspace.ts
|
|
252679
252679
|
const workspaceIdSchema = string().regex(/^wd_[a-z0-9._-]+_[0-9a-f]{12}$/, { message: "workspace_id must be a wd_<slug>_<hash12> string" });
|
|
252680
252680
|
const workspaceSchema = object({
|
|
252681
252681
|
id: workspaceIdSchema,
|
|
@@ -252693,7 +252693,7 @@ object({
|
|
|
252693
252693
|
});
|
|
252694
252694
|
object({ name: string().min(1).max(100) });
|
|
252695
252695
|
//#endregion
|
|
252696
|
-
//#region
|
|
252696
|
+
//#region ../../../../hm623s/r/packages/protocol/src/session.ts
|
|
252697
252697
|
const sessionStatusSchema = _enum([
|
|
252698
252698
|
"idle",
|
|
252699
252699
|
"running",
|
|
@@ -252803,7 +252803,7 @@ object({
|
|
|
252803
252803
|
metadata: record$2(string(), unknown()).optional()
|
|
252804
252804
|
});
|
|
252805
252805
|
//#endregion
|
|
252806
|
-
//#region
|
|
252806
|
+
//#region ../../../../hm623s/r/packages/protocol/src/rest/config.ts
|
|
252807
252807
|
const providerConfigResponseSchema = object({
|
|
252808
252808
|
type: string(),
|
|
252809
252809
|
base_url: string().optional(),
|
|
@@ -252852,7 +252852,7 @@ object({
|
|
|
252852
252852
|
telemetry: boolean$1().optional()
|
|
252853
252853
|
});
|
|
252854
252854
|
//#endregion
|
|
252855
|
-
//#region
|
|
252855
|
+
//#region ../../../../hm623s/r/packages/protocol/src/modelCatalog.ts
|
|
252856
252856
|
const modelCatalogItemSchema = object({
|
|
252857
252857
|
provider: string().min(1),
|
|
252858
252858
|
model: string().min(1),
|
|
@@ -252887,7 +252887,7 @@ const providerRefreshFailureSchema = object({
|
|
|
252887
252887
|
reason: string().min(1)
|
|
252888
252888
|
});
|
|
252889
252889
|
//#endregion
|
|
252890
|
-
//#region
|
|
252890
|
+
//#region ../../../../hm623s/r/packages/protocol/src/events.ts
|
|
252891
252891
|
const MCP_OAUTH_AUTHORIZATION_URL_TOOL_UPDATE = "mcp.oauth.authorization_url";
|
|
252892
252892
|
const tokenUsageSchema = object({
|
|
252893
252893
|
inputOther: number$1(),
|
|
@@ -253596,7 +253596,7 @@ const eventSchema = discriminatedUnion("type", [
|
|
|
253596
253596
|
sessionId: string()
|
|
253597
253597
|
}));
|
|
253598
253598
|
//#endregion
|
|
253599
|
-
//#region
|
|
253599
|
+
//#region ../../../../hm623s/r/packages/protocol/src/ws-control.ts
|
|
253600
253600
|
/**
|
|
253601
253601
|
* Event: { type, seq, session_id?, timestamp, payload }
|
|
253602
253602
|
* Control: { type, id?, payload }
|
|
@@ -253998,7 +253998,7 @@ const serverSystemOperations = [
|
|
|
253998
253998
|
];
|
|
253999
253999
|
[...clientControlOperations, ...serverSystemOperations];
|
|
254000
254000
|
//#endregion
|
|
254001
|
-
//#region
|
|
254001
|
+
//#region ../../../../hm623s/r/packages/protocol/src/approval.ts
|
|
254002
254002
|
const approvalDecisionSchema = _enum([
|
|
254003
254003
|
"approved",
|
|
254004
254004
|
"rejected",
|
|
@@ -254023,7 +254023,7 @@ object({
|
|
|
254023
254023
|
selected_label: string().optional()
|
|
254024
254024
|
});
|
|
254025
254025
|
//#endregion
|
|
254026
|
-
//#region
|
|
254026
|
+
//#region ../../../../hm623s/r/packages/protocol/src/question.ts
|
|
254027
254027
|
const questionOptionSchema = object({
|
|
254028
254028
|
id: string().min(1),
|
|
254029
254029
|
label: string().min(1),
|
|
@@ -254080,7 +254080,7 @@ object({
|
|
|
254080
254080
|
note: string().optional()
|
|
254081
254081
|
});
|
|
254082
254082
|
//#endregion
|
|
254083
|
-
//#region
|
|
254083
|
+
//#region ../../../../hm623s/r/packages/protocol/src/tool.ts
|
|
254084
254084
|
const toolSourceSchema = _enum([
|
|
254085
254085
|
"builtin",
|
|
254086
254086
|
"skill",
|
|
@@ -254113,7 +254113,7 @@ const mcpServerSchema = object({
|
|
|
254113
254113
|
tool_count: number$1().int().nonnegative()
|
|
254114
254114
|
});
|
|
254115
254115
|
//#endregion
|
|
254116
|
-
//#region
|
|
254116
|
+
//#region ../../../../hm623s/r/packages/protocol/src/skill.ts
|
|
254117
254117
|
const skillDescriptorSchema = object({
|
|
254118
254118
|
name: string().min(1),
|
|
254119
254119
|
description: string(),
|
|
@@ -254124,7 +254124,7 @@ const skillDescriptorSchema = object({
|
|
|
254124
254124
|
disable_model_invocation: boolean$1().optional()
|
|
254125
254125
|
});
|
|
254126
254126
|
//#endregion
|
|
254127
|
-
//#region
|
|
254127
|
+
//#region ../../../../hm623s/r/packages/protocol/src/task.ts
|
|
254128
254128
|
const backgroundTaskKindSchema = _enum([
|
|
254129
254129
|
"subagent",
|
|
254130
254130
|
"bash",
|
|
@@ -254150,7 +254150,7 @@ const backgroundTaskSchema = object({
|
|
|
254150
254150
|
output_bytes: number$1().int().nonnegative().optional()
|
|
254151
254151
|
});
|
|
254152
254152
|
//#endregion
|
|
254153
|
-
//#region
|
|
254153
|
+
//#region ../../../../hm623s/r/packages/protocol/src/fs.ts
|
|
254154
254154
|
const fsKindSchema = _enum([
|
|
254155
254155
|
"file",
|
|
254156
254156
|
"directory",
|
|
@@ -254234,7 +254234,7 @@ object({
|
|
|
254234
254234
|
expires_at: isoDateTimeSchema.optional()
|
|
254235
254235
|
});
|
|
254236
254236
|
//#endregion
|
|
254237
|
-
//#region
|
|
254237
|
+
//#region ../../../../hm623s/r/packages/protocol/src/rest/fs.ts
|
|
254238
254238
|
/**
|
|
254239
254239
|
* POST /v1/sessions/{sid}/fs:list
|
|
254240
254240
|
* Body: FsListRequest
|
|
@@ -254452,7 +254452,7 @@ object({
|
|
|
254452
254452
|
if_none_match: string().optional()
|
|
254453
254453
|
});
|
|
254454
254454
|
//#endregion
|
|
254455
|
-
//#region
|
|
254455
|
+
//#region ../../../../hm623s/r/packages/protocol/src/rest/meta.ts
|
|
254456
254456
|
/**
|
|
254457
254457
|
* GET /v1/meta
|
|
254458
254458
|
* Reply: MetaResponse {
|
|
@@ -254485,7 +254485,7 @@ object({
|
|
|
254485
254485
|
dangerous_bypass_auth: boolean$1()
|
|
254486
254486
|
});
|
|
254487
254487
|
//#endregion
|
|
254488
|
-
//#region
|
|
254488
|
+
//#region ../../../../hm623s/r/packages/protocol/src/rest/auth.ts
|
|
254489
254489
|
/**
|
|
254490
254490
|
* GET /v1/auth
|
|
254491
254491
|
* Reply: AuthSummary {
|
|
@@ -254512,7 +254512,7 @@ object({
|
|
|
254512
254512
|
managed_provider: managedProviderSummarySchema.nullable()
|
|
254513
254513
|
});
|
|
254514
254514
|
//#endregion
|
|
254515
|
-
//#region
|
|
254515
|
+
//#region ../../../../hm623s/r/packages/protocol/src/rest/oauth.ts
|
|
254516
254516
|
/**
|
|
254517
254517
|
* POST /v1/oauth/login body: { provider? } data: OAuthFlowStart
|
|
254518
254518
|
* GET /v1/oauth/login query: { provider? } data: OAuthFlowStatus | null
|
|
@@ -254562,7 +254562,7 @@ object({
|
|
|
254562
254562
|
provider: string().min(1)
|
|
254563
254563
|
});
|
|
254564
254564
|
//#endregion
|
|
254565
|
-
//#region
|
|
254565
|
+
//#region ../../../../hm623s/r/packages/protocol/src/rest/session.ts
|
|
254566
254566
|
/**
|
|
254567
254567
|
* POST /v1/sessions body: SessionCreate data: Session
|
|
254568
254568
|
* GET /v1/sessions query: ListSessions data: Page<Session>
|
|
@@ -254627,7 +254627,7 @@ object({
|
|
|
254627
254627
|
object({ archived: literal(true) });
|
|
254628
254628
|
object({ aborted: boolean$1() });
|
|
254629
254629
|
//#endregion
|
|
254630
|
-
//#region
|
|
254630
|
+
//#region ../../../../hm623s/r/packages/protocol/src/rest/snapshot.ts
|
|
254631
254631
|
/**
|
|
254632
254632
|
* `GET /v1/sessions/{session_id}/snapshot` — IM-style "initial sync".
|
|
254633
254633
|
*
|
|
@@ -254779,7 +254779,7 @@ object({
|
|
|
254779
254779
|
failed: array(providerRefreshFailureSchema)
|
|
254780
254780
|
});
|
|
254781
254781
|
//#endregion
|
|
254782
|
-
//#region
|
|
254782
|
+
//#region ../../../../hm623s/r/packages/protocol/src/rest/terminal.ts
|
|
254783
254783
|
const relativeCwdSchema = string().min(1).refine((value) => !isAbsolutePath(value), "cwd must be relative to the session workspace");
|
|
254784
254784
|
const terminalStatusSchema = _enum(["running", "exited"]);
|
|
254785
254785
|
const terminalSchema = object({
|
|
@@ -254820,7 +254820,7 @@ object({ connections: array(object({
|
|
|
254820
254820
|
subscriptions: array(string())
|
|
254821
254821
|
})) });
|
|
254822
254822
|
//#endregion
|
|
254823
|
-
//#region
|
|
254823
|
+
//#region ../../../../hm623s/r/packages/protocol/src/rest/guiStore.ts
|
|
254824
254824
|
const keySchema = string().min(1).max(256);
|
|
254825
254825
|
object({ key: keySchema });
|
|
254826
254826
|
object({
|
|
@@ -254831,7 +254831,7 @@ object({ key: keySchema });
|
|
|
254831
254831
|
object({ value: string().nullable() });
|
|
254832
254832
|
object({ length: number$1() });
|
|
254833
254833
|
//#endregion
|
|
254834
|
-
//#region
|
|
254834
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/oauth/callback-server.ts
|
|
254835
254835
|
/**
|
|
254836
254836
|
* One-shot localhost OAuth callback listener.
|
|
254837
254837
|
*
|
|
@@ -254955,7 +254955,7 @@ async function startCallbackServer() {
|
|
|
254955
254955
|
};
|
|
254956
254956
|
}
|
|
254957
254957
|
//#endregion
|
|
254958
|
-
//#region
|
|
254958
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/oauth/store.ts
|
|
254959
254959
|
/**
|
|
254960
254960
|
* Small atomic JSON file store used by the MCP OAuth provider to persist
|
|
254961
254961
|
* tokens, registered client info, and discovery state under
|
|
@@ -255047,7 +255047,7 @@ var JsonFileStore = class {
|
|
|
255047
255047
|
}
|
|
255048
255048
|
};
|
|
255049
255049
|
//#endregion
|
|
255050
|
-
//#region
|
|
255050
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/oauth/provider.ts
|
|
255051
255051
|
/**
|
|
255052
255052
|
* `OAuthClientProvider` implementation backed by per-MCP-server JSON files.
|
|
255053
255053
|
*
|
|
@@ -258104,7 +258104,7 @@ async function registerClient(authorizationServerUrl, { metadata, clientMetadata
|
|
|
258104
258104
|
return OAuthClientInformationFullSchema.parse(await response.json());
|
|
258105
258105
|
}
|
|
258106
258106
|
//#endregion
|
|
258107
|
-
//#region
|
|
258107
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/oauth/service.ts
|
|
258108
258108
|
/**
|
|
258109
258109
|
* Per-process OAuth orchestrator for MCP HTTP servers.
|
|
258110
258110
|
*
|
|
@@ -258251,7 +258251,7 @@ function wrapAuthError(prefix, error) {
|
|
|
258251
258251
|
return /* @__PURE__ */ new Error(`${prefix}: ${String(error)}`);
|
|
258252
258252
|
}
|
|
258253
258253
|
//#endregion
|
|
258254
|
-
//#region
|
|
258254
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/auth-tool.ts
|
|
258255
258255
|
/**
|
|
258256
258256
|
* Synthetic `mcp__<server>__authenticate` tool.
|
|
258257
258257
|
*
|
|
@@ -258375,7 +258375,7 @@ function errorResult$1(serverName, error, authorizationUrl) {
|
|
|
258375
258375
|
};
|
|
258376
258376
|
}
|
|
258377
258377
|
//#endregion
|
|
258378
|
-
//#region
|
|
258378
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/support/image-originals.ts
|
|
258379
258379
|
/**
|
|
258380
258380
|
* Content-addressed store for pre-compression image originals.
|
|
258381
258381
|
*
|
|
@@ -258471,7 +258471,7 @@ async function sweepCache(dir, maxTotalBytes) {
|
|
|
258471
258471
|
}
|
|
258472
258472
|
}
|
|
258473
258473
|
//#endregion
|
|
258474
|
-
//#region
|
|
258474
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/output.ts
|
|
258475
258475
|
const MCP_MAX_OUTPUT_CHARS = 1e5;
|
|
258476
258476
|
const MCP_OUTPUT_TRUNCATED_TEXT = `\n\n[Output truncated: exceeded ${String(MCP_MAX_OUTPUT_CHARS)} character limit. Use pagination or more specific queries to get remaining content.]`;
|
|
258477
258477
|
const MCP_MAX_BINARY_PART_BYTES = 10 * 1024 * 1024;
|
|
@@ -258701,10 +258701,10 @@ function collapseSingleText(parts) {
|
|
|
258701
258701
|
return [...parts];
|
|
258702
258702
|
}
|
|
258703
258703
|
//#endregion
|
|
258704
|
-
//#region
|
|
258704
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/background/task-output.md?raw
|
|
258705
258705
|
var task_output_default = "Retrieve output from a running or completed background task.\n\nUse this after `Bash(run_in_background=true)` or `Agent(run_in_background=true)` when you need to inspect progress or explicitly wait for completion.\n\nGuidelines:\n- Prefer relying on automatic completion notifications. Use this tool only when you need task output before the automatic notification arrives.\n- Do not use TaskOutput to wait for a result you need before continuing — if your next step depends on the task's result, run that task in the foreground instead. TaskOutput is for a deliberate progress check you will act on without blocking, not a way to sit and wait for a background task you just launched.\n- By default this tool is non-blocking and returns a current status/output snapshot.\n- Use block=true only when you intentionally want to wait for completion or timeout.\n- This tool returns structured task metadata and a fixed-size output preview. When a persisted full log is available, it also returns output_path.\n- For a terminal task, the metadata also explains why it ended. A shell command that runs to completion reports `status: completed` on a zero exit, or `status: failed` with its non-zero `exit_code` — judge that failure from the `exit_code`, because a plain command failure carries no `stop_reason` and no `terminal_reason`. `terminal_reason` is a categorical label emitted only when the end is not an ordinary exit: `timed_out` when the deadline aborted it, `stopped` when it was explicitly stopped, or `failed` when it errored without producing an exit code; the `stopped` and `failed` cases also carry a human-readable `stop_reason`. A task that finished on its own with a clean exit carries neither `stop_reason` nor `terminal_reason`.\n- When `full_output_available: true` and output_path are returned, use the `Read` tool with that path to page through the full log, whether or not the preview was truncated.\n- When `full_output_available: false`, no persisted full log is available. Use the returned preview; do not invent a recovery path or assume omitted output can be recovered with `Read`.\n- This tool works with the generic background task system and should remain the primary read path for future task types, not just bash.\n";
|
|
258706
258706
|
//#endregion
|
|
258707
|
-
//#region
|
|
258707
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/background/task-output.ts
|
|
258708
258708
|
/**
|
|
258709
258709
|
* TaskOutputTool — read output from a background task.
|
|
258710
258710
|
*
|
|
@@ -258796,10 +258796,10 @@ var TaskOutputTool = class {
|
|
|
258796
258796
|
}
|
|
258797
258797
|
};
|
|
258798
258798
|
//#endregion
|
|
258799
|
-
//#region
|
|
258799
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/background/task-stop.md?raw
|
|
258800
258800
|
var task_stop_default = "Stop a running background task.\n\nOnly use this when a task must genuinely be cancelled — for a task that is\nfinishing normally, wait for its completion notification or inspect it with\n`TaskOutput` instead of stopping it.\n\nGuidelines:\n- This is a general-purpose stop capability for any background task. It is not\n a bash-specific kill.\n- Stopping a task is destructive: it may leave partial side effects behind.\n Use it with care.\n- If the task has already finished, this tool simply returns its current\n status.\n";
|
|
258801
258801
|
//#endregion
|
|
258802
|
-
//#region
|
|
258802
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/background/task-stop.ts
|
|
258803
258803
|
/**
|
|
258804
258804
|
* TaskStopTool — stop a running background task.
|
|
258805
258805
|
*/
|
|
@@ -258851,7 +258851,7 @@ function terminalStopReason(reason) {
|
|
|
258851
258851
|
return trimmed === void 0 || trimmed.length === 0 ? "Task already in terminal state" : trimmed;
|
|
258852
258852
|
}
|
|
258853
258853
|
//#endregion
|
|
258854
|
-
//#region
|
|
258854
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/background/task-update.ts
|
|
258855
258855
|
const TaskUpdateInputSchema = object({
|
|
258856
258856
|
task_id: string().trim().max(128).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*-[0-9a-z]{8}$/),
|
|
258857
258857
|
message: string().trim().min(1)
|
|
@@ -258889,7 +258889,7 @@ var TaskUpdateTool = class {
|
|
|
258889
258889
|
}
|
|
258890
258890
|
};
|
|
258891
258891
|
//#endregion
|
|
258892
|
-
//#region
|
|
258892
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/background/task-resume.ts
|
|
258893
258893
|
const TaskResumeInputSchema = object({
|
|
258894
258894
|
task_id: string().trim().max(128).regex(BACKGROUND_TASK_ID),
|
|
258895
258895
|
prompt: string().trim().min(1).max(32768),
|
|
@@ -258937,10 +258937,10 @@ var TaskResumeTool = class {
|
|
|
258937
258937
|
}
|
|
258938
258938
|
};
|
|
258939
258939
|
//#endregion
|
|
258940
|
-
//#region
|
|
258940
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/cron-delete.md?raw
|
|
258941
258941
|
var cron_delete_default = "Cancel a scheduled cron job by id.\n\nUse this tool to remove a cron task previously scheduled with\n`CronCreate`. The `id` is the 8-hex value returned by `CronCreate`, or\nshown in the `id:` column of `CronList` — quote it verbatim, no\nprefix.\n\nBehaviour by task kind:\n\n- **Recurring task** (`recurring: true`): stops all future fires\n immediately. The scheduler picks up the deletion on its next tick.\n- **One-shot task** (`recurring: false`): cancels the pending fire if\n it has not happened yet. One-shots that have already fired\n auto-delete themselves, so calling `CronDelete` on a fired one-shot\n returns \"no cron job with id ...\".\n\nNot-found is reported as an error (not a silent no-op) so you can\ncorrect yourself — typically by calling `CronList` to see which ids\nare actually live, rather than re-trying with the same stale id.\n\nRefresh pattern (use when you want a stale recurring schedule to\ncontinue):\n\nStale recurring tasks are auto-deleted by the system after their final\nfire — there is nothing for `CronDelete` to remove at that point. To\nkeep the schedule running, just call `CronCreate` with the same `cron`\nand `prompt`. Use `CronList`'s `prompt` field to recall the original\ntext after a context compaction.\n\n`CronDelete` remains the right call when you want to cancel a task\nthat is still live (recurring not yet stale, or a one-shot still\npending).\n\nGuidelines:\n\n- Users have no direct `/cron` command or self-service UI to delete\n tasks themselves; they must ask the model to cancel a reminder.\n When deleting on behalf of a user, confirm the action and report\n the result plainly.\n- Cron deletion is irreversible — there is no undo. If you delete the\n wrong task, you must re-create it with `CronCreate`.\n- If the model is unsure which id is current (e.g. after a context\n compaction), call `CronList` first rather than guessing.\n";
|
|
258942
258942
|
//#endregion
|
|
258943
|
-
//#region
|
|
258943
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/cron-delete.ts
|
|
258944
258944
|
/**
|
|
258945
258945
|
* CronDeleteTool — cancel a scheduled cron job by id.
|
|
258946
258946
|
*
|
|
@@ -259018,10 +259018,10 @@ var CronDeleteTool = class {
|
|
|
259018
259018
|
}
|
|
259019
259019
|
};
|
|
259020
259020
|
//#endregion
|
|
259021
|
-
//#region
|
|
259021
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/cron-list.md?raw
|
|
259022
259022
|
var cron_list_default = "List all cron jobs currently scheduled in this session.\n\nUse this tool to see every pending cron task — both recurring jobs and\none-shot reminders — that you (or the user) have scheduled with\n`CronCreate`. The output is the entry point for inspecting scheduled\nwork: it returns a stable id, the original cron expression, a human\nrendering, the next post-jitter fire time, the recurring flag, the\ntask's age in days, and a stale indicator.\n\nEach record carries:\n\n- `id` — the 8-hex task id. Pass this to `CronDelete` to remove the\n task, or quote it in user-facing messages when asking for\n confirmation.\n- `cron` — the verbatim 5-field cron expression as scheduled.\n- `humanSchedule` — plain-English rendering (e.g. `every 5 minutes`).\n- `prompt` — the scheduled prompt text, JSON-encoded so embedded\n newlines stay on one line. Truncated to 200 UTF-8 bytes with\n `…(truncated)` if longer. Use this to recall what a task is for\n after a context compaction, and as the source for the\n `CronCreate` refresh ritual.\n- `nextFireAt` — local ISO timestamp with an explicit numeric offset\n for the next fire **after jitter has been applied**. The actual fire\n may land slightly before or after a round `:00` / `:30` minute mark\n due to herd-avoidance jitter; this is the value the scheduler will\n compare against, so it reflects what will really happen. `null` if\n the expression has no fire in the next 5 years (should not happen\n for tasks created through `CronCreate`, which validates).\n- `recurring` — `true` for cadenced jobs, `false` for one-shots.\n- `ageDays` — `(now - createdAt) / day`, two decimal places. Useful\n when deciding whether a long-running cron is still relevant.\n- `stale` — `true` when a recurring task is older than 7 days. The\n system **auto-deletes the task after this fire** to bound session\n lifetime; the `stale: true` flag is the model's notice that this is\n the final delivery. To resume the same schedule, call `CronCreate`\n again with the original `cron` and `prompt` (the `prompt` row above\n carries it for exactly this purpose). One-shots are never marked\n stale — they fire at most once by construction.\n\nGuidelines:\n\n- This tool is read-only and never mutates state, so it is always\n safe to call (including in plan mode).\n- Users cannot directly manage cron tasks themselves; if they want to\n cancel or modify a schedule, route the request through the model\n (i.e. call `CronDelete` or `CronCreate` on their behalf).\n- The empty case returns `cron_jobs: 0\\nNo cron jobs scheduled.`. Cron\n tasks survive a `blun resume` of the same session but do not bleed\n into new sessions.\n- After a context compaction, or whenever you are unsure which cron\n jobs are live, call this tool to re-enumerate them rather than\n guessing ids from earlier in the conversation.\n- Records are separated by a line containing just `---`, in the\n insertion order they were scheduled.\n";
|
|
259023
259023
|
//#endregion
|
|
259024
|
-
//#region
|
|
259024
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/cron-list.ts
|
|
259025
259025
|
/**
|
|
259026
259026
|
* CronListTool — enumerate the cron tasks currently scheduled in this
|
|
259027
259027
|
* session.
|
|
@@ -259131,7 +259131,7 @@ var CronListTool = class {
|
|
|
259131
259131
|
}
|
|
259132
259132
|
};
|
|
259133
259133
|
//#endregion
|
|
259134
|
-
//#region
|
|
259134
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/cron/cron-runs.ts
|
|
259135
259135
|
const CronRunListInputSchema = object({
|
|
259136
259136
|
job_id: CronJobIdSchema.optional(),
|
|
259137
259137
|
status: CronRunStatusSchema.optional(),
|
|
@@ -259189,16 +259189,16 @@ var CronRunOutputTool = class {
|
|
|
259189
259189
|
}
|
|
259190
259190
|
};
|
|
259191
259191
|
//#endregion
|
|
259192
|
-
//#region
|
|
259192
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/collaboration/agent-background-disabled.md?raw
|
|
259193
259193
|
var agent_background_disabled_default = "Background agent execution is disabled for this agent. Do not set `run_in_background=true` — any call that sets it is rejected before the subagent launches. Run every subagent in the foreground and wait for its result.";
|
|
259194
259194
|
//#endregion
|
|
259195
|
-
//#region
|
|
259195
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/collaboration/agent-background-enabled.md?raw
|
|
259196
259196
|
var agent_background_enabled_default = "When `run_in_background=true`, the subagent runs detached from this turn. The completion arrives in a later turn as a synthetic user-role message containing its result — you do not need to poll, sleep, or check on its progress. Continue with other work or respond to the user. Never fabricate or predict what the result will say.\n\nDefault to a foreground subagent (omit `run_in_background`) when your next step needs its result — foreground hands the result straight back. Reach for `run_in_background=true` only when you have other work to do while it runs and do not need its result to proceed. Never launch in the background and then immediately wait on it (with `TaskOutput block=true`, sleeping, or otherwise): that just blocks the turn for no benefit — run it in the foreground instead.\n";
|
|
259197
259197
|
//#endregion
|
|
259198
|
-
//#region
|
|
259198
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/collaboration/agent.md?raw
|
|
259199
259199
|
var agent_default = "Launch a subagent to handle a task. The subagent runs as a same-process loop instance with its own context and wire file. Delegating also keeps the bulk of intermediate file contents out of your own context — you get a conclusion back instead of a pile of dumps.\n\nWriting the prompt:\n- The subagent starts with zero context — it has not seen this conversation. Brief it like a colleague who just walked into the room: state the goal, list what you already know, hand over the specifics.\n- Lookups (read this file, run that test): put the exact path or command in the prompt. The subagent should not have to search for things you already know.\n- Investigations (figure out X, find why Y): give the question, not prescribed steps — fixed steps become dead weight when the premise is wrong.\n- Do not delegate understanding. If the task hinges on a file path or line number, find it yourself first and write it into the prompt.\n\nUsage notes:\n- When the task continues earlier work a subagent already did, prefer resuming that agent (pass its `resume` id) over spawning a fresh instance — the resumed agent keeps its prior context.\n- A subagent's result is only visible to you, not to the user. When the user needs to see what a subagent produced, summarize the relevant parts yourself in your own reply.\n- Subagents use a fixed 30-minute timeout. If one times out, resume the same agent instead of starting over.\n\nWhen NOT to use Agent: skip delegation for trivial work you can do directly — reading a file whose path you already know, searching a small known set of files, or any task that takes only a step or two. Delegation has a context-handoff cost; it pays off only when the task is substantial enough to outweigh it.\n\nOnce a subagent is running, leave that scope to it: do not redo its searches or reads in parallel, and do not abandon it midway and finish the job manually. Both undo the context savings the delegation was meant to buy.\n";
|
|
259200
259200
|
//#endregion
|
|
259201
|
-
//#region
|
|
259201
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/collaboration/agent.ts
|
|
259202
259202
|
/**
|
|
259203
259203
|
* AgentTool — collaboration tool for spawning task subagents.
|
|
259204
259204
|
*
|
|
@@ -259415,10 +259415,10 @@ function buildSubagentDescriptions(subagents) {
|
|
|
259415
259415
|
}).join("\n");
|
|
259416
259416
|
}
|
|
259417
259417
|
//#endregion
|
|
259418
|
-
//#region
|
|
259418
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/collaboration/agent-swarm.md?raw
|
|
259419
259419
|
var agent_swarm_default = "Launch multiple subagents from one prompt template, existing agent resumes, or both.\n\nUse AgentSwarm when many subagents should run the same kind of task over different inputs. The placeholder is exactly `{{item}}`. For example, with `prompt_template` set to `Review {{item}} for likely regressions.` and `items` set to `[\"src/a.ts\", \"src/b.ts\"]`, AgentSwarm launches two new subagents with those two concrete prompts. For a few differently-shaped tasks, make separate `Agent` calls in one message instead.\n\nUse `resume_agent_ids` to continue subagents that already exist from earlier work, such as ones that failed or timed out: map each agent id to the prompt for that resumed subagent (usually `continue` if no extra information is needed). You may combine `resume_agent_ids` with `items` in the same call to resume existing subagents and launch new ones. Do not duplicate resumed work in `items`.\n\nEach of these is enforced — a violation is rejected before any subagent starts: provide at least 2 `items` unless you pass `resume_agent_ids`; whenever `items` are present, `prompt_template` is required and must contain `{{item}}`; and the filled-in prompts must be distinct (two items that expand to the same prompt are rejected).\n\nUse enough subagents to keep the work focused and parallel. AgentSwarm supports up to 128 subagents, and launches are queued automatically, so it is safe to split large tasks into many clear, independent items.\n\nIf `AgentSwarm` is called, that call must be the only tool call in the response.\n";
|
|
259420
259420
|
//#endregion
|
|
259421
|
-
//#region
|
|
259421
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/collaboration/agent-swarm.ts
|
|
259422
259422
|
const DEFAULT_SUBAGENT_TYPE = "coder";
|
|
259423
259423
|
const PROMPT_TEMPLATE_PLACEHOLDER = "{{item}}";
|
|
259424
259424
|
const MAX_AGENT_SWARM_SUBAGENTS = 128;
|
|
@@ -259576,10 +259576,10 @@ function escapeXmlAttribute(value) {
|
|
|
259576
259576
|
return value.replaceAll("&", "&").replaceAll("\"", """).replaceAll("<", "<").replaceAll(">", ">");
|
|
259577
259577
|
}
|
|
259578
259578
|
//#endregion
|
|
259579
|
-
//#region
|
|
259579
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/collaboration/ask-user.md?raw
|
|
259580
259580
|
var ask_user_default = "Use this tool when you need to ask the user questions with structured options during execution. This allows you to:\n1. Collect user preferences or requirements before proceeding\n2. Resolve ambiguous or underspecified instructions\n3. Let the user decide between implementation approaches as you work\n4. Present concrete options when multiple valid directions exist\n\n**When NOT to use:**\n- When you can infer the answer from context — be decisive and proceed\n- Trivial decisions that don't materially affect the outcome\n\nOverusing this tool interrupts the user's flow. Only use it when the user's input genuinely changes your next action.\n\n**Usage notes:**\n- Users always have an \"Other\" option for custom input — don't create one yourself\n- Use multi_select to allow multiple answers to be selected for a question\n- Keep option labels concise (1-5 words), use descriptions for trade-offs and details\n- Each question should have 2-4 meaningful, distinct options\n- You can ask 1-4 questions at a time; group related questions to minimize interruptions\n- If you recommend a specific option, list it first and append \"(Recommended)\" to its label\n- The result is JSON with an `answers` object whose keys identify each answered question; if `answers` is empty and a `note` says the user dismissed it, they declined to answer — proceed with your best judgment and do not re-ask the same question\n";
|
|
259581
259581
|
//#endregion
|
|
259582
|
-
//#region
|
|
259582
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/collaboration/ask-user.ts
|
|
259583
259583
|
/**
|
|
259584
259584
|
* AskUserQuestionTool — structured user question tool.
|
|
259585
259585
|
*
|
|
@@ -259738,7 +259738,7 @@ function isQuestionResponse(result) {
|
|
|
259738
259738
|
return typeof answers === "object" && answers !== null && !Array.isArray(answers);
|
|
259739
259739
|
}
|
|
259740
259740
|
//#endregion
|
|
259741
|
-
//#region
|
|
259741
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/collaboration/skill-tool.md?raw
|
|
259742
259742
|
var skill_tool_default = "Invoke a registered skill from the current skill listing. BLOCKING REQUIREMENT: when a skill from the listing matches the user's request, you MUST call this tool (not free-form text). Do not re-invoke a skill to repeat work already done: if a `<blun-skill-loaded>` block for it with the same `args` is already present in the conversation, follow those instructions directly instead of calling the tool again. Do call the tool again when you need the skill with different arguments — the loaded block was expanded with the earlier `args` and will not reflect new inputs.\n\nFor a deferred catalog, call `Skill({skill: \"task keywords\", search: true})` first. Search returns at most 10 eligible names and descriptions without loading skill instructions. An empty search browses the catalog; pass `nextOffset` as `offset` for the next page. Then invoke the chosen exact name with `search` omitted.\n\nAUTO-SKILL-ROUTING — you MUST proactively use skills WITHOUT being asked:\n- Before responding to any user request, check if an available skill matches the task. If it does, call this tool FIRST — do not attempt the task without the skill.\n- Images/screenshots → use the image/vision skill (e.g. \"screenshot-lesen\") to read and understand the image content before responding.\n- Design/UI tasks → use the appropriate design skill (e.g. \"design-taste-frontend\", \"high-end-visual-design\", \"apple-design\", \"huashu-design\", \"emil-design-eng\", \"motion-design-taste\", \"stitch-design-taste\", \"minimalist-ui\", \"industrial-brutalist-ui\", \"redesign-existing-projects\").\n- FOR ANY UI/frontend/visual output you MUST first load a design skill — never produce raw/default-styled UI. Gradients-everywhere, random emoji-icons, generic AI-looking layouts = FORBIDDEN slop. Always use a design skill before writing UI code.\n- Video/media tasks → use \"ffmpeg\" or the relevant media skill.\n- Web scraping/reading → use \"web-lesen\".\n- PDF/document tasks → use the PDF or document skill.\n- When in doubt whether a skill applies, call it — using a skill when not needed is harmless; NOT using a skill when it would help is a failure.\n- Never tell the user \"I don't have the right tool\" if a matching skill exists in the listing — use it.\n- This is automatic: do not ask the user \"should I use a skill?\" — just use it.\n";
|
|
259743
259743
|
var NestedSkillTooDeepError = class extends Error {
|
|
259744
259744
|
skillName;
|
|
@@ -259839,7 +259839,7 @@ function skillOrigin(skill, skillArgs, currentDepth) {
|
|
|
259839
259839
|
};
|
|
259840
259840
|
}
|
|
259841
259841
|
//#endregion
|
|
259842
|
-
//#region
|
|
259842
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/file/line-endings.ts
|
|
259843
259843
|
function detectLineEndingStyle(text) {
|
|
259844
259844
|
let hasCrLf = false;
|
|
259845
259845
|
let hasLf = false;
|
|
@@ -259984,10 +259984,10 @@ function hasExplicitSingleFileRequest(history) {
|
|
|
259984
259984
|
return false;
|
|
259985
259985
|
}
|
|
259986
259986
|
//#endregion
|
|
259987
|
-
//#region
|
|
259987
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/file/edit.md?raw
|
|
259988
259988
|
var edit_default = "Perform exact replacements in existing files.\n\n- Edit is mandatory for every incremental change, especially small edits. DO NOT use Write or Bash `sed`.\n- Read the target file before every Edit. DO NOT call Edit from memory, stale context, or a guessed `old_string`.\n- Take `old_string` and `new_string` from the Read output view.\n- Drop the line-number prefix and tab; match only file content.\n- `old_string` must be unique unless `replace_all` is set.\n- If `old_string` is ambiguous, add surrounding context. Use `replace_all` only when every occurrence should change — for example, renaming a symbol throughout the file.\n- Multiple Edit calls may run in one response only when they do not target the same file.\n- DO NOT issue consecutive Edit calls on the same file. A previous Edit can invalidate a later Edit's `old_string`, causing `old_string not found`. Read the file again before the next Edit.\n- A write lock serializes same-file edits in response order, but serialization does not make stale `old_string` valid.\n- For pure CRLF files, Read shows LF; use LF in `old_string` and `new_string`, and Edit writes CRLF back.\n- For mixed endings or lone carriage returns, Read shows carriage returns as \\r; include actual \\r escapes in those positions.\n- Source files may contain at most 500 lines. An already oversized source may only be edited when the result has fewer lines.\n- Set `single_file_override=true` only when the latest direct user message explicitly requires one single file. The accepted override is reported visibly.\n";
|
|
259989
259989
|
//#endregion
|
|
259990
|
-
//#region
|
|
259990
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/file/lsp-diagnostics.ts
|
|
259991
259991
|
async function appendLspDiagnostics(result, path, lsp) {
|
|
259992
259992
|
if (lsp === void 0 || result.isError === true || typeof result.output !== "string") return result;
|
|
259993
259993
|
try {
|
|
@@ -260006,7 +260006,7 @@ async function appendLspDiagnostics(result, path, lsp) {
|
|
|
260006
260006
|
}
|
|
260007
260007
|
}
|
|
260008
260008
|
//#endregion
|
|
260009
|
-
//#region
|
|
260009
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/file/edit.ts
|
|
260010
260010
|
const EditInputSchema = object({
|
|
260011
260011
|
path: string().describe("Path to the text file to edit. Relative paths resolve against the working directory; a path outside the working directory must be absolute."),
|
|
260012
260012
|
old_string: string().min(1).describe("Exact content to replace from the Read output view, without the line-number prefix. Use LF for pure CRLF files; use actual \\r escapes where Read shows \\r."),
|
|
@@ -263733,7 +263733,7 @@ var require_buffer_crc32 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
263733
263733
|
module.exports = crc32;
|
|
263734
263734
|
}));
|
|
263735
263735
|
//#endregion
|
|
263736
|
-
//#region
|
|
263736
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/support/rg-locator.ts
|
|
263737
263737
|
/**
|
|
263738
263738
|
* rg-locator — hybrid ripgrep binary resolution.
|
|
263739
263739
|
*
|
|
@@ -264575,12 +264575,12 @@ function rgUnavailableMessage(cause) {
|
|
|
264575
264575
|
Error: ${cause instanceof Error ? cause.message : typeof cause === "string" ? cause : "unknown error"}\n\nFix options:\n macOS: brew install ripgrep\n Ubuntu: sudo apt-get install ripgrep\n Other: https://github.com/BurntSushi/ripgrep#installation\n\nAlternatively, drop a static rg binary at ${join$1(getShareDir(), "bin", rgBinaryName())}`;
|
|
264576
264576
|
}
|
|
264577
264577
|
//#endregion
|
|
264578
|
-
//#region
|
|
264578
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/support/stream.ts
|
|
264579
264579
|
function isPrematureCloseError(error) {
|
|
264580
264580
|
return error instanceof Error && error.code === "ERR_STREAM_PREMATURE_CLOSE";
|
|
264581
264581
|
}
|
|
264582
264582
|
//#endregion
|
|
264583
|
-
//#region
|
|
264583
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/support/run-rg.ts
|
|
264584
264584
|
const DEFAULT_TIMEOUT_MS = 2e4;
|
|
264585
264585
|
const MAX_OUTPUT_BYTES = 10 * 1024 * 1024;
|
|
264586
264586
|
const VCS_DIRECTORIES_TO_EXCLUDE = [
|
|
@@ -264745,10 +264745,10 @@ async function readStreamWithCap(stream, maxBytes, suppressPrematureClose) {
|
|
|
264745
264745
|
};
|
|
264746
264746
|
}
|
|
264747
264747
|
//#endregion
|
|
264748
|
-
//#region
|
|
264748
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/file/glob.md?raw
|
|
264749
264749
|
var glob_default = "Find files by glob pattern, sorted by modification time (most recent first).\n\nPowered by ripgrep. Respects `.gitignore`, `.ignore`, and `.rgignore` by default — set `include_ignored` to also match ignored files (e.g. build outputs, `node_modules`). Sensitive files (such as `.env`) are always filtered out. Matches are files only — directories themselves are never listed; to find a directory, glob for a file inside it (e.g. `**/fixtures/**`).\n\nGood patterns:\n- `*.ts` — all files matching an extension, at any depth below the search root (a bare pattern without `/` matches recursively)\n- `src/*.ts` — files directly inside `src/` (one level, not recursive)\n- `src/**/*.ts` — recursive walk with a subdirectory anchor and extension\n- `**/*.py` — recursive walk from the search root for an extension\n- `*.{ts,tsx}` — brace expansion is supported\n- `{src,test}/**/*.ts` — cartesian brace expansion is supported too\n\nResults are capped at the first 100 matching paths. If a search would return more, a truncation marker is appended. Refine the pattern (extension, subdirectory) when 100 is not enough, or call again with a narrower anchor.\n\nLarge-directory caveat — avoid recursing into dependency / build output even with an anchor, especially when `include_ignored` is set:\n- `node_modules/**/*.js`, `.venv/**/*.py`, `__pycache__/**`, `target/**` can produce thousands of results that truncate at the match cap and waste context. Prefer specific subpaths like `node_modules/react/src/**/*.js`.\n";
|
|
264750
264750
|
//#endregion
|
|
264751
|
-
//#region
|
|
264751
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/file/glob.ts
|
|
264752
264752
|
const GlobInputSchema = object({
|
|
264753
264753
|
pattern: string().describe("Glob pattern to match files."),
|
|
264754
264754
|
path: string().optional().describe("Directory to search. Accepts an absolute path, or a path relative to the current working directory. Defaults to the current working directory."),
|
|
@@ -264959,7 +264959,7 @@ function relativizeIfUnder$1(candidate, base, pathClass) {
|
|
|
264959
264959
|
return normCandidate;
|
|
264960
264960
|
}
|
|
264961
264961
|
//#endregion
|
|
264962
|
-
//#region
|
|
264962
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/support/result-builder.ts
|
|
264963
264963
|
const DEFAULT_MAX_CHARS = 5e4;
|
|
264964
264964
|
const DEFAULT_MAX_LINE_LENGTH = 2e3;
|
|
264965
264965
|
const TRUNCATION_MARKER = "[...truncated]";
|
|
@@ -265043,10 +265043,10 @@ var ToolResultBuilder = class {
|
|
|
265043
265043
|
}
|
|
265044
265044
|
};
|
|
265045
265045
|
//#endregion
|
|
265046
|
-
//#region
|
|
265046
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/file/grep.md?raw
|
|
265047
265047
|
var grep_default = "Search file contents using regular expressions (powered by ripgrep).\n\nUse Grep when the task is to find unknown content or unknown file locations. Do not use shell `grep` or `rg` directly; this tool applies workspace path policy, output limits, and sensitive-file filtering.\nALWAYS use Grep tool instead of running `grep` or `rg` from a shell — direct shell calls bypass workspace policy, output limits, and sensitive-file filtering.\nIf you already know a concrete file path and need to inspect its contents, use Read directly instead.\n\nWrite patterns in ripgrep regex syntax, which differs from POSIX `grep` syntax. For example, braces are special, so escape them as `\\{` to match a literal `{`.\n\nHidden files (dotfiles such as `.gitlab-ci.yml` or `.eslintrc.json`) are searched by default. To also search files excluded by `.gitignore` (such as `node_modules` or build outputs), set `include_ignored` to `true`. Sensitive files (such as `.env`) are always skipped for safety, even when `include_ignored` is `true`.\n";
|
|
265048
265048
|
//#endregion
|
|
265049
|
-
//#region
|
|
265049
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/file/grep.ts
|
|
265050
265050
|
const GrepInputSchema = object({
|
|
265051
265051
|
pattern: string().describe("Regular expression to search for."),
|
|
265052
265052
|
path: string().optional().describe("File or directory to search. Accepts an absolute path, or a path relative to the current working directory. Omit to search the current working directory. Use Read instead when you already know a concrete file path and need its contents."),
|
|
@@ -265502,10 +265502,10 @@ function countPayloadFromLegacyLine(line) {
|
|
|
265502
265502
|
return idx > 0 ? line.slice(idx + 1) : void 0;
|
|
265503
265503
|
}
|
|
265504
265504
|
//#endregion
|
|
265505
|
-
//#region
|
|
265505
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/file/read.md?raw
|
|
265506
265506
|
var read_default = "Read a text file from the local filesystem.\n\nIf the user provides a concrete file path to a text file, call Read directly. Do not `Glob`, `ls`, or otherwise pre-check known text file paths; missing or invalid file paths return errors you can handle. Do not use Read for directories; use `ls` via Bash for a known directory, or Glob when you need files matching a name pattern (Glob lists files only, never directories). Use `Grep` only when the task is to search for unknown content or locations.\n\nWhen you need several files, prefer to read them in parallel: emit multiple `Read` calls in a single response instead of reading one file per turn.\n\n- Relative paths resolve against the working directory; a path outside the working directory must be absolute.\n- Returns up to {{ MAX_LINES }} lines or {{ MAX_BYTES_KB }} KB per call, whichever comes first; lines longer than {{ MAX_LINE_LENGTH }} chars are truncated mid-line.\n- Page larger files with `line_offset` (1-based start line) and `n_lines`. Omit `n_lines` to read up to the {{ MAX_LINES }}-line cap.\n- Sensitive files (`.env` files, credential stores, SSH private keys, and similar secrets) are refused to protect secrets; do not attempt to read them. Templates and public keys are exempt: `.env.example` / `.env.sample` / `.env.template` and public SSH keys such as `id_rsa.pub` read normally.\n- Only UTF-8 text files can be read. Non-UTF-8 encodings, binary files, and files containing NUL bytes are refused; use `ReadMediaFile` for images or video, and Bash or an MCP tool for other binary formats.\n- Negative line_offset reads from the end of the file (for example, -100 reads the last 100 lines); the absolute value cannot exceed {{ MAX_LINES }}.\n- Output format: `<line-number>\\t<content>` per line.\n- A `<system>...</system>` status block is appended after the file content; it summarizes how much was read (line and byte counts, truncation, line-ending notes) and is not part of the file itself.\n- Pure CRLF files are displayed with LF line endings; `Edit` matches this output and preserves CRLF when writing back.\n- Mixed or lone carriage-return line endings are shown as `\\r` and require exact `Edit.old_string` escapes.\n- After a successful `Edit`/`Write`, do not re-read solely to prove the write landed. When the task depends on an exact file, API, or output shape, inspect the final external contract before finishing.\n";
|
|
265507
265507
|
//#endregion
|
|
265508
|
-
//#region
|
|
265508
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/file/read.ts
|
|
265509
265509
|
const MAX_LINES = 1e3;
|
|
265510
265510
|
const MAX_LINE_LENGTH = 2e3;
|
|
265511
265511
|
const MAX_BYTES = 100 * 1024;
|
|
@@ -265931,10 +265931,10 @@ var ReadBatchTool = class {
|
|
|
265931
265931
|
}
|
|
265932
265932
|
};
|
|
265933
265933
|
//#endregion
|
|
265934
|
-
//#region
|
|
265934
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/file/read-media.md?raw
|
|
265935
265935
|
var read_media_default = "Read media content from a file.\n\n**Tips:**\n- Make sure you follow the description of each tool parameter.\n- A `<system>` tag is given before the file content; it summarizes the mime type, byte size and, for images, the original pixel dimensions, and states how the image was delivered (untouched, downsampled, cropped, or native resolution). When outputting coordinates, give relative coordinates first and compute absolute coordinates from the original image size. After generating or editing media via commands or scripts, read the result back before continuing.\n- Large images are downsampled by default to fit model limits, which can blur fine detail (small text, dense UI). Compute absolute coordinates from the original dimensions reported in the `<system>` block, never by measuring the displayed copy. When the `<system>` tag reports downsampling and you need that detail, call this tool again with the `region` parameter (original-image pixel coordinates) to view a crop at full fidelity, or set `full_resolution` to true when the whole file fits the per-image byte limit. Re-reading the same file without these parameters just reproduces the same downsampled image.\n- The system will notify you when there is anything wrong when reading the file.\n- This tool is a tool that you typically want to use in parallel. Always read multiple files in one response when possible.\n- This tool can only read image or video files. To read text files, use the Read tool. To list directories, use `ls` via Bash for a known directory, or Glob for pattern search.\n- If the file doesn't exist or path is invalid, an error will be returned.\n- The maximum size that can be read is {{ MAX_MEDIA_MEGABYTES }}MB. An error will be returned if the file is larger than this limit.\n- The media content will be returned in a form that you can directly view and understand.\n\n**Capabilities**";
|
|
265936
265936
|
//#endregion
|
|
265937
|
-
//#region
|
|
265937
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/file/read-media.ts
|
|
265938
265938
|
const MAX_MEDIA_MEGABYTES = 100;
|
|
265939
265939
|
const MAX_MEDIA_BYTES = MAX_MEDIA_MEGABYTES * 1024 * 1024;
|
|
265940
265940
|
const ReadMediaFileInputSchema = object({
|
|
@@ -266170,7 +266170,7 @@ var ReadMediaFileTool = class {
|
|
|
266170
266170
|
}
|
|
266171
266171
|
};
|
|
266172
266172
|
//#endregion
|
|
266173
|
-
//#region
|
|
266173
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/file/write.md?raw
|
|
266174
266174
|
var write_default = "Create, append to, or replace a file entirely.\n\n- Missing parent directories are created automatically (like `mkdir(parents=True, exist_ok=True)`).\n- Mode defaults to overwrite; append adds content at EOF without adding a newline.\n- Write is NOT ALLOWED for incremental changes to existing files, including trivial, one-line, quick, or cosmetic edits. Use Edit instead.\n- Use Write only when the file does not exist, you intend a complete replacement, or the new contents have little continuity with the old contents.\n- Do not create unsolicited documentation files (`*.md` write-ups, `README`s, summaries) just because a task finished — write one only when the user asks for it, or when a task or project instruction requires it (e.g. the plan-mode plan file, created with Write when plan mode directs you to, or a changeset the repo mandates).\n- Read before overwriting an existing file.\n- Write ignores the Read/Edit line-number view. NEVER include line prefixes.\n- Write outputs content literally, including supplied line endings: \\n stays LF, \\r\\n stays CRLF.\n- Source files may contain at most 500 lines. Split larger implementations into focused files; append cannot bypass the limit.\n- Set `single_file_override=true` only when the latest direct user message explicitly requires one single file. The accepted override is reported visibly.\n- For any new or completely replaced file with content too large for one call, use `continuation`. Keep every chunk at or below 2,048 UTF-8 bytes and end every chunk on a complete line with `\\n`. Set the exact final `expected_lines`; include `expected_sha256` when a source hash is available. Use overwrite for the first chunk, then append for every later chunk, with consecutive part numbers. The target file remains unchanged until the final line-count and optional SHA-256 checks pass.\n- Never use continuation to modify an existing file incrementally. Use Edit for incremental changes.\n- To abandon an unfinished continuation, call Write for the same path with `mode=\"discard_continuation\"`, `content=\"\"`, and no `continuation`. This discards only that path's staged chunks, never the target file. Then start again with `part=1`, `mode=\"overwrite\"`, and the corrected total line count and optional hash. Do not send old continuation parts after discarding. Discarding a path with no staged draft is a no-op.\n- Runaway generated JavaScript/TypeScript identifiers are rejected before disk I/O. Regenerate only the affected section as a smaller focused chunk.\n";
|
|
266175
266175
|
const JAVASCRIPT_LIKE_EXTENSIONS = new Set([
|
|
266176
266176
|
".cjs",
|
|
@@ -266276,7 +266276,7 @@ function isIdentifierPart(value) {
|
|
|
266276
266276
|
return /[A-Za-z0-9_$]/.test(value);
|
|
266277
266277
|
}
|
|
266278
266278
|
//#endregion
|
|
266279
|
-
//#region
|
|
266279
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/file/write.ts
|
|
266280
266280
|
/** Mask isolating the file-type bits of a stat mode. */
|
|
266281
266281
|
const S_IFMT = 61440;
|
|
266282
266282
|
/** File-type bits of a directory. */
|
|
@@ -266549,10 +266549,10 @@ function countCompletedLines(content) {
|
|
|
266549
266549
|
return count;
|
|
266550
266550
|
}
|
|
266551
266551
|
//#endregion
|
|
266552
|
-
//#region
|
|
266552
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/goal/create-goal.md?raw
|
|
266553
266553
|
var create_goal_default = "Create a durable, structured goal that the runtime will pursue across multiple turns.\n\nCall `CreateGoal` only when:\n\n- the user explicitly asks you to start a goal or work autonomously toward an outcome, or\n- a host goal-intake prompt asks you to create one.\n\nDo NOT create a goal for greetings, ordinary questions, or vague requests that lack a\nverifiable completion condition. A goal needs a checkable end state.\n\nWhen the request is vague, ask the user for the missing completion criterion before creating\nthe goal. If the user clearly insists after you warn them that the wording is vague or risky,\nrespect that and create the goal.\n\nInclude a `completionCriterion` when the user provides one, or when it can be stated without\ninventing new requirements. Keep `objective` concise; reference long task descriptions by file\npath rather than pasting them.\n\nCreating a goal fails if one already exists, so use `replace: true` only when the user explicitly\nwants to abandon the current goal and start a new one.\n";
|
|
266554
266554
|
//#endregion
|
|
266555
|
-
//#region
|
|
266555
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/goal/serialize.ts
|
|
266556
266556
|
/**
|
|
266557
266557
|
* The goalId is a random UUID with no user-facing meaning, and no goal tool
|
|
266558
266558
|
* takes one (there is only ever one goal at a time). Keep it out of what the
|
|
@@ -266566,7 +266566,7 @@ function goalResultForModel(result) {
|
|
|
266566
266566
|
return { goal: result.goal === null ? null : goalForModel(result.goal) };
|
|
266567
266567
|
}
|
|
266568
266568
|
//#endregion
|
|
266569
|
-
//#region
|
|
266569
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/goal/create-goal.ts
|
|
266570
266570
|
const CreateGoalToolInputSchema = object({
|
|
266571
266571
|
objective: string().min(1).describe("The objective to pursue. Must have a verifiable end state."),
|
|
266572
266572
|
completionCriterion: string().optional().describe("How to verify the goal is complete. Include when the user provides one."),
|
|
@@ -266616,10 +266616,10 @@ var CreateGoalTool = class {
|
|
|
266616
266616
|
}
|
|
266617
266617
|
};
|
|
266618
266618
|
//#endregion
|
|
266619
|
-
//#region
|
|
266619
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/goal/get-goal.md?raw
|
|
266620
266620
|
var get_goal_default = "Read the current goal: its objective, completion criterion, status, and budgets (turns, tokens,\ntime, and how much of each remains). When the goal has stopped, it also reports the terminal reason.\n\nUse `GetGoal` before deciding whether to continue working, report completion, report a blocker,\nor respect a pause. It returns `{ \"goal\": null }` when there is no current goal.\n";
|
|
266621
266621
|
//#endregion
|
|
266622
|
-
//#region
|
|
266622
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/goal/get-goal.ts
|
|
266623
266623
|
const GetGoalToolInputSchema = object({}).strict();
|
|
266624
266624
|
var GetGoalTool = class {
|
|
266625
266625
|
agent;
|
|
@@ -266642,10 +266642,10 @@ var GetGoalTool = class {
|
|
|
266642
266642
|
}
|
|
266643
266643
|
};
|
|
266644
266644
|
//#endregion
|
|
266645
|
-
//#region
|
|
266645
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/goal/set-goal-budget.md?raw
|
|
266646
266646
|
var set_goal_budget_default = "Set a hard budget limit for the current goal.\n\nUse this only when the user clearly gives a runtime limit, such as:\n\n- \"stop after 20 turns\"\n- \"use no more than 500k tokens\"\n- \"finish within 30 minutes\"\n\nDo not invent limits. Do not call this for vague wording such as \"spend some time\" or\n\"try to be quick\".\n\nIf the user gives a compound time, convert it to one supported unit before calling this tool.\nFor example, \"2 hours and 3 minutes\" can be set as `value: 123, unit: \"minutes\"`.\n\nA time budget must be between 1 second and 24 hours — the tool rejects anything shorter or\nlonger, telling the user it is not a reasonable goal budget. Turn and token budgets are not\nbounded this way; they must be positive and are rounded to the nearest whole number (minimum 1).\n\nSupported units:\n\n- `turns`\n- `tokens`\n- `milliseconds`\n- `seconds`\n- `minutes`\n- `hours`\n";
|
|
266647
266647
|
//#endregion
|
|
266648
|
-
//#region
|
|
266648
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/goal/set-goal-budget.ts
|
|
266649
266649
|
const MIN_REASONABLE_TIME_BUDGET_MS = 1e3;
|
|
266650
266650
|
const MAX_REASONABLE_TIME_BUDGET_MS = 1440 * 60 * 1e3;
|
|
266651
266651
|
const SetGoalBudgetToolInputSchema = object({
|
|
@@ -266722,7 +266722,7 @@ function formatBudget(value, unit) {
|
|
|
266722
266722
|
return `${String(value)} ${value === 1 ? singular : unit}`;
|
|
266723
266723
|
}
|
|
266724
266724
|
//#endregion
|
|
266725
|
-
//#region
|
|
266725
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/turn/tool-dedup.ts
|
|
266726
266726
|
const REMINDER_TEXT_1 = "\n\n<system-reminder>\nYou are repeating the exact same tool call with identical parameters. Please carefully analyze the previous result. If the task is not yet complete, try a different method or parameters instead of repeating the same call.\n</system-reminder>";
|
|
266727
266727
|
function makeReminderText2(toolName, repeatCount, args) {
|
|
266728
266728
|
const argsStr = canonicalTelemetryArgs(args);
|
|
@@ -266930,7 +266930,7 @@ var ToolCallDeduplicator = class {
|
|
|
266930
266930
|
}
|
|
266931
266931
|
};
|
|
266932
266932
|
//#endregion
|
|
266933
|
-
//#region
|
|
266933
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/turn/tool-result-budget.ts
|
|
266934
266934
|
const TOOL_RESULT_MAX_CHARS = 5e4;
|
|
266935
266935
|
const TOOL_RESULT_PREVIEW_CHARS = 2e3;
|
|
266936
266936
|
function toolResultMaxChars(maxContextTokens) {
|
|
@@ -267022,7 +267022,7 @@ function safeToolResultFileStem(toolName, toolCallId) {
|
|
|
267022
267022
|
return `${toolName}-${toolCallId}`.replace(/[^a-zA-Z0-9._-]+/g, "_").replace(/^_+|_+$/g, "").slice(0, 80) || "tool-result";
|
|
267023
267023
|
}
|
|
267024
267024
|
//#endregion
|
|
267025
|
-
//#region
|
|
267025
|
+
//#region ../../../../hm623s/r/packages/kaos/src/errors.ts
|
|
267026
267026
|
/**
|
|
267027
267027
|
* Base error class for the kaos package.
|
|
267028
267028
|
*/
|
|
@@ -267053,7 +267053,7 @@ var KaosShellNotFoundError = class extends KaosError {
|
|
|
267053
267053
|
}
|
|
267054
267054
|
};
|
|
267055
267055
|
//#endregion
|
|
267056
|
-
//#region
|
|
267056
|
+
//#region ../../../../hm623s/r/packages/kaos/src/environment.ts
|
|
267057
267057
|
/**
|
|
267058
267058
|
* Environment — cross-platform probe of OS / shell.
|
|
267059
267059
|
*
|
|
@@ -267261,7 +267261,7 @@ async function execFileText(file, args, timeoutMs) {
|
|
|
267261
267261
|
});
|
|
267262
267262
|
}
|
|
267263
267263
|
//#endregion
|
|
267264
|
-
//#region
|
|
267264
|
+
//#region ../../../../hm623s/r/packages/kaos/src/internal.ts
|
|
267265
267265
|
function isUtf8Continuation(byte) {
|
|
267266
267266
|
return byte >= 128 && byte <= 191;
|
|
267267
267267
|
}
|
|
@@ -267470,7 +267470,7 @@ var BufferedReadable = class extends Readable {
|
|
|
267470
267470
|
};
|
|
267471
267471
|
};
|
|
267472
267472
|
//#endregion
|
|
267473
|
-
//#region
|
|
267473
|
+
//#region ../../../../hm623s/r/packages/kaos/src/login-shell-path.ts
|
|
267474
267474
|
/**
|
|
267475
267475
|
* Login-shell PATH probe — enrich `process.env.PATH` with entries from the
|
|
267476
267476
|
* user's login shell.
|
|
@@ -267582,7 +267582,7 @@ function applyLoginShellPathFromNode() {
|
|
|
267582
267582
|
return appliedLoginShellPath;
|
|
267583
267583
|
}
|
|
267584
267584
|
//#endregion
|
|
267585
|
-
//#region
|
|
267585
|
+
//#region ../../../../hm623s/r/packages/kaos/src/local.ts
|
|
267586
267586
|
const isWindows$1 = process.platform === "win32";
|
|
267587
267587
|
const READ_CHUNK_SIZE = 64 * 1024;
|
|
267588
267588
|
/**
|
|
@@ -268158,7 +268158,7 @@ function waitForSpawn(child) {
|
|
|
268158
268158
|
}
|
|
268159
268159
|
new AsyncLocalStorage();
|
|
268160
268160
|
//#endregion
|
|
268161
|
-
//#region
|
|
268161
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/utils/private-recovery-batch.ts
|
|
268162
268162
|
const identity$1 = (stat) => `${stat.dev}:${stat.ino}:${stat.birthtimeNs}`;
|
|
268163
268163
|
const revision$1 = (stat) => `${identity$1(stat)}:${stat.size}:${stat.mtimeNs}:${stat.ctimeNs}:${stat.mode}`;
|
|
268164
268164
|
const canonical$1 = (path) => resolve(path).toLowerCase();
|
|
@@ -268268,7 +268268,7 @@ async function writePrivateRecoveryBatch(directory, entries, acl, signal) {
|
|
|
268268
268268
|
}
|
|
268269
268269
|
}
|
|
268270
268270
|
//#endregion
|
|
268271
|
-
//#region
|
|
268271
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/turn/historical-tool-projection.ts
|
|
268272
268272
|
const MIN_CHARS = 3e3;
|
|
268273
268273
|
const MAX_REFERENCE_CHARS = 2500;
|
|
268274
268274
|
const RECOVERY_REFERENCE = /\[Tool result offloaded\]|\[Repeated tool result omitted\]|^output_path\s*:|Tool output exceeded \d+ characters/m;
|
|
@@ -268572,7 +268572,7 @@ var HistoricalToolProjection = class {
|
|
|
268572
268572
|
}
|
|
268573
268573
|
};
|
|
268574
268574
|
//#endregion
|
|
268575
|
-
//#region
|
|
268575
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/turn/baseline-skill-projection.ts
|
|
268576
268576
|
const BASELINE_ORIGIN = "baseline_skill:blun-design-dna";
|
|
268577
268577
|
const NONVISUAL_TASK = /\b(?:backend|back-end|serverseitig|server-side|datenbank|database|sql|api[- ](?:endpoint|route)|memory broker)\b/i;
|
|
268578
268578
|
const VISUAL_TASK = /\b(?:ui|ux|frontend|front-end|website|webseite|web|page|screen|screenshot|bild|image|design|layout|css|html|react|vue|svelte|komponente|component|button|formular|form|style|visual|visuell|interaction|interaktion|interface|oberfl[aä]che|dashboard|landing|mobile|responsive|accessibility|barrierefreiheit|tui|terminal|konsole|console|browser|diagram|chart|graph)\b/i;
|
|
@@ -268614,7 +268614,7 @@ function projectBaselineSkillForTurn(history, input, origin, turnAnchor) {
|
|
|
268614
268614
|
} : message);
|
|
268615
268615
|
}
|
|
268616
268616
|
//#endregion
|
|
268617
|
-
//#region
|
|
268617
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/response-review-decision.ts
|
|
268618
268618
|
const STAGES = [
|
|
268619
268619
|
"setup",
|
|
268620
268620
|
"native",
|
|
@@ -268665,7 +268665,7 @@ function rejectionMessage(value) {
|
|
|
268665
268665
|
return `Response review rejected candidate: ${value.stage}/${value.reason}` + (findings?.length ? ` (${findings.join(", ")})` : "");
|
|
268666
268666
|
}
|
|
268667
268667
|
//#endregion
|
|
268668
|
-
//#region
|
|
268668
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/response-review-deadline.ts
|
|
268669
268669
|
const IDLE_TIMEOUT_MS = 3e4;
|
|
268670
268670
|
const NATIVE_FIRST_CONTENT_MS = 9e4;
|
|
268671
268671
|
const ABSOLUTE_TIMEOUT_MS = 12e4;
|
|
@@ -268726,7 +268726,7 @@ function createResponseReviewDeadline(source) {
|
|
|
268726
268726
|
};
|
|
268727
268727
|
}
|
|
268728
268728
|
//#endregion
|
|
268729
|
-
//#region
|
|
268729
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/response-review.ts
|
|
268730
268730
|
const MAX_CANDIDATE_BYTES = 1048576;
|
|
268731
268731
|
const MAX_CANDIDATE_PARTS = 4096;
|
|
268732
268732
|
const REVIEW_CANCEL_SETTLE_MS = 1e3;
|
|
@@ -268921,7 +268921,7 @@ function createReviewedOutputDispatcher(options) {
|
|
|
268921
268921
|
return dispatch;
|
|
268922
268922
|
}
|
|
268923
268923
|
//#endregion
|
|
268924
|
-
//#region
|
|
268924
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/turn/index.ts
|
|
268925
268925
|
function restoreRecentMcpToolNames(history, loadedNames) {
|
|
268926
268926
|
const successfulResults = /* @__PURE__ */ new Set();
|
|
268927
268927
|
const recentNames = [];
|
|
@@ -270459,7 +270459,7 @@ function abandonedToolResultOutput(ended) {
|
|
|
270459
270459
|
return `Tool call did not complete: ${ended.reason === "cancelled" ? "the turn was cancelled" : ended.reason === "failed" ? `the turn failed${ended.error !== void 0 ? ` (${ended.error.message})` : ""}` : "the turn ended"} before its result was recorded. Do not assume the tool completed successfully.`;
|
|
270460
270460
|
}
|
|
270461
270461
|
//#endregion
|
|
270462
|
-
//#region
|
|
270462
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/goal/outcome-prompts.ts
|
|
270463
270463
|
function buildGoalCompletionSummaryPrompt(goal) {
|
|
270464
270464
|
return [
|
|
270465
270465
|
buildGoalCompletionPromptMessage(goal),
|
|
@@ -270495,10 +270495,10 @@ function formatTokens(tokens) {
|
|
|
270495
270495
|
return `${(tokens / 1e6).toFixed(1)}M`;
|
|
270496
270496
|
}
|
|
270497
270497
|
//#endregion
|
|
270498
|
-
//#region
|
|
270498
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/goal/update-goal.md?raw
|
|
270499
270499
|
var update_goal_default = "Set the status of the current goal. This is how you resume, end, or yield an autonomous goal.\n\n- `active` — resume a paused or blocked goal when the user explicitly asks you to work on that goal.\n- `complete` — the objective is fully satisfied, all files are written, all tests pass, and any stated validation has passed. The goal ends and a completion summary is recorded.\n- `blocked` — an external condition or required user input prevents progress, or the objective cannot be completed as stated. The goal stops but can be resumed later. Do not use `blocked` merely because the work is hard, slow, uncertain, or incomplete — reserve it for a genuine impasse.\n- `paused` — set the goal aside for now (e.g. to hand control back to the user). It can be resumed later.\n\nIf the goal is active and you do not call this, the goal keeps running: after your turn ends you will be prompted to continue.\n\nCRITICAL — when to call `complete`:\n- Call `complete` ONLY when all required work is actually finished — files written, code executed, tests passing, validation done.\n- Do NOT call `complete` after announcing or planning the next step — if you said \"now I will create the source files\" but haven't created them yet, the goal is NOT complete.\n- Do NOT call `complete` after only producing a plan, summary, first pass, or partial result.\n- If there is more work to do, leave the goal `active` and keep working — the system will automatically prompt you to continue.\n- When in doubt, keep the goal `active` and do the next step instead of calling `complete`.\n\nIf you call `blocked`, you will be prompted to explain the blocker in your next message. Setting the status is the machine-readable signal; the completion summary or blocker explanation is yours to write in the following message.\n";
|
|
270500
270500
|
//#endregion
|
|
270501
|
-
//#region
|
|
270501
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/goal/update-goal.ts
|
|
270502
270502
|
const UpdateGoalToolInputSchema = object({ status: _enum([
|
|
270503
270503
|
"active",
|
|
270504
270504
|
"complete",
|
|
@@ -270572,10 +270572,10 @@ var UpdateGoalTool = class {
|
|
|
270572
270572
|
}
|
|
270573
270573
|
};
|
|
270574
270574
|
//#endregion
|
|
270575
|
-
//#region
|
|
270575
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/planning/enter-plan-mode.md?raw
|
|
270576
270576
|
var enter_plan_mode_default = "Use this tool proactively when you're about to start a non-trivial implementation task.\nGetting user sign-off on your approach via ExitPlanMode before writing code prevents wasted effort.\n\nUse it when ANY of these conditions apply:\n\n1. New Feature Implementation - e.g. \"Add a caching layer to the API\"\n2. Multiple Valid Approaches - e.g. \"Optimize database queries\" (indexing vs rewrite vs caching)\n3. Code Modifications - e.g. \"Refactor auth module to support OAuth\"\n4. Architectural Decisions - e.g. \"Add WebSocket support\"\n5. Multi-File Changes - involves more than 2-3 files\n6. Unclear Requirements - need exploration to understand scope\n7. User Preferences Matter - if user input would materially change the implementation approach, use EnterPlanMode to structure the decision\n\nPermission mode notes:\n- EnterPlanMode enters plan mode automatically without an approval prompt in all permission modes.\n- In yolo and manual modes, ExitPlanMode still presents the plan to the user for approval.\n- In auto permission mode, do not use AskUserQuestion; make the best decision from available context.\n- In auto permission mode, ExitPlanMode exits plan mode without asking the user.\n- Use EnterPlanMode only when planning itself adds value.\n\nWhen NOT to use:\n- Single-line or few-line fixes (typos, obvious bugs, small tweaks)\n- User gave very specific, detailed instructions\n- Pure research/exploration tasks\n\nOnce you are in plan mode, a reminder walks you through the workflow (explore → design → write the plan file → `ExitPlanMode`) and enforces read-only access. For non-trivial tasks where you are unsure of the codebase structure or relevant code paths, use `Agent(subagent_type=\"explore\")` to investigate first when the `Agent` tool is available.\n";
|
|
270577
270577
|
//#endregion
|
|
270578
|
-
//#region
|
|
270578
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/planning/enter-plan-mode.ts
|
|
270579
270579
|
const EnterPlanModeInputSchema = object({}).strict();
|
|
270580
270580
|
var EnterPlanModeTool = class {
|
|
270581
270581
|
agent;
|
|
@@ -270634,10 +270634,10 @@ function enteredPlanModeMessage(planPath) {
|
|
|
270634
270634
|
].join("\n");
|
|
270635
270635
|
}
|
|
270636
270636
|
//#endregion
|
|
270637
|
-
//#region
|
|
270637
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/planning/exit-plan-mode.md?raw
|
|
270638
270638
|
var exit_plan_mode_default = "Use this tool when you are in plan mode and have finished writing your plan to the plan file and are ready for user approval.\n\n## How This Tool Works\n- You should have already written your plan to the plan file specified in the plan mode reminder.\n- This tool does NOT take the plan content as a parameter - it reads the plan from the file you wrote.\n- The user will see the contents of your plan file when they review it. In auto permission mode, the tool reads the file and exits plan mode without asking the user.\n\n## When to Use\nOnly use this tool for tasks that require planning implementation steps. For research tasks (searching files, reading code, understanding the codebase), do NOT use this tool.\n\n## What a good plan contains\nList specific, verifiable steps grounded in the actual codebase — real files, functions, and commands, in a sensible order. Each step should be concrete enough to act on and to check. Avoid vague filler like \"improve performance\" or \"add tests\"; say what to change and where.\n\n## Multiple Approaches\nIf your plan offers multiple alternative approaches, pass them via the `options` parameter so the user can choose which one to execute — see the `options` parameter for the format, count, and reserved labels. In yolo and manual modes the user sees all options alongside the host's Reject and Revise controls.\n\n## Before Using\n- In auto permission mode, do NOT use AskUserQuestion; make the best decision from available context.\n- In auto permission mode, this tool exits plan mode without asking the user.\n- In yolo and manual modes, this tool still presents the plan to the user for approval.\n- If auto permission mode is not active and you have unresolved questions, use AskUserQuestion first.\n- If auto permission mode is not active and you have multiple approaches and haven't narrowed down yet, consider using AskUserQuestion first to let the user choose, then write a plan for the chosen approach only.\n- Once your plan is finalized, use THIS tool to request approval.\n- Do NOT use AskUserQuestion to ask \"Is this plan OK?\" or \"Should I proceed?\" - that is exactly what ExitPlanMode does.\n- If rejected, revise based on feedback and call ExitPlanMode again.\n";
|
|
270639
270639
|
//#endregion
|
|
270640
|
-
//#region
|
|
270640
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/planning/exit-plan-mode.ts
|
|
270641
270641
|
const RESERVED_OPTION_LABELS = new Set([
|
|
270642
270642
|
"Approve",
|
|
270643
270643
|
"Reject",
|
|
@@ -270758,10 +270758,10 @@ function formatPlanForOutput(plan, path) {
|
|
|
270758
270758
|
return `Plan mode deactivated. All tools are now available.\n${path !== void 0 ? `Plan saved to: ${path}\n\n` : ""}## Approved Plan:\n${plan}`;
|
|
270759
270759
|
}
|
|
270760
270760
|
//#endregion
|
|
270761
|
-
//#region
|
|
270761
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/shell/bash.md?raw
|
|
270762
270762
|
var bash_default = "Execute a `{{ SHELL_NAME }}` command. Use this for shell semantics — pipes, env, processes, git, package managers, build/test runners, anything genuinely interactive or multi-step.\n\n**Translate these to a dedicated tool instead:**\n- `cat` / `head` / `tail` (known path) → `Read`\n- `sed` / `awk` (in-place edit) → `Edit`\n- `echo > file` / `cat <<EOF` → `Write`\n- `find` / recursive `ls` to locate files by name pattern → `Glob` (plain `ls <known-directory>` is fine for listing a directory)\n- `grep` / `rg` (search file contents) → `Grep`\n- `echo` / `printf` (talk to the user) → just output text directly\n\nThe dedicated tools render in the per-tool permission UI and keep raw stdout out of the conversation; that is why they are worth reaching for whenever one fits.\n\n**Output:**\nThe stdout and stderr will be combined and returned as a string. The output may be truncated if it is too long. If the command exits non-zero, the output ends with a `Command failed with exit code: N` line; a command killed by its timeout or interrupted by the user ends with its own message instead.\n\nIf `run_in_background=true`, the command will be started as a background task and this tool will return a task ID instead of waiting for command completion. When doing that, you must provide a short `description`. Background commands default to a {{ DEFAULT_BACKGROUND_TIMEOUT_S }}s timeout and `timeout` is capped at {{ MAX_BACKGROUND_TIMEOUT_S }}s; set `disable_timeout=true` only when the task should run without a timeout. You will be automatically notified when the task completes. After starting one, default to returning control to the user instead of immediately waiting on it. Use `TaskOutput` for a non-blocking status/output snapshot, and only set `block=true` when you explicitly want to wait for completion. Use `TaskStop` only if the task must be cancelled. If a human user wants to inspect background tasks themselves, point them to the `/tasks` command, which opens an interactive panel; it has no subcommands.\n\n**Guidelines for safety and security:**\n- Each shell tool call will be executed in a fresh shell environment. The shell variables, current working directory changes, and the shell history is not preserved between calls. To run a command in a particular directory, pass the `cwd` argument (or use absolute paths) rather than relying on a `cd` from an earlier call.\n- The tool call will return after the command is finished. You shall not use this tool to execute an interactive command or a command that may run forever. For possibly long-running foreground commands, set the `timeout` argument in seconds. Foreground commands default to {{ DEFAULT_TIMEOUT_S }}s and allow up to {{ MAX_TIMEOUT_S }}s.\n- Avoid using `..` to access files or directories outside of the working directory.\n- Avoid modifying files outside of the working directory unless explicitly instructed to do so.\n- Never run commands that require superuser privileges unless explicitly instructed to do so.\n\n**Guidelines for efficiency:**\n- Use `&&` to chain commands that genuinely depend on each other, e.g. `npm install && npm test`. Independent read-only commands (separate `git show`, `ls`, or status checks) should be issued as separate parallel Bash calls in one response, not chained into a single call — chaining serializes their execution and mixes their output. Do not stitch outputs together with `echo` separators.\n- Use `;` to run commands sequentially regardless of success/failure\n- Use `||` for conditional execution (run second command only if first fails)\n- Use pipe operations (`|`) and redirections (`>`, `>>`) to chain input and output between commands\n- Always quote file paths containing spaces with double quotes (e.g., cd \"/path with spaces/\")\n- Compose multi-step logic in a single call with `if` / `case` / `for` / `while` control flows.\n- Prefer `run_in_background=true` for long-running builds, tests, watchers, or servers when you need the conversation to continue before the command finishes.\n\n**Commands available:**\nThe following common command categories are usually available. Availability still depends on the host, so when in doubt run `which <command>` first to confirm a command exists before relying on it.\n- Navigation and inspection: `ls`, `pwd`, `cd`, `stat`, `file`, `du`, `df`, `tree`\n- File and directory management: `cp`, `mv`, `rm`, `mkdir`, `touch`, `ln`, `chmod`, `chown`\n- Text and data processing: `wc`, `sort`, `uniq`, `cut`, `tr`, `diff`, `xargs`\n- Archives and compression: `tar`, `gzip`, `gunzip`, `zip`, `unzip`\n- Networking and transfer: `curl`, `wget`, `ping`, `ssh`, `scp`\n- Version control: `git`; for GitHub-hosted work (PRs, issues, CI runs, API queries) prefer the `gh` CLI when installed — it carries the user's GitHub auth and can return structured JSON\n- Process and system: `ps`, `kill`, `top`, `env`, `date`, `uname`, `whoami`\n- Language and package toolchains: `node`, `npm`, `pnpm`, `yarn`, `python`, `pip` (use whichever the project actually relies on)\n";
|
|
270763
270763
|
//#endregion
|
|
270764
|
-
//#region
|
|
270764
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/shell/bash.ts
|
|
270765
270765
|
const MS_PER_SECOND = 1e3;
|
|
270766
270766
|
const DEFAULT_TIMEOUT_S = 60;
|
|
270767
270767
|
const MAX_TIMEOUT_S = 300;
|
|
@@ -271059,7 +271059,7 @@ function rewriteWindowsNullRedirect(command) {
|
|
|
271059
271059
|
return command.replace(WINDOWS_NUL_REDIRECT, "$1/dev/null");
|
|
271060
271060
|
}
|
|
271061
271061
|
//#endregion
|
|
271062
|
-
//#region
|
|
271062
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/state/compact-conversation.ts
|
|
271063
271063
|
const CompactConversationInputSchema = object({}).strict();
|
|
271064
271064
|
var CompactConversationTool = class {
|
|
271065
271065
|
agent;
|
|
@@ -271087,10 +271087,10 @@ var CompactConversationTool = class {
|
|
|
271087
271087
|
}
|
|
271088
271088
|
};
|
|
271089
271089
|
//#endregion
|
|
271090
|
-
//#region
|
|
271090
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/web/fetch-url.md?raw
|
|
271091
271091
|
var fetch_url_default = "Fetch content from a URL. The content is returned either as the main text extracted from the page, or as the full response body verbatim; a note at the top of the result states which of the two you received, so you can judge how complete it is. Use this when you need to read a specific web page.\n\nOnly fully-formed public `http`/`https` URLs are supported; other schemes and private or loopback addresses are not fetched. Very large pages may be truncated or refused. The fetch carries no login or session for the target site, so pages behind authentication (private repositories, internal dashboards) return a login page or an error instead of the real content — if the text you get back looks like a generic landing or sign-in page, treat that as the login wall, not the answer, and reach the content through a credentialed route (an authenticated CLI or MCP tool) instead.\n";
|
|
271092
271092
|
//#endregion
|
|
271093
|
-
//#region
|
|
271093
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/web/fetch-url.ts
|
|
271094
271094
|
/**
|
|
271095
271095
|
* FetchURLTool — host-injected URL fetcher.
|
|
271096
271096
|
*
|
|
@@ -271160,10 +271160,10 @@ var FetchURLTool = class {
|
|
|
271160
271160
|
}
|
|
271161
271161
|
};
|
|
271162
271162
|
//#endregion
|
|
271163
|
-
//#region
|
|
271163
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/web/web-search.md?raw
|
|
271164
271164
|
var web_search_default = "Search the web for information. Use this when you need up-to-date information from the internet.\n\nEach result includes its title, its URL, and a snippet, plus its source site and publication date when available. Results are short summaries, not full pages — when a result looks relevant, call the FetchURL tool on its URL to read the full page content. Fetch only the few URLs you actually need. Prefer specific queries, and refine the query if the results don't contain what you need.\n\nWhen you rely on a result in your answer, cite its source URL so the user can verify it.\n";
|
|
271165
271165
|
//#endregion
|
|
271166
|
-
//#region
|
|
271166
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/web/web-search.ts
|
|
271167
271167
|
/**
|
|
271168
271168
|
* WebSearchTool — host-injected web search.
|
|
271169
271169
|
*
|
|
@@ -271251,10 +271251,10 @@ function classifySearchError(error) {
|
|
|
271251
271251
|
return `Search failed: ${message}`;
|
|
271252
271252
|
}
|
|
271253
271253
|
//#endregion
|
|
271254
|
-
//#region
|
|
271254
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/search/codebase-search.md?raw
|
|
271255
271255
|
var codebase_search_default = "Find code by **meaning**, not by keywords.\n\nThis tool runs a semantic search over the codebase index. It understands what a file or function *does*, not just what words appear in it. Use it when you are looking for *where* something is handled, *which file* implements a concept, or *how* a particular concern is addressed — even when the exact term never appears in the source.\n\n**When to use this tool:**\n- \"Where is keyboard input handled?\" — finds the handler even if the word \"keyboard\" never appears.\n- \"Which file manages the retry logic for API calls?\"\n- \"How does the app decide which model to route a message to?\"\n- \"Find the code that handles user authentication flow.\"\n- Any question where you want to locate code by its *purpose* or *behavior*.\n\n**When NOT to use this tool — use a different one instead:**\n- Exact string matches, regex patterns, or specific identifiers → `Grep`\n- Finding files by name, extension, or path glob → `Glob`\n- Reading a known file path → `Read`\n\n**Parameters:**\n- `query` (required): A natural-language question, concept, or phrase describing what the code does. Examples: `\"keyboard event handling\"`, `\"retry with exponential backoff\"`, `\"where chat messages are routed to the model\"`.\n- `top` (optional, default 5, maximum 100): Maximum number of results to return.\n\n**Output:**\nEach result includes a file path and a relevance score, plus the index model and revision. The index is rebuilt incrementally; if a file was recently added it may not appear until the next index update. Always verify the finding by reading the file before relying on it.\n";
|
|
271256
271256
|
//#endregion
|
|
271257
|
-
//#region
|
|
271257
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/search/codebase-search.ts
|
|
271258
271258
|
/**
|
|
271259
271259
|
* CodebaseSearchTool — semantic code search via the codebase-index.
|
|
271260
271260
|
*
|
|
@@ -271382,10 +271382,10 @@ var CodebaseSearchTool = class {
|
|
|
271382
271382
|
}
|
|
271383
271383
|
};
|
|
271384
271384
|
//#endregion
|
|
271385
|
-
//#region
|
|
271385
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/search/lsp.md?raw
|
|
271386
271386
|
var lsp_default = "Query a configured Language Server Protocol (LSP) server for precise code intelligence.\n\nUse this tool for definitions, references, hover/type information, document or workspace symbols, implementations, and current diagnostics. Line and character positions are one-based. Use `workspace_symbols` with `query`; all other operations require `path`. Position-based operations also require `line` and `character`.\n\nLanguage servers are provided by enabled plugins and start only when first used. If the required server executable is missing, report that exact setup error instead of falling back to a guess.\n";
|
|
271387
271387
|
//#endregion
|
|
271388
|
-
//#region
|
|
271388
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/search/lsp.ts
|
|
271389
271389
|
const LspInputSchema = object({
|
|
271390
271390
|
operation: _enum([
|
|
271391
271391
|
"definition",
|
|
@@ -271447,10 +271447,10 @@ var LspTool = class {
|
|
|
271447
271447
|
}
|
|
271448
271448
|
};
|
|
271449
271449
|
//#endregion
|
|
271450
|
-
//#region
|
|
271450
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/mistake-record.md?raw
|
|
271451
271451
|
var mistake_record_default = "Record a mistake or refutation into Mistake.md.\n\nUse this tool when you (or another agent) have been refuted — someone showed that a claim you made was wrong. The entry becomes a shared lesson for the whole team.\n\n**CRITICAL RULE — read before using:**\n- Never create space in Mistake.md by editing or shortening existing entries.\n- If the file is full, the correct action is a visible message — not making room.\n- Existing entries are untouchable. A full file is refused visibly for manual curation.\n- This tool appends only. It never edits, reorders, or reformats existing content.\n\n**When to use:**\n- Another agent or the user showed that a number, claim, or assumption was wrong\n- You discovered a mistake in your own earlier statement through re-measurement\n- A pattern repeats and should be documented with its recurrence condition\n\n**Parameters:**\n- `about` — who made the original claim (agent name or \"me\" for yourself)\n- `claim` — what was claimed (one sentence)\n- `measurement` — what was actually measured (one sentence)\n- `condition` — under what condition this mistake will happen again (required; without it the entry is discarded)\n\n**What happens:**\n- The entry is appended to Mistake.md with origin \"program\"\n- The condition is checked by A2 — vague entries (timeout, network error without context) are rejected\n- The entry includes metadata (who reported, who it's about, date) as machine-readable markers\n- The lesson text contains only claim, measurement, and condition — no names in the readable part\n- The file is shared across all projects and turns, so the whole team learns from it\n";
|
|
271452
271452
|
//#endregion
|
|
271453
|
-
//#region
|
|
271453
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/mistake-record.ts
|
|
271454
271454
|
/**
|
|
271455
271455
|
* MistakeRecordTool — record a refutation into Mistake.md.
|
|
271456
271456
|
*
|
|
@@ -271520,7 +271520,7 @@ var MistakeRecordTool = class {
|
|
|
271520
271520
|
}
|
|
271521
271521
|
};
|
|
271522
271522
|
//#endregion
|
|
271523
|
-
//#region
|
|
271523
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/programmatic-guest-console.ts
|
|
271524
271524
|
function renderProgrammaticBootstrap(tools, stateJson, limits) {
|
|
271525
271525
|
const entries = tools.map((tool, index) => {
|
|
271526
271526
|
const bridge = `globalThis.__blun_ptc_${index}`;
|
|
@@ -271728,7 +271728,7 @@ function renderProgrammaticBootstrap(tools, stateJson, limits) {
|
|
|
271728
271728
|
`;
|
|
271729
271729
|
}
|
|
271730
271730
|
//#endregion
|
|
271731
|
-
//#region
|
|
271731
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/programmatic-quickjs.ts
|
|
271732
271732
|
var ProgrammaticPinnedAsyncModule = class extends QuickJSAsyncWASMModule {
|
|
271733
271733
|
static dispose(module, runtime) {
|
|
271734
271734
|
const callbacks = module.callbacks;
|
|
@@ -271747,7 +271747,7 @@ var ProgrammaticPinnedAsyncModule = class extends QuickJSAsyncWASMModule {
|
|
|
271747
271747
|
};
|
|
271748
271748
|
const disposeProgrammaticRuntime = ProgrammaticPinnedAsyncModule.dispose;
|
|
271749
271749
|
//#endregion
|
|
271750
|
-
//#region
|
|
271750
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/programmatic-tool-runtime.ts
|
|
271751
271751
|
const IDENTIFIER_RE = /^[A-Za-z_$][A-Za-z0-9_$]*$/u;
|
|
271752
271752
|
const DEFAULT_LIMITS = Object.freeze({
|
|
271753
271753
|
memoryBytes: 16 * 1024 * 1024,
|
|
@@ -272168,7 +272168,7 @@ function errorMessage$2(error) {
|
|
|
272168
272168
|
return String(error);
|
|
272169
272169
|
}
|
|
272170
272170
|
//#endregion
|
|
272171
|
-
//#region
|
|
272171
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/programmatic-tool.ts
|
|
272172
272172
|
const PROGRAMMATIC_TOOL_NAME = "ProgrammaticTool";
|
|
272173
272173
|
const ProgrammaticToolInputSchema = object({
|
|
272174
272174
|
code: string().max(32e3).describe("JavaScript function body. Use state for explicit JSON state and tools.<alias>(args) for declared sequential tool calls."),
|
|
@@ -272230,7 +272230,7 @@ var ProgrammaticTool = class {
|
|
|
272230
272230
|
}
|
|
272231
272231
|
};
|
|
272232
272232
|
//#endregion
|
|
272233
|
-
//#region
|
|
272233
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/builtin/media/blun-media.ts
|
|
272234
272234
|
const PromptSchema = string().trim().min(1).max(2e4);
|
|
272235
272235
|
const MediaIdSchema = string().trim().min(1).max(200).regex(/^[A-Za-z0-9_-]+$/);
|
|
272236
272236
|
const GenerateImageInputSchema = object({ prompt: PromptSchema.describe("A complete visual description of the image to generate.") });
|
|
@@ -272526,7 +272526,7 @@ function errorMessage$1(error) {
|
|
|
272526
272526
|
return error instanceof Error ? error.message : String(error);
|
|
272527
272527
|
}
|
|
272528
272528
|
//#endregion
|
|
272529
|
-
//#region
|
|
272529
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/tool/index.ts
|
|
272530
272530
|
/** Foreground timeout (seconds) for a user-initiated `!` shell command. */
|
|
272531
272531
|
const SHELL_FOREGROUND_TIMEOUT_S = 120;
|
|
272532
272532
|
var ToolManager = class {
|
|
@@ -273043,7 +273043,7 @@ var ToolManager = class {
|
|
|
273043
273043
|
}
|
|
273044
273044
|
};
|
|
273045
273045
|
//#endregion
|
|
273046
|
-
//#region
|
|
273046
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/response-review-mcp.ts
|
|
273047
273047
|
const SERVER_NAME = "blun-language-guard";
|
|
273048
273048
|
const TOOL_NAMES = ["release_response", "verify_release_token"];
|
|
273049
273049
|
const CHECK_NAMES = [
|
|
@@ -273186,7 +273186,7 @@ function createGuardResponseReviewer(host) {
|
|
|
273186
273186
|
};
|
|
273187
273187
|
}
|
|
273188
273188
|
//#endregion
|
|
273189
|
-
//#region
|
|
273189
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/response-review-host.ts
|
|
273190
273190
|
function responseReviewSettingsFromEnv(env) {
|
|
273191
273191
|
const language = env["BLUN_LANGUAGE_GUARD_LANGUAGE"];
|
|
273192
273192
|
const guardVersion = env["BLUN_LANGUAGE_GUARD_VERSION"];
|
|
@@ -273367,7 +273367,7 @@ async function authorizeReview(agent, request) {
|
|
|
273367
273367
|
return unchangedApproval(permission, expected) && canonicalTelemetryArgs(args) === canonicalTelemetryArgs(expected);
|
|
273368
273368
|
}
|
|
273369
273369
|
//#endregion
|
|
273370
|
-
//#region
|
|
273370
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/turn/fallback-llm.ts
|
|
273371
273371
|
const MODEL_FALLBACK_ORDER = [];
|
|
273372
273372
|
const MODEL_FALLBACK_STATUS_CODES = new Set([
|
|
273373
273373
|
429,
|
|
@@ -273569,7 +273569,7 @@ function wrapPart(callback, markOutput) {
|
|
|
273569
273569
|
};
|
|
273570
273570
|
}
|
|
273571
273571
|
//#endregion
|
|
273572
|
-
//#region
|
|
273572
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/usage/index.ts
|
|
273573
273573
|
function copyUsage(usage) {
|
|
273574
273574
|
return { ...usage };
|
|
273575
273575
|
}
|
|
@@ -273623,7 +273623,7 @@ function totalUsage(byModel) {
|
|
|
273623
273623
|
return total;
|
|
273624
273624
|
}
|
|
273625
273625
|
//#endregion
|
|
273626
|
-
//#region
|
|
273626
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/llm-request-logger.ts
|
|
273627
273627
|
var LlmRequestLogger = class {
|
|
273628
273628
|
log;
|
|
273629
273629
|
lastConfigLogSignature;
|
|
@@ -273887,7 +273887,7 @@ function fingerprint(content) {
|
|
|
273887
273887
|
return createHash("sha256").update(content).digest("hex");
|
|
273888
273888
|
}
|
|
273889
273889
|
//#endregion
|
|
273890
|
-
//#region
|
|
273890
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/index.ts
|
|
273891
273891
|
const RUNTIME_SYSTEM_PROMPT_APPEND_MAX_CHARS = 16e3;
|
|
273892
273892
|
function normalizeRuntimeSystemPromptAppend(value) {
|
|
273893
273893
|
const trimmed = value?.trim() ?? "";
|
|
@@ -274627,7 +274627,7 @@ var Agent$1 = class {
|
|
|
274627
274627
|
}
|
|
274628
274628
|
};
|
|
274629
274629
|
//#endregion
|
|
274630
|
-
//#region
|
|
274630
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/rpc/types.ts
|
|
274631
274631
|
function proxyWithExtraPayload(methods, extraPayload) {
|
|
274632
274632
|
return new Proxy(methods, { get(target, prop) {
|
|
274633
274633
|
const origMethod = target[prop];
|
|
@@ -276824,7 +276824,7 @@ var StreamableHTTPClientTransport = class {
|
|
|
276824
276824
|
}
|
|
276825
276825
|
};
|
|
276826
276826
|
//#endregion
|
|
276827
|
-
//#region
|
|
276827
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/version.ts
|
|
276828
276828
|
function getCoreVersion() {
|
|
276829
276829
|
try {
|
|
276830
276830
|
const raw = readFileSync(fileURLToPath(new URL("../package.json", import.meta.url)), "utf-8");
|
|
@@ -276885,7 +276885,7 @@ function toMcpToolResult(result) {
|
|
|
276885
276885
|
};
|
|
276886
276886
|
}
|
|
276887
276887
|
//#endregion
|
|
276888
|
-
//#region
|
|
276888
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/client-remote.ts
|
|
276889
276889
|
function buildMcpRemoteHeaders(config, envLookup) {
|
|
276890
276890
|
const headers = { ...config.headers };
|
|
276891
276891
|
if (config.bearerTokenEnvVar !== void 0) {
|
|
@@ -276900,7 +276900,7 @@ function isRemoteMcpConfig(config) {
|
|
|
276900
276900
|
return config.transport === "http" || config.transport === "sse";
|
|
276901
276901
|
}
|
|
276902
276902
|
//#endregion
|
|
276903
|
-
//#region
|
|
276903
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/client-http.ts
|
|
276904
276904
|
/**
|
|
276905
276905
|
* Wraps the SDK streamable-HTTP transport as a kosong {@link MCPClient}.
|
|
276906
276906
|
* Static bearer tokens are looked up from `process.env[bearerTokenEnvVar]`.
|
|
@@ -277435,7 +277435,7 @@ var SSEClientTransport = class {
|
|
|
277435
277435
|
}
|
|
277436
277436
|
};
|
|
277437
277437
|
//#endregion
|
|
277438
|
-
//#region
|
|
277438
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/client-sse.ts
|
|
277439
277439
|
/**
|
|
277440
277440
|
* Wraps the SDK's deprecated HTTP+SSE transport as a kosong
|
|
277441
277441
|
* {@link MCPClient}. This exists for compatibility with older MCP servers;
|
|
@@ -304459,7 +304459,7 @@ var StdioClientTransport = class {
|
|
|
304459
304459
|
}
|
|
304460
304460
|
};
|
|
304461
304461
|
//#endregion
|
|
304462
|
-
//#region
|
|
304462
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/client-stdio.ts
|
|
304463
304463
|
const STDERR_BUFFER_CAPACITY = 4 * 1024;
|
|
304464
304464
|
/**
|
|
304465
304465
|
* Wraps the `@modelcontextprotocol/sdk` stdio client and exposes the small
|
|
@@ -304637,7 +304637,7 @@ function mergeStdioEnv(configEnv, parentEnv = process.env, runtimeEnv) {
|
|
|
304637
304637
|
return merged;
|
|
304638
304638
|
}
|
|
304639
304639
|
//#endregion
|
|
304640
|
-
//#region
|
|
304640
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/public-display.ts
|
|
304641
304641
|
const SENSITIVE_FLAG = /(?:token|secret|password|passwd|api[-_]?key|authorization|credential)/i;
|
|
304642
304642
|
const OPAQUE_VALUE_FLAG = /^(?:--header|-H|--env|-e)$/;
|
|
304643
304643
|
function sanitizeMcpPublicArgs(args) {
|
|
@@ -304672,7 +304672,7 @@ function sanitizeMcpPublicText(value) {
|
|
|
304672
304672
|
return value.replaceAll(/-----BEGIN [^-]*PRIVATE KEY-----[\s\S]*?-----END [^-]*PRIVATE KEY-----/gi, redacted).replaceAll(/(["']?)(authorization)\1\s*([:=])\s*(["']?)((?:basic|bearer)\s+)[^"'\s,;]+\4/gi, (_match, labelQuote, label, separator, valueQuote, scheme) => `${labelQuote}${label}${labelQuote}${separator} ${valueQuote}${scheme}${redacted}${valueQuote}`).replaceAll(/(["']?)((?:api[_ -]?(?:key|token)|access[_ -]?token|refresh[_ -]?token|id[_ -]?token|token|secret|password|passwd|pwd|credential))\1\s*([:=])\s*(?:"[^"]*"|'[^']*'|[^\s,;]+)/gi, (_match, quote, label, separator) => `${quote}${label}${quote}${separator}${redacted}`).replaceAll(/\b((?:api[_ -]?(?:key|token)|access[_ -]?token|refresh[_ -]?token|id[_ -]?token|token|secret|password|passwd|pwd|credential)\s+)(?!(?:is|was|not|missing|empty|required|invalid|expired|env|environment|variable|header|argument|flag|file|path|value)\b)(?:"[^"]*"|'[^']*'|[^\s,;]+)/gi, `$1${redacted}`).replaceAll(/\b(?:sk|key|token)-[a-z0-9_-]{3,}\b/gi, redacted).replaceAll(/https?:\/\/[^\s"'`]+/gi, (url) => sanitizeMcpPublicUrl(url));
|
|
304673
304673
|
}
|
|
304674
304674
|
//#endregion
|
|
304675
|
-
//#region
|
|
304675
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/types.ts
|
|
304676
304676
|
/**
|
|
304677
304677
|
* Validate the `inputSchema` field of an MCP tool definition. MCP advertises
|
|
304678
304678
|
* input schemas as JSON Schema objects; reject anything that is not a plain
|
|
@@ -304684,7 +304684,7 @@ function assertMcpInputSchema(toolName, inputSchema) {
|
|
|
304684
304684
|
throw new Error(`Invalid inputSchema for MCP tool "${toolName}": schema must be a JSON object`);
|
|
304685
304685
|
}
|
|
304686
304686
|
//#endregion
|
|
304687
|
-
//#region
|
|
304687
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/connection-manager.ts
|
|
304688
304688
|
const DEFAULT_STARTUP_TIMEOUT_MS$1 = 3e4;
|
|
304689
304689
|
/**
|
|
304690
304690
|
* Owns the lifecycle of every configured MCP server for a Session.
|
|
@@ -305128,7 +305128,7 @@ async function withTimeout(promise, timeoutMs, onTimeout) {
|
|
|
305128
305128
|
}
|
|
305129
305129
|
}
|
|
305130
305130
|
//#endregion
|
|
305131
|
-
//#region
|
|
305131
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/config-loader.ts
|
|
305132
305132
|
const McpJsonFileSchema = object({ mcpServers: record$2(string(), McpServerConfigSchema).default({}) });
|
|
305133
305133
|
async function resolveMcpJsonPaths(input) {
|
|
305134
305134
|
const projectRoot = await findProjectRoot(input.cwd);
|
|
@@ -305240,7 +305240,7 @@ function describeError(error) {
|
|
|
305240
305240
|
return error instanceof Error ? error.message : String(error);
|
|
305241
305241
|
}
|
|
305242
305242
|
//#endregion
|
|
305243
|
-
//#region
|
|
305243
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/config-editor.ts
|
|
305244
305244
|
async function setMcpServerEnabledInFile(configPath, name, enabled) {
|
|
305245
305245
|
const document = await readMcpDocument(configPath);
|
|
305246
305246
|
const server = document.mcpServers[name];
|
|
@@ -305280,7 +305280,7 @@ function missingServer(name, configPath) {
|
|
|
305280
305280
|
return new BlunError(ErrorCodes.MCP_SERVER_NOT_FOUND, `MCP server "${name}" is not declared in ${configPath}`);
|
|
305281
305281
|
}
|
|
305282
305282
|
//#endregion
|
|
305283
|
-
//#region
|
|
305283
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/mcp/session-config.ts
|
|
305284
305284
|
async function resolveSessionMcpConfig(input) {
|
|
305285
305285
|
const loaded = await loadMcpServerConfig({
|
|
305286
305286
|
cwd: input.cwd,
|
|
@@ -305303,7 +305303,7 @@ function mergeCallerMcpServers(base, callerServers) {
|
|
|
305303
305303
|
};
|
|
305304
305304
|
}
|
|
305305
305305
|
//#endregion
|
|
305306
|
-
//#region
|
|
305306
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/plugin/agent-spine-runtime.ts
|
|
305307
305307
|
const PROMPT_EVENTS = new Set([
|
|
305308
305308
|
"UserPromptSubmit",
|
|
305309
305309
|
"TurnStart",
|
|
@@ -305370,7 +305370,7 @@ var AgentSpineSessionRuntime = class {
|
|
|
305370
305370
|
}
|
|
305371
305371
|
};
|
|
305372
305372
|
//#endregion
|
|
305373
|
-
//#region
|
|
305373
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/profile/legacy-memory.ts
|
|
305374
305374
|
const LEGACY_LOCAL_MEMORY_HEADING = "## Persistent memory — your cross-session memory";
|
|
305375
305375
|
const LEGACY_LOCAL_MEMORY_LOCATION = "You have a persistent file-based memory at `";
|
|
305376
305376
|
const LEGACY_LOCAL_MEMORY_SAVE = "When the user tells you something worth remembering (preferences, facts about them, project context, corrections), SAVE it:";
|
|
@@ -305386,7 +305386,7 @@ function hasLegacyLocalMemorySystemBlock(systemPrompt) {
|
|
|
305386
305386
|
return candidate.includes(LEGACY_LOCAL_MEMORY_LOCATION) && candidate.includes(LEGACY_LOCAL_MEMORY_SAVE) && candidate.includes("MEMORY.md");
|
|
305387
305387
|
}
|
|
305388
305388
|
//#endregion
|
|
305389
|
-
//#region
|
|
305389
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/utils/host-work.ts
|
|
305390
305390
|
function bindHostEffectMethod(methods, owner, name, asynchronous, kind, detail) {
|
|
305391
305391
|
const method = Reflect.get(methods, name);
|
|
305392
305392
|
Object.defineProperty(methods, name, {
|
|
@@ -305403,7 +305403,7 @@ function bindHostEffectMethod(methods, owner, name, asynchronous, kind, detail)
|
|
|
305403
305403
|
});
|
|
305404
305404
|
}
|
|
305405
305405
|
//#endregion
|
|
305406
|
-
//#region
|
|
305406
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/host-work.ts
|
|
305407
305407
|
const DIRECT_WORK = {
|
|
305408
305408
|
setToolKaos: false,
|
|
305409
305409
|
setAdditionalDirs: true,
|
|
@@ -305430,7 +305430,7 @@ function bindDirectSessionWork(session) {
|
|
|
305430
305430
|
].includes(name) ? "teardown" : "work", `session:${name}`);
|
|
305431
305431
|
}
|
|
305432
305432
|
//#endregion
|
|
305433
|
-
//#region
|
|
305433
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/idle-admission.ts
|
|
305434
305434
|
function nativeOwners(session, id, agent) {
|
|
305435
305435
|
if (!(agent.turn instanceof TurnFlow) || !(agent.fullCompaction instanceof FullCompaction) || !(agent.background instanceof BackgroundManager) || !(agent.records instanceof AgentRecords) || !(agent.goal instanceof GoalMode) || !(agent.subagentHost instanceof SessionSubagentHost) || !agent.subagentHost.belongsTo(session, id) || agent.cron !== null && !(agent.cron instanceof CronManager) || agent.hooks !== void 0 && !(agent.hooks instanceof HookEngine)) return void 0;
|
|
305436
305436
|
return [
|
|
@@ -305539,7 +305539,7 @@ var SessionIdleAdmission = class {
|
|
|
305539
305539
|
}
|
|
305540
305540
|
};
|
|
305541
305541
|
//#endregion
|
|
305542
|
-
//#region
|
|
305542
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/host-events.ts
|
|
305543
305543
|
/** Publication settlement belongs to the session, even during native teardown. */
|
|
305544
305544
|
function withOwnedSessionEvents(rpc, operations) {
|
|
305545
305545
|
const emitEvent = (...args) => operations.run("rpc-event", () => rpc.emitEvent(...args));
|
|
@@ -305548,7 +305548,7 @@ function withOwnedSessionEvents(rpc, operations) {
|
|
|
305548
305548
|
} });
|
|
305549
305549
|
}
|
|
305550
305550
|
//#endregion
|
|
305551
|
-
//#region
|
|
305551
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/lsp/client.ts
|
|
305552
305552
|
const DEFAULT_STARTUP_TIMEOUT_MS = 1e4;
|
|
305553
305553
|
const DEFAULT_SHUTDOWN_TIMEOUT_MS = 2e3;
|
|
305554
305554
|
const REQUEST_TIMEOUT_MS = 3e4;
|
|
@@ -305919,7 +305919,7 @@ function delay(timeoutMs) {
|
|
|
305919
305919
|
});
|
|
305920
305920
|
}
|
|
305921
305921
|
//#endregion
|
|
305922
|
-
//#region
|
|
305922
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/lsp/manager.ts
|
|
305923
305923
|
var LspManager = class {
|
|
305924
305924
|
options;
|
|
305925
305925
|
admission = new AdmissionGate();
|
|
@@ -306091,7 +306091,7 @@ function positionFrom(input) {
|
|
|
306091
306091
|
};
|
|
306092
306092
|
}
|
|
306093
306093
|
//#endregion
|
|
306094
|
-
//#region
|
|
306094
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/index.ts
|
|
306095
306095
|
init_injector();
|
|
306096
306096
|
const BACKGROUND_KEEP_ALIVE_ON_EXIT_ENV = "BLUN_BACKGROUND_KEEP_ALIVE_ON_EXIT";
|
|
306097
306097
|
const ACTIVE_TURN_CLOSE_TIMEOUT_MS = 8e3;
|
|
@@ -307110,7 +307110,7 @@ function initCompletionReminder(agentsMd) {
|
|
|
307110
307110
|
].join("\n");
|
|
307111
307111
|
}
|
|
307112
307112
|
//#endregion
|
|
307113
|
-
//#region
|
|
307113
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/rpc/client.ts
|
|
307114
307114
|
function createRPC() {
|
|
307115
307115
|
const left = createControlledPromise();
|
|
307116
307116
|
const right = createControlledPromise();
|
|
@@ -307173,13 +307173,13 @@ function createRPC() {
|
|
|
307173
307173
|
return [leftClient, rightClient];
|
|
307174
307174
|
}
|
|
307175
307175
|
//#endregion
|
|
307176
|
-
//#region
|
|
307176
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/plugin/types.ts
|
|
307177
307177
|
const PLUGIN_NAME_REGEX = /^[a-z0-9][a-z0-9_-]{0,63}$/;
|
|
307178
307178
|
function normalizePluginId(name) {
|
|
307179
307179
|
return name.toLowerCase();
|
|
307180
307180
|
}
|
|
307181
307181
|
//#endregion
|
|
307182
|
-
//#region
|
|
307182
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/plugin/manifest.ts
|
|
307183
307183
|
const BLUN_PLUGIN_ROOT_PATH = "blun.plugin.json";
|
|
307184
307184
|
const BLUN_PLUGIN_DIR_PATH = ".blun-plugin/plugin.json";
|
|
307185
307185
|
const UNSUPPORTED_RUNTIME_FIELDS = [
|
|
@@ -307708,7 +307708,7 @@ async function isDir(p) {
|
|
|
307708
307708
|
}
|
|
307709
307709
|
}
|
|
307710
307710
|
//#endregion
|
|
307711
|
-
//#region
|
|
307711
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/plugin/store.ts
|
|
307712
307712
|
const INSTALLED_REL = path.join("plugins", "installed.json");
|
|
307713
307713
|
const EMPTY = {
|
|
307714
307714
|
version: 1,
|
|
@@ -307740,7 +307740,7 @@ async function writeInstalled(blunHomeDir, data) {
|
|
|
307740
307740
|
await rename(tmp, final);
|
|
307741
307741
|
}
|
|
307742
307742
|
//#endregion
|
|
307743
|
-
//#region
|
|
307743
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/plugin/archive.ts
|
|
307744
307744
|
async function downloadZip(url, signal) {
|
|
307745
307745
|
const controller = new AbortController();
|
|
307746
307746
|
const timeoutHandle = setTimeout(() => {
|
|
@@ -307855,7 +307855,7 @@ async function isFile(p) {
|
|
|
307855
307855
|
}
|
|
307856
307856
|
}
|
|
307857
307857
|
//#endregion
|
|
307858
|
-
//#region
|
|
307858
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/plugin/github-resolver.ts
|
|
307859
307859
|
/**
|
|
307860
307860
|
* Resolve a `github` source descriptor to a downloadable zip URL.
|
|
307861
307861
|
*
|
|
@@ -307963,7 +307963,7 @@ function encodeCodeloadRefPath(value) {
|
|
|
307963
307963
|
return value.split("/").map(encodeURIComponent).join("/");
|
|
307964
307964
|
}
|
|
307965
307965
|
//#endregion
|
|
307966
|
-
//#region
|
|
307966
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/plugin/source.ts
|
|
307967
307967
|
const SHA_RE = /^[0-9a-f]{7,40}$/;
|
|
307968
307968
|
function resolveInstallSource(source) {
|
|
307969
307969
|
const trimmed = source.trim();
|
|
@@ -308053,7 +308053,7 @@ function decodeRefSegments(segments) {
|
|
|
308053
308053
|
}).join("/");
|
|
308054
308054
|
}
|
|
308055
308055
|
//#endregion
|
|
308056
|
-
//#region
|
|
308056
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/plugin/work.ts
|
|
308057
308057
|
const EFFECTS = [
|
|
308058
308058
|
"load",
|
|
308059
308059
|
"install",
|
|
@@ -308067,7 +308067,7 @@ function bindPluginWork(manager) {
|
|
|
308067
308067
|
for (const name of EFFECTS) bindHostEffectMethod(manager, manager, name, true, "work", `plugin:${name}`);
|
|
308068
308068
|
}
|
|
308069
308069
|
//#endregion
|
|
308070
|
-
//#region
|
|
308070
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/plugin/manager.ts
|
|
308071
308071
|
const BLUN_NODE_FALLBACK_SUBCOMMAND = "__plugin_run_node";
|
|
308072
308072
|
var PluginManager = class {
|
|
308073
308073
|
blunHomeDir;
|
|
@@ -337063,7 +337063,7 @@ var require_turndown_plugin_gfm_cjs = /* @__PURE__ */ __commonJSMin(((exports) =
|
|
|
337063
337063
|
exports.tables = tables;
|
|
337064
337064
|
}));
|
|
337065
337065
|
//#endregion
|
|
337066
|
-
//#region
|
|
337066
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/providers/html-to-research-markdown.ts
|
|
337067
337067
|
var import_turndown_cjs = /* @__PURE__ */ __toESM(require_turndown_cjs(), 1);
|
|
337068
337068
|
var import_turndown_plugin_gfm_cjs = require_turndown_plugin_gfm_cjs();
|
|
337069
337069
|
const parseHTML = parseHTML$1;
|
|
@@ -337185,7 +337185,7 @@ function htmlToResearchMarkdown(html, baseUrl) {
|
|
|
337185
337185
|
return root === null ? "" : renderRoot(root, title, safeBaseUrl);
|
|
337186
337186
|
}
|
|
337187
337187
|
//#endregion
|
|
337188
|
-
//#region
|
|
337188
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/providers/local-fetch-url.ts
|
|
337189
337189
|
/**
|
|
337190
337190
|
* LocalFetchURLProvider — host-side URL fetcher.
|
|
337191
337191
|
*
|
|
@@ -337284,7 +337284,7 @@ var LocalFetchURLProvider = class {
|
|
|
337284
337284
|
}
|
|
337285
337285
|
};
|
|
337286
337286
|
//#endregion
|
|
337287
|
-
//#region
|
|
337287
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/providers/blun-fetch-url.ts
|
|
337288
337288
|
/**
|
|
337289
337289
|
* BlunFetchURLProvider — host-side UrlFetcher.
|
|
337290
337290
|
*
|
|
@@ -337367,7 +337367,7 @@ var BlunFetchURLProvider = class {
|
|
|
337367
337367
|
}
|
|
337368
337368
|
};
|
|
337369
337369
|
//#endregion
|
|
337370
|
-
//#region
|
|
337370
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/providers/blun-web-search.ts
|
|
337371
337371
|
var BlunWebSearchProvider = class {
|
|
337372
337372
|
tokenProvider;
|
|
337373
337373
|
apiKey;
|
|
@@ -337463,7 +337463,7 @@ async function safeReadText(response) {
|
|
|
337463
337463
|
}
|
|
337464
337464
|
}
|
|
337465
337465
|
//#endregion
|
|
337466
|
-
//#region
|
|
337466
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/tools/providers/blun-media.ts
|
|
337467
337467
|
var BlunMediaService = class {
|
|
337468
337468
|
tokenProvider;
|
|
337469
337469
|
apiKey;
|
|
@@ -337640,7 +337640,7 @@ async function assertSuccess(response, operation) {
|
|
|
337640
337640
|
throw new Error(`${operation} failed: HTTP ${String(response.status)}${detail ? `: ${detail}` : ""}`);
|
|
337641
337641
|
}
|
|
337642
337642
|
//#endregion
|
|
337643
|
-
//#region
|
|
337643
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/replay/build.ts
|
|
337644
337644
|
async function buildReplay(persistence, range) {
|
|
337645
337645
|
const agent = new Agent$1({
|
|
337646
337646
|
kaos: await LocalKaos.create(),
|
|
@@ -337658,7 +337658,7 @@ async function buildReplay(persistence, range) {
|
|
|
337658
337658
|
return agent.replayBuilder.buildResult();
|
|
337659
337659
|
}
|
|
337660
337660
|
//#endregion
|
|
337661
|
-
//#region
|
|
337661
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/agent/replay/pages.ts
|
|
337662
337662
|
function replayPageLimit(limit = 200) {
|
|
337663
337663
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 2e3) throw new Error("Invalid replay page limit");
|
|
337664
337664
|
return limit;
|
|
@@ -337729,7 +337729,7 @@ var ReplayPages = class {
|
|
|
337729
337729
|
}
|
|
337730
337730
|
};
|
|
337731
337731
|
//#endregion
|
|
337732
|
-
//#region
|
|
337732
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/export/manifest.ts
|
|
337733
337733
|
const WIRE_PROTOCOL_VERSION = "1.4";
|
|
337734
337734
|
function buildExportManifest(args) {
|
|
337735
337735
|
return {
|
|
@@ -337750,7 +337750,7 @@ function buildExportManifest(args) {
|
|
|
337750
337750
|
};
|
|
337751
337751
|
}
|
|
337752
337752
|
//#endregion
|
|
337753
|
-
//#region
|
|
337753
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/export/wire-scan.ts
|
|
337754
337754
|
async function scanSessionWire(sessionDir) {
|
|
337755
337755
|
let raw;
|
|
337756
337756
|
try {
|
|
@@ -338088,7 +338088,7 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
338088
338088
|
module.exports = /* @__PURE__ */ getDefaultExportFromCjs(crc32);
|
|
338089
338089
|
}));
|
|
338090
338090
|
//#endregion
|
|
338091
|
-
//#region
|
|
338091
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/export/zip.ts
|
|
338092
338092
|
var import_yazl = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
338093
338093
|
var fs$1 = __require("fs");
|
|
338094
338094
|
var Transform = __require("stream").Transform;
|
|
@@ -338696,7 +338696,7 @@ async function writeExportZip(args) {
|
|
|
338696
338696
|
return entries;
|
|
338697
338697
|
}
|
|
338698
338698
|
//#endregion
|
|
338699
|
-
//#region
|
|
338699
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/export/session-export.ts
|
|
338700
338700
|
const SESSION_LOG_REL = "logs/blun.log";
|
|
338701
338701
|
const GLOBAL_LOG_REL = "logs/global/blun.log";
|
|
338702
338702
|
async function exportSessionDirectory(input) {
|
|
@@ -338753,7 +338753,7 @@ async function readOptionalFile(path) {
|
|
|
338753
338753
|
}
|
|
338754
338754
|
}
|
|
338755
338755
|
//#endregion
|
|
338756
|
-
//#region
|
|
338756
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/provider-manager.ts
|
|
338757
338757
|
const MANAGED_PROVIDER_NAME$2 = "managed:blun";
|
|
338758
338758
|
const MANAGED_BLUN_MODEL_ALIASES = new Set(["blun/king", "king-blun"]);
|
|
338759
338759
|
var ProviderManager = class {
|
|
@@ -338933,7 +338933,7 @@ function nonEmptyString$1(value) {
|
|
|
338933
338933
|
return trimmed === void 0 || trimmed.length === 0 ? void 0 : trimmed;
|
|
338934
338934
|
}
|
|
338935
338935
|
//#endregion
|
|
338936
|
-
//#region
|
|
338936
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/managed-api-key-revocation.ts
|
|
338937
338937
|
const MANAGED_PROVIDER_NAME$1 = "managed:blun";
|
|
338938
338938
|
const REVOCATION_DIRECTORY = "managed-api-key-revocations";
|
|
338939
338939
|
const unpersistedRevocations = /* @__PURE__ */ new Set();
|
|
@@ -338993,7 +338993,7 @@ function managedApiKeyFingerprint(apiKey) {
|
|
|
338993
338993
|
return createHash("sha256").update(`${MANAGED_PROVIDER_NAME$1}\0${apiKey.trim()}`).digest("hex");
|
|
338994
338994
|
}
|
|
338995
338995
|
//#endregion
|
|
338996
|
-
//#region
|
|
338996
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/rpc-work.ts
|
|
338997
338997
|
const SESSION_RPC_WORK = {
|
|
338998
338998
|
prompt: "work",
|
|
338999
338999
|
promptAccepted: "work",
|
|
@@ -339075,7 +339075,7 @@ function bindSessionRpcWork(methods, session) {
|
|
|
339075
339075
|
}
|
|
339076
339076
|
}
|
|
339077
339077
|
//#endregion
|
|
339078
|
-
//#region
|
|
339078
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/prompt-metadata.ts
|
|
339079
339079
|
const MAX_TITLE_LENGTH = 200;
|
|
339080
339080
|
const MAX_LAST_PROMPT_LENGTH = 4e3;
|
|
339081
339081
|
function titleFromPromptMetadataText(text) {
|
|
@@ -339116,7 +339116,7 @@ function sanitizeAndTruncatePromptText(text, maxLength) {
|
|
|
339116
339116
|
return sanitized.slice(0, maxLength);
|
|
339117
339117
|
}
|
|
339118
339118
|
//#endregion
|
|
339119
|
-
//#region
|
|
339119
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/rpc.ts
|
|
339120
339120
|
var SessionAPIImpl = class {
|
|
339121
339121
|
session;
|
|
339122
339122
|
constructor(session) {
|
|
@@ -339411,7 +339411,7 @@ function hasCustomTitle(metadata) {
|
|
|
339411
339411
|
return typeof metadata.customTitle === "string";
|
|
339412
339412
|
}
|
|
339413
339413
|
//#endregion
|
|
339414
|
-
//#region
|
|
339414
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/store/session-index.ts
|
|
339415
339415
|
function sessionIndexPath(homeDir) {
|
|
339416
339416
|
return join$1(homeDir, "session_index.jsonl");
|
|
339417
339417
|
}
|
|
@@ -339469,14 +339469,14 @@ function isPathInside(parent, child) {
|
|
|
339469
339469
|
return rel !== "" && !rel.startsWith("..") && !isAbsolute$1(rel);
|
|
339470
339470
|
}
|
|
339471
339471
|
//#endregion
|
|
339472
|
-
//#region
|
|
339472
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/utils/workdir-slug.ts
|
|
339473
339473
|
const MAX_WORKDIR_SLUG_LENGTH = 40;
|
|
339474
339474
|
function slugifyWorkDirName(name) {
|
|
339475
339475
|
const slug = name.toLowerCase().replaceAll(/[^a-z0-9._-]+/g, "-").replaceAll(/^-+|-+$/g, "").slice(0, MAX_WORKDIR_SLUG_LENGTH).replaceAll(/^-+|-+$/g, "");
|
|
339476
339476
|
return slug === "" || slug === "." || slug === ".." ? "workspace" : slug;
|
|
339477
339477
|
}
|
|
339478
339478
|
//#endregion
|
|
339479
|
-
//#region
|
|
339479
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/store/workdir-key.ts
|
|
339480
339480
|
const WORKDIR_KEY_PREFIX = "wd_";
|
|
339481
339481
|
const HASH_LENGTH = 12;
|
|
339482
339482
|
function normalizeWorkDir(workDir) {
|
|
@@ -339487,7 +339487,7 @@ function encodeWorkDirKey(workDir) {
|
|
|
339487
339487
|
return `${WORKDIR_KEY_PREFIX}${slugifyWorkDirName(basename$1(normalized))}_${createHash("sha256").update(normalized).digest("hex").slice(0, HASH_LENGTH)}`;
|
|
339488
339488
|
}
|
|
339489
339489
|
//#endregion
|
|
339490
|
-
//#region
|
|
339490
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/session/store/session-store.ts
|
|
339491
339491
|
const SessionSummaryStateSchema = object({
|
|
339492
339492
|
archived: boolean$1().optional(),
|
|
339493
339493
|
customTitle: string().optional(),
|
|
@@ -339891,7 +339891,7 @@ function compareSessionSummary(a, b) {
|
|
|
339891
339891
|
return 0;
|
|
339892
339892
|
}
|
|
339893
339893
|
//#endregion
|
|
339894
|
-
//#region
|
|
339894
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/rpc/core-work.ts
|
|
339895
339895
|
const CORE_RPC_WORK = {
|
|
339896
339896
|
...SESSION_RPC_WORK,
|
|
339897
339897
|
getSessionWarnings: "work",
|
|
@@ -339928,7 +339928,7 @@ function bindCoreWork(core) {
|
|
|
339928
339928
|
for (const name of ["createSessionWithOverrides", "resumeSessionWithOverrides"]) bindHostEffectMethod(core, core, name, true, "work", `core:${name}`);
|
|
339929
339929
|
}
|
|
339930
339930
|
//#endregion
|
|
339931
|
-
//#region
|
|
339931
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/rpc/idle-admission.ts
|
|
339932
339932
|
/** The Core session map stays authoritative; receipts identify native construction only. */
|
|
339933
339933
|
var CoreIdleAdmission = class {
|
|
339934
339934
|
core;
|
|
@@ -339998,7 +339998,7 @@ var CoreIdleAdmission = class {
|
|
|
339998
339998
|
}
|
|
339999
339999
|
};
|
|
340000
340000
|
//#endregion
|
|
340001
|
-
//#region
|
|
340001
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/rpc/config-idle-admission.ts
|
|
340002
340002
|
/** Extend the actual Core reservation with the same native claim used by config writes. */
|
|
340003
340003
|
async function reserveCoreConfiguration(core, configState) {
|
|
340004
340004
|
const local = core.tryReserveIdleAdmission();
|
|
@@ -340054,7 +340054,7 @@ async function reserveCoreConfiguration(core, configState) {
|
|
|
340054
340054
|
}
|
|
340055
340055
|
}
|
|
340056
340056
|
//#endregion
|
|
340057
|
-
//#region
|
|
340057
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/rpc/core-impl.ts
|
|
340058
340058
|
const BLUN_PROVIDER_NAME = "managed:blun";
|
|
340059
340059
|
const BLUN_BASE_URL_ENV = "BLUN_BASE_URL";
|
|
340060
340060
|
const BLUN_OAUTH_HOST_ENV = "BLUN_OAUTH_HOST";
|
|
@@ -341182,7 +341182,7 @@ function parsePositiveInt(value) {
|
|
|
341182
341182
|
return n;
|
|
341183
341183
|
}
|
|
341184
341184
|
//#endregion
|
|
341185
|
-
//#region
|
|
341185
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/di/instantiation.ts
|
|
341186
341186
|
let _util;
|
|
341187
341187
|
(function(_util2) {
|
|
341188
341188
|
_util2.serviceIds = /* @__PURE__ */ new Map();
|
|
@@ -341227,7 +341227,7 @@ function createDecorator(name) {
|
|
|
341227
341227
|
}
|
|
341228
341228
|
const IInstantiationService = createDecorator("instantiationService");
|
|
341229
341229
|
//#endregion
|
|
341230
|
-
//#region
|
|
341230
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/di/descriptors.ts
|
|
341231
341231
|
/**
|
|
341232
341232
|
* Service descriptors: a `SyncDescriptor` packages a constructor + static
|
|
341233
341233
|
* args for later instantiation by the container. Modelled after VSCode's
|
|
@@ -341249,7 +341249,7 @@ var SyncDescriptor = class {
|
|
|
341249
341249
|
}
|
|
341250
341250
|
};
|
|
341251
341251
|
//#endregion
|
|
341252
|
-
//#region
|
|
341252
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/di/lifecycle.ts
|
|
341253
341253
|
let disposableTracker = null;
|
|
341254
341254
|
function trackDisposable(x) {
|
|
341255
341255
|
disposableTracker?.trackDisposable(x);
|
|
@@ -341527,7 +341527,7 @@ var DisposableMap = class {
|
|
|
341527
341527
|
}
|
|
341528
341528
|
});
|
|
341529
341529
|
//#endregion
|
|
341530
|
-
//#region
|
|
341530
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/di/extensions.ts
|
|
341531
341531
|
/**
|
|
341532
341532
|
* Module-global service registry. Modules (or top-level files) register their
|
|
341533
341533
|
* service implementations at import-time via `registerSingleton`; the daemon
|
|
@@ -341549,7 +341549,7 @@ function registerSingleton(id, ctorOrDescriptor, instantiationType) {
|
|
|
341549
341549
|
_registry.push([id, descriptor]);
|
|
341550
341550
|
}
|
|
341551
341551
|
//#endregion
|
|
341552
|
-
//#region
|
|
341552
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/base/common/event.ts
|
|
341553
341553
|
var Emitter = class {
|
|
341554
341554
|
_listeners;
|
|
341555
341555
|
_disposed = false;
|
|
@@ -341634,7 +341634,7 @@ let Event$1;
|
|
|
341634
341634
|
_Event.any = any;
|
|
341635
341635
|
})(Event$1 || (Event$1 = {}));
|
|
341636
341636
|
//#endregion
|
|
341637
|
-
//#region
|
|
341637
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/coreProcess/coreProcessClient.ts
|
|
341638
341638
|
var BridgeClientAPI = class {
|
|
341639
341639
|
deps;
|
|
341640
341640
|
constructor(deps) {
|
|
@@ -341663,7 +341663,7 @@ var BridgeClientAPI = class {
|
|
|
341663
341663
|
}
|
|
341664
341664
|
};
|
|
341665
341665
|
//#endregion
|
|
341666
|
-
//#region
|
|
341666
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/coreProcess/coreProcess.ts
|
|
341667
341667
|
/**
|
|
341668
341668
|
* `CoreProcessService` — the in-process RPC adapter owned by the services
|
|
341669
341669
|
* package. Internally:
|
|
@@ -341696,7 +341696,7 @@ var BridgeClientAPI = class {
|
|
|
341696
341696
|
*/
|
|
341697
341697
|
const ICoreProcessService = createDecorator("coreProcessService");
|
|
341698
341698
|
//#endregion
|
|
341699
|
-
//#region
|
|
341699
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/auth/managedAuth.ts
|
|
341700
341700
|
var ServicesManagedAuthFacade = class {
|
|
341701
341701
|
options;
|
|
341702
341702
|
toolkit;
|
|
@@ -341784,7 +341784,7 @@ function createManagedAuthFacade(env) {
|
|
|
341784
341784
|
return new ServicesManagedAuthFacade(env);
|
|
341785
341785
|
}
|
|
341786
341786
|
//#endregion
|
|
341787
|
-
//#region
|
|
341787
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/approval/approval.ts
|
|
341788
341788
|
/**
|
|
341789
341789
|
* Approval service interface + protocol adapter.
|
|
341790
341790
|
*
|
|
@@ -341839,7 +341839,7 @@ function createManagedAuthFacade(env) {
|
|
|
341839
341839
|
*/
|
|
341840
341840
|
const IApprovalService = createDecorator("approvalService");
|
|
341841
341841
|
//#endregion
|
|
341842
|
-
//#region
|
|
341842
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/environment/environment.ts
|
|
341843
341843
|
/**
|
|
341844
341844
|
* `IEnvironmentService` — canonical source for resolved filesystem paths
|
|
341845
341845
|
* (home directory, config file, etc.) used by the daemon and in-process
|
|
@@ -341851,7 +341851,7 @@ const IApprovalService = createDecorator("approvalService");
|
|
|
341851
341851
|
*/
|
|
341852
341852
|
const IEnvironmentService = createDecorator("environmentService");
|
|
341853
341853
|
//#endregion
|
|
341854
|
-
//#region
|
|
341854
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/event/event.ts
|
|
341855
341855
|
/**
|
|
341856
341856
|
* `IEventService` — in-process pub-sub bus that fans out `Event`s coming out of
|
|
341857
341857
|
* `BlunCore` (and synthetic events from daemon-side services) to all
|
|
@@ -341880,10 +341880,10 @@ const IEnvironmentService = createDecorator("environmentService");
|
|
|
341880
341880
|
*/
|
|
341881
341881
|
const IEventService = createDecorator("eventService");
|
|
341882
341882
|
//#endregion
|
|
341883
|
-
//#region
|
|
341883
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/logger/logger.ts
|
|
341884
341884
|
const ILogService = createDecorator("logService");
|
|
341885
341885
|
//#endregion
|
|
341886
|
-
//#region
|
|
341886
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/question/question.ts
|
|
341887
341887
|
/**
|
|
341888
341888
|
* Question service interface + protocol adapter.
|
|
341889
341889
|
*
|
|
@@ -341947,7 +341947,7 @@ function __decorate(decorators, target, key, desc) {
|
|
|
341947
341947
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
341948
341948
|
}
|
|
341949
341949
|
//#endregion
|
|
341950
|
-
//#region
|
|
341950
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/coreProcess/coreProcessService.ts
|
|
341951
341951
|
/**
|
|
341952
341952
|
* `CoreProcessService` — implementation of `ICoreProcessService`.
|
|
341953
341953
|
*/
|
|
@@ -342076,7 +342076,7 @@ CoreProcessService = _CoreProcessService = __decorate([
|
|
|
342076
342076
|
], CoreProcessService);
|
|
342077
342077
|
registerSingleton(ICoreProcessService, new SyncDescriptor(CoreProcessService, [{}], false));
|
|
342078
342078
|
//#endregion
|
|
342079
|
-
//#region
|
|
342079
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/event/eventService.ts
|
|
342080
342080
|
/**
|
|
342081
342081
|
* `EventService` — implementation of `IEventService`.
|
|
342082
342082
|
*
|
|
@@ -342107,7 +342107,7 @@ var EventService = class extends Disposable {
|
|
|
342107
342107
|
};
|
|
342108
342108
|
registerSingleton(IEventService, EventService, 1);
|
|
342109
342109
|
//#endregion
|
|
342110
|
-
//#region
|
|
342110
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/fileStore/fileStore.ts
|
|
342111
342111
|
const DEFAULT_MAX_UPLOAD_BYTES = 50 * 1024 * 1024;
|
|
342112
342112
|
var FileNotFoundError = class extends Error {
|
|
342113
342113
|
fileId;
|
|
@@ -342129,7 +342129,7 @@ var FileTooLargeError = class extends Error {
|
|
|
342129
342129
|
};
|
|
342130
342130
|
const IFileStore = createDecorator("fileStore");
|
|
342131
342131
|
//#endregion
|
|
342132
|
-
//#region
|
|
342132
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/fileStore/fileStoreService.ts
|
|
342133
342133
|
let FileStore = class FileStore extends Disposable {
|
|
342134
342134
|
logger;
|
|
342135
342135
|
_serviceBrand;
|
|
@@ -342268,7 +342268,7 @@ let FileStore = class FileStore extends Disposable {
|
|
|
342268
342268
|
FileStore = __decorate([__decorateParam(0, IEnvironmentService), __decorateParam(1, ILogService)], FileStore);
|
|
342269
342269
|
registerSingleton(IFileStore, FileStore, 1);
|
|
342270
342270
|
//#endregion
|
|
342271
|
-
//#region
|
|
342271
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/fs/fs.ts
|
|
342272
342272
|
var FsPathNotFoundError = class extends Error {
|
|
342273
342273
|
inputPath;
|
|
342274
342274
|
constructor(inputPath) {
|
|
@@ -342323,7 +342323,7 @@ var FsAlreadyExistsError = class extends Error {
|
|
|
342323
342323
|
};
|
|
342324
342324
|
const IFsService = createDecorator("fsService");
|
|
342325
342325
|
//#endregion
|
|
342326
|
-
//#region
|
|
342326
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/session/session.ts
|
|
342327
342327
|
var import_ignore = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
342328
342328
|
function makeArray(subject) {
|
|
342329
342329
|
return Array.isArray(subject) ? subject : [subject];
|
|
@@ -342556,7 +342556,7 @@ function toProtocolSession(summary, meta) {
|
|
|
342556
342556
|
};
|
|
342557
342557
|
}
|
|
342558
342558
|
//#endregion
|
|
342559
|
-
//#region
|
|
342559
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/fs/fsPathSafety.ts
|
|
342560
342560
|
var FsPathEscapesError = class extends Error {
|
|
342561
342561
|
inputPath;
|
|
342562
342562
|
reason;
|
|
@@ -342611,7 +342611,7 @@ function toPosixRelative$1(cwd, absolute) {
|
|
|
342611
342611
|
return rel.split(path.sep).join("/");
|
|
342612
342612
|
}
|
|
342613
342613
|
//#endregion
|
|
342614
|
-
//#region
|
|
342614
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/fs/fsService.ts
|
|
342615
342615
|
const FS_READ_MAX_BYTES = 10 * 1024 * 1024;
|
|
342616
342616
|
const FS_BINARY_SAMPLE_BYTES = 4096;
|
|
342617
342617
|
const FS_BINARY_NONPRINTABLE_FRACTION = .3;
|
|
@@ -343081,7 +343081,7 @@ function mapToWireError(err) {
|
|
|
343081
343081
|
}
|
|
343082
343082
|
registerSingleton(IFsService, FsService, 1);
|
|
343083
343083
|
//#endregion
|
|
343084
|
-
//#region
|
|
343084
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/fs/fsSearch.ts
|
|
343085
343085
|
var FsGrepTimeoutError = class extends Error {
|
|
343086
343086
|
elapsedMs;
|
|
343087
343087
|
constructor(elapsedMs) {
|
|
@@ -343092,7 +343092,7 @@ var FsGrepTimeoutError = class extends Error {
|
|
|
343092
343092
|
};
|
|
343093
343093
|
const IFsSearchService = createDecorator("fsSearchService");
|
|
343094
343094
|
//#endregion
|
|
343095
|
-
//#region
|
|
343095
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/fs/fsSearchService.ts
|
|
343096
343096
|
const SEARCH_HARD_CAP = 500;
|
|
343097
343097
|
const GREP_TIMEOUT_MS = 3e4;
|
|
343098
343098
|
const WALK_MAX_DEPTH = 64;
|
|
@@ -343542,7 +343542,7 @@ async function whichBinary(name) {
|
|
|
343542
343542
|
}
|
|
343543
343543
|
registerSingleton(IFsSearchService, new SyncDescriptor(FsSearchService, [noopTelemetryClient], true));
|
|
343544
343544
|
//#endregion
|
|
343545
|
-
//#region
|
|
343545
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/fs/fsGit.ts
|
|
343546
343546
|
var FsGitUnavailableError = class extends Error {
|
|
343547
343547
|
cwd;
|
|
343548
343548
|
detail;
|
|
@@ -343649,7 +343649,7 @@ function posix$1(p) {
|
|
|
343649
343649
|
return p.split(path.sep).join("/");
|
|
343650
343650
|
}
|
|
343651
343651
|
//#endregion
|
|
343652
|
-
//#region
|
|
343652
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/fs/fsGitService.ts
|
|
343653
343653
|
/** Cap a single file's unified diff (a runaway generated file should not blow
|
|
343654
343654
|
up the envelope); the response carries `truncated` so the UI can say so. */
|
|
343655
343655
|
const DIFF_MAX_BYTES = 1048576;
|
|
@@ -343909,7 +343909,7 @@ function hasControlChars(value) {
|
|
|
343909
343909
|
}
|
|
343910
343910
|
registerSingleton(IFsGitService, FsGitService, 1);
|
|
343911
343911
|
//#endregion
|
|
343912
|
-
//#region
|
|
343912
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/fs/fsWatcher.ts
|
|
343913
343913
|
var FsWatchLimitError = class extends Error {
|
|
343914
343914
|
connectionId;
|
|
343915
343915
|
attempted;
|
|
@@ -345454,7 +345454,7 @@ var FSWatcher = class extends EventEmitter {
|
|
|
345454
345454
|
}
|
|
345455
345455
|
};
|
|
345456
345456
|
//#endregion
|
|
345457
|
-
//#region
|
|
345457
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/fs/fsWatcherService.ts
|
|
345458
345458
|
const DEFAULT_DEBOUNCE_MS = 200;
|
|
345459
345459
|
const DEFAULT_MAX_CHANGES_PER_WINDOW = 500;
|
|
345460
345460
|
const DEFAULT_MAX_PATHS_PER_CONNECTION = 100;
|
|
@@ -345782,7 +345782,7 @@ function deriveSharedCwd(absPaths) {
|
|
|
345782
345782
|
return prefix.length === 0 ? "/" : prefix.join(path.sep) || path.sep;
|
|
345783
345783
|
}
|
|
345784
345784
|
//#endregion
|
|
345785
|
-
//#region
|
|
345785
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/workspace/workspaceRegistry.ts
|
|
345786
345786
|
var WorkspaceNotFoundError = class extends Error {
|
|
345787
345787
|
workspaceId;
|
|
345788
345788
|
constructor(workspaceId) {
|
|
@@ -345801,7 +345801,7 @@ var WorkspaceRootNotFoundError = class extends Error {
|
|
|
345801
345801
|
};
|
|
345802
345802
|
const IWorkspaceRegistry = createDecorator("workspaceRegistry");
|
|
345803
345803
|
//#endregion
|
|
345804
|
-
//#region
|
|
345804
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/workspace/workspaceRegistryService.ts
|
|
345805
345805
|
const WORKSPACE_REGISTRY_FILE = "workspaces.json";
|
|
345806
345806
|
const WORKSPACE_REGISTRY_VERSION = 1;
|
|
345807
345807
|
let WorkspaceRegistryService = class WorkspaceRegistryService extends Disposable {
|
|
@@ -346168,7 +346168,7 @@ async function isSessionArchived(sessionDir) {
|
|
|
346168
346168
|
}
|
|
346169
346169
|
registerSingleton(IWorkspaceRegistry, WorkspaceRegistryService, 1);
|
|
346170
346170
|
//#endregion
|
|
346171
|
-
//#region
|
|
346171
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/workspace/workspaceFs.ts
|
|
346172
346172
|
var WorkspaceFsNotAbsoluteError = class extends Error {
|
|
346173
346173
|
path;
|
|
346174
346174
|
constructor(path) {
|
|
@@ -346195,7 +346195,7 @@ var WorkspaceFsPermissionError = class extends Error {
|
|
|
346195
346195
|
};
|
|
346196
346196
|
const IWorkspaceFsService = createDecorator("workspaceFsService");
|
|
346197
346197
|
//#endregion
|
|
346198
|
-
//#region
|
|
346198
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/workspace/workspaceFsService.ts
|
|
346199
346199
|
let WorkspaceFsService = class WorkspaceFsService extends Disposable {
|
|
346200
346200
|
registry;
|
|
346201
346201
|
_serviceBrand;
|
|
@@ -346267,7 +346267,7 @@ function compareBrowseEntries(a, b) {
|
|
|
346267
346267
|
}
|
|
346268
346268
|
registerSingleton(IWorkspaceFsService, WorkspaceFsService, 1);
|
|
346269
346269
|
//#endregion
|
|
346270
|
-
//#region
|
|
346270
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/authSummary/authSummary.ts
|
|
346271
346271
|
/**
|
|
346272
346272
|
* `IAuthSummaryService` — daemon-facing readiness probe.
|
|
346273
346273
|
*
|
|
@@ -346346,7 +346346,7 @@ var AuthModelNotResolvedError = class extends Error {
|
|
|
346346
346346
|
}
|
|
346347
346347
|
};
|
|
346348
346348
|
//#endregion
|
|
346349
|
-
//#region
|
|
346349
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/authSummary/authSummaryService.ts
|
|
346350
346350
|
/**
|
|
346351
346351
|
* `AuthSummaryService` — implementation of `IAuthSummaryService`.
|
|
346352
346352
|
*/
|
|
@@ -346457,7 +346457,7 @@ function nonEmpty$3(value) {
|
|
|
346457
346457
|
}
|
|
346458
346458
|
registerSingleton(IAuthSummaryService, AuthSummaryService, 1);
|
|
346459
346459
|
//#endregion
|
|
346460
|
-
//#region
|
|
346460
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/oauth/oauth.ts
|
|
346461
346461
|
/**
|
|
346462
346462
|
* `IOAuthService` — daemon-facing device-code login orchestration.
|
|
346463
346463
|
*
|
|
@@ -346523,7 +346523,7 @@ registerSingleton(IAuthSummaryService, AuthSummaryService, 1);
|
|
|
346523
346523
|
*/
|
|
346524
346524
|
const IOAuthService = createDecorator("oauthService");
|
|
346525
346525
|
//#endregion
|
|
346526
|
-
//#region
|
|
346526
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/oauth/oauthService.ts
|
|
346527
346527
|
/**
|
|
346528
346528
|
* `OAuthService` — implementation of `IOAuthService`.
|
|
346529
346529
|
*/
|
|
@@ -346741,7 +346741,7 @@ function classifyFailure(err) {
|
|
|
346741
346741
|
}
|
|
346742
346742
|
registerSingleton(IOAuthService, OAuthService, 1);
|
|
346743
346743
|
//#endregion
|
|
346744
|
-
//#region
|
|
346744
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/modelCatalog/modelCatalog.ts
|
|
346745
346745
|
const IModelCatalogService = createDecorator("modelCatalogService");
|
|
346746
346746
|
var ProviderNotFoundError = class extends Error {
|
|
346747
346747
|
providerId;
|
|
@@ -346794,7 +346794,7 @@ function globalDefaultForProvider(config, providerId) {
|
|
|
346794
346794
|
return (config.models?.[defaultModel])?.provider === providerId ? defaultModel : void 0;
|
|
346795
346795
|
}
|
|
346796
346796
|
//#endregion
|
|
346797
|
-
//#region
|
|
346797
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/modelCatalog/modelCatalogService.ts
|
|
346798
346798
|
var _ModelCatalogService;
|
|
346799
346799
|
let ModelCatalogService = _ModelCatalogService = class ModelCatalogService extends Disposable {
|
|
346800
346800
|
core;
|
|
@@ -346932,10 +346932,10 @@ const noopEventService = {
|
|
|
346932
346932
|
};
|
|
346933
346933
|
registerSingleton(IModelCatalogService, ModelCatalogService, 1);
|
|
346934
346934
|
//#endregion
|
|
346935
|
-
//#region
|
|
346935
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/config/config.ts
|
|
346936
346936
|
const IConfigService = createDecorator("configService");
|
|
346937
346937
|
//#endregion
|
|
346938
|
-
//#region
|
|
346938
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/config/configService.ts
|
|
346939
346939
|
let ConfigService = class ConfigService extends Disposable {
|
|
346940
346940
|
core;
|
|
346941
346941
|
eventService;
|
|
@@ -347016,7 +347016,7 @@ function snakeToCamel(str) {
|
|
|
347016
347016
|
}
|
|
347017
347017
|
registerSingleton(IConfigService, ConfigService, 1);
|
|
347018
347018
|
//#endregion
|
|
347019
|
-
//#region
|
|
347019
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/message/message.ts
|
|
347020
347020
|
/**
|
|
347021
347021
|
* `IMessageService` — daemon-facing message history interface.
|
|
347022
347022
|
*
|
|
@@ -347215,7 +347215,7 @@ function toProtocolMessage(sessionId, index, msg, sessionCreatedAtMs, createdAtM
|
|
|
347215
347215
|
};
|
|
347216
347216
|
}
|
|
347217
347217
|
//#endregion
|
|
347218
|
-
//#region
|
|
347218
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/prompt/prompt.ts
|
|
347219
347219
|
/**
|
|
347220
347220
|
* `PromptService` — adapter between the protocol-shaped REST surface and
|
|
347221
347221
|
* agent-core's `prompt` / `steer` / `cancel` RPC.
|
|
@@ -347313,7 +347313,7 @@ var PromptAlreadyCompletedError = class extends Error {
|
|
|
347313
347313
|
}
|
|
347314
347314
|
};
|
|
347315
347315
|
//#endregion
|
|
347316
|
-
//#region
|
|
347316
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/session/sessionService.ts
|
|
347317
347317
|
const DEFAULT_PAGE_SIZE$1 = 20;
|
|
347318
347318
|
const MAX_PAGE_SIZE$1 = 100;
|
|
347319
347319
|
const DEFAULT_UNDO_MESSAGE_PAGE_SIZE = 50;
|
|
@@ -347715,7 +347715,7 @@ SessionService = __decorate([
|
|
|
347715
347715
|
], SessionService);
|
|
347716
347716
|
registerSingleton(ISessionService, SessionService, 1);
|
|
347717
347717
|
//#endregion
|
|
347718
|
-
//#region
|
|
347718
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/message/transcript.ts
|
|
347719
347719
|
/**
|
|
347720
347720
|
* Wire-transcript reader — rebuilds the FULL message history of a session
|
|
347721
347721
|
* agent from its `wire.jsonl` record log.
|
|
@@ -348096,7 +348096,7 @@ async function resolveBlobRef(url, blobsDir, cache) {
|
|
|
348096
348096
|
return resolved;
|
|
348097
348097
|
}
|
|
348098
348098
|
//#endregion
|
|
348099
|
-
//#region
|
|
348099
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/message/messageService.ts
|
|
348100
348100
|
/**
|
|
348101
348101
|
* `MessageService` — implementation of `IMessageService`.
|
|
348102
348102
|
*
|
|
@@ -348242,7 +348242,7 @@ let MessageService = class MessageService extends Disposable {
|
|
|
348242
348242
|
MessageService = __decorate([__decorateParam(0, ICoreProcessService)], MessageService);
|
|
348243
348243
|
registerSingleton(IMessageService, MessageService, 1);
|
|
348244
348244
|
//#endregion
|
|
348245
|
-
//#region
|
|
348245
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/prompt/promptService.ts
|
|
348246
348246
|
/**
|
|
348247
348247
|
* `PromptService` — implementation of `IPromptService`.
|
|
348248
348248
|
*/
|
|
@@ -348976,7 +348976,7 @@ PromptService = __decorate([
|
|
|
348976
348976
|
], PromptService);
|
|
348977
348977
|
registerSingleton(IPromptService, PromptService, 1);
|
|
348978
348978
|
//#endregion
|
|
348979
|
-
//#region
|
|
348979
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/tool/tool.ts
|
|
348980
348980
|
/**
|
|
348981
348981
|
* `IToolService` — daemon-facing read-only tool surface.
|
|
348982
348982
|
*
|
|
@@ -349034,7 +349034,7 @@ function toProtocolTool(info) {
|
|
|
349034
349034
|
}
|
|
349035
349035
|
const IToolService = createDecorator("toolService");
|
|
349036
349036
|
//#endregion
|
|
349037
|
-
//#region
|
|
349037
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/tool/toolService.ts
|
|
349038
349038
|
/**
|
|
349039
349039
|
* `ToolService` — implementation of `IToolService`.
|
|
349040
349040
|
*/
|
|
@@ -349074,7 +349074,7 @@ let ToolService = class ToolService extends Disposable {
|
|
|
349074
349074
|
ToolService = __decorate([__decorateParam(0, ICoreProcessService)], ToolService);
|
|
349075
349075
|
registerSingleton(IToolService, ToolService, 1);
|
|
349076
349076
|
//#endregion
|
|
349077
|
-
//#region
|
|
349077
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/mcp/mcp.ts
|
|
349078
349078
|
/**
|
|
349079
349079
|
* `IMcpService` — daemon-facing MCP server surface.
|
|
349080
349080
|
*
|
|
@@ -349154,7 +349154,7 @@ var McpServerNotFoundError = class extends Error {
|
|
|
349154
349154
|
}
|
|
349155
349155
|
};
|
|
349156
349156
|
//#endregion
|
|
349157
|
-
//#region
|
|
349157
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/mcp/mcpService.ts
|
|
349158
349158
|
/**
|
|
349159
349159
|
* `McpService` — implementation of `IMcpService`.
|
|
349160
349160
|
*/
|
|
@@ -349193,7 +349193,7 @@ let McpService = class McpService extends Disposable {
|
|
|
349193
349193
|
McpService = __decorate([__decorateParam(0, ICoreProcessService)], McpService);
|
|
349194
349194
|
registerSingleton(IMcpService, McpService, 1);
|
|
349195
349195
|
//#endregion
|
|
349196
|
-
//#region
|
|
349196
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/skill/skill.ts
|
|
349197
349197
|
/**
|
|
349198
349198
|
* `ISkillService` — daemon-facing skill surface.
|
|
349199
349199
|
*
|
|
@@ -349263,7 +349263,7 @@ var SkillNotActivatableError = class extends Error {
|
|
|
349263
349263
|
}
|
|
349264
349264
|
};
|
|
349265
349265
|
//#endregion
|
|
349266
|
-
//#region
|
|
349266
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/skill/skillService.ts
|
|
349267
349267
|
/**
|
|
349268
349268
|
* `SkillService` — implementation of `ISkillService`.
|
|
349269
349269
|
*/
|
|
@@ -349311,7 +349311,7 @@ let SkillService = class SkillService extends Disposable {
|
|
|
349311
349311
|
SkillService = __decorate([__decorateParam(0, ICoreProcessService)], SkillService);
|
|
349312
349312
|
registerSingleton(ISkillService, SkillService, 1);
|
|
349313
349313
|
//#endregion
|
|
349314
|
-
//#region
|
|
349314
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/task/task.ts
|
|
349315
349315
|
/**
|
|
349316
349316
|
* `ITaskService` — daemon-facing background task surface.
|
|
349317
349317
|
*
|
|
@@ -349428,7 +349428,7 @@ var TaskAlreadyFinishedError = class extends Error {
|
|
|
349428
349428
|
}
|
|
349429
349429
|
};
|
|
349430
349430
|
//#endregion
|
|
349431
|
-
//#region
|
|
349431
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/task/taskService.ts
|
|
349432
349432
|
/**
|
|
349433
349433
|
* `TaskService` — implementation of `ITaskService`.
|
|
349434
349434
|
*/
|
|
@@ -349499,7 +349499,7 @@ let TaskService = class TaskService extends Disposable {
|
|
|
349499
349499
|
TaskService = __decorate([__decorateParam(0, ICoreProcessService)], TaskService);
|
|
349500
349500
|
registerSingleton(ITaskService, TaskService, 1);
|
|
349501
349501
|
//#endregion
|
|
349502
|
-
//#region
|
|
349502
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/terminal/terminal.ts
|
|
349503
349503
|
const ITerminalService = createDecorator("terminalService");
|
|
349504
349504
|
var TerminalNotFoundError = class extends Error {
|
|
349505
349505
|
sessionId;
|
|
@@ -349515,7 +349515,7 @@ function disposeAll(items) {
|
|
|
349515
349515
|
for (const item of items) item.dispose();
|
|
349516
349516
|
}
|
|
349517
349517
|
//#endregion
|
|
349518
|
-
//#region
|
|
349518
|
+
//#region ../../../../hm623s/r/packages/agent-core/src/services/terminal/terminalService.ts
|
|
349519
349519
|
const DEFAULT_COLS = 80;
|
|
349520
349520
|
const DEFAULT_ROWS = 24;
|
|
349521
349521
|
const nodeRequire = createRequire(import.meta.url);
|
|
@@ -349708,7 +349708,7 @@ function defaultShell() {
|
|
|
349708
349708
|
}
|
|
349709
349709
|
registerSingleton(ITerminalService, new SyncDescriptor(TerminalService, [{}], false));
|
|
349710
349710
|
//#endregion
|
|
349711
|
-
//#region
|
|
349711
|
+
//#region ../../../../hm623s/r/packages/node-sdk/src/rpc-work.ts
|
|
349712
349712
|
const SDK_RPC_WORK = {
|
|
349713
349713
|
withInteractiveAgent: "callback",
|
|
349714
349714
|
ensureConfigFile: "work",
|
|
@@ -349914,7 +349914,7 @@ function bindSdkWork(methods, owner, classification, scope) {
|
|
|
349914
349914
|
}
|
|
349915
349915
|
}
|
|
349916
349916
|
//#endregion
|
|
349917
|
-
//#region
|
|
349917
|
+
//#region ../../../../hm623s/r/packages/node-sdk/src/session.ts
|
|
349918
349918
|
const MAIN_AGENT_ID$1 = "main";
|
|
349919
349919
|
var Session = class {
|
|
349920
349920
|
id;
|
|
@@ -350643,7 +350643,7 @@ function hasResumeState(summary) {
|
|
|
350643
350643
|
return summary !== void 0 && typeof summary.sessionMetadata === "object" && summary.sessionMetadata !== null && typeof summary.agents === "object" && summary.agents !== null;
|
|
350644
350644
|
}
|
|
350645
350645
|
//#endregion
|
|
350646
|
-
//#region
|
|
350646
|
+
//#region ../../../../hm623s/r/packages/node-sdk/src/blun-harness.ts
|
|
350647
350647
|
var BlunHarness = class {
|
|
350648
350648
|
rpc;
|
|
350649
350649
|
homeDir;
|
|
@@ -350890,7 +350890,7 @@ function normalizeSessionId(value) {
|
|
|
350890
350890
|
return normalized;
|
|
350891
350891
|
}
|
|
350892
350892
|
//#endregion
|
|
350893
|
-
//#region
|
|
350893
|
+
//#region ../../../../hm623s/r/packages/node-sdk/src/oauth-error.ts
|
|
350894
350894
|
/**
|
|
350895
350895
|
* Classify an OAuth token-fetch failure into the public {@link BlunError}
|
|
350896
350896
|
* protocol so callers (turn serialization, SDK clients, ACP) can react on
|
|
@@ -350913,7 +350913,7 @@ function mapOAuthTokenError(error, providerName) {
|
|
|
350913
350913
|
if (error instanceof OAuthConnectionError || error instanceof RetryableRefreshError) return new BlunError(ErrorCodes.PROVIDER_CONNECTION_ERROR, `OAuth provider "${providerName}" failed to fetch an access token: ${error.message}`, { cause: error });
|
|
350914
350914
|
}
|
|
350915
350915
|
//#endregion
|
|
350916
|
-
//#region
|
|
350916
|
+
//#region ../../../../hm623s/r/packages/node-sdk/src/auth-work.ts
|
|
350917
350917
|
const AUTH_WORK_METHODS = [
|
|
350918
350918
|
"restoreMissingProfileModel",
|
|
350919
350919
|
"status",
|
|
@@ -350936,7 +350936,7 @@ function bindAuthWork(auth, owner) {
|
|
|
350936
350936
|
for (const method of AUTH_WORK_METHODS) bindHostEffectMethod(auth, owner, method, method !== "resolveOAuthTokenProvider", "work", `auth.${method}`);
|
|
350937
350937
|
}
|
|
350938
350938
|
//#endregion
|
|
350939
|
-
//#region
|
|
350939
|
+
//#region ../../../../hm623s/r/packages/node-sdk/src/auth.ts
|
|
350940
350940
|
var BlunAuthTransitionError = class extends Error {
|
|
350941
350941
|
warnings;
|
|
350942
350942
|
constructor(message, cause, warnings) {
|
|
@@ -351427,7 +351427,7 @@ function managedApiKeyRejectedResult() {
|
|
|
351427
351427
|
};
|
|
351428
351428
|
}
|
|
351429
351429
|
//#endregion
|
|
351430
|
-
//#region
|
|
351430
|
+
//#region ../../../../hm623s/r/packages/node-sdk/src/rpc.ts
|
|
351431
351431
|
const MAIN_AGENT_ID = "main";
|
|
351432
351432
|
var SDKRpcClientBase = class {
|
|
351433
351433
|
interactiveAgentScope = new AsyncLocalStorage();
|
|
@@ -352143,7 +352143,7 @@ function errorMessage(error) {
|
|
|
352143
352143
|
return error instanceof Error ? error.message : String(error);
|
|
352144
352144
|
}
|
|
352145
352145
|
//#endregion
|
|
352146
|
-
//#region
|
|
352146
|
+
//#region ../../../../hm623s/r/packages/node-sdk/src/sdk-rpc-client.ts
|
|
352147
352147
|
function authHomeForProfile(homeDir, scope) {
|
|
352148
352148
|
const sharedHome = scope.sharedHome?.trim();
|
|
352149
352149
|
const profile = scope.profile?.trim();
|
|
@@ -353615,7 +353615,7 @@ function optionalBuildString(value) {
|
|
|
353615
353615
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
353616
353616
|
}
|
|
353617
353617
|
const BLUN_BUILD_INFO = {
|
|
353618
|
-
version: optionalBuildString("9.1.
|
|
353618
|
+
version: optionalBuildString("9.1.623"),
|
|
353619
353619
|
channel: typeof __BLUN_CHANNEL__ === "string" ? optionalBuildString(__BLUN_CHANNEL__) : void 0,
|
|
353620
353620
|
commit: typeof __BLUN_COMMIT__ === "string" ? optionalBuildString(__BLUN_COMMIT__) : void 0,
|
|
353621
353621
|
buildTarget: typeof __BLUN_BUILD_TARGET__ === "string" ? optionalBuildString(__BLUN_BUILD_TARGET__) : void 0
|