@agimon-ai/po-codemode 0.0.1-alpha.3 → 0.0.1-alpha.4

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.
@@ -2,11 +2,16 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_codemodeTools = require("../codemodeTools-CLgSDqfU.cjs");
5
+ const require_codemodeTools = require("../codemodeTools-BQDVk-4P.cjs");
6
6
  let _agimon_ai_po_core_codemode = require("@agimon-ai/po-core/codemode");
7
+ let typebox = require("typebox");
7
8
  let _agimon_ai_po_core_serverPlugin = require("@agimon-ai/po-core/serverPlugin");
8
9
  let _agimon_ai_po_core_extensionFile = require("@agimon-ai/po-core/extensionFile");
10
+ let _agimon_ai_po_config = require("@agimon-ai/po-config");
9
11
  let _agimon_ai_po_core_platform = require("@agimon-ai/po-core/platform");
12
+ let _agimon_ai_po_config_majorModes = require("@agimon-ai/po-config/majorModes");
13
+ let typebox_value = require("typebox/value");
14
+ let typebox_schema = require("typebox/schema");
10
15
  //#region src/services/codemodeScripts/index.ts
11
16
  const SESSION_FOLDER = "codemode";
12
17
  const SESSION_PREFIX = "session:";
@@ -116,9 +121,377 @@ var FileSystemCodemodeScriptsService = class {
116
121
  }
117
122
  };
118
123
  //#endregion
