@ngockhoale/ckit 0.4.4 → 0.4.5

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.
@@ -214,12 +214,14 @@ const HOW_TO_HEAD = String.raw `(?<![\p{L}])(?:how (?:to|do (?:i|we|you)|should
214
214
  const HOW_TO_RE = new RegExp(String.raw `${HOW_TO_HEAD}[^\n]*?(?=$|\n|[,;!?]|\.(?=\s|$)| (?:rồi|then|and|also|please|sau đó|và|với|plus)(?![\p{L}]))`, 'gimu'); // the clause ends at a conjunction, , ; ! ? or a sentence-ending dot (not the dot in src/config.ts)
215
215
  const HOW_TO_SENT_RE = new RegExp(String.raw `${HOW_TO_HEAD}[^\n]*?(?=$|\n|[;!?]|\.(?=\s|$))`, 'gimu'); // before an explicit no-write order: the explained clause runs to its sentence end
216
216
  /** The owner forbade writing in so many words (not only a "read-only" label): "do not change any files", "no code changes", "không sửa". */
217
- const NO_WRITE_RE = /(?<![\p{L}])(?:(?:do not|don't|dont|never|without) (?:change|changing|modify|modifying|edit|editing|touch|touching|write|writing) (?:(?:any(?: of the)?|the|a single) )?(?:files?|code|anything|the repo|the project|the codebase)(?![\p{L}])|no (?:code |file )?changes(?![\p{L}])|không (?:được )?(?:sửa|thay đổi|chỉnh sửa))(?![^.;\n]{0,40}?(?<![\p{L}])(?:outside|except|other than|besides|beyond|apart from|else|in production|ngoài|trừ)(?![\p{L}]))/iu; // a whole no-write order; a scoped one ("except docs/", "ngoài docs/") is not
217
+ const NO_WRITE_RE = /(?<![\p{L}])(?:(?:do not|don't|dont|never|without) (?:change|changing|modify|modifying|edit|editing|touch|touching|write|writing) (?:(?:any(?: of the)?|the|a single) )?(?:files?|code|anything|the repo|the project|the codebase)(?![\p{L}])(?!,? (?:except|outside|other than|besides|beyond|apart from|in production|else)(?![\p{L}]))|no (?:code |file )?changes(?![\p{L}])(?!,? (?:except|outside|other than|besides|beyond|apart from|in production|else)(?![\p{L}]))|không (?:được )?(?:sửa|thay đổi|chỉnh sửa)(?: (?:file|code|gì))?(?![\p{L}])(?!,? (?:file |code )?(?:ngoài|trừ)(?![\p{L}])))/iu; // a whole no-write order; one whose object is directly limited ("files outside docs/", "file ngoài docs/") is a scope, not read-only
218
+ /** "In your reply, add a summary": shapes the answer, never the workspace. */
219
+ const REPLY_RE = /(?<![\p{L}])(?:in|to|into) (?:your|the) (?:reply|answer|response|report|summary|explanation|câu trả lời)(?![\p{L}])[^.;!?\n]*|(?<![\p{L}])(?:trong|vào) (?:câu trả lời|báo cáo|phần trả lời)[^.;!?\n]*/giu;
218
220
  /** PF-MODES: the owner asked for a read-only result (question, analysis, review) - no team may change files.
219
221
  * The scope phrase must open the goal (first 25 chars) and the rest of the goal (after removing the scope phrases and [bracket tags]) must not ask for a change. */
220
222
  export const isReadOnlyGoal = (goal) => {
221
223
  const g = goal.replace(/\[[^\]]*\]/g, ' ').replace(/[^\S\n]+/g, ' ').trim(), first = [...g.matchAll(READ_ONLY_RE)][0], nw = NO_WRITE_RE.exec(g);
222
- const asks = (t, how = HOW_TO_RE) => CHANGE_RE.test(t.replace(READ_ONLY_RE, ' ').replace(how, ' '));
224
+ const asks = (t, how = HOW_TO_RE) => CHANGE_RE.test(t.replace(READ_ONLY_RE, ' ').replace(REPLY_RE, ' ').replace(how, ' '));
223
225
  // an explicit whole no-write order (anywhere) wins when nothing before it asks for a change: the rest is to be explained, never done
224
226
  if (nw && !asks(g.slice(0, nw.index), HOW_TO_SENT_RE))
225
227
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngockhoale/ckit",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "CKit — local Agent Company: a Director plus BA / Implement / QC teams running your own codex, claude and omp CLIs, with a web Mission Control (ckit gui).",
5
5
  "type": "module",
6
6
  "bin": {