@anhlp/alp-runtime 0.0.1-beta.4 → 0.0.1-beta.5

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.
Files changed (67) hide show
  1. package/dist/acp-transport.js +5 -36
  2. package/dist/antigravity-transport.d.ts +17 -0
  3. package/dist/antigravity-transport.js +82 -58
  4. package/dist/assignment-results.d.ts +34 -0
  5. package/dist/assignment-results.js +94 -2
  6. package/dist/board-domain.js +2 -2
  7. package/dist/board.d.ts +6 -0
  8. package/dist/board.js +7 -0
  9. package/dist/catalog.d.ts +13 -0
  10. package/dist/catalog.js +9 -1
  11. package/dist/claude-transport.d.ts +7 -0
  12. package/dist/claude-transport.js +65 -6
  13. package/dist/compact.d.ts +29 -0
  14. package/dist/compact.js +49 -0
  15. package/dist/configure.d.ts +1 -1
  16. package/dist/configure.js +2 -2
  17. package/dist/contracts.d.ts +25 -1
  18. package/dist/index.d.ts +9 -2
  19. package/dist/index.js +30 -2
  20. package/dist/input-limits.d.ts +25 -0
  21. package/dist/input-limits.js +48 -0
  22. package/dist/language.d.ts +8 -0
  23. package/dist/language.js +20 -0
  24. package/dist/mcp-tools.d.ts +8 -0
  25. package/dist/mcp-tools.js +26 -0
  26. package/dist/model-catalog.d.ts +76 -0
  27. package/dist/model-catalog.js +193 -0
  28. package/dist/model-probes.d.ts +7 -0
  29. package/dist/model-probes.js +69 -0
  30. package/dist/providers.js +2 -0
  31. package/dist/resolve.d.ts +1 -0
  32. package/dist/resolve.js +3 -1
  33. package/dist/runtime.d.ts +3 -1
  34. package/dist/runtime.js +605 -45
  35. package/dist/session-config.d.ts +174 -0
  36. package/dist/session-config.js +9 -9
  37. package/dist/session-state.d.ts +23 -1
  38. package/dist/tools.d.ts +82 -0
  39. package/dist/tools.js +53 -5
  40. package/dist/transport.js +3 -1
  41. package/dist/workspace.d.ts +11 -4
  42. package/dist/workspace.js +29 -11
  43. package/package.json +3 -3
  44. package/src/acp-transport.ts +7 -37
  45. package/src/antigravity-transport.ts +95 -53
  46. package/src/assignment-results.ts +85 -3
  47. package/src/board-domain.ts +2 -2
  48. package/src/board.ts +7 -0
  49. package/src/catalog.ts +10 -1
  50. package/src/claude-transport.ts +71 -6
  51. package/src/compact.ts +62 -0
  52. package/src/configure.ts +3 -3
  53. package/src/contracts.ts +22 -1
  54. package/src/index.ts +9 -2
  55. package/src/input-limits.ts +65 -0
  56. package/src/language.ts +18 -0
  57. package/src/mcp-tools.ts +33 -0
  58. package/src/model-catalog.ts +166 -0
  59. package/src/model-probes.ts +58 -0
  60. package/src/providers.ts +3 -0
  61. package/src/resolve.ts +4 -2
  62. package/src/runtime.ts +650 -46
  63. package/src/session-config.ts +8 -8
  64. package/src/session-state.ts +15 -1
  65. package/src/tools.ts +53 -5
  66. package/src/transport.ts +3 -1
  67. package/src/workspace.ts +42 -15
@@ -6,11 +6,18 @@ import path from "node:path";
6
6
  import { optionalRead, claudeUsage } from "./runtime-context.js";
7
7
  import { randomUUID } from "node:crypto";
8
8
  import { z } from "zod";
9
- import { PIN_KINDS } from "./board.js";
9
+ import { BOARD_KINDS_INPUT, PIN_BODY_CHARS, PIN_KINDS, PIN_PATH_CHARS, PIN_PATHS, PIN_PATHS_INPUT } from "./board.js";
10
+ import { RESULT_OUTCOMES } from "./assignment-results.js";
11
+ import { inputLimitError, POUR_VARS, VAR_NAME } from "./input-limits.js";
10
12
  import { claudeToolDetail, resultText } from "./tool-detail.js";
11
13
  import { CLOSE_REASONS, GATE_KINDS, TASK_STATUSES, TASK_TYPES } from "@anhlp/alp-core/tasks";
12
14
  import { commandDecision } from "@anhlp/alp-core/permissions";
13
15
  var CLAUDE_SDK = ["@anthropic-ai", "claude-agent-sdk"].join("/");
16
+ var bounded = (schema, limits) => z.preprocess((value, ctx) => {
17
+ const error = inputLimitError(value, limits);
18
+ if (error) ctx.addIssue({ code: "custom", message: error });
19
+ return value;
20
+ }, schema);
14
21
  var handoffList = z.array(z.string().min(1)).max(100).optional();
15
22
  var taskIds = z.array(z.string().min(1)).max(50).optional();
16
23
  var taskLinks = z.object({ blockedBy: taskIds, related: taskIds, parent: z.string().min(1).optional() }).strict().optional();
@@ -45,6 +52,15 @@ var toolShapes = {
45
52
  scope: z.enum(["project", "user"]),
46
53
  lesson: z.string().min(1).max(600)
47
54
  },
