@mcpc-tech/plugin-markdown-loader 0.0.6 → 0.0.8

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/index.cjs CHANGED
@@ -433,9 +433,7 @@ var SystemPrompts = {
433
433
  * - `man` command for fetching tool schemas (like Unix manual)
434
434
  * - No `hasDefinitions` - trusts model's context memory
435
435
  */
436
- AUTONOMOUS_EXECUTION: `Agentic tool \`{toolName}\` that executes complex tasks by iteratively selecting and calling tools.
437
-
438
- You must follow the <manual/>, obey the <rules/>, and use the <format/>.
436
+ AUTONOMOUS_EXECUTION: `Agentic tool \`{toolName}\` that executes tasks by calling its tools, following the <manual/>, obeying the <rules/>, and using the <format/>.
439
437
 
440
438
  <manual>
441
439
  {description}
@@ -449,26 +447,11 @@ You must follow the <manual/>, obey the <rules/>, and use the <format/>.
449
447
  <rules>
450
448
  1. **First call**: Use \`man\` to get tool schemas you need
451
449
  2. **Execute tools**: Use tool name in \`tool\` and parameters in \`args\`
452
- 3. **Parallel calls**: If your client supports it, call \`man\` and execute tools simultaneously
453
- 4. Note: You are an agent exposed as an MCP tool
454
450
  </rules>
455
451
 
456
452
  <format>
457
- Get tool schemas:
458
- \`\`\`json
459
- {
460
- "tool": "man",
461
- "args": { "tools": ["tool1", "tool2"] }
462
- }
463
- \`\`\`
464
-
465
- Execute a tool:
466
- \`\`\`json
467
- {
468
- "tool": "tool_name",
469
- "args": { /* tool parameters */ }
470
- }
471
- \`\`\`
453
+ Get tool schemas: \`{ "tool": "man", "args": { "tools": ["tool1", "tool2"] } }\`
454
+ Execute a tool: \`{ "tool": "tool_name", "args": { /* parameters */ } }\`
472
455
  </format>`,
473
456
  /**
474
457
  * Compact system prompt for autonomous MCP execution (when manual is provided)
@@ -477,14 +460,17 @@ Execute a tool:
477
460
  * - Short description shown by default
478
461
  * - Use `man` command with args `{ manual: true }` to get full manual
479
462
  */
480
- AUTONOMOUS_EXECUTION_COMPACT: `Agentic tool \`{toolName}\`: {description}
463
+ AUTONOMOUS_EXECUTION_COMPACT: `Agentic tool \`{toolName}\` that executes tasks by calling its tools, following the <rules/> and using the <format/>.
464
+
465
+ {description}
481
466
 
482
- Use \`man\` command with args \`{ tools: [], manual: true }\` to get the full manual, or \`{ tools: ["tool1"] }\` to get tool schemas.
467
+ <rules>
468
+ 1. **First call**: Use \`man\` to get tool schemas and full manual
469
+ 2. **Execute tools**: Use tool name in \`tool\` and parameters in \`args\`
470
+ </rules>
483
471
 
484
472
  <format>
485
- Get full manual: \`{ "tool": "man", "args": { "tools": [], "manual": true } }\`
486
- Get tool schemas: \`{ "tool": "man", "args": { "tools": ["tool1", "tool2"] } }\`
487
- Get both: \`{ "tool": "man", "args": { "tools": ["tool1"], "manual": true } }\`
473
+ Get manual + schemas: \`{ "tool": "man", "args": { "tools": ["tool1"], "manual": true } }\`
488
474
  Execute a tool: \`{ "tool": "tool_name", "args": { /* parameters */ } }\`
489
475
  </format>`,
490
476
  /**
@@ -525,30 +511,12 @@ You must follow the <manual/>, obey the <rules/>, and use the <format/>.
525
511
  </rules>{context}`
526
512
  };
527
513
  var ResponseTemplates = {
528
- /**
529
- * Success response for action execution
530
- */
531
- ACTION_SUCCESS: `Action \`{currentAction}\` completed.
532
-
533
- Next: Execute \`{nextAction}\` by calling \`{toolName}\` again.`,
534
- /**
535
- * Planning prompt when no next action is specified
536
- */
537
- PLANNING_PROMPT: `Action \`{currentAction}\` completed. Determine next step:
538
-
539
- 1. Analyze results from \`{currentAction}\`
540
- 2. Decide: Continue with another action or Complete?
541
- 3. Call \`{toolName}\` with chosen action or \`decision: "complete"\``,
542
514
  /**
543
515
  * Error response templates
544
516
  */
545
517
  ERROR_RESPONSE: `Validation failed: {errorMessage}
546
518
 
547
519
  Adjust parameters and retry.`,
548
- /**
549
- * Completion message
550
- */
551
- COMPLETION_MESSAGE: `Task completed.`,
552
520
  /**
553
521
  * Security validation messages
554
522
  */
@@ -566,13 +534,10 @@ var CompiledPrompts = {
566
534
  autonomousExecutionCompact: p(SystemPrompts.AUTONOMOUS_EXECUTION_COMPACT),
567
535
  samplingToolDescription: p(SystemPrompts.SAMPLING_TOOL_DESCRIPTION),
568
536
  aiLoopSystem: p(SystemPrompts.AI_LOOP_SYSTEM),
569
- actionSuccess: p(ResponseTemplates.ACTION_SUCCESS),
570
- planningPrompt: p(ResponseTemplates.PLANNING_PROMPT),
571
537
  errorResponse: p(ResponseTemplates.ERROR_RESPONSE),
572
538
  securityPassed: p(ResponseTemplates.SECURITY_VALIDATION.PASSED),
573
539
  securityFailed: p(ResponseTemplates.SECURITY_VALIDATION.FAILED),
574
- auditLog: p(ResponseTemplates.AUDIT_LOG),
575
- completionMessage: () => ResponseTemplates.COMPLETION_MESSAGE
540
+ auditLog: p(ResponseTemplates.AUDIT_LOG)
576
541
  };
577
542
 
578
543
  // __mcpc__plugin-markdown-loader_latest/node_modules/@jsr/mcpc__core/src/factories/args-def-factory.js
@@ -4018,8 +3983,12 @@ function parse(content, options = {}) {
4018
3983
  var import_node_path = require("node:path");
4019
3984
  var import_node_process5 = __toESM(require("node:process"), 1);
4020
3985
  function replaceEnvVars(str2) {
4021
- return str2.replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g, (_match, varName) => {
4022
- return import_node_process5.default.env[varName] || "";
3986
+ return str2.replace(/\$([A-Za-z_][A-Za-z0-9_]*)(?!\s*\()/g, (match, varName) => {
3987
+ const value = import_node_process5.default.env[varName];
3988
+ if (value !== void 0) {
3989
+ return value;
3990
+ }
3991
+ return match;
4023
3992
  });
4024
3993
  }
4025
3994
  function replaceEnvVarsInObject(obj) {
package/index.mjs CHANGED
@@ -392,9 +392,7 @@ var SystemPrompts = {
392
392
  * - `man` command for fetching tool schemas (like Unix manual)
393
393
  * - No `hasDefinitions` - trusts model's context memory
394
394
  */
395
- AUTONOMOUS_EXECUTION: `Agentic tool \`{toolName}\` that executes complex tasks by iteratively selecting and calling tools.
396
-
397
- You must follow the <manual/>, obey the <rules/>, and use the <format/>.
395
+ AUTONOMOUS_EXECUTION: `Agentic tool \`{toolName}\` that executes tasks by calling its tools, following the <manual/>, obeying the <rules/>, and using the <format/>.
398
396
 
399
397
  <manual>
400
398
  {description}
@@ -408,26 +406,11 @@ You must follow the <manual/>, obey the <rules/>, and use the <format/>.
408
406
  <rules>
409
407
  1. **First call**: Use \`man\` to get tool schemas you need
410
408
  2. **Execute tools**: Use tool name in \`tool\` and parameters in \`args\`
411
- 3. **Parallel calls**: If your client supports it, call \`man\` and execute tools simultaneously
412
- 4. Note: You are an agent exposed as an MCP tool
413
409
  </rules>
414
410
 
415
411
  <format>
416
- Get tool schemas:
417
- \`\`\`json
418
- {
419
- "tool": "man",
420
- "args": { "tools": ["tool1", "tool2"] }
421
- }
422
- \`\`\`
423
-
424
- Execute a tool:
425
- \`\`\`json
426
- {
427
- "tool": "tool_name",
428
- "args": { /* tool parameters */ }
429
- }
430
- \`\`\`
412
+ Get tool schemas: \`{ "tool": "man", "args": { "tools": ["tool1", "tool2"] } }\`
413
+ Execute a tool: \`{ "tool": "tool_name", "args": { /* parameters */ } }\`
431
414
  </format>`,
432
415
  /**
433
416
  * Compact system prompt for autonomous MCP execution (when manual is provided)
@@ -436,14 +419,17 @@ Execute a tool:
436
419
  * - Short description shown by default
437
420
  * - Use `man` command with args `{ manual: true }` to get full manual
438
421
  */
439
- AUTONOMOUS_EXECUTION_COMPACT: `Agentic tool \`{toolName}\`: {description}
422
+ AUTONOMOUS_EXECUTION_COMPACT: `Agentic tool \`{toolName}\` that executes tasks by calling its tools, following the <rules/> and using the <format/>.
423
+
424
+ {description}
440
425
 
441
- Use \`man\` command with args \`{ tools: [], manual: true }\` to get the full manual, or \`{ tools: ["tool1"] }\` to get tool schemas.
426
+ <rules>
427
+ 1. **First call**: Use \`man\` to get tool schemas and full manual
428
+ 2. **Execute tools**: Use tool name in \`tool\` and parameters in \`args\`
429
+ </rules>
442
430
 
443
431
  <format>
444
- Get full manual: \`{ "tool": "man", "args": { "tools": [], "manual": true } }\`
445
- Get tool schemas: \`{ "tool": "man", "args": { "tools": ["tool1", "tool2"] } }\`
446
- Get both: \`{ "tool": "man", "args": { "tools": ["tool1"], "manual": true } }\`
432
+ Get manual + schemas: \`{ "tool": "man", "args": { "tools": ["tool1"], "manual": true } }\`
447
433
  Execute a tool: \`{ "tool": "tool_name", "args": { /* parameters */ } }\`
448
434
  </format>`,
449
435
  /**
@@ -484,30 +470,12 @@ You must follow the <manual/>, obey the <rules/>, and use the <format/>.
484
470
  </rules>{context}`
485
471
  };
486
472
  var ResponseTemplates = {
487
- /**
488
- * Success response for action execution
489
- */
490
- ACTION_SUCCESS: `Action \`{currentAction}\` completed.
491
-
492
- Next: Execute \`{nextAction}\` by calling \`{toolName}\` again.`,
493
- /**
494
- * Planning prompt when no next action is specified
495
- */
496
- PLANNING_PROMPT: `Action \`{currentAction}\` completed. Determine next step:
497
-
498
- 1. Analyze results from \`{currentAction}\`
499
- 2. Decide: Continue with another action or Complete?
500
- 3. Call \`{toolName}\` with chosen action or \`decision: "complete"\``,
501
473
  /**
502
474
  * Error response templates
503
475
  */
504
476
  ERROR_RESPONSE: `Validation failed: {errorMessage}
505
477
 
506
478
  Adjust parameters and retry.`,
507
- /**
508
- * Completion message
509
- */
510
- COMPLETION_MESSAGE: `Task completed.`,
511
479
  /**
512
480
  * Security validation messages
513
481
  */
@@ -525,13 +493,10 @@ var CompiledPrompts = {
525
493
  autonomousExecutionCompact: p(SystemPrompts.AUTONOMOUS_EXECUTION_COMPACT),
526
494
  samplingToolDescription: p(SystemPrompts.SAMPLING_TOOL_DESCRIPTION),
527
495
  aiLoopSystem: p(SystemPrompts.AI_LOOP_SYSTEM),
528
- actionSuccess: p(ResponseTemplates.ACTION_SUCCESS),
529
- planningPrompt: p(ResponseTemplates.PLANNING_PROMPT),
530
496
  errorResponse: p(ResponseTemplates.ERROR_RESPONSE),
531
497
  securityPassed: p(ResponseTemplates.SECURITY_VALIDATION.PASSED),
532
498
  securityFailed: p(ResponseTemplates.SECURITY_VALIDATION.FAILED),
533
- auditLog: p(ResponseTemplates.AUDIT_LOG),
534
- completionMessage: () => ResponseTemplates.COMPLETION_MESSAGE
499
+ auditLog: p(ResponseTemplates.AUDIT_LOG)
535
500
  };
536
501
 
537
502
  // __mcpc__plugin-markdown-loader_latest/node_modules/@jsr/mcpc__core/src/factories/args-def-factory.js
@@ -3977,8 +3942,12 @@ function parse(content, options = {}) {
3977
3942
  import { join } from "node:path";
3978
3943
  import process5 from "node:process";
3979
3944
  function replaceEnvVars(str2) {
3980
- return str2.replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g, (_match, varName) => {
3981
- return process5.env[varName] || "";
3945
+ return str2.replace(/\$([A-Za-z_][A-Za-z0-9_]*)(?!\s*\()/g, (match, varName) => {
3946
+ const value = process5.env[varName];
3947
+ if (value !== void 0) {
3948
+ return value;
3949
+ }
3950
+ return match;
3982
3951
  });
3983
3952
  }
3984
3953
  function replaceEnvVarsInObject(obj) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpc-tech/plugin-markdown-loader",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "homepage": "https://jsr.io/@mcpc/plugin-markdown-loader",
5
5
  "dependencies": {
6
6
  "@ai-sdk/provider": "^2.0.0",
@@ -1 +1 @@
1
- {"version":3,"file":"markdown-loader.d.ts","sources":["../../src/markdown-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BC,GAED,SACE,KAAK,iBAAiB,EACtB,cAAc,EACd,KAAK,eAAe,EAEpB,KAAK,cAAc,0BACW;AAOhC,SAAyB,kBAAkB,mBAAmB,GAAG;AAgCjE;;CAEC,GACD,iBAAiB;EACf,0BAA0B,GAC1B,MAAM,MAAM;EACZ;;;;GAIC,GACD,cAAc,MAAM;EACpB,mBAAmB,GACnB,OAAO,YAAY,gBAAgB,WAAW;EAC9C,4BAA4B,GAC5B,WAAW,MAAM;EACjB,gCAAgC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