@wrongstack/core 0.291.1 → 0.292.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/coordination/director-tools.d.ts.map +1 -1
- package/dist/coordination/index.js +113 -113
- package/dist/coordination/index.js.map +3 -3
- package/dist/core/agent-loop.d.ts.map +1 -1
- package/dist/core/agent-response.d.ts.map +1 -1
- package/dist/core/context.d.ts +10 -0
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/system-prompt-builder.d.ts +20 -1
- package/dist/core/system-prompt-builder.d.ts.map +1 -1
- package/dist/defaults/index.d.ts +1 -0
- package/dist/defaults/index.d.ts.map +1 -1
- package/dist/defaults/index.js +3132 -2440
- package/dist/defaults/index.js.map +4 -4
- package/dist/execution/auto-compaction-middleware.d.ts +34 -2
- package/dist/execution/auto-compaction-middleware.d.ts.map +1 -1
- package/dist/execution/compaction-core.d.ts +59 -0
- package/dist/execution/compaction-core.d.ts.map +1 -1
- package/dist/execution/compactor.d.ts.map +1 -1
- package/dist/execution/error-handler.d.ts +7 -0
- package/dist/execution/error-handler.d.ts.map +1 -1
- package/dist/execution/index.d.ts +1 -0
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +4677 -3924
- package/dist/execution/index.js.map +4 -4
- package/dist/execution/intelligent-compactor.d.ts.map +1 -1
- package/dist/execution/model-runtime.d.ts.map +1 -1
- package/dist/execution/selective-compactor.d.ts +10 -0
- package/dist/execution/selective-compactor.d.ts.map +1 -1
- package/dist/execution/subagent-compaction.d.ts +24 -0
- package/dist/execution/subagent-compaction.d.ts.map +1 -0
- package/dist/hq/alerts.d.ts +5 -0
- package/dist/hq/alerts.d.ts.map +1 -1
- package/dist/hq/auth-audit.d.ts +115 -0
- package/dist/hq/auth-audit.d.ts.map +1 -0
- package/dist/hq/auth-store.d.ts +98 -2
- package/dist/hq/auth-store.d.ts.map +1 -1
- package/dist/hq/brain-bridge.d.ts +2 -8
- package/dist/hq/brain-bridge.d.ts.map +1 -1
- package/dist/hq/bridge-context.d.ts +74 -0
- package/dist/hq/bridge-context.d.ts.map +1 -0
- package/dist/hq/cost-bridge.d.ts +4 -10
- package/dist/hq/cost-bridge.d.ts.map +1 -1
- package/dist/hq/fleet-bridge.d.ts +2 -8
- package/dist/hq/fleet-bridge.d.ts.map +1 -1
- package/dist/hq/index.d.ts +2 -0
- package/dist/hq/index.d.ts.map +1 -1
- package/dist/hq/index.js +358 -222
- package/dist/hq/index.js.map +4 -4
- package/dist/hq/protocol/session.d.ts +13 -0
- package/dist/hq/protocol/session.d.ts.map +1 -1
- package/dist/hq/tool-bridge.d.ts +2 -8
- package/dist/hq/tool-bridge.d.ts.map +1 -1
- package/dist/hq/worktree-bridge.d.ts +2 -8
- package/dist/hq/worktree-bridge.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6054 -4741
- package/dist/index.js.map +4 -4
- package/dist/infrastructure/index.js +32 -15
- package/dist/infrastructure/index.js.map +2 -2
- package/dist/infrastructure/provider-cache-ledger.d.ts +48 -0
- package/dist/infrastructure/provider-cache-ledger.d.ts.map +1 -0
- package/dist/infrastructure/token-counter.d.ts +4 -2
- package/dist/infrastructure/token-counter.d.ts.map +1 -1
- package/dist/kernel/events/brain-events.d.ts +2 -0
- package/dist/kernel/events/brain-events.d.ts.map +1 -1
- package/dist/kernel/events/memory-events.d.ts +102 -0
- package/dist/kernel/events/memory-events.d.ts.map +1 -1
- package/dist/kernel/events/session-events.d.ts +35 -0
- package/dist/kernel/events/session-events.d.ts.map +1 -1
- package/dist/models/index.js +161 -78
- package/dist/models/index.js.map +3 -3
- package/dist/models/llm-selector.d.ts.map +1 -1
- package/dist/notifications/index.d.ts +40 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/notifier-impl.d.ts +34 -0
- package/dist/notifications/notifier-impl.d.ts.map +1 -0
- package/dist/notifications/notifier.d.ts +95 -0
- package/dist/notifications/notifier.d.ts.map +1 -0
- package/dist/notifications/types.d.ts +111 -0
- package/dist/notifications/types.d.ts.map +1 -0
- package/dist/plugin/api.d.ts +10 -1
- package/dist/plugin/api.d.ts.map +1 -1
- package/dist/registry/provider-registry.d.ts +1 -1
- package/dist/registry/provider-registry.d.ts.map +1 -1
- package/dist/security/index.js +15 -15
- package/dist/security/index.js.map +3 -3
- package/dist/skills/index.js +80 -80
- package/dist/skills/index.js.map +3 -3
- package/dist/storage/config-loader.d.ts +3 -5
- package/dist/storage/config-loader.d.ts.map +1 -1
- package/dist/storage/index.js +325 -259
- package/dist/storage/index.js.map +4 -4
- package/dist/storage/memory-consolidator.d.ts +14 -2
- package/dist/storage/memory-consolidator.d.ts.map +1 -1
- package/dist/storage/queue-store.d.ts +2 -0
- package/dist/storage/queue-store.d.ts.map +1 -1
- package/dist/tools/index.js +6 -6
- package/dist/tools/index.js.map +3 -3
- package/dist/tools/mcp-control.d.ts +1 -1
- package/dist/types/config.d.ts +64 -20
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/index.js +60 -34
- package/dist/types/index.js.map +3 -3
- package/dist/types/plugin.d.ts +11 -0
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/provider.d.ts +31 -0
- package/dist/types/provider.d.ts.map +1 -1
- package/dist/types/token-counter.d.ts +8 -1
- package/dist/types/token-counter.d.ts.map +1 -1
- package/dist/utils/cache-key.d.ts +19 -0
- package/dist/utils/cache-key.d.ts.map +1 -0
- package/dist/utils/compaction-preview.d.ts +8 -0
- package/dist/utils/compaction-preview.d.ts.map +1 -0
- package/dist/utils/context-breakdown.d.ts +59 -0
- package/dist/utils/context-breakdown.d.ts.map +1 -0
- package/dist/utils/context-evidence.d.ts +22 -0
- package/dist/utils/context-evidence.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1730 -1543
- package/dist/utils/index.js.map +4 -4
- package/dist/utils/token-estimate.d.ts +27 -0
- package/dist/utils/token-estimate.d.ts.map +1 -1
- package/instructions/llm/memory-consolidator.md +19 -3
- package/instructions/system.md +10 -2
- package/package.json +2 -2
package/dist/skills/index.js
CHANGED
|
@@ -238,6 +238,86 @@ function expectDefined(value, label) {
|
|
|
238
238
|
return value;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
+
// src/skills/limits.ts
|
|
242
|
+
var SKILL_LIMITS = {
|
|
243
|
+
/**
|
|
244
|
+
* Per-skill body cap when injecting a full skill body into the system prompt
|
|
245
|
+
* (eager mode), and when returning a skill body from the `skill` tool.
|
|
246
|
+
* ~4k tokens. Oversized bodies are truncated at a paragraph boundary.
|
|
247
|
+
*
|
|
248
|
+
* Consumers: `system-prompt-builder.capSkillBody`, `skill` tool body return.
|
|
249
|
+
*/
|
|
250
|
+
MAX_SKILL_BODY_CHARS: 16e3,
|
|
251
|
+
/**
|
|
252
|
+
* Per-resource cap when the `skill` tool loads a bundled file
|
|
253
|
+
* (`scripts/`, `references/`, `assets/`). ~8k tokens.
|
|
254
|
+
*
|
|
255
|
+
* Consumer: `skill` tool `loadResource`.
|
|
256
|
+
*/
|
|
257
|
+
MAX_RESOURCE_CHARS: 32e3,
|
|
258
|
+
/**
|
|
259
|
+
* Maximum number of bundled resource paths the `skill` tool lists in one
|
|
260
|
+
* response. Caps a pathological skill (huge `assets/` tree) from blowing up
|
|
261
|
+
* the tool result.
|
|
262
|
+
*
|
|
263
|
+
* Consumer: `skill` tool resource listing.
|
|
264
|
+
*/
|
|
265
|
+
MAX_LISTED_RESOURCES: 100,
|
|
266
|
+
/**
|
|
267
|
+
* Max size of a single installed skill file (SKILL.md or a bundled resource).
|
|
268
|
+
* Guards against a malicious registry skill shipping a multi-MB blob that
|
|
269
|
+
* then flows into the prompt. 100KB.
|
|
270
|
+
*
|
|
271
|
+
* Consumer: `SkillInstaller.install` / `importFromDir`.
|
|
272
|
+
*/
|
|
273
|
+
MAX_SKILL_FILE_SIZE: 100 * 1024,
|
|
274
|
+
/**
|
|
275
|
+
* Max size of a GitHub tarball downloaded by the skill installer. Guards
|
|
276
|
+
* against a repo accidentally (or maliciously) shipping a giant tarball that
|
|
277
|
+
* would be extracted into a temp dir. 50MB.
|
|
278
|
+
*
|
|
279
|
+
* Consumer: `downloadGitHubTarball`.
|
|
280
|
+
*/
|
|
281
|
+
MAX_TARBALL_SIZE: 50 * 1024 * 1024,
|
|
282
|
+
/**
|
|
283
|
+
* Default total char budget for skill bodies injected in eager mode when
|
|
284
|
+
* `config.skills.eagerMaxChars` is unset. ~6k tokens. Skills are injected
|
|
285
|
+
* highest-priority first; once the budget is exhausted the remaining skills
|
|
286
|
+
* are listed as a manifest the agent loads via the `skill` tool. Set very
|
|
287
|
+
* high to effectively disable budgeting.
|
|
288
|
+
*
|
|
289
|
+
* Consumer: `DefaultSystemPromptBuilder.buildMemoryAndSkills` (default for
|
|
290
|
+
* `skillEagerMaxChars`).
|
|
291
|
+
*/
|
|
292
|
+
EAGER_DEFAULT_MAX_CHARS: 24e3,
|
|
293
|
+
/**
|
|
294
|
+
* Auto-compact body limits (the token-saving fallback used when a skill has
|
|
295
|
+
* no hand-crafted `SKILL.save.md`). The Overview and Rules sections are
|
|
296
|
+
* extracted and trimmed to these char budgets, then the total is capped.
|
|
297
|
+
*
|
|
298
|
+
* Consumer: `DefaultSkillLoader.compactSkillBody`.
|
|
299
|
+
*/
|
|
300
|
+
COMPACT_OVERVIEW_MAX: 200,
|
|
301
|
+
COMPACT_RULES_MAX: 350,
|
|
302
|
+
COMPACT_TOTAL_MAX: 450,
|
|
303
|
+
/**
|
|
304
|
+
* Max length of a skill name (agentskills.io spec). Enforced by the
|
|
305
|
+
* frontmatter validator's format regex plus this length bound.
|
|
306
|
+
*
|
|
307
|
+
* Consumer: `isValidSkillNameFormat`.
|
|
308
|
+
*/
|
|
309
|
+
SKILL_NAME_MAX_LEN: 64,
|
|
310
|
+
/**
|
|
311
|
+
* Soft line limit for a SKILL.md body, per the bundled `skill-creator` rule.
|
|
312
|
+
* Not enforced in code (a skill can exceed it) — surfaced by `/skill-gen
|
|
313
|
+
* validate` and the `skill-creator` skill as guidance to move deep material
|
|
314
|
+
* into `references/`.
|
|
315
|
+
*
|
|
316
|
+
* Consumer: `skill-creator` skill, `/skill-gen validate` advisory.
|
|
317
|
+
*/
|
|
318
|
+
SKILL_BODY_LINE_LIMIT: 500
|
|
319
|
+
};
|
|
320
|
+
|
|
241
321
|
// src/types/errors.ts
|
|
242
322
|
var ERROR_CODES = {
|
|
243
323
|
// Provider
|
|
@@ -372,86 +452,6 @@ var ParseError = class extends WrongStackError {
|
|
|
372
452
|
}
|
|
373
453
|
};
|
|
374
454
|
|
|
375
|
-
// src/skills/limits.ts
|
|
376
|
-
var SKILL_LIMITS = {
|
|
377
|
-
/**
|
|
378
|
-
* Per-skill body cap when injecting a full skill body into the system prompt
|
|
379
|
-
* (eager mode), and when returning a skill body from the `skill` tool.
|
|
380
|
-
* ~4k tokens. Oversized bodies are truncated at a paragraph boundary.
|
|
381
|
-
*
|
|
382
|
-
* Consumers: `system-prompt-builder.capSkillBody`, `skill` tool body return.
|
|
383
|
-
*/
|
|
384
|
-
MAX_SKILL_BODY_CHARS: 16e3,
|
|
385
|
-
/**
|
|
386
|
-
* Per-resource cap when the `skill` tool loads a bundled file
|
|
387
|
-
* (`scripts/`, `references/`, `assets/`). ~8k tokens.
|
|
388
|
-
*
|
|
389
|
-
* Consumer: `skill` tool `loadResource`.
|
|
390
|
-
*/
|
|
391
|
-
MAX_RESOURCE_CHARS: 32e3,
|
|
392
|
-
/**
|
|
393
|
-
* Maximum number of bundled resource paths the `skill` tool lists in one
|
|
394
|
-
* response. Caps a pathological skill (huge `assets/` tree) from blowing up
|
|
395
|
-
* the tool result.
|
|
396
|
-
*
|
|
397
|
-
* Consumer: `skill` tool resource listing.
|
|
398
|
-
*/
|
|
399
|
-
MAX_LISTED_RESOURCES: 100,
|
|
400
|
-
/**
|
|
401
|
-
* Max size of a single installed skill file (SKILL.md or a bundled resource).
|
|
402
|
-
* Guards against a malicious registry skill shipping a multi-MB blob that
|
|
403
|
-
* then flows into the prompt. 100KB.
|
|
404
|
-
*
|
|
405
|
-
* Consumer: `SkillInstaller.install` / `importFromDir`.
|
|
406
|
-
*/
|
|
407
|
-
MAX_SKILL_FILE_SIZE: 100 * 1024,
|
|
408
|
-
/**
|
|
409
|
-
* Max size of a GitHub tarball downloaded by the skill installer. Guards
|
|
410
|
-
* against a repo accidentally (or maliciously) shipping a giant tarball that
|
|
411
|
-
* would be extracted into a temp dir. 50MB.
|
|
412
|
-
*
|
|
413
|
-
* Consumer: `downloadGitHubTarball`.
|
|
414
|
-
*/
|
|
415
|
-
MAX_TARBALL_SIZE: 50 * 1024 * 1024,
|
|
416
|
-
/**
|
|
417
|
-
* Default total char budget for skill bodies injected in eager mode when
|
|
418
|
-
* `config.skills.eagerMaxChars` is unset. ~6k tokens. Skills are injected
|
|
419
|
-
* highest-priority first; once the budget is exhausted the remaining skills
|
|
420
|
-
* are listed as a manifest the agent loads via the `skill` tool. Set very
|
|
421
|
-
* high to effectively disable budgeting.
|
|
422
|
-
*
|
|
423
|
-
* Consumer: `DefaultSystemPromptBuilder.buildMemoryAndSkills` (default for
|
|
424
|
-
* `skillEagerMaxChars`).
|
|
425
|
-
*/
|
|
426
|
-
EAGER_DEFAULT_MAX_CHARS: 24e3,
|
|
427
|
-
/**
|
|
428
|
-
* Auto-compact body limits (the token-saving fallback used when a skill has
|
|
429
|
-
* no hand-crafted `SKILL.save.md`). The Overview and Rules sections are
|
|
430
|
-
* extracted and trimmed to these char budgets, then the total is capped.
|
|
431
|
-
*
|
|
432
|
-
* Consumer: `DefaultSkillLoader.compactSkillBody`.
|
|
433
|
-
*/
|
|
434
|
-
COMPACT_OVERVIEW_MAX: 200,
|
|
435
|
-
COMPACT_RULES_MAX: 350,
|
|
436
|
-
COMPACT_TOTAL_MAX: 450,
|
|
437
|
-
/**
|
|
438
|
-
* Max length of a skill name (agentskills.io spec). Enforced by the
|
|
439
|
-
* frontmatter validator's format regex plus this length bound.
|
|
440
|
-
*
|
|
441
|
-
* Consumer: `isValidSkillNameFormat`.
|
|
442
|
-
*/
|
|
443
|
-
SKILL_NAME_MAX_LEN: 64,
|
|
444
|
-
/**
|
|
445
|
-
* Soft line limit for a SKILL.md body, per the bundled `skill-creator` rule.
|
|
446
|
-
* Not enforced in code (a skill can exceed it) — surfaced by `/skill-gen
|
|
447
|
-
* validate` and the `skill-creator` skill as guidance to move deep material
|
|
448
|
-
* into `references/`.
|
|
449
|
-
*
|
|
450
|
-
* Consumer: `skill-creator` skill, `/skill-gen validate` advisory.
|
|
451
|
-
*/
|
|
452
|
-
SKILL_BODY_LINE_LIMIT: 500
|
|
453
|
-
};
|
|
454
|
-
|
|
455
455
|
// src/skills/github-fetcher.ts
|
|
456
456
|
function parseSkillRef(input) {
|
|
457
457
|
const trimmed = input.trim().replace(/^https?:\/\/github\.com\//, "").replace(/\.git$/, "");
|