newmark-agent 0.3.12 → 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.
Files changed (60) hide show
  1. package/dist/cli-commands.d.ts +1 -0
  2. package/dist/cli-commands.js +11 -2
  3. package/dist/context/domain/types.d.ts +37 -0
  4. package/dist/context/services/context-orchestrator.js +2 -0
  5. package/dist/conversation-utility-host.bundle.cjs +1259 -132
  6. package/dist/conversation-utility-host.js +3 -0
  7. package/dist/core/agent.d.ts +139 -5
  8. package/dist/core/agent.js +964 -82
  9. package/dist/core/agentKernel/agent-loop.js +29 -3
  10. package/dist/core/agentKernel/types.d.ts +7 -0
  11. package/dist/core/agentKernelRunner.d.ts +2 -0
  12. package/dist/core/agentKernelRunner.js +121 -19
  13. package/dist/core/conversationKernel.d.ts +5 -0
  14. package/dist/core/conversationKernel.js +29 -0
  15. package/dist/core/dshCompatibility.d.ts +198 -0
  16. package/dist/core/dshCompatibility.js +600 -0
  17. package/dist/core/electronUtilityAgentClient.d.ts +4 -0
  18. package/dist/core/electronUtilityAgentClient.js +4 -0
  19. package/dist/core/electronUtilityRuntimePool.d.ts +8 -0
  20. package/dist/core/electronUtilityRuntimePool.js +14 -0
  21. package/dist/core/mcpManager.d.ts +1 -0
  22. package/dist/core/mcpManager.js +100 -10
  23. package/dist/core/subagent.d.ts +6 -0
  24. package/dist/core/subagent.js +22 -1
  25. package/dist/core/toolPolicy.d.ts +15 -0
  26. package/dist/core/toolPolicy.js +174 -1
  27. package/dist/core/types.d.ts +1 -1
  28. package/dist/core/utilityAgentProtocol.d.ts +8 -1
  29. package/dist/core/workspace.d.ts +9 -0
  30. package/dist/core/workspace.js +48 -1
  31. package/dist/core/wslAgentClient.d.ts +4 -0
  32. package/dist/core/wslAgentClient.js +4 -0
  33. package/dist/core/wslAgentProtocol.d.ts +8 -1
  34. package/dist/core/wslAgentRuntimePool.d.ts +8 -0
  35. package/dist/core/wslAgentRuntimePool.js +15 -0
  36. package/dist/launcher.js +8 -0
  37. package/dist/llm/provider.d.ts +1 -1
  38. package/dist/llm/provider.js +4 -3
  39. package/dist/main.js +163 -11
  40. package/dist/preload.js +11 -0
  41. package/dist/providers/chat-completions.adapter.js +41 -15
  42. package/dist/providers/provider-adapter.d.ts +3 -0
  43. package/dist/toolchain/registry/tool-registry.d.ts +13 -1
  44. package/dist/toolchain/registry/tool-registry.js +8 -0
  45. package/dist/toolchain/registry-seeder.js +52 -6
  46. package/dist/tools/index.d.ts +1 -0
  47. package/dist/tools/index.js +39 -2
  48. package/dist/tools/nativeTools.js +6 -1
  49. package/dist/tui/src/app.js +24 -0
  50. package/dist/tui/src/i18n.js +151 -0
  51. package/dist/tui/src/render.js +152 -61
  52. package/dist/tui/src/state.js +83 -0
  53. package/dist/ui/index.html +2669 -234
  54. package/dist/ui/lucide-sprite.svg +31 -0
  55. package/dist/wsl-agent-host.bundle.cjs +1259 -132
  56. package/dist/wsl-agent-host.js +3 -0
  57. package/package.json +6 -10
  58. package/Flow/Electron-Debug-Release.Flow.json +0 -43
  59. package/Flow/Flow.md +0 -9
  60. package/Flow/UI-Feature-Integration.Flow.json +0 -96
@@ -1,4 +1,5 @@
1
1
  export declare const CLI_COMMANDS: readonly ["state", "tool", "send", "validate-models", "fuzzy-inject", "skills-market", "memory-lab", "install-update", "compat", "compat-tool"];
