evolcore 0.0.41-test.0 → 0.0.41-test.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 (235) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/agents/baseagent-availability.js +1 -1
  3. package/dist/agents/baseagent.js +88 -49
  4. package/dist/agents/claude-runner.js +177 -92
  5. package/dist/agents/codex-runner.js +146 -71
  6. package/dist/agents/ecagent-runner.js +1 -1
  7. package/dist/agents/gemini-runner.js +1 -1
  8. package/dist/aun/aid/agentmd.js +98 -11
  9. package/dist/aun/aid/client.js +1 -1
  10. package/dist/aun/aid/control-aid.js +26 -2
  11. package/dist/aun/aid/identity.js +91 -0
  12. package/dist/aun/aid/index.js +1 -1
  13. package/dist/aun/aid/managed-operation.js +1 -1
  14. package/dist/aun/aid/ownership-operation.js +23 -22
  15. package/dist/aun/group/fs-download.js +39 -0
  16. package/dist/aun/group/identity.js +36 -21
  17. package/dist/aun/group/operations.js +5 -0
  18. package/dist/aun/menu/client.js +27 -0
  19. package/dist/aun/msg/managed-operation.js +68 -7
  20. package/dist/aun/msg/p2p.js +8 -8
  21. package/dist/aun/service-proxy.js +53 -12
  22. package/dist/channels/aun.js +633 -32
  23. package/dist/channels/daemon.js +15 -1
  24. package/dist/cli/agent-command.js +5 -2
  25. package/dist/cli/agent-create.js +991 -233
  26. package/dist/cli/agent.js +49 -10
  27. package/dist/cli/aid-bind-command.js +48 -19
  28. package/dist/cli/aun-commands.js +48 -36
  29. package/dist/cli/daemon-commands.js +679 -697
  30. package/dist/cli/fs-command.js +64 -2
  31. package/dist/cli/index.js +72 -5
  32. package/dist/cli/init-channel.js +1 -1
  33. package/dist/cli/init.js +75 -1
  34. package/dist/cli/managed-command-guard.js +17 -1
  35. package/dist/cli/model.js +40 -40
  36. package/dist/cli/provider-command.js +57 -0
  37. package/dist/cli/proxy-command.js +92 -0
  38. package/dist/cli/restart-monitor.js +4 -2
  39. package/dist/cli/role.js +85 -0
  40. package/dist/cli/stats.js +10 -3
  41. package/dist/cli/task-context.js +19 -0
  42. package/dist/config/access-policy.js +7 -2
  43. package/dist/config/boot-log.js +39 -1
  44. package/dist/config/config-field-policy.js +17 -39
  45. package/dist/config/config-manager.js +183 -44
  46. package/dist/config/config-operation-service.js +5 -19
  47. package/dist/config/contact-book-store.js +47 -21
  48. package/dist/config/contact-book.js +18 -12
  49. package/dist/config/contact-operation-service.js +3 -4
  50. package/dist/config/contact-request-service.js +11 -0
  51. package/dist/config/daemon-services.js +11 -0
  52. package/dist/config/gateway-config.js +88 -594
  53. package/dist/config/owner-config.js +2 -2
  54. package/dist/config/peer-role-resolver.js +15 -12
  55. package/dist/config/provider-ipc-service.js +132 -0
  56. package/dist/config/provider-menu-request.js +58 -0
  57. package/dist/config/providers-config.js +12 -7
  58. package/dist/config/providers-import.js +3 -21
  59. package/dist/config/providers-management.js +78 -5
  60. package/dist/config/resolved-config-op.js +11 -1
  61. package/dist/config/role-command-service.js +166 -0
  62. package/dist/config/role-request-service.js +193 -0
  63. package/dist/config/schema-migration.js +1000 -25
  64. package/dist/config-store.js +89 -4
  65. package/dist/contracts/ecweb-instance.js +41 -0
  66. package/dist/contracts/ecweb-service-protocol.js +4 -1
  67. package/dist/core/agent-application-service.js +60 -11
  68. package/dist/core/agent-create-status.js +203 -0
  69. package/dist/core/agent-creation-claim.js +177 -0
  70. package/dist/core/agent-ipc-registration.js +39 -18
  71. package/dist/core/agent-runtime.js +194 -24
  72. package/dist/core/auth/agent-delegation.js +6 -3
  73. package/dist/core/auth/auth-gateway.js +67 -2
  74. package/dist/core/auth/authorization-audit.js +58 -11
  75. package/dist/core/auth/delegation-authorization.js +5 -2
  76. package/dist/core/auth/operation-authorizer.js +43 -6
  77. package/dist/core/auth/operation-catalog.js +45 -7
  78. package/dist/core/channel-loader.js +2 -0
  79. package/dist/core/command/agent-control.js +260 -21
  80. package/dist/core/command/agent-storage-menu.js +5 -3
  81. package/dist/core/command/cli-intent-parser.js +8 -3
  82. package/dist/core/command/command-handler.js +112 -154
  83. package/dist/core/command/connect-menu.js +11 -3
  84. package/dist/core/command/data-root-resolver.js +5 -4
  85. package/dist/core/command/memory-slash.js +16 -8
  86. package/dist/core/command/menu-catalog.js +10 -6
  87. package/dist/core/command/menu-handler.js +106 -73
  88. package/dist/core/command/menu-protocol.js +15 -1
  89. package/dist/core/command/provider-menu.js +46 -0
  90. package/dist/core/command/role-menu.js +147 -30
  91. package/dist/core/command/slash-handler.js +125 -255
  92. package/dist/core/daemon-control.js +26 -27
  93. package/dist/core/event-catalog.js +10 -0
  94. package/dist/core/evolagent-registry.js +7 -5
  95. package/dist/core/evolagent.js +10 -8
  96. package/dist/core/file-integrity/store.js +11 -0
  97. package/dist/core/handoff/ipc-registration.js +3 -0
  98. package/dist/core/inference/text-inference.js +31 -40
  99. package/dist/core/initialization/service.js +491 -0
  100. package/dist/core/ipc-registration.js +40 -24
  101. package/dist/core/memory/consolidation-context.js +51 -5
  102. package/dist/core/memory/consolidation-ops-records.js +96 -1
  103. package/dist/core/memory/consolidation-trigger.js +208 -191
  104. package/dist/core/memory/consolidation.js +333 -35
  105. package/dist/core/memory/index-manager.js +27 -5
  106. package/dist/core/memory/memory-admin.js +45 -5
  107. package/dist/core/memory/memory-writer.js +163 -18
  108. package/dist/core/memory/relation-idle-monitor.js +119 -58
  109. package/dist/core/memory/relation-sweep.js +55 -45
  110. package/dist/core/message/aun-ipc-sender.js +81 -69
  111. package/dist/core/message/im-renderer.js +25 -4
  112. package/dist/core/message/message-admission.js +89 -4
  113. package/dist/core/message/message-bridge.js +66 -21
  114. package/dist/core/message/response-engine.js +108 -35
  115. package/dist/core/model/catalog-service.js +5 -3
  116. package/dist/core/model/config-scope.js +29 -71
  117. package/dist/core/model/field-scope.js +1 -1
  118. package/dist/core/model/model-catalog.js +30 -41
  119. package/dist/core/model/model-diagnostics.js +4 -3
  120. package/dist/core/model/model-fallback.js +10 -7
  121. package/dist/core/model/model-permission.js +3 -2
  122. package/dist/core/ownership/owner-resolver.js +772 -158
  123. package/dist/core/permission/approval-gateway.js +103 -403
  124. package/dist/core/permission/ec-command-parser.js +62 -6
  125. package/dist/core/permission/index.js +1 -0
  126. package/dist/core/permission/permission-result.js +78 -0
  127. package/dist/core/permission/sandbox-runtime.js +18 -1
  128. package/dist/core/permission/tool-policy.js +21 -46
  129. package/dist/core/relation/peer-identity.js +64 -1
  130. package/dist/core/role/runtime-policy.js +72 -13
  131. package/dist/core/session/session-capsule.js +1 -1
  132. package/dist/core/session/session-idle-monitor.js +1 -1
  133. package/dist/core/session/session-manager.js +20 -0
  134. package/dist/core/session/session-renew.js +3 -3
  135. package/dist/core/skill/index-generator.js +15 -5
  136. package/dist/core/system-session/memory.js +43 -8
  137. package/dist/core/thread/thread-service.js +19 -6
  138. package/dist/directory/owner-directory-admission.js +95 -0
  139. package/dist/directory/owner-directory-authorization.js +309 -0
  140. package/dist/directory/owner-directory-cache.js +635 -0
  141. package/dist/eck/kit-renderer.js +2 -2
  142. package/dist/ecweb/basic-settings-service.js +33 -40
  143. package/dist/ecweb/init-menu.js +32 -0
  144. package/dist/ecweb/message-context-service.js +110 -0
  145. package/dist/index.js +93 -19
  146. package/dist/ipc.js +247 -29
  147. package/dist/paths.js +7 -0
  148. package/dist/proxy/command.js +122 -0
  149. package/dist/proxy/ipc-service.js +68 -0
  150. package/dist/proxy/manager.js +484 -0
  151. package/dist/proxy/service-supervisor.js +603 -0
  152. package/dist/response-system/engines/v1/proactive-flow.js +16 -6
  153. package/dist/trigger/authorization.js +27 -17
  154. package/dist/trigger/feedback.js +2 -3
  155. package/dist/trigger/ipc-service.js +105 -78
  156. package/dist/trigger/local-files.js +2 -1
  157. package/dist/trigger/manager.js +5 -3
  158. package/dist/trigger/scheduler.js +88 -6
  159. package/dist/utils/atomic-write.js +28 -0
  160. package/dist/utils/cross-platform.js +14 -0
  161. package/dist/utils/ecweb-supervisor.js +258 -83
  162. package/dist/utils/error-utils.js +26 -2
  163. package/dist/utils/logger.js +92 -6
  164. package/dist/utils/package-version-info.js +4 -2
  165. package/dist/utils/welcome.js +1 -1
  166. package/kits/docs/INDEX.md +1 -0
  167. package/kits/docs/aun/SDK.md +4 -1
  168. package/kits/docs/channels/aun.md +9 -0
  169. package/kits/docs/evolcore/INDEX.md +1 -0
  170. package/kits/docs/evolcore/agent.md +8 -1
  171. package/kits/docs/evolcore/aid.md +67 -17
  172. package/kits/docs/evolcore/config.md +28 -7
  173. package/kits/docs/evolcore/contact.md +3 -0
  174. package/kits/docs/evolcore/fs.md +11 -0
  175. package/kits/docs/evolcore/group.md +1 -1
  176. package/kits/docs/evolcore/memory-architecture.md +2 -2
  177. package/kits/docs/evolcore/memory-consolidation.md +32 -8
  178. package/kits/docs/evolcore/memory.md +1 -1
  179. package/kits/docs/evolcore/menu-protocol.md +4 -0
  180. package/kits/docs/evolcore/model.md +23 -20
  181. package/kits/docs/evolcore/msg.md +4 -7
  182. package/kits/docs/evolcore/provider.md +50 -0
  183. package/kits/docs/identity/AID_PROFILE_SPEC.md +52 -17
  184. package/kits/migrations/migrate-contact-book-v2.mjs +30 -11
  185. package/kits/rules/01-overview.md +3 -0
  186. package/kits/rules/04-relation.md +1 -1
  187. package/kits/schemas/_meta.json +37 -4
  188. package/kits/schemas/agent-config.schema.13.json +8 -3
  189. package/kits/schemas/agent-config.schema.16.json +891 -0
  190. package/kits/schemas/daemon.schema.9.json +366 -0
  191. package/kits/schemas/defaults.schema.5.json +406 -127
  192. package/kits/schemas/relation-config.schema.11.json +277 -0
  193. package/kits/schemas/role-config.schema.1.json +7 -7
  194. package/kits/skills/.switches.json +4 -0
  195. package/kits/skills/ec-agent-create/SKILL.md +3 -0
  196. package/kits/skills/ec-identity/SKILL.md +2 -2
  197. package/kits/skills/ec-service-proxy/SKILL.md +118 -0
  198. package/kits/skills/ec-skill/scripts/skill.mjs +6 -0
  199. package/kits/skills/personal-assistant/SKILL.md +176 -0
  200. package/kits/skills/personal-assistant/references/01-workspace-spec.md +333 -0
  201. package/kits/skills/personal-assistant/references/02-bootstrap.md +205 -0
  202. package/kits/skills/personal-assistant/references/03-data-flow-and-gaps.md +177 -0
  203. package/kits/skills/personal-assistant/references/04-frontend-contract.md +439 -0
  204. package/kits/skills/personal-assistant/references/05-directory-reference.md +292 -0
  205. package/kits/skills/personal-assistant/references/06-render-config.md +350 -0
  206. package/kits/skills/personal-assistant/schema/workspace.schema.json +85 -0
  207. package/kits/skills/personal-assistant/schema/workspace.v1.json +66 -0
  208. package/kits/skills/personal-assistant/scripts/archive.mjs +154 -0
  209. package/kits/skills/personal-assistant/scripts/check.mjs +114 -0
  210. package/kits/skills/personal-assistant/scripts/index-rebuild.mjs +252 -0
  211. package/kits/skills/personal-assistant/scripts/ingest.mjs +344 -0
  212. package/kits/skills/personal-assistant/scripts/init.mjs +270 -0
  213. package/kits/skills/personal-assistant/scripts/lib/apply.mjs +92 -0
  214. package/kits/skills/personal-assistant/scripts/lib/schema.mjs +96 -0
  215. package/kits/skills/personal-assistant/scripts/lib/time.mjs +28 -0
  216. package/kits/skills/personal-assistant/scripts/migrate.mjs +172 -0
  217. package/kits/skills/personal-assistant/scripts/search.mjs +172 -0
  218. package/kits/skills/personal-assistant/scripts/verify.mjs +196 -0
  219. package/kits/skills/personal-assistant/templates/INDEX.md.tpl +24 -0
  220. package/kits/skills/personal-assistant/templates/README.md.tpl +108 -0
  221. package/kits/skills/personal-assistant/triggers/ingest-daily.json +23 -0
  222. package/kits/skills/personal-assistant/triggers/memory-consolidate.json +23 -0
  223. package/kits/skills/personal-assistant/triggers/report-daily.json +23 -0
  224. package/kits/skills/personal-assistant/triggers/report-weekly.json +23 -0
  225. package/kits/skills/thread-ops/SKILL.md +5 -0
  226. package/kits/templates/memory-consolidation/forget.md +19 -6
  227. package/kits/templates/memory-consolidation/notes.md +1 -1
  228. package/kits/templates/memory-consolidation/profile.md +2 -2
  229. package/kits/templates/memory-consolidation/promote.md +20 -3
  230. package/kits/templates/roles/member.json +8 -1
  231. package/kits/templates/system-fragments/baseagent.md +2 -2
  232. package/kits/templates/system-fragments/memory.md +4 -4
  233. package/kits/templates/system-fragments/venue.md +1 -1
  234. package/package.json +7 -3
  235. package/dist/core/message/create-status.js +0 -96
