newmark-agent 0.4.0 → 0.4.2

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.
@@ -327545,6 +327545,7 @@ var NATIVE_TOOL_CATALOG = [
327545
327545
  { name: "read", label: "Read file", description: "Read workspace file contents.", category: "core", defaultEnabled: true, protected: true, availability: "required" },
327546
327546
  { name: "write", label: "Write file", description: "Create or overwrite workspace files.", category: "core", defaultEnabled: true },
327547
327547
  { name: "edit", label: "Edit file", description: "Patch workspace files through exact find and replace.", category: "core", defaultEnabled: true },
327548
+ { name: "delete_file", label: "Delete file", description: "Delete one file at a time under Agent supervision; refuses directory and wildcard deletion.", category: "core", defaultEnabled: true },
327548
327549
  { name: "glob", label: "Glob files", description: "Find files by glob pattern.", category: "core", defaultEnabled: true, protected: true, availability: "required" },
327549
327550
  { name: "grep", label: "Search files", description: "Search workspace text by regex.", category: "core", defaultEnabled: true, protected: true, availability: "required" },
327550
327551
  { name: "web_search", label: "Web search", description: "Search the web from the Agent.", category: "web", defaultEnabled: true },
@@ -335297,6 +335298,91 @@ function planModePolicyPrompt() {
335297
335298
  "Runtime policy rejects stale or hidden mutating tool calls even if a prompt asks for them."
335298
335299
  ].join(" ");
335299
335300
  }
