evolcore 0.0.26 → 0.0.28

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 (177) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/bin/codex-managed-acl.ps1 +43 -0
  3. package/dist/agents/baseagent-availability.js +68 -0
  4. package/dist/agents/baseagent.js +10 -5
  5. package/dist/agents/claude-runner.js +123 -22
  6. package/dist/agents/codex/app-server-client.js +70 -26
  7. package/dist/agents/codex/catalog.js +7 -1
  8. package/dist/agents/codex-runner.js +363 -421
  9. package/dist/agents/ecagent-runner.js +170 -25
  10. package/dist/agents/gemini-runner.js +6 -0
  11. package/dist/agents/runner-types.js +50 -2
  12. package/dist/aun/aid/agentmd.js +73 -31
  13. package/dist/aun/aid/client.js +1 -1
  14. package/dist/aun/aid/control-aid.js +180 -1
  15. package/dist/aun/aid/identity.js +3 -3
  16. package/dist/aun/group/history.js +303 -0
  17. package/dist/aun/group/identity.js +43 -0
  18. package/dist/aun/group/index.js +5 -0
  19. package/dist/aun/{msg/group.js → group/operations.js} +161 -38
  20. package/dist/aun/{menu-client.js → menu/client.js} +13 -7
  21. package/dist/aun/menu/index.js +2 -0
  22. package/dist/aun/menu/transport.js +49 -0
  23. package/dist/aun/msg/index.js +2 -1
  24. package/dist/aun/msg/managed-operation.js +84 -18
  25. package/dist/aun/msg/mention-schema.js +51 -0
  26. package/dist/aun/msg/p2p.js +13 -8
  27. package/dist/aun/msg/upload.js +43 -88
  28. package/dist/aun/outbox.js +29 -7
  29. package/dist/aun/rpc/client.js +1 -0
  30. package/dist/aun/storage/client.js +39 -50
  31. package/dist/channels/aun.js +544 -239
  32. package/dist/channels/daemon.js +10 -6
  33. package/dist/cli/agent-command.js +108 -6
  34. package/dist/cli/agent-create.js +515 -2
  35. package/dist/cli/agent.js +109 -8
  36. package/dist/cli/aun-commands.js +191 -42
  37. package/dist/cli/config.js +8 -5
  38. package/dist/cli/contact.js +2 -2
  39. package/dist/cli/ctl-command.js +2 -2
  40. package/dist/cli/daemon-commands.js +111 -162
  41. package/dist/cli/diag.js +3 -3
  42. package/dist/cli/fs-command.js +3 -3
  43. package/dist/cli/handoff-command.js +6 -6
  44. package/dist/cli/index.js +8 -2
  45. package/dist/cli/init.js +34 -1
  46. package/dist/cli/managed-command-guard.js +2 -1
  47. package/dist/cli/menu-client.js +13 -5
  48. package/dist/cli/model.js +3 -3
  49. package/dist/cli/queue-command.js +2 -2
  50. package/dist/cli/response.js +2 -2
  51. package/dist/cli/restart-monitor.js +81 -19
  52. package/dist/cli/task-command.js +59 -0
  53. package/dist/cli/task-context.js +97 -49
  54. package/dist/cli/trigger-command.js +20 -10
  55. package/dist/config/builtin-roles.js +10 -0
  56. package/dist/config/config-field-policy.js +11 -0
  57. package/dist/config/config-manager.js +32 -4
  58. package/dist/config/config-operation-service.js +20 -5
  59. package/dist/config/contact-book-store.js +1 -1
  60. package/dist/config/contact-book.js +1 -1
  61. package/dist/config/contact-operation-service.js +1 -1
  62. package/dist/config/peer-role-resolver.js +1 -1
  63. package/dist/config/resolved-config-op.js +3 -0
  64. package/dist/config-store.js +1 -1
  65. package/dist/core/agent-application-service.js +5 -0
  66. package/dist/core/audit/event-key.js +17 -2
  67. package/dist/core/audit/log-integrity.js +34 -8
  68. package/dist/core/auth/agent-delegation.js +48 -14
  69. package/dist/core/auth/auth-gateway.js +2 -0
  70. package/dist/core/auth/authorization-audit.js +34 -38
  71. package/dist/core/auth/operation-authorizer.js +67 -5
  72. package/dist/core/auth/operation-catalog.js +110 -0
  73. package/dist/core/auth/remote-access-store.js +115 -9
  74. package/dist/core/bootstrap-messages.js +66 -7
  75. package/dist/core/bootstrap-service.js +110 -19
  76. package/dist/core/command/agent-control.js +88 -7
  77. package/dist/core/command/agent-storage-menu.js +443 -0
  78. package/dist/core/command/cli-intent-parser.js +19 -0
  79. package/dist/core/command/command-handler.js +105 -40
  80. package/dist/core/command/data-root-resolver.js +273 -0
  81. package/dist/core/command/diag-service.js +292 -27
  82. package/dist/core/command/group-menu.js +7 -2
  83. package/dist/core/command/menu-catalog.js +34 -4
  84. package/dist/core/command/menu-handler.js +364 -96
  85. package/dist/core/command/menu-protocol.js +43 -6
  86. package/dist/core/command/role-menu.js +2 -2
  87. package/dist/core/command/slash-handler.js +61 -37
  88. package/dist/core/event-catalog.js +4 -0
  89. package/dist/core/evolagent-registry.js +28 -2
  90. package/dist/core/group/invite-service.js +924 -0
  91. package/dist/core/interaction-router.js +22 -8
  92. package/dist/core/message/im-renderer.js +94 -16
  93. package/dist/core/message/message-bridge.js +140 -13
  94. package/dist/core/message/message-log.js +5 -3
  95. package/dist/core/message/message-queue.js +73 -41
  96. package/dist/core/message/response-engine.js +729 -118
  97. package/dist/core/permission/approval-gateway.js +36 -3
  98. package/dist/core/permission/ec-command-parser.js +76 -36
  99. package/dist/core/permission/protected-paths.js +134 -16
  100. package/dist/core/permission/sandbox-runtime.js +72 -3
  101. package/dist/core/permission/tool-error-code.js +15 -0
  102. package/dist/core/permission/tool-policy.js +8 -8
  103. package/dist/core/relation/peer-identity.js +57 -6
  104. package/dist/core/relation/shared-data.js +106 -0
  105. package/dist/core/role/runtime-policy.js +64 -0
  106. package/dist/core/runtime-lock.js +10 -26
  107. package/dist/core/session/runner-task-history.js +170 -0
  108. package/dist/core/session/session-manager.js +38 -6
  109. package/dist/core/session/session-mapper.js +41 -0
  110. package/dist/core/session/session-turn-coordinator.js +37 -7
  111. package/dist/core/session/session-turns.js +48 -7
  112. package/dist/core/task/task-recovery-service.js +176 -0
  113. package/dist/core/task/task-resume-operation.js +32 -0
  114. package/dist/eck/group-rules-sync.js +5 -3
  115. package/dist/eck/kit-renderer.js +1 -0
  116. package/dist/index.js +322 -207
  117. package/dist/ipc.js +141 -15
  118. package/dist/paths.js +17 -4
  119. package/dist/product.js +3 -0
  120. package/dist/trigger/event-source.js +19 -0
  121. package/dist/trigger/feedback.js +233 -40
  122. package/dist/trigger/parser.js +55 -5
  123. package/dist/trigger/patch.js +9 -0
  124. package/dist/trigger/scheduler.js +30 -4
  125. package/dist/trigger/validation.js +20 -3
  126. package/dist/utils/atomic-write.js +98 -0
  127. package/dist/utils/cross-platform.js +87 -16
  128. package/dist/utils/ecweb-utils.js +1 -0
  129. package/dist/utils/error-utils.js +40 -2
  130. package/dist/utils/logger.js +23 -13
  131. package/dist/utils/npm-ops.js +119 -4
  132. package/dist/utils/package-version-info.js +244 -0
  133. package/dist/utils/tool-summary.js +59 -3
  134. package/dist/utils/welcome.js +174 -1
  135. package/dist/utils/windows-shell-trust.js +37 -0
  136. package/ecagent/dist/harness/agent-harness.js +3 -0
  137. package/ecagent/dist/harness/session/jsonl-storage.js +21 -2
  138. package/kits/docs/INDEX.md +0 -6
  139. package/kits/docs/channels/aun.md +23 -2
  140. package/kits/docs/channels/feishu.md +1 -1
  141. package/kits/docs/context-assembly.md +29 -17
  142. package/kits/docs/evolcore/INDEX.md +8 -3
  143. package/kits/docs/evolcore/agent-create.md +39 -7
  144. package/kits/docs/evolcore/agent.md +33 -1
  145. package/kits/docs/evolcore/aid.md +9 -1
  146. package/kits/docs/evolcore/config.md +40 -1
  147. package/kits/docs/evolcore/group-collaboration.md +1 -1
  148. package/kits/docs/evolcore/group.md +117 -2
  149. package/kits/docs/evolcore/menu-client.md +16 -0
  150. package/kits/docs/evolcore/msg.md +3 -0
  151. package/kits/docs/evolcore/storage.md +3 -0
  152. package/kits/docs/evolcore/task.md +14 -0
  153. package/kits/docs/evolcore/trigger.md +51 -3
  154. package/kits/docs/venues/group.md +5 -0
  155. package/kits/eck_manifest.json +27 -0
  156. package/kits/rules/01-overview.md +11 -7
  157. package/kits/rules/04-relation.md +2 -1
  158. package/kits/rules/05-venue.md +1 -1
  159. package/kits/rules/06-channel.md +6 -4
  160. package/kits/schemas/agent-config.schema.12.json +25 -1
  161. package/kits/schemas/daemon.schema.6.json +2 -2
  162. package/kits/schemas/defaults.schema.5.json +1 -1
  163. package/kits/schemas/relation-config.schema.1.json +1 -1
  164. package/kits/schemas/relation-config.schema.5.json +1 -1
  165. package/kits/schemas/role-config.schema.1.json +14 -0
  166. package/kits/templates/roles/member.json +5 -0
  167. package/kits/templates/roles/visitor.json +5 -0
  168. package/kits/templates/system-fragments/baseagent.md +1 -1
  169. package/kits/templates/system-fragments/bootstrap.md +26 -9
  170. package/kits/templates/system-fragments/channel.md +8 -44
  171. package/kits/templates/system-fragments/commands.md +10 -2
  172. package/kits/templates/system-fragments/group-unread-history.md +7 -0
  173. package/kits/templates/system-fragments/reply.md +56 -0
  174. package/package.json +7 -3
  175. package/dist/aun/group-identity.js +0 -9
  176. /package/dist/aun/{group-fs-download.js → group/fs-download.js} +0 -0
  177. /package/dist/aun/{msg/group-index.js → group/index-rpc.js} +0 -0
