@yankeguo/dsh-tool-devlead 0.4.3-rc.3 → 0.4.3-rc.4
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/lib/index.js +39 -5
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -658,7 +658,29 @@ var SESSION_VIEW_SCHEMA = {
|
|
|
658
658
|
required: true,
|
|
659
659
|
description: "Whether the Session is live in the Host store, with an Agent or an attached Session."
|
|
660
660
|
},
|
|
661
|
-
running: {
|
|
661
|
+
running: {
|
|
662
|
+
type: "boolean",
|
|
663
|
+
required: true,
|
|
664
|
+
description: "Whether the Session Agent is inside a turn; false does not prove its descendants are inactive."
|
|
665
|
+
},
|
|
666
|
+
subagents: {
|
|
667
|
+
type: "object",
|
|
668
|
+
additionalProperties: false,
|
|
669
|
+
description: "Detail-only descendant activity. Zeroes are a confirmed empty/inactive tree; omission means unknown or a list row.",
|
|
670
|
+
properties: {
|
|
671
|
+
running: {
|
|
672
|
+
type: "integer",
|
|
673
|
+
required: true,
|
|
674
|
+
description: "Running descendants that can wake this Session later; greater than zero means the work is not complete."
|
|
675
|
+
},
|
|
676
|
+
total: { type: "integer", required: true, description: "All reachable child descendants, including inactive ones." },
|
|
677
|
+
names: {
|
|
678
|
+
type: "array",
|
|
679
|
+
items: { type: "string" },
|
|
680
|
+
description: "Up to five running descendants\u2019 paths, names, or labels."
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
},
|
|
662
684
|
watched: { type: "boolean", required: true, description: "Whether this lead watches the Session." },
|
|
663
685
|
archived: { type: "boolean", required: true, description: "Whether the Workspace registry lists the Session as archived." },
|
|
664
686
|
lastTurn: { type: "integer", description: "Latest turn number observed on the Session, when known." },
|
|
@@ -764,6 +786,10 @@ var NOTIFICATION_SCHEMA = {
|
|
|
764
786
|
error: { type: "string", description: "Compact single-line failure excerpt when the settled turn failed." },
|
|
765
787
|
summary: { type: "string", description: "Latest-assistant excerpt before the turn settled." },
|
|
766
788
|
summaryTruncated: { type: "boolean", description: "Whether summary was truncated; absent on legacy records." },
|
|
789
|
+
subagentsRunning: {
|
|
790
|
+
type: "integer",
|
|
791
|
+
description: "Running descendants observed at turn-end; the Session can wake itself, so this is not completed work."
|
|
792
|
+
},
|
|
767
793
|
cancelledByLeadInterrupt: {
|
|
768
794
|
type: "boolean",
|
|
769
795
|
description: "True when this lead intentionally cancelled the interrupted/aborted turn."
|
|
@@ -865,6 +891,13 @@ function sessionValue(view) {
|
|
|
865
891
|
sessionId: view.sessionId,
|
|
866
892
|
live: view.live,
|
|
867
893
|
running: view.running,
|
|
894
|
+
...view.subagents === void 0 ? {} : {
|
|
895
|
+
subagents: {
|
|
896
|
+
running: view.subagents.running,
|
|
897
|
+
total: view.subagents.total,
|
|
898
|
+
...view.subagents.names === void 0 ? {} : { names: [...view.subagents.names] }
|
|
899
|
+
}
|
|
900
|
+
},
|
|
868
901
|
watched: view.watched,
|
|
869
902
|
archived: view.archived,
|
|
870
903
|
...view.title === void 0 ? {} : { title: view.title },
|
|
@@ -905,6 +938,7 @@ function notificationValue(notification) {
|
|
|
905
938
|
...notification.error === void 0 ? {} : { error: notification.error },
|
|
906
939
|
...notification.summary === void 0 ? {} : { summary: notification.summary },
|
|
907
940
|
...notification.summaryTruncated === void 0 ? {} : { summaryTruncated: notification.summaryTruncated },
|
|
941
|
+
...notification.subagentsRunning === void 0 ? {} : { subagentsRunning: notification.subagentsRunning },
|
|
908
942
|
...notification.cancelledByLeadInterrupt === void 0 ? {} : { cancelledByLeadInterrupt: notification.cancelledByLeadInterrupt },
|
|
909
943
|
...notification.wakeSuppressedByReportId === void 0 ? {} : { wakeSuppressedByReportId: notification.wakeSuppressedByReportId },
|
|
910
944
|
...notification.wakeSuppressionReason === void 0 ? {} : { wakeSuppressionReason: notification.wakeSuppressionReason }
|
|
@@ -1698,7 +1732,7 @@ Workflow:
|
|
|
1698
1732
|
- List known Workspaces with devlead_list_workspaces. Register a repository directory with devlead_use_workspace using an absolute path; registering an already-registered path is idempotent. A missing directory is never created by default: set create true only when the human explicitly asked to create that directory.
|
|
1699
1733
|
- Dispatch work with devlead_create_session: pass workspace (the owning Workspace's id, registered path, or exact title; omit it only when the work truly belongs to this session's directory, where the new Session lives) and a self-contained prompt that states the background, the target result, the open questions the Session must confirm or refine, the deliverables, how to verify them, and what not to touch, plus an optional title/preset. Preset is a Host-defined Agent preset id: call devlead_list_agent_presets before setting it; omit or leave it blank to inherit the plugin defaultAgentPreset, then the Host default/selectedDefault. An unknown or unusable preset fails creation with a structured error, so never guess an id. Models inherit the Host default: pass provider/model/reasoning_effort only when the human explicitly asked, or the brief needs cost/capability routing or reproducibility; call devlead_list_models first. Agent Teams is your judgment: complex, multi-step, or parallel work that benefits from subagents may set agent_teams true; simple linear work omits it; obey an explicit human on/off; report the choice and why. Team availability depends on the Host composition and DSH version (0.2.2-rc.2+); if unavailable, continue without Team instead of retrying or blocking. Both apply at creation only and never change the profile default. A brief with open questions is expected: the Session owns the deeper investigation, not only the edits. The new Session is watched by default and runs independently; it does not see this conversation, so restate every fact it needs.
|
|
1700
1734
|
- Prefer an existing Session: if the owning Workspace already has a live Session working on the request, continue that Session with devlead_prompt_session instead of opening a duplicate.
|
|
1701
|
-
- Inspect
|
|
1735
|
+
- Inspect with devlead_list_sessions and devlead_get_session. Detail adds lastTransition/lastError/lastAssistant(4096+truncation)+subagents; lists omit them. running:false + lastTransition:completed does not mean the work is complete when subagents.running > 0 or subagentsRunning is present: the Session will wake itself; do not prompt it again, declare a fault, or archive it. Long reports: /tmp/*.md + summary/path. Answer lastAssistant questions/ask the human, then use devlead_prompt_session.
|
|
1702
1736
|
- Continue a Session with devlead_prompt_session: the prompt is admitted as a user message attributed to you, and a cold Session is resumed first. Archived Sessions are rejected. By default a running Session queues the prompt behind its current turn; set interrupt true only to replace that work: the Host stops the running turn and the work its stop providers report (subagents, owned jobs, active schedules), discards queued input by default (interrupt_inbox keep/clear-own retains it), then admits the prompt as a new turn; an idle Session is a no-op, and the interrupted turn still notifies you as cancelled. A stale queued prompt you sent can be withdrawn with devlead_retract_input before it runs; only your own relay inputs are yours to retract.
|
|
1703
1737
|
- Manage the watch set with devlead_watch_session. Only watched Sessions produce notifications, so unwatch work you no longer need and do not let the set grow without purpose. A watch is a follow relationship, not a permission grant: it routes notifications/reports and allows steering, not file access or ownership. For a long-running watched Session whose mid-turn milestones matter, you may invite devlead_report in the brief for blockers, decision forks, or questions; omit it with watch=false and for short linear work. Reports are one-way and never replace the final turn notice.
|
|
1704
1738
|
- Board: devlead_board_read/devlead_board_update. Notes: devlead_board_note_read=metadata+absolutePath only; devlead_board_note_write=index/metadata/delete only; native read/write/edit=body@absolutePath, never devlead tools or notes/index.json for bodies.
|
|
@@ -1850,13 +1884,13 @@ var LIST_MODELS_DESCRIPTION = "List the model routes this Host can dispatch to:
|
|
|
1850
1884
|
var LIST_AGENT_PRESETS_DESCRIPTION = "List the Agent preset roster this Host currently defines for Session creation. Each entry carries the id accepted by devlead_create_session preset, its name/description when available, a default marker, and a broken reason when the preset cannot compose a Session. Call this before setting preset and never assume a fixed list; standard and ptc are examples on some Hosts, not a complete vocabulary. If the Host composes no roster, the result reports available false with a reason; the preset parameter states the fallback and rejection rules.";
|
|
1851
1885
|
var LIST_WORKSPACES_DESCRIPTION = "List every registered DSH Workspace: its id, title, canonical directory path, live directory status, and the Sessions the registry accounts to it. Use it first to decide which Workspace owns a request, before registering a new Workspace or dispatching a Session. Its id, path, and exact title are the accepted Workspace references.";
|
|
1852
1886
|
var USE_WORKSPACE_DESCRIPTION = "Register a repository directory as a DSH Workspace so Sessions can be created in it. An already-registered path is reused idempotently. A missing directory is an error by default: set create to true only when the human explicitly asked to create that directory.";
|
|
1853
|
-
var LIST_SESSIONS_DESCRIPTION = "List DSH Sessions this DevLead Session can address: whether each is live, running, watched, or archived, plus latest-turn facts when the Host knows them. Watched and running rows come first. Optionally restrict to one Workspace (by id, registered path, or exact title) or to the watched set; use devlead_get_session for
|
|
1887
|
+
var LIST_SESSIONS_DESCRIPTION = "List DSH Sessions this DevLead Session can address: whether each is live, running, watched, or archived, plus latest-turn facts when the Host knows them. Watched and running rows come first. Optionally restrict to one Workspace (by id, registered path, or exact title) or to the watched set. The list intentionally omits subagent activity to avoid one recursive query per row, so running false alone never proves completion; use devlead_get_session for the latest turn outcome, assistant excerpt, and descendant activity. Inspect it after a wake-up or when the human explicitly asks, not as a polling loop while waiting for a dispatched Session.";
|
|
1854
1888
|
var CREATE_SESSION_DESCRIPTION = "Create an ordinary DSH Session in a Workspace, optionally started with a prompt. Use it to dispatch the owning Workspace's work to that Session instead of doing the work yourself; the brief may carry open questions, because the Session owns the deeper investigation and the implementation. The child inherits the Host default model unless you pin provider/model (plus optional reasoning_effort); preset and agent_teams inherit by default too. These settings are creation-time only; each parameter states its pinning rules. Never change the Host/profile default or reroute a model on your own. It runs independently: after this call end the turn instead of waiting; never sleep or poll the read tools, and never call wait_agent to wait for it. A watched Session is the default, and its settled turn starts a new turn of this lead session with the wake-up message. A watched child can use devlead_report for mid-turn milestones; invite it only in a long-running brief, and omit that advice with watch=false.";
|
|
1855
|
-
var GET_SESSION_DESCRIPTION = `Read one Session in detail: whether it is live and running, whether it is archived, and, when the Host can read the Session log, the latest turn number and outcome plus the latest error and assistant excerpts. While a live Agent owns the target, the output also lists its queued inbox inputs (id, boundary, source, text excerpt, enqueue time, and for DevLead messages the intent/questionId/wakeRequested plus a tracked answer's deliveryState), so stale or duplicate queued instructions can be identified before they run and answers distinguished from instructions. Use it to inspect state after a wake-up or when the human explicitly asks, not to poll while waiting for a dispatched Session. When the target is this lead Session itself, the output also carries its ${SELF_REPORTS_LIMIT} newest retained mid-turn reports (question reports with questionStatus/answerStatus, every report with its diagnostic lane and in-memory deliveryState).`;
|
|
1889
|
+
var GET_SESSION_DESCRIPTION = `Read one Session in detail: whether it is live and running, whether it is archived, and, when the Host can read the Session log, the latest turn number and outcome plus the latest error and assistant excerpts. Best-effort subagents reports {running,total,names?}: zeroes mean a confirmed empty/inactive tree, omission means unknown. running:false + lastTransition:completed is not completion when subagents.running > 0; descendants can wake the Session themselves, so do not prompt it again, declare a fault, or archive it. While a live Agent owns the target, the output also lists its queued inbox inputs (id, boundary, source, text excerpt, enqueue time, and for DevLead messages the intent/questionId/wakeRequested plus a tracked answer's deliveryState), so stale or duplicate queued instructions can be identified before they run and answers distinguished from instructions. Use it to inspect state after a wake-up or when the human explicitly asks, not to poll while waiting for a dispatched Session. When the target is this lead Session itself, the output also carries its ${SELF_REPORTS_LIMIT} newest retained mid-turn reports (question reports with questionStatus/answerStatus, every report with its diagnostic lane and in-memory deliveryState).`;
|
|
1856
1890
|
var PROMPT_SESSION_DESCRIPTION = "Admit a prompt into an existing Session, resuming a cold Session first. The prompt is attributed to this DevLead Session. Archived Sessions are rejected. The Session is watched by default, so after this call end the turn instead of waiting: its settled turn starts a new turn of this lead session with the wake-up message. A watched Session gains devlead_report for mid-turn milestones; mention it only in a long-running continuation. With watch=false this call only skips adding a watch: an already-watched Session stays watched and keeps devlead_report, so use devlead_watch_session with watching:false to remove it. The intent selects delivery: instruction (default) queues a new next-turn boundary behind the current turn; answer (requires question_id) replies to a [DEV LEAD QUESTION] report and steers the child's next step; correction changes the current approach and also steers; background injects non-urgent context without a wake. steer is next-step priority, not preemption or isolation: the current model request/tool batch finishes first, and an idle answer may share a request with an older next-turn input. Set interrupt true only to replace the current work (cancel + new turn), with inbox retention on interrupt_inbox. The result delivery reports the actual primitive/boundary/wake and the messageId (for retract); it is an admission receipt, not a presented confirmation.";
|
|
1857
1891
|
var RETRACT_INPUT_DESCRIPTION = `Withdraw one queued inbox input from a Session before it runs, addressed by the id devlead_get_session reports in queuedInputs. Your own instruction/correction relay prompts and background notices can be withdrawn; an answer is refused (removing it would desynchronize the question state from the child inbox \u2014 to discard an answer and reopen its question use interrupt:true with interrupt_inbox:"clear-all"). Human, scheduled, and other producers' queued inputs are refused with an explanation \u2014 they are not yours to remove. Idempotent: an input already consumed or withdrawn reports retracted false. The target must be live (a cold Session has no folded inbox) and cannot be this lead Session itself. Use it to clean up a stale or misdelivered instruction you queued, instead of layering another prompt on top of it.`;
|
|
1858
1892
|
var WATCH_SESSION_DESCRIPTION = "Add one Session to, or remove it from, this DevLead Session's watch set. A watch is a one-way follow relationship, not a permission grant: it only routes turn notifications/reports and allows steering; it does not grant file access or ownership. Only watched Sessions produce wake-up notifications, so unwatch work that no longer needs attention. A Session cannot watch itself.";
|
|
1859
|
-
var NOTIFICATIONS_DESCRIPTION = 'Read the retained notification digest of this DevLead Session together with the current watch set. Each notification names a watched Session whose turn settled and how it ended
|
|
1893
|
+
var NOTIFICATIONS_DESCRIPTION = 'Read the retained notification digest of this DevLead Session together with the current watch set. Each notification names a watched Session whose turn settled and how it ended. A positive subagentsRunning means descendants are still active and can wake that Session, so even completed is not completed work: do not prompt again, declare a fault, or archive it. A wakeSuppressedByReportId/wakeSuppressionReason pair means that turn-end was carried by an action-required wake instead of a separate one (the transition is still retained, not lost). The reports array carries mid-turn reports from watched Sessions, each with its diagnostic lane (background for progress/fyi, action-required for blocked/decision/question) and an in-memory deliveryState (pending/delivered/digest-only; absent after a restart \u2014 not a presented confirmation). Both digests are newest last. A question report carries questionStatus (open/answered/expired/cancelled) and, when answered, answerStatus (admitted/claimed/presented/discarded/failed): filter open questions with questionStatus === "open", and note that answered does not mean presented (only presented is delivery completion). Answer an open question yourself or ask the human, then relay with devlead_prompt_session intent "answer" and the report id as question_id. The [DEV LEAD QUESTION] wake already carries the full question, so the normal path needs no digest read; use this for history or a lost wake. Read it after a wake-up or when the human explicitly asks, not as a polling loop while waiting for a dispatched Session.';
|
|
1860
1894
|
var REPORT_DESCRIPTION = "Send a one-way mid-turn report to the active DevLead Session that watches this Session; the lead cannot reply through the report itself. The lead is already notified when your turn settles, so do not report routine progress or a final summary here. Use it only mid-turn, on a long-running task, for a milestone the lead must know before the turn ends; a short or linear task should not call it. The kind selects the lane: progress/fyi are non-urgent background context injected without waking the lead (a cold lead or a full background budget keeps them digest-only) \u2014 use them only for updates that can wait for the next wake or settled-turn notice; blocked (a real blocker) and decision (a fork needing the lead before your turn ends) steer the lead's next step under [DEV LEAD ACTION REQUIRED] and share a bounded pending queue per pair, so an overflow returns DEVLEAD_DELIVERY_RATE_LIMITED \u2014 merge instead of resending. Use kind question when you are blocked on missing information or a decision, then end your turn; the lead answers in a new turn (or steers your next step while you are still running). When a question report is durably forwarded the result sets `turnEndRequested:true`: the tool requests the end of your turn, but the current tool batch still completes and already-queued next-step work still runs before the turn closes; do not poll or resend. When the question receipt is not durable, no turn end is requested: restate the question in your final assistant message and end the turn naturally. At most four non-question reports per turn; question reports are exempt. The result carries `durable` and `queued`; `durable` false means no durable receipt was written on this attempt (storage absent or the outbox write failed), so treat the warning as a possible-loss receipt and retry when the lead is reachable.";
|
|
1861
1895
|
var QUESTION_FORWARDED_GUIDANCE = "The question was forwarded to the DevLead and an answer is requested. This is not an immediate close; the turn ends after the current tool batch and any committed next-step work \u2014 the request cannot veto them. The answer may arrive as a new turn or steer your next step while you are still running; do not poll or resend the question.";
|
|
1862
1896
|
var QUESTION_MEMORY_ONLY_RESTATE = "Forwarding is memory-only on this attempt; restate the question in your final assistant message and end your turn naturally so the DevLead can also read it from the turn notification.";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yankeguo/dsh-tool-devlead",
|
|
3
|
-
"version": "0.4.3-rc.
|
|
3
|
+
"version": "0.4.3-rc.4",
|
|
4
4
|
"description": "Model-facing DevLead tools: register and list DSH Workspaces, create and steer ordinary Sessions, read session status, watch state changes, and read the lead's notification feed.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@deepseek-ai/schemastery": "~3.19.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@yankeguo/dsh-devlead": "0.4.3-rc.
|
|
30
|
-
"@yankeguo/dsh-devlead-protocol": "0.4.3-rc.
|
|
29
|
+
"@yankeguo/dsh-devlead": "0.4.3-rc.4",
|
|
30
|
+
"@yankeguo/dsh-devlead-protocol": "0.4.3-rc.4"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
33
33
|
"dsh": ">=0.2.2-rc.1 <0.3.0"
|