124
+ //#region src/schemas/packageConfig.ts
125
+ const CODEMODE_PACKAGE = "@agimon-ai/po-codemode";
126
+ const CodemodePackageConfigSchema = typebox.Type.Object({ llmModel: typebox.Type.Optional(typebox.Type.String({
127
+ pattern: "^[^/\\s]+/\\S+$",
128
+ maxLength: 256
129
+ })) }, { additionalProperties: false });
130
+ //#endregion
131
+ //#region src/services/llmConfig/index.ts
132
+ const PO_CODEMODE_LLM_CONFIG_SERVICE = "po/codemode-llm-config";
133
+ /** Session policy is loaded once per immutable Po config snapshot, including failed loads. */
134
+ var LlmConfigService = class {
135
+ io;
136
+ snapshot;
137
+ loads = /* @__PURE__ */ new WeakMap();
138
+ constructor(io) {
139
+ this.io = io;
140
+ }
141
+ bind(snapshot) {
142
+ this.snapshot = snapshot;
143
+ return () => {
144
+ if (this.snapshot === snapshot) this.snapshot = void 0;
145
+ };
146
+ }
147
+ current() {
148
+ if (!this.snapshot) return Promise.resolve({});
149
+ const snapshot = this.snapshot();
150
+ let load = this.loads.get(snapshot);
151
+ if (!load) {
152
+ load = this.load(snapshot);
153
+ this.loads.set(snapshot, load);
154
+ }
155
+ return load;
156
+ }
157
+ async load(snapshot) {
158
+ if (!snapshot.harness.root) return {};
159
+ const { environment, homeDirectory } = this.io;
160
+ const fs = this.io.fs();
161
+ if (!fs || !homeDirectory) throw new Error("Code mode LLM configuration requires host filesystem and home.");
162
+ const modes = await (0, _agimon_ai_po_config_majorModes.readMajorModesConfig)(fs, snapshot.harness.root, _agimon_ai_po_core_platform.BACKGROUND_CONTEXT, {
163
+ environment,
164
+ homeDirectory
165
+ });
166
+ const configurations = await (0, _agimon_ai_po_config_majorModes.readPackageConfigurations)(fs, modes, [...snapshot.harness.layers], CODEMODE_PACKAGE, _agimon_ai_po_core_platform.BACKGROUND_CONTEXT);
167
+ let merged = {};
168
+ for (const entry of configurations) {
169
+ if (!(0, typebox_value.Check)(CodemodePackageConfigSchema, entry.config)) throw new TypeError("Invalid code mode package configuration: llmModel must be provider/modelId.");
170
+ merged = {
171
+ ...merged,
172
+ ...entry.config
173
+ };
174
+ }
175
+ return merged;
176
+ }
177
+ };
178
+ //#endregion
179
+ //#region src/services/llmNamespace/index.ts
180
+ const MAX_INPUT_BYTES = 65536;
181
+ const MAX_SCHEMA_BYTES = 16384;
182
+ const MAX_OUTPUT_BYTES = 65536;
183
+ const MAX_CALLS = 8;
184
+ const MAX_CONCURRENT = 2;
185
+ const DEFAULT_TOKENS = 1024;
186
+ const MAX_TOKENS = 4096;
187
+ const RESULT_TOOL = "return_result";
188
+ const MODEL = /^[^/\s]+\/\S+$/u;
189
+ const META = typebox_schema.Meta["http://json-schema.org/draft-07/schema#"];
190
+ const DECLARATIONS$1 = `interface LlmRequest {
191
+ prompt: string;
192
+ /** Explicit JSON input only, never the surrounding conversation. */
193
+ input?: unknown;
194
+ system?: string;
195
+ /** provider/modelId; overrides llmModel config and the live session model. */
196
+ model?: string;
197
+ /** Defaults to 1024, maximum 4096. */
198
+ maxTokens?: number;
199
+ }
200
+ declare const llm: {
201
+ /** One-shot text transform. At most 8 calls per exec, 2 concurrently. */
202
+ complete(request: LlmRequest): Promise<{ text: string; model: string }>;
203
+ /** Object-root JSON Schema (draft 7), local nonrecursive refs only. Invalid output rejects without retry. */
204
+ json(request: LlmRequest & { schema: Record<string, unknown> }): Promise<{ value: unknown; model: string }>;
205
+ };`;
206
+ function jsonText(value, limit, label) {
207
+ const json = JSON.stringify(value, (_key, item) => {
208
+ if (item === void 0 || typeof item === "function" || typeof item === "symbol" || typeof item === "bigint" || typeof item === "number" && !Number.isFinite(item)) throw new TypeError(`${label} must be JSON serializable.`);
209
+ return item;
210
+ });
211
+ if (json === void 0) throw new TypeError(`${label} must be JSON serializable.`);
212
+ if (new TextEncoder().encode(json).length > limit) throw new RangeError(`${label} exceeds ${limit} bytes.`);
213
+ return json;
214
+ }
215
+ function object(value) {
216
+ return value !== null && typeof value === "object" && !Array.isArray(value);
217
+ }
218
+ /** Reject unsupported references and recursive schemas before spending tokens or entering the validator. */
219
+ function checkedSchema(value) {
220
+ const schema = JSON.parse(jsonText(value, MAX_SCHEMA_BYTES, "LLM schema"));
221
+ if (!object(schema) || schema.type !== "object") throw new TypeError("LLM schema must have type: object.");
222
+ if (schema.$schema !== void 0 && schema.$schema !== "http://json-schema.org/draft-07/schema#") throw new TypeError("LLM schema supports JSON Schema draft 7 only.");
223
+ if (!(0, typebox_schema.Check)(META, schema)) throw new TypeError("Invalid LLM JSON Schema.");
224
+ let expanded = 0;
225
+ const visit = (node, ancestors) => {
226
+ if (!object(node)) return;
227
+ if (++expanded > 1024) throw new TypeError("LLM schema exceeds 1024 expanded schema nodes.");
228
+ if (ancestors.length > 32 || ancestors.includes(node)) throw new TypeError("LLM schema references must be nonrecursive and at most 32 levels deep.");
229
+ const stack = [...ancestors, node];
230
+ if (node.$dynamicRef !== void 0 || node.$recursiveRef !== void 0 || node.$id !== void 0) throw new TypeError("LLM schema supports local $ref only, without $id.");
231
+ if (node.$ref !== void 0) {
232
+ if (typeof node.$ref !== "string" || !node.$ref.startsWith("#/")) throw new TypeError("LLM schema supports local JSON-pointer $ref only.");
233
+ let resolved = schema;
234
+ for (const segment of node.$ref.slice(2).split("/")) {
235
+ const key = segment.replace(/~1/gu, "/").replace(/~0/gu, "~");
236
+ resolved = resolved !== null && typeof resolved === "object" && Object.hasOwn(resolved, key) ? Reflect.get(resolved, key) : void 0;
237
+ }
238
+ if (!object(resolved) && typeof resolved !== "boolean") throw new TypeError("Unresolved LLM schema $ref.");
239
+ visit(resolved, stack);
240
+ }
241
+ for (const key of [
242
+ "properties",
243
+ "patternProperties",
244
+ "definitions",
245
+ "$defs",
246
+ "dependencies"
247
+ ]) if (object(node[key])) for (const child of Object.values(node[key])) visit(child, stack);
248
+ for (const key of [
249
+ "items",
250
+ "additionalItems",
251
+ "additionalProperties",
252
+ "contains",
253
+ "propertyNames",
254
+ "not",
255
+ "if",
256
+ "then",
257
+ "else",
258
+ "allOf",
259
+ "anyOf",
260
+ "oneOf"
261
+ ]) {
262
+ const child = node[key];
263
+ if (Array.isArray(child)) for (const item of child) visit(item, stack);
264
+ else visit(child, stack);
265
+ }
266
+ };
267
+ visit(schema, []);
268
+ return schema;
269
+ }
270
+ function request$1(value, structured) {
271
+ if (!object(value)) throw new TypeError("LLM request must be an object.");
272
+ const allowed = [
273
+ "prompt",
274
+ "input",
275
+ "system",
276
+ "model",
277
+ "maxTokens",
278
+ ...structured ? ["schema"] : []
279
+ ];
280
+ if (Object.keys(value).some((key) => !allowed.includes(key))) throw new TypeError("Unknown LLM request field.");
281
+ if (typeof value.prompt !== "string" || !value.prompt.trim()) throw new TypeError("LLM prompt must be nonempty text.");
282
+ if (value.system !== void 0 && typeof value.system !== "string") throw new TypeError("LLM system must be text.");
283
+ if (value.model !== void 0 && (typeof value.model !== "string" || !MODEL.test(value.model) || value.model.length > 256)) throw new TypeError("LLM model must be provider/modelId.");
284
+ if (value.maxTokens !== void 0 && (!Number.isInteger(value.maxTokens) || Number(value.maxTokens) < 1 || Number(value.maxTokens) > MAX_TOKENS)) throw new RangeError(`LLM maxTokens must be an integer from 1 to ${MAX_TOKENS}.`);
285
+ return {
286
+ prompt: value.prompt,
287
+ ...value.input === void 0 ? {} : { input: value.input },
288
+ ...value.system === void 0 ? {} : { system: value.system },
289
+ ...value.model === void 0 ? {} : { model: value.model },
290
+ ...value.maxTokens === void 0 ? {} : { maxTokens: value.maxTokens },
291
+ ...structured ? { schema: checkedSchema(value.schema) } : {}
292
+ };
293
+ }
294
+ /** Explicit data transforms over the host's guarded completions, never a tool-using agent. */
295
+ function createLlmNamespace(options) {
296
+ const { context } = options;
297
+ return {
298
+ name: "llm",
299
+ summary: "One-shot LLM text and schema-validated JSON transforms. Explicit input only, bounded calls, no tools or retries.",
300
+ declarations: DECLARATIONS$1,
301
+ portable: true,
302
+ bind(run) {
303
+ if (run.sessionId !== context.sessionId) throw new Error("LLM namespace belongs to another session.");
304
+ let disposed = false;
305
+ let calls = 0;
306
+ let active = 0;
307
+ run.onDispose(() => {
308
+ disposed = true;
309
+ });
310
+ const available = () => {
311
+ run.signal.throwIfAborted();
312
+ if (disposed) throw new Error("LLM namespace run is disposed.");
313
+ };
314
+ const call = async (input, structured) => {
315
+ available();
316
+ if (calls >= MAX_CALLS) throw new RangeError(`At most ${MAX_CALLS} LLM calls per exec.`);
317
+ if (active >= MAX_CONCURRENT) throw new RangeError(`At most ${MAX_CONCURRENT} concurrent LLM calls per exec.`);
318
+ const params = request$1(input, structured);
319
+ const userInput = params.input === void 0 ? params.prompt : `${params.prompt}\n\nInput (JSON):\n${jsonText(params.input, MAX_INPUT_BYTES, "LLM input")}`;
320
+ const systemPrompt = `${params.system ?? "Transform only the explicit input according to the request."}${structured ? "\nCall return_result exactly once with the result. Do not call other tools." : ""}`;
321
+ if (new TextEncoder().encode(systemPrompt + userInput).length > MAX_INPUT_BYTES) throw new RangeError("LLM prompt and input exceed 65536 bytes.");
322
+ active += 1;
323
+ const started = Date.now();
324
+ let model;
325
+ let tokens;
326
+ const record = (ok, error) => run.record?.({
327
+ name: structured ? "llm.json" : "llm.complete",
328
+ tool: "llm",
329
+ args: {
330
+ ...model ? { model } : {},
331
+ maxTokens: params.maxTokens ?? DEFAULT_TOKENS
332
+ },
333
+ ok,
334
+ ms: Date.now() - started,
335
+ ...error === void 0 ? {} : { error },
336
+ ...tokens === void 0 ? {} : { result: {
337
+ content: [],
338
+ details: { totalTokens: tokens }
339
+ } }
340
+ });
341
+ try {
342
+ const config = await options.config();
343
+ const current = params.model || config.llmModel ? void 0 : (await context.session.readModelSettings?.())?.model ?? context.model;
344
+ model = params.model ?? config.llmModel ?? (current ? `${current.provider}/${current.id}` : void 0);
345
+ available();
346
+ if (!model || !context.textCompletion?.available(model)) throw new Error(`LLM model is unavailable${model ? `: ${model}` : ""}.`);
347
+ if (structured ? !context.toolCompletion : !context.textCompletion) throw new Error("LLM completion is unavailable on this host.");
348
+ if (calls >= MAX_CALLS) throw new RangeError(`At most ${MAX_CALLS} LLM calls per exec.`);
349
+ calls += 1;
350
+ const completion = {
351
+ systemPrompt,
352
+ input: userInput,
353
+ maxTokens: params.maxTokens ?? DEFAULT_TOKENS,
354
+ signal: run.signal,
355
+ recordUsage: true
356
+ };
357
+ if (!structured) {
358
+ const text = await context.textCompletion.complete(model, completion);
359
+ available();
360
+ jsonText(text, MAX_OUTPUT_BYTES, "LLM output");
361
+ record(true);
362
+ return {
363
+ text,
364
+ model
365
+ };
366
+ }
367
+ const schema = params.schema;
368
+ const response = await context.toolCompletion.complete(model, {
369
+ ...completion,
370
+ tools: [{
371
+ name: RESULT_TOOL,
372
+ description: "Return the requested structured result.",
373
+ parameters: schema
374
+ }]
375
+ });
376
+ tokens = response.usage.totalTokens;
377
+ available();
378
+ if (response.toolCalls.length !== 1 || response.toolCalls[0]?.name !== RESULT_TOOL) throw new Error("LLM must return exactly one return_result call.");
379
+ const value = JSON.parse(jsonText(response.toolCalls[0].arguments, MAX_OUTPUT_BYTES, "LLM output"));
380
+ if (!(0, typebox_schema.Check)(schema, value)) {
381
+ const [, errors] = (0, typebox_schema.Errors)(schema, value);
382
+ throw new TypeError(`LLM result failed schema validation: ${errors[0]?.message ?? "invalid result"}`);
383
+ }
384
+ record(true);
385
+ return {
386
+ value,
387
+ model
388
+ };
389
+ } catch (error) {
390
+ record(false, error instanceof Error ? error.message : String(error));
391
+ throw error;
392
+ } finally {
393
+ active -= 1;
394
+ }
395
+ };
396
+ return {
397
+ complete: (input) => call(input, false),
398
+ json: (input) => call(input, true)
399
+ };
400
+ }
401
+ };
402
+ }
403
+ //#endregion
404
+ //#region src/services/shellNamespace/index.ts
405
+ const DEFAULT_TIMEOUT_MS = 1e4;
406
+ const MAX_TIMEOUT_MS = 12e4;
407
+ const MAX_COMMAND_CHARS = 65536;
408
+ const MAX_OUTPUT_CHARS = 32768;
409
+ const TRUNCATED = "\n[truncated]";
410
+ const DECLARATIONS = `declare const shell: {
411
+ /** Short foreground Bash command in the session cwd/environment. Nonzero exits are returned; cancellation and timeout reject. */
412
+ bash(input: { command: string; timeoutMs?: number }): Promise<{ stdout: string; stderr: string; exitCode: number }>;
413
+ };`;
414
+ function request(input) {
415
+ if (input === null || typeof input !== "object" || Array.isArray(input)) throw new TypeError("shell.bash expects an object.");
416
+ const value = input;
417
+ if (Object.keys(value).some((key) => key !== "command" && key !== "timeoutMs")) throw new TypeError("shell.bash accepts only command and timeoutMs.");
418
+ if (typeof value.command !== "string" || !value.command.trim() || value.command.length > MAX_COMMAND_CHARS) throw new TypeError(`shell.bash command must be nonempty text of at most ${MAX_COMMAND_CHARS} characters.`);
419
+ if (value.timeoutMs !== void 0 && (!Number.isInteger(value.timeoutMs) || Number(value.timeoutMs) < 1 || Number(value.timeoutMs) > MAX_TIMEOUT_MS)) throw new RangeError(`shell.bash timeoutMs must be an integer from 1 to ${MAX_TIMEOUT_MS}.`);
420
+ return {
421
+ command: value.command,
422
+ timeoutMs: value.timeoutMs
423
+ };
424
+ }
425
+ /** Deadline-bound commands for post-processing, separate from Runner's supervised processes. */
426
+ function createShellNamespace(options) {
427
+ return {
428
+ name: "shell",
429
+ summary: "Run short foreground Bash commands with bounded stdout/stderr and a deadline. No background or interactive mode.",
430
+ declarations: DECLARATIONS,
431
+ portable: true,
432
+ bind(run) {
433
+ if (run.sessionId !== options.context.sessionId) throw new Error("Shell namespace belongs to another session.");
434
+ const disposal = new AbortController();
435
+ const lifetime = AbortSignal.any([run.signal, disposal.signal]);
436
+ run.onDispose(() => disposal.abort(/* @__PURE__ */ new Error("Shell namespace run is disposed.")));
437
+ return { async bash(input) {
438
+ lifetime.throwIfAborted();
439
+ const params = request(input);
440
+ const shell = options.shell();
441
+ if (!shell) throw new Error("Shell commands are not available on this host.");
442
+ const timeoutMs = params.timeoutMs ?? DEFAULT_TIMEOUT_MS;
443
+ const signal = AbortSignal.any([lifetime, AbortSignal.timeout(timeoutMs)]);
444
+ const output = {
445
+ stdout: "",
446
+ stderr: ""
447
+ };
448
+ const truncated = {
449
+ stdout: false,
450
+ stderr: false
451
+ };
452
+ const started = Date.now();
453
+ let ok = false;
454
+ let failure;
455
+ try {
456
+ const result = await shell.exec(params.command, {
457
+ cwd: options.context.cwd,
458
+ env: Object.fromEntries(Object.entries(options.context.environment).filter((entry) => entry[1] !== void 0)),
459
+ inheritEnv: false,
460
+ onOutput: (text, _context, { stream }) => {
461
+ const remaining = MAX_OUTPUT_CHARS - output[stream].length;
462
+ output[stream] += text.slice(0, remaining);
463
+ if (text.length > remaining) truncated[stream] = true;
464
+ }
465
+ }, (0, _agimon_ai_po_core_platform.withAbortSignal)(signal, _agimon_ai_po_core_platform.BACKGROUND_CONTEXT));
466
+ signal.throwIfAborted();
467
+ const { exitCode } = (0, _agimon_ai_po_core_platform.getOrThrow)(result);
468
+ ok = exitCode === 0;
469
+ return {
470
+ stdout: output.stdout + (truncated.stdout ? TRUNCATED : ""),
471
+ stderr: output.stderr + (truncated.stderr ? TRUNCATED : ""),
472
+ exitCode
473
+ };
474
+ } catch (error) {
475
+ failure = error instanceof Error ? error.message : String(error);
476
+ throw error;
477
+ } finally {
478
+ run.record?.({
479
+ name: "shell.bash",
480
+ tool: "shell",
481
+ args: { timeoutMs },
482
+ ok,
483
+ ms: Date.now() - started,
484
+ ...failure === void 0 ? {} : { error: failure }
485
+ });
486
+ }
487
+ } };
488
+ }
489
+ };
490
+ }
491
+ //#endregion
119
492
  //#region src/extensions/workspaces/sessions/(backend)/_lib/root.server.ts
