newmark-agent 0.3.5 → 0.3.6

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.
@@ -1,43 +1,43 @@
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
- }
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 CHANGED
@@ -1,9 +1,9 @@
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
-
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
9
  Components execute in order unless logic redirects.
@@ -1,96 +1,96 @@
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
- }
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
+ }
@@ -109,43 +109,43 @@ class AutomationWakeScheduler {
109
109
  const startBoundary = toTaskSchedulerLocal(nextRunAt);
110
110
  const command = xmlEscape(this.exePath);
111
111
  const args = xmlEscape(`--root "${this.rootPath}" --automation-wake`);
112
- const xml = `<?xml version="1.0" encoding="UTF-16"?>
113
- <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
114
- <RegistrationInfo>
115
- <Description>Wake Newmark Agent to run due automations.</Description>
116
- <URI>\\${xmlEscape(taskName)}</URI>
117
- </RegistrationInfo>
118
- <Triggers>
119
- <TimeTrigger>
120
- <StartBoundary>${xmlEscape(startBoundary)}</StartBoundary>
121
- <Enabled>true</Enabled>
122
- </TimeTrigger>
123
- </Triggers>
124
- <Principals>
125
- <Principal id="Author">
126
- <UserId>${xmlEscape(os.userInfo().username)}</UserId>
127
- <LogonType>InteractiveToken</LogonType>
128
- <RunLevel>LeastPrivilege</RunLevel>
129
- </Principal>
130
- </Principals>
131
- <Settings>
132
- <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
133
- <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
134
- <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
135
- <AllowHardTerminate>true</AllowHardTerminate>
136
- <StartWhenAvailable>true</StartWhenAvailable>
137
- <WakeToRun>true</WakeToRun>
138
- <Enabled>true</Enabled>
139
- <Hidden>false</Hidden>
140
- <ExecutionTimeLimit>PT2H</ExecutionTimeLimit>
141
- </Settings>
142
- <Actions Context="Author">
143
- <Exec>
144
- <Command>${command}</Command>
145
- <Arguments>${args}</Arguments>
146
- <WorkingDirectory>${xmlEscape(this.rootPath)}</WorkingDirectory>
147
- </Exec>
148
- </Actions>
112
+ const xml = `<?xml version="1.0" encoding="UTF-16"?>
113
+ <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
114
+ <RegistrationInfo>
115
+ <Description>Wake Newmark Agent to run due automations.</Description>
116
+ <URI>\\${xmlEscape(taskName)}</URI>
117
+ </RegistrationInfo>
118
+ <Triggers>
119
+ <TimeTrigger>
120
+ <StartBoundary>${xmlEscape(startBoundary)}</StartBoundary>
121
+ <Enabled>true</Enabled>
122
+ </TimeTrigger>
123
+ </Triggers>
124
+ <Principals>
125
+ <Principal id="Author">
126
+ <UserId>${xmlEscape(os.userInfo().username)}</UserId>
127
+ <LogonType>InteractiveToken</LogonType>
128
+ <RunLevel>LeastPrivilege</RunLevel>
129
+ </Principal>
130
+ </Principals>
131
+ <Settings>
132
+ <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
133
+ <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
134
+ <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
135
+ <AllowHardTerminate>true</AllowHardTerminate>
136
+ <StartWhenAvailable>true</StartWhenAvailable>
137
+ <WakeToRun>true</WakeToRun>
138
+ <Enabled>true</Enabled>
139
+ <Hidden>false</Hidden>
140
+ <ExecutionTimeLimit>PT2H</ExecutionTimeLimit>
141
+ </Settings>
142
+ <Actions Context="Author">
143
+ <Exec>
144
+ <Command>${command}</Command>
145
+ <Arguments>${args}</Arguments>
146
+ <WorkingDirectory>${xmlEscape(this.rootPath)}</WorkingDirectory>
147
+ </Exec>
148
+ </Actions>
149
149
  </Task>`;
150
150
  fs.writeFileSync(xmlPath, Buffer.from(`\ufeff${xml}`, 'utf16le'));
151
151
  return xmlPath;
package/dist/main.js CHANGED
@@ -491,34 +491,34 @@ function firstRunInit(root) {
491
491
  // Flow.md
492
492
  const fm = path.join(root, 'Flow', 'Flow.md');
493
493
  if (!fs.existsSync(fm)) {
494
- fs.writeFileSync(fm, `# Newmark Flow Format Guide
495
-
496
- A Flow workflow is saved as \`name.Flow.json\` in the Flow/ folder.
497
-
498
- ## File Format
499
- \`\`\`json
500
- {
501
- "name": "my-workflow",
502
- "components": [
503
- {"id": 0, "type": "dialog", "mode": "build", "prompt": "Implement a web server"},
504
- {"id": 1, "type": "dialog", "mode": "plan", "prompt": "Review: {#prompt#}"},
505
- {"id": 2, "type": "logic", "prompt": "Is the review complete?", "goto_true": 0, "goto_false": 3},
506
- {"id": 3, "type": "dialog", "mode": "build", "prompt": "Apply fixes from review"}
507
- ]
508
- }
509
- \`\`\`
510
-
511
- ## Component Types
512
- ### dialog
513
- - id: Sequential index, type: "dialog", mode: "build"/"plan"/"goal"
514
- - prompt: Base prompt. Use \`{#prompt#}\` as placeholder for user input.
515
-
516
- ### logic
517
- - id: Sequential index, type: "logic", prompt: Question for the agent to evaluate
518
- - goto_true/goto_false: Component ID to jump to
519
-
520
- ## Execution
521
- Components execute in order 0 -> 1 -> 2 -> ..., unless a logic component redirects.
494
+ fs.writeFileSync(fm, `# Newmark Flow Format Guide
495
+
496
+ A Flow workflow is saved as \`name.Flow.json\` in the Flow/ folder.
497
+
498
+ ## File Format
499
+ \`\`\`json
500
+ {
501
+ "name": "my-workflow",
502
+ "components": [
503
+ {"id": 0, "type": "dialog", "mode": "build", "prompt": "Implement a web server"},
504
+ {"id": 1, "type": "dialog", "mode": "plan", "prompt": "Review: {#prompt#}"},
505
+ {"id": 2, "type": "logic", "prompt": "Is the review complete?", "goto_true": 0, "goto_false": 3},
506
+ {"id": 3, "type": "dialog", "mode": "build", "prompt": "Apply fixes from review"}
507
+ ]
508
+ }
509
+ \`\`\`
510
+
511
+ ## Component Types
512
+ ### dialog
513
+ - id: Sequential index, type: "dialog", mode: "build"/"plan"/"goal"
514
+ - prompt: Base prompt. Use \`{#prompt#}\` as placeholder for user input.
515
+
516
+ ### logic
517
+ - id: Sequential index, type: "logic", prompt: Question for the agent to evaluate
518
+ - goto_true/goto_false: Component ID to jump to
519
+
520
+ ## Execution
521
+ Components execute in order 0 -> 1 -> 2 -> ..., unless a logic component redirects.
522
522
  `, 'utf-8');