@@ -210,8 +210,8 @@ export class CodexAppServerClient {
210
210
  }
211
211
  return undefined;
212
212
  }
213
- async threadRead(threadId, includeTurns = true) {
214
- return this.request('thread/read', { threadId, includeTurns });
213
+ async threadRead(threadId, includeTurns = true, timeoutMs) {
214
+ return this.request('thread/read', { threadId, includeTurns }, timeoutMs);
215
215
  }
216
216
  async threadRollback(threadId, numTurns) {
217
217
  return this.request('thread/rollback', { threadId, numTurns });
@@ -481,6 +481,12 @@ export class CodexAppServerClient {
481
481
  const launchCommand = resolveCodexLaunchCommand(args);
482
482
  if (!launchCommand)
483
483
  throw new Error('Codex CLI not found');
484
+ logger.info(`[CodexAppServer] launch ${JSON.stringify({
485
+ resolvedPath: launchCommand.resolvedPath,
486
+ launcherKind: launchCommand.launcherKind,
487
+ launcherPath: launchCommand.launcherPath,
488
+ codexVersion: this.options.codexVersion ?? null,
489
+ })}`);
484
490
  try {
485
491
  let command = launchCommand.command;
486
492
  let commandArgs = launchCommand.args;
@@ -509,6 +515,7 @@ export class CodexAppServerClient {
509
515
  env,
510
516
  stdio: ['pipe', 'pipe', 'pipe'],
511
517
  windowsHide: process.platform === 'win32',
518
+ windowsVerbatimArguments: launchCommand.windowsVerbatimArguments,
512
519
  });
513
520
  try {
514
521
  this.processRegistrationPath = registerCodexAppServerProcess(this.proc.pid);
@@ -622,7 +629,7 @@ export class CodexAppServerClient {
622
629
  env.TMPDIR = managedTmpDir;
623
630
  delete env.EVOLCORE_RUNTIME_LOCK_DIR;
624
631
  if (managedTmpDir) {
625
- const runtimeLockDir = path.join(managedTmpDir, 'evolcore-locks');
632
+ const runtimeLockDir = path.join(managedTmpDir, 'locks');
626
633
  try {
627
634
  // The parent is the already-validated process root, so only create
628
635
  // and validate the final component. Never follow a pre-existing
@@ -768,30 +775,63 @@ export class CodexAppServerClient {
768
775
  }
769
776
  return args;
770
777
  }
771
- async request(method, params) {
772
- await this.ensureReadyFor(method);
773
- const proc = this.proc;
774
- if (!proc)
775
- throw new Error('Codex app-server is not running');
776
- const id = String(this.nextId++);
777
- const payload = { id, method };
778
- if (params !== undefined && params !== null)
779
- payload.params = params;
780
- return new Promise((resolve, reject) => {
781
- this.pending.set(id, {
782
- resolve,
783
- reject,
784
- method,
785
- params,
786
- stderrStartSequence: this.stderrSequence,
787
- });
788
- proc.stdin.write(`${JSON.stringify(payload)}\n`, error => {
789
- if (!error)
790
- return;
791
- this.pending.delete(id);
792
- reject(error);
778
+ async request(method, params, timeoutMs) {
779
+ // Only lifecycle RPCs get short deadlines. Model work has its own policy.
780
+ const deadline = timeoutMs ?? (method === 'turn/interrupt' ? 5_000 : undefined);
781
+ let timer;
782
+ let requestId;
783
+ let expired = false;
784
+ const operation = (async () => {
785
+ await this.ensureReadyFor(method);
786
+ if (expired)
787
+ throw new Error(`Codex ${method} expired before dispatch`);
788
+ const proc = this.proc;
789
+ if (!proc)
790
+ throw new Error('Codex app-server is not running');
791
+ const id = String(this.nextId++);
792
+ requestId = id;
793
+ const payload = { id, method };
794
+ if (params !== undefined && params !== null)
795
+ payload.params = params;
796
+ return new Promise((resolve, reject) => {
797
+ this.pending.set(id, {
798
+ resolve,
799
+ reject,
800
+ method,
801
+ params,
802
+ stderrStartSequence: this.stderrSequence,
803
+ });
804
+ proc.stdin.write(`${JSON.stringify(payload)}\n`, error => {
805
+ if (!error)
806
+ return;
807
+ this.pending.delete(id);
808
+ reject(error);
809
+ });
793
810
  });
794
- });
811
+ })();
812
+ if (deadline === undefined)
813
+ return operation;
814
+ try {
815
+ return await Promise.race([
816
+ operation,
817
+ new Promise((_, reject) => {
818
+ timer = setTimeout(() => {
819
+ expired = true;
820
+ reject(new Error(`Codex ${method} deadline exceeded`));
821
+ }, deadline);
822
+ timer.unref?.();
823
+ }),
824
+ ]);
825
+ }
826
+ finally {
827
+ if (timer)
828
+ clearTimeout(timer);
829
+ if (requestId && expired) {
830
+ const pending = this.pending.get(requestId);
831
+ this.pending.delete(requestId);
832
+ pending?.reject(new Error(`Codex ${method} deadline exceeded`));
833
+ }
834
+ }
795
835
  }
796
836
  respond(id, result) {
797
837
  if (!this.proc)
@@ -870,6 +910,10 @@ export class CodexAppServerClient {
870
910
  else if (/already has an active writer/i.test(detail)) {
871
911
  error.code = CODEX_THREAD_ACTIVE_WRITER;
872
912
  }
913
+ else if (pending.method === 'turn/steer' && /\bno active turn\b/i.test(detail)) {
914
+ // Explicit server rejection proves the input was not accepted. Transport errors do not.
915
+ error.code = 'CODEX_NO_ACTIVE_TURN';
916
+ }
873
917
  pending.reject(error);
874
918
  return;
875
919
  }
@@ -7,7 +7,13 @@ async function cliModels() {
7
7
  if (!launch)
8
8
  return null;
9
9
  return new Promise(resolve => {
10
- execFile(launch.command, launch.args, { timeout: 3000, windowsHide: true, maxBuffer: 16 * 1024 * 1024, encoding: 'utf8' }, (error, stdout) => {
10
+ execFile(launch.command, launch.args, {
11
+ timeout: 3000,
12
+ windowsHide: true,
13
+ windowsVerbatimArguments: launch.windowsVerbatimArguments,
14
+ maxBuffer: 16 * 1024 * 1024,
15
+ encoding: 'utf8',
16
+ }, (error, stdout) => {
11
17
  try {
12
18
  if (error)
13
19
  return resolve(null);