@mcpc-tech/cli 0.1.7 → 0.1.8-beta.1

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/bin/mcpc.mjs CHANGED
@@ -1477,13 +1477,13 @@ var AgenticExecutor = class {
1477
1477
  this.tracingEnabled = false;
1478
1478
  }
1479
1479
  }
1480
- async execute(args, schema) {
1480
+ async execute(args, schema, parentSpan) {
1481
1481
  const executeSpan = this.tracingEnabled ? startSpan("mcpc.agentic_execute", {
1482
1482
  agent: this.name,
1483
1483
  action: String(args[this.ACTION_KEY] ?? "unknown"),
1484
1484
  nextAction: String(args[this.NEXT_ACTION_KEY] ?? "none"),
1485
1485
  args: JSON.stringify(args)
1486
- }) : null;
1486
+ }, parentSpan ?? void 0) : null;
1487
1487
  try {
1488
1488
  const validationResult = this.validate(args, schema);
1489
1489
  if (!validationResult.valid) {
@@ -2143,7 +2143,7 @@ var BaseSamplingExecutor = class {
2143
2143
  if (iterationSpan) endSpan(iterationSpan);
2144
2144
  continue;
2145
2145
  }
2146
- const result = await this.processAction(parsedData, schema, state, loopSpan);
2146
+ const result = await this.processAction(parsedData, schema, state, iterationSpan);
2147
2147
  this.logIterationProgress(parsedData, result, model, stopReason, role);
2148
2148
  if (iterationSpan) {
2149
2149
  let rawJson = "{}";
@@ -2423,12 +2423,21 @@ var SamplingExecutor = class extends BaseSamplingExecutor {
2423
2423
  }
2424
2424
  async processAction(parsedData, schema, _state, parentSpan) {
2425
2425
  const toolCallData = parsedData;
2426
+ const isComplete = toolCallData.decision === "complete";
2427
+ const actionName = toolCallData.action;
2428
+ if (isComplete && actionName && actionName !== "complete") {
2429
+ this.logger.debug({
2430
+ message: "Decision is 'complete' with action present, treating as 'proceed'",
2431
+ action: actionName
2432
+ });
2433
+ toolCallData.decision = "proceed";
2434
+ }
2426
2435
  if (toolCallData.decision === "complete") {
2427
2436
  return await this.createCompletionResult("Task completed", parentSpan);
2428
2437
  }
2429
2438
  try {
2430
2439
  const { action: _action, decision: _decision, ..._toolArgs } = toolCallData;
2431
- const toolResult = await this.agenticExecutor.execute(toolCallData, schema);
2440
+ const toolResult = await this.agenticExecutor.execute(toolCallData, schema, parentSpan);
2432
2441
  const resultText = toolResult.content?.filter((content) => content.type === "text")?.map((content) => content.text)?.join("\n") || "No result";
2433
2442
  this.conversationHistory.push({
2434
2443
  role: "assistant",
@@ -3043,6 +3052,15 @@ var WorkflowSamplingExecutor = class extends BaseSamplingExecutor {
3043
3052
  throw new Error("WorkflowState is required for workflow");
3044
3053
  }
3045
3054
  const toolCallData = parsedData;
3055
+ const isComplete = toolCallData.decision === "complete";
3056
+ const actionName = toolCallData.action;
3057
+ if (isComplete && actionName && actionName !== "complete") {
3058
+ this.logger.debug({
3059
+ message: "Decision is 'complete' with action present, treating as 'proceed'",
3060
+ action: actionName
3061
+ });
3062
+ toolCallData.decision = "proceed";
3063
+ }
3046
3064
  if (toolCallData.decision === "complete") {
3047
3065
  return await this.createCompletionResult("Task completed", parentSpan);
3048
3066
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpc-tech/cli",
3
- "version": "0.1.7",
3
+ "version": "0.1.8-beta.1",
4
4
  "homepage": "https://jsr.io/@mcpc/cli",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sources":["../../src/app.ts"],"names":[],"mappings":"AAAA,SAAS,WAAW,4BAAwC;AAI5D,cAAc,mBAAmB,0BAAmD;AACpF,cAAc,UAAU,6BAA6B;AAErD,OAAO,cAAM,eACX,SAAS,eACR,QAAQ,qBA8BT;AAEF,OAAO,cAAM,iBAAgB,YAO3B"}
1
+ {"version":3,"file":"app.d.ts","sources":["../../src/app.ts"],"names":[],"mappings":"AAAA,SAAS,WAAW,4BAAwC;AAI5D,cAAc,mBAAmB,0BAA0D;AAC3F,cAAc,UAAU,6BAA6B;AAErD,OAAO,cAAM,eACX,SAAS,eACR,QAAQ,qBA8BT;AAEF,OAAO,cAAM,iBAAgB,YAO3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sources":["../../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CC,GAED,cAAc,iBAAiB,0BAAgC;AAK/D,iBAAiB;EACf;;GAEC,GACD,OAAO,MAAM;EACb;;GAEC,GACD,UAAU,MAAM;EAChB;;GAEC,GACD;IACE,QAAQ,OAAO,MAAM,EAAE,OAAO;IAC9B,WAAW,OAAO,MAAM,EAAE,OAAO;;EAEnC;;GAEC,GACD,QAAQ;;AAwHV;;;CAGC,GACD,OAAO,iBAAe,cAAc,QAAQ,aAAa,IAAI;AAoK7D;;CAEC,GACD,OAAO,iBAAS,eAAe,QAAQ,UAAU,GAAG,IAAI"}
1
+ {"version":3,"file":"loader.d.ts","sources":["../../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CC,GAED,cAAc,iBAAiB,0BAAuC;AAKtE,iBAAiB;EACf;;GAEC,GACD,OAAO,MAAM;EACb;;GAEC,GACD,UAAU,MAAM;EAChB;;GAEC,GACD;IACE,QAAQ,OAAO,MAAM,EAAE,OAAO;IAC9B,WAAW,OAAO,MAAM,EAAE,OAAO;;EAEnC;;GAEC,GACD,QAAQ;;AAwHV;;;CAGC,GACD,OAAO,iBAAe,cAAc,QAAQ,aAAa,IAAI;AAoK7D;;CAEC,GACD,OAAO,iBAAS,eAAe,QAAQ,UAAU,GAAG,IAAI"}