@zq-silk/yui 0.7.0 → 0.8.1
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/README.md +42 -23
- package/dist/cli/commandCatalog.js +234 -122
- package/dist/cli/completion.js +3 -3
- package/dist/cli/helpRenderer.js +3 -0
- package/dist/cli/interactionPolicy.js +44 -23
- package/dist/cli/interactiveSelection.js +1 -1
- package/dist/cli/invocationRouter.js +1 -1
- package/dist/cli/roleWizard.js +8 -8
- package/dist/cli.js +116 -72
- package/dist/commands/agentCommands.js +5 -5
- package/dist/commands/configCommands.js +351 -104
- package/dist/commands/configOverview.js +60 -0
- package/dist/commands/deliveryGuardPreflight.js +2 -2
- package/dist/commands/globalRoleCommands.js +9 -9
- package/dist/commands/profileCommands.js +8 -8
- package/dist/commands/resourcesCommands.js +6 -5
- package/dist/commands/taskCommands.js +3 -6
- package/dist/commands/taskRoleRuntimeStatus.js +3 -1
- package/dist/commands/telemetryCommands.js +11 -6
- package/dist/config/configCatalog.js +42 -0
- package/dist/config/yuiConfig.js +80 -35
- package/dist/context/sessionBootstrapManifest.js +1 -1
- package/dist/controller/clientRuntime.js +0 -2
- package/dist/controller/controller.js +21 -9
- package/dist/controller/fileSchedulerStoreAdapter.js +20 -9
- package/dist/controller/runtime.js +32 -18
- package/dist/coordination/workMailbox.js +25 -22
- package/dist/doctor/doctor.js +2 -2
- package/dist/resources/autoResourceGc.js +3 -1
- package/dist/review/reviewConfig.js +0 -2
- package/dist/run/providerRetry.js +29 -16
- package/dist/run/providerRetryConfig.js +5 -3
- package/dist/runtime/launchDiagnostics.js +1 -1
- package/dist/scheduler/roleRunStall.js +12 -9
- package/dist/setup/setupCommand.js +153 -492
- package/dist/storage/compatibleTaskStore.js +9 -5
- package/dist/storage/migration/productionRegistry.js +58 -0
- package/dist/storage/sqliteStore.js +9 -2
- package/dist/storage/taskStore.js +21 -2
- package/dist/telemetry/sqliteTelemetryStore.js +9 -1
- package/dist/telemetry/telemetryConfig.js +1 -18
- package/dist/telemetry/telemetryStore.js +2 -2
- package/dist/telemetry/telemetryWiring.js +6 -5
- package/dist/web/webSnapshot.js +5 -3
- package/i18n/README.zh-CN.md +37 -32
- package/package.json +1 -1
- package/skills/yui-leader/SKILL.md +12 -5
- package/skills/yui-operator/SKILL.md +44 -6
- package/skills/yui-runtime/SKILL.md +1 -1
|
@@ -51,6 +51,8 @@ export function clearMatchingLeaderStallAttention(store, taskId, runId) {
|
|
|
51
51
|
*/
|
|
52
52
|
export function projectRoleRunHealth(input) {
|
|
53
53
|
const windowMs = input.windowMs ?? DEFAULT_STALL_WINDOW_MS;
|
|
54
|
+
const diagnosticAfterMs = input.diagnosticAfterMs
|
|
55
|
+
?? DEFAULT_WORKFLOW_STALL_CANDIDATE_AGE_MS;
|
|
54
56
|
if (!Number.isFinite(windowMs) || windowMs <= 0) {
|
|
55
57
|
throw new Error("Role run stall window must be a positive number of milliseconds.");
|
|
56
58
|
}
|
|
@@ -65,7 +67,7 @@ export function projectRoleRunHealth(input) {
|
|
|
65
67
|
const candidate = Number.isFinite(candidateAge)
|
|
66
68
|
&& (input.deliveredAt === undefined
|
|
67
69
|
? candidateAge >= windowMs
|
|
68
|
-
: candidateAge >=
|
|
70
|
+
: candidateAge >= diagnosticAfterMs);
|
|
69
71
|
const providerAcceptance = input.providerAcceptance
|
|
70
72
|
?? (input.deliveredAt === undefined ? "ambiguous" : "accepted");
|
|
71
73
|
const hostLiveness = input.hostLiveness;
|
|
@@ -84,7 +86,7 @@ export function projectRoleRunHealth(input) {
|
|
|
84
86
|
: "matching";
|
|
85
87
|
const resourceActivity = hostLiveness === "present"
|
|
86
88
|
&& nativeSession === "matching"
|
|
87
|
-
&& resourceEvidenceIsFresh(input.resource, input.now, windowMs)
|
|
89
|
+
&& resourceEvidenceIsFresh(input.resource, input.now, windowMs, diagnosticAfterMs)
|
|
88
90
|
// Residency/RSS and an unchanged cumulative counter are not progress.
|
|
89
91
|
&& input.resource?.active === true
|
|
90
92
|
&& input.resource?.changed === true;
|
|
@@ -494,7 +496,7 @@ export function isRoleRunStalled(events, runId) {
|
|
|
494
496
|
* structured waiting/working facts. No branch sends terminal bytes, retries,
|
|
495
497
|
* replaces a Session, or changes Run status.
|
|
496
498
|
*/
|
|
497
|
-
export async function reconcileStalledRoleRuns(store, delivery, now, selection, windowMs = DEFAULT_STALL_WINDOW_MS, liveStatuses, resourceEvidence) {
|
|
499
|
+
export async function reconcileStalledRoleRuns(store, delivery, now, selection, windowMs = DEFAULT_STALL_WINDOW_MS, liveStatuses, resourceEvidence, diagnosticAfterMs = DEFAULT_WORKFLOW_STALL_CANDIDATE_AGE_MS) {
|
|
498
500
|
// Dirty mailbox passes are intentionally not a second scheduler. Full
|
|
499
501
|
// reconcile owns the all-active-Run scan; dirty passes may still route the
|
|
500
502
|
// existing mailbox work without manufacturing another episode.
|
|
@@ -519,7 +521,7 @@ export async function reconcileStalledRoleRuns(store, delivery, now, selection,
|
|
|
519
521
|
session: store.getRoleSession(task.id, role.name, run.effective.agentId)
|
|
520
522
|
}];
|
|
521
523
|
})));
|
|
522
|
-
const stallCandidates = candidates.filter(({ run }) => isStallCandidate(run, now, windowMs));
|
|
524
|
+
const stallCandidates = candidates.filter(({ run }) => isStallCandidate(run, now, windowMs, diagnosticAfterMs));
|
|
523
525
|
if (stallCandidates.length === 0)
|
|
524
526
|
return [];
|
|
525
527
|
const stallCandidateKeys = new Set(stallCandidates.map(({ task, role }) => (`${task.id}\0${role.name}`)));
|
|
@@ -689,7 +691,7 @@ export async function reconcileStalledRoleRuns(store, delivery, now, selection,
|
|
|
689
691
|
&& sessionUsable
|
|
690
692
|
&& expectedResourceIdentity !== undefined
|
|
691
693
|
&& resourceEvidenceMatchesCurrentRun(resourceSnapshot, expectedResourceIdentity, progressAt)
|
|
692
|
-
&& resourceEvidenceIsFresh(resourceSnapshot, now, windowMs);
|
|
694
|
+
&& resourceEvidenceIsFresh(resourceSnapshot, now, windowMs, diagnosticAfterMs);
|
|
693
695
|
const resource = resourceIsCurrent ? resourceSnapshot : undefined;
|
|
694
696
|
const health = projectRoleRunHealth({
|
|
695
697
|
progressAt,
|
|
@@ -699,6 +701,7 @@ export async function reconcileStalledRoleRuns(store, delivery, now, selection,
|
|
|
699
701
|
: { deliveredAt: candidate.run.deliveredAt }),
|
|
700
702
|
now,
|
|
701
703
|
windowMs,
|
|
704
|
+
diagnosticAfterMs,
|
|
702
705
|
hostLiveness: live,
|
|
703
706
|
nativeSession: candidate.session,
|
|
704
707
|
providerAcceptance: candidate.run.deliveredAt === undefined
|
|
@@ -825,7 +828,7 @@ export async function reconcileStalledRoleRuns(store, delivery, now, selection,
|
|
|
825
828
|
}
|
|
826
829
|
return raised;
|
|
827
830
|
}
|
|
828
|
-
function isStallCandidate(run, now, windowMs) {
|
|
831
|
+
function isStallCandidate(run, now, windowMs, diagnosticAfterMs) {
|
|
829
832
|
const startAt = run.deliveredAt ?? run.createdAt;
|
|
830
833
|
const ageMs = now.getTime() - Date.parse(startAt);
|
|
831
834
|
if (!Number.isFinite(ageMs))
|
|
@@ -834,7 +837,7 @@ function isStallCandidate(run, now, windowMs) {
|
|
|
834
837
|
// window, but they never enter workflow-stall candidate filtering.
|
|
835
838
|
return run.deliveredAt === undefined
|
|
836
839
|
? ageMs >= windowMs
|
|
837
|
-
: ageMs >=
|
|
840
|
+
: ageMs >= diagnosticAfterMs;
|
|
838
841
|
}
|
|
839
842
|
function classifyLeaderStall(store, taskId, observed, now, windowMs) {
|
|
840
843
|
if (store.hasOpenInputRequest(taskId))
|
|
@@ -1020,7 +1023,7 @@ function resourceEvidenceMatchesCurrentRun(resource, expected, progressAt) {
|
|
|
1020
1023
|
function hasResourceIdentityText(value) {
|
|
1021
1024
|
return typeof value === "string" && value.trim().length > 0;
|
|
1022
1025
|
}
|
|
1023
|
-
function resourceEvidenceIsFresh(evidence, now, windowMs) {
|
|
1026
|
+
function resourceEvidenceIsFresh(evidence, now, windowMs, diagnosticAfterMs = DEFAULT_WORKFLOW_STALL_CANDIDATE_AGE_MS) {
|
|
1024
1027
|
if (evidence === undefined)
|
|
1025
1028
|
return false;
|
|
1026
1029
|
const observedAt = Date.parse(evidence.observedAt);
|
|
@@ -1028,5 +1031,5 @@ function resourceEvidenceIsFresh(evidence, now, windowMs) {
|
|
|
1028
1031
|
return false;
|
|
1029
1032
|
// A sample from an earlier scheduler window is not a current health signal.
|
|
1030
1033
|
return observedAt <= now.getTime()
|
|
1031
|
-
&& now.getTime() - observedAt < Math.max(windowMs,
|
|
1034
|
+
&& now.getTime() - observedAt < Math.max(windowMs, diagnosticAfterMs);
|
|
1032
1035
|
}
|