@zq-silk/yui 2.1.0 → 2.3.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.
Files changed (135) hide show
  1. package/README.md +8 -2
  2. package/dist/cli/commandCatalog.js +32 -6
  3. package/dist/cli/commandDiscovery.js +4 -1
  4. package/dist/cli/interactionPolicy.js +4 -0
  5. package/dist/cli.js +23 -3078
  6. package/dist/commands/taskCommands.js +84 -28
  7. package/dist/commands/taskIntegrationCommands.js +8 -17
  8. package/dist/commands/taskUpstreamCommands.js +3 -1
  9. package/dist/context/runContextPack.js +132 -5
  10. package/dist/context/sourceRunContext.js +4 -2
  11. package/dist/context/taskContext.js +6 -1
  12. package/dist/controlPlaneCli.js +3099 -0
  13. package/dist/controller/clientRuntime.js +3 -2
  14. package/dist/controller/fileSchedulerStoreAdapter.js +19 -6
  15. package/dist/controller/jobControl.js +21 -0
  16. package/dist/executor/agentExecutor.js +1 -1
  17. package/dist/executor/effectiveLaunch.js +18 -5
  18. package/dist/executor/fileRoleLaunchPlanner.js +15 -19
  19. package/dist/integration/gitIntegrationService.js +58 -82
  20. package/dist/job/jobCleanupInspection.js +67 -0
  21. package/dist/message/messageContinuation.js +7 -2
  22. package/dist/nativeAgent/agent.js +176 -74
  23. package/dist/nativeAgent/cliDemo.js +37 -0
  24. package/dist/nativeAgent/codingTools.js +11 -0
  25. package/dist/nativeAgent/commandTool.js +215 -0
  26. package/dist/nativeAgent/compactionDemo.js +158 -0
  27. package/dist/nativeAgent/composition.js +71 -0
  28. package/dist/nativeAgent/context/budget.js +44 -0
  29. package/dist/nativeAgent/context/index.js +339 -0
  30. package/dist/nativeAgent/context/providerCompressor.js +103 -0
  31. package/dist/nativeAgent/demo.js +12 -1
  32. package/dist/nativeAgent/evaluation/cases.js +38 -0
  33. package/dist/nativeAgent/evaluation/checks.js +91 -0
  34. package/dist/nativeAgent/evaluation/demo.js +19 -0
  35. package/dist/nativeAgent/evaluation/files.js +54 -0
  36. package/dist/nativeAgent/evaluation/fixture.js +36 -0
  37. package/dist/nativeAgent/evaluation/index.js +239 -0
  38. package/dist/nativeAgent/executionOwner.js +209 -0
  39. package/dist/nativeAgent/filePatterns.js +170 -0
  40. package/dist/nativeAgent/fileToolsSupport.js +202 -0
  41. package/dist/nativeAgent/index.js +13 -0
  42. package/dist/nativeAgent/interaction/cli.js +358 -0
  43. package/dist/nativeAgent/interaction/contracts.js +1 -0
  44. package/dist/nativeAgent/interaction/index.js +3 -0
  45. package/dist/nativeAgent/interaction/memoryDemo.js +115 -0
  46. package/dist/nativeAgent/interaction/renderer.js +34 -0
  47. package/dist/nativeAgent/localSafety.js +258 -0
  48. package/dist/nativeAgent/model/anthropicMessages.js +204 -0
  49. package/dist/nativeAgent/model/chatCompletions.js +210 -0
  50. package/dist/nativeAgent/model/errors.js +47 -0
  51. package/dist/nativeAgent/model/gateway.js +423 -0
  52. package/dist/nativeAgent/model/index.js +7 -0
  53. package/dist/nativeAgent/model/observationAdapter.js +21 -0
  54. package/dist/nativeAgent/model/protocols.js +19 -0
  55. package/dist/nativeAgent/model/responses.js +263 -0
  56. package/dist/nativeAgent/model/types.js +1 -0
  57. package/dist/nativeAgent/model/wire.js +73 -0
  58. package/dist/nativeAgent/observability/index.js +220 -0
  59. package/dist/nativeAgent/product/catalog.js +82 -0
  60. package/dist/nativeAgent/product/config.js +295 -0
  61. package/dist/nativeAgent/product/facts.js +30 -0
  62. package/dist/nativeAgent/product/index.js +62 -0
  63. package/dist/nativeAgent/product/location.js +44 -0
  64. package/dist/nativeAgent/product/runtime.js +276 -0
  65. package/dist/nativeAgent/product/storage.js +49 -0
  66. package/dist/nativeAgent/product/tools.js +47 -0
  67. package/dist/nativeAgent/product/transport.js +54 -0
  68. package/dist/nativeAgent/projectGuidance/index.js +425 -0
  69. package/dist/nativeAgent/searchTools.js +305 -0
  70. package/dist/nativeAgent/session/backends.js +293 -0
  71. package/dist/nativeAgent/session/catalog.js +97 -0
  72. package/dist/nativeAgent/session/catalogDemo.js +87 -0
  73. package/dist/nativeAgent/session/contracts.js +1 -0
  74. package/dist/nativeAgent/session/format.js +269 -0
  75. package/dist/nativeAgent/session/index.js +5 -0
  76. package/dist/nativeAgent/session/location.js +36 -0
  77. package/dist/nativeAgent/session/sqliteFormat.js +134 -0
  78. package/dist/nativeAgent/session/store.js +248 -0
  79. package/dist/nativeAgent/textTools.js +270 -133
  80. package/dist/nativeAgent/toolManager/executor.js +290 -0
  81. package/dist/nativeAgent/toolManager/index.js +4 -0
  82. package/dist/nativeAgent/validation.js +2 -2
  83. package/dist/repository/gitWorkspace.js +41 -12
  84. package/dist/repository/taskWorkspaceCoordinator.js +72 -145
  85. package/dist/repository/taskWorkspacePreparer.js +39 -43
  86. package/dist/repository/workspaceCleanupInspection.js +88 -7
  87. package/dist/resources/resourceRegistrar.js +16 -10
  88. package/dist/runtime/integrationRuntimeIsolation.js +21 -0
  89. package/dist/runtime/taskRuntimeIsolation.js +91 -21
  90. package/dist/task/archiveDiagnostics.js +26 -8
  91. package/dist/task/archivePreflight.js +26 -9
  92. package/dist/task/leaderArchive.js +9 -15
  93. package/dist/task/taskAuthority.js +56 -0
  94. package/dist/web/assets/client/api.js +8 -0
  95. package/dist/web/assets/client/app.js +74 -9
  96. package/dist/web/assets/client/components.js +95 -36
  97. package/dist/web/assets/client/detail.js +110 -64
  98. package/dist/web/assets/client/dock.js +95 -11
  99. package/dist/web/assets/client/evidence.js +286 -94
  100. package/dist/web/assets/client/i18n.js +182 -62
  101. package/dist/web/assets/client/overview.js +9 -10
  102. package/dist/web/assets/client/records.js +142 -7
  103. package/dist/web/assets/client/sections.js +234 -198
  104. package/dist/web/assets/client/sidebar.js +31 -2
  105. package/dist/web/assets/icons.js +4 -0
  106. package/dist/web/assets/shell.js +2 -1
  107. package/dist/web/assets/styles/components.js +64 -15
  108. package/dist/web/assets/styles/layout.js +11 -4
  109. package/dist/web/assets/styles/responsive.js +16 -6
  110. package/dist/web/assets/styles/tokens.js +1 -1
  111. package/dist/web/assets/styles/views.js +62 -42
  112. package/dist/web/webServer.js +12 -1
  113. package/dist/web/webTaskSurface.js +8 -1
  114. package/docs/agent-result-consumption.md +16 -0
  115. package/docs/agent-result-consumption.zh-CN.md +13 -0
  116. package/docs/examples/agent-offline.mjs +194 -0
  117. package/docs/native-agent.md +283 -0
  118. package/docs/observability/README.md +13 -3
  119. package/docs/observability/README.zh-CN.md +10 -3
  120. package/docs/release-workflow.md +72 -9
  121. package/docs/release-workflow.zh-CN.md +55 -6
  122. package/docs/roles-and-configuration.md +32 -0
  123. package/docs/roles-and-configuration.zh-CN.md +26 -0
  124. package/docs/task-delivery.md +36 -8
  125. package/docs/task-delivery.zh-CN.md +24 -7
  126. package/i18n/README.zh-CN.md +3 -2
  127. package/package.json +1 -1
  128. package/skills/yui-leader/SKILL.md +9 -0
  129. package/skills/yui-leader/references/execution.md +2 -1
  130. package/skills/yui-leader/references/integration.md +20 -0
  131. package/skills/yui-operator/SKILL.md +4 -0
  132. package/skills/yui-reviewer/SKILL.md +8 -0
  133. package/skills/yui-runtime/SKILL.md +11 -0
  134. package/skills/yui-runtime/references/publication.md +20 -4
  135. package/skills/yui-worker/SKILL.md +3 -0