2
+ export declare function cliHelpRequested(args: string[]): boolean;
2
3
  /**
3
4
  * Compatibility discovery reads third-party metadata outside the selected
4
5
  * Newmark root. Those manifests can contain provider options, so structured
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.CLI_COMMANDS = void 0;
37
+ exports.cliHelpRequested = cliHelpRequested;
37
38
  exports.redactCliSecrets = redactCliSecrets;
38
39
  exports.runCliCommand = runCliCommand;
39
40
  exports.cliCommandHelp = cliCommandHelp;
@@ -45,6 +46,7 @@ const config_1 = require("./core/config");
45
46
  const fuzzy_1 = require("./core/fuzzy");
46
47
  const provider_1 = require("./llm/provider");
47
48
  const compat_1 = require("./core/compat");
49
+ const dshCompatibility_1 = require("./core/dshCompatibility");
48
50
  const memoryLab_1 = require("./core/memoryLab");
49
51
  const installUpdate_1 = require("./core/installUpdate");
50
52
  exports.CLI_COMMANDS = ['state', 'tool', 'send', 'validate-models', 'fuzzy-inject', 'skills-market', 'memory-lab', 'install-update', 'compat', 'compat-tool'];
@@ -83,7 +85,7 @@ const CLI_COMMAND_HELP = {
83
85
  'Inspect or apply a local/GitHub update using the selected install target.',
84
86
  ],
85
87
  compat: [
86
- 'Usage: Newmark.exe compat [--target all|tools|plugins|marketplaces|skills|agents|subagents] [--root <dir>]',
88
+ 'Usage: Newmark.exe compat [--target all|tools|plugins|dsh|marketplaces|skills|agents|subagents] [--root <dir>]',
87
89
  'Discover compatible local agent, plugin, marketplace, and skill metadata.',
88
90
  ],
89
91
  'compat-tool': [
@@ -107,6 +109,7 @@ const CLI_VALUE_FLAGS = new Set([
107
109
  const CLI_BOOLEAN_FLAGS = new Set([
108
110
  '--persist', '--agent-only', '--list', '--preview-only', '--sources', '--add-source', '--check-github',
109
111
  '--from-github', '--dry-run', '--read', '--index', '--reindex', '--update', '--version', '--folder', '--help', '-h',
112
+ '--branch-communication',
110
113
  ]);
111
114
  function invalidCliCommandArgument(args) {
112
115
  let skipNext = false;
@@ -689,6 +692,8 @@ async function runCliCommand(root, args) {
689
692
  const conversation = argValue(args, '--conversation');
690
693
  if (conversation)
691
694
  agent.setConversation(conversation);
695
+ if (args.includes('--branch-communication'))
696
+ agent.setBranchCommunication(true);
692
697
  const language = argValue(args, '--language');
693
698
  if (language && ['auto', 'en', 'zh'].includes(language))
694
699
  agent.config.set('general', 'language', language);
@@ -988,10 +993,11 @@ async function runCliCommand(root, args) {
988
993
  target,
989
994
  compatibility: {
990
995
  tool_schemas: ['openai_chat_completions', 'openai_responses', 'anthropic_input_schema'],
991
- plugin_ecosystems: ['codex', 'claude-code', 'opencode', 'newmark'],
996
+ plugin_ecosystems: ['codex', 'claude-code', 'opencode', 'newmark', 'deepseek-harness'],
992
997
  marketplace_ecosystems: ['codex', 'claude-code', 'newmark'],
993
998
  plugin_execution: 'metadata-only by default; OpenCode JavaScript tools require explicit compat-tool invocation.',
994
999
  mcp_activation: 'discovered from plugin/config metadata but not auto-started.',
1000
+ dsh_compatibility: 'read-only bundle/profile/config discovery; unknown manifest keys are retained as compatibility metadata.',
995
1001
  subagent_return_contract: 'structured NewmarkSubagentRecord embedded in NewmarkToolResult while preserving legacy text output.',
996
1002
  },
997
1003
  };
@@ -1006,6 +1012,9 @@ async function runCliCommand(root, args) {
1006
1012
  if (target === 'all' || target === 'plugins') {
1007
1013
  payload.plugins = plugins;
1008
1014
  }
1015
+ if (target === 'all' || target === 'plugins' || target === 'dsh') {
1016
+ payload.dsh = (0, dshCompatibility_1.discoverDshCompatibility)(root);
1017
+ }
1009
1018
  if (target === 'all' || target === 'marketplaces') {
1010
1019
  payload.marketplaces = (0, compat_1.discoverPluginMarketplaces)(root);
1011
1020
  }
@@ -148,6 +148,27 @@ export interface CapabilityDescriptor {
148
148
  version: number;
149
149
  }
150
150
  export type ToolIdempotency = 'idempotent' | 'conditionally_idempotent' | 'non_idempotent';
151
+ /** 最小执行上下文:承载 DSH 工具 execute 的 exec.signal/agent 等运行时能力。 */
152
+ export interface ToolExecuteContext {
153
+ signal?: AbortSignal;
154
+ agent?: unknown;
155
+ token?: unknown;
156
+ [key: string]: unknown;
157
+ }
158
+ /** DSH ToolDefinition.execute 的运行时执行函数签名(cordis 核功能承载)。 */
159
+ export type ToolExecuteFn = (args: unknown, context: ToolExecuteContext) => Promise<unknown> | unknown;
160
+ /** DSH ToolDefinition.isConcurrencySafe 的运行时并发分类(cordis 核功能承载)。 */
161
+ export type ToolConcurrencySafeFn = (args: unknown) => boolean;
162
+ /** DSH ToolOutputDefinition.render 的模型可见内容投影。 */
163
+ export type ToolRenderFn = (args: unknown, value: unknown) => unknown;
164
+ /** DSH ToolOutputDefinition.presentationMeta 的可回放 UI 状态投影。 */
165
+ export type ToolPresentationMetaFn = (args: unknown, value: unknown) => unknown;
166
+ /** DSH ToolDefinition.finalizeContent 的同步 last-mile 内容变换(可选)。 */
167
+ export type ToolFinalizeContentFn = (context: ToolExecuteContext, result: unknown) => unknown;
168
+ /** DSH ToolDefinition.presentCall 的 PENDING 卡片展示投影(可选)。 */
169
+ export type ToolPresentCallFn = (args: unknown) => unknown;
170
+ /** DSH ToolDefinition.presentResult 的 COMPLETED 卡片展示投影(可选)。 */
171
+ export type ToolPresentResultFn = (args: unknown, result: unknown) => unknown;
151
172
  export interface ToolDescriptor {
152
173
  toolId: string;
153
174
  capabilityId: string;
@@ -166,6 +187,22 @@ export interface ToolDescriptor {
166
187
  implementationHash?: string;
167
188
  cacheGroup: string;
168
189
  enabled: boolean;
190
+ /** DSH ToolDefinition.execute 承载:接入的命令式功能实现(不 import/execute DSH 代码,仅承载已安全注入的函数引用)。 */
191
+ execute?: ToolExecuteFn;
192
+ /** DSH ToolDefinition.isConcurrencySafe 承载:运行时并发分类,静态 riskLevel 的补充。 */
193
+ isConcurrencySafe?: ToolConcurrencySafeFn;
194
+ /** DSH ToolOutputDefinition.render:模型可见内容投影(功能承载)。 */
195
+ render?: ToolRenderFn;
196
+ /** DSH ToolOutputDefinition.presentationMeta:可回放 UI 状态投影(功能承载)。 */
197
+ presentationMeta?: ToolPresentationMetaFn;
198
+ /** DSH ToolDefinition.finalizeContent:同步 last-mile 内容变换(功能承载)。 */
199
+ finalizeContent?: ToolFinalizeContentFn;
200
+ /** DSH ToolDefinition.timeoutMs:协作超时预算(功能承载)。 */
201
+ timeoutMs?: number;
202
+ /** DSH ToolDefinition.presentCall:PENDING 卡片展示投影(功能承载)。 */
203
+ presentCall?: ToolPresentCallFn;
204
+ /** DSH ToolDefinition.presentResult:COMPLETED 卡片展示投影(功能承载)。 */
205
+ presentResult?: ToolPresentResultFn;
169
206
  }
170
207
  export interface ActiveToolManifestEntry {
171
208
  toolId: string;
@@ -20,6 +20,8 @@ exports.CONTEXT_SECTION_ORDER = [
20
20
  'active_toolset_manifest',
21
21
  'build_block_startup_input',
22
22
  'build_block_metadata',
23
+ // Compatibility slot: linked-plan content is tool-retrieved on demand and
24
+ // should remain empty for ordinary model requests.
23
25
  'linked_plan',
24
26
  'active_tasks',
25
27
  'current_work_set',