@zq-silk/yui 0.15.12 → 0.16.0
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 +3 -2
- package/ARCHITECTURE.zh-CN.md +3 -2
- package/dist/artifacts/artifactCommitLock.js +16 -55
- package/dist/artifacts/taskArtifactRepository.js +3 -3
- package/dist/cli/agentConfigurationPicker.js +1 -1
- package/dist/cli/commandCatalog.js +57 -41
- package/dist/cli/completion.js +18 -18
- package/dist/cli/completionWizard.js +1 -1
- package/dist/cli/dynamicCompletion.js +1 -1
- package/dist/cli/interactionPolicy.js +7 -3
- package/dist/cli/invocationAuthority.js +64 -0
- package/dist/cli/managedDiagnostics.js +1 -1
- package/dist/cli/parseRepeatable.js +35 -0
- package/dist/cli/updatePorts.js +26 -5
- package/dist/cli.js +1280 -1243
- package/dist/commands/agentCommands.js +4 -4
- package/dist/commands/capabilityCommands.js +1 -1
- package/dist/commands/configCommands.js +6 -57
- package/dist/commands/configOverview.js +2 -2
- package/dist/commands/durableJobCommands.js +12 -6
- package/dist/commands/globalRoleCommands.js +53 -29
- package/dist/commands/grantCommands.js +0 -3
- package/dist/commands/jobCommands.js +1 -4
- package/dist/commands/operatorCommands.js +3 -3
- package/dist/commands/projectCommands.js +1 -10
- package/dist/commands/resourcesCommands.js +10 -40
- package/dist/commands/roleConfiguration.js +2 -6
- package/dist/commands/taskActivationCommands.js +4 -8
- package/dist/commands/taskAgentCapabilities.js +9 -0
- package/dist/commands/taskCommandSupport.js +155 -0
- package/dist/commands/taskCommandTypes.js +1 -0
- package/dist/commands/taskCommands.js +271 -710
- package/dist/commands/taskCompletionGate.js +1 -1
- package/dist/commands/taskExecutionCommands.js +1 -1
- package/dist/commands/taskFactCommands.js +325 -0
- package/dist/commands/taskInputCommands.js +12 -42
- package/dist/commands/taskIntegrationCommands.js +17 -57
- package/dist/commands/taskNextActionCommand.js +7 -6
- package/dist/commands/taskPublicationAdoptCommand.js +3 -3
- package/dist/commands/taskPublicationCommands.js +1 -1
- package/dist/commands/taskPublicationVerifyCommand.js +1 -1
- package/dist/commands/taskRemoteDeliveryCommand.js +2 -94
- package/dist/commands/taskUpstreamCommands.js +19 -8
- package/dist/commands/workflowCommands.js +6 -1
- package/dist/completion/completionInstaller.js +26 -26
- package/dist/completion/completionState.js +26 -26
- package/dist/completion/fileCompletionManager.js +6 -11
- package/dist/config/configCatalog.js +0 -2
- package/dist/config/timeZone.js +14 -0
- package/dist/config/yuiConfig.js +0 -29
- package/dist/context/runContextPack.js +2 -3
- package/dist/context/taskCatalog.js +3 -5
- package/dist/context/taskContext.js +139 -151
- package/dist/context/wakeRunReferences.js +11 -0
- package/dist/controller/agentCapabilities.js +58 -0
- package/dist/controller/agentRuntimeObserver.js +6 -11
- package/dist/controller/clientRuntime.js +22 -14
- package/dist/controller/controller.js +9 -22
- package/dist/controller/fileSchedulerStoreAdapter.js +117 -212
- package/dist/controller/jobClient.js +4 -4
- package/dist/controller/jobControl.js +60 -25
- package/dist/controller/jobSupervisor.js +4 -4
- package/dist/controller/providerRetryDelivery.js +7 -7
- package/dist/controller/runtime.js +51 -44
- package/dist/controller/runtimeEventProcessor.js +0 -5
- package/dist/controller/sessionOwnerReconciliation.js +5 -0
- package/dist/controller/taskAgentError.js +35 -0
- package/dist/coordination/workMailboxQueue.js +2 -24
- package/dist/core/controllerClient.js +2 -2
- package/dist/core/fileLockOwner.js +74 -0
- package/dist/decision/decision.js +17 -0
- package/dist/doctor/doctor.js +18 -9
- package/dist/event/taskEvent.js +12 -0
- package/dist/execution/workItemExecutionProjection.js +2 -2
- package/dist/executor/agentCapabilityConfig.js +43 -0
- package/dist/executor/agentConfigurationCatalog.js +49 -11
- package/dist/executor/agentExecutor.js +5 -8
- package/dist/executor/fileRoleLaunchPlanner.js +11 -53
- package/dist/executor/taskAgentCapabilities.js +64 -0
- package/dist/integration/deliveryObligation.js +1 -69
- package/dist/integration/gitIntegrationService.js +60 -84
- package/dist/integration/integrationAttempt.js +3 -14
- package/dist/integration/integrationSourceApplication.js +4 -12
- package/dist/integration/manifestTags.js +2 -2
- package/dist/job/durableJob.js +4 -25
- package/dist/job/jobAssignmentScope.js +22 -0
- package/dist/job/jobOperation.js +16 -0
- package/dist/job/jobRunner.js +2 -1
- package/dist/job/stepDirectory.js +15 -0
- package/dist/kernel/builtinCapabilities.js +15 -11
- package/dist/kernel/kernelPorts.js +1 -17
- package/dist/lifecycle/exactRunTerminalization.js +1 -9
- package/dist/message/inputControlResolution.js +3 -4
- package/dist/message/message.js +17 -20
- package/dist/message/messageContinuation.js +1 -1
- package/dist/milestone/milestone.js +11 -0
- package/dist/observability/orchestrationMetrics.js +24 -1
- package/dist/observability/runtimeIdentity.js +1 -17
- package/dist/output/agentConfigurationPresentation.js +2 -0
- package/dist/output/timePresentation.js +1 -14
- package/dist/plugins/pluginService.js +12 -4
- package/dist/release/releaseWorkflowPorts.js +45 -96
- package/dist/release/runtimeRelease.js +9 -15
- package/dist/repository/projectMaintenanceLock.js +23 -64
- package/dist/repository/taskBaseFreshness.js +1 -1
- package/dist/repository/taskWorkspaceCoordinator.js +13 -22
- package/dist/repository/taskWorkspacePreparer.js +29 -25
- package/dist/repository/workspaceCleanupInspection.js +5 -5
- package/dist/resources/autoResourceGc.js +4 -77
- package/dist/resources/liveReferences.js +7 -54
- package/dist/resources/resourceDiscovery.js +5 -118
- package/dist/resources/resourceGc.js +233 -181
- package/dist/resources/resourceRegistrar.js +5 -4
- package/dist/resources/resourceRegistry.js +3 -37
- package/dist/resources/resourceRegistryStore.js +13 -36
- package/dist/resources/sqliteResourceRegistry.js +43 -26
- package/dist/review/deltaRecheck.js +1 -1
- package/dist/review/reviewAcceptance.js +1 -1
- package/dist/review/reviewDecision.js +1 -1
- package/dist/review/reviewRound.js +8 -7
- package/dist/review/taskFinalReviewContractResolution.js +1 -1
- package/dist/runtime/acpProtocol.js +4 -51
- package/dist/runtime/acpSession.js +10 -75
- package/dist/runtime/acpSessionConfiguration.js +1 -8
- package/dist/runtime/agentEndpoint.js +3 -2
- package/dist/runtime/agentFailureContext.js +43 -0
- package/dist/runtime/agentHost.js +15 -15
- package/dist/runtime/codexInteractiveHost.js +2 -2
- package/dist/runtime/index.js +0 -1
- package/dist/runtime/managedCaller.js +21 -1
- package/dist/runtime/providerErrors.js +38 -0
- package/dist/runtime/runtimeObservation.js +0 -5
- package/dist/runtime/runtimeSessionCandidate.js +2 -3
- package/dist/runtime/sessionOwnerIdentity.js +1 -1
- package/dist/runtime/structuredProviderHost.js +4 -41
- package/dist/runtime/tmuxAdapters.js +6 -8
- package/dist/scheduler/activeRoleRunDelivery.js +7 -7
- package/dist/scheduler/leaderWakeupProcessor.js +19 -6
- package/dist/scheduler/operatorEvent.js +12 -20
- package/dist/scheduler/operatorInputNotificationProcessor.js +1 -1
- package/dist/scheduler/ports.js +5 -8
- package/dist/scheduler/roleRunLiveness.js +4 -4
- package/dist/scheduler/roleRunStall.js +16 -23
- package/dist/scheduler/taskExecutionProjection.js +25 -33
- package/dist/scheduler/taskObservabilityProjection.js +0 -1
- package/dist/scheduler/taskWake.js +5 -10
- package/dist/scheduler/wakeReason.js +2 -0
- package/dist/scheduler/wakeupQueue.js +2 -4
- package/dist/setup/setupCommand.js +1 -1
- package/dist/storage/contextRecords.js +106 -0
- package/dist/storage/currentTaskStore.js +1 -1
- package/dist/storage/homeLayout.js +13 -17
- package/dist/storage/migrations/agentFailureContext.js +22 -0
- package/dist/storage/migrations/currentInputContract.js +86 -0
- package/dist/storage/migrations/currentRuntimeContract.js +228 -0
- package/dist/storage/migrations/historicalVerificationPlan.js +35 -0
- package/dist/storage/migrations/integrationContinuation.js +5 -4
- package/dist/storage/migrations/narrowAgentFailureContext.js +65 -0
- package/dist/storage/migrations/notificationOnlyWakes.js +74 -0
- package/dist/storage/migrations/verificationPlanV1.js +162 -0
- package/dist/storage/migrations/verificationPolicy.js +74 -0
- package/dist/storage/migrations/workItemHistory.js +46 -0
- package/dist/storage/persistenceWorker.js +12 -4
- package/dist/storage/recordValidation.js +87 -0
- package/dist/storage/sqliteSchema.js +142 -1
- package/dist/storage/sqliteStore.js +156 -162
- package/dist/storage/storageSchema.js +2 -14
- package/dist/storage/storageVersions.js +1 -1
- package/dist/storage/storeRpc.js +15 -7
- package/dist/storage/taskStore.js +3 -7
- package/dist/storage/upgrade/upgradeOrchestrator.js +25 -37
- package/dist/task/completionReadiness.js +5 -24
- package/dist/task/draftPlan.js +0 -53
- package/dist/task/nextAction.js +7 -13
- package/dist/task/remoteDeliveryService.js +89 -0
- package/dist/task/taskActivation.js +2 -25
- package/dist/task/taskActivationService.js +0 -2
- package/dist/task/taskRecordReference.js +0 -1
- package/dist/task/taskSubmission.js +3 -14
- package/dist/telemetry/sqliteTelemetryBatch.js +29 -0
- package/dist/telemetry/sqliteTelemetryStore.js +49 -49
- package/dist/telemetry/telemetryWiring.js +4 -3
- package/dist/tmux/tmuxManager.js +29 -20
- package/dist/verification/gateArtifact.js +15 -24
- package/dist/verification/gateArtifactStore.js +14 -7
- package/dist/verification/verificationGateService.js +29 -88
- package/dist/verification/verificationPlan.js +27 -72
- package/dist/web/assets/client/app.js +1 -1
- package/dist/web/assets/client/taskSurface.js +4 -4
- package/dist/web/webServer.js +4 -6
- package/dist/web/webSnapshot.js +3 -83
- package/dist/web/webTaskSurface.js +17 -46
- package/dist/workItem/workItem.js +1 -12
- package/docs/architecture/capabilities-and-resources.md +14 -2
- package/docs/architecture/capabilities-and-resources.zh-CN.md +11 -1
- package/docs/managed-turn-and-session-runtime.md +83 -10
- package/docs/managed-turn-and-session-runtime.zh-CN.md +65 -11
- package/docs/plugin-sdk.md +4 -2
- package/docs/provider-runtime.md +3 -1
- package/docs/provider-runtime.zh-CN.md +4 -2
- package/docs/release-workflow.md +190 -7
- package/docs/release-workflow.zh-CN.md +139 -5
- package/docs/roles-and-configuration.md +29 -0
- package/docs/roles-and-configuration.zh-CN.md +21 -0
- package/docs/sqlite-control-plane-design.md +16 -3
- package/docs/sqlite-control-plane-design.zh-CN.md +13 -2
- package/docs/task-dag-semantics.md +3 -3
- package/docs/task-dag-semantics.zh-CN.md +2 -2
- package/docs/task-delivery.md +91 -5
- package/docs/task-delivery.zh-CN.md +72 -4
- package/docs/task-discovery.md +10 -11
- package/docs/task-discovery.zh-CN.md +8 -9
- package/docs/testing/verification-levels.md +145 -9
- package/docs/testing/verification-levels.zh-CN.md +103 -8
- package/package.json +1 -1
- package/skills/yui-leader/SKILL.md +5 -0
- package/skills/yui-leader/references/integration.md +9 -5
- package/skills/yui-leader/references/planning.md +9 -3
- package/skills/yui-operator/SKILL.md +15 -10
- package/skills/yui-runtime/SKILL.md +6 -6
- package/skills/yui-runtime/references/recovery.md +47 -0
- package/dist/agent/agentRegistry.js +0 -10
- package/dist/agentRun/runIdentity.js +0 -22
- package/dist/commands/deliveryGuardPreflight.js +0 -30
- package/dist/commands/taskIntegrationQueueCommands.js +0 -226
- package/dist/commands/taskOverviewCommand.js +0 -377
- package/dist/completion/completionWizard.js +0 -125
- package/dist/context/dispatchContext.js +0 -110
- package/dist/context/wakeNotification.js +0 -144
- package/dist/integration/integrationCheckEvidenceReuse.js +0 -53
- package/dist/integration/integrationQueueEntry.js +0 -191
- package/dist/integration/integrationQueueService.js +0 -810
- package/dist/release/fakeReleasePorts.js +0 -55
- package/dist/runtime/sessionOwnerRegistry.js +0 -137
- package/dist/task/deliveryGuard.js +0 -226
- /package/dist/{commands/taskActor.js → task/taskAuthority.js} +0 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { taskNotFound, usageError } from "../errors/cliError.js";
|
|
2
|
+
import { createTaskEvent } from "../event/taskEvent.js";
|
|
3
|
+
import { formatTimestamp } from "../output/timePresentation.js";
|
|
4
|
+
import { SYSTEM_LEADER_ROLE as LEADER_ROLE } from "../role/systemRoles.js";
|
|
5
|
+
import { currentManagedRuntime } from "../runtime/managedCaller.js";
|
|
6
|
+
import { taskLocalActor as resolveTaskLocalActor } from "../task/taskAuthority.js";
|
|
7
|
+
export function recordTaskEvent(store, taskId, type, payload, now) {
|
|
8
|
+
return recordTaskEventRecord(store, taskId, type, payload, now);
|
|
9
|
+
}
|
|
10
|
+
export function leaderActionEventPayload(store, taskId, options) {
|
|
11
|
+
const caller = currentManagedRuntime(store, options.environment, taskId, "leader");
|
|
12
|
+
// A long-lived Session may be handling direct input while another request
|
|
13
|
+
// awaits admission. The Role's active pointer cannot prove command origin.
|
|
14
|
+
return caller === undefined ? {} : { leaderNativeSessionId: caller.nativeSessionId };
|
|
15
|
+
}
|
|
16
|
+
export function recordTaskEventRecord(store, taskId, type, payload, now) {
|
|
17
|
+
const event = createTaskEvent(store.nextEventId(taskId), taskId, type, payload, now);
|
|
18
|
+
store.saveEvent(taskId, event);
|
|
19
|
+
return event;
|
|
20
|
+
}
|
|
21
|
+
export function requireTask(store, taskId) {
|
|
22
|
+
const id = requiredText(taskId, "Task id");
|
|
23
|
+
const task = store.getTask(id);
|
|
24
|
+
if (task === null)
|
|
25
|
+
throw taskNotFound(id);
|
|
26
|
+
return task;
|
|
27
|
+
}
|
|
28
|
+
export function assertTaskOpen(task) {
|
|
29
|
+
if (task.status === "completed") {
|
|
30
|
+
throw usageError(`Task ${task.id} is completed; reopen it before continuing.`);
|
|
31
|
+
}
|
|
32
|
+
if (task.status === "archived")
|
|
33
|
+
throw usageError(`Task is archived: ${task.id}.`);
|
|
34
|
+
if (task.status === "cancelled")
|
|
35
|
+
throw usageError(`Task is retired: ${task.id}.`);
|
|
36
|
+
}
|
|
37
|
+
export function taskActor(store, options, taskId) {
|
|
38
|
+
return resolveTaskLocalActor(store, options.environment, taskId);
|
|
39
|
+
}
|
|
40
|
+
export function parseMultiValueTail(args, valueOptions, repeatOptions, usage, flagOptions = new Set()) {
|
|
41
|
+
const positionals = [];
|
|
42
|
+
const options = new Map();
|
|
43
|
+
const multiOptions = new Map();
|
|
44
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
45
|
+
const value = args[index];
|
|
46
|
+
if (!value.startsWith("--")) {
|
|
47
|
+
positionals.push(value);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (!valueOptions.has(value) && !repeatOptions.has(value) && !flagOptions.has(value)) {
|
|
51
|
+
throw usageError(`Unsupported option: ${value}.`, usage);
|
|
52
|
+
}
|
|
53
|
+
if (flagOptions.has(value)) {
|
|
54
|
+
if (options.has(value))
|
|
55
|
+
throw usageError(`Option may only be specified once: ${value}.`, usage);
|
|
56
|
+
options.set(value, "");
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (repeatOptions.has(value)) {
|
|
60
|
+
const optionValue = args[index + 1];
|
|
61
|
+
if (optionValue === undefined || optionValue.startsWith("--")) {
|
|
62
|
+
throw usageError(`${value} is required.`, usage);
|
|
63
|
+
}
|
|
64
|
+
const existing = multiOptions.get(value) ?? [];
|
|
65
|
+
multiOptions.set(value, [...existing, optionValue]);
|
|
66
|
+
index += 1;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (options.has(value))
|
|
70
|
+
throw usageError(`Option may only be specified once: ${value}.`, usage);
|
|
71
|
+
const optionValue = args[index + 1];
|
|
72
|
+
if (optionValue === undefined || optionValue.startsWith("--")) {
|
|
73
|
+
throw usageError(`${value} is required.`, usage);
|
|
74
|
+
}
|
|
75
|
+
options.set(value, optionValue);
|
|
76
|
+
index += 1;
|
|
77
|
+
}
|
|
78
|
+
return { positionals, options, multiOptions };
|
|
79
|
+
}
|
|
80
|
+
export function parseTail(args, valueOptions, usage, flagOptions = new Set()) {
|
|
81
|
+
const positionals = [];
|
|
82
|
+
const options = new Map();
|
|
83
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
84
|
+
const value = args[index];
|
|
85
|
+
if (!value.startsWith("--")) {
|
|
86
|
+
positionals.push(value);
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (!valueOptions.has(value) && !flagOptions.has(value)) {
|
|
90
|
+
throw usageError(`Unsupported option: ${value}.`, usage);
|
|
91
|
+
}
|
|
92
|
+
if (options.has(value))
|
|
93
|
+
throw usageError(`Option may only be specified once: ${value}.`, usage);
|
|
94
|
+
if (flagOptions.has(value)) {
|
|
95
|
+
options.set(value, "");
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
const optionValue = args[index + 1];
|
|
99
|
+
if (optionValue === undefined || optionValue.startsWith("--")) {
|
|
100
|
+
throw usageError(`${value} is required.`, usage);
|
|
101
|
+
}
|
|
102
|
+
options.set(value, optionValue);
|
|
103
|
+
index += 1;
|
|
104
|
+
}
|
|
105
|
+
return { positionals, options };
|
|
106
|
+
}
|
|
107
|
+
export function requiredOption(options, name) {
|
|
108
|
+
return requiredText(options.get(name), name);
|
|
109
|
+
}
|
|
110
|
+
export function optionalNonEmptyOption(options, name) {
|
|
111
|
+
if (!options.has(name))
|
|
112
|
+
return undefined;
|
|
113
|
+
return requiredText(options.get(name), name);
|
|
114
|
+
}
|
|
115
|
+
export function exactPositionals(values, count, usage) {
|
|
116
|
+
if (values.length !== count || values.some((value) => value.trim().length === 0)) {
|
|
117
|
+
throw usageError(usage);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
export function requiredText(value, label) {
|
|
121
|
+
const normalized = value?.trim();
|
|
122
|
+
if (normalized === undefined || normalized.length === 0)
|
|
123
|
+
throw usageError(`${label} is required.`);
|
|
124
|
+
return normalized;
|
|
125
|
+
}
|
|
126
|
+
export function trimmed(value) {
|
|
127
|
+
const normalized = value?.trim();
|
|
128
|
+
return normalized === undefined || normalized.length === 0 ? undefined : normalized;
|
|
129
|
+
}
|
|
130
|
+
export function presentTime(value, timeZone) {
|
|
131
|
+
return formatTimestamp(value, timeZone);
|
|
132
|
+
}
|
|
133
|
+
export function output(value, data) {
|
|
134
|
+
return data === undefined
|
|
135
|
+
? { kind: "output", output: value }
|
|
136
|
+
: { kind: "output", output: value, data };
|
|
137
|
+
}
|
|
138
|
+
export function clock(options) {
|
|
139
|
+
return options.now?.() ?? new Date();
|
|
140
|
+
}
|
|
141
|
+
export function taskMailbox(taskId) {
|
|
142
|
+
return { kind: "task", taskId };
|
|
143
|
+
}
|
|
144
|
+
export function roleMailbox(taskId, roleName) {
|
|
145
|
+
return { kind: "role", taskId, roleName };
|
|
146
|
+
}
|
|
147
|
+
export function leaderMailbox(taskId) {
|
|
148
|
+
return roleMailbox(taskId, LEADER_ROLE);
|
|
149
|
+
}
|
|
150
|
+
export function taskRef(id) {
|
|
151
|
+
return { type: "task", id };
|
|
152
|
+
}
|
|
153
|
+
export function notifyMailbox(runtime, target) {
|
|
154
|
+
void runtime?.notifyMailboxChanged(target);
|
|
155
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|