120
493
  /** One registry per session: contributors register into it, `discover` and `exec` read it. */
121
- function createCodemodeSession({ context }) {
494
+ function createCodemodeSession({ context, agent, host }) {
122
495
  const registry = require_codemodeTools.createCodemodeRegistry();
123
496
  context.inject([_agimon_ai_po_core_serverPlugin.PO_SERVER_SCOPE_SERVICE], (scoped) => (0, _agimon_ai_po_core_serverPlugin.requirePoServerScope)(scoped).provide(_agimon_ai_po_core_codemode.PO_CODEMODE_CONTRACT, registry));
124
497
  let temporaryDirectory;
@@ -133,14 +506,46 @@ function createCodemodeSession({ context }) {
133
506
  fs: () => (0, _agimon_ai_po_core_platform.readPoFs)(context),
134
507
  temporaryDirectory: () => temporaryDirectory
135
508
  });
136
- return { value: {
137
- registry,
138
- ...require_codemodeTools.createCodemodeTools({
509
+ const execution = agent?.context;
510
+ const config = execution ? new LlmConfigService({
511
+ fs: () => (0, _agimon_ai_po_core_platform.readPoFs)(context),
512
+ environment: execution.environment,
513
+ homeDirectory: host.context.homeDirectory
514
+ }) : void 0;
515
+ let disposeNamespaces;
516
+ if (execution && config) {
517
+ context.inject([_agimon_ai_po_config.PO_CONFIG_SERVICE], (scoped) => {
518
+ const service = scoped.get(_agimon_ai_po_config.PO_CONFIG_SERVICE);
519
+ return service ? config.bind(() => service.getSnapshot()) : void 0;
520
+ });
521
+ const registration = registry.register("@agimon-ai/po-codemode", createLlmNamespace({
522
+ context: execution,
523
+ config: () => config.current()
524
+ }));
525
+ const shellRegistration = registry.register("@agimon-ai/po-codemode", createShellNamespace({
526
+ context: execution,
527
+ shell: () => context.get(_agimon_ai_po_core_platform.PO_SHELL_SERVICE)
528
+ }));
529
+ disposeNamespaces = () => {
530
+ registration.dispose();
531
+ shellRegistration.dispose();
532
+ };
533
+ }
534
+ return {
535
+ value: {
139
536
  registry,
140
- isolate: () => (0, _agimon_ai_po_core_platform.readPoIsolate)(context),
141
- scripts
142
- })
143
- } };
537
+ ...require_codemodeTools.createCodemodeTools({
538
+ registry,
539
+ isolate: () => (0, _agimon_ai_po_core_platform.readPoIsolate)(context),
540
+ npm: () => (0, _agimon_ai_po_core_platform.readPoNpm)(context),
541
+ scripts
542
+ })
543
+ },
544
+ services: [(scoped) => {
545
+ if (config) scoped.provide(PO_CODEMODE_LLM_CONFIG_SERVICE, config);
546
+ }],
547
+ onDispose: () => disposeNamespaces?.()
548
+ };
144
549
  }
