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.
- package/CHANGELOG.md +62 -0
- package/dist/agents/baseagent-availability.js +1 -1
- package/dist/agents/baseagent.js +88 -49
- package/dist/agents/claude-runner.js +177 -92
- package/dist/agents/codex-runner.js +146 -71
- package/dist/agents/ecagent-runner.js +1 -1
- package/dist/agents/gemini-runner.js +1 -1
- package/dist/aun/aid/agentmd.js +98 -11
- package/dist/aun/aid/client.js +1 -1
- package/dist/aun/aid/control-aid.js +26 -2
- package/dist/aun/aid/identity.js +91 -0
- package/dist/aun/aid/index.js +1 -1
- package/dist/aun/aid/managed-operation.js +1 -1
- package/dist/aun/aid/ownership-operation.js +23 -22
- package/dist/aun/group/fs-download.js +39 -0
- package/dist/aun/group/identity.js +36 -21
- package/dist/aun/group/operations.js +5 -0
- package/dist/aun/menu/client.js +27 -0
- package/dist/aun/msg/managed-operation.js +68 -7
- package/dist/aun/msg/p2p.js +8 -8
- package/dist/aun/service-proxy.js +53 -12
- package/dist/channels/aun.js +633 -32
- package/dist/channels/daemon.js +15 -1
- package/dist/cli/agent-command.js +5 -2
- package/dist/cli/agent-create.js +991 -233
- package/dist/cli/agent.js +49 -10
- package/dist/cli/aid-bind-command.js +48 -19
- package/dist/cli/aun-commands.js +48 -36
- package/dist/cli/daemon-commands.js +679 -697
- package/dist/cli/fs-command.js +64 -2
- package/dist/cli/index.js +72 -5
- package/dist/cli/init-channel.js +1 -1
- package/dist/cli/init.js +75 -1
- package/dist/cli/managed-command-guard.js +17 -1
- package/dist/cli/model.js +40 -40
- package/dist/cli/provider-command.js +57 -0
- package/dist/cli/proxy-command.js +92 -0
- package/dist/cli/restart-monitor.js +4 -2
- package/dist/cli/role.js +85 -0
- package/dist/cli/stats.js +10 -3
- package/dist/cli/task-context.js +19 -0
- package/dist/config/access-policy.js +7 -2
- package/dist/config/boot-log.js +39 -1
- package/dist/config/config-field-policy.js +17 -39
- package/dist/config/config-manager.js +183 -44
- package/dist/config/config-operation-service.js +5 -19
- package/dist/config/contact-book-store.js +47 -21
- package/dist/config/contact-book.js +18 -12
- package/dist/config/contact-operation-service.js +3 -4
- package/dist/config/contact-request-service.js +11 -0
- package/dist/config/daemon-services.js +11 -0
- package/dist/config/gateway-config.js +88 -594
- package/dist/config/owner-config.js +2 -2
- package/dist/config/peer-role-resolver.js +15 -12
- package/dist/config/provider-ipc-service.js +132 -0
- package/dist/config/provider-menu-request.js +58 -0
- package/dist/config/providers-config.js +12 -7
- package/dist/config/providers-import.js +3 -21
- package/dist/config/providers-management.js +78 -5
- package/dist/config/resolved-config-op.js +11 -1
- package/dist/config/role-command-service.js +166 -0
- package/dist/config/role-request-service.js +193 -0
- package/dist/config/schema-migration.js +1000 -25
- package/dist/config-store.js +89 -4
- package/dist/contracts/ecweb-instance.js +41 -0
- package/dist/contracts/ecweb-service-protocol.js +4 -1
- package/dist/core/agent-application-service.js +60 -11
- package/dist/core/agent-create-status.js +203 -0
- package/dist/core/agent-creation-claim.js +177 -0
- package/dist/core/agent-ipc-registration.js +39 -18
- package/dist/core/agent-runtime.js +194 -24
- package/dist/core/auth/agent-delegation.js +6 -3
- package/dist/core/auth/auth-gateway.js +67 -2
- package/dist/core/auth/authorization-audit.js +58 -11
- package/dist/core/auth/delegation-authorization.js +5 -2
- package/dist/core/auth/operation-authorizer.js +43 -6
- package/dist/core/auth/operation-catalog.js +45 -7
- package/dist/core/channel-loader.js +2 -0
- package/dist/core/command/agent-control.js +260 -21
- package/dist/core/command/agent-storage-menu.js +5 -3
- package/dist/core/command/cli-intent-parser.js +8 -3
- package/dist/core/command/command-handler.js +112 -154
- package/dist/core/command/connect-menu.js +11 -3
- package/dist/core/command/data-root-resolver.js +5 -4
- package/dist/core/command/memory-slash.js +16 -8
- package/dist/core/command/menu-catalog.js +10 -6
- package/dist/core/command/menu-handler.js +106 -73
- package/dist/core/command/menu-protocol.js +15 -1
- package/dist/core/command/provider-menu.js +46 -0
- package/dist/core/command/role-menu.js +147 -30
- package/dist/core/command/slash-handler.js +125 -255
- package/dist/core/daemon-control.js +26 -27
- package/dist/core/event-catalog.js +10 -0
- package/dist/core/evolagent-registry.js +7 -5
- package/dist/core/evolagent.js +10 -8
- package/dist/core/file-integrity/store.js +11 -0
- package/dist/core/handoff/ipc-registration.js +3 -0
- package/dist/core/inference/text-inference.js +31 -40
- package/dist/core/initialization/service.js +491 -0
- package/dist/core/ipc-registration.js +40 -24
- package/dist/core/memory/consolidation-context.js +51 -5
- package/dist/core/memory/consolidation-ops-records.js +96 -1
- package/dist/core/memory/consolidation-trigger.js +208 -191
- package/dist/core/memory/consolidation.js +333 -35
- package/dist/core/memory/index-manager.js +27 -5
- package/dist/core/memory/memory-admin.js +45 -5
- package/dist/core/memory/memory-writer.js +163 -18
- package/dist/core/memory/relation-idle-monitor.js +119 -58
- package/dist/core/memory/relation-sweep.js +55 -45
- package/dist/core/message/aun-ipc-sender.js +81 -69
- package/dist/core/message/im-renderer.js +25 -4
- package/dist/core/message/message-admission.js +89 -4
- package/dist/core/message/message-bridge.js +66 -21
- package/dist/core/message/response-engine.js +108 -35
- package/dist/core/model/catalog-service.js +5 -3
- package/dist/core/model/config-scope.js +29 -71
- package/dist/core/model/field-scope.js +1 -1
- package/dist/core/model/model-catalog.js +30 -41
- package/dist/core/model/model-diagnostics.js +4 -3
- package/dist/core/model/model-fallback.js +10 -7
- package/dist/core/model/model-permission.js +3 -2
- package/dist/core/ownership/owner-resolver.js +772 -158
- package/dist/core/permission/approval-gateway.js +103 -403
- package/dist/core/permission/ec-command-parser.js +62 -6
- package/dist/core/permission/index.js +1 -0
- package/dist/core/permission/permission-result.js +78 -0
- package/dist/core/permission/sandbox-runtime.js +18 -1
- package/dist/core/permission/tool-policy.js +21 -46
- package/dist/core/relation/peer-identity.js +64 -1
- package/dist/core/role/runtime-policy.js +72 -13
- package/dist/core/session/session-capsule.js +1 -1
- package/dist/core/session/session-idle-monitor.js +1 -1
- package/dist/core/session/session-manager.js +20 -0
- package/dist/core/session/session-renew.js +3 -3
- package/dist/core/skill/index-generator.js +15 -5
- package/dist/core/system-session/memory.js +43 -8
- package/dist/core/thread/thread-service.js +19 -6
- package/dist/directory/owner-directory-admission.js +95 -0
- package/dist/directory/owner-directory-authorization.js +309 -0
- package/dist/directory/owner-directory-cache.js +635 -0
- package/dist/eck/kit-renderer.js +2 -2
- package/dist/ecweb/basic-settings-service.js +33 -40
- package/dist/ecweb/init-menu.js +32 -0
- package/dist/ecweb/message-context-service.js +110 -0
- package/dist/index.js +93 -19
- package/dist/ipc.js +247 -29
- package/dist/paths.js +7 -0
- package/dist/proxy/command.js +122 -0
- package/dist/proxy/ipc-service.js +68 -0
- package/dist/proxy/manager.js +484 -0
- package/dist/proxy/service-supervisor.js +603 -0
- package/dist/response-system/engines/v1/proactive-flow.js +16 -6
- package/dist/trigger/authorization.js +27 -17
- package/dist/trigger/feedback.js +2 -3
- package/dist/trigger/ipc-service.js +105 -78
- package/dist/trigger/local-files.js +2 -1
- package/dist/trigger/manager.js +5 -3
- package/dist/trigger/scheduler.js +88 -6
- package/dist/utils/atomic-write.js +28 -0
- package/dist/utils/cross-platform.js +14 -0
- package/dist/utils/ecweb-supervisor.js +258 -83
- package/dist/utils/error-utils.js +26 -2
- package/dist/utils/logger.js +92 -6
- package/dist/utils/package-version-info.js +4 -2
- package/dist/utils/welcome.js +1 -1
- package/kits/docs/INDEX.md +1 -0
- package/kits/docs/aun/SDK.md +4 -1
- package/kits/docs/channels/aun.md +9 -0
- package/kits/docs/evolcore/INDEX.md +1 -0
- package/kits/docs/evolcore/agent.md +8 -1
- package/kits/docs/evolcore/aid.md +67 -17
- package/kits/docs/evolcore/config.md +28 -7
- package/kits/docs/evolcore/contact.md +3 -0
- package/kits/docs/evolcore/fs.md +11 -0
- package/kits/docs/evolcore/group.md +1 -1
- package/kits/docs/evolcore/memory-architecture.md +2 -2
- package/kits/docs/evolcore/memory-consolidation.md +32 -8
- package/kits/docs/evolcore/memory.md +1 -1
- package/kits/docs/evolcore/menu-protocol.md +4 -0
- package/kits/docs/evolcore/model.md +23 -20
- package/kits/docs/evolcore/msg.md +4 -7
- package/kits/docs/evolcore/provider.md +50 -0
- package/kits/docs/identity/AID_PROFILE_SPEC.md +52 -17
- package/kits/migrations/migrate-contact-book-v2.mjs +30 -11
- package/kits/rules/01-overview.md +3 -0
- package/kits/rules/04-relation.md +1 -1
- package/kits/schemas/_meta.json +37 -4
- package/kits/schemas/agent-config.schema.13.json +8 -3
- package/kits/schemas/agent-config.schema.16.json +891 -0
- package/kits/schemas/daemon.schema.9.json +366 -0
- package/kits/schemas/defaults.schema.5.json +406 -127
- package/kits/schemas/relation-config.schema.11.json +277 -0
- package/kits/schemas/role-config.schema.1.json +7 -7
- package/kits/skills/.switches.json +4 -0
- package/kits/skills/ec-agent-create/SKILL.md +3 -0
- package/kits/skills/ec-identity/SKILL.md +2 -2
- package/kits/skills/ec-service-proxy/SKILL.md +118 -0
- package/kits/skills/ec-skill/scripts/skill.mjs +6 -0
- package/kits/skills/personal-assistant/SKILL.md +176 -0
- package/kits/skills/personal-assistant/references/01-workspace-spec.md +333 -0
- package/kits/skills/personal-assistant/references/02-bootstrap.md +205 -0
- package/kits/skills/personal-assistant/references/03-data-flow-and-gaps.md +177 -0
- package/kits/skills/personal-assistant/references/04-frontend-contract.md +439 -0
- package/kits/skills/personal-assistant/references/05-directory-reference.md +292 -0
- package/kits/skills/personal-assistant/references/06-render-config.md +350 -0
- package/kits/skills/personal-assistant/schema/workspace.schema.json +85 -0
- package/kits/skills/personal-assistant/schema/workspace.v1.json +66 -0
- package/kits/skills/personal-assistant/scripts/archive.mjs +154 -0
- package/kits/skills/personal-assistant/scripts/check.mjs +114 -0
- package/kits/skills/personal-assistant/scripts/index-rebuild.mjs +252 -0
- package/kits/skills/personal-assistant/scripts/ingest.mjs +344 -0
- package/kits/skills/personal-assistant/scripts/init.mjs +270 -0
- package/kits/skills/personal-assistant/scripts/lib/apply.mjs +92 -0
- package/kits/skills/personal-assistant/scripts/lib/schema.mjs +96 -0
- package/kits/skills/personal-assistant/scripts/lib/time.mjs +28 -0
- package/kits/skills/personal-assistant/scripts/migrate.mjs +172 -0
- package/kits/skills/personal-assistant/scripts/search.mjs +172 -0
- package/kits/skills/personal-assistant/scripts/verify.mjs +196 -0
- package/kits/skills/personal-assistant/templates/INDEX.md.tpl +24 -0
- package/kits/skills/personal-assistant/templates/README.md.tpl +108 -0
- package/kits/skills/personal-assistant/triggers/ingest-daily.json +23 -0
- package/kits/skills/personal-assistant/triggers/memory-consolidate.json +23 -0
- package/kits/skills/personal-assistant/triggers/report-daily.json +23 -0
- package/kits/skills/personal-assistant/triggers/report-weekly.json +23 -0
- package/kits/skills/thread-ops/SKILL.md +5 -0
- package/kits/templates/memory-consolidation/forget.md +19 -6
- package/kits/templates/memory-consolidation/notes.md +1 -1
- package/kits/templates/memory-consolidation/profile.md +2 -2
- package/kits/templates/memory-consolidation/promote.md +20 -3
- package/kits/templates/roles/member.json +8 -1
- package/kits/templates/system-fragments/baseagent.md +2 -2
- package/kits/templates/system-fragments/memory.md +4 -4
- package/kits/templates/system-fragments/venue.md +1 -1
- package/package.json +7 -3
- package/dist/core/message/create-status.js +0 -96
|
@@ -7,6 +7,7 @@ import { hasTrustedPrincipal } from './authenticated-actor.js';
|
|
|
7
7
|
import { ownerResolver, refreshOwnershipForAuthorization, OWNERSHIP_CACHE_MAX_AGE_MS } from '../ownership/owner-resolver.js';
|
|
8
8
|
import { getOperationMeta } from './operation-catalog.js';
|
|
9
9
|
import { resolveRuntimePermissionMode } from '../role/runtime-policy.js';
|
|
10
|
+
import { buildAuthorizationEventKey } from '../audit/event-key.js';
|
|
10
11
|
export function isCrossAgentTriggerOperationAllowed(input) {
|
|
11
12
|
return input.control || input.daemonOwner === true || input.taskAgentAid === input.targetAgentAid;
|
|
12
13
|
}
|
|
@@ -107,7 +108,7 @@ export async function authorizeFreshOperation(params) {
|
|
|
107
108
|
const configCommand = params.resolvedConfigCommand;
|
|
108
109
|
const changesOwner = configCommand?.kind === 'field' && configCommand.subcommand !== 'get'
|
|
109
110
|
&& ['owner', 'owners'].includes(configCommand.field.split('.')[0]);
|
|
110
|
-
const force = changesOwner || ['ec.aid.bind', 'ec.aid.
|
|
111
|
+
const force = changesOwner || ['ec.aid.bind', 'ec.aid.unbind', 'ec.aid.transfer']
|
|
111
112
|
.includes(params.intent.operation) || params.intent.operation === 'config.restore';
|
|
112
113
|
const operation = getOperationMeta(params.intent.operation);
|
|
113
114
|
const sensitive = force || params.intent.dangerous || operation?.dangerous || operation?.category !== 'read'
|
|
@@ -143,6 +144,69 @@ export async function authorizeFreshOperation(params) {
|
|
|
143
144
|
}
|
|
144
145
|
return authorizeOperation(params);
|
|
145
146
|
}
|
|
147
|
+
/** Record managed command stages using the existing transport request identity. */
|
|
148
|
+
export async function executeAuditedOperation(params, execute, itemIndex) {
|
|
149
|
+
const startedAt = Date.now();
|
|
150
|
+
const metadata = params.auditMetadata;
|
|
151
|
+
const eventKey = metadata?.eventKey ?? buildAuthorizationEventKey({
|
|
152
|
+
sessionId: metadata?.sessionId ?? params.subject.sessionId,
|
|
153
|
+
requestId: metadata?.requestId ?? params.subject.requestId,
|
|
154
|
+
callId: metadata?.callId,
|
|
155
|
+
correlationId: metadata?.correlationId,
|
|
156
|
+
operation: params.intent.operation,
|
|
157
|
+
});
|
|
158
|
+
const auditedParams = {
|
|
159
|
+
...params,
|
|
160
|
+
auditMetadata: {
|
|
161
|
+
...metadata,
|
|
162
|
+
eventKey: itemIndex === undefined ? eventKey : `${eventKey}:item:${itemIndex}`,
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
let snapshot = {
|
|
166
|
+
allow: true,
|
|
167
|
+
operation: params.intent.operation,
|
|
168
|
+
scope: params.intent.scope,
|
|
169
|
+
role: params.subject.role,
|
|
170
|
+
dangerous: params.intent.dangerous ?? getOperationMeta(params.intent.operation)?.dangerous ?? false,
|
|
171
|
+
};
|
|
172
|
+
const record = (overrides) => {
|
|
173
|
+
if (params.audit !== false)
|
|
174
|
+
auditDecision(auditedParams, snapshot, overrides);
|
|
175
|
+
};
|
|
176
|
+
record({ eventPhase: 'request', decision: 'pending', decisionSource: 'command', executionState: 'requested' });
|
|
177
|
+
let executed = false;
|
|
178
|
+
try {
|
|
179
|
+
const decision = await authorizeFreshOperation(auditedParams);
|
|
180
|
+
if (decision.command)
|
|
181
|
+
snapshot = decision.command;
|
|
182
|
+
if (!decision.allow) {
|
|
183
|
+
record({
|
|
184
|
+
eventPhase: 'response', decision: 'deny', executionState: 'blocked',
|
|
185
|
+
decisionSource: decision.command ? undefined : 'policy',
|
|
186
|
+
code: decision.code, durationMs: Date.now() - startedAt,
|
|
187
|
+
});
|
|
188
|
+
return { ok: false, code: decision.code, error: decision.reason };
|
|
189
|
+
}
|
|
190
|
+
const result = await execute(() => { executed = true; });
|
|
191
|
+
record({
|
|
192
|
+
eventPhase: 'response', executed,
|
|
193
|
+
executionState: result.ok ? 'completed' : executed ? 'failed' : 'blocked',
|
|
194
|
+
code: result.ok ? undefined : result.code,
|
|
195
|
+
errorCode: result.ok ? undefined : 'EXECUTION_FAILED',
|
|
196
|
+
durationMs: Date.now() - startedAt,
|
|
197
|
+
});
|
|
198
|
+
return result;
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
record({
|
|
202
|
+
eventPhase: 'response', executed, executionState: executed ? 'failed' : 'blocked',
|
|
203
|
+
decision: executed ? 'allow' : 'pending',
|
|
204
|
+
decisionSource: executed ? 'command' : 'infrastructure',
|
|
205
|
+
errorCode: 'EXECUTION_FAILED', durationMs: Date.now() - startedAt,
|
|
206
|
+
});
|
|
207
|
+
throw error;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
146
210
|
export function authorizeOperation(params) {
|
|
147
211
|
const access = authorizeAccess(params.subject);
|
|
148
212
|
if (!access.allow) {
|
|
@@ -228,7 +292,7 @@ function resolveRoleDetail(input) {
|
|
|
228
292
|
peerType: input.peerType,
|
|
229
293
|
});
|
|
230
294
|
}
|
|
231
|
-
function auditDecision(params, decision) {
|
|
295
|
+
function auditDecision(params, decision, overrides) {
|
|
232
296
|
const roleDenial = !decision.allow && decision.code === 'ROLE_ACCESS_DENIED';
|
|
233
297
|
auditCommandAuthorization({
|
|
234
298
|
ts: Date.now(),
|
|
@@ -278,5 +342,6 @@ function auditDecision(params, decision) {
|
|
|
278
342
|
reason: decision.allow ? undefined : decision.reason,
|
|
279
343
|
matchedRule: decision.matchedRule,
|
|
280
344
|
argsSummary: params.intent.args,
|
|
345
|
+
...Object.fromEntries(Object.entries(overrides ?? {}).filter(([, value]) => value !== undefined)),
|
|
281
346
|
});
|
|
282
347
|
}
|
|
@@ -5,14 +5,25 @@ import crypto from 'node:crypto';
|
|
|
5
5
|
import { buildAuthorizationEventKey, buildToolLifecycleEventKey, normalizeToolCorrelation } from '../audit/event-key.js';
|
|
6
6
|
import { normalizeExecutionPermissionMode } from '../permission/mode.js';
|
|
7
7
|
import { normalizeToolErrorClassification } from '../permission/tool-error-code.js';
|
|
8
|
+
function permissionAuditDetails(input) {
|
|
9
|
+
return Object.fromEntries(Object.entries({
|
|
10
|
+
approvalRequestId: input.approvalRequestId,
|
|
11
|
+
approverOperatorId: input.approverOperatorId,
|
|
12
|
+
approverChannelKey: input.approverChannelKey,
|
|
13
|
+
approverPrincipalId: input.approverPrincipalId,
|
|
14
|
+
}).filter((entry) => typeof entry[1] === 'string'));
|
|
15
|
+
}
|
|
8
16
|
export function auditCommandAuthorization(event) {
|
|
9
17
|
const shouldAudit = event.source === 'menu.cli' ||
|
|
10
18
|
event.decision === 'deny' ||
|
|
11
19
|
(event.decision === 'allow' && event.dangerous) ||
|
|
12
20
|
(event.source === 'agent-tool' && event.operation.startsWith('config.')) ||
|
|
21
|
+
(event.source === 'agent-tool' && event.decisionSource === 'command'
|
|
22
|
+
&& (event.eventPhase === 'request' || event.eventPhase === 'response'
|
|
23
|
+
|| (event.eventPhase === 'final' && !!event.requestId))) ||
|
|
13
24
|
event.operation === 'codex.approval' ||
|
|
14
25
|
event.operation === 'permission.approval' ||
|
|
15
|
-
event.operation
|
|
26
|
+
event.operation.startsWith('permission.runtime') ||
|
|
16
27
|
event.operation.startsWith('fullaccess.') ||
|
|
17
28
|
event.operation.startsWith('role.') ||
|
|
18
29
|
event.operation === 'file.root.storage' ||
|
|
@@ -180,15 +191,17 @@ export function auditCodexApprovalDecision(input) {
|
|
|
180
191
|
approvalMethod: input.method,
|
|
181
192
|
policyCode: input.policyCode,
|
|
182
193
|
protectionClass: protectionClassForPolicy(input.policyCode),
|
|
194
|
+
parseFailure: sanitizeParseFailure(input.parseFailure),
|
|
183
195
|
reason: input.reason,
|
|
184
196
|
role: input.role ?? 'unknown',
|
|
185
197
|
taskId: input.taskId,
|
|
186
198
|
argsSummary: {
|
|
199
|
+
...permissionAuditDetails(input),
|
|
187
200
|
method: input.method,
|
|
188
201
|
...(input.summary ? { summary: input.summary } : {}),
|
|
189
202
|
...(input.threadId ? { threadId: input.threadId } : {}),
|
|
190
203
|
...(input.cwd ? { cwd: input.cwd } : {}),
|
|
191
|
-
...(input.parseFailure ? { parseFailure: input.parseFailure } : {}),
|
|
204
|
+
...(input.parseFailure ? { parseFailure: sanitizeParseFailure(input.parseFailure) } : {}),
|
|
192
205
|
},
|
|
193
206
|
});
|
|
194
207
|
}
|
|
@@ -200,6 +213,7 @@ export function auditCodexApprovalDecision(input) {
|
|
|
200
213
|
export function auditPermissionDecision(input) {
|
|
201
214
|
const requestId = input.requestId ?? `perm-audit-${crypto.randomUUID()}`;
|
|
202
215
|
auditPermissionLifecycle({
|
|
216
|
+
...input,
|
|
203
217
|
phase: 'final',
|
|
204
218
|
requestId,
|
|
205
219
|
callId: input.callId,
|
|
@@ -244,6 +258,7 @@ export function auditPermissionLifecycle(input) {
|
|
|
244
258
|
approvalMethod: input.approvalMethod,
|
|
245
259
|
policyCode: input.policyCode,
|
|
246
260
|
decisionSource: input.decisionSource,
|
|
261
|
+
errorDetailCode: input.errorDetailCode,
|
|
247
262
|
errorCode: input.decision === 'deny'
|
|
248
263
|
? input.decisionSource === 'approval'
|
|
249
264
|
? 'USER_DENIED'
|
|
@@ -257,8 +272,9 @@ export function auditPermissionLifecycle(input) {
|
|
|
257
272
|
dangerous: false,
|
|
258
273
|
role: input.role ?? 'unknown',
|
|
259
274
|
taskId: input.taskId,
|
|
260
|
-
argsSummary: input.summary || input.response
|
|
275
|
+
argsSummary: input.summary || input.response || Object.keys(permissionAuditDetails(input)).length
|
|
261
276
|
? {
|
|
277
|
+
...permissionAuditDetails(input),
|
|
262
278
|
...(input.summary ? { summary: input.summary } : {}),
|
|
263
279
|
...(input.response ? { response: input.response } : {}),
|
|
264
280
|
}
|
|
@@ -267,9 +283,9 @@ export function auditPermissionLifecycle(input) {
|
|
|
267
283
|
executed: false,
|
|
268
284
|
executionState: input.phase === 'request'
|
|
269
285
|
? 'requested'
|
|
270
|
-
: input.
|
|
271
|
-
? '
|
|
272
|
-
: input.
|
|
286
|
+
: input.decision === 'deny'
|
|
287
|
+
? 'blocked'
|
|
288
|
+
: input.phase === 'response' ? 'responded' : 'authorized',
|
|
273
289
|
reason: input.reason,
|
|
274
290
|
});
|
|
275
291
|
}
|
|
@@ -280,14 +296,14 @@ export function auditToolInfrastructureFailure(input) {
|
|
|
280
296
|
eventKey: buildToolLifecycleEventKey(input),
|
|
281
297
|
eventPhase: 'final',
|
|
282
298
|
source: 'agent-tool',
|
|
283
|
-
operation: 'tool.execution.blocked',
|
|
299
|
+
operation: input.fallback ? 'permission.runtime.sandbox_fallback' : 'tool.execution.blocked',
|
|
284
300
|
scope: 'filesystem',
|
|
285
301
|
dangerous: false,
|
|
286
|
-
decision: 'deny',
|
|
302
|
+
decision: input.fallback ? 'allow' : 'deny',
|
|
287
303
|
decisionSource: 'infrastructure',
|
|
288
304
|
errorCode: infrastructureErrorCode(input.policyCode),
|
|
289
305
|
executed: false,
|
|
290
|
-
executionState: 'blocked',
|
|
306
|
+
executionState: input.fallback ? 'authorized' : 'blocked',
|
|
291
307
|
...normalizeToolCorrelation(input),
|
|
292
308
|
sessionId: input.sessionId ?? 'unknown',
|
|
293
309
|
agentAid: input.agentAid ?? 'unknown',
|
|
@@ -301,6 +317,7 @@ export function auditToolInfrastructureFailure(input) {
|
|
|
301
317
|
argsSummary: input.occurrences || input.sandboxFailure
|
|
302
318
|
? {
|
|
303
319
|
...(input.occurrences ? { occurrences: input.occurrences } : {}),
|
|
320
|
+
...(input.fallback ? { sandboxFallback: true } : {}),
|
|
304
321
|
// Flat primitive fields survive the audit argument redactor and can
|
|
305
322
|
// be aggregated without reparsing (possibly truncated) stderr.
|
|
306
323
|
...(input.sandboxFailure ? {
|
|
@@ -316,6 +333,8 @@ export function auditToolInfrastructureFailure(input) {
|
|
|
316
333
|
});
|
|
317
334
|
}
|
|
318
335
|
function infrastructureErrorCode(policyCode) {
|
|
336
|
+
if (policyCode === 'approval_expired' || policyCode === 'approval_timeout')
|
|
337
|
+
return 'APPROVAL_TIMEOUT';
|
|
319
338
|
const code = String(policyCode ?? '').toLowerCase();
|
|
320
339
|
if (/delegat|carrier|not.?armed/.test(code))
|
|
321
340
|
return 'DELEGATION_FAILED';
|
|
@@ -390,9 +409,11 @@ function buildAuditRecord(event) {
|
|
|
390
409
|
requestId,
|
|
391
410
|
sourceRequestId,
|
|
392
411
|
sessionId: event.sessionId,
|
|
393
|
-
...(
|
|
412
|
+
...(!event.sessionId ? {
|
|
413
|
+
sessionScope: event.source === 'ecweb' ? 'not_applicable' : 'unknown',
|
|
414
|
+
} : {}),
|
|
394
415
|
agentAid: redactIdentifier(event.agentAid ?? event.selfAid),
|
|
395
|
-
agentName: resolveAgentName(event),
|
|
416
|
+
agentName: resolveAgentName(event) ?? 'unknown',
|
|
396
417
|
permissionMode: normalizeAuditPermissionMode(event.permissionMode),
|
|
397
418
|
toolName: event.toolName,
|
|
398
419
|
approvalMethod: event.approvalMethod,
|
|
@@ -403,6 +424,7 @@ function buildAuditRecord(event) {
|
|
|
403
424
|
policyCode: event.policyCode ?? event.code,
|
|
404
425
|
protectionClass: event.protectionClass,
|
|
405
426
|
matchedPath: event.matchedPath,
|
|
427
|
+
parseFailure: sanitizeParseFailure(event.parseFailure),
|
|
406
428
|
decisionSource,
|
|
407
429
|
ecwebRequestId: event.ecwebRequestId,
|
|
408
430
|
targetAgentAid: redactIdentifier(event.targetAgentAid),
|
|
@@ -449,6 +471,22 @@ function namespaceAuditRequestId(source, sessionId, sourceRequestId) {
|
|
|
449
471
|
const parts = [...namespace, sourceRequestId].map(part => encodeURIComponent(JSON.stringify(part).slice(1, -1)));
|
|
450
472
|
return `audit:v1:${parts.join(':')}`;
|
|
451
473
|
}
|
|
474
|
+
function sanitizeParseFailure(value) {
|
|
475
|
+
if (!value || typeof value !== 'object')
|
|
476
|
+
return undefined;
|
|
477
|
+
const candidate = value;
|
|
478
|
+
const issues = ['empty-command', 'invalid-control-char', 'unsafe-expansion', 'invalid-quote',
|
|
479
|
+
'structural-newline', 'unsupported-escape', 'lossy-cmd-shim', 'shell-composition', 'untrusted-shell'];
|
|
480
|
+
if (typeof candidate.issue !== 'string' || !issues.includes(candidate.issue)
|
|
481
|
+
|| typeof candidate.dialect !== 'string' || !['posix', 'powershell', 'cmd'].includes(candidate.dialect))
|
|
482
|
+
return undefined;
|
|
483
|
+
const { offset, tokenIndex, inputLength } = candidate;
|
|
484
|
+
if (typeof offset !== 'number' || typeof tokenIndex !== 'number' || typeof inputLength !== 'number'
|
|
485
|
+
|| ![offset, tokenIndex, inputLength].every(value => Number.isSafeInteger(value) && value >= 0)
|
|
486
|
+
|| offset > inputLength || tokenIndex > inputLength)
|
|
487
|
+
return undefined;
|
|
488
|
+
return { issue: candidate.issue, dialect: candidate.dialect, offset, tokenIndex, inputLength };
|
|
489
|
+
}
|
|
452
490
|
function resolveAgentName(event) {
|
|
453
491
|
const displayName = typeof event.agentName === 'string' ? event.agentName.trim() : '';
|
|
454
492
|
if (displayName && !isUnknownAgentLabel(displayName))
|
|
@@ -459,6 +497,14 @@ function resolveAgentName(event) {
|
|
|
459
497
|
const selfAid = typeof event.selfAid === 'string' ? event.selfAid.trim() : '';
|
|
460
498
|
if (selfAid && selfAid !== 'unknown')
|
|
461
499
|
return selfAid;
|
|
500
|
+
const targetAgentAid = event.source === 'ecweb' && typeof event.targetAgentAid === 'string'
|
|
501
|
+
? event.targetAgentAid.trim() : '';
|
|
502
|
+
if (targetAgentAid && targetAgentAid !== 'unknown')
|
|
503
|
+
return targetAgentAid;
|
|
504
|
+
const actorId = event.source === 'ecweb' && typeof event.actorId === 'string'
|
|
505
|
+
? event.actorId.trim() : '';
|
|
506
|
+
if (actorId && !isUnknownAgentLabel(actorId))
|
|
507
|
+
return actorId;
|
|
462
508
|
return aid === 'unknown' || selfAid === 'unknown' ? 'unknown' : undefined;
|
|
463
509
|
}
|
|
464
510
|
function isUnknownAgentLabel(value) {
|
|
@@ -523,6 +569,7 @@ function logAuditEvent(record) {
|
|
|
523
569
|
record.policyCode ? `policy=${record.policyCode}` : null,
|
|
524
570
|
record.protectionClass ? `protectionClass=${record.protectionClass}` : null,
|
|
525
571
|
record.matchedPath ? `matchedPath=${JSON.stringify(record.matchedPath)}` : null,
|
|
572
|
+
record.parseFailure ? `parseFailure=${JSON.stringify(record.parseFailure)}` : null,
|
|
526
573
|
record.decisionSource ? `decisionSource=${record.decisionSource}` : null,
|
|
527
574
|
`executed=${record.executed}`,
|
|
528
575
|
`executionState=${record.executionState}`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { authorizeFreshOperation as authorizeOperation, buildAuthSubject } from './auth-gateway.js';
|
|
2
|
-
import { trustedExecutionIdentityInput } from './agent-delegation.js';
|
|
2
|
+
import { hasTrustedFullAccessDelegation, trustedExecutionIdentityInput } from './agent-delegation.js';
|
|
3
3
|
import { isManagementRole } from '../../config/builtin-roles.js';
|
|
4
4
|
import { parsePeerKey } from '../relation/peer-identity.js';
|
|
5
5
|
export function createDelegationAuthorizer({ agentDelegationRegistry, sessionManager, getProcessOwners, }) {
|
|
@@ -40,7 +40,9 @@ export function createDelegationAuthorizer({ agentDelegationRegistry, sessionMan
|
|
|
40
40
|
subject,
|
|
41
41
|
intent: {
|
|
42
42
|
operation,
|
|
43
|
-
scope: operation === 'system.status'
|
|
43
|
+
scope: operation === 'system.status' || operation === 'proxy.configure' || operation === 'proxy.lifecycle'
|
|
44
|
+
? 'process'
|
|
45
|
+
: 'agent',
|
|
44
46
|
source: 'agent-tool',
|
|
45
47
|
args: { self: delegation.grant.selfAid, aid: params.targetAid ?? delegation.grant.selfAid },
|
|
46
48
|
},
|
|
@@ -51,6 +53,7 @@ export function createDelegationAuthorizer({ agentDelegationRegistry, sessionMan
|
|
|
51
53
|
ok: true,
|
|
52
54
|
aid: subject.dataScope === 'daemon' ? (params.targetAid ?? delegation.grant.selfAid) : delegation.grant.selfAid,
|
|
53
55
|
dataScope: subject.dataScope,
|
|
56
|
+
fullAccess: hasTrustedFullAccessDelegation(delegation.grant),
|
|
54
57
|
management: isManagementRole(subject.role),
|
|
55
58
|
sessionRuntimeDir: delegation.grant.sessionRuntimeDir,
|
|
56
59
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getRoleDefinition } from '../../config/roles.js';
|
|
2
2
|
import { isManagementRole } from '../../config/builtin-roles.js';
|
|
3
|
-
import { isUnsupportedBaseagentConfigField, relationFieldWriteOperation, resolveRoleFieldPermission, } from '../../config/config-field-policy.js';
|
|
3
|
+
import { isAgentOnlyBaseagentField, isUnsupportedBaseagentConfigField, relationFieldWriteOperation, resolveRoleFieldPermission, } from '../../config/config-field-policy.js';
|
|
4
4
|
import { isResolvedConfigMutation, } from '../../config/resolved-config-op.js';
|
|
5
5
|
import { normalizePeer } from '../model/config-scope.js';
|
|
6
6
|
import { getOperationMeta } from './operation-catalog.js';
|
|
@@ -45,6 +45,11 @@ const DAEMON_OWNER_MODEL_OPTION_READ_OPERATIONS = new Set([
|
|
|
45
45
|
'model.list',
|
|
46
46
|
'model.effort.current',
|
|
47
47
|
]);
|
|
48
|
+
const MODEL_WRITE_OPERATIONS = new Set([
|
|
49
|
+
'model.use',
|
|
50
|
+
'model.effort',
|
|
51
|
+
'model.reset',
|
|
52
|
+
]);
|
|
48
53
|
export function authorizeCommand(ctx) {
|
|
49
54
|
return authorizeCommandInternal(ctx);
|
|
50
55
|
}
|
|
@@ -98,6 +103,14 @@ function authorizeCommandInternal(ctx, resolvedConfigCommand) {
|
|
|
98
103
|
if (!opMeta) {
|
|
99
104
|
return denyDecision(ctx, 'NOT_ALLOWED', `Unknown operation: ${operation}`, operation, intent.scope);
|
|
100
105
|
}
|
|
106
|
+
if (operation.startsWith('provider.')) {
|
|
107
|
+
if (intent.scope !== 'process' || !ctx.fromControlChannel
|
|
108
|
+
|| !(ctx.isDaemonOwner === true || ctx.processRole === 'daemon-owner')
|
|
109
|
+
|| !['menu', 'control', 'ecweb'].includes(ctx.source)) {
|
|
110
|
+
return denyDecision(ctx, 'NOT_ALLOWED', 'Provider management requires DaemonOwner process control', operation, intent.scope, opMeta.dangerous);
|
|
111
|
+
}
|
|
112
|
+
return { allow: true, operation, scope: intent.scope, role: 'daemon-owner', dangerous: opMeta.dangerous, matchedRule: 'provider-process-owner' };
|
|
113
|
+
}
|
|
101
114
|
if (isFieldConfigOperation(operation) && !resolvedConfigCommand) {
|
|
102
115
|
return denyDecision(ctx, 'NOT_ALLOWED', 'Resolved config operation is required', operation, intent.scope, opMeta.dangerous);
|
|
103
116
|
}
|
|
@@ -116,7 +129,10 @@ function authorizeCommandInternal(ctx, resolvedConfigCommand) {
|
|
|
116
129
|
// but relation/Agent role rules, source lists, and daemon-owner gates are
|
|
117
130
|
// not meaningful limits for code already approved for host-level execution.
|
|
118
131
|
if (ctx.processRole === 'fullaccess-run' && ctx.dataScope === 'daemon'
|
|
119
|
-
&& operation !== 'ec.aid.bind' && operation !== 'ec.aid.bind.status') {
|
|
132
|
+
&& operation !== 'ec.aid.bind' && operation !== 'ec.aid.transfer' && operation !== 'ec.aid.bind.status') {
|
|
133
|
+
if (operation === 'system.restart' || operation === 'system.upgrade') {
|
|
134
|
+
return denyDecision(ctx, 'NOT_ALLOWED', 'The EvolCore instance hosting the current fullaccess task is protected from lifecycle changes', operation, intent.scope, opMeta.dangerous, 'fullaccess-current-runtime-protected');
|
|
135
|
+
}
|
|
120
136
|
return {
|
|
121
137
|
allow: true,
|
|
122
138
|
operation,
|
|
@@ -137,12 +153,18 @@ function authorizeCommandInternal(ctx, resolvedConfigCommand) {
|
|
|
137
153
|
if (!sourceAllowed) {
|
|
138
154
|
return denyDecision(ctx, 'NOT_ALLOWED', `Operation ${operation} is not available from source ${ctx.source}`, operation, intent.scope, opMeta.dangerous);
|
|
139
155
|
}
|
|
140
|
-
if (operation === 'ec.aid.bind
|
|
141
|
-
|
|
156
|
+
if (operation === 'ec.aid.bind.status') {
|
|
157
|
+
if (intent.scope !== 'agent') {
|
|
158
|
+
return denyDecision(ctx, 'NOT_ALLOWED', 'Ownership status is only available for an Agent subject', operation, intent.scope, opMeta.dangerous);
|
|
159
|
+
}
|
|
160
|
+
return { allow: true, operation, scope: intent.scope, role, dangerous: opMeta.dangerous, matchedRule: 'ownership-status-read' };
|
|
161
|
+
}
|
|
162
|
+
if (operation === 'ec.aid.bind' || operation === 'ec.aid.transfer') {
|
|
163
|
+
const permitted = intent.scope === 'agent' && ctx.processRole !== 'daemon-service'
|
|
142
164
|
&& (ctx.isDaemonOwner === true || ctx.processRole === 'daemon-owner'
|
|
143
|
-
|| (isCurrentAgentTarget(ctx) &&
|
|
165
|
+
|| (isCurrentAgentTarget(ctx) && role === 'owner'));
|
|
144
166
|
if (!permitted)
|
|
145
|
-
return denyDecision(ctx, 'NOT_ALLOWED', 'Protocol Owner binding requires the subject Owner or daemon Owner', operation, intent.scope, opMeta.dangerous);
|
|
167
|
+
return denyDecision(ctx, 'NOT_ALLOWED', 'Protocol Owner binding or transfer requires the subject Owner or daemon Owner', operation, intent.scope, opMeta.dangerous);
|
|
146
168
|
return { allow: true, operation, scope: intent.scope, role, dangerous: opMeta.dangerous, matchedRule: 'protocol-owner-binding' };
|
|
147
169
|
}
|
|
148
170
|
if (ctx.processRole === 'daemon-service') {
|
|
@@ -212,6 +234,16 @@ function authorizeCommandInternal(ctx, resolvedConfigCommand) {
|
|
|
212
234
|
matchedRule: 'daemon-owner-model-options-read',
|
|
213
235
|
};
|
|
214
236
|
}
|
|
237
|
+
// 模型参数只在 Agent 级:写操作只能落 agent scope,且只有该 Agent 的 owner/admin
|
|
238
|
+
// (或 DaemonOwner)能改。这是代码级上限,角色文件授予 model.* 也不能越过。
|
|
239
|
+
if (MODEL_WRITE_OPERATIONS.has(operation)) {
|
|
240
|
+
if (intent.scope !== 'agent') {
|
|
241
|
+
return denyDecision(ctx, 'SCOPE_MISMATCH', '模型参数只能在 Agent 级配置,不支持关系级设置', operation, intent.scope, opMeta.dangerous);
|
|
242
|
+
}
|
|
243
|
+
if (!hasDaemonOwnerRole(ctx) && !(isManagementRole(role) && isCurrentAgentTarget(ctx))) {
|
|
244
|
+
return denyDecision(ctx, 'NOT_ALLOWED', '只有当前 Agent 的 owner/admin 可以修改模型', operation, intent.scope, opMeta.dangerous);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
215
247
|
if (requiresDaemonOwner(ctx, resolvedConfigCommand)) {
|
|
216
248
|
if (!hasDaemonOwnerRole(ctx)) {
|
|
217
249
|
const reasonCode = daemonOwnerDenialReasonCode(ctx);
|
|
@@ -660,6 +692,11 @@ function checkConfigFieldPolicy(ctx, policy, resolvedConfigOp) {
|
|
|
660
692
|
return { ok: false, reason: 'Resolved config operation is required' };
|
|
661
693
|
const field = resolvedConfigOp.field;
|
|
662
694
|
if (!resolvedConfigOp.route || (resolvedConfigOp.fieldRule.class !== 'safe-scalar' && resolvedConfigOp.fieldRule.class !== 'safe-readonly-object')) {
|
|
695
|
+
if (policy === 'behavior-read'
|
|
696
|
+
&& resolvedConfigOp.configScope === 'relation'
|
|
697
|
+
&& isAgentOnlyBaseagentField(field)) {
|
|
698
|
+
return { ok: true };
|
|
699
|
+
}
|
|
663
700
|
if (policy === 'behavior-read'
|
|
664
701
|
&& !isCurrentAgentTarget(ctx)
|
|
665
702
|
&& hasDaemonOwnerRole(ctx)
|
|
@@ -128,7 +128,40 @@ const QUEUE_OPERATIONS = [['read', 'Read the current Agent message queue'], ['cl
|
|
|
128
128
|
*
|
|
129
129
|
* 参照设计文档 docs/command-execution-role-permission-design.md 第 5 节
|
|
130
130
|
*/
|
|
131
|
+
const PROVIDER_OPERATIONS = ['list', 'show', 'create', 'import', 'update', 'delete'].map(action => ({
|
|
132
|
+
id: 'provider.' + action,
|
|
133
|
+
category: action === 'list' || action === 'show' ? 'read' : 'process',
|
|
134
|
+
dangerous: action !== 'list' && action !== 'show',
|
|
135
|
+
defaultScopes: ['process'],
|
|
136
|
+
description: 'Manage the daemon Provider registry: ' + action,
|
|
137
|
+
sources: ['menu', 'control', 'ecweb'],
|
|
138
|
+
}));
|
|
131
139
|
const OPERATIONS = [
|
|
140
|
+
...PROVIDER_OPERATIONS,
|
|
141
|
+
{
|
|
142
|
+
id: 'proxy.read',
|
|
143
|
+
category: 'read',
|
|
144
|
+
dangerous: false,
|
|
145
|
+
defaultScopes: ['agent'],
|
|
146
|
+
description: '查看当前 daemon 的本地服务与 ServiceProxy 状态',
|
|
147
|
+
sources: ['agent-tool'],
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
id: 'proxy.configure',
|
|
151
|
+
category: 'process',
|
|
152
|
+
dangerous: true,
|
|
153
|
+
defaultScopes: ['process'],
|
|
154
|
+
description: '创建、修改、发布或删除本地服务代理配置',
|
|
155
|
+
sources: ['agent-tool'],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: 'proxy.lifecycle',
|
|
159
|
+
category: 'process',
|
|
160
|
+
dangerous: true,
|
|
161
|
+
defaultScopes: ['process'],
|
|
162
|
+
description: '启动、停止、重载或守护本地服务',
|
|
163
|
+
sources: ['agent-tool'],
|
|
164
|
+
},
|
|
132
165
|
// ── Model Operations ──
|
|
133
166
|
{
|
|
134
167
|
id: 'baseagent.models.list',
|
|
@@ -178,28 +211,29 @@ const OPERATIONS = [
|
|
|
178
211
|
description: '检查模型可用性(可能触发网关探测)',
|
|
179
212
|
sources: ['slash', 'menu.cli', 'agent-tool'],
|
|
180
213
|
},
|
|
214
|
+
// 模型参数只在 Agent 级配置,仅 owner/admin 可写(operation-authorizer 另有代码级上限)。
|
|
181
215
|
{
|
|
182
216
|
id: 'model.use',
|
|
183
217
|
category: 'write-own',
|
|
184
218
|
dangerous: false,
|
|
185
|
-
defaultScopes: ['
|
|
186
|
-
description: '
|
|
219
|
+
defaultScopes: ['agent'],
|
|
220
|
+
description: '设置 Agent 使用的模型',
|
|
187
221
|
sources: ['slash', 'menu', 'menu.cli', 'agent-tool'],
|
|
188
222
|
},
|
|
189
223
|
{
|
|
190
224
|
id: 'model.effort',
|
|
191
225
|
category: 'write-own',
|
|
192
226
|
dangerous: false,
|
|
193
|
-
defaultScopes: ['
|
|
194
|
-
description: '
|
|
227
|
+
defaultScopes: ['agent'],
|
|
228
|
+
description: '设置 Agent 的推理强度',
|
|
195
229
|
sources: ['slash', 'menu', 'menu.cli', 'agent-tool'],
|
|
196
230
|
},
|
|
197
231
|
{
|
|
198
232
|
id: 'model.reset',
|
|
199
233
|
category: 'write-own',
|
|
200
234
|
dangerous: false,
|
|
201
|
-
defaultScopes: ['
|
|
202
|
-
description: '
|
|
235
|
+
defaultScopes: ['agent'],
|
|
236
|
+
description: '清除 Agent 的模型与推理强度设置',
|
|
203
237
|
sources: ['slash', 'menu.cli', 'agent-tool'],
|
|
204
238
|
},
|
|
205
239
|
// ── Session Operations ──
|
|
@@ -1149,9 +1183,13 @@ const OPERATIONS = [
|
|
|
1149
1183
|
id: 'ec.aid.bind', category: 'write-agent', dangerous: true, defaultScopes: ['agent'],
|
|
1150
1184
|
description: 'Request or decide a protocol Owner binding using the subject SDK client', sources: ['agent-tool', 'menu.cli'],
|
|
1151
1185
|
},
|
|
1186
|
+
{
|
|
1187
|
+
id: 'ec.aid.transfer', category: 'write-agent', dangerous: true, defaultScopes: ['agent'],
|
|
1188
|
+
description: 'Transfer a protocol Owner relationship to a new Owner using the subject SDK client', sources: ['agent-tool', 'menu.cli'],
|
|
1189
|
+
},
|
|
1152
1190
|
{
|
|
1153
1191
|
id: 'ec.aid.bind.status', category: 'read', dangerous: false, defaultScopes: ['agent'],
|
|
1154
|
-
description: '
|
|
1192
|
+
description: 'Read the protocol Owner consensus and binding task projection; status --refresh forces a fresh query', sources: ['agent-tool', 'menu.cli'],
|
|
1155
1193
|
},
|
|
1156
1194
|
{
|
|
1157
1195
|
id: 'ec.aid.lookup',
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* The main service (index.ts) handles registration and message flow wiring.
|
|
7
7
|
*/
|
|
8
8
|
import { logger } from '../utils/logger.js';
|
|
9
|
+
import { assertAgentAidAvailable } from '../config/config-manager.js';
|
|
9
10
|
// ── Shared helpers for plugins ─────────────────────────────────────────────
|
|
10
11
|
/** Resolve showActivities for a single instance (instance overrides default). */
|
|
11
12
|
export function resolveShowActivities(inst) {
|
|
@@ -49,6 +50,7 @@ export class ChannelLoader {
|
|
|
49
50
|
* AUN is always created implicitly from agent.aid (no explicit entry required).
|
|
50
51
|
*/
|
|
51
52
|
async createForAgent(agent) {
|
|
53
|
+
assertAgentAidAvailable(agent.aid);
|
|
52
54
|
const ctx = {
|
|
53
55
|
agentName: agent.aid,
|
|
54
56
|
defaultProjectPath: agent.config.projects?.defaultPath ?? process.cwd(),
|