523
523
  }
524
524
  // Local.json, External.json, State.json
@@ -843,14 +843,14 @@ async function executeInBrowser(contents, script) {
843
843
  return await contents.executeJavaScript(script, true);
844
844
  }
845
845
  function browserSnapshotScript(maxChars) {
846
- return `(() => {
847
- const clone = document.body ? document.body.cloneNode(true) : null;
848
- if (clone) clone.querySelectorAll('script,style,noscript,svg,canvas').forEach((node) => node.remove());
849
- const text = (clone ? clone.innerText : document.documentElement.innerText || '')
850
- .replace(/\\s+/g, ' ')
851
- .trim()
852
- .slice(0, ${Math.max(500, Math.min(maxChars, 50000))});
853
- return { url: location.href, title: document.title || '', text };
846
+ return `(() => {
847
+ const clone = document.body ? document.body.cloneNode(true) : null;
848
+ if (clone) clone.querySelectorAll('script,style,noscript,svg,canvas').forEach((node) => node.remove());
849
+ const text = (clone ? clone.innerText : document.documentElement.innerText || '')
850
+ .replace(/\\s+/g, ' ')
851
+ .trim()
852
+ .slice(0, ${Math.max(500, Math.min(maxChars, 50000))});
853
+ return { url: location.href, title: document.title || '', text };
854
854
  })()`;
855
855
  }
856
856
  async function runBrowserControl(request) {
@@ -881,33 +881,33 @@ async function runBrowserControl(request) {
881
881
  return { ok: true, action, source: 'webview-cdp', ...snap };
882
882
  }
883
883
  if (action === 'click') {
884
- const data = await executeInBrowser(contents, `(() => {
885
- const el = document.querySelector(${JSON.stringify(request.selector || '')});
886
- if (!el) return { clicked: false, error: 'selector not found' };
887
- el.scrollIntoView({ block: 'center', inline: 'center' });
888
- el.dispatchEvent(new MouseEvent('mouseover', { bubbles: true }));
889
- el.dispatchEvent(new MouseEvent('mousedown', { bubbles: true }));
890
- el.dispatchEvent(new MouseEvent('mouseup', { bubbles: true }));
891
- el.click();
892
- return { clicked: true, tag: el.tagName, text: (el.innerText || el.value || '').slice(0, 200) };
884
+ const data = await executeInBrowser(contents, `(() => {
885
+ const el = document.querySelector(${JSON.stringify(request.selector || '')});
886
+ if (!el) return { clicked: false, error: 'selector not found' };
887
+ el.scrollIntoView({ block: 'center', inline: 'center' });
888
+ el.dispatchEvent(new MouseEvent('mouseover', { bubbles: true }));
889
+ el.dispatchEvent(new MouseEvent('mousedown', { bubbles: true }));
890
+ el.dispatchEvent(new MouseEvent('mouseup', { bubbles: true }));
891
+ el.click();
892
+ return { clicked: true, tag: el.tagName, text: (el.innerText || el.value || '').slice(0, 200) };
893
893
  })()`);
894
894
  return { ok: true, action, source: 'webview-cdp', url: contents.getURL(), data };
895
895
  }
896
896
  if (action === 'type') {
897
- const data = await executeInBrowser(contents, `(() => {
898
- const el = document.querySelector(${JSON.stringify(request.selector || '')});
899
- if (!el) return { typed: false, error: 'selector not found' };
900
- el.scrollIntoView({ block: 'center', inline: 'center' });
901
- el.focus();
902
- if ('value' in el) {
903
- el.value = ${JSON.stringify(request.text || '')};
904
- el.dispatchEvent(new Event('input', { bubbles: true }));
905
- el.dispatchEvent(new Event('change', { bubbles: true }));
906
- } else {
907
- el.textContent = ${JSON.stringify(request.text || '')};
908
- el.dispatchEvent(new InputEvent('input', { bubbles: true, data: ${JSON.stringify(request.text || '')} }));
909
- }
910
- return { typed: true, tag: el.tagName };
897
+ const data = await executeInBrowser(contents, `(() => {
898
+ const el = document.querySelector(${JSON.stringify(request.selector || '')});
899
+ if (!el) return { typed: false, error: 'selector not found' };
900
+ el.scrollIntoView({ block: 'center', inline: 'center' });
901
+ el.focus();
902
+ if ('value' in el) {
903
+ el.value = ${JSON.stringify(request.text || '')};
904
+ el.dispatchEvent(new Event('input', { bubbles: true }));
905
+ el.dispatchEvent(new Event('change', { bubbles: true }));
906
+ } else {
907
+ el.textContent = ${JSON.stringify(request.text || '')};
908
+ el.dispatchEvent(new InputEvent('input', { bubbles: true, data: ${JSON.stringify(request.text || '')} }));
909
+ }
910
+ return { typed: true, tag: el.tagName };
911
911
  })()`);
912
912
  return { ok: true, action, source: 'webview-cdp', url: contents.getURL(), data };
913
913
  }
@@ -966,7 +966,7 @@ function viewerDocument(request) {
966
966
  const image = request?.type === 'image' && /^data:image\/(?:png|jpeg);base64,[A-Za-z0-9+/]+={0,2}$/i.test(String(request?.dataUrl || ''))
967
967
  ? `<img src="${viewerEscape(request.dataUrl)}" alt="${title}">`
968
968
  : '<div class="empty">Image unavailable</div>';
969
- return `<!doctype html><html><head><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'"><title>${title}</title><style>
969
+ return `<!doctype html><html><head><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'"><title>${title}</title><style>
970
970
  :root{color-scheme:dark}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#090d16;color:#dce8f7;font:12px system-ui,sans-serif}main{height:100%;display:grid;grid-template-rows:auto 1fr;padding:14px;gap:10px}header{font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#a8bdd4}section{min-height:0;display:flex;align-items:center;justify-content:center;border:1px solid #233044;border-radius:10px;background:#0d1420}img{display:block;max-width:100%;max-height:100%;object-fit:contain}svg{width:100%;height:100%}.edges line{stroke:#30435b;stroke-width:1;opacity:.62}text{fill:#9fb2c7;font-size:9px}.empty{color:#6f8196}</style></head><body><main><header>${title}</header><section>${image}</section></main></body></html>`;
971
971
  }
972
972
  async function createViewerWindow(request) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "newmark-agent",
3
3
  "productName": "Newmark Agent",
4
- "version": "0.3.5",
4
+ "version": "0.3.6",
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": {