335301
+ var DELETE_VERB_SOURCE = "(?:remove-item|rmdir|unlink|erase|del|rm|rd|ri)";
335302
+ var DELETE_VERB_BOUNDARY = new RegExp(`(?:^|[\\s;&|()\\n])${DELETE_VERB_SOURCE}(?:\\s|$)`, "i");
335303
+ function hasDeletionVerb(text) {
335304
+ return DELETE_VERB_BOUNDARY.test(text);
335305
+ }
335306
+ function deletionVerbCount(text) {
335307
+ const matches = text.match(new RegExp(DELETE_VERB_BOUNDARY.source, "gi"));
335308
+ return matches ? matches.length : 0;
335309
+ }
335310
+ function hasLoopDeletion(text) {
335311
+ const lower = text.toLowerCase();
335312
+ if (/\bforeach\b/.test(lower)) return true;
335313
+ if (/\bfor\b\s*[$({]/.test(lower)) return true;
335314
+ if (/\bfor\b\s+\S+\s+in\b/.test(lower)) return true;
335315
+ if (/\bwhile\b\s*[({]/.test(lower)) return true;
335316
+ if (/\bwhile\b\s+\S/.test(lower) && /\bdo\b/.test(lower)) return true;
335317
+ if (/\bdone\b/.test(lower)) return true;
335318
+ return false;
335319
+ }
335320
+ function hasFindXargsDeletion(text) {
335321
+ if (/\bfind\b[^\n;&|]*-(?:delete\b|exec(?:dir)?\s+(?:rm|del|erase)\b)/i.test(text)) return true;
335322
+ if (/\bxargs\b[^\n;&|]*\b(?:rm|del|erase|remove-item)\b/i.test(text)) return true;
335323
+ return false;
335324
+ }
335325
+ function splitCommandArgs(args) {
335326
+ const tokens = [];
335327
+ const re = /"([^"]*)"|'([^']*)'|(\S+)/g;
335328
+ let m2;
335329
+ while ((m2 = re.exec(args)) !== null) {
335330
+ const token = m2[1] ?? m2[2] ?? m2[3] ?? "";
335331
+ if (token) tokens.push(token);
335332
+ }
335333
+ return tokens;
335334
+ }
335335
+ function hasPipeDeletion(text) {
335336
+ return new RegExp(`\\|\\s*${DELETE_VERB_SOURCE}\\b`, "i").test(text);
335337
+ }
335338
+ function hasRecursiveDeletionFlag(text) {
335339
+ const lower = text.toLowerCase();
335340
+ if (/\brm\b\s+(-[a-z]*r[a-z]*|--recursive)\b/.test(lower)) return true;
335341
+ if (/\bremove-item\b[^\n;&|]*\s+-(?:recurse|r)\b/.test(lower)) return true;
335342
+ if (/\b(?:rmdir|rd)\b\s+(-r\b|\/[s]\b)/.test(lower)) return true;
335343
+ if (/\bdel\b\s+\/[s]\b/.test(lower)) return true;
335344
+ return false;
335345
+ }
335346
+ function hasWildcardDeletionTarget(text) {
335347
+ const segmentRe = new RegExp(`(?:^|[\\s;&|()\\n])${DELETE_VERB_SOURCE}([\\s][^;&|\\n]*)?`, "gi");
335348
+ let m2;
335349
+ while ((m2 = segmentRe.exec(text)) !== null) {
335350
+ const args = m2[1] || "";
335351
+ for (const token of splitCommandArgs(args)) {
335352
+ if (!token || token.startsWith("-") || /^\/[A-Za-z]/.test(token)) continue;
335353
+ if (/[*?]/.test(token)) return true;
335354
+ }
335355
+ }
335356
+ return false;
335357
+ }
335358
+ function hasMultipleDeleteTargets(text) {
335359
+ const segmentRe = new RegExp(`(?:^|[\\s;&|()\\n])${DELETE_VERB_SOURCE}([\\s][^;&|\\n]*)?`, "gi");
335360
+ let m2;
335361
+ while ((m2 = segmentRe.exec(text)) !== null) {
335362
+ const args = m2[1] || "";
335363
+ const targets = splitCommandArgs(args).filter((t3) => t3 && !t3.startsWith("-") && !/^\/[A-Za-z]/.test(t3) && !/^(&&|\|\||;|\||&|>|>>|<|2>&1)$/.test(t3));
335364
+ if (targets.length >= 2) return true;
335365
+ }
335366
+ return false;
335367
+ }
335368
+ function evaluateDeletionGuard(command) {
335369
+ const text = String(command || "");
335370
+ if (!text.trim()) return { blocked: false };
335371
+ const findXargs = hasFindXargsDeletion(text);
335372
+ if (!hasDeletionVerb(text) && !findXargs) return { blocked: false };
335373
+ const refuse = (kind) => ({
335374
+ blocked: true,
335375
+ reason: `[deletion guard] ${kind} batch deletion is not allowed. Delete files one by one with the delete_file tool under Agent supervision.`
335376
+ });
335377
+ if (hasLoopDeletion(text)) return refuse("Loop-based");
335378
+ if (findXargs) return refuse("find/xargs");
335379
+ if (hasPipeDeletion(text)) return refuse("Pipe-fed");
335380
+ if (hasRecursiveDeletionFlag(text)) return refuse("Recursive");
335381
+ if (hasWildcardDeletionTarget(text)) return refuse("Wildcard");
335382
+ if (hasMultipleDeleteTargets(text)) return refuse("Multiple-target");
335383
+ if (deletionVerbCount(text) >= 2) return refuse("Multiple-statement");
335384
+ return { blocked: false };
335385
+ }
335300
335386
 
335301
335387
  // src/core/wslHostToolBridge.ts
335302
335388
  var ROOT_AGENT_ACTOR_ID = "00000000-0000-4000-8000-000000000001";
@@ -336169,6 +336255,7 @@ var ToolExecutor = class {
336169
336255
  t3("read", "Read file contents. Use ABSOLUTE paths. The working directory is given in system prompt.", { path: { type: "string" } }, ["path"]),
336170
336256
  t3("write", "Write/create a file. Use ABSOLUTE paths.", { path: { type: "string" }, content: { type: "string" } }, ["path", "content"]),
336171
336257
  t3("edit", "Edit file with find-and-replace. Use ABSOLUTE paths.", { path: { type: "string" }, old_str: { type: "string" }, new_str: { type: "string" } }, ["path", "old_str", "new_str"]),
336258
+ t3("delete_file", "Delete ONE file under Agent supervision. Use ABSOLUTE paths. This tool refuses directory deletion and wildcard paths; delete files one by one. Never use bash rm/del/Remove-Item for batch (recursive/wildcard/loop/pipe/multi-target) deletion \u2014 the runtime hard-blocks such commands.", { path: { type: "string" } }, ["path"]),
336172
336259
  t3("glob", "Find files by glob pattern (e.g. **/*.ts, src/**/*.html)", { pattern: { type: "string" } }, ["pattern"]),
336173
336260
  t3("grep", "Search file content with regex", { pattern: { type: "string" }, path: { type: "string" } }, ["pattern", "path"]),
336174
336261
  t3("web_search", "Search the web", { query: { type: "string" } }, ["query"]),
@@ -336503,6 +336590,7 @@ var ToolExecutor = class {
336503
336590
  case "read":
336504
336591
  case "write":
336505
336592
  case "edit":
336593
+ case "delete_file":
336506
336594
  case "grep":
336507
336595
  case "file_audit":
336508
336596
  case "pdf_read":
@@ -336519,6 +336607,11 @@ var ToolExecutor = class {
336519
336607
  if (permissionGuard) return permissionGuard;
336520
336608
  const bashGuard = tool === "bash" || tool === "terminal_takeover" && g2("action") === "write" ? this.checkBashWorkspaceAccess(g2("command"), context.workspacePath || wsPath) : null;
336521
336609
  if (bashGuard) return bashGuard;
336610
+ const deletionGuardTarget = tool === "bash" || tool === "terminal_takeover" && g2("action") === "write" ? g2("command") : null;
336611
+ if (deletionGuardTarget !== null) {
336612
+ const deletionGuard = evaluateDeletionGuard(deletionGuardTarget);
336613
+ if (deletionGuard.blocked) return deletionGuard.reason || "[deletion guard] Batch deletion is not allowed.";
336614
+ }
336522
336615
  try {
336523
336616
  switch (tool) {
336524
336617
  case "bash":
@@ -336531,6 +336624,8 @@ var ToolExecutor = class {
336531
336624
  return this.fwrite(resolve16(g2("path")), g2("content"));
336532
336625
  case "edit":
336533
336626
  return this.fedit(resolve16(g2("path")), g2("old_str"), g2("new_str"));
336627
+ case "delete_file":
336628
+ return this.fdelete(resolve16(g2("path")));
336534
336629
  case "glob":
336535
336630
  return this.glob(g2("pattern"), wsPath);
336536
336631
  case "grep":
@@ -337064,6 +337159,20 @@ var ToolExecutor = class {
337064
337159
  return `[edit] ${e3}`;
337065
337160
  }
337066
337161
  }
337162
+ fdelete(p) {
337163
+ try {
337164
+ if (/[*?]/.test(p)) return "[delete_file] Refused: wildcard paths are not allowed. Delete one file per call.";
337165
+ const resolved = path15.resolve(p);
337166
+ const stat = fs13.lstatSync(resolved);
337167
+ if (stat.isDirectory()) {
337168
+ return "[delete_file] Refused: deleting a directory is not allowed. Delete files one by one under Agent supervision.";
337169
+ }
337170
+ fs13.unlinkSync(resolved);
337171
+ return `[delete_file] OK: ${resolved}`;
337172
+ } catch (e3) {
337173
+ return `[delete_file] ${e3 instanceof Error ? e3.message : String(e3)}`;
337174
+ }
337175
+ }
337067
337176
  glob(pattern, ws) {
337068
337177
  try {
337069
337178
  const results = globSync(pattern, {
@@ -339932,7 +340041,7 @@ var DOMAIN_PREFIXES = [
339932
340041
  [/^web_/, "web"],
339933
340042
  [/^computer_use$/, "computer"],
339934
340043
  [/^(image_|ocr_|pdf_)/, "media"],
339935
- [/^(bash|pwd|read|write|edit|glob|grep)$/, "core"]
340044
+ [/^(bash|pwd|read|write|edit|delete_file|glob|grep)$/, "core"]
339936
340045
  ];
339937
340046
  var READ_TOOL_PATTERN = /^(pwd|read|glob|grep|git_status|git_log|git_diff|git_branch|git_show|memory_lab_read|memory_lab_query|skill|linked_plan|build_history_query|subagent_read|subagent_result|subagent_list|subagent_progress|question|image_inspect|image_display|ocr_read|pdf_read|automation_list|automation_status)$/;
339938
340047
  var DESTRUCTIVE_PATTERN = /(?<!\b(?:are|is|be|being|was|were|will be|would be|gets?|become)\s)\b(?:destroy|delete|erase|remove|rm\s|force|shutdown|kill|terminate|drop\s|prune)\b/;
@@ -344421,6 +344530,7 @@ var CORE_SYSTEM_PROMPT = `You are Newmark Agent, a powerful AI coding assistant
344421
344530
  - read: Read file contents
344422
344531
  - write: Write a new file
344423
344532
  - edit: Edit a file with search-and-replace
344533
+ - delete_file: Delete ONE file at a time under Agent supervision (absolute path; refuses directories and wildcards)
344424
344534
  - glob: Find files by pattern
344425
344535
  - grep: Search file contents with regex
344426
344536
  - web_search: Search the web via DuckDuckGo
@@ -344482,6 +344592,7 @@ var CORE_SYSTEM_PROMPT = `You are Newmark Agent, a powerful AI coding assistant
344482
344592
  - Visible replies must be concise, direct engineering prose. Do not wrap replies in chat bubbles or role labels.
344483
344593
  - Be thorough and precise. Verify your work.
344484
344594
  - Use tools appropriately - don't just describe, do it.
344595
+ - Deletion safety (intrinsic, non-overridable): file deletion is allowed only ONE file at a time under Agent supervision. Use the delete_file tool with an absolute path for every single-file delete. Never use bash or the terminal to delete files in bulk: recursive deletes (rm -r/-rf, Remove-Item -Recurse, rmdir /s, del /s), wildcard deletes (rm *.log, del *), loop deletes (for/foreach/while + rm), pipe-fed deletes (Get-ChildItem | Remove-Item), find/xargs deletes, and multi-target or multi-statement deletes are hard-blocked by the runtime and will be rejected. To remove a directory, delete its files one by one first, then remove the now-empty directory without a recursive flag.
344485
344596
  - For desktop Computer Use requests, follow observe -> decide -> act -> observe. Start visible takeover with computer_use takeover_start before multi-step desktop control and stop it when finished. Prefer app-scoped actions through app_list/app_observe/app_* when controlling one taskbar application, because this preserves human collaboration around other windows. Prefer target_id from the latest high-priority semantic UI objects, otherwise precise coordinates from the latest observation. Use vision plus UI controls together when the selected model has vision input. Avoid destructive UI actions unless the user asked for them, and do not claim YOLO/OCR perception unless an actual detector/OCR result is present.
344486
344597
  - For browser buttons and scanned document pages, the strict recognition sequence is text layer/DOM -> screenshot to a validated vision model -> local OCR. Do not skip directly to OCR. If OCR is used, treat it as approximate evidence and repair only what surrounding context supports.
344487
344598
  - Multiple tool calls emitted in one provider turn run concurrently. Treat their returned records as one barrier: continue reasoning only after every call in that batch has returned either a successful receipt or a failure receipt.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "newmark-agent",
3
3
  "productName": "Newmark Agent",
4
- "version": "0.4.0",
4
+ "version": "0.4.2",
5
5
  "description": "Newmark Agent — Portable AI coding agent with rich GUI and CLI (TypeScript)",
6
6
  "homepage": "https://github.com/positer/Newmark-Agent",
7
7
  "repository": {
@@ -21,7 +21,6 @@
21
21
  "!dist/tests/**/*",
22
22
  "!dist/**/*.map",
23
23
  "assets/**/*",
24
- "Flow/**/*",
25
24
  "config.example.json"
26
25
  ],
27
26
  "scripts": {
@@ -52,7 +51,9 @@
52
51
  "check-cross-platform-env": "node scripts/check-cross-platform-env.cjs",
53
52
  "dist:harmonyos": "node scripts/dist-harmonyos.cjs",
54
53
  "test:desktop": "npm run build && npm run test:desktop:built",
55
- "test:desktop:built": "node dist/tests/verify.js && node dist/tests/computerUseSessionVerify.js && node dist/tests/contextSystemV2Verify.js && node dist/tests/contextSystemV2StressVerify.js && node dist/tests/providerAdapterV2Verify.js && node dist/tests/providerTimeoutRecoveryVerify.js && node dist/tests/agentRuntimeV2Verify.js && node dist/tests/toolchainExposureV2Verify.js && node dist/tests/localOcrFallbackVerify.js && node dist/tests/dev018ModeSubagentStressVerify.js && node dist/tests/conversationBranchStressVerify.js && node dist/tests/conversationArchiveConcurrencyVerify.js && node dist/tests/conversationArchiveRuntimeVerify.js && node dist/tests/memoryPolicyVerify.js && node dist/tests/newmarkSelectVerify.js && node dist/tests/mcpManagerVerify.js && node dist/tests/dshCompatibilityVerify.js && node dist/tests/performanceOptimizationVerify.js && node scripts/compression-pressure-stress.cjs && node dist/tests/compressionFidelityVerify.js && node dist/tests/responseTrajectoryVerify.js && node dist/tests/normalChatRegressionVerify.js && node dist/tests/dev008-subagent.js && node dist/tests/dev009Verify.js && node dist/tests/runtimeIsolationVerify.js && node dist/tests/runtimePoolCapacityVerify.js && node dist/tests/guideWorkRunVerify.js && node scripts/flow-pause-stop-draft-stress.cjs && node dist/tests/guideUiReconcileVerify.js && node dist/tests/queueAttachmentIsolationVerify.js && node dist/tests/workspaceMenuVerify.js && node dist/tests/userImagePersistenceVerify.js && node dist/tests/displayImageVerify.js && node dist/tests/visualPreferencesVerify.js && node dist/tests/browserUseVerify.js && node dist/tests/toolProcessVerify.js && node dist/tests/toolProvisioningVerify.js && node dist/tests/startupPrewarmVerify.js && node dist/tests/pdfPreviewServerVerify.js && node dist/tests/editorLifecycleVerify.js && node dist/tests/terminalTakeoverVerify.js && node dist/tests/workspaceFileRouterVerify.js && node dist/tests/computerUsePerformanceVerify.js && node dist/tests/autoRouterVerify.js && node dist/tests/autoAgentIntegrationVerify.js && node dist/tests/autoRouteRatingVerify.js && node dist/tests/providerIdentityVerify.js && node dist/tests/modelValidationVerify.js && node dist/tests/modelValidationAgentIntegrationVerify.js",
54
+ "test:deletion-safety": "npm run build && npm run test:deletion-safety:built",
55
+ "test:deletion-safety:built": "node scripts/deletion-safety-stress.cjs",
56
+ "test:desktop:built": "node dist/tests/verify.js && node dist/tests/computerUseSessionVerify.js && node dist/tests/contextSystemV2Verify.js && node dist/tests/contextSystemV2StressVerify.js && node dist/tests/providerAdapterV2Verify.js && node dist/tests/providerTimeoutRecoveryVerify.js && node dist/tests/agentRuntimeV2Verify.js && node dist/tests/toolchainExposureV2Verify.js && node dist/tests/localOcrFallbackVerify.js && node dist/tests/dev018ModeSubagentStressVerify.js && node dist/tests/conversationBranchStressVerify.js && node dist/tests/conversationArchiveConcurrencyVerify.js && node dist/tests/conversationArchiveRuntimeVerify.js && node dist/tests/dev040ComprehensiveStressVerify.js && node dist/tests/memoryPolicyVerify.js && node dist/tests/newmarkSelectVerify.js && node dist/tests/mcpManagerVerify.js && node dist/tests/dshCompatibilityVerify.js && node dist/tests/performanceOptimizationVerify.js && node scripts/compression-pressure-stress.cjs && node dist/tests/compressionFidelityVerify.js && node dist/tests/responseTrajectoryVerify.js && node dist/tests/normalChatRegressionVerify.js && node dist/tests/dev008-subagent.js && node dist/tests/dev009Verify.js && node dist/tests/runtimeIsolationVerify.js && node dist/tests/runtimePoolCapacityVerify.js && node dist/tests/guideWorkRunVerify.js && node scripts/flow-pause-stop-draft-stress.cjs && node dist/tests/guideUiReconcileVerify.js && node dist/tests/queueAttachmentIsolationVerify.js && node dist/tests/workspaceMenuVerify.js && node dist/tests/userImagePersistenceVerify.js && node dist/tests/displayImageVerify.js && node dist/tests/visualPreferencesVerify.js && node dist/tests/browserUseVerify.js && node dist/tests/toolProcessVerify.js && node dist/tests/toolProvisioningVerify.js && node dist/tests/startupPrewarmVerify.js && node dist/tests/pdfPreviewServerVerify.js && node dist/tests/editorLifecycleVerify.js && node dist/tests/terminalTakeoverVerify.js && node dist/tests/workspaceFileRouterVerify.js && node dist/tests/computerUsePerformanceVerify.js && node dist/tests/autoRouterVerify.js && node dist/tests/autoAgentIntegrationVerify.js && node dist/tests/autoRouteRatingVerify.js && node dist/tests/providerIdentityVerify.js && node dist/tests/modelValidationVerify.js && node dist/tests/modelValidationAgentIntegrationVerify.js && node scripts/deletion-safety-stress.cjs",
56
57
  "test:conversation-branch-stress": "npm run build && node dist/tests/conversationBranchStressVerify.js",
57
58
  "test:conversation-archive-concurrency": "npm run build && node dist/tests/conversationArchiveConcurrencyVerify.js",
58
59
  "test:memory-policy": "npm run build && node dist/tests/memoryPolicyVerify.js",
@@ -221,13 +222,6 @@
221
222
  {
222
223
  "from": "../THIRD_PARTY_NOTICES.md",
223
224
  "to": "THIRD_PARTY_NOTICES.md"
224
- },
225
- {
226
- "from": "Flow",
227
- "to": "Flow",
228
- "filter": [
229
- "**/*"
230
- ]
231
225
  }
232
226
  ],
233
227
  "win": {
@@ -1,43 +0,0 @@
1
- {
2
- "name": "Electron-Debug-Release",
3
- "description": "TypeScript Electron project debug pipeline: typecheck → build → lint → IPC consistency → UI sanity → release",
4
- "components": [
5
- {
6
- "id": 0,
7
- "type": "dialog",
8
- "mode": "build",
9
- "prompt": "Debug Step 1: TypeScript Compilation Check\nRun `npx tsc --noEmit` in the DESKTOP/ directory.\n- If it fails, collect ALL errors, categorize by file, and fix each one.\n- Ensure strict mode passes (noImplicitAny, strictNullChecks, etc)."
10
- },
11
- {
12
- "id": 1,
13
- "type": "dialog",
14
- "mode": "build",
15
- "prompt": "Debug Step 2: Build + Lint\n1. Run `npm run build` and verify it succeeds.\n2. Run `npm run lint` and fix any warnings/errors.\n3. Ensure `dist/main.js`, `dist/preload.js`, `dist/ui/index.html` all exist in dist/"
16
- },
17
- {
18
- "id": 2,
19
- "type": "dialog",
20
- "mode": "build",
21
- "prompt": "Debug Step 3: IPC Handler Consistency Check\nRead `src/preload.ts` and `src/main.ts`. Verify that:\n- Every `ipcRenderer.invoke('agent:xxx', ...)` in preload.ts has a matching `ipcMain.handle('agent:xxx', ...)` in main.ts\n- The async function signatures match (number of parameters)\n- Every `ipcMain.handle` is used (no orphaned handlers)\n- Report any mismatches and fix them."
22
- },
23
- {
24
- "id": 3,
25
- "type": "dialog",
26
- "mode": "build",
27
- "prompt": "Debug Step 4: index.html Sanity Check\nRead `src/ui/index.html` and check:\n- All `onclick=\"window.xxx(...)\"` references have corresponding `window.xxx = function(...)` definitions\n- No duplicate function declarations\n- No syntax errors (orphaned braces, missing catch/finally)\n- All `api.xxx()` calls match preload.ts exposed methods\n- Report any issues and fix them."
28
- },
29
- {
30
- "id": 4,
31
- "type": "logic",
32
- "prompt": "Are all Debug Steps 0-4 clean? No errors, no warnings, no mismatches.",
33
- "goto_true": 5,
34
- "goto_false": 0
35
- },
36
- {
37
- "id": 5,
38
- "type": "dialog",
39
- "mode": "build",
40
- "prompt": "Release Step: Build portable distribution\nRun `npx tsc --noEmit` to confirm clean, then `npm run build`. Then run:\n```\nnpx electron-builder --win --config electron-builder.config.ts --x64 2>&1\n```\nCollect the output artifact path. Verify the .exe file exists and its size is reasonable (>50MB)."
41
- }
42
- ]
43
- }
package/Flow/Flow.md DELETED
@@ -1,9 +0,0 @@
1
- # Newmark Flow Format Guide
2
-
3
- A Flow workflow is saved as name.Flow.json in the Flow/ folder.
4
-
5
- ## Component Types
6
- ### dialog - id, type:"dialog", mode:"build"/"plan"/"goal", prompt (use {#prompt#} placeholder)
7
- ### logic - id, type:"logic", prompt, goto_true, goto_false
8
-
9
- Components execute in order unless logic redirects.
@@ -1,96 +0,0 @@
1
- {
2
- "name": "UI-Feature-Integration",
3
- "description": "Complete all Design.txt UI features on top of working IPC+chat foundation",
4
- "components": [
5
- {
6
- "id": 0,
7
- "type": "dialog",
8
- "mode": "build",
9
- "prompt": "当前状态:Electron IPC、preload、agent初始化、基本聊天输入/发送均已正常工作。精简版UI已运行,下一步需要将完整UI功能逐步集成回来。请读取 DESKTOP/src/ui/index.html 和 Design.txt 了解现状和目标。第一步:恢复原始玻璃拟态设计系统。将原始 index.html 中的CSS设计系统(玻璃拟态三层深度、贝塞尔圆角、GPU加速、SF字体栈、动态彩条跑马灯动画)合并到当前精简版UI中,同时保持所有功能(IPC通信、事件绑定方式)正常工作。注意:所有 onclick 必须使用 window.xxx 绑定,const 不创建window属性。完成后运行 npm run build 并启动测试。"
10
- },
11
- {
12
- "id": 1,
13
- "type": "dialog",
14
- "mode": "build",
15
- "prompt": "第二步:恢复可调节面板系统。实现左侧栏(#left)、右侧栏(#right)、底部栏(#bottom)的可伸缩面板,带拖拽手柄(mousedown/mousemove/mouseup),最小宽度/高度约束,折叠/展开切换按钮。左侧栏折叠时只显示图标,右下栏不显示时隐藏。阅读 Design.txt §12 了解右侧栏标签页(文件树、编辑器、MD阅读器、子代理、浏览器)和底部终端。同时保留当前所有功能正常。"
16
- },
17
- {
18
- "id": 2,
19
- "type": "dialog",
20
- "mode": "build",
21
- "prompt": "第三步:恢复顶部自定义标题栏。实现无OS窗口边框的标题栏(#topbar),左侧显示Newmark标题(agent运行时字体动态彩色闪动),右侧最小化/最大化/关闭按钮。窗口拖拽通过 -webkit-app-region:drag 实现。阅读 Design.txt §10。注意:最大化/最小化/关闭按钮的 onclick 使用 api.minimize/maximize/close。完成后集成左侧栏的插件/自动化/工作流/设置图标按钮,点击打开独立子窗口(.sub-win),子窗口可拖动、可关闭,点击外部关闭弹出列表。阅读 Design.txt §11。"
22
- },
23
- {
24
- "id": 3,
25
- "type": "dialog",
26
- "mode": "build",
27
- "prompt": "第四步:恢复完整聊天区功能。包括:(1) 消息气泡样式(用户蓝色右对齐、助手灰色左对齐),(2) 消息附带mode/model标签(hover显示),(3) 正在运行时的灰白/灰黑脉冲动画,(4) Shell输出块(默认折叠,点击展开),(5) 文件变更差异块(绿增红减,默认折叠,点击展开),(6) 选项反馈显示。阅读 Design.txt §13。同时实现 Guide/Next 输入模式切换(输入框左下角),Ctrl+Enter切换相反模式。"
28
- },
29
- {
30
- "id": 4,
31
- "type": "dialog",
32
- "mode": "build",
33
- "prompt": "第五步:实现 Goal 模式UI。在输入框上方添加 Goal 条(仅Goal模式显示):左顶格显示目标文本,右顶格编辑+暂停/继续按钮,上边两角贝塞尔圆角。参考 Design.txt §14。实现目标清单(Todo List):可折叠/展开,最多8行滚动,完成项变淡+删除线,用户/agent可切换完成状态。实现回到底部向下按钮(当聊天未在最底部时显示)。全存在时顺序:回到底部、清单、Goal、输入框。"
34
- },
35
- {
36
- "id": 5,
37
- "type": "dialog",
38
- "mode": "build",
39
- "prompt": "第六步:实现设置窗口。独立子窗口,居中显示,非可调大小可拖动。三标签页:(1) 通用 - 暗色模式(深色/浅色/跟随系统)、毛玻璃模糊程度、对话风格、反馈等级、默认输入模式、关闭行为等;(2) 模型与供应商 - 添加供应商(名称+API端点+API密钥)、添加模型(上下文大小、视觉/思考开关、描述)、三维评估(开销/性能/速度)、模型自动切换开关与倾向、模糊注入按钮;(3) 归档管理 - 列出归档、加载归档、删除归档、归档当前会话。所有设置绑定 config.json。阅读 Design.txt §16。"
40
- },
41
- {
42
- "id": 6,
43
- "type": "dialog",
44
- "mode": "build",
45
- "prompt": "第七步:实现文件树管理器。右侧栏默认显示文件树,列出当前工作区文件。点击文件夹展开/折叠,点击文件:.md文件在MD阅读器打开,.txt/.json/.tex等在编辑器打开。文件树支持面包屑导航。阅读 Design.txt §12。实现 MD阅读器(渲染markdown为HTML)、编辑器(显示文件内容,简单文本编辑功能)、内置浏览器(输入URL导航,前进/后退历史)。均在右侧栏标签页切换。"
46
- },
47
- {
48
- "id": 7,
49
- "type": "dialog",
50
- "mode": "build",
51
- "prompt": "第八步:实现终端面板。底部栏显示终端,可选择 PowerShell/Bash/CMD。输入命令执行,显示输出。通过 api.executeBash() IPC 调用。Shell 输出块默认折叠,点击展开。阅读 Design.txt §12。"
52
- },
53
- {
54
- "id": 8,
55
- "type": "dialog",
56
- "mode": "build",
57
- "prompt": "第九步:实现动态跑马灯/彩条边框系统。搜索学习Apple AI风格的动态渐变边框效果。所有活动元素(工作中对话、提交按钮、设置中校验按钮、工作区缩略图)在活跃状态时显示动态彩色跑马灯边框。颜色在设置中通过调色盘可视化调节(设置颜色数量,再设置每个颜色)。阅读 Design.txt §15。参考CSS动画方案:用伪元素+conic-gradient+mask实现动态旋转边框。"
58
- },
59
- {
60
- "id": 9,
61
- "type": "dialog",
62
- "mode": "build",
63
- "prompt": "第十步:实现二级左侧边栏。单击工作区缩略图时展开二级左侧边栏:顶部显示工作区设置按钮和新对话按钮,下部显示对话列表(每行显示对话大纲摘要,右侧归档按钮)。运行中的对话边框动态跑马灯。阅读 Design.txt §11。"
64
- },
65
- {
66
- "id": 10,
67
- "type": "dialog",
68
- "mode": "build",
69
- "prompt": "第十一步:实现 Subagent 面板。右侧栏 subagent 标签页显示活跃子代理列表,点击查看对话历史(只读)。agent 可通过 task 工具创建 subagent,通过 get.subagent() 获取结果。阅读 Design.txt §26。"
70
- },
71
- {
72
- "id": 11,
73
- "type": "dialog",
74
- "mode": "build",
75
- "prompt": "第十二步:实现自动化窗口。独立子窗口,固定大小居中。3-4行输入框,下方模型选择器和条件选择器(单次/循环间隔/起止时间)。agent 和用户都可创建自动化任务。阅读 Design.txt §24。"
76
- },
77
- {
78
- "id": 12,
79
- "type": "dialog",
80
- "mode": "build",
81
- "prompt": "第十三步:实现工作流编辑器。左侧栏工作流按钮打开独立窗口。目录树显示 Flow/ 目录下的所有 .Flow.json 文件(去除后缀)。展示组件树:展开显示编码+类型(0 Build, 1 Logic等),再次展开可编辑(对话组件:mode+prompt;逻辑组件:prompt+goto1+goto2)。所有输入框贝塞尔圆角。新建工作流按钮始终在第一位。阅读 Design.txt §29。"
82
- },
83
- {
84
- "id": 13,
85
- "type": "dialog",
86
- "mode": "build",
87
- "prompt": "第十四步:实现归档功能。学习现有实现(Hermes/Codex/OpenCode),实现对话归档到工作区存储,可恢复。实现上下文压缩:接近token限制时调用压缩模型总结对话保留关键信息。阅读 Design.txt §30。"
88
- },
89
- {
90
- "id": 14,
91
- "type": "dialog",
92
- "mode": "build",
93
- "prompt": "第十五步:最终整合与完整测试。确保所有onclick使用 window.xxx 绑定,所有功能在IPC和HTTP fallback模式下均可工作,暗色/亮色模式切换正常,各面板独立折叠/展开/缩放,所有设置读写 config.json,Goal 模式无限制循环,Flow 工作流正确执行,归档/恢复完整。运行 npm run build && npm run start:cli 测试CLI,再启动 Electron 测试UI。对照 Design.txt 逐一验证。"
94
- }
95
- ]
96
- }