55
+ alp_lesson_curate: {
56
+ changes: z.array(z.object({
57
+ scope: z.enum(["project", "user"]),
58
+ remove: z.array(z.string().min(1).max(600)).min(1).max(50),
59
+ add: z.string().min(1).max(600).optional(),
60
+ reason: z.string().max(300).optional()
61
+ }).strict()).min(1).max(50),
62
+ requestId: z.string().min(1).max(100).optional()
63
+ },
48
64
  alp_skill: {
49
65
  name: z.string().min(1),
50
66
  description: z.string().min(1).max(300),
@@ -90,9 +106,10 @@ var toolShapes = {
90
106
  kind: z.enum(GATE_KINDS).optional(),
91
107
  until: z.string().min(1).optional(),
92
108
  ref: z.string().min(1).optional(),
109
+ options: z.array(z.string().min(1).max(200)).max(10).optional(),
93
110
  gate: z.string().min(1).optional(),
94
111
  formula: z.string().min(1).optional(),
95
- vars: z.record(z.string(), z.string()).optional(),
112
+ vars: bounded(z.record(z.string().regex(VAR_NAME), z.string().max(POUR_VARS.string)), POUR_VARS).optional(),
96
113
  summary: z.string().min(1).max(2e3).optional(),
97
114
  unverified: z.string().min(1).max(2e3).optional(),
98
115
  note: z.string().min(1).max(2e3).optional(),
@@ -103,17 +120,22 @@ var toolShapes = {
103
120
  alp_discard: {
104
121
  assignmentId: z.string().min(1)
105
122
  },
123
+ alp_resolve: {
124
+ assignmentId: z.string().min(1),
125
+ outcome: z.enum(RESULT_OUTCOMES),
126
+ note: z.string().min(1).max(2e3).optional()
127
+ },
106
128
  alp_cancel: {
107
129
  assignmentId: z.string().min(1),
108
130
  reason: z.string().optional()
109
131
  },
110
132
  alp_pin: {
111
133
  kind: z.enum(PIN_KINDS),
112
- body: z.string().min(1),
113
- paths: z.array(z.string().min(1)).optional()
134
+ body: z.string().min(1).max(PIN_BODY_CHARS),
135
+ paths: bounded(z.array(z.string().min(1).max(PIN_PATH_CHARS)).max(PIN_PATHS), PIN_PATHS_INPUT).optional()
114
136
  },
115
137
  alp_board: {
116
- kinds: z.array(z.enum(PIN_KINDS)).optional(),
138
+ kinds: bounded(z.array(z.enum(PIN_KINDS)).max(PIN_KINDS.length), BOARD_KINDS_INPUT).optional(),
117
139
  limit: z.number().int().positive().optional()
118
140
  },
119
141
  alp_unpin: {
@@ -229,8 +251,18 @@ function claudePermissions(sandbox, currentSandbox, rules, ask) {
229
251
  // Ask rules make Claude consult canUseTool in every mode, which asks the user.
230
252
  ...rules?.ask?.length ? { settings: { permissions: { ask: rules.ask } } } : {},
231
253
  // The floor: Bash runs in the OS sandbox, which writes only the workspace (or nothing, read-only) and temp files, offline.
254
+ // Keep the SDK's restrictive host-network defaults. Broad Unix socket/localhost
255
+ // access lets host services act outside this floor; the SDK cannot scope local
256
+ // binding to a test server, and scoped Unix sockets are not portable to Linux.
232
257
  // A command leaves it only with dangerouslyDisableSandbox, which Claude allows itself for allow rules and asks canUseTool otherwise.
233
- ...rules?.floor ? { sandbox: { enabled: true, autoAllowBashIfSandboxed: false, allowUnsandboxedCommands: true, ...rules.floor === "read-only" && rules.floorRoot ? { filesystem: { denyWrite: [rules.floorRoot] } } : {} } } : {},
258
+ ...rules?.floor ? {
259
+ sandbox: {
260
+ enabled: true,
261
+ autoAllowBashIfSandboxed: false,
262
+ allowUnsandboxedCommands: true,
263
+ ...rules.floor === "read-only" && rules.floorRoot ? { filesystem: { denyWrite: [rules.floorRoot] } } : {}
264
+ }
265
+ } : {},
234
266
  canUseTool: async (name, input, context) => {
235
267
  const mode = currentSandbox ? currentSandbox() : sandbox;
236
268
  const leaving = Boolean(rules?.floor) && name === "Bash" && input.dangerouslyDisableSandbox === true;
@@ -345,6 +377,21 @@ var ClaudeTransport = class {
345
377
  }
346
378
  async initialize() {
347
379
  }
380
+ /** The models Claude offers now, from a Claude process that sends no prompt and is closed after (t-e5ee). */
381
+ async probeModels(signal) {
382
+ const { query } = await import(CLAUDE_SDK);
383
+ if (signal?.aborted) throw new Error("aborted");
384
+ const probe = query({ prompt: new InputQueue(), options: { cwd: this.cwd, env: this.env, settingSources: [], persistSession: false, strictMcpConfig: true, mcpServers: {}, pathToClaudeCodeExecutable: this.command } });
385
+ const stop = () => probe.close();
386
+ signal?.addEventListener("abort", stop);
387
+ try {
388
+ const models = await probe.supportedModels();
389
+ return models.map((model) => ({ id: model.value, label: model.displayName, description: model.description, efforts: model.supportedEffortLevels ?? void 0 }));
390
+ } finally {
391
+ signal?.removeEventListener("abort", stop);
392
+ probe.close();
393
+ }
394
+ }
348
395
  /** The plan's usage windows before a session starts, from a Claude process that sends no prompt and is closed after. */
349
396
  async probeUsage() {
350
397
  if (this.closed) return void 0;
@@ -417,6 +464,18 @@ var ClaudeTransport = class {
417
464
  });
418
465
  return method === "turn/start" ? { turn: { id: turnId } } : {};
419
466
  }
467
+ if (method === "thread/compact/start") {
468
+ if (!this.query) throw new Error("Claude thread is not initialized");
469
+ if (this.activeTurn) throw new Error("A turn is running");
470
+ const turnId = randomUUID();
471
+ this.clearAssistantText();
472
+ this.activeTurn = turnId;
473
+ this.turnsStarted = true;
474
+ this.emit("turn/started", { threadId: this.threadId, turn: { id: turnId } });
475
+ const instructions = typeof params.instructions === "string" ? ` ${params.instructions.trim()}` : "";
476
+ this.input.push({ type: "user", message: { role: "user", content: `/compact${instructions}` }, parent_tool_use_id: null, uuid: turnId, session_id: this.threadId });
477
+ return {};
478
+ }
420
479
  if (method === "turn/interrupt") {
421
480
  this.streamingMessage = void 0;
422
481
  await this.query?.interrupt();
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Main's compaction (t-0e56): at a turn boundary, once main's context fills to the
3
+ * threshold (or the user asks), ALP has main write a checkpoint by skill `compact`,
4
+ * then compacts with the runtime's own mechanism (Claude's /compact, Codex's
5
+ * thread/compact/start), or else starts a fresh conversation seeded with the checkpoint.
6
+ */
7
+ export interface CompactSettings {
8
+ auto: boolean;
9
+ threshold: number;
10
+ }
11
+ export declare const COMPACT_DEFAULTS: CompactSettings;
12
+ /**
13
+ * settings.json `compact`: { auto?: boolean, threshold?: number in (0, 1) }; anything else keeps the default.
14
+ * The threshold is a share of the window main works in: the agent's autocompact or context setting when
15
+ * set, else the model's context window, as the context advisory measures it.
16
+ */
17
+ export declare function compactSettings(raw: unknown): CompactSettings;
18
+ /** How full the context is, 0..1, from a runtime's token usage; undefined when the window is unknown. */
19
+ export declare function contextFill(usage: any): number | undefined;
20
+ /** Whether an idle root should compact now. */
21
+ export declare function compactDue(settings: CompactSettings, fill: number | undefined, requested: boolean): 'auto' | 'manual' | undefined;
22
+ /** Runtimes that compact a conversation in place. */
23
+ export declare const NATIVE_COMPACT: string[];
24
+ export declare const CHECKPOINT_MARK = "ALP compact checkpoint";
25
+ export declare function checkpointPrompt(trigger: 'auto' | 'manual', fill?: number): string;
26
+ /** What the runtime's native compaction is told to keep. */
27
+ export declare function compactInstructions(checkpoint: string): string;
28
+ /** The first prompt of a fresh conversation that replaces a full one. */
29
+ export declare function seedPrompt(checkpoint: string, lastUser?: string): string;
@@ -0,0 +1,49 @@
1
+ // packages/runtime/src/compact.ts
2
+ var COMPACT_DEFAULTS = Object.freeze({ auto: true, threshold: 0.7 });
3
+ function compactSettings(raw) {
4
+ const value = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
5
+ const auto = typeof value.auto === "boolean" ? value.auto : COMPACT_DEFAULTS.auto;
6
+ const threshold = typeof value.threshold === "number" && Number.isFinite(value.threshold) && value.threshold > 0 && value.threshold < 1 ? value.threshold : COMPACT_DEFAULTS.threshold;
7
+ return { auto, threshold };
8
+ }
9
+ function contextFill(usage) {
10
+ const used = usage?.last?.totalTokens;
11
+ const window = usage?.modelContextWindow;
12
+ if (typeof used !== "number" || typeof window !== "number" || window <= 0) return void 0;
13
+ return used / window;
14
+ }
15
+ function compactDue(settings, fill, requested) {
16
+ if (requested) return "manual";
17
+ if (settings.auto && typeof fill === "number" && fill >= settings.threshold) return "auto";
18
+ return void 0;
19
+ }
20
+ var NATIVE_COMPACT = ["claude", "codex"];
21
+ var CHECKPOINT_MARK = "ALP compact checkpoint";
22
+ function checkpointPrompt(trigger, fill) {
23
+ const why = trigger === "manual" ? "The user asked to compact your context." : `Your context is about ${Math.round((fill ?? 0) * 100)}% full.`;
24
+ return `${CHECKPOINT_MARK}: ${why} ALP compacts it after this turn. Write a checkpoint now following skill compact (read its SKILL.md): check the facts with alp_task, alp_board and gh where it applies, then reply with the checkpoint alone, in its sections: skip the skill's notice to the user, ALP posts it. Do not start new work, delegate, wait or ask in this turn.`;
25
+ }
26
+ function compactInstructions(checkpoint) {
27
+ return `Keep this checkpoint verbatim in the summary; it is the state of the work:
28
+ ${checkpoint}`;
29
+ }
30
+ function seedPrompt(checkpoint, lastUser) {
31
+ return [
32
+ "Your context was compacted: ALP started this conversation fresh. Your instructions are unchanged. This is the checkpoint you wrote before, by skill compact:",
33
+ checkpoint,
34
+ ...lastUser ? [`The user's last message before the compaction, verbatim:
35
+ ${lastUser}`] : [],
36
+ "Read alp_task and alp_board again (and gh for PR/CI) before reporting status, then carry on. If nothing waits for you, end the turn."
37
+ ].join("\n\n");
38
+ }
39
+ export {
40
+ CHECKPOINT_MARK,
41
+ COMPACT_DEFAULTS,
42
+ NATIVE_COMPACT,
43
+ checkpointPrompt,
44
+ compactDue,
45
+ compactInstructions,
46
+ compactSettings,
47
+ contextFill,
48
+ seedPrompt
49
+ };
@@ -20,7 +20,7 @@ export declare function nativeModelOf(runtime: RuntimeKind, model: string): {
20
20
  runtime: string;
21
21
  };
22
22
  /**
23
- * Whether the host offers `model` on `runtime`: ALP's catalog (core MODELS, what library.models and
23
+ * Whether the host offers `model` on `runtime`: ALP's live catalog (catalog.ts entries, what library.models and
24
24
  * catalog.get list), a model the project's settings give an agent of the team, or the model the session
25
25
  * runs already. Never an arbitrary string.
26
26
  */
package/dist/configure.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // packages/runtime/src/configure.ts
2
2
  import { createHash } from "node:crypto";
3
- import { MODELS } from "@anhlp/alp-core/models";
3
+ import { entries } from "./catalog.js";
4
4
  import { profileModel } from "@anhlp/alp-core/profiles";
5
5
  var CONFIGURABLE = /* @__PURE__ */ new Set(["codex", "claude"]);
6
6
  var PREFIXED = /^(codex|claude|antigravity|acp)[:/](.*)$/s;
@@ -11,7 +11,7 @@ function nativeModelOf(runtime, model) {
11
11
  }
12
12
  function offered(runtime, model, mapping) {
13
13
  if (model === mapping.model) return true;
14
- if (MODELS.some((entry) => entry.runtime === runtime && entry.id === model)) return true;
14
+ if (entries.some((entry) => entry.runtime === runtime && entry.id === model)) return true;
15
15
  return Object.values(mapping.modelProfiles ?? {}).flat().some((profile) => profileModel(profile) === `${runtime}:${model}`);
16
16
  }
17
17
  function mcpOf(mapping) {
@@ -43,6 +43,8 @@ export type RuntimeOptions = {
43
43
  checkInMs?: number;
44
44
  /** How often the watchdog looks at running assignments; derived from silentForMs and checkInMs when omitted. */
45
45
  watchMs?: number;
46
+ /** How often the project tasks are read for gate changes made without alpd, in ms; 0 turns the timer off. Default 5000. */
47
+ gateSyncMs?: number;
46
48
  /** How long alp_ask waits for the requester before returning unanswered. */
47
49
  askTimeoutMs?: number;
48
50
  /** How long alp_ask waits for the user before returning unanswered. Default 30 minutes. */
@@ -110,6 +112,13 @@ export type AlpRuntime = {
110
112
  registerWorkspace(directory: string): Promise<void>;
111
113
  /** Reserves runtime admission while an external checkout mutation runs. */
112
114
  withWorkspaceMutation<T>(directory: string, run: () => Promise<T>): Promise<T>;
115
+ /**
116
+ * Owner-audited adoption of a checkout that predates birth certification (t-c1ba). Under the
117
+ * removal guard's reservation and ownership checks, `verify` must prove the checkout's identity
118
+ * (it throws otherwise); only then is the canonical directory certified. Never call it without
119
+ * the owner's explicit confirmation of the facts `verify` checks.
120
+ */
121
+ adoptWorkspace?(directory: string, verify: (canonical: string) => Promise<void>): Promise<void>;
113
122
  /** Opens a root session under a client-chosen id. */
114
123
  open(sessionId: string, spec: SessionSpec, options?: OpenOptions): Promise<SessionSnapshot>;
115
124
  /** What a new root would run as, before it opens, and the teams it may choose (ALPD §60). */
@@ -150,8 +159,11 @@ export type AlpRuntime = {
150
159
  answer(questionId: string, reply: {
151
160
  text?: string;
152
161
  dismiss?: boolean;
153
- reason?: string;
162
+ reason?: string; /** Where the user answered a gate card: paseo or web. */
163
+ channel?: 'paseo' | 'web';
154
164
  }): void;
165
+ /** Mirrors the project's open human gates as cards on its main session and tells main of the user's gate decisions, once each (t-ccac). */
166
+ syncGates?(projectRoot: string): Promise<void>;
155
167
  /** Mails a note from the user to any live session, such as an assignment the user wants to redirect. */
156
168
  message(sessionId: string, text: string): void;
157
169
  /** The project board: live claims, then decisions and findings, oldest first. */
@@ -166,6 +178,14 @@ export type AlpRuntime = {
166
178
  resume(input?: {
167
179
  runtime?: RuntimeKind;
168
180
  }): PauseState;
181
+ /** alpd's disk takes no writes (t-2831): pauses all of ALP and parks running assignments, unless all of ALP is paused already. */
182
+ holdForDisk(reason: string): PauseState;
183
+ /** Lifts the pause holdForDisk made, keeping usage-limit pauses; a pause the user made stays. */
184
+ releaseDisk(by: string): PauseState;
185
+ /** Whether alpd's disk pause holds ALP now. */
186
+ diskHeld(): boolean;
187
+ /** Tells every open root that disk space runs low. */
188
+ diskLow(free: string): void;
169
189
  /** Current pauses and parked assignments. */
170
190
  pauses(): PauseState;
171
191
  /** Read-only, cached account usage for the web and desktop viewers. */
@@ -219,6 +239,10 @@ export type AlpRuntime = {
219
239
  * Emits session.updated.
220
240
  */
221
241
  reload?(sessionId: string): Promise<SessionSnapshot>;
242
+ /** Compacts a root's context at its next turn boundary, with a checkpoint main writes by skill compact (t-0e56). */
243
+ compact?(sessionId: string): {
244
+ status: 'started' | 'deferred' | 'running';
245
+ };
222
246
  /**
223
247
  * Holds the turns the runtime would start by itself on this session (mail wakes) while a lifecycle
224
248
  * operation changes its conversation (a rewind, later a reload or live configure): mail stays queued
package/dist/index.d.ts CHANGED
@@ -5,7 +5,11 @@ export type { BranchRequest, ConversationErrorReason, NativeBase, NativeBinding,
5
5
  export type { AlpEvent, AlpError, Envelope, SessionSnapshot, TimelineItem, TurnOrigin, AssignmentSnapshot, UserQuestion, TreeStatus, SessionState } from './events.js';
6
6
  export { resolveSession, InstructionsAdapter, skillDescription } from './resolve.js';
7
7
  export type { SessionSpec, HostMcpServer, ResolvedSession, RuntimeKind } from './resolve.js';
8
- export { DEFAULT_MODEL, DEFAULT_CLAUDE_MODEL, models, modes, thinkingOptions, thinkingOptionsFor } from './catalog.js';
8
+ export { DEFAULT_MODEL, DEFAULT_CLAUDE_MODEL, entries as catalogEntries, models, modes, thinkingOptions, thinkingOptionsFor } from './catalog.js';
9
+ export type { CatalogEntry } from './catalog.js';
10
+ export { ModelCatalog, mergeCatalog, liveFromContext, feedCatalog, setActiveCatalog, activeCatalog, POLICY as CATALOG_POLICY, REFRESH_MS as CATALOG_REFRESH_MS } from './model-catalog.js';
11
+ export type { CatalogSnapshot, CatalogRuntime, LiveModel, Probe as CatalogProbe } from './model-catalog.js';
12
+ export { liveProbes, codexProbe, claudeProbe, antigravityProbe, parseAgyModels } from './model-probes.js';
9
13
  export { CodexTransport } from './transport.js';
10
14
  export { ATTACHMENT_HEADER, ATTACHMENT_ROUTES, attachmentStageDir, createAttachmentStager, stagingExposure } from './attachments.js';
11
15
  export type { AttachmentReader, AttachmentRoute } from './attachments.js';
@@ -17,10 +21,12 @@ export type { AntigravityProvider } from './antigravity-transport.js';
17
21
  export { ClaudeTransport, claudePermissions, claudeSandboxAvailable, skillPlugin, SKILL_PLUGIN, toolShapes as claudeToolShapes } from './claude-transport.js';
18
22
  export { MAIL_BATCH_CHARS, MAIL_BODY_CHARS, publicEvent, renderMail, takeBatch, USER } from './mailbox.js';
19
23
  export type { MailEvent, MailKind } from './mailbox.js';
20
- export { createCopy, gitEnvironment, reclaimCopies, reclaimWorktrees, removeCopy } from './workspace.js';
24
+ export { createCopy, gitEnvironment, reattachWorktree, reclaimCopies, reclaimWorktrees, removeCopy } from './workspace.js';
21
25
  export { OWN_START, processStartedAt, sameProcessAlive } from './process-info.js';
22
26
  export type { Worktree, WorktreeChange } from './workspace.js';
23
27
  export { PIN_KINDS, renderBoard, renderPin } from './board.js';
28
+ export { inputLimitError, TOOL_INPUT, POUR_VARS } from './input-limits.js';
29
+ export type { InputLimits } from './input-limits.js';
24
30
  export { CHOICES, isVietnamese, languageInstruction, words } from './language.js';
25
31
  export type { Words } from './language.js';
26
32
  export type { Pin, PinKind } from './board.js';
@@ -28,3 +34,4 @@ export { ProviderRegistry, createProviderRegistry } from './providers.js';
28
34
  export type { ProviderContext, ProviderFactory, ProviderFactories } from './providers.js';
29
35
  export { acpToolDetail, antigravityToolDetail, boundDetail, claudeToolDetail, clipText, codexToolCall, stripReadGutter, toolError, DETAIL_FILE_PATHS, DETAIL_TEXT_CHARS, DETAIL_WEB_RESULTS, ERROR_CHARS, TOOL_FAILED } from './tool-detail.js';
30
36
  export type { AcpCall, ClaudeResult, CodexToolCall, ToolCallDetail } from './tool-detail.js';
37
+ export { checkpointPrompt, compactDue, compactSettings, contextFill, seedPrompt, COMPACT_DEFAULTS } from './compact.js';
package/dist/index.js CHANGED
@@ -2,7 +2,9 @@
2
2
  import { createAlpRuntime, DEFAULT_TEAM, WorkspaceMutationError } from "./runtime.js";
3
3
  import { ConversationError } from "./contracts.js";
4
4
  import { resolveSession, InstructionsAdapter, skillDescription } from "./resolve.js";
5
- import { DEFAULT_MODEL, DEFAULT_CLAUDE_MODEL, models, modes, thinkingOptions, thinkingOptionsFor } from "./catalog.js";
5
+ import { DEFAULT_MODEL, DEFAULT_CLAUDE_MODEL, entries, models, modes, thinkingOptions, thinkingOptionsFor } from "./catalog.js";
6
+ import { ModelCatalog, mergeCatalog, liveFromContext, feedCatalog, setActiveCatalog, activeCatalog, POLICY, REFRESH_MS } from "./model-catalog.js";
7
+ import { liveProbes, codexProbe, claudeProbe, antigravityProbe, parseAgyModels } from "./model-probes.js";
6
8
  import { CodexTransport } from "./transport.js";
7
9
  import { ATTACHMENT_HEADER, ATTACHMENT_ROUTES, attachmentStageDir, createAttachmentStager, stagingExposure } from "./attachments.js";
8
10
  import { usageAllows } from "./runtime-context.js";
@@ -10,18 +12,23 @@ import { AcpTransport, acpDecision, acpEnv, acpPermission } from "./acp-transpor
10
12
  import { AntigravityTransport } from "./antigravity-transport.js";
11
13
  import { ClaudeTransport, claudePermissions, claudeSandboxAvailable, skillPlugin, SKILL_PLUGIN, toolShapes } from "./claude-transport.js";
12
14
  import { MAIL_BATCH_CHARS, MAIL_BODY_CHARS, publicEvent, renderMail, takeBatch, USER } from "./mailbox.js";
13
- import { createCopy, gitEnvironment, reclaimCopies, reclaimWorktrees, removeCopy } from "./workspace.js";
15
+ import { createCopy, gitEnvironment, reattachWorktree, reclaimCopies, reclaimWorktrees, removeCopy } from "./workspace.js";
14
16
  import { OWN_START, processStartedAt, sameProcessAlive } from "./process-info.js";
15
17
  import { PIN_KINDS, renderBoard, renderPin } from "./board.js";
18
+ import { inputLimitError, TOOL_INPUT, POUR_VARS } from "./input-limits.js";
16
19
  import { CHOICES, isVietnamese, languageInstruction, words } from "./language.js";
17
20
  import { ProviderRegistry, createProviderRegistry } from "./providers.js";
18
21
  import { acpToolDetail, antigravityToolDetail, boundDetail, claudeToolDetail, clipText, codexToolCall, stripReadGutter, toolError, DETAIL_FILE_PATHS, DETAIL_TEXT_CHARS, DETAIL_WEB_RESULTS, ERROR_CHARS, TOOL_FAILED } from "./tool-detail.js";
22
+ import { checkpointPrompt, compactDue, compactSettings, contextFill, seedPrompt, COMPACT_DEFAULTS } from "./compact.js";
19
23
  export {
20
24
  ATTACHMENT_HEADER,
21
25
  ATTACHMENT_ROUTES,
22
26
  AcpTransport,
23
27
  AntigravityTransport,
28
+ POLICY as CATALOG_POLICY,
29
+ REFRESH_MS as CATALOG_REFRESH_MS,
24
30
  CHOICES,
31
+ COMPACT_DEFAULTS,
25
32
  ClaudeTransport,
26
33
  CodexTransport,
27
34
  ConversationError,
@@ -35,37 +42,56 @@ export {
35
42
  InstructionsAdapter,
36
43
  MAIL_BATCH_CHARS,
37
44
  MAIL_BODY_CHARS,
45
+ ModelCatalog,
38
46
  OWN_START,
39
47
  PIN_KINDS,
48
+ POUR_VARS,
40
49
  ProviderRegistry,
41
50
  SKILL_PLUGIN,
42
51
  TOOL_FAILED,
52
+ TOOL_INPUT,
43
53
  USER,
44
54
  WorkspaceMutationError,
45
55
  acpDecision,
46
56
  acpEnv,
47
57
  acpPermission,
48
58
  acpToolDetail,
59
+ activeCatalog,
60
+ antigravityProbe,
49
61
  antigravityToolDetail,
50
62
  attachmentStageDir,
51
63
  boundDetail,
64
+ entries as catalogEntries,
65
+ checkpointPrompt,
52
66
  claudePermissions,
67
+ claudeProbe,
53
68
  claudeSandboxAvailable,
54
69
  claudeToolDetail,
55
70
  toolShapes as claudeToolShapes,
56
71
  clipText,
72
+ codexProbe,
57
73
  codexToolCall,
74
+ compactDue,
75
+ compactSettings,
76
+ contextFill,
58
77
  createAlpRuntime,
59
78
  createAttachmentStager,
60
79
  createCopy,
61
80
  createProviderRegistry,
81
+ feedCatalog,
62
82
  gitEnvironment,
83
+ inputLimitError,
63
84
  isVietnamese,
64
85
  languageInstruction,
86
+ liveFromContext,
87
+ liveProbes,
88
+ mergeCatalog,
65
89
  models,
66
90
  modes,
91
+ parseAgyModels,
67
92
  processStartedAt,
68
93
  publicEvent,
94
+ reattachWorktree,
69
95
  reclaimCopies,
70
96
  reclaimWorktrees,
71
97
  removeCopy,
@@ -74,6 +100,8 @@ export {
74
100
  renderPin,
75
101
  resolveSession,
76
102
  sameProcessAlive,
103
+ seedPrompt,
104
+ setActiveCatalog,
77
105
  skillDescription,
78
106
  skillPlugin,
79
107
  stagingExposure,
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Size caps for values that reach ALP from a provider or an external MCP server, checked
3
+ * before any schema walks them. Zod before 4.6.6 walks every element of an array before it
4
+ * reports the array's .max(), and a record has no bound at all, so a cap stated only in a
5
+ * schema still costs time and memory in proportion to the input. This walk stops at the first
6
+ * cap the value passes, so its own cost is bounded by the caps, not by the value.
7
+ */
8
+ export type InputLimits = {
9
+ /** UTF-8 bytes of the value as JSON, roughly: strings, keys and separators. */
10
+ bytes: number;
11
+ /** Array elements and object keys, counted over the whole value. */
12
+ items: number;
13
+ /** Arrays and objects inside each other; 1 admits a flat list or object of scalars. */
14
+ depth: number;
15
+ /** Characters in any one string, keys included. */
16
+ string: number;
17
+ };
18
+ /** The arguments of any ALP tool. The longest declared field is alp_delegate's 32,000-character task. */
19
+ export declare const TOOL_INPUT: InputLimits;
20
+ /** alp_task pour's vars: a flat object of text, one value per variable the formula declares. */
21
+ export declare const POUR_VARS: InputLimits;
22
+ /** A formula variable's name, as validateFormula admits it. */
23
+ export declare const VAR_NAME: RegExp;
24
+ /** The first cap `value` passes, as an error that names `what`, or undefined within them. */
25
+ export declare function inputLimitError(value: unknown, limits: InputLimits, what?: string): string | undefined;
@@ -0,0 +1,48 @@
1
+ // packages/runtime/src/input-limits.ts
2
+ var TOOL_INPUT = { bytes: 1024 * 1024, items: 5e3, depth: 8, string: 128 * 1024 };
3
+ var POUR_VARS = { bytes: 128 * 1024, items: 50, depth: 1, string: 2e3 };
4
+ var VAR_NAME = /^[\w-]{1,64}$/;
5
+ function inputLimitError(value, limits, what = "The input") {
6
+ let bytes = 0;
7
+ let items = 0;
8
+ const stack = [[value, 0]];
9
+ const tooLarge = `${what} is too large: over ${limits.bytes} bytes`;
10
+ const text = (string) => {
11
+ if (string.length > limits.string) return `${what} is too large: a text over ${limits.string} characters`;
12
+ bytes += Buffer.byteLength(string) + 2;
13
+ return bytes > limits.bytes ? tooLarge : void 0;
14
+ };
15
+ while (stack.length) {
16
+ const [current, depth] = stack.pop();
17
+ if (typeof current === "string") {
18
+ const error = text(current);
19
+ if (error) return error;
20
+ } else if (current !== null && typeof current === "object") {
21
+ if (depth >= limits.depth) return `${what} is too large: nested over ${limits.depth} levels deep`;
22
+ bytes += 2;
23
+ const list = Array.isArray(current);
24
+ const keys = list ? void 0 : Object.keys(current);
25
+ const size = list ? current.length : keys.length;
26
+ if (items + size > limits.items) return `${what} is too large: over ${limits.items} values`;
27
+ items += size;
28
+ for (let index = 0; index < size; index++) {
29
+ if (keys) {
30
+ const error = text(keys[index]);
31
+ if (error) return error;
32
+ }
33
+ bytes += 1;
34
+ stack.push([list ? current[index] : current[keys[index]], depth + 1]);
35
+ }
36
+ } else {
37
+ bytes += String(current).length;
38
+ }
39
+ if (bytes > limits.bytes) return tooLarge;
40
+ }
41
+ return void 0;
42
+ }
43
+ export {
44
+ POUR_VARS,
45
+ TOOL_INPUT,
46
+ VAR_NAME,
47
+ inputLimitError
48
+ };
@@ -11,6 +11,10 @@ declare const en: {
11
11
  skill: (agent: string, replacing: boolean, file: string, roles: string, lessons: string[]) => string;
12
12
  issue: (agent: string, create: boolean, issue: number | undefined, where: string) => string;
13
13
  issueTitle: string;
14
+ lessonCurate: (agent: string, changes: string) => string;
15
+ lessonRemove: string;
16
+ lessonAdd: string;
17
+ lessonScope: (scope: string, file: string) => string;
14
18
  issueLabels: string;
15
19
  trust: (project: string, names: string) => string;
16
20
  trustYes: string;
@@ -21,10 +25,14 @@ declare const en: {
21
25
  permission: (agent: string, what: string, byRule: boolean, profile: string | undefined, mode: string, always: string | undefined) => string;
22
26
  limitReached: (runtime: string, resetsAt: string | undefined, other: string | undefined, autoResume: boolean, kind: string) => string;
23
27
  limitLifted: (runtime: string, kind: string) => string;
28
+ compacted: (native: boolean) => string;
29
+ compactFailed: (reason: string) => string;
24
30
  usageWarning: (runtime: string, used: string, resetsAt: string | undefined) => string;
25
31
  /** The web app's answer to a Paseo feature ALP has not got yet (ALPD §62). */
26
32
  inDevelopment: string;
27
33
  resumed: (what: string, by: string, parked: boolean) => string;
34
+ diskFull: (reason: string) => string;
35
+ diskLow: (free: string) => string;
28
36
  paused: (what: string, reason: string | undefined, runtime: string | undefined, now: boolean) => string;
29
37
  };
30
38
  export type Words = typeof en;
package/dist/language.js CHANGED
@@ -8,6 +8,12 @@ var en = {
8
8
  ${lessons.map((lesson) => `- ${lesson}`).join("\n")}` : ""),
9
9
  issue: (agent, create, issue, where) => `${agent} wants to ${create ? `open an issue in ${where}` : `comment on issue #${issue} in ${where}`}. It is posted with your GitHub account, and anyone who can see the repository can read it.`,
10
10
  issueTitle: "Title",
11
+ lessonCurate: (agent, changes) => `${agent} proposes to curate the lessons files. Approve to apply every change below at once; nothing else changes.
12
+
13
+ ${changes}`,
14
+ lessonRemove: "Remove",
15
+ lessonAdd: "Add",
16
+ lessonScope: (scope, file) => `${scope === "user" ? "User lessons" : "Project lessons"} (${file})`,
11
17
  issueLabels: "Labels",
12
18
  trust: (project, names) => `This project's hooks run shell commands from ${project} on your machine: ${names}. Trust this workspace's hooks? ALP asks once: after you agree, its hooks run without asking, including hooks added or changed later.`,
13
19
  trustYes: "Trust this workspace",
@@ -18,10 +24,14 @@ ${lessons.map((lesson) => `- ${lesson}`).join("\n")}` : ""),
18
24
  permission: (agent, what, byRule, profile, mode, always) => `${agent} wants to ${what}. ` + (byRule ? `Its permission profile ${profile} asks you each time.` : `Its ${mode} mode does not allow that.`) + (always ? ` Always allow adds ${always} to profile ${profile}.` : ""),
19
25
  limitReached: (runtime, resetsAt, other, autoResume, kind) => `${runtime} usage limit reached${resetsAt ? `; it resets ${resetsAt}` : ""}. ALP paused delegation to ${runtime} agents and parked their assignments${other ? `; ${other} agents keep working` : ""}. ${autoResume ? `ALP asks ${runtime} every minute and resumes it as soon as the limit lifts.` : `ALP asks ${runtime} every minute and tells you when the limit lifts; then run alp resume ${kind}.`}`,
20
26
  limitLifted: (runtime, kind) => `${runtime} says its usage limit has lifted. Run alp resume ${kind} to continue its work.`,
27
+ compacted: (native) => `Main's context was compacted${native ? "" : " into a fresh conversation"}; it keeps its checkpoint and carries on.`,
28
+ compactFailed: (reason) => `Compacting main's context failed (${reason}); ALP tries again later.`,
21
29
  usageWarning: (runtime, used, resetsAt) => `${runtime} has used ${used} of a usage window${resetsAt ? ` that resets ${resetsAt}` : ""}.`,
22
30
  /** The web app's answer to a Paseo feature ALP has not got yet (ALPD §62). */
23
31
  inDevelopment: "This feature is in development",
24
32
  resumed: (what, by, parked) => `${what} resumed by ${by}.${parked ? " Parked assignments continue." : ""}`,
33
+ diskFull: (reason) => `Disk full: ${reason}. ALP paused its work and parked running assignments; it keeps answering. Free some space (alp doctor lists leftover worktrees); ALP checks every minute and continues by itself, or run alp resume.`,
34
+ diskLow: (free) => `Disk space is low: ${free} free. Free some space before it fills (alp doctor lists leftover worktrees); when it is full, ALP pauses its work.`,
25
35
  paused: (what, reason, runtime, now) => `${what} paused by the user${reason ? `: ${reason}` : ""}. Delegation${runtime ? ` to ${runtime} agents` : ""} waits${now ? ", and running assignments park where they are" : "; running turns finish"}. alp resume continues.`
26
36
  };
27
37
  var viWhat = (what) => what.replace(/^run /, "ch\u1EA1y ").replace(/^change files under /, "s\u1EEDa file trong ").replace(/^change files/, "s\u1EEDa file").replace(/^use /, "d\xF9ng ");
@@ -33,6 +43,12 @@ var vi = {
33
43
  ${lessons.map((lesson) => `- ${lesson}`).join("\n")}` : ""),
34
44
  issue: (agent, create, issue, where) => `${agent} mu\u1ED1n ${create ? `m\u1EDF m\u1ED9t issue trong ${where}` : `b\xECnh lu\u1EADn v\xE0o issue #${issue} trong ${where}`}. N\u1ED9i dung \u0111\u01B0\u1EE3c \u0111\u0103ng b\u1EB1ng t\xE0i kho\u1EA3n GitHub c\u1EE7a b\u1EA1n, ai xem \u0111\u01B0\u1EE3c repository \u0111\u1EC1u \u0111\u1ECDc \u0111\u01B0\u1EE3c.`,
35
45
  issueTitle: "Ti\xEAu \u0111\u1EC1",
46
+ lessonCurate: (agent, changes) => `${agent} \u0111\u1EC1 xu\u1EA5t r\xE0 so\xE1t file b\xE0i h\u1ECDc. Duy\u1EC7t \u0111\u1EC3 \xE1p d\u1EE5ng c\xF9ng l\xFAc m\u1ECDi thay \u0111\u1ED5i d\u01B0\u1EDBi \u0111\xE2y; kh\xF4ng thay \u0111\u1ED5i g\xEC kh\xE1c.
47
+
48
+ ${changes}`,
49
+ lessonRemove: "B\u1ECF",
50
+ lessonAdd: "Th\xEAm",
51
+ lessonScope: (scope, file) => `${scope === "user" ? "B\xE0i h\u1ECDc c\u1EE7a ng\u01B0\u1EDDi d\xF9ng" : "B\xE0i h\u1ECDc c\u1EE7a project"} (${file})`,
36
52
  issueLabels: "Nh\xE3n",
37
53
  trust: (project, names) => `C\xE1c hook c\u1EE7a project n\xE0y ch\u1EA1y l\u1EC7nh shell t\u1EEB ${project} tr\xEAn m\xE1y c\u1EE7a b\u1EA1n: ${names}. Tin c\u1EADy c\xE1c hook c\u1EE7a workspace n\xE0y? ALP ch\u1EC9 h\u1ECFi m\u1ED9t l\u1EA7n: khi b\u1EA1n \u0111\u1ED3ng \xFD, c\xE1c hook ch\u1EA1y m\xE0 kh\xF4ng h\u1ECFi l\u1EA1i, k\u1EC3 c\u1EA3 hook th\xEAm ho\u1EB7c s\u1EEDa sau n\xE0y.`,
38
54
  trustYes: "Tin c\u1EADy workspace n\xE0y",
@@ -43,9 +59,13 @@ ${lessons.map((lesson) => `- ${lesson}`).join("\n")}` : ""),
43
59
  permission: (agent, what, byRule, profile, mode, always) => `${agent} mu\u1ED1n ${viWhat(what)}. ` + (byRule ? `H\u1ED3 s\u01A1 quy\u1EC1n ${profile} c\u1EE7a n\xF3 y\xEAu c\u1EA7u h\u1ECFi b\u1EA1n m\u1ED7i l\u1EA7n.` : `Ch\u1EBF \u0111\u1ED9 ${mode} c\u1EE7a n\xF3 kh\xF4ng cho ph\xE9p vi\u1EC7c n\xE0y.`) + (always ? ` Lu\xF4n cho ph\xE9p s\u1EBD th\xEAm ${always} v\xE0o h\u1ED3 s\u01A1 ${profile}.` : ""),
44
60
  limitReached: (runtime, resetsAt, other, autoResume, kind) => `${runtime} \u0111\xE3 h\u1EBFt h\u1EA1n m\u1EE9c s\u1EED d\u1EE5ng${resetsAt ? `; h\u1EA1n m\u1EE9c \u0111\u1EB7t l\u1EA1i l\xFAc ${resetsAt}` : ""}. ALP t\u1EA1m d\u1EEBng giao vi\u1EC7c cho c\xE1c agent ${runtime} v\xE0 t\u1EA1m gi\u1EEF vi\u1EC7c c\u1EE7a ch\xFAng${other ? `; c\xE1c agent ${other} v\u1EABn l\xE0m ti\u1EBFp` : ""}. ${autoResume ? `ALP h\u1ECFi ${runtime} m\u1ED7i ph\xFAt v\xE0 t\u1EF1 ch\u1EA1y l\u1EA1i ngay khi c\xF3 h\u1EA1n m\u1EE9c.` : `ALP h\u1ECFi ${runtime} m\u1ED7i ph\xFAt v\xE0 b\xE1o khi c\xF3 h\u1EA1n m\u1EE9c tr\u1EDF l\u1EA1i; khi \u0111\xF3 ch\u1EA1y alp resume ${kind}.`}`,
45
61
  limitLifted: (runtime, kind) => `${runtime} b\xE1o \u0111\xE3 c\xF3 h\u1EA1n m\u1EE9c tr\u1EDF l\u1EA1i. Ch\u1EA1y alp resume ${kind} \u0111\u1EC3 l\xE0m ti\u1EBFp vi\u1EC7c c\u1EE7a n\xF3.`,
62
+ compacted: (native) => `Context c\u1EE7a main \u0111\xE3 \u0111\u01B0\u1EE3c compact${native ? "" : " sang m\u1ED9t cu\u1ED9c h\u1ED9i tho\u1EA1i m\u1EDBi"}; main gi\u1EEF checkpoint v\xE0 l\xE0m ti\u1EBFp.`,
63
+ compactFailed: (reason) => `Compact context c\u1EE7a main th\u1EA5t b\u1EA1i (${reason}); ALP s\u1EBD th\u1EED l\u1EA1i sau.`,
46
64
  usageWarning: (runtime, used, resetsAt) => `${runtime} \u0111\xE3 d\xF9ng ${used} h\u1EA1n m\u1EE9c c\u1EE7a k\u1EF3 n\xE0y${resetsAt ? `, k\u1EF3 \u0111\u1EB7t l\u1EA1i l\xFAc ${resetsAt}` : ""}.`,
47
65
  inDevelopment: "T\xEDnh n\u0103ng \u0111ang ph\xE1t tri\u1EC3n",
48
66
  resumed: (what, by, parked) => `${what} \u0111\xE3 ch\u1EA1y l\u1EA1i, b\u1EDFi ${by}.${parked ? " C\xE1c vi\u1EC7c \u0111ang t\u1EA1m gi\u1EEF \u0111\u01B0\u1EE3c l\xE0m ti\u1EBFp." : ""}`,
67
+ diskFull: (reason) => `\u0110\u0129a \u0111\u1EA7y: ${reason === "the disk is full" ? "\u0111\u0129a h\u1EBFt dung l\u01B0\u1EE3ng" : reason === "the disk is read-only" ? "\u0111\u0129a ch\u1EC9 \u0111\u1ECDc" : reason}. ALP \u0111\xE3 t\u1EA1m d\u1EEBng c\xF4ng vi\u1EC7c v\xE0 t\u1EA1m gi\u1EEF c\xE1c vi\u1EC7c \u0111ang ch\u1EA1y; ALP v\u1EABn tr\u1EA3 l\u1EDDi. H\xE3y gi\u1EA3i ph\xF3ng dung l\u01B0\u1EE3ng (alp doctor li\u1EC7t k\xEA c\xE1c worktree c\xF2n s\xF3t); ALP ki\u1EC3m tra m\u1ED7i ph\xFAt v\xE0 t\u1EF1 l\xE0m ti\u1EBFp, ho\u1EB7c ch\u1EA1y alp resume.`,
68
+ diskLow: (free) => `\u0110\u0129a s\u1EAFp \u0111\u1EA7y: c\xF2n ${free} tr\u1ED1ng. H\xE3y gi\u1EA3i ph\xF3ng dung l\u01B0\u1EE3ng tr\u01B0\u1EDBc khi \u0111\u1EA7y (alp doctor li\u1EC7t k\xEA c\xE1c worktree c\xF2n s\xF3t); khi \u0111\u0129a \u0111\u1EA7y, ALP s\u1EBD t\u1EA1m d\u1EEBng c\xF4ng vi\u1EC7c.`,
49
69
  paused: (what, reason, runtime, now) => `${what} \u0111\xE3 b\u1ECB ng\u01B0\u1EDDi d\xF9ng t\u1EA1m d\u1EEBng${reason ? `: ${reason}` : ""}. Vi\u1EC7c giao${runtime ? ` cho c\xE1c agent ${runtime}` : ""} ph\u1EA3i ch\u1EDD${now ? ", c\xE1c vi\u1EC7c \u0111ang ch\u1EA1y \u0111\u01B0\u1EE3c t\u1EA1m gi\u1EEF t\u1EA1i ch\u1ED7" : "; c\xE1c l\u01B0\u1EE3t \u0111ang ch\u1EA1y v\u1EABn ch\u1EA1y h\u1EBFt"}. Ch\u1EA1y alp resume \u0111\u1EC3 ti\u1EBFp t\u1EE5c.`
50
70
  };
51
71
  function words(language) {
@@ -1,3 +1,4 @@
1
+ import { type InputLimits } from './input-limits.js';
1
2
  type Tool = {
2
3
  name: string;
3
4
  description: string;
@@ -11,6 +12,13 @@ type Server = {
11
12
  url?: string;
12
13
  http_headers?: Record<string, string>;
13
14
  };
15
+ /** What one external MCP server may list: pages of tools/list, and tools over all of them. */
16
+ export declare const MCP_TOOLS: {
17
+ pages: number;
18
+ tools: number;
19
+ };
20
+ /** One tools/list result, checked before the MCP SDK parses it with ListToolsResultSchema. */
21
+ export declare const MCP_TOOLS_PAGE: InputLimits;
14
22
  /** Session-owned MCP clients. Only tool aliases cross the agy bridge; no server
15
23
  * command, URL, environment or authorization header is persisted in agy's config.
16
24
  */