@codeagentswarm/cas-cloud 0.0.15 → 0.0.17

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.
@@ -1068,7 +1068,7 @@ var require_database_mcp_standalone = __commonJS({
1068
1068
  { status_key: "needs_testing", label: "Needs testing", color: "#3b82f6", icon: "flask-conical", sort_order: 2, is_default: 1, agent_settable: 1, prompt: "Set it when you finish the implementation and the work is pending the user testing it manually. Do not set it if there are still things left to implement." },
1069
1069
  { status_key: "working", label: "Working", color: "#fbbf24", icon: "hammer", sort_order: 3, is_default: 1, agent_settable: 1, prompt: "Set it when you start working on any request and while you are implementing, investigating or fixing something." },
1070
1070
  { status_key: "done", label: "Done", color: "#22c55e", icon: "circle-check", sort_order: 4, is_default: 1, agent_settable: 1, prompt: "Set it when the work is completely finished: implemented, validated and with its commit/push done when applicable. It is the final state." },
1071
- { status_key: "idle", label: "Idle", color: "#6b7280", icon: "circle-dashed", sort_order: 5, is_default: 1, agent_settable: 0, prompt: "Set by the app on an agent that has just been opened and has not been given any work yet. Agents cannot set this status; it clears itself as soon as you send the agent something." }
1071
+ { status_key: "idle", label: "Idle", color: "#6b7280", icon: "circle-dashed", sort_order: 5, is_default: 1, agent_settable: 0, prompt: "Set by the app when an agent is resting without an explicit work status, including after a reply finishes. It does not mean the work is complete or that user input is required. Agents cannot set this status." }
1072
1072
  ];
1073
1073
  var IDLE_TERMINAL_STATUS_KEY = "idle";
1074
1074
  var IDLE_STATUS_SEEDED_SETTING = "terminal_status_idle_seeded";
@@ -1080,7 +1080,8 @@ var require_database_mcp_standalone = __commonJS({
1080
1080
  blocked: 5,
1081
1081
  done: 6
1082
1082
  };
1083
- var LEGACY_SPANISH_DEFAULT_PROMPTS = {
1083
+ var LEGACY_DEFAULT_PROMPTS = {
1084
+ idle: "Set by the app on an agent that has just been opened and has not been given any work yet. Agents cannot set this status; it clears itself as soon as you send the agent something.",
1084
1085
  working: "Ponlo al empezar a trabajar en cualquier petici\xF3n y mientras est\xE9s implementando, investigando o arreglando algo.",
1085
1086
  needs_input: "Ponlo cuando pares porque necesites una respuesta o decisi\xF3n del usuario para continuar (una pregunta, una elecci\xF3n de dise\xF1o, un permiso).",
1086
1087
  needs_testing: "Ponlo cuando termines la implementaci\xF3n y el trabajo quede pendiente de que el usuario lo pruebe a mano. No lo pongas si a\xFAn quedan cosas por implementar.",
@@ -1094,14 +1095,14 @@ var require_database_mcp_standalone = __commonJS({
1094
1095
  label: "Blocked",
1095
1096
  color: "#ef4444",
1096
1097
  prompt_en: "Set it when you cannot make progress due to something external that does not depend on you or the user: broken CI, a dependency that is down, failing permissions, a third-party bug.",
1097
- prompt_es: LEGACY_SPANISH_DEFAULT_PROMPTS.blocked
1098
+ prompt_es: LEGACY_DEFAULT_PROMPTS.blocked
1098
1099
  },
1099
1100
  {
1100
1101
  status_key: "pending_commit",
1101
1102
  label: "Pending commit/push",
1102
1103
  color: "#a78bfa",
1103
1104
  prompt_en: "Set it when the user has already validated the work and only the commit or push remains.",
1104
- prompt_es: LEGACY_SPANISH_DEFAULT_PROMPTS.pending_commit
1105
+ prompt_es: LEGACY_DEFAULT_PROMPTS.pending_commit
1105
1106
  }
1106
1107
  ];
1107
1108
  function findSqlite3Path() {
@@ -1438,13 +1439,13 @@ SELECT COUNT(*) AS count FROM terminal_statuses`);
1438
1439
  console.error("[MCP Database] Error migrating idle terminal status:", error.message);
1439
1440
  }
1440
1441
  }
1441
- // Migration: upgrade the legacy SPANISH factory prompts to the English ones.
1442
+ // Migration: upgrade the legacy factory prompts to the English ones.
1442
1443
  // Only default statuses whose prompt is still the legacy string VERBATIM (never
1443
1444
  // edited by the user) are touched. Idempotent. Mirrors database.js.
1444
1445
  migrateLegacyTerminalStatusPrompts() {
1445
1446
  try {
1446
1447
  for (const status of DEFAULT_TERMINAL_STATUSES) {
1447
- const legacy = LEGACY_SPANISH_DEFAULT_PROMPTS[status.status_key];
1448
+ const legacy = LEGACY_DEFAULT_PROMPTS[status.status_key];
1448
1449
  if (!legacy) continue;
1449
1450
  this.execSQL(
1450
1451
  `UPDATE terminal_statuses SET prompt = ?
@@ -3802,6 +3803,18 @@ var require_mcp_stdio_server = __commonJS({
3802
3803
  } catch (e) {
3803
3804
  }
3804
3805
  }
3806
+ _hasNudgeMarker(kind) {
3807
+ try {
3808
+ const os3 = require("os");
3809
+ const fs3 = require("fs");
3810
+ const stateDir = path2.join(os3.homedir(), ".codeagentswarm", "terminal-nudge-state");
3811
+ const rawKey = process.env.CODEAGENTSWARM_TERMINAL_ID || process.env.CODEAGENTSWARM_CURRENT_QUADRANT;
3812
+ const key = String(rawKey || "").replace(/[^A-Za-z0-9_-]/g, "_");
3813
+ return !!key && fs3.existsSync(path2.join(stateDir, `${key}.${kind}`));
3814
+ } catch (e) {
3815
+ return false;
3816
+ }
3817
+ }
3805
3818
  // Resolve the current terminal id (1-based) from the environment.
3806
3819
  _getCurrentTerminalId() {
3807
3820
  const terminalId = process.env.CODEAGENTSWARM_CURRENT_QUADRANT;
@@ -3820,20 +3833,30 @@ var require_mcp_stdio_server = __commonJS({
3820
3833
  }
3821
3834
  // Set the GENERAL terminal title: the sticky tab label that represents the
3822
3835
  // product-level goal of what this terminal is working on. Set it ONCE at the
3823
- // start of work; call it again only to refine when the overall functionality
3824
- // changes, or to replace it when the terminal pivots to a radically different
3825
- // topic. It does NOT represent the current step — use update_terminal_activity
3826
- // for that.
3836
+ // start of the conversation. Later calls preserve it unless the caller explicitly
3837
+ // declares a radical topic change. It does NOT represent the current step — use
3838
+ // update_terminal_activity for that.
3827
3839
  async setTerminalTitle(params) {
3828
- const { title, long_title } = params;
3840
+ const { title, long_title, replace_existing } = params;
3829
3841
  if (!title) {
3830
3842
  throw new Error("title is required");
3831
3843
  }
3832
3844
  if (isPlaceholderTitle(title)) {
3833
3845
  throw new Error(`"${title}" looks like example text copied from the tool documentation, not a real title. Call the tool again with a title that describes the ACTUAL feature or goal you are working on in this agent (max 6 words).`);
3834
3846
  }
3835
- const shortTitle = this.generateShortTitle(title);
3847
+ if (replace_existing !== void 0 && typeof replace_existing !== "boolean") {
3848
+ throw new Error("replace_existing must be a boolean");
3849
+ }
3836
3850
  const terminalId = this._getCurrentTerminalId();
3851
+ if (replace_existing !== true && this._hasNudgeMarker("title")) {
3852
+ return {
3853
+ terminal_id: terminalId,
3854
+ updated: false,
3855
+ preserved: true,
3856
+ message: "The existing conversation title was preserved. Use update_terminal_activity for follow-up work; set replace_existing=true only after the user pivots to a completely different functionality."
3857
+ };
3858
+ }
3859
+ const shortTitle = this.generateShortTitle(title);
3837
3860
  const currentTask = this._getCurrentTask(terminalId);
3838
3861
  const taskId = currentTask ? currentTask.id : null;
3839
3862
  let longTitle = long_title;
@@ -4731,7 +4754,7 @@ Use 'clear' to remove the status.`;
4731
4754
  },
4732
4755
  {
4733
4756
  name: "set_terminal_title",
4734
- description: 'Set the GENERAL agent title AND the agent GOAL \u2014 pass BOTH arguments, because the user sees them together. `title` is the sticky Agent tab label at the FEATURE level (e.g. "Promo video for Twitter", "Minimize agents"); `long_title` is one sentence on what this agent is FOR, shown in the hover under the title. Keep the title high-level: name the feature, not a low-level step or work phase. Set it once at the start, then only refine it when the overall goal changes. Use update_terminal_activity for the current step. LANGUAGE: write BOTH in the SAME language the user is speaking.',
4757
+ description: "Set the GENERAL agent title AND the agent GOAL from the first user request that established this conversation's topic. Pass BOTH text arguments because the user sees them together. This is once per conversation, NOT once per user message, turn, task, review, validation, or resumed session. Follow-up work belongs in update_terminal_activity and repeated calls preserve the original title. Only a user pivot to a completely different functionality may replace it, by passing replace_existing=true. LANGUAGE: write both text fields in the SAME language the user is speaking.",
4735
4758
  inputSchema: {
4736
4759
  type: "object",
4737
4760
  properties: {
@@ -4742,6 +4765,10 @@ Use 'clear' to remove the status.`;
4742
4765
  long_title: {
4743
4766
  type: "string",
4744
4767
  description: `The agent GOAL: one sentence saying what this agent is FOR \u2014 the outcome the work is aiming at, not the current step. ALWAYS provide it: the user reads it in the Agent hover, labelled GOAL, under the short title. Write the real goal in the user's language. Do NOT restate the title or prefix it with "Working on:".`
4768
+ },
4769
+ replace_existing: {
4770
+ type: "boolean",
4771
+ description: "Leave false or omit for normal follow-up work. Set true ONLY when the user explicitly pivots this existing conversation to a completely different functionality; reviews, tests, fixes, implementation phases, and refinements of the original request are activities and must not replace the title."
4745
4772
  }
4746
4773
  },
4747
4774
  // long_title is NOT in `required` on purpose: some agent clients
@@ -5195,7 +5222,8 @@ Use 'clear' to remove the status.`;
5195
5222
  case "set_terminal_title":
5196
5223
  result = await this.setTerminalTitle({
5197
5224
  title: args.title,
5198
- long_title: args.long_title
5225
+ long_title: args.long_title,
5226
+ replace_existing: args.replace_existing
5199
5227
  });
5200
5228
  break;
5201
5229
  case "update_terminal_activity":