@@ -1,10 +1,10 @@
1
1
  import { agentContactConfig } from '../paths.js';
2
2
  import { isValidAid } from '../aun/aid/validation.js';
3
- import { isExplicitGroupId } from '../aun/group/index.js';
4
3
  import { ConfigTarget, read, validateConfig } from './config-manager.js';
5
- import { ContactMutationError, contactRevision, mutateContactBookSync } from './contact-book-store.js';
4
+ import { ContactMutationError, contactRevision, resolveContactAidKind, mutateContactBookSync } from './contact-book-store.js';
6
5
  import { formatContactAlias, normalizeContactChannelKey, parseContactAlias, } from './contact-alias.js';
7
- import { getProtocolOwners } from '../core/ownership/owner-resolver.js';
6
+ import { getOwners } from '../core/ownership/owner-resolver.js';
7
+ import { readAunPeerKind } from '../core/relation/peer-identity.js';
8
8
  export class ContactBookError extends Error {
9
9
  code;
10
10
  constructor(code, message) {
@@ -58,7 +58,7 @@ export function resolvePrimaryId(selfAid, channelType, actorId, channelKey) {
58
58
  return resolvePrincipal(selfAid, channelType, actor, channelKey).principalId ?? actor;
59
59
  }
60
60
  export function bindContactAlias(selfAid, primaryId, channelType, actorId, channelKey) {
61
- const primary = normalizePrimaryId(primaryId);
61
+ const primary = normalizePrimaryId(primaryId, selfAid);
62
62
  const type = String(channelType || '').trim().toLowerCase();
63
63
  const actor = String(actorId || '').trim();
64
64
  if (type === 'aun') {
@@ -88,7 +88,7 @@ export function bindContactAlias(selfAid, primaryId, channelType, actorId, chann
88
88
  }
89
89
  }
90
90
  export function unbindContactAlias(selfAid, primaryId, channelType, actorId, channelKey) {
91
- const primary = normalizePrimaryId(primaryId);
91
+ const primary = normalizePrimaryId(primaryId, selfAid, true);
92
92
  const type = String(channelType || '').trim().toLowerCase();
93
93
  const actor = String(actorId || '').trim();
94
94
  const canonicalChannelKey = normalizeContactChannelKey(selfAid, type, channelKey);
@@ -149,11 +149,12 @@ export function resolveContactView(selfAid, primaryId) {
149
149
  export function isBlockedContact(selfAid, primaryId) {
150
150
  return resolveContactView(selfAid, primaryId).blocked;
151
151
  }
152
- export function isAcceptedContact(selfAid, primaryId) {
152
+ export function isAcceptedContact(selfAid, primaryId, routeKind) {
153
153
  const id = String(primaryId || '').trim();
154
154
  const snapshot = getContactSnapshot(selfAid);
155
155
  const entry = snapshot.contacts.get(id);
156
- return !!entry && (entry.status === undefined || entry.status === 'active');
156
+ return !!entry && (entry.status === undefined || entry.status === 'active')
157
+ && readAunPeerKind(selfAid, id, { routeKind }).kind === 'private';
157
158
  }
158
159
  /**
159
160
  * 对端展示名:联系人簿 displayName → principalId。仅用于展示(预览行/日志),
@@ -183,7 +184,8 @@ function buildSnapshot(book, selfAid, aliases) {
183
184
  const blockedIndex = new Set();
184
185
  const owners = new Set(listAgentOwners(selfAid));
185
186
  for (const [primaryId, rawEntry] of Object.entries(book.contacts)) {
186
- if (!isValidAid(primaryId) || isExplicitGroupId(primaryId)) {
187
+ const kind = resolveContactAidKind(selfAid, primaryId);
188
+ if (!isValidAid(primaryId) || kind.kind === 'group' || (kind.kind === 'unknown' && kind.reason !== 'missing')) {
187
189
  throw new ContactBookError('INVALID_CONTACT_BOOK', `Invalid contact AID: ${primaryId}`);
188
190
  }
189
191
  if (rawEntry.status === 'blocked' && owners.has(primaryId)) {
@@ -224,7 +226,9 @@ function buildAliasMap(book, selfAid) {
224
226
  const aliasToPrimary = new Map();
225
227
  const conflictingAliases = new Set();
226
228
  for (const [primaryId, entry] of Object.entries(book?.contacts ?? {})) {
227
- if (!isValidAid(primaryId) || isExplicitGroupId(primaryId) || !entry || typeof entry !== 'object')
229
+ const kind = resolveContactAidKind(selfAid, primaryId);
230
+ if (!isValidAid(primaryId) || kind.kind === 'group' || (kind.kind === 'unknown' && kind.reason !== 'missing')
231
+ || !entry || typeof entry !== 'object')
228
232
  continue;
229
233
  for (const rawAlias of entry.aliases ?? []) {
230
234
  const parsed = parseContactAlias(rawAlias, selfAid);
@@ -246,13 +250,15 @@ function buildAliasMap(book, selfAid) {
246
250
  }
247
251
  return { aliasToPrimary, conflictingAliases };
248
252
  }
249
- function normalizePrimaryId(value) {
253
+ function normalizePrimaryId(value, selfAid, allowMissing = false) {
250
254
  const id = String(value || '').trim();
251
- if (!isValidAid(id) || isExplicitGroupId(id)) {
255
+ const type = resolveContactAidKind(selfAid, id);
256
+ if (!isValidAid(id) || (type.kind !== 'private' && !(allowMissing && type.reason === 'missing'))) {
252
257
  throw new ContactBookError('INVALID_PRIMARY_ID', `Invalid individual contact AID: ${String(value)}`);
253
258
  }
254
259
  return id;
255
260
  }
256
261
  function listAgentOwners(selfAid) {
257
- return getProtocolOwners(selfAid);
262
+ // Keep configured Owners usable while protocol consensus is unavailable.
263
+ return getOwners(selfAid);
258
264
  }
@@ -1,6 +1,5 @@
1
1
  import fs from 'fs';
2
2
  import { isValidAid } from '../aun/aid/validation.js';
3
- import { isExplicitGroupId } from '../aun/group/index.js';
4
3
  import { agentConfig } from '../paths.js';
5
4
  import { getContactSnapshot, resolveContactView } from './contact-book.js';
6
5
  import { ContactMutationError } from './contact-book-store.js';
@@ -33,7 +32,7 @@ export function resolveContactCommand(argv) {
33
32
  };
34
33
  }
35
34
  if (command === 'approve' || command === 'reject' || command === 'block-request') {
36
- if (!isValidAid(subcommand || '') || isExplicitGroupId(subcommand || '')) {
35
+ if (!isValidAid(subcommand || '')) {
37
36
  return invalid('INVALID_AID', 'primaryId must be a valid individual AID');
38
37
  }
39
38
  const requestId = String(argValue(args, '--request-id') || '').trim();
@@ -55,7 +54,7 @@ export function resolveContactCommand(argv) {
55
54
  };
56
55
  }
57
56
  if (command === 'block' || command === 'unblock') {
58
- if (!isValidAid(subcommand || '') || isExplicitGroupId(subcommand || '')) {
57
+ if (!isValidAid(subcommand || '')) {
59
58
  return invalid('INVALID_AID', 'primaryId must be a valid individual AID');
60
59
  }
61
60
  return {
@@ -71,7 +70,7 @@ export function resolveContactCommand(argv) {
71
70
  };
72
71
  }
73
72
  if (command === 'add') {
74
- if (!isValidAid(subcommand || '') || isExplicitGroupId(subcommand || '')) {
73
+ if (!isValidAid(subcommand || '')) {
75
74
  return invalid('INVALID_AID', 'primaryId must be a valid individual AID');
76
75
  }
77
76
  return {
@@ -1,6 +1,7 @@
1
1
  import crypto from 'crypto';
2
2
  import fs from 'fs';
3
3
  import { isValidAid } from '../aun/aid/validation.js';
4
+ import { recordAunPeerRoute, resolveAunPeerKind } from '../core/relation/peer-identity.js';
4
5
  import { agentContactOperations } from '../paths.js';
5
6
  import { listStaticAgentAdmins, listStaticAgentOwners } from './peer-role-resolver.js';
6
7
  import { listAgentOwners } from './access-policy.js';
@@ -48,6 +49,11 @@ export async function addContact(input) {
48
49
  if (!isValidAid(primaryId)) {
49
50
  throw new ContactMutationError('INVALID_AID', `Invalid contact AID: ${primaryId}`);
50
51
  }
52
+ const identity = await resolveAunPeerKind(input.selfAid, primaryId);
53
+ if (identity.kind !== 'private') {
54
+ throw new ContactMutationError(identity.kind === 'group' ? 'INVALID_AID' : 'CONTACT_TYPE_UNKNOWN', identity.kind === 'group' ? `Contact Book does not support group AID: ${primaryId}`
55
+ : `Cannot establish private contact type (${identity.reason}): ${primaryId}`);
56
+ }
51
57
  const at = new Date(input.now ?? Date.now()).toISOString();
52
58
  const logFile = agentContactOperations(input.selfAid);
53
59
  const result = await mutateContactBookPrepared(input.selfAid, ({ contact, contactRevision }) => {
@@ -94,6 +100,11 @@ export async function submitContactRequest(input) {
94
100
  if (owners.length === 0) {
95
101
  return { code: 'no-owner', contactRevision: '' };
96
102
  }
103
+ const identity = input.routeKind
104
+ ? recordAunPeerRoute(input.selfAid, applicantAid, input.routeKind)
105
+ : await resolveAunPeerKind(input.selfAid, applicantAid);
106
+ if (identity.kind !== 'private')
107
+ return { code: 'invalid-applicant', contactRevision: '' };
97
108
  const note = normalizeNote(input.note);
98
109
  if (note === null) {
99
110
  return { code: 'invalid-note', contactRevision: '' };
@@ -1,5 +1,16 @@
1
+ export const SERVICE_RESTART_MAX_ATTEMPTS = 3;
2
+ export const SERVICE_RESTART_WINDOW_MS = 900000;
3
+ export const SERVICE_RESTART_BACKOFF_MS = 5000;
4
+ export const SERVICE_HEALTH_INTERVALS = {
5
+ tcp: { startup: 500, running: 10000 },
6
+ http: { startup: 1000, running: 15000 },
7
+ };
1
8
  const SERVICE_TYPES = new Set(['http', 'websocket', 'ssh']);
2
9
  const SERVICE_VISIBILITIES = new Set(['public', 'private', 'aun-auth']);
10
+ /** Preserve legacy ECWeb ownership; other services are external unless explicitly managed. */
11
+ export function serviceRuntimeMode(service) {
12
+ return service.runtime?.mode ?? (service.name === 'ecweb' ? 'managed' : 'external');
13
+ }
3
14
  export const DEFAULT_ECWEB_PORT = 42705;
4
15
  function isRecord(value) {
5
16
  return !!value && typeof value === 'object' && !Array.isArray(value);