package/README.md CHANGED
@@ -42,6 +42,10 @@ not from terminal windows you juggle or details you have to remember.
42
42
 
43
43
  ## Quick start
44
44
 
45
+ For the self-built coding Agent (without a Controller or Yui Home), see
46
+ [`yui agent`](docs/native-agent.md). Its explicit configuration and product state
47
+ are separate from the orchestration setup below.
48
+
45
49
  You need Linux x64 (glibc) or macOS (x64 or Apple Silicon), Git, tmux, and
46
50
  Node.js `^20.17.0`, `^22.9.0`, `^24.0.0` or `^26.0.0`. On macOS install tmux with
47
51
  `brew install tmux`. For the simplest setup, have Codex CLI or Claude Code CLI
@@ -158,8 +162,10 @@ The task list remains at the left, task details occupy the primary reading area,
158
162
  and recorded Task messages live in a secondary discussion pane. You can resize,
159
163
  swap or hide that pane; on narrow screens it opens over the detail. Native Sessions
160
164
  remain separate from recorded Task messages.
161
- The detail prioritizes user input, native Session activity, Task progress and key
162
- conclusions; fixed file results and delivery evidence open on demand. See
165
+ The detail has four tabs: Overview (user input, progress and key Decisions),
166
+ Delivery (WorkItems, Reviews, Integration and remote delivery, read on demand),
167
+ Runtime (Roles, native Session activity, open execution and usage) and Records
168
+ (a timeline of Decisions, milestones, executions and questions). See
163
169
  [attention and progress](docs/observability/README.md#web-attention-and-progress).
164
170
  See [Web permissions](docs/architecture/capabilities-and-resources.md#cli-and-web)
165
171
  and [input timing](docs/managed-turn-and-session-runtime.md#input-timing-queue-steer-and-interrupt).
@@ -1,5 +1,7 @@
1
1
  import { supportedAgentAdapterIds } from "../agent/adapterCatalog.js";
2
2
  import { supportedAgentExecutionComponentIds } from "../agent/executionComponents.js";
3
+ import { productConfigurationOptions } from "../nativeAgent/product/config.js";
4
+ import { catalogCommands, catalogCommandOptions } from "../nativeAgent/product/catalog.js";
3
5
  import { CONFIG_DEFINITIONS, CONFIG_DOMAINS, configDefinitionsForDomain } from "../config/configCatalog.js";
4
6
  function buildNode(input, parentPath = []) {
5
7
  const path = [...parentPath, input.name];
@@ -420,9 +422,14 @@ const taskChildren = [
420
422
  usage: "yui task archive-preflight <id> (--integrated|--abandon) [--force] [--json]",
421
423
  options: ["--integrated", "--abandon", "--force", "--json"]
422
424
  },
425
+ {
426
+ name: "archive-cleanup", discovery: { surface: "public", audiences: ["public", "operator", "leader"] },
427
+ summary: "Retry one foreground exact-owner cleanup for an archived Task; retain unsafe resources and all history.",
428
+ usage: "yui task archive-cleanup <id>"
429
+ },
423
430
  {
424
431
  name: "archive", discovery: { surface: "public", audiences: ["public", "operator", "leader"], optionAudiences: { "--force": ["public", "operator"] } },
425
- summary: "Archive a terminal Task; explicit --force commits despite delivery/cleanup warnings, retaining unsafe resources.",
432
+ summary: "Archive settled, delivered, stopped work, then attempt exact-owner cleanup. Retained physical resources do not require --force; force separately bypasses business admission.",
426
433
  usage: "yui task archive <id> (--integrated|--abandon) [--force] [--source-message <id> --purpose <verbatim-authorization> --request-id <id>]",
427
434
  options: ["--integrated", "--abandon", "--force", "--source-message", "--purpose", "--request-id"]
428
435
  },
@@ -794,8 +801,8 @@ const taskChildren = [
794
801
  {
795
802
  name: "dispatch", discovery: { surface: "managed", audiences: ["operator", "leader"] },
796
803
  summary: "Dispatch a work item to its Role.",
797
- usage: "yui task work dispatch <task>/<work> [--input <text>] [--lane-role <role> ...]",
798
- options: ["--input", "--lane-role"]
804
+ usage: "yui task work dispatch <task>/<work> [--input <text>] [--context-ref <store/refId@digest> ...] [--lane-role <role> ...]",
805
+ options: ["--input", "--context-ref", "--lane-role"]
799
806
  },
800
807
  {
801
808
  name: "synthesize", discovery: { surface: "managed", audiences: ["operator", "leader"] },
@@ -990,7 +997,7 @@ const taskChildren = [
990
997
  },
991
998
  { name: "list", discovery: { surface: "managed", audiences: ["operator", "leader"] }, summary: "List Integration Attempts.", usage: "yui task integration list <task>" },
992
999
  { name: "show", discovery: { surface: "managed", audiences: ["operator", "leader"] }, summary: "Show one Integration Attempt.", usage: "yui task integration show <task>/<integration>" },
993
- { name: "cleanup", discovery: { surface: "managed", audiences: ["operator", "leader"] }, summary: "Remove a terminal Integration worktree and branch.", usage: "yui task integration cleanup <task>/<integration>" }
1000
+ { name: "cleanup", discovery: { surface: "managed", audiences: ["operator", "leader"] }, summary: "Release clean terminal Integration resources; preserve attempt history, check logs and dirty diagnostics.", usage: "yui task integration cleanup <task>/<integration>" }
994
1001
  ]
995
1002
  },
996
1003
  {
@@ -1113,13 +1120,32 @@ export const ROOT_COMMAND = buildNode({
1113
1120
  { id: "general", title: "General", entries: [
1114
1121
  "help", "version", "update", "upgrade", "setup", "start", "doctor"
1115
1122
  ] },
1116
- { id: "workflow", title: "Workflow", entries: ["operator", "role", "project", "task"] },
1123
+ { id: "workflow", title: "Workflow", entries: ["agent", "operator", "role", "project", "task"] },
1117
1124
  { id: "configuration", title: "Configuration", entries: ["config"] },
1118
1125
  { id: "operations", title: "Operations", entries: ["web", "controller", "session", "execution", "capability", "job", "jobs", "telemetry", "release"] },
1119
1126
  { id: "resources", title: "Resources", entries: ["resources"] },
1120
1127
  { id: "internal", title: "Internal", entries: ["internal"] }
1121
1128
  ],
1122
1129
  children: [
1130
+ {
1131
+ name: "agent", discovery: { surface: "public", audiences: ["public", "operator"] },
1132
+ summary: "Run the independent coding Agent without a Controller or Yui Home.",
1133
+ sections: [{ id: "product", title: "Independent Agent", entries: ["check-config", "start", "run", ...catalogCommands] }],
1134
+ children: [
1135
+ { name: "check-config", discovery: { surface: "public", audiences: ["public", "operator"] },
1136
+ summary: "Validate explicit configuration without model requests or state initialization.",
1137
+ options: productConfigurationOptions, fileOptions: ["--config"] },
1138
+ { name: "start", discovery: { surface: "public", audiences: ["public", "operator"] },
1139
+ summary: "Open a foreground line UI; select --session ID to resume saved history.",
1140
+ options: [...productConfigurationOptions, "--session"], fileOptions: ["--config"] },
1141
+ { name: "run", discovery: { surface: "public", audiences: ["public", "operator"] },
1142
+ summary: "Submit one input and return real result/save evidence as JSON.",
1143
+ options: [...productConfigurationOptions, "--session", "--input"], fileOptions: ["--config"] },
1144
+ ...catalogCommands.map(name => ({ name, discovery: { surface: "public", audiences: ["public", "operator"] },
1145
+ summary: "Use the real persistent Session catalog without starting execution.",
1146
+ options: catalogCommandOptions(name) }))
1147
+ ]
1148
+ },
1123
1149
  {
1124
1150
  name: "role", discovery: { surface: "public", audiences: ["public", "operator"] },
1125
1151
  summary: "Queue input or control an exact current Global Role Turn.",
@@ -1558,7 +1584,7 @@ export const ROOT_COMMAND = buildNode({
1558
1584
  name: "task", discovery: { surface: "public", audiences: ["public", "operator"] },
1559
1585
  summary: "Manage Tasks, WorkItems, AgentRuns, and integration.",
1560
1586
  sections: [
1561
- { id: "lifecycle", title: "Lifecycle", entries: ["create", "project", "base", "update", "activate", "activation", "execution", "complete", "cancel", "reopen", "retire", "list", "show", "context", "next-action", "remote-delivery", "archive-preflight", "archive", "replace", "reconcile", "upstream", "artifact"] },
1587
+ { id: "lifecycle", title: "Lifecycle", entries: ["create", "project", "base", "update", "activate", "activation", "execution", "complete", "cancel", "reopen", "retire", "list", "show", "context", "next-action", "remote-delivery", "archive-preflight", "archive", "archive-cleanup", "replace", "reconcile", "upstream", "artifact"] },
1562
1588
  { id: "collaboration", title: "Collaboration", entries: ["message", "input", "grant", "workflow", "publication", "work", "run", "review", "integration", "role", "overlap", "change-set"] },
1563
1589
  { id: "knowledge", title: "Task Knowledge", entries: ["brief", "decision", "milestone", "event", "continuation", "wake"] }
1564
1590
  ],
@@ -5,7 +5,10 @@ import { hasManagedIdentity } from "../runtime/managedIdentity.js";
5
5
  export function discoveryAudience(env) {
6
6
  if (!hasManagedIdentity(env))
7
7
  return "public";
8
- if (!env.YUI_ROLE || !env.YUI_NATIVE_SESSION_ID)
8
+ const nativeSessionId = env.YUI_ADAPTER_ID === "codex"
9
+ ? env.CODEX_THREAD_ID ?? env.YUI_NATIVE_SESSION_ID : env.YUI_NATIVE_SESSION_ID;
10
+ if (!env.YUI_ROLE || !nativeSessionId || nativeSessionId.trim() !== nativeSessionId
11
+ || nativeSessionId.includes("\0"))
9
12
  return "unbound";
10
13
  if (env.YUI_SESSION_SCOPE === "global")
11
14
  return env.YUI_ROLE === "operator" ? "operator" : "global";
@@ -236,6 +236,10 @@ export const INTERACTION_POLICIES = Object.freeze([
236
236
  ...taskTarget("archive-preflight"),
237
237
  trailingOptions: { "--integrated": "flag", "--abandon": "flag", "--force": "flag", "--json": "flag" }
238
238
  },
239
+ {
240
+ ...taskTarget("archive-cleanup", 2, ["archived"]),
241
+ confirmation: { action: "Clean archived Task resources", targetArgumentIndex: 2 }
242
+ },
239
243
  {
240
244
  ...taskTarget("archive", 2, ["completed", "cancelled"]),
241
245
  trailingOptions: { "--integrated": "flag", "--abandon": "flag", "--force": "flag" },