@zq-silk/yui 2.6.0 → 2.8.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/README.md +23 -0
- package/dist/cli/commandCatalog.js +34 -7
- package/dist/cli/updateCommand.js +3 -0
- package/dist/commands/configCommands.js +1 -0
- package/dist/commands/globalRoleCommands.js +62 -35
- package/dist/commands/inboxCommands.js +372 -0
- package/dist/commands/roleSkillValidation.js +2 -0
- package/dist/commands/taskCommands.js +39 -7
- package/dist/commands/taskRoleRuntimeStatus.js +2 -0
- package/dist/context/currentSkills.js +48 -0
- package/dist/context/roleSessionContext.js +13 -16
- package/dist/context/runContextPack.js +50 -3
- package/dist/context/runInputContract.js +1 -1
- package/dist/context/sessionBootstrapManifest.js +27 -4
- package/dist/context/skillCatalog.js +2 -3
- package/dist/context/taskContext.js +38 -12
- package/dist/controlPlaneCli.js +58 -7
- package/dist/controller/controller.js +8 -2
- package/dist/controller/fileSchedulerStoreAdapter.js +26 -6
- package/dist/controller/globalInputDelivery.js +86 -16
- package/dist/controller/globalRuntimeAttention.js +136 -6
- package/dist/controller/operatorNotification.js +6 -1
- package/dist/controller/providerRetryDelivery.js +3 -5
- package/dist/controller/runtime.js +6 -2
- package/dist/controller/structuredProviderObservation.js +51 -15
- package/dist/controller/taskHostTerminalRecovery.js +33 -0
- package/dist/doctor/doctor.js +25 -2
- package/dist/executor/effectiveLaunch.js +2 -2
- package/dist/executor/fileRoleLaunchPlanner.js +8 -15
- package/dist/interaction/notificationPresentation.js +2 -2
- package/dist/interaction/operatorPresentation.js +1 -1
- package/dist/message/globalInputBacklog.js +69 -0
- package/dist/message/globalMessageQuery.js +1 -0
- package/dist/message/inboxReceipt.js +62 -0
- package/dist/message/message.js +6 -1
- package/dist/message/messageContinuation.js +34 -13
- package/dist/message/taskInboxOwnership.js +43 -0
- package/dist/models/modelManagement.js +469 -0
- package/dist/models/modelManagementConfig.js +46 -0
- package/dist/models/modelManagementFiles.js +90 -0
- package/dist/models/modelManagementHttp.js +90 -0
- package/dist/models/modelManagementTypes.js +1 -0
- package/dist/nativeAgent/session/backends.js +1 -1
- package/dist/observability/runtimeIdentity.js +1 -1
- package/dist/output/boundedRead.js +43 -14
- package/dist/resources/sqliteResourceRegistry.js +1 -1
- package/dist/runtime/agentEndpointIdentity.js +8 -4
- package/dist/runtime/agentEndpointOwnership.js +5 -6
- package/dist/runtime/agentHost.js +165 -24
- package/dist/runtime/agentHostImplementation.js +18 -0
- package/dist/runtime/managedCaller.js +25 -1
- package/dist/runtime/managedIdentity.js +1 -1
- package/dist/runtime/providerRetry.js +19 -1
- package/dist/runtime/sessionCaller.js +53 -0
- package/dist/scheduler/operatorEvent.js +49 -0
- package/dist/scheduler/operatorInputNotificationProcessor.js +5 -4
- package/dist/scheduler/taskWake.js +5 -0
- package/dist/sqlite/driver.js +108 -0
- package/dist/storage/contextRecords.js +28 -0
- package/dist/storage/sqliteSchema.js +21 -1
- package/dist/storage/sqliteStore.js +64 -1
- package/dist/storage/storageSchema.js +1 -1
- package/dist/storage/storageVersions.js +1 -1
- package/dist/storage/storeRpc.js +1 -0
- package/dist/storage/taskStore.js +4 -0
- package/dist/storage/upgrade/upgradeOrchestrator.js +1 -1
- package/dist/task/completionReadiness.js +13 -6
- package/dist/telemetry/sqliteTelemetryStore.js +1 -1
- package/dist/web/assets/assetManifest.js +28 -2
- package/dist/web/assets/client/app/manage.js +6 -0
- package/dist/web/assets/client/app/models.js +20 -0
- package/dist/web/assets/client/app/settings.js +41 -9
- package/dist/web/assets/client/i18n/en.js +180 -2
- package/dist/web/assets/client/i18n/zh-CN.js +178 -2
- package/dist/web/assets/client/index.js +8 -0
- package/dist/web/assets/client/layout/manageShell.js +94 -0
- package/dist/web/assets/client/lib/api.js +13 -1
- package/dist/web/assets/client/lib/i18n.js +5 -3
- package/dist/web/assets/client/views/dock/conversation.js +231 -80
- package/dist/web/assets/client/views/models.js +777 -0
- package/dist/web/assets/client/views/skills.js +22 -15
- package/dist/web/assets/shared/icons.js +2 -0
- package/dist/web/assets/shared/manageNav.js +13 -0
- package/dist/web/assets/shell/manage.js +54 -0
- package/dist/web/assets/shell/models.js +7 -0
- package/dist/web/assets/shell/settings.js +1 -35
- package/dist/web/assets/shell/settingsContent.js +30 -0
- package/dist/web/assets/shell/sidebar.js +1 -0
- package/dist/web/assets/styles/index.js +6 -0
- package/dist/web/assets/styles/views/conversation.js +133 -0
- package/dist/web/assets/styles/views/manage.js +71 -0
- package/dist/web/assets/styles/views/models.js +129 -0
- package/dist/web/assets/styles/views/settings.js +28 -14
- package/dist/web/assets/styles/views/sidebar.js +1 -0
- package/dist/web/webServer.js +59 -9
- package/docs/cli-information-contract.md +42 -11
- package/docs/cli-information-contract.zh-CN.md +28 -7
- package/docs/managed-turn-and-session-runtime.md +127 -5
- package/docs/managed-turn-and-session-runtime.zh-CN.md +83 -3
- package/docs/release-workflow.md +105 -9
- package/docs/release-workflow.zh-CN.md +73 -5
- package/docs/storage-baseline.md +22 -7
- package/docs/storage-baseline.zh-CN.md +14 -5
- package/docs/task-delivery.md +17 -8
- package/docs/task-delivery.zh-CN.md +11 -5
- package/docs/testing/review-evaluation.md +148 -0
- package/docs/testing/review-evaluation.zh-CN.md +117 -0
- package/docs/testing/verification-levels.md +26 -4
- package/docs/testing/verification-levels.zh-CN.md +11 -1
- package/i18n/README.zh-CN.md +19 -0
- package/package.json +5 -2
- package/skills/yui-leader/SKILL.md +28 -11
- package/skills/yui-leader/VERSION +1 -0
- package/skills/yui-leader/references/execution.md +29 -0
- package/skills/yui-leader/references/replicated-execution.md +7 -0
- package/skills/yui-operator/SKILL.md +15 -3
- package/skills/yui-operator/VERSION +1 -0
- package/skills/yui-operator/references/task-delivery.md +2 -0
- package/skills/yui-reviewer/SKILL.md +43 -1
- package/skills/yui-reviewer/VERSION +1 -0
- package/skills/yui-runtime/SKILL.md +144 -15
- package/skills/yui-runtime/VERSION +1 -0
- package/skills/yui-runtime/references/publication.md +16 -5
- package/skills/yui-runtime/references/recovery.md +24 -5
- package/skills/yui-worker/SKILL.md +8 -1
- package/skills/yui-worker/VERSION +1 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { MANAGE_SECTIONS } from "../../shared/manageNav.js";
|
|
2
|
+
export const MANAGE_SHELL_SCRIPT = String.raw `
|
|
3
|
+
import { createI18n } from "/assets/js/lib/i18n.js";
|
|
4
|
+
const SECTIONS = ${JSON.stringify(MANAGE_SECTIONS)};
|
|
5
|
+
export const i18n = createI18n([document.querySelector("#locale-select"), document.querySelector("#settings-locale")]);
|
|
6
|
+
const pages = new Map();
|
|
7
|
+
const dirty = {};
|
|
8
|
+
let started = false;
|
|
9
|
+
let route;
|
|
10
|
+
|
|
11
|
+
export function manageArea(page, section) {
|
|
12
|
+
return section === "connection" ? "settings" : page;
|
|
13
|
+
}
|
|
14
|
+
export function pageSections(page) {
|
|
15
|
+
return Object.values(SECTIONS).flat().filter(item => item.page === page).map(item => item.section);
|
|
16
|
+
}
|
|
17
|
+
export function readManageRoute(url) {
|
|
18
|
+
const parts = url.pathname.split("/").filter(Boolean);
|
|
19
|
+
const area = parts[0] === "settings" ? "settings" : "models";
|
|
20
|
+
const requested = parts[1] || url.searchParams.get("section");
|
|
21
|
+
const section = (SECTIONS[area].find(item => item.section === requested) ||
|
|
22
|
+
(area === "models" && requested === "connection" ? SECTIONS.settings.at(-1) : SECTIONS[area][0])).section;
|
|
23
|
+
return { page: section === "connection" ? "models" : area, section,
|
|
24
|
+
source: url.searchParams.get("source") === "command-code" ? "command-code" : "factory" };
|
|
25
|
+
}
|
|
26
|
+
export function manageHref(next) {
|
|
27
|
+
return "/" + manageArea(next.page, next.section) + "/" + next.section +
|
|
28
|
+
(next.section === "quota" && next.source === "command-code" ? "?source=command-code" : "");
|
|
29
|
+
}
|
|
30
|
+
function render() {
|
|
31
|
+
if (!started) return;
|
|
32
|
+
const rail = document.querySelector(".manage-rail");
|
|
33
|
+
const area = manageArea(route.page, route.section);
|
|
34
|
+
rail.querySelectorAll("a[data-section]").forEach(link => {
|
|
35
|
+
const active = link.dataset.page === route.page && link.dataset.section === route.section;
|
|
36
|
+
if (active) link.setAttribute("aria-current", "page"); else link.removeAttribute("aria-current");
|
|
37
|
+
if (dirty[link.dataset.page]?.[link.dataset.section]) link.dataset.dirty = "true"; else delete link.dataset.dirty;
|
|
38
|
+
});
|
|
39
|
+
rail.querySelectorAll("a[data-area]").forEach(link => {
|
|
40
|
+
if (link.dataset.area === area) link.setAttribute("aria-current", "true"); else link.removeAttribute("aria-current");
|
|
41
|
+
});
|
|
42
|
+
rail.querySelectorAll("[data-area-group]").forEach(group => {
|
|
43
|
+
if (group.dataset.areaGroup === area) group.dataset.active = "true"; else delete group.dataset.active;
|
|
44
|
+
});
|
|
45
|
+
document.title = i18n.t((route.page === "models" ? "models" : "settings") + ".section." + route.section) +
|
|
46
|
+
" · " + i18n.t(area + ".title") + " · Yui";
|
|
47
|
+
}
|
|
48
|
+
function apply(next) {
|
|
49
|
+
route = next;
|
|
50
|
+
document.querySelector("#models-root").hidden = next.page !== "models";
|
|
51
|
+
document.querySelector("#settings-root").hidden = next.page !== "settings";
|
|
52
|
+
pages.get(next.page).show(next);
|
|
53
|
+
render();
|
|
54
|
+
}
|
|
55
|
+
export function navigateManage(next) {
|
|
56
|
+
const normalized = readManageRoute(new URL(manageHref(next), location.origin));
|
|
57
|
+
if (manageHref(normalized) === location.pathname + location.search) return;
|
|
58
|
+
history.replaceState({ ...history.state, scroll: window.scrollY }, "");
|
|
59
|
+
history.pushState({ scroll: 0 }, "", manageHref(normalized));
|
|
60
|
+
apply(normalized);
|
|
61
|
+
window.scrollTo(0, 0);
|
|
62
|
+
}
|
|
63
|
+
export function createManageShell(options) {
|
|
64
|
+
return {
|
|
65
|
+
set: function () { render(); },
|
|
66
|
+
setDirty: function (flags) { dirty[options.page] = flags; render(); },
|
|
67
|
+
link: section => document.querySelector('.manage-rail a[data-page="' + options.page + '"][data-section="' + section + '"]'),
|
|
68
|
+
render: render
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export function registerManagePage(name, controller) { pages.set(name, controller); }
|
|
72
|
+
export function startManagement() {
|
|
73
|
+
started = true;
|
|
74
|
+
route = readManageRoute(new URL(location.href));
|
|
75
|
+
history.replaceState({ ...history.state, scroll: window.scrollY }, "", manageHref(route));
|
|
76
|
+
history.scrollRestoration = "manual";
|
|
77
|
+
apply(route);
|
|
78
|
+
document.querySelector(".manage-app").hidden = false;
|
|
79
|
+
document.addEventListener("click", event => {
|
|
80
|
+
const link = event.target.closest("a");
|
|
81
|
+
if (!link || link.target || link.hasAttribute("download") || event.defaultPrevented ||
|
|
82
|
+
event.button > 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
|
|
83
|
+
const url = new URL(link.href);
|
|
84
|
+
if (url.origin !== location.origin || !/^\/(models|settings)(\/|$)/.test(url.pathname)) return;
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
navigateManage(readManageRoute(url));
|
|
87
|
+
});
|
|
88
|
+
window.addEventListener("popstate", () => {
|
|
89
|
+
apply(readManageRoute(new URL(location.href)));
|
|
90
|
+
window.scrollTo(0, history.state?.scroll || 0);
|
|
91
|
+
});
|
|
92
|
+
i18n.subscribe(render);
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
@@ -137,6 +137,18 @@ export const api = {
|
|
|
137
137
|
globalState: function (role) { return requestJson("/api/roles/" + encodeURIComponent(role) + "/control"); },
|
|
138
138
|
globalControl: function (role, input) {
|
|
139
139
|
return submitMutation("global/" + role, "/api/roles/" + encodeURIComponent(role) + "/control", input);
|
|
140
|
-
}
|
|
140
|
+
},
|
|
141
|
+
// Model management. Configuration writes share one key: the view revision
|
|
142
|
+
// covers the connection and providers together, so an unknown outcome
|
|
143
|
+
// blocks every model write until the page reads current facts again.
|
|
144
|
+
models: function () { return requestJson("/api/models"); },
|
|
145
|
+
modelCatalog: function (cursor) { return requestJson("/api/models/catalog?" + new URLSearchParams({ cursor: cursor || "0" })); },
|
|
146
|
+
modelQuota: function (source) { return requestJson("/api/models/quota?" + new URLSearchParams({ source: source })); },
|
|
147
|
+
saveModelConnection: function (input) { return submitMutation("models/configuration", "/api/models/connection", input); },
|
|
148
|
+
saveModelProvider: function (input) { return submitMutation("models/configuration", "/api/models/provider", input); },
|
|
149
|
+
releaseModelWrites: function () { releaseMutation("models/configuration"); },
|
|
150
|
+
// An explicit refresh is an observation, not a configuration write; a
|
|
151
|
+
// failed or unknown refresh may be requested again by the reader.
|
|
152
|
+
refreshModels: function (input) { return postJson("/api/models/refresh", input); }
|
|
141
153
|
};
|
|
142
154
|
`;
|
|
@@ -17,7 +17,9 @@ function preferredLocale() {
|
|
|
17
17
|
return languages.some(function (language) { return String(language).toLowerCase().startsWith("zh"); }) ? "zh-CN" : "en";
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
// select: one language <select>, a list of them (kept in sync), or none.
|
|
20
21
|
export function createI18n(select) {
|
|
22
|
+
const selects = (Array.isArray(select) ? select : [select]).filter(Boolean);
|
|
21
23
|
let locale = preferredLocale();
|
|
22
24
|
const subscribers = new Set();
|
|
23
25
|
function t(key, fallback) {
|
|
@@ -27,13 +29,13 @@ export function createI18n(select) {
|
|
|
27
29
|
function apply() {
|
|
28
30
|
document.documentElement.lang = locale;
|
|
29
31
|
document.title = t("app.title");
|
|
30
|
-
document.querySelectorAll("[data-i18n]").forEach(function (element) { element.textContent = t(element.dataset.i18n); });
|
|
32
|
+
document.querySelectorAll("[data-i18n]").forEach(function (element) { element.textContent = t(element.dataset.i18n, element.dataset.i18nFallback); });
|
|
31
33
|
TRANSLATED_ATTRIBUTES.forEach(function (attribute) {
|
|
32
34
|
document.querySelectorAll("[data-i18n-" + attribute + "]").forEach(function (element) {
|
|
33
35
|
element.setAttribute(attribute, t(element.getAttribute("data-i18n-" + attribute)));
|
|
34
36
|
});
|
|
35
37
|
});
|
|
36
|
-
|
|
38
|
+
selects.forEach(function (control) { control.value = locale; });
|
|
37
39
|
}
|
|
38
40
|
function setLocale(next) {
|
|
39
41
|
if (!SUPPORTED_LOCALES.includes(next) || next === locale) return;
|
|
@@ -42,7 +44,7 @@ export function createI18n(select) {
|
|
|
42
44
|
apply();
|
|
43
45
|
subscribers.forEach(function (subscriber) { subscriber(locale); });
|
|
44
46
|
}
|
|
45
|
-
|
|
47
|
+
selects.forEach(function (control) { control.addEventListener("change", function () { setLocale(control.value); }); });
|
|
46
48
|
apply();
|
|
47
49
|
return {
|
|
48
50
|
t: t,
|