@productmaker/mcp 12.10.0 → 12.10.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.
Files changed (3) hide show
  1. package/dist/http.js +80 -28
  2. package/dist/stdio.js +80 -28
  3. package/package.json +1 -1
package/dist/http.js CHANGED
@@ -32052,7 +32052,7 @@ var ApiClient = class {
32052
32052
  };
32053
32053
 
32054
32054
  // src/index.ts
32055
- var MCP_VERSION = "12.10.0";
32055
+ var MCP_VERSION = "12.10.1";
32056
32056
 
32057
32057
  // src/meta-upload-app.ts
32058
32058
  import { readFileSync } from "fs";
@@ -33444,6 +33444,16 @@ var McpErrorCode = {
33444
33444
  AGENT_EXPERIMENT_ALREADY_CLOSED: "AGENT_EXPERIMENT_ALREADY_CLOSED",
33445
33445
  AGENT_PENDING_NOT_FOUND: "AGENT_PENDING_NOT_FOUND",
33446
33446
  AGENT_PENDING_ALREADY_RESOLVED: "AGENT_PENDING_ALREADY_RESOLVED",
33447
+ AGENT_COUNTRY_REQUIRED: "AGENT_COUNTRY_REQUIRED",
33448
+ AGENT_RUN_NO_SLOT: "AGENT_RUN_NO_SLOT",
33449
+ AGENT_RUN_ALREADY_CLAIMED: "AGENT_RUN_ALREADY_CLAIMED",
33450
+ AGENT_RUN_ALREADY_FINISHED: "AGENT_RUN_ALREADY_FINISHED",
33451
+ AGENT_SPEND_REF_CONFLICT: "AGENT_SPEND_REF_CONFLICT",
33452
+ AGENT_SPEND_REF_REQUIRED: "AGENT_SPEND_REF_REQUIRED",
33453
+ AGENT_RUN_NOT_FOUND: "AGENT_RUN_NOT_FOUND",
33454
+ AGENT_RUN_NOT_YOURS: "AGENT_RUN_NOT_YOURS",
33455
+ AGENT_SETTINGS_CHANGED: "AGENT_SETTINGS_CHANGED",
33456
+ AGENT_TIMEZONE_LOCKED: "AGENT_TIMEZONE_LOCKED",
33447
33457
  AGENT_MEMORY_FILTER_NOT_APPLICABLE: "AGENT_MEMORY_FILTER_NOT_APPLICABLE",
33448
33458
  AGENT_MEMORY_FILTER_VALUE_INVALID: "AGENT_MEMORY_FILTER_VALUE_INVALID",
33449
33459
  KALODATA_NOT_CONFIGURED: "KALODATA_NOT_CONFIGURED",
@@ -33682,6 +33692,16 @@ var CODE_MESSAGES = {
33682
33692
  AGENT_EXPERIMENT_ALREADY_CLOSED: "That experiment is already closed and is never reopened. Open a new experiment if you are testing again.",
33683
33693
  AGENT_PENDING_NOT_FOUND: "No pending item with that id in this account's agent memory. Read the brief for the open ones.",
33684
33694
  AGENT_PENDING_ALREADY_RESOLVED: "That pending item was already resolved. Add a new one if the decision changed.",
33695
+ AGENT_COUNTRY_REQUIRED: `This account has no country or time zone yet. Save the seller's country (or time zone) with save_agent_memory type "settings", then try again.`,
33696
+ AGENT_RUN_NO_SLOT: "No autopilot turn is open now in the agent's time zone. Do not run a phase; turns start at 9, 12, 15, 18 and 21.",
33697
+ AGENT_RUN_ALREADY_CLAIMED: "This autopilot turn was already claimed. Do not run this phase again; `run` shows who claimed it.",
33698
+ AGENT_RUN_ALREADY_FINISHED: "That autopilot turn is already closed. It is closed only once.",
33699
+ AGENT_SPEND_REF_CONFLICT: "That spend `ref` was already recorded with a different amount. Use a new ref for a different charge.",
33700
+ AGENT_SPEND_REF_REQUIRED: "Recording spend needs a `ref` per charge (taskId:tool, runId or adSetId) so a retry is not counted twice.",
33701
+ AGENT_RUN_NOT_FOUND: "No autopilot turn with that id in this account. Use the id returned by run_claim.",
33702
+ AGENT_RUN_NOT_YOURS: "That autopilot turn is run by another runner; only it can close it. Close only the turn your run_claim returned.",
33703
+ AGENT_SETTINGS_CHANGED: "The agent settings changed while saving. Read the brief again and resend the change.",
33704
+ AGENT_TIMEZONE_LOCKED: "Spend is already recorded today in the current time zone, so it can change tomorrow. Keep the current one for today.",
33685
33705
  AGENT_MEMORY_FILTER_NOT_APPLICABLE: "That filter does not apply to the chosen search scope. Remove it or change the scope.",
33686
33706
  AGENT_MEMORY_FILTER_VALUE_INVALID: "That filter value is not valid for the chosen search scope.",
33687
33707
  KALODATA_NOT_CONFIGURED: "Product research is temporarily unavailable because the trend-data provider is not configured.",
@@ -33720,6 +33740,27 @@ var CODE_MESSAGES = {
33720
33740
  INTERNAL: "Internal error.",
33721
33741
  INVALID_INPUT: "Invalid input."
33722
33742
  };
33743
+ var AGENT_MEMORY_CODES = [
33744
+ McpErrorCode.PRODUCT_CONTROL_NOT_FOUND,
33745
+ McpErrorCode.AGENT_PRODUCT_NOT_FOUND,
33746
+ McpErrorCode.AGENT_PRODUCT_NAME_REQUIRED,
33747
+ McpErrorCode.AGENT_EXPERIMENT_NOT_FOUND,
33748
+ McpErrorCode.AGENT_EXPERIMENT_ALREADY_CLOSED,
33749
+ McpErrorCode.AGENT_PENDING_NOT_FOUND,
33750
+ McpErrorCode.AGENT_PENDING_ALREADY_RESOLVED,
33751
+ McpErrorCode.AGENT_COUNTRY_REQUIRED,
33752
+ McpErrorCode.AGENT_RUN_NO_SLOT,
33753
+ McpErrorCode.AGENT_RUN_ALREADY_CLAIMED,
33754
+ McpErrorCode.AGENT_RUN_ALREADY_FINISHED,
33755
+ McpErrorCode.AGENT_SPEND_REF_CONFLICT,
33756
+ McpErrorCode.AGENT_SPEND_REF_REQUIRED,
33757
+ McpErrorCode.AGENT_RUN_NOT_FOUND,
33758
+ McpErrorCode.AGENT_RUN_NOT_YOURS,
33759
+ McpErrorCode.AGENT_SETTINGS_CHANGED,
33760
+ McpErrorCode.AGENT_TIMEZONE_LOCKED,
33761
+ McpErrorCode.AGENT_MEMORY_FILTER_NOT_APPLICABLE,
33762
+ McpErrorCode.AGENT_MEMORY_FILTER_VALUE_INVALID
33763
+ ];
33723
33764
  var INVALID_PARAM_CODES = /* @__PURE__ */ new Set([
33724
33765
  // Input/auth
33725
33766
  McpErrorCode.INVALID_INPUT,
@@ -33754,15 +33795,7 @@ var INVALID_PARAM_CODES = /* @__PURE__ */ new Set([
33754
33795
  McpErrorCode.DROPSHIPPING_PROJECT_MEDIA_REQUIRED,
33755
33796
  McpErrorCode.DROPSHIPPING_PROJECT_CAMPAIGN_ALREADY_LINKED,
33756
33797
  McpErrorCode.DROPSHIPPING_PROJECT_CAMPAIGN_NOT_FOUND,
33757
- McpErrorCode.PRODUCT_CONTROL_NOT_FOUND,
33758
- McpErrorCode.AGENT_PRODUCT_NOT_FOUND,
33759
- McpErrorCode.AGENT_PRODUCT_NAME_REQUIRED,
33760
- McpErrorCode.AGENT_EXPERIMENT_NOT_FOUND,
33761
- McpErrorCode.AGENT_EXPERIMENT_ALREADY_CLOSED,
33762
- McpErrorCode.AGENT_PENDING_NOT_FOUND,
33763
- McpErrorCode.AGENT_PENDING_ALREADY_RESOLVED,
33764
- McpErrorCode.AGENT_MEMORY_FILTER_NOT_APPLICABLE,
33765
- McpErrorCode.AGENT_MEMORY_FILTER_VALUE_INVALID,
33798
+ ...AGENT_MEMORY_CODES,
33766
33799
  McpErrorCode.META_TASK_NOT_FOUND,
33767
33800
  McpErrorCode.META_INVALID_AD_ACCOUNT,
33768
33801
  McpErrorCode.META_PIXEL_NOT_FOUND,
@@ -33875,15 +33908,7 @@ var PASSTHROUGH_CODES = /* @__PURE__ */ new Set([
33875
33908
  McpErrorCode.DROPSHIPPING_PROJECT_MEDIA_REQUIRED,
33876
33909
  McpErrorCode.DROPSHIPPING_PROJECT_CAMPAIGN_ALREADY_LINKED,
33877
33910
  McpErrorCode.DROPSHIPPING_PROJECT_CAMPAIGN_NOT_FOUND,
33878
- McpErrorCode.PRODUCT_CONTROL_NOT_FOUND,
33879
- McpErrorCode.AGENT_PRODUCT_NOT_FOUND,
33880
- McpErrorCode.AGENT_PRODUCT_NAME_REQUIRED,
33881
- McpErrorCode.AGENT_EXPERIMENT_NOT_FOUND,
33882
- McpErrorCode.AGENT_EXPERIMENT_ALREADY_CLOSED,
33883
- McpErrorCode.AGENT_PENDING_NOT_FOUND,
33884
- McpErrorCode.AGENT_PENDING_ALREADY_RESOLVED,
33885
- McpErrorCode.AGENT_MEMORY_FILTER_NOT_APPLICABLE,
33886
- McpErrorCode.AGENT_MEMORY_FILTER_VALUE_INVALID,
33911
+ ...AGENT_MEMORY_CODES,
33887
33912
  McpErrorCode.KALODATA_NOT_CONFIGURED,
33888
33913
  McpErrorCode.DROPKILLER_NOT_CONFIGURED,
33889
33914
  McpErrorCode.META_AD_LIBRARY_NOT_CONFIGURED,
@@ -34032,6 +34057,40 @@ function invalidInputFromZod(error) {
34032
34057
  return mcp(McpErrorCode.INVALID_INPUT, detail || resolveMessage(McpErrorCode.INVALID_INPUT, void 0));
34033
34058
  }
34034
34059
  __name(invalidInputFromZod, "invalidInputFromZod");
34060
+ function passthroughExtra(body) {
34061
+ const extra = {};
34062
+ if (body.helpUrl !== void 0) extra.helpUrl = body.helpUrl;
34063
+ for (const key2 of [
34064
+ "requiredCredits",
34065
+ "availableCredits",
34066
+ "usage",
34067
+ "limit"
34068
+ ]) {
34069
+ if (typeof body[key2] === "number") extra[key2] = body[key2];
34070
+ }
34071
+ for (const key2 of [
34072
+ "dimension",
34073
+ "retryAt"
34074
+ ]) {
34075
+ if (typeof body[key2] === "string") extra[key2] = body[key2];
34076
+ }
34077
+ if (isRecord3(body.run)) {
34078
+ const run = {};
34079
+ for (const key2 of [
34080
+ "id",
34081
+ "slot",
34082
+ "phase",
34083
+ "runner",
34084
+ "status",
34085
+ "startedAt"
34086
+ ]) {
34087
+ if (typeof body.run[key2] === "string") run[key2] = body.run[key2];
34088
+ }
34089
+ extra.run = run;
34090
+ }
34091
+ return extra;
34092
+ }
34093
+ __name(passthroughExtra, "passthroughExtra");
34035
34094
  function translateError(err) {
34036
34095
  if (err instanceof McpError) {
34037
34096
  return err;
@@ -34074,14 +34133,7 @@ function translateError(err) {
34074
34133
  const rawCode = (typeof body.code === "string" ? body.code : void 0) ?? messageCode;
34075
34134
  const code = rawCode === "INSUFFICIENT_CREDIT" ? McpErrorCode.INSUFFICIENT_CREDITS : rawCode;
34076
34135
  if (code && PASSTHROUGH_CODES.has(code)) {
34077
- const extra = {};
34078
- if (body.helpUrl !== void 0) extra.helpUrl = body.helpUrl;
34079
- if (typeof body.requiredCredits === "number") extra.requiredCredits = body.requiredCredits;
34080
- if (typeof body.availableCredits === "number") extra.availableCredits = body.availableCredits;
34081
- if (typeof body.dimension === "string") extra.dimension = body.dimension;
34082
- if (typeof body.usage === "number") extra.usage = body.usage;
34083
- if (typeof body.limit === "number") extra.limit = body.limit;
34084
- if (typeof body.retryAt === "string") extra.retryAt = body.retryAt;
34136
+ const extra = passthroughExtra(body);
34085
34137
  return mcp(
34086
34138
  code,
34087
34139
  // When the code itself came from `message`, do not append it back as
@@ -42131,7 +42183,7 @@ function registerAgentMemoryTools(server, api) {
42131
42183
  }
42132
42184
  });
42133
42185
  server.registerTool("save_agent_memory", {
42134
- description: saveGuidance.summary + ' Un solo punto de escritura; `memory.type` dice qu\xE9 se guarda: "product" crea o actualiza la ficha por `code` (la primera vez exige `name`; solo cambia los campos enviados; `verdict: ""` lo borra; productControlId/projectId deben ser de esta cuenta), "experiment_open" abre un experimento con hip\xF3tesis y montaje, "experiment_close" lo cierra UNA vez con outcome y conclusi\xF3n (cerrado no se reabre: 409, abre otro), "playbook" guarda una versi\xF3n NUEVA completa del playbook (no un parche; las anteriores quedan en el historial), "pending_add" deja una aprobaci\xF3n o seguimiento abierto, "pending_resolve" lo resuelve UNA vez (409 si ya estaba resuelto), "note" escribe en la bit\xE1cora, "settings" guarda la configuraci\xF3n del agente (solo los campos enviados; `null` borra un valor; pa\xEDs, moneda, presupuesto y topes salen del contexto o de lo que diga el vendedor, nunca de un n\xFAmero por defecto; prender `autopilot` exige pa\xEDs o zona: 400 AGENT_COUNTRY_REQUIRED) y "spend" lleva el gasto del d\xEDa: `mode: "check"` ANTES de cada gasto (cr\xE9ditos cotizados o 1 conjunto nuevo) dice si cabe (`fits`) en el tope del vendedor, sin escribir (sin tope, siempre cabe); si no cabe, pide OK al vendedor. `mode: "record"` DESPU\xC9S registra el costo real con una `ref` por cobro (`<taskId>:<tool>`, runId o adSetId): repetirlo con el mismo monto no suma dos veces y otro monto con la misma ref es 409 AGENT_SPEND_REF_CONFLICT. "run_claim" reclama el turno vigente del piloto autom\xE1tico ANTES de correr una fase programada (turnos a las 9, 12, 15, 18 y 21 en la zona del agente; devuelve `phase`: launch, review, evening o weekly): 409 AGENT_RUN_ALREADY_CLAIMED si ya lo corri\xF3 otro (no lo corras), 409 AGENT_RUN_NO_SLOT fuera de horario. "run_complete" cierra ese turno UNA vez con `status` done o failed y el reporte corto en `summary`. `productCode` debe existir (404 AGENT_PRODUCT_NOT_FOUND: guarda primero el producto). Para reintentar sin duplicar, manda el mismo `requestId` (UUID): la respuesta trae `replayed: true`. Nunca guardes datos personales de compradores, contrase\xF1as ni llaves.',
42186
+ description: saveGuidance.summary + ' Un solo punto de escritura; `memory.type` dice qu\xE9 se guarda: "product" crea o actualiza la ficha por `code` (la primera vez exige `name`; solo cambia los campos enviados; `verdict: ""` lo borra; productControlId/projectId deben ser de esta cuenta), "experiment_open" abre un experimento con hip\xF3tesis y montaje, "experiment_close" lo cierra UNA vez con outcome y conclusi\xF3n (cerrado no se reabre: 409, abre otro), "playbook" guarda una versi\xF3n NUEVA completa del playbook (no un parche; las anteriores quedan en el historial), "pending_add" deja una aprobaci\xF3n o seguimiento abierto, "pending_resolve" lo resuelve UNA vez (409 si ya estaba resuelto), "note" escribe en la bit\xE1cora, "settings" guarda la configuraci\xF3n del agente (solo los campos enviados; `null` borra un valor; pa\xEDs, moneda, presupuesto y topes salen del contexto o de lo que diga el vendedor, nunca de un n\xFAmero por defecto; prender `autopilot` exige pa\xEDs o zona: 400 AGENT_COUNTRY_REQUIRED) y "spend" lleva el gasto del d\xEDa: `mode: "check"` ANTES de cada gasto (cr\xE9ditos cotizados o 1 conjunto nuevo) dice si cabe (`fits`) en el tope del vendedor, sin escribir (sin tope, siempre cabe); si no cabe, pide OK al vendedor. `mode: "record"` DESPU\xC9S registra el costo real con una `ref` por cobro (`<taskId>:<tool>`, runId o adSetId): repetirlo con el mismo monto no suma dos veces y otro monto con la misma ref es 409 AGENT_SPEND_REF_CONFLICT. "run_claim" reclama el turno vigente del piloto autom\xE1tico ANTES de correr una fase programada (turnos a las 9, 12, 15, 18 y 21 en la zona del agente; devuelve `phase`: launch, review, evening o weekly): 409 AGENT_RUN_ALREADY_CLAIMED si ya lo corri\xF3 otro (no lo corras), 409 AGENT_RUN_NO_SLOT fuera de horario, 400 AGENT_COUNTRY_REQUIRED si a\xFAn no hay pa\xEDs ni zona (guarda primero "settings" con el pa\xEDs o la zona del vendedor y reclama otra vez). "run_complete" cierra ese turno UNA vez con `status` done o failed y el reporte corto en `summary`. `productCode` debe existir (404 AGENT_PRODUCT_NOT_FOUND: guarda primero el producto). Para reintentar sin duplicar, manda el mismo `requestId` (UUID): la respuesta trae `replayed: true`. Nunca guardes datos personales de compradores, contrase\xF1as ni llaves.',
42135
42187
  inputSchema: SaveInput.shape,
42136
42188
  annotations: OVERWRITES_INTERNAL
42137
42189
  }, async (input) => {
package/dist/stdio.js CHANGED
@@ -30379,7 +30379,7 @@ var ApiClient = class {
30379
30379
  };
30380
30380
 
30381
30381
  // src/index.ts
30382
- var MCP_VERSION = "12.10.0";
30382
+ var MCP_VERSION = "12.10.1";
30383
30383
 
30384
30384
  // src/meta-upload-app.ts
30385
30385
  import { readFileSync } from "fs";
@@ -31775,6 +31775,16 @@ var McpErrorCode = {
31775
31775
  AGENT_EXPERIMENT_ALREADY_CLOSED: "AGENT_EXPERIMENT_ALREADY_CLOSED",
31776
31776
  AGENT_PENDING_NOT_FOUND: "AGENT_PENDING_NOT_FOUND",
31777
31777
  AGENT_PENDING_ALREADY_RESOLVED: "AGENT_PENDING_ALREADY_RESOLVED",
31778
+ AGENT_COUNTRY_REQUIRED: "AGENT_COUNTRY_REQUIRED",
31779
+ AGENT_RUN_NO_SLOT: "AGENT_RUN_NO_SLOT",
31780
+ AGENT_RUN_ALREADY_CLAIMED: "AGENT_RUN_ALREADY_CLAIMED",
31781
+ AGENT_RUN_ALREADY_FINISHED: "AGENT_RUN_ALREADY_FINISHED",
31782
+ AGENT_SPEND_REF_CONFLICT: "AGENT_SPEND_REF_CONFLICT",
31783
+ AGENT_SPEND_REF_REQUIRED: "AGENT_SPEND_REF_REQUIRED",
31784
+ AGENT_RUN_NOT_FOUND: "AGENT_RUN_NOT_FOUND",
31785
+ AGENT_RUN_NOT_YOURS: "AGENT_RUN_NOT_YOURS",
31786
+ AGENT_SETTINGS_CHANGED: "AGENT_SETTINGS_CHANGED",
31787
+ AGENT_TIMEZONE_LOCKED: "AGENT_TIMEZONE_LOCKED",
31778
31788
  AGENT_MEMORY_FILTER_NOT_APPLICABLE: "AGENT_MEMORY_FILTER_NOT_APPLICABLE",
31779
31789
  AGENT_MEMORY_FILTER_VALUE_INVALID: "AGENT_MEMORY_FILTER_VALUE_INVALID",
31780
31790
  KALODATA_NOT_CONFIGURED: "KALODATA_NOT_CONFIGURED",
@@ -32013,6 +32023,16 @@ var CODE_MESSAGES = {
32013
32023
  AGENT_EXPERIMENT_ALREADY_CLOSED: "That experiment is already closed and is never reopened. Open a new experiment if you are testing again.",
32014
32024
  AGENT_PENDING_NOT_FOUND: "No pending item with that id in this account's agent memory. Read the brief for the open ones.",
32015
32025
  AGENT_PENDING_ALREADY_RESOLVED: "That pending item was already resolved. Add a new one if the decision changed.",
32026
+ AGENT_COUNTRY_REQUIRED: `This account has no country or time zone yet. Save the seller's country (or time zone) with save_agent_memory type "settings", then try again.`,
32027
+ AGENT_RUN_NO_SLOT: "No autopilot turn is open now in the agent's time zone. Do not run a phase; turns start at 9, 12, 15, 18 and 21.",
32028
+ AGENT_RUN_ALREADY_CLAIMED: "This autopilot turn was already claimed. Do not run this phase again; `run` shows who claimed it.",
32029
+ AGENT_RUN_ALREADY_FINISHED: "That autopilot turn is already closed. It is closed only once.",
32030
+ AGENT_SPEND_REF_CONFLICT: "That spend `ref` was already recorded with a different amount. Use a new ref for a different charge.",
32031
+ AGENT_SPEND_REF_REQUIRED: "Recording spend needs a `ref` per charge (taskId:tool, runId or adSetId) so a retry is not counted twice.",
32032
+ AGENT_RUN_NOT_FOUND: "No autopilot turn with that id in this account. Use the id returned by run_claim.",
32033
+ AGENT_RUN_NOT_YOURS: "That autopilot turn is run by another runner; only it can close it. Close only the turn your run_claim returned.",
32034
+ AGENT_SETTINGS_CHANGED: "The agent settings changed while saving. Read the brief again and resend the change.",
32035
+ AGENT_TIMEZONE_LOCKED: "Spend is already recorded today in the current time zone, so it can change tomorrow. Keep the current one for today.",
32016
32036
  AGENT_MEMORY_FILTER_NOT_APPLICABLE: "That filter does not apply to the chosen search scope. Remove it or change the scope.",
32017
32037
  AGENT_MEMORY_FILTER_VALUE_INVALID: "That filter value is not valid for the chosen search scope.",
32018
32038
  KALODATA_NOT_CONFIGURED: "Product research is temporarily unavailable because the trend-data provider is not configured.",
@@ -32051,6 +32071,27 @@ var CODE_MESSAGES = {
32051
32071
  INTERNAL: "Internal error.",
32052
32072
  INVALID_INPUT: "Invalid input."
32053
32073
  };
32074
+ var AGENT_MEMORY_CODES = [
32075
+ McpErrorCode.PRODUCT_CONTROL_NOT_FOUND,
32076
+ McpErrorCode.AGENT_PRODUCT_NOT_FOUND,
32077
+ McpErrorCode.AGENT_PRODUCT_NAME_REQUIRED,
32078
+ McpErrorCode.AGENT_EXPERIMENT_NOT_FOUND,
32079
+ McpErrorCode.AGENT_EXPERIMENT_ALREADY_CLOSED,
32080
+ McpErrorCode.AGENT_PENDING_NOT_FOUND,
32081
+ McpErrorCode.AGENT_PENDING_ALREADY_RESOLVED,
32082
+ McpErrorCode.AGENT_COUNTRY_REQUIRED,
32083
+ McpErrorCode.AGENT_RUN_NO_SLOT,
32084
+ McpErrorCode.AGENT_RUN_ALREADY_CLAIMED,
32085
+ McpErrorCode.AGENT_RUN_ALREADY_FINISHED,
32086
+ McpErrorCode.AGENT_SPEND_REF_CONFLICT,
32087
+ McpErrorCode.AGENT_SPEND_REF_REQUIRED,
32088
+ McpErrorCode.AGENT_RUN_NOT_FOUND,
32089
+ McpErrorCode.AGENT_RUN_NOT_YOURS,
32090
+ McpErrorCode.AGENT_SETTINGS_CHANGED,
32091
+ McpErrorCode.AGENT_TIMEZONE_LOCKED,
32092
+ McpErrorCode.AGENT_MEMORY_FILTER_NOT_APPLICABLE,
32093
+ McpErrorCode.AGENT_MEMORY_FILTER_VALUE_INVALID
32094
+ ];
32054
32095
  var INVALID_PARAM_CODES = /* @__PURE__ */ new Set([
32055
32096
  // Input/auth
32056
32097
  McpErrorCode.INVALID_INPUT,
@@ -32085,15 +32126,7 @@ var INVALID_PARAM_CODES = /* @__PURE__ */ new Set([
32085
32126
  McpErrorCode.DROPSHIPPING_PROJECT_MEDIA_REQUIRED,
32086
32127
  McpErrorCode.DROPSHIPPING_PROJECT_CAMPAIGN_ALREADY_LINKED,
32087
32128
  McpErrorCode.DROPSHIPPING_PROJECT_CAMPAIGN_NOT_FOUND,
32088
- McpErrorCode.PRODUCT_CONTROL_NOT_FOUND,
32089
- McpErrorCode.AGENT_PRODUCT_NOT_FOUND,
32090
- McpErrorCode.AGENT_PRODUCT_NAME_REQUIRED,
32091
- McpErrorCode.AGENT_EXPERIMENT_NOT_FOUND,
32092
- McpErrorCode.AGENT_EXPERIMENT_ALREADY_CLOSED,
32093
- McpErrorCode.AGENT_PENDING_NOT_FOUND,
32094
- McpErrorCode.AGENT_PENDING_ALREADY_RESOLVED,
32095
- McpErrorCode.AGENT_MEMORY_FILTER_NOT_APPLICABLE,
32096
- McpErrorCode.AGENT_MEMORY_FILTER_VALUE_INVALID,
32129
+ ...AGENT_MEMORY_CODES,
32097
32130
  McpErrorCode.META_TASK_NOT_FOUND,
32098
32131
  McpErrorCode.META_INVALID_AD_ACCOUNT,
32099
32132
  McpErrorCode.META_PIXEL_NOT_FOUND,
@@ -32206,15 +32239,7 @@ var PASSTHROUGH_CODES = /* @__PURE__ */ new Set([
32206
32239
  McpErrorCode.DROPSHIPPING_PROJECT_MEDIA_REQUIRED,
32207
32240
  McpErrorCode.DROPSHIPPING_PROJECT_CAMPAIGN_ALREADY_LINKED,
32208
32241
  McpErrorCode.DROPSHIPPING_PROJECT_CAMPAIGN_NOT_FOUND,
32209
- McpErrorCode.PRODUCT_CONTROL_NOT_FOUND,
32210
- McpErrorCode.AGENT_PRODUCT_NOT_FOUND,
32211
- McpErrorCode.AGENT_PRODUCT_NAME_REQUIRED,
32212
- McpErrorCode.AGENT_EXPERIMENT_NOT_FOUND,
32213
- McpErrorCode.AGENT_EXPERIMENT_ALREADY_CLOSED,
32214
- McpErrorCode.AGENT_PENDING_NOT_FOUND,
32215
- McpErrorCode.AGENT_PENDING_ALREADY_RESOLVED,
32216
- McpErrorCode.AGENT_MEMORY_FILTER_NOT_APPLICABLE,
32217
- McpErrorCode.AGENT_MEMORY_FILTER_VALUE_INVALID,
32242
+ ...AGENT_MEMORY_CODES,
32218
32243
  McpErrorCode.KALODATA_NOT_CONFIGURED,
32219
32244
  McpErrorCode.DROPKILLER_NOT_CONFIGURED,
32220
32245
  McpErrorCode.META_AD_LIBRARY_NOT_CONFIGURED,
@@ -32363,6 +32388,40 @@ function invalidInputFromZod(error) {
32363
32388
  return mcp(McpErrorCode.INVALID_INPUT, detail || resolveMessage(McpErrorCode.INVALID_INPUT, void 0));
32364
32389
  }
32365
32390
  __name(invalidInputFromZod, "invalidInputFromZod");
32391
+ function passthroughExtra(body) {
32392
+ const extra = {};
32393
+ if (body.helpUrl !== void 0) extra.helpUrl = body.helpUrl;
32394
+ for (const key2 of [
32395
+ "requiredCredits",
32396
+ "availableCredits",
32397
+ "usage",
32398
+ "limit"
32399
+ ]) {
32400
+ if (typeof body[key2] === "number") extra[key2] = body[key2];
32401
+ }
32402
+ for (const key2 of [
32403
+ "dimension",
32404
+ "retryAt"
32405
+ ]) {
32406
+ if (typeof body[key2] === "string") extra[key2] = body[key2];
32407
+ }
32408
+ if (isRecord3(body.run)) {
32409
+ const run = {};
32410
+ for (const key2 of [
32411
+ "id",
32412
+ "slot",
32413
+ "phase",
32414
+ "runner",
32415
+ "status",
32416
+ "startedAt"
32417
+ ]) {
32418
+ if (typeof body.run[key2] === "string") run[key2] = body.run[key2];
32419
+ }
32420
+ extra.run = run;
32421
+ }
32422
+ return extra;
32423
+ }
32424
+ __name(passthroughExtra, "passthroughExtra");
32366
32425
  function translateError(err) {
32367
32426
  if (err instanceof McpError) {
32368
32427
  return err;
@@ -32405,14 +32464,7 @@ function translateError(err) {
32405
32464
  const rawCode = (typeof body.code === "string" ? body.code : void 0) ?? messageCode;
32406
32465
  const code = rawCode === "INSUFFICIENT_CREDIT" ? McpErrorCode.INSUFFICIENT_CREDITS : rawCode;
32407
32466
  if (code && PASSTHROUGH_CODES.has(code)) {
32408
- const extra = {};
32409
- if (body.helpUrl !== void 0) extra.helpUrl = body.helpUrl;
32410
- if (typeof body.requiredCredits === "number") extra.requiredCredits = body.requiredCredits;
32411
- if (typeof body.availableCredits === "number") extra.availableCredits = body.availableCredits;
32412
- if (typeof body.dimension === "string") extra.dimension = body.dimension;
32413
- if (typeof body.usage === "number") extra.usage = body.usage;
32414
- if (typeof body.limit === "number") extra.limit = body.limit;
32415
- if (typeof body.retryAt === "string") extra.retryAt = body.retryAt;
32467
+ const extra = passthroughExtra(body);
32416
32468
  return mcp(
32417
32469
  code,
32418
32470
  // When the code itself came from `message`, do not append it back as
@@ -40616,7 +40668,7 @@ function registerAgentMemoryTools(server, api) {
40616
40668
  }
40617
40669
  });
40618
40670
  server.registerTool("save_agent_memory", {
40619
- description: saveGuidance.summary + ' Un solo punto de escritura; `memory.type` dice qu\xE9 se guarda: "product" crea o actualiza la ficha por `code` (la primera vez exige `name`; solo cambia los campos enviados; `verdict: ""` lo borra; productControlId/projectId deben ser de esta cuenta), "experiment_open" abre un experimento con hip\xF3tesis y montaje, "experiment_close" lo cierra UNA vez con outcome y conclusi\xF3n (cerrado no se reabre: 409, abre otro), "playbook" guarda una versi\xF3n NUEVA completa del playbook (no un parche; las anteriores quedan en el historial), "pending_add" deja una aprobaci\xF3n o seguimiento abierto, "pending_resolve" lo resuelve UNA vez (409 si ya estaba resuelto), "note" escribe en la bit\xE1cora, "settings" guarda la configuraci\xF3n del agente (solo los campos enviados; `null` borra un valor; pa\xEDs, moneda, presupuesto y topes salen del contexto o de lo que diga el vendedor, nunca de un n\xFAmero por defecto; prender `autopilot` exige pa\xEDs o zona: 400 AGENT_COUNTRY_REQUIRED) y "spend" lleva el gasto del d\xEDa: `mode: "check"` ANTES de cada gasto (cr\xE9ditos cotizados o 1 conjunto nuevo) dice si cabe (`fits`) en el tope del vendedor, sin escribir (sin tope, siempre cabe); si no cabe, pide OK al vendedor. `mode: "record"` DESPU\xC9S registra el costo real con una `ref` por cobro (`<taskId>:<tool>`, runId o adSetId): repetirlo con el mismo monto no suma dos veces y otro monto con la misma ref es 409 AGENT_SPEND_REF_CONFLICT. "run_claim" reclama el turno vigente del piloto autom\xE1tico ANTES de correr una fase programada (turnos a las 9, 12, 15, 18 y 21 en la zona del agente; devuelve `phase`: launch, review, evening o weekly): 409 AGENT_RUN_ALREADY_CLAIMED si ya lo corri\xF3 otro (no lo corras), 409 AGENT_RUN_NO_SLOT fuera de horario. "run_complete" cierra ese turno UNA vez con `status` done o failed y el reporte corto en `summary`. `productCode` debe existir (404 AGENT_PRODUCT_NOT_FOUND: guarda primero el producto). Para reintentar sin duplicar, manda el mismo `requestId` (UUID): la respuesta trae `replayed: true`. Nunca guardes datos personales de compradores, contrase\xF1as ni llaves.',
40671
+ description: saveGuidance.summary + ' Un solo punto de escritura; `memory.type` dice qu\xE9 se guarda: "product" crea o actualiza la ficha por `code` (la primera vez exige `name`; solo cambia los campos enviados; `verdict: ""` lo borra; productControlId/projectId deben ser de esta cuenta), "experiment_open" abre un experimento con hip\xF3tesis y montaje, "experiment_close" lo cierra UNA vez con outcome y conclusi\xF3n (cerrado no se reabre: 409, abre otro), "playbook" guarda una versi\xF3n NUEVA completa del playbook (no un parche; las anteriores quedan en el historial), "pending_add" deja una aprobaci\xF3n o seguimiento abierto, "pending_resolve" lo resuelve UNA vez (409 si ya estaba resuelto), "note" escribe en la bit\xE1cora, "settings" guarda la configuraci\xF3n del agente (solo los campos enviados; `null` borra un valor; pa\xEDs, moneda, presupuesto y topes salen del contexto o de lo que diga el vendedor, nunca de un n\xFAmero por defecto; prender `autopilot` exige pa\xEDs o zona: 400 AGENT_COUNTRY_REQUIRED) y "spend" lleva el gasto del d\xEDa: `mode: "check"` ANTES de cada gasto (cr\xE9ditos cotizados o 1 conjunto nuevo) dice si cabe (`fits`) en el tope del vendedor, sin escribir (sin tope, siempre cabe); si no cabe, pide OK al vendedor. `mode: "record"` DESPU\xC9S registra el costo real con una `ref` por cobro (`<taskId>:<tool>`, runId o adSetId): repetirlo con el mismo monto no suma dos veces y otro monto con la misma ref es 409 AGENT_SPEND_REF_CONFLICT. "run_claim" reclama el turno vigente del piloto autom\xE1tico ANTES de correr una fase programada (turnos a las 9, 12, 15, 18 y 21 en la zona del agente; devuelve `phase`: launch, review, evening o weekly): 409 AGENT_RUN_ALREADY_CLAIMED si ya lo corri\xF3 otro (no lo corras), 409 AGENT_RUN_NO_SLOT fuera de horario, 400 AGENT_COUNTRY_REQUIRED si a\xFAn no hay pa\xEDs ni zona (guarda primero "settings" con el pa\xEDs o la zona del vendedor y reclama otra vez). "run_complete" cierra ese turno UNA vez con `status` done o failed y el reporte corto en `summary`. `productCode` debe existir (404 AGENT_PRODUCT_NOT_FOUND: guarda primero el producto). Para reintentar sin duplicar, manda el mismo `requestId` (UUID): la respuesta trae `replayed: true`. Nunca guardes datos personales de compradores, contrase\xF1as ni llaves.',
40620
40672
  inputSchema: SaveInput.shape,
40621
40673
  annotations: OVERWRITES_INTERNAL
40622
40674
  }, async (input) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@productmaker/mcp",
3
- "version": "12.10.0",
3
+ "version": "12.10.1",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "ProductMaker MCP server — cost products, generate landing pages, UGC videos, and ad creatives, and publish to Shopify, Meta Ads, and TikTok Ads.",