@zq-silk/yui 0.6.7 → 0.6.9
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 +8 -4
- package/dist/commands/taskCommands.js +1 -1
- package/dist/controller/clientRuntime.js +26 -3
- package/dist/controller/fileSchedulerStoreAdapter.js +27 -4
- package/dist/controller/resourceCleanupLinux.js +2 -1
- package/dist/controller/resourceInventory.js +4 -2
- package/dist/controller/resourceInventoryLinux.js +62 -5
- package/dist/controller/runtime.js +2 -1
- package/dist/core/controllerClient.js +141 -7
- package/dist/core/controllerEndpoint.js +18 -30
- package/dist/core/controllerProcessIdentity.js +56 -0
- package/dist/core/controllerServer.js +90 -8
- package/dist/core/homeFilesystemIdentity.js +24 -0
- package/dist/core/protocol.js +68 -5
- package/dist/integration/gitIntegrationService.js +3 -3
- package/dist/repository/homeIdentity.js +7 -3
- package/dist/resources/liveReferences.js +35 -2
- package/dist/runtime/runtimeObservation.js +22 -0
- package/dist/runtime/runtimeProjection.js +10 -4
- package/dist/scheduler/leaderWakeupProcessor.js +2 -1
- package/dist/storage/compatibleTaskStore.js +36 -1
- package/dist/storage/sqliteStore.js +25 -1
- package/dist/storage/taskStore.js +48 -3
- package/dist/task/nextAction.js +1 -1
- package/package.json +1 -1
- package/skills/yui-leader/SKILL.md +27 -23
- package/skills/yui-operator/SKILL.md +7 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
|
-
import { join, resolve } from "node:path";
|
|
3
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
4
4
|
import { isDeepStrictEqual } from "node:util";
|
|
5
5
|
import { validateConfiguredAgent } from "../agent/agent.js";
|
|
6
6
|
import { validateCapabilityGrant } from "../grant/capabilityGrant.js";
|
|
@@ -1735,11 +1735,56 @@ export class StorageCancelledError extends Error {
|
|
|
1735
1735
|
constructor(message) { super(message); this.name = "StorageCancelledError"; }
|
|
1736
1736
|
}
|
|
1737
1737
|
export function resolveYuiHome(env) {
|
|
1738
|
-
|
|
1738
|
+
const requested = env.YUI_HOME === undefined || env.YUI_HOME.length === 0
|
|
1739
1739
|
? join(homedir(), ".yui")
|
|
1740
1740
|
: resolve(env.YUI_HOME);
|
|
1741
|
+
return canonicalizeYuiHome(requested);
|
|
1741
1742
|
}
|
|
1742
1743
|
export function ensureYuiHome(rootDir) { mkdirSync(rootDir, { recursive: true, mode: 0o700 }); }
|
|
1744
|
+
/**
|
|
1745
|
+
* YUI_HOME is a runtime identity, not only a storage path. Resolve every
|
|
1746
|
+
* existing symlink component before Controller/tmux namespaces or exact
|
|
1747
|
+
* descriptors derive identity from it. A Home may not exist before `setup`,
|
|
1748
|
+
* so retain proven-missing trailing components below the longest existing
|
|
1749
|
+
* physical ancestor. Existing-but-unresolvable paths fail closed.
|
|
1750
|
+
*/
|
|
1751
|
+
function canonicalizeYuiHome(value) {
|
|
1752
|
+
const absolute = resolve(value);
|
|
1753
|
+
let current = absolute;
|
|
1754
|
+
const trailing = [];
|
|
1755
|
+
for (;;) {
|
|
1756
|
+
try {
|
|
1757
|
+
const physical = realpathSync(current);
|
|
1758
|
+
return trailing.length === 0 ? physical : join(physical, ...trailing);
|
|
1759
|
+
}
|
|
1760
|
+
catch (realpathError) {
|
|
1761
|
+
if (!isErrno(realpathError, "ENOENT")) {
|
|
1762
|
+
throw unstableYuiHome(absolute, realpathError);
|
|
1763
|
+
}
|
|
1764
|
+
try {
|
|
1765
|
+
lstatSync(current);
|
|
1766
|
+
}
|
|
1767
|
+
catch (lstatError) {
|
|
1768
|
+
if (!isErrno(lstatError, "ENOENT")) {
|
|
1769
|
+
throw unstableYuiHome(absolute, lstatError);
|
|
1770
|
+
}
|
|
1771
|
+
const parent = dirname(current);
|
|
1772
|
+
if (parent === current)
|
|
1773
|
+
return absolute;
|
|
1774
|
+
trailing.unshift(basename(current));
|
|
1775
|
+
current = parent;
|
|
1776
|
+
continue;
|
|
1777
|
+
}
|
|
1778
|
+
throw unstableYuiHome(absolute, realpathError);
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
function unstableYuiHome(path, cause) {
|
|
1783
|
+
return new Error(`YUI_HOME cannot be resolved to a stable physical path: ${path}.`, { cause });
|
|
1784
|
+
}
|
|
1785
|
+
function isErrno(error, code) {
|
|
1786
|
+
return error instanceof Error && "code" in error && error.code === code;
|
|
1787
|
+
}
|
|
1743
1788
|
function emptyState() {
|
|
1744
1789
|
return {
|
|
1745
1790
|
schemaVersion: CURRENT_STORAGE_STATE_SCHEMA_VERSION,
|
package/dist/task/nextAction.js
CHANGED
|
@@ -244,7 +244,7 @@ export function projectNextAction(facts) {
|
|
|
244
244
|
},
|
|
245
245
|
{
|
|
246
246
|
kind: "native-subagent",
|
|
247
|
-
reason: "Use
|
|
247
|
+
reason: "Use native implementer subagents when bounded work benefits from specialist attention or parallel fan-out inside the Leader Session.",
|
|
248
248
|
refs
|
|
249
249
|
}
|
|
250
250
|
],
|
package/package.json
CHANGED
|
@@ -38,21 +38,24 @@ Choose the executor in this order:
|
|
|
38
38
|
|
|
39
39
|
1. **Leader directly** when the work is small and the current Leader context,
|
|
40
40
|
authority, and tools are sufficient.
|
|
41
|
-
2. **
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
Session and durable Run lifecycle.
|
|
41
|
+
2. **Native subagents** when bounded implementation or research benefits from
|
|
42
|
+
specialist attention or parallel fan-out inside the current Agent Session.
|
|
43
|
+
Give each child an explicit Profile, workspace access, and result contract.
|
|
44
|
+
3. **Task Role AgentRun** when the work genuinely needs independent durable
|
|
45
|
+
ownership, different credentials or authority, a provider/model capability
|
|
46
|
+
unavailable to the current Agent, or an independently managed Session and
|
|
47
|
+
Run lifecycle.
|
|
49
48
|
|
|
50
49
|
Do not dispatch a Task Role merely to obtain a fresh context, run a command,
|
|
51
50
|
perform a routine small edit, or add an intermediate review. Direct and native
|
|
52
51
|
execution add no Worker Role, Worker Yui Session, or Worker AgentRun. The exact
|
|
53
|
-
Leader Run fence stays active
|
|
52
|
+
Leader Run fence stays active while native child work is outstanding; the
|
|
54
53
|
WorkItem and its workspace remain the durable delivery boundary.
|
|
55
54
|
|
|
55
|
+
Provider-native foreground and background child lifecycle stays owned by the
|
|
56
|
+
current Agent Session. Structured child completion notifications may resume the
|
|
57
|
+
Leader in later provider Turns while the same Yui AgentRun remains active.
|
|
58
|
+
|
|
56
59
|
A Project-backed code result still uses one WorkItem-owned Develop workspace
|
|
57
60
|
and a clean committed Candidate. The fast path compresses orchestration, not
|
|
58
61
|
delivery evidence: Candidate, ChangeSet, committed Integration, acceptance,
|
|
@@ -84,11 +87,11 @@ WorkItem while its delivery scope remains open. If an immutable final-review
|
|
|
84
87
|
boundary makes that impossible, create only the smallest repair WorkItem and
|
|
85
88
|
retain the original Candidate, Review, and Integration evidence.
|
|
86
89
|
|
|
87
|
-
Native and managed waits use different fences. For
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
Do not poll, send a waiting
|
|
91
|
-
|
|
90
|
+
Native and managed waits use different fences. For native children, let the
|
|
91
|
+
provider deliver structured completion notifications and continue the parent
|
|
92
|
+
Agent. The exact Leader Run stays active across intermediate provider Turn
|
|
93
|
+
boundaries while native children remain active. Do not poll, send a waiting
|
|
94
|
+
Message, rewrite a checkpoint, or yield merely to preserve that native wait.
|
|
92
95
|
|
|
93
96
|
For a managed Task Role or Reviewer Run, persist a necessary changed checkpoint,
|
|
94
97
|
yield the active Leader Run, and stop the turn. Its durable mailbox result or an
|
|
@@ -344,12 +347,12 @@ hint only if this Agent's native child API supports that override; otherwise
|
|
|
344
347
|
inherit the actual runtime setting. Never claim a model that cannot be
|
|
345
348
|
confirmed.
|
|
346
349
|
|
|
347
|
-
Create and communicate with
|
|
348
|
-
not create, address, resume, or terminate
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
350
|
+
Create and communicate with children through the native Agent tools. Yui does
|
|
351
|
+
not create, address, resume, or terminate those children; it observes their
|
|
352
|
+
structured lifecycle so the parent AgentRun can span the provider Turns needed
|
|
353
|
+
to receive their results. Children must not mutate Yui lifecycle state. Let the
|
|
354
|
+
provider's native completion mechanism return results to the Leader, then
|
|
355
|
+
synthesize them before deciding the next Yui workflow outcome.
|
|
353
356
|
|
|
354
357
|
Review the returned work and run proportionate checks. Record each round in the
|
|
355
358
|
WorkItem summary; preserve earlier round facts when updating it:
|
|
@@ -617,9 +620,10 @@ evidence; truthfully surface the blocker through the supported provider failure
|
|
|
617
620
|
boundary. Do not add a fallback protocol.
|
|
618
621
|
|
|
619
622
|
Yield before waiting only for managed Task Role or Reviewer results whose
|
|
620
|
-
durable mailbox can wake the Task. Do not yield
|
|
621
|
-
|
|
622
|
-
|
|
623
|
+
durable mailbox can wake the Task. Do not yield merely because native child
|
|
624
|
+
results are outstanding: the provider owns their completion notifications, and
|
|
625
|
+
Yui keeps this AgentRun active across intermediate provider Turns. After native
|
|
626
|
+
work drains, continue to Task completion, InputRequest, or final yield.
|
|
623
627
|
|
|
624
628
|
Complete only after required WorkItems are accepted, Role work is terminal,
|
|
625
629
|
latest isolated results are integrated or deliberately abandoned, and user
|
|
@@ -162,11 +162,13 @@ Do not pre-split WorkItems or decide their dependsOn, execution path,
|
|
|
162
162
|
acceptance, or Integration; the Leader owns WorkItem creation, replacement,
|
|
163
163
|
parallel dispatch, dependency and conflict resolution inside the one Task.
|
|
164
164
|
|
|
165
|
-
The Leader chooses among direct execution,
|
|
166
|
-
AgentRun.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
165
|
+
The Leader chooses among direct execution, native subagents, and a Task Role
|
|
166
|
+
AgentRun. Native subagents are created inside the Leader Session, inherit the
|
|
167
|
+
Leader Agent, ignore Task Role Agent bindings, and have no Yui launch command.
|
|
168
|
+
Their structured lifecycle and completion notifications may span provider
|
|
169
|
+
Turns inside the same Yui AgentRun. A Task Role is required when the user
|
|
170
|
+
requests a different provider, credentials, interactive Session, or durable
|
|
171
|
+
independent lifecycle.
|
|
170
172
|
|
|
171
173
|
When the user requires a specific Leader or Worker provider, inspect Roles
|
|
172
174
|
before routing:
|