145
550
  const root = (0, _agimon_ai_po_core_extensionFile.defineRoot)(createCodemodeSession);
146
551
  //#endregion
@@ -150,6 +555,26 @@ var root_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoot)(root)
150
555
  //#region src/extensions/workspaces/sessions/(backend)/contract/codemode.server.ts
151
556
  var codemode_server_default = (0, _agimon_ai_po_core_extensionFile.defineServiceContract)(_agimon_ai_po_core_codemode.PO_CODEMODE_SERVICE, { scope: "session" });
152
557
  //#endregion
558
+ //#region src/extensions/workspaces/sessions/(backend)/resource/codemode-how-to-llm.server.ts
559
+ var codemode_how_to_llm_server_default = (0, _agimon_ai_po_core_extensionFile.defineResource)({
560
+ name: "codemode-how-to-llm",
561
+ description: "Use the llm namespace for one-shot text and schema-checked JSON transformations inside exec.",
562
+ pinned: true,
563
+ kind: "skill",
564
+ path: (0, _agimon_ai_po_core_serverPlugin.packageResourcePath)(require("url").pathToFileURL(__filename).href, "src/prompts/codemode-how-to-llm/SKILL.md"),
565
+ read: () => (0, _agimon_ai_po_core_serverPlugin.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/codemode-how-to-llm/SKILL.md")
566
+ });
567
+ //#endregion
568
+ //#region src/extensions/workspaces/sessions/(backend)/resource/codemode-how-to-shell.server.ts
569
+ var codemode_how_to_shell_server_default = (0, _agimon_ai_po_core_extensionFile.defineResource)({
570
+ name: "codemode-how-to-shell",
571
+ description: "Use shell.bash for short deadline-bound Bash commands and code-side output post-processing.",
572
+ pinned: true,
573
+ kind: "skill",
574
+ path: (0, _agimon_ai_po_core_serverPlugin.packageResourcePath)(require("url").pathToFileURL(__filename).href, "src/prompts/codemode-how-to-shell/SKILL.md"),
575
+ read: () => (0, _agimon_ai_po_core_serverPlugin.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/codemode-how-to-shell/SKILL.md")
576
+ });
577
+ //#endregion
153
578
  //#region src/extensions/workspaces/sessions/(backend)/resource/how-to-codemode.server.ts
154
579
  var how_to_codemode_server_default = (0, _agimon_ai_po_core_extensionFile.defineResource)({
155
580
  name: "how-to-codemode",
@@ -186,7 +611,11 @@ const serverPlugin = (0, _agimon_ai_po_core_serverPlugin.defineServerPlugin)({
186
611
  return {
187
612
  ...(0, _agimon_ai_po_core_extensionFile.composeRootHooks)(scopeSession),
188
613
  get resources() {
189
- return [at(how_to_codemode_server_default, contextSession)];
614
+ return [
615
+ at(codemode_how_to_llm_server_default, contextSession),
616
+ at(codemode_how_to_shell_server_default, contextSession),
617
+ at(how_to_codemode_server_default, contextSession)
618
+ ];
190
619
  },
191
620
  get tools() {
192
621
  return [via({ name: "discover" }, at(discover_server_default, contextSession)), via({ name: "exec" }, at(exec_server_default, contextSession))];