@zq-silk/yui 0.15.7 → 0.15.8
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/ARCHITECTURE.md +192 -399
- package/README.md +127 -1149
- package/dist/agent/adapterCatalog.js +15 -2
- package/dist/agent/agent.js +23 -3
- package/dist/agent/argumentPolicy.js +7 -1
- package/dist/agent/connectionPlan.js +62 -0
- package/dist/agent/executionComponents.js +158 -0
- package/dist/agent/launchEnvironment.js +31 -3
- package/dist/agent/managedRuntimeEnvironment.js +3 -5
- package/dist/{turn/turn.js → agentRun/agentRun.js} +166 -109
- package/dist/{turn/turnIdentity.js → agentRun/runIdentity.js} +4 -4
- package/dist/brief/taskBrief.js +12 -0
- package/dist/cli/agentConfigurationPicker.js +13 -0
- package/dist/cli/commandCatalog.js +157 -70
- package/dist/cli/interactionCandidates.js +5 -5
- package/dist/cli/interactionPolicy.js +38 -8
- package/dist/cli/invocationRouter.js +1 -1
- package/dist/cli/managedDiagnostics.js +28 -0
- package/dist/cli/operatorWizard.js +1 -7
- package/dist/cli/roleOptionOrder.js +27 -0
- package/dist/cli/roleWizard.js +50 -14
- package/dist/cli/updateOrchestrator.js +1 -1
- package/dist/cli/updatePorts.js +3 -4
- package/dist/cli.js +178 -95
- package/dist/commands/agentCommands.js +72 -14
- package/dist/commands/capabilityCommands.js +9 -6
- package/dist/commands/configCommands.js +20 -20
- package/dist/commands/deliveryGuardPreflight.js +2 -2
- package/dist/commands/executionAuditCommands.js +24 -24
- package/dist/commands/globalRoleCommands.js +1 -1
- package/dist/commands/grantCommands.js +4 -4
- package/dist/commands/operatorCommands.js +1 -7
- package/dist/commands/projectCommands.js +4 -4
- package/dist/commands/resourcesCommands.js +2 -2
- package/dist/commands/roleConfiguration.js +25 -5
- package/dist/commands/roleRuntimeGuard.js +4 -5
- package/dist/commands/sessionCommands.js +3 -7
- package/dist/commands/taskActivationCommands.js +259 -0
- package/dist/commands/taskActor.js +28 -49
- package/dist/commands/taskCommands.js +1188 -710
- package/dist/commands/taskContextCommand.js +39 -583
- package/dist/commands/taskExecutionCommands.js +32 -32
- package/dist/commands/taskInputCommands.js +40 -104
- package/dist/commands/taskIntegrationCommands.js +3 -2
- package/dist/commands/taskIntegrationQueueCommands.js +1 -1
- package/dist/commands/taskNextActionCommand.js +8 -8
- package/dist/commands/taskOverviewCommand.js +33 -45
- package/dist/commands/taskRemoteDeliveryCommand.js +2 -2
- package/dist/commands/taskRoleRuntimeStatus.js +133 -102
- package/dist/commands/telemetryCommands.js +36 -38
- package/dist/config/configCatalog.js +4 -4
- package/dist/config/yuiConfig.js +8 -8
- package/dist/context/contextSnapshot.js +10 -10
- package/dist/context/dispatchContext.js +11 -11
- package/dist/context/roleSessionContext.js +6 -3
- package/dist/context/{turnContextPack.js → runContextPack.js} +146 -81
- package/dist/context/{turnInputContract.js → runInputContract.js} +73 -60
- package/dist/context/sessionBootstrapManifest.js +21 -2
- package/dist/context/sourceRunContext.js +30 -0
- package/dist/context/taskContext.js +458 -0
- package/dist/context/wakeNotification.js +27 -27
- package/dist/controller/agentRuntimeObserver.js +21 -24
- package/dist/controller/capabilityBridge.js +17 -6
- package/dist/controller/clientRuntime.js +65 -92
- package/dist/controller/controller.js +114 -188
- package/dist/controller/fileSchedulerStoreAdapter.js +787 -887
- package/dist/controller/jobControl.js +54 -85
- package/dist/controller/resourceInventory.js +8 -27
- package/dist/controller/resourceInventoryLinux.js +12 -13
- package/dist/controller/runtime.js +529 -479
- package/dist/controller/runtimeEventInbox.js +55 -25
- package/dist/controller/runtimeEventProcessor.js +22 -31
- package/dist/controller/{runtimeHookTurnFence.js → runtimeHookRunFence.js} +91 -115
- package/dist/controller/runtimeLaunchCoordinator.js +80 -426
- package/dist/controller/runtimeObservationHook.js +14 -18
- package/dist/controller/sessionNotify.js +16 -24
- package/dist/controller/sessionOwnerReconciliation.js +168 -50
- package/dist/controller/structuredProviderObservation.js +138 -99
- package/dist/coordination/workMailbox.js +3 -3
- package/dist/coordination/workMailboxQueue.js +36 -33
- package/dist/core/boundedRpc.js +8 -1
- package/dist/core/controllerClient.js +20 -1
- package/dist/core/controllerServer.js +4 -4
- package/dist/doctor/doctor.js +13 -2
- package/dist/domain/agentResultTransport.js +9 -9
- package/dist/execution/codexThreadNaming.js +2 -8
- package/dist/execution/executionHealth.js +51 -63
- package/dist/execution/reviewMainRun.js +137 -0
- package/dist/execution/workItemExecution.js +28 -29
- package/dist/execution/workItemExecutionProjection.js +99 -107
- package/dist/execution/workItemMainRun.js +141 -0
- package/dist/executor/agentAdapter.js +227 -20
- package/dist/executor/agentConfigurationCatalog.js +126 -4
- package/dist/executor/agentConfigurationProbe.js +162 -4
- package/dist/executor/agentExecutor.js +79 -78
- package/dist/executor/effectiveLaunch.js +105 -18
- package/dist/executor/executorRegistry.js +29 -44
- package/dist/executor/fileRoleLaunchPlanner.js +229 -154
- package/dist/executor/workspacePreflightClassification.js +16 -16
- package/dist/grant/capabilityGrant.js +6 -3
- package/dist/input/inputRequest.js +12 -10
- package/dist/integration/gitIntegrationService.js +4 -11
- package/dist/integration/integrationQueueService.js +4 -4
- package/dist/interaction/operatorPresentation.js +1 -1
- package/dist/kernel/builtinCapabilities.js +247 -12
- package/dist/kernel/capabilityRegistry.js +64 -18
- package/dist/kernel/instanceHost.js +12 -1
- package/dist/kernel/kernelPorts.js +2 -2
- package/dist/lifecycle/canonicalLifecycleEvent.js +44 -49
- package/dist/lifecycle/exactRunTerminalization.js +449 -0
- package/dist/message/message.js +62 -6
- package/dist/message/messageContinuation.js +204 -0
- package/dist/observability/executionAudit.js +70 -72
- package/dist/observability/faultClassification.js +2 -2
- package/dist/observability/orchestrationMetrics.js +8 -8
- package/dist/operator/operatorSessionHistory.js +1 -7
- package/dist/output/agentConfigurationPresentation.js +8 -3
- package/dist/output/agentRunConfigurationPresentation.js +128 -0
- package/dist/output/rolePresentation.js +54 -3
- package/dist/plugins/pluginChild.js +104 -0
- package/dist/plugins/pluginIntent.js +26 -0
- package/dist/plugins/pluginInterpreter.js +43 -0
- package/dist/plugins/pluginPackage.js +101 -0
- package/dist/plugins/pluginProcess.js +112 -0
- package/dist/plugins/pluginService.js +380 -0
- package/dist/profile/agentProfile.js +1 -1
- package/dist/repository/gitWorkspace.js +26 -4
- package/dist/repository/project.js +19 -4
- package/dist/repository/taskBaseFreshness.js +13 -13
- package/dist/repository/taskWorkspaceCoordinator.js +20 -27
- package/dist/repository/taskWorkspacePreparer.js +344 -83
- package/dist/resources/autoResourceGc.js +3 -3
- package/dist/resources/liveReferences.js +3 -3
- package/dist/resources/projectResource.js +123 -0
- package/dist/resources/projectResourceService.js +421 -0
- package/dist/resources/resourceDiscovery.js +6 -6
- package/dist/resources/resourceGc.js +1 -1
- package/dist/resources/resourceRegistrar.js +1 -1
- package/dist/resources/resourceTypes.js +1 -1
- package/dist/review/deltaRecheck.js +3 -3
- package/dist/review/reviewAcceptance.js +16 -16
- package/dist/review/reviewDecision.js +7 -7
- package/dist/review/reviewRound.js +21 -20
- package/dist/review/reviewerAvailability.js +2 -2
- package/dist/role/role.js +51 -7
- package/dist/role/taskRoleUpdate.js +30 -0
- package/dist/runtime/acpProtocol.js +425 -0
- package/dist/runtime/acpSession.js +731 -0
- package/dist/runtime/acpSessionConfiguration.js +260 -0
- package/dist/runtime/agentDriver.js +30 -11
- package/dist/runtime/agentEndpoint.js +278 -0
- package/dist/runtime/agentEndpointIdentity.js +86 -0
- package/dist/runtime/agentEndpointOwnership.js +239 -0
- package/dist/runtime/agentError.js +2 -10
- package/dist/runtime/agentHost.js +565 -314
- package/dist/runtime/agentRunConfiguration.js +258 -0
- package/dist/runtime/builtinAgentDrivers.js +134 -18
- package/dist/runtime/builtinAgentErrorMappers.js +55 -3
- package/dist/runtime/builtinTranscriptUsage.js +1 -1
- package/dist/runtime/claude-process-owner +0 -0
- package/dist/runtime/codexAppServerRuntime.js +38 -30
- package/dist/runtime/codexInteractiveHost.js +41 -6
- package/dist/runtime/continuationManager.js +2 -6
- package/dist/runtime/executionEnvironment.js +30 -0
- package/dist/runtime/firstProgressAdvisory.js +11 -11
- package/dist/runtime/index.js +4 -3
- package/dist/runtime/jsonLineChannel.js +109 -0
- package/dist/runtime/launchBroker.js +91 -16
- package/dist/runtime/launchDiagnostics.js +2 -2
- package/dist/runtime/lifecycleReservation.js +10 -18
- package/dist/runtime/managedCaller.js +61 -17
- package/dist/runtime/nativeSessionControl.js +102 -0
- package/dist/runtime/ports.js +6 -21
- package/dist/runtime/processExitObservation.js +8 -7
- package/dist/runtime/promptEnvelope.js +17 -6
- package/dist/runtime/providerContinuation.js +3 -9
- package/dist/runtime/providerContinuationReconciliationService.js +4 -13
- package/dist/runtime/providerControl.js +2 -7
- package/dist/runtime/providerRuntimeIdentity.js +110 -222
- package/dist/runtime/providerRuntimeReconciler.js +5 -9
- package/dist/runtime/runtimeBinding.js +0 -1
- package/dist/runtime/runtimeContinuationProjection.js +4 -7
- package/dist/runtime/runtimeDeadlines.js +9 -0
- package/dist/runtime/runtimeHealthPolicy.js +1 -1
- package/dist/runtime/runtimeObservation.js +29 -65
- package/dist/runtime/runtimeProjection.js +43 -51
- package/dist/runtime/runtimeSessionCandidate.js +1 -3
- package/dist/runtime/sessionLaunchRequest.js +3 -7
- package/dist/runtime/sessionOwnerIdentity.js +7 -54
- package/dist/runtime/sessionOwnerRegistry.js +22 -17
- package/dist/runtime/sessionReconciliation.js +4 -8
- package/dist/runtime/sessionTerminationGuard.js +70 -259
- package/dist/runtime/sessionTokenMetrics.js +5 -16
- package/dist/runtime/structuredProviderHost.js +237 -117
- package/dist/runtime/taskRuntimeIsolation.js +39 -122
- package/dist/runtime/tmuxAdapters.js +39 -86
- package/dist/scheduler/activeRoleRunDelivery.js +354 -0
- package/dist/scheduler/leaderWakeupProcessor.js +75 -266
- package/dist/scheduler/operatorInputNotificationProcessor.js +1 -1
- package/dist/scheduler/ports.js +80 -9
- package/dist/scheduler/{roleTurnLiveness.js → roleRunLiveness.js} +26 -30
- package/dist/scheduler/{roleTurnStall.js → roleRunStall.js} +128 -139
- package/dist/scheduler/taskExecutionProjection.js +120 -124
- package/dist/scheduler/taskObservabilityProjection.js +29 -29
- package/dist/scheduler/taskWake.js +11 -4
- package/dist/scheduler/wakeReason.js +9 -1
- package/dist/setup/setupCommand.js +1 -0
- package/dist/storage/migrations/agentRunContract.js +159 -0
- package/dist/storage/migrations/removeRuntimeGeneration.js +207 -0
- package/dist/storage/sqliteSchema.js +431 -5
- package/dist/storage/sqliteStore.js +375 -220
- package/dist/storage/storageVersions.js +1 -1
- package/dist/storage/storeRpc.js +10 -5
- package/dist/storage/taskStore.js +13 -11
- package/dist/storage/upgrade/upgradeOrchestrator.js +5 -7
- package/dist/surface/surfaceContributions.js +102 -0
- package/dist/task/completionReadiness.js +32 -6
- package/dist/task/deliveryGuard.js +16 -16
- package/dist/task/draftPlan.js +72 -12
- package/dist/task/nextAction.js +144 -128
- package/dist/task/remoteDelivery.js +6 -6
- package/dist/task/task.js +184 -18
- package/dist/task/taskActivation.js +301 -0
- package/dist/task/taskActivationService.js +392 -0
- package/dist/task/taskRecordReference.js +5 -4
- package/dist/task/taskRecordRetirement.js +1 -1
- package/dist/telemetry/sqliteTelemetryStore.js +55 -68
- package/dist/telemetry/telemetryConfig.js +14 -14
- package/dist/telemetry/telemetryWiring.js +2 -2
- package/dist/web/assets/assetManifest.js +2 -0
- package/dist/web/assets/client/app.js +120 -20
- package/dist/web/assets/client/components.js +87 -54
- package/dist/web/assets/client/i18n.js +83 -41
- package/dist/web/assets/client/markdown.js +1 -1
- package/dist/web/assets/client/taskSurface.js +353 -0
- package/dist/web/assets/client/view.js +49 -44
- package/dist/web/assets/shell.js +1 -1
- package/dist/web/assets/styles/cards.js +22 -4
- package/dist/web/controllerWeb.js +60 -0
- package/dist/web/webMutation.js +28 -0
- package/dist/web/webServer.js +118 -8
- package/dist/web/webSnapshot.js +81 -74
- package/dist/web/webTaskSurface.js +64 -0
- package/dist/workItem/dependencyGate.js +1 -1
- package/dist/workItem/workItem.js +80 -48
- package/dist/workspace/workItemChangeSetManager.js +16 -9
- package/docs/agent-result-consumption.md +94 -0
- package/docs/agent-runtime-drivers.md +91 -0
- package/docs/architecture/README.md +38 -0
- package/docs/architecture/capabilities-and-resources.md +79 -0
- package/docs/managed-turn-and-session-runtime.md +222 -0
- package/docs/observability/README.md +81 -0
- package/docs/plugin-sdk.md +290 -0
- package/docs/provider-runtime.md +163 -0
- package/docs/release-workflow.md +303 -0
- package/docs/roles-and-configuration.md +113 -0
- package/docs/sqlite-control-plane-design.md +76 -0
- package/docs/task-dag-semantics.md +57 -0
- package/docs/task-delivery.md +103 -0
- package/docs/task-local-identity.md +6 -6
- package/docs/testing/verification-levels.md +86 -0
- package/i18n/README.zh-CN.md +98 -739
- package/package.json +2 -2
- package/skills/yui-leader/SKILL.md +130 -103
- package/skills/yui-leader/references/integration.md +39 -0
- package/skills/yui-leader/references/replicated-execution.md +42 -0
- package/skills/yui-leader/references/task-plugins.md +33 -0
- package/skills/yui-operator/SKILL.md +30 -59
- package/skills/yui-reviewer/SKILL.md +35 -36
- package/skills/yui-runtime/SKILL.md +88 -24
- package/skills/yui-runtime/references/publication.md +22 -0
- package/skills/yui-runtime/references/recovery.md +64 -0
- package/skills/yui-worker/SKILL.md +37 -39
- package/dist/cli/roleOptionCatalog.js +0 -68
- package/dist/context/sourceTurnContext.js +0 -30
- package/dist/execution/reviewMainTurn.js +0 -161
- package/dist/execution/workItemMainTurn.js +0 -164
- package/dist/lifecycle/exactTurnTerminalization.js +0 -407
- package/dist/runtime/preallocatedNativeSession.js +0 -13
- package/dist/runtime/runtimeStopReceipt.js +0 -42
- package/dist/scheduler/activeRoleTurnDelivery.js +0 -315
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Read/repair routing, not an alternative grant. Callers still prove their
|
|
2
|
+
* Home and Role identity; writes still require current Session authority. */
|
|
3
|
+
export function taskDiagnosticTarget(args) {
|
|
4
|
+
if (args[0] !== "task")
|
|
5
|
+
return undefined;
|
|
6
|
+
if (["show", "context", "next-action"].includes(args[1] ?? "")) {
|
|
7
|
+
return args[1] === "context" && ["inspect", "delta"].includes(args[2] ?? "")
|
|
8
|
+
? args[3] : args[2];
|
|
9
|
+
}
|
|
10
|
+
if (args[1] === "role" && ["list", "status", "show"].includes(args[2] ?? ""))
|
|
11
|
+
return args[3];
|
|
12
|
+
if (args[1] === "role" && args[2] === "session" && args[3] === "inspect")
|
|
13
|
+
return args[4];
|
|
14
|
+
if (["message", "run", "wake", "input"].includes(args[1] ?? "")
|
|
15
|
+
&& ["list", "show"].includes(args[2] ?? ""))
|
|
16
|
+
return args[3]?.split("/")[0];
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
export function operatorOfflineCommand(args) {
|
|
20
|
+
return (args[0] === "controller"
|
|
21
|
+
&& ["status", "identity", "live-identity", "stop", "restart"].includes(args[1] ?? ""))
|
|
22
|
+
|| args[0] === "doctor"
|
|
23
|
+
|| (args[0] === "execution" && args[1] === "audit")
|
|
24
|
+
|| (args[0] === "operator" && ["status", "list"].includes(args[1] ?? ""))
|
|
25
|
+
|| (args[0] === "session" && ["context", "reconcile"].includes(args[1] ?? ""))
|
|
26
|
+
|| (args[0] === "task" && args[1] === "list")
|
|
27
|
+
|| taskDiagnosticTarget(args) !== undefined;
|
|
28
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { agentAdapterLabel as adapterLabel } from "../agent/adapterCatalog.js";
|
|
1
2
|
import { renderTable } from "../output/table.js";
|
|
2
3
|
import { formatRelativeTimestamp } from "../output/timePresentation.js";
|
|
3
4
|
export async function resolveOperatorWizardArguments(commandArgs, role, sessions, io, now = new Date()) {
|
|
@@ -68,10 +69,3 @@ async function choose(title, choices, columns, io, defaultValue, label) {
|
|
|
68
69
|
}
|
|
69
70
|
return choices.find((choice) => choice.value === answer)?.value;
|
|
70
71
|
}
|
|
71
|
-
function adapterLabel(adapterId) {
|
|
72
|
-
return adapterId === "codex"
|
|
73
|
-
? "Codex"
|
|
74
|
-
: adapterId === "claude"
|
|
75
|
-
? "Claude"
|
|
76
|
-
: adapterId;
|
|
77
|
-
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ordering for interactive Role pickers.
|
|
3
|
+
*
|
|
4
|
+
* Operator and Leader come first because they are the Roles a user reaches for
|
|
5
|
+
* most often in a Task; everything else is alphabetical. This is presentation
|
|
6
|
+
* order only and carries no authority over Role configuration.
|
|
7
|
+
*/
|
|
8
|
+
export function orderRoleOptions(roles) {
|
|
9
|
+
return [...roles].sort((left, right) => {
|
|
10
|
+
const rank = roleRank(left) - roleRank(right);
|
|
11
|
+
if (rank !== 0)
|
|
12
|
+
return rank;
|
|
13
|
+
return roleName(left).localeCompare(roleName(right));
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function roleRank(role) {
|
|
17
|
+
const kind = role.kind?.toLowerCase();
|
|
18
|
+
const name = roleName(role).toLowerCase();
|
|
19
|
+
if (kind === "operator" || name === "operator")
|
|
20
|
+
return 0;
|
|
21
|
+
if (kind === "leader" || name === "leader")
|
|
22
|
+
return 1;
|
|
23
|
+
return 2;
|
|
24
|
+
}
|
|
25
|
+
function roleName(role) {
|
|
26
|
+
return role.name ?? role.id ?? "";
|
|
27
|
+
}
|
package/dist/cli/roleWizard.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { renderTable } from "../output/table.js";
|
|
2
|
+
import { displayExecutionComponent } from "../agent/executionComponents.js";
|
|
3
|
+
import { isAgentAdapterId } from "../agent/adapterCatalog.js";
|
|
4
|
+
import { defaultRoleAgentConfig } from "../executor/agentAdapter.js";
|
|
2
5
|
import { selectAgentEffort, selectAgentModelAndEffort } from "./agentConfigurationPicker.js";
|
|
3
6
|
const TEXT_COLUMN = { header: "Selection", minWidth: 12, maxWidth: 34 };
|
|
4
7
|
export async function resolveRoleWizardArguments(commandArgs, ports, io) {
|
|
@@ -190,10 +193,18 @@ async function configureNewAgentField(args, agent, ports, io) {
|
|
|
190
193
|
const binding = {
|
|
191
194
|
agentId: agent.id,
|
|
192
195
|
adapterId: agent.adapterId,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
196
|
+
component: agent.component,
|
|
197
|
+
// A probe binding used only to fetch this Agent's capability catalog, before
|
|
198
|
+
// the user has chosen anything. It carries the adapter's own default
|
|
199
|
+
// permission rather than a fixed `bypass`: the user has stated no permission
|
|
200
|
+
// preference at this point, and inventing an elevated one here produced a
|
|
201
|
+
// config ACP's own validator rejects. The catalog does not depend on this
|
|
202
|
+
// value, so the honest default costs nothing. An adapter this build does not
|
|
203
|
+
// know cannot have a default resolved, so it keeps the bare plan and lets
|
|
204
|
+
// the capability port report the problem.
|
|
205
|
+
config: isAgentAdapterId(agent.adapterId)
|
|
206
|
+
? defaultRoleAgentConfig(agent.adapterId)
|
|
207
|
+
: { adapterId: agent.adapterId }
|
|
197
208
|
};
|
|
198
209
|
const resolved = await loadAgentCatalog(ports, binding);
|
|
199
210
|
const fields = agentFields(binding, resolved?.catalog);
|
|
@@ -329,10 +340,10 @@ async function updateAgentSettings(args, role, ports, io) {
|
|
|
329
340
|
const bindings = Object.values(role.agentBindings);
|
|
330
341
|
const selectedId = await choose("Select Role Agent binding", bindings.map((binding) => ({
|
|
331
342
|
value: binding.agentId,
|
|
332
|
-
cells: [binding.agentId, binding.
|
|
343
|
+
cells: [binding.agentId, binding.component, binding.agentId === role.activeAgentId ? "active" : "bound"]
|
|
333
344
|
})), [
|
|
334
345
|
{ header: "Agent", minWidth: 5, maxWidth: 24 },
|
|
335
|
-
{ header: "
|
|
346
|
+
{ header: "Component", minWidth: 9, maxWidth: 18 },
|
|
336
347
|
{ header: "State", minWidth: 6, maxWidth: 8 }
|
|
337
348
|
], io, role.activeAgentId, "binding");
|
|
338
349
|
if (selectedId === undefined)
|
|
@@ -449,7 +460,8 @@ function agentFields(binding, catalog) {
|
|
|
449
460
|
...catalogChoices(catalog, "search", ["true"])
|
|
450
461
|
])
|
|
451
462
|
] : []),
|
|
452
|
-
...(binding.adapterId === "claude"
|
|
463
|
+
...((binding.adapterId === "claude" || binding.adapterId === "acp")
|
|
464
|
+
&& permission.strategy === "configured" ? [
|
|
453
465
|
agentField("permission-mode", "Permission mode", permission.mode, "--permission-mode", ["--permission-strategy", "default"], catalogChoices(catalog, "permission.mode"))
|
|
454
466
|
] : [])
|
|
455
467
|
];
|
|
@@ -507,6 +519,17 @@ async function configuredPermissionArgs(binding, catalog, strategy, io) {
|
|
|
507
519
|
? undefined
|
|
508
520
|
: ["--permission-strategy", "configured", option, value];
|
|
509
521
|
}
|
|
522
|
+
if (binding.adapterId === "acp") {
|
|
523
|
+
// An ACP Session's configured permission is one mode the Agent enumerated,
|
|
524
|
+
// so there is nothing to choose between: ask for the mode directly rather
|
|
525
|
+
// than offering tool rules the protocol has no place for. The choices come
|
|
526
|
+
// from the capability catalog, so a Session that offers no modes presents
|
|
527
|
+
// none instead of inviting a value the Agent would reject.
|
|
528
|
+
const value = await promptAgentFieldValue(agentField("permission-mode", "Permission mode", undefined, "--permission-mode", ["--permission-strategy", "default"], catalogChoices(catalog, "permission.mode")), io);
|
|
529
|
+
return value === undefined || value.length === 0
|
|
530
|
+
? undefined
|
|
531
|
+
: ["--permission-strategy", "configured", "--permission-mode", value];
|
|
532
|
+
}
|
|
510
533
|
const field = await choose("Native permission option", [
|
|
511
534
|
{ value: "mode", cells: ["Permission mode"] },
|
|
512
535
|
{ value: "allowed", cells: ["Allowed tool"] },
|
|
@@ -534,19 +557,23 @@ async function selectActiveAgent(role, ports, io) {
|
|
|
534
557
|
const byId = new Map(configured.map((agent) => [agent.id, agent]));
|
|
535
558
|
for (const binding of Object.values(role.agentBindings)) {
|
|
536
559
|
if (!byId.has(binding.agentId)) {
|
|
537
|
-
byId.set(binding.agentId, {
|
|
560
|
+
byId.set(binding.agentId, {
|
|
561
|
+
id: binding.agentId,
|
|
562
|
+
adapterId: binding.adapterId,
|
|
563
|
+
component: binding.component
|
|
564
|
+
});
|
|
538
565
|
}
|
|
539
566
|
}
|
|
540
567
|
return choose("Select Active Agent", [...byId.values()].map((agent) => ({
|
|
541
568
|
value: agent.id,
|
|
542
569
|
cells: [
|
|
543
570
|
agent.id,
|
|
544
|
-
agent.
|
|
571
|
+
agent.component,
|
|
545
572
|
agent.id === role.activeAgentId ? "active" : role.agentBindings[agent.id] === undefined ? "new" : "bound"
|
|
546
573
|
]
|
|
547
574
|
})), [
|
|
548
575
|
{ header: "Agent", minWidth: 5, maxWidth: 24 },
|
|
549
|
-
{ header: "
|
|
576
|
+
{ header: "Component", minWidth: 9, maxWidth: 18 },
|
|
550
577
|
{ header: "State", minWidth: 5, maxWidth: 8 }
|
|
551
578
|
], io, role.activeAgentId, "Agent");
|
|
552
579
|
}
|
|
@@ -554,10 +581,10 @@ async function selectConfiguredAgent(ports, io, title, loaded) {
|
|
|
554
581
|
const selection = loaded ?? await loadAgentSelection(ports);
|
|
555
582
|
return choose(title, selection.agents.map((agent) => ({
|
|
556
583
|
value: agent.id,
|
|
557
|
-
cells: [agent.id, agent.
|
|
584
|
+
cells: [agent.id, agent.component, agent.id === selection.defaultAgent ? "yes" : ""]
|
|
558
585
|
})), [
|
|
559
586
|
{ header: "Agent", minWidth: 5, maxWidth: 24 },
|
|
560
|
-
{ header: "
|
|
587
|
+
{ header: "Component", minWidth: 9, maxWidth: 18 },
|
|
561
588
|
{ header: "Default", minWidth: 7, maxWidth: 7 }
|
|
562
589
|
], io, selection.defaultAgent, "Agent");
|
|
563
590
|
}
|
|
@@ -583,7 +610,11 @@ async function configuredAgents(ports) {
|
|
|
583
610
|
const input = entity(candidate);
|
|
584
611
|
const id = stringField(input, "id");
|
|
585
612
|
const adapterId = stringField(input, "adapterId");
|
|
586
|
-
return id === undefined || adapterId === undefined ? [] : [{
|
|
613
|
+
return id === undefined || adapterId === undefined ? [] : [{
|
|
614
|
+
id,
|
|
615
|
+
adapterId,
|
|
616
|
+
component: displayExecutionComponent(adapterId, stringField(input, "component"))
|
|
617
|
+
}];
|
|
587
618
|
});
|
|
588
619
|
}
|
|
589
620
|
async function choose(title, choices, columns, io, defaultValue, label) {
|
|
@@ -621,7 +652,12 @@ function asRole(value) {
|
|
|
621
652
|
const config = entity(binding?.config);
|
|
622
653
|
return agentId === undefined || adapterId === undefined || config === undefined
|
|
623
654
|
? []
|
|
624
|
-
: [[id, {
|
|
655
|
+
: [[id, {
|
|
656
|
+
agentId,
|
|
657
|
+
adapterId,
|
|
658
|
+
component: displayExecutionComponent(adapterId, stringField(binding, "component")),
|
|
659
|
+
config
|
|
660
|
+
}]];
|
|
625
661
|
}));
|
|
626
662
|
return {
|
|
627
663
|
name,
|
|
@@ -244,7 +244,7 @@ function captureControllerLifecycle(ports, version, home) {
|
|
|
244
244
|
return { lifecycle: { ensureRunning: true, wasRunning: false } };
|
|
245
245
|
}
|
|
246
246
|
if (!isPositivePid(status.pid) || !isControllerIdentity(status.identity)) {
|
|
247
|
-
return malformedControllerResult(version, "The running Controller did not expose an exact PID and runtime
|
|
247
|
+
return malformedControllerResult(version, "The running Controller did not expose an exact PID and runtime identity.");
|
|
248
248
|
}
|
|
249
249
|
let stopped;
|
|
250
250
|
try {
|
package/dist/cli/updatePorts.js
CHANGED
|
@@ -709,7 +709,7 @@ function assertActivatedControllerIdentity(identity, activatedBinary, activatedV
|
|
|
709
709
|
if (identity.executablePath !== process.execPath
|
|
710
710
|
|| identity.args.length !== 1
|
|
711
711
|
|| identity.args[0] !== expectedEntrypoint) {
|
|
712
|
-
throw new Error("Replacement Controller runtime
|
|
712
|
+
throw new Error("Replacement Controller runtime identity does not match the activated global binary "
|
|
713
713
|
+ "runtime/entrypoint; refusing readiness.");
|
|
714
714
|
}
|
|
715
715
|
}
|
|
@@ -872,18 +872,17 @@ function parseUpdateBlockers(value) {
|
|
|
872
872
|
if (!isRecord(item) || typeof item.reason !== "string" || item.reason.length === 0) {
|
|
873
873
|
return undefined;
|
|
874
874
|
}
|
|
875
|
-
const optional = ["taskId", "roleName", "
|
|
875
|
+
const optional = ["taskId", "roleName", "runId", "nativeSessionId"];
|
|
876
876
|
if (optional.some((key) => item[key] !== undefined && typeof item[key] !== "string")) {
|
|
877
877
|
return undefined;
|
|
878
878
|
}
|
|
879
879
|
parsed.push({
|
|
880
880
|
...(typeof item.taskId === "string" ? { taskId: item.taskId } : {}),
|
|
881
881
|
...(typeof item.roleName === "string" ? { roleName: item.roleName } : {}),
|
|
882
|
-
...(typeof item.
|
|
882
|
+
...(typeof item.runId === "string" ? { runId: item.runId } : {}),
|
|
883
883
|
...(typeof item.nativeSessionId === "string"
|
|
884
884
|
? { nativeSessionId: item.nativeSessionId }
|
|
885
885
|
: {}),
|
|
886
|
-
...(typeof item.runtimeGenerationId === "string" ? { runtimeGenerationId: item.runtimeGenerationId } : {}),
|
|
887
886
|
reason: item.reason
|
|
888
887
|
});
|
|
889
888
|
}
|