@yankeguo/dsh-tool-devlead 0.2.2 → 0.2.3
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 +22 -4
- package/lib/index.js +192 -5
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @yankeguo/dsh-tool-devlead
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The twelve model-facing `devlead_*` tools and the conditional DevLead system-prompt section.
|
|
4
4
|
|
|
5
5
|
The tools are registered with `when: ({ agent }) => ctx.devLead.isEnabled(agent)`, so an ordinary
|
|
6
6
|
Session never sees them. They become visible only after a human enables DevLead mode with
|
|
@@ -9,9 +9,11 @@ Session never sees them. They become visible only after a human enables DevLead
|
|
|
9
9
|
## Tools
|
|
10
10
|
|
|
11
11
|
- `devlead_list_workspaces`
|
|
12
|
+
- `devlead_list_models` (compact Host model catalog for dispatch pinning)
|
|
12
13
|
- `devlead_use_workspace`
|
|
13
14
|
- `devlead_list_sessions`
|
|
14
|
-
- `devlead_create_session` (optional `isolation: "none" | "worktree"
|
|
15
|
+
- `devlead_create_session` (optional `isolation: "none" | "worktree"`; creation-time
|
|
16
|
+
`provider`/`model`/`reasoning_effort` and `agent_teams`)
|
|
15
17
|
- `devlead_get_session`
|
|
16
18
|
- `devlead_prompt_session`
|
|
17
19
|
- `devlead_watch_session`
|
|
@@ -28,6 +30,19 @@ to create the directory. Domain failures are translated to `HarnessError` with a
|
|
|
28
30
|
`DEVLEAD_*` code. Tool outputs are canonical JSON validated against their declared output
|
|
29
31
|
schemas.
|
|
30
32
|
|
|
33
|
+
`devlead_list_models` reports the compact Host model catalog (default selection, providers,
|
|
34
|
+
models, reasoning efforts, and provider failures). `devlead_create_session` inherits the Host
|
|
35
|
+
default model unless the human explicitly asked for a route or the brief needs cost/capability
|
|
36
|
+
routing or reproducibility; when pinning, call `devlead_list_models` first and pass `provider` +
|
|
37
|
+
`model` (optional `reasoning_effort`). Agent Teams is the lead's judgment for complex, multi-step,
|
|
38
|
+
or parallel work (`agent_teams: true`); simple linear work omits it, and an explicit human on/off
|
|
39
|
+
is obeyed. The model is validated before the Session exists, the selection is recorded on the
|
|
40
|
+
child Session only (never through the controller's profile-default-writing path), and omitted
|
|
41
|
+
settings leave the Host default untouched; both settings are creation-time only. Agent Teams
|
|
42
|
+
requires DSH 0.2.2-rc.2 or newer with the Agent Teams service composed; on an rc.1 or otherwise
|
|
43
|
+
Team-less Host, `agent_teams: true` fails with `DEVLEAD_TEAM_UNAVAILABLE` and no Session is
|
|
44
|
+
created, so omit it (or pass `false`) and continue.
|
|
45
|
+
|
|
31
46
|
The closing tools are non-destructive and judgment-based: their descriptions and the policy text
|
|
32
47
|
allow autonomous, reasonable wrap-up closes (finished Sessions the lead created or dispatched,
|
|
33
48
|
clearly stale/duplicate/empty or self-created Workspace registrations, or a human "tidy up" request),
|
|
@@ -57,11 +72,14 @@ supported platform.
|
|
|
57
72
|
|
|
58
73
|
## 中文
|
|
59
74
|
|
|
60
|
-
`@yankeguo/dsh-tool-devlead` 提供
|
|
75
|
+
`@yankeguo/dsh-tool-devlead` 提供 12 个模型工具 `devlead_*` 与条件 system prompt,只在 DevLead
|
|
61
76
|
模式开启时可见。除 `devlead_list_workspaces` 外都需要 live 调用者;0.2.0 起
|
|
62
77
|
`devlead_use_workspace` 把 live Agent 转发给 core 的 `useWorkspace(agent, request, signal)`,
|
|
63
78
|
`create` 默认 `false`(缺目录报 `DEVLEAD_DIRECTORY_MISSING`,只有人类明确要求建目录时才传
|
|
64
|
-
`true
|
|
79
|
+
`true`)。`devlead_create_session` 还支持创建时指定 `provider`+`model`(可选
|
|
80
|
+
`reasoning_effort`)与 `agent_teams`:模型在创建前按 Host 当前 provider 目录校验,只记录在该
|
|
81
|
+
子 Session 上(不走会改写 profile 默认模型的 controller 路径),省略时不动 Host 默认,且均为
|
|
82
|
+
仅创建时生效。领域错误翻译为稳定的 `DEVLEAD_*` code。关闭类工具(remove / archive / unarchive)
|
|
65
83
|
都不是破坏性操作,且采用判断式自主:合理收尾时可自行关闭自己创建/派发且已完成的 Session、
|
|
66
84
|
明显陈旧/重复/空置或由自己创建的 Workspace 注册;但不得关闭人类正在使用/对话的 Session 或
|
|
67
85
|
Workspace、不得用关闭掩盖失败,并且每次自主关闭都要汇报原因与影响面。remove 只注销 Workspace、
|
package/lib/index.js
CHANGED
|
@@ -71,18 +71,40 @@ function optionalPositiveInteger(value, field) {
|
|
|
71
71
|
function defaultedLimit(value, field, fallback) {
|
|
72
72
|
return optionalPositiveInteger(value, field) ?? fallback;
|
|
73
73
|
}
|
|
74
|
+
function modelSelectionRequest(args) {
|
|
75
|
+
const provider = optionalText(args.provider);
|
|
76
|
+
const model = optionalText(args.model);
|
|
77
|
+
const reasoningEffort = optionalText(args.reasoning_effort);
|
|
78
|
+
if (provider === void 0 && model === void 0) {
|
|
79
|
+
if (reasoningEffort !== void 0) {
|
|
80
|
+
throw new DevLeadToolInputError("reasoning_effort requires provider and model");
|
|
81
|
+
}
|
|
82
|
+
return void 0;
|
|
83
|
+
}
|
|
84
|
+
if (provider === void 0 || model === void 0) {
|
|
85
|
+
throw new DevLeadToolInputError("provider and model must be provided together");
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
provider,
|
|
89
|
+
model,
|
|
90
|
+
...reasoningEffort === void 0 ? {} : { reasoningEffort }
|
|
91
|
+
};
|
|
92
|
+
}
|
|
74
93
|
function createSessionRequest(args) {
|
|
75
94
|
const workspace = optionalWorkspaceRef(args.workspace);
|
|
76
95
|
const prompt = args.prompt === void 0 ? void 0 : requirePrompt(args.prompt);
|
|
77
96
|
const title = optionalText(args.title);
|
|
78
97
|
const preset = optionalText(args.preset);
|
|
79
98
|
const isolation = optionalIsolationMode(args.isolation);
|
|
99
|
+
const model = modelSelectionRequest(args);
|
|
80
100
|
return {
|
|
81
101
|
...workspace === void 0 ? {} : { workspace },
|
|
82
102
|
...prompt === void 0 ? {} : { prompt },
|
|
83
103
|
...title === void 0 ? {} : { title },
|
|
84
104
|
...preset === void 0 ? {} : { preset },
|
|
85
105
|
...isolation === void 0 ? {} : { isolation },
|
|
106
|
+
...model === void 0 ? {} : { model },
|
|
107
|
+
...args.agent_teams === void 0 ? {} : { agentTeams: args.agent_teams },
|
|
86
108
|
watch: args.watch ?? true
|
|
87
109
|
};
|
|
88
110
|
}
|
|
@@ -116,7 +138,7 @@ Role boundary:
|
|
|
116
138
|
|
|
117
139
|
Workflow:
|
|
118
140
|
- 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.
|
|
119
|
-
- Dispatch work with devlead_create_session: pass workspace (the owning Workspace's id or registered path; omit it only when the work truly belongs to this session's directory, in which case the new Session lives there) 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
|
|
141
|
+
- Dispatch work with devlead_create_session: pass workspace (the owning Workspace's id or registered path; omit it only when the work truly belongs to this session's directory, in which case the new Session lives there) 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. 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.
|
|
120
142
|
- 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.
|
|
121
143
|
- Inspect progress with devlead_list_sessions and devlead_get_session. The listing carries live, running, watched, archived, and lastTurn; the single-Session detail adds lastTransition, lastError, and lastAssistant when the Host can read the log. Read those fields rather than guessing.
|
|
122
144
|
- 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.
|
|
@@ -154,6 +176,9 @@ function present(title, kind, rawInput) {
|
|
|
154
176
|
function presentListWorkspacesCall() {
|
|
155
177
|
return present("List DevLead workspaces", "search");
|
|
156
178
|
}
|
|
179
|
+
function presentListModelsCall() {
|
|
180
|
+
return present("List DevLead models", "read");
|
|
181
|
+
}
|
|
157
182
|
function presentUseWorkspaceCall(args) {
|
|
158
183
|
return present("Register DevLead workspace", "other", firstText(args.path));
|
|
159
184
|
}
|
|
@@ -258,6 +283,18 @@ var SESSION_VIEW_SCHEMA = {
|
|
|
258
283
|
createdAt: { type: "integer", description: "Epoch milliseconds of Session creation, when known." }
|
|
259
284
|
}
|
|
260
285
|
};
|
|
286
|
+
var MODEL_SELECTION_SCHEMA = {
|
|
287
|
+
type: "object",
|
|
288
|
+
additionalProperties: false,
|
|
289
|
+
properties: {
|
|
290
|
+
provider: { type: "string", required: true, description: "Registered provider route." },
|
|
291
|
+
model: { type: "string", required: true, description: "Provider-owned model id." },
|
|
292
|
+
reasoningEffort: {
|
|
293
|
+
type: "string",
|
|
294
|
+
description: "Adapter-owned reasoning effort, present only when one was explicitly requested."
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
};
|
|
261
298
|
var ISOLATION_SCHEMA = {
|
|
262
299
|
type: "object",
|
|
263
300
|
additionalProperties: false,
|
|
@@ -385,7 +422,12 @@ var CREATE_SESSION_OUTPUT = jsonOutput({
|
|
|
385
422
|
session: required(SESSION_VIEW_SCHEMA),
|
|
386
423
|
workspace: required(WORKSPACE_VIEW_SCHEMA),
|
|
387
424
|
prompted: { type: "boolean", required: true },
|
|
388
|
-
isolation: required(ISOLATION_SCHEMA)
|
|
425
|
+
isolation: required(ISOLATION_SCHEMA),
|
|
426
|
+
model: MODEL_SELECTION_SCHEMA,
|
|
427
|
+
agentTeams: {
|
|
428
|
+
type: "boolean",
|
|
429
|
+
description: "Agent Teams mode applied to the new Session, present only when explicitly requested."
|
|
430
|
+
}
|
|
389
431
|
}
|
|
390
432
|
});
|
|
391
433
|
var GET_SESSION_OUTPUT = jsonOutput({
|
|
@@ -421,6 +463,87 @@ var NOTIFICATIONS_OUTPUT = jsonOutput({
|
|
|
421
463
|
watched: required({ type: "array", items: { type: "string" } })
|
|
422
464
|
}
|
|
423
465
|
});
|
|
466
|
+
var MODEL_EFFORT_SCHEMA = {
|
|
467
|
+
type: "object",
|
|
468
|
+
additionalProperties: false,
|
|
469
|
+
properties: {
|
|
470
|
+
id: { type: "string", required: true, description: "Effort id accepted by reasoning_effort." },
|
|
471
|
+
name: { type: "string", required: true, description: "Human-readable effort name." }
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
var MODEL_VIEW_SCHEMA = {
|
|
475
|
+
type: "object",
|
|
476
|
+
additionalProperties: false,
|
|
477
|
+
properties: {
|
|
478
|
+
id: { type: "string", required: true, description: "Model id accepted by model." },
|
|
479
|
+
name: { type: "string", required: true, description: "Human-readable model name." },
|
|
480
|
+
reasoning: {
|
|
481
|
+
type: "object",
|
|
482
|
+
additionalProperties: false,
|
|
483
|
+
properties: {
|
|
484
|
+
efforts: {
|
|
485
|
+
type: "array",
|
|
486
|
+
required: true,
|
|
487
|
+
items: MODEL_EFFORT_SCHEMA,
|
|
488
|
+
description: "Reasoning efforts the model accepts."
|
|
489
|
+
},
|
|
490
|
+
defaultEffort: {
|
|
491
|
+
type: "string",
|
|
492
|
+
description: "Effort the adapter uses when the caller omits one."
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
var MODEL_PROVIDER_VIEW_SCHEMA = {
|
|
499
|
+
type: "object",
|
|
500
|
+
additionalProperties: false,
|
|
501
|
+
properties: {
|
|
502
|
+
id: { type: "string", required: true, description: "Provider route accepted by provider." },
|
|
503
|
+
name: { type: "string", required: true, description: "Human-readable provider name." },
|
|
504
|
+
models: {
|
|
505
|
+
type: "array",
|
|
506
|
+
required: true,
|
|
507
|
+
items: MODEL_VIEW_SCHEMA,
|
|
508
|
+
description: "Models the provider currently advertises."
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
var MODEL_CATALOG_FAILURE_SCHEMA = {
|
|
513
|
+
type: "object",
|
|
514
|
+
additionalProperties: false,
|
|
515
|
+
properties: {
|
|
516
|
+
id: { type: "string", required: true, description: "Provider route whose lookup failed." },
|
|
517
|
+
name: { type: "string", required: true, description: "Human-readable provider name." },
|
|
518
|
+
message: { type: "string", required: true, description: "Failure detail." }
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
var MODEL_CATALOG_SCHEMA = {
|
|
522
|
+
type: "object",
|
|
523
|
+
additionalProperties: false,
|
|
524
|
+
properties: {
|
|
525
|
+
default: required(MODEL_SELECTION_SCHEMA),
|
|
526
|
+
routableProviders: {
|
|
527
|
+
type: "array",
|
|
528
|
+
required: true,
|
|
529
|
+
items: { type: "string" },
|
|
530
|
+
description: "Provider routes with at least one available model."
|
|
531
|
+
},
|
|
532
|
+
providers: {
|
|
533
|
+
type: "array",
|
|
534
|
+
required: true,
|
|
535
|
+
items: MODEL_PROVIDER_VIEW_SCHEMA,
|
|
536
|
+
description: "Provider groups and their models."
|
|
537
|
+
},
|
|
538
|
+
failures: {
|
|
539
|
+
type: "array",
|
|
540
|
+
required: true,
|
|
541
|
+
items: MODEL_CATALOG_FAILURE_SCHEMA,
|
|
542
|
+
description: "Providers whose catalog lookup failed."
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
var LIST_MODELS_OUTPUT = jsonOutput(MODEL_CATALOG_SCHEMA);
|
|
424
547
|
var REMOVE_WORKSPACE_OUTPUT = jsonOutput({
|
|
425
548
|
type: "object",
|
|
426
549
|
additionalProperties: false,
|
|
@@ -459,12 +582,21 @@ var UNARCHIVE_SESSION_OUTPUT = jsonOutput({
|
|
|
459
582
|
}
|
|
460
583
|
}
|
|
461
584
|
});
|
|
585
|
+
function modelSelectionValue(selection) {
|
|
586
|
+
return {
|
|
587
|
+
provider: selection.provider,
|
|
588
|
+
model: selection.model,
|
|
589
|
+
...selection.reasoningEffort === void 0 ? {} : { reasoningEffort: selection.reasoningEffort }
|
|
590
|
+
};
|
|
591
|
+
}
|
|
462
592
|
function createdSessionValue(created) {
|
|
463
593
|
return {
|
|
464
594
|
session: sessionValue(created.session),
|
|
465
595
|
workspace: workspaceValue(created.workspace),
|
|
466
596
|
prompted: created.prompted,
|
|
467
|
-
isolation: isolationValue(created.isolation)
|
|
597
|
+
isolation: isolationValue(created.isolation),
|
|
598
|
+
...created.model === void 0 ? {} : { model: modelSelectionValue(created.model) },
|
|
599
|
+
...created.agentTeams === void 0 ? {} : { agentTeams: created.agentTeams }
|
|
468
600
|
};
|
|
469
601
|
}
|
|
470
602
|
function promptedSessionValue(prompted) {
|
|
@@ -481,6 +613,31 @@ function watchMutationValue(mutation) {
|
|
|
481
613
|
sessions: [...mutation.sessions]
|
|
482
614
|
};
|
|
483
615
|
}
|
|
616
|
+
function modelCatalogValue(catalog) {
|
|
617
|
+
return {
|
|
618
|
+
default: modelSelectionValue(catalog.default),
|
|
619
|
+
routableProviders: [...catalog.routableProviders],
|
|
620
|
+
providers: catalog.providers.map((provider) => ({
|
|
621
|
+
id: provider.id,
|
|
622
|
+
name: provider.name,
|
|
623
|
+
models: provider.models.map((model) => ({
|
|
624
|
+
id: model.id,
|
|
625
|
+
name: model.name,
|
|
626
|
+
...model.reasoning === void 0 ? {} : {
|
|
627
|
+
reasoning: {
|
|
628
|
+
efforts: model.reasoning.efforts.map((effort) => ({ id: effort.id, name: effort.name })),
|
|
629
|
+
...model.reasoning.defaultEffort === void 0 ? {} : { defaultEffort: model.reasoning.defaultEffort }
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}))
|
|
633
|
+
})),
|
|
634
|
+
failures: catalog.failures.map((failure) => ({
|
|
635
|
+
id: failure.id,
|
|
636
|
+
name: failure.name,
|
|
637
|
+
message: failure.message
|
|
638
|
+
}))
|
|
639
|
+
};
|
|
640
|
+
}
|
|
484
641
|
function removedWorkspaceValue(removed) {
|
|
485
642
|
return {
|
|
486
643
|
workspace: workspaceValue(removed.workspace),
|
|
@@ -506,10 +663,11 @@ var name = "tool-devlead";
|
|
|
506
663
|
var inject = ["devLead", "tools", "systemPrompt"];
|
|
507
664
|
var DEFAULT_NOTIFICATIONS_LIMIT = 20;
|
|
508
665
|
var SESSION_ARGUMENT_DESCRIPTION = 'Session id: the full id, a unique id prefix, or the uuid prefix without the "session-" prefix (for example e59ab350); it resolves only when unique.';
|
|
666
|
+
var LIST_MODELS_DESCRIPTION = "List the model routes this Host can dispatch to: the Host default selection, routable providers, each provider's models with their reasoning efforts and default effort, and any provider whose catalog could not be loaded. Call this before pinning provider/model/reasoning_effort on devlead_create_session. Most dispatches should omit the model parameters and inherit the Host default; only pin a model when the human explicitly asked, or the brief needs cost/capability routing or reproducibility.";
|
|
509
667
|
var LIST_WORKSPACES_DESCRIPTION = "List every registered DSH Workspace: its 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.";
|
|
510
668
|
var USE_WORKSPACE_DESCRIPTION = "Register a repository directory as a DSH Workspace so Sessions can be created in it. The path must be absolute, and an already-registered path is reused with its existing title. A missing directory is an error by default: set create to true only when the human explicitly asked to create that directory.";
|
|
511
669
|
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 or to the watched set; use devlead_get_session for a log detail with the latest turn outcome and assistant excerpt. Inspect it after a wake-up or when the human explicitly asks, not as a polling loop while waiting for a dispatched Session.";
|
|
512
|
-
var CREATE_SESSION_DESCRIPTION = "Create an ordinary DSH Session in a Workspace and optionally start it with a prompt. The Session is a real Session the human can open and take over, not a subagent. It runs independently, so after this call end the turn instead of waiting: never sleep, never poll devlead_get_session, devlead_list_sessions, or devlead_notifications, 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. Use it to dispatch the owning Workspace's work to that Session instead of doing the work yourself from this lead session; the brief may carry open questions, because the Session owns the deeper investigation and the implementation.";
|
|
670
|
+
var CREATE_SESSION_DESCRIPTION = "Create an ordinary DSH Session in a Workspace and optionally start it with a prompt. The child inherits the Host default model unless you explicitly pin provider/model (plus optional reasoning_effort); pin only when the human explicitly asked, or the brief needs cost/capability routing or reproducibility, and call devlead_list_models first so provider/model/effort are real. Agent Teams is your judgment: complex, multi-step, or parallel work that benefits from subagent collaboration may set agent_teams true; simple linear work should omit it; obey an explicit human on/off. Agent Teams requires DSH 0.2.2-rc.2 or newer with the Agent Teams service composed; when the Host reports it unavailable, continue without Team mode instead of retrying or blocking. Never change the Host/profile default, and do not upgrade or downgrade a model on your own. Both settings are creation-time only; the model is validated before the Session is created. The Session is a real Session the human can open and take over, not a subagent. It runs independently, so after this call end the turn instead of waiting: never sleep, never poll devlead_get_session, devlead_list_sessions, or devlead_notifications, 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. Use it to dispatch the owning Workspace's work to that Session instead of doing the work yourself from this lead session; the brief may carry open questions, because the Session owns the deeper investigation and the implementation.";
|
|
513
671
|
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. Address it by full id, a unique id prefix, or the uuid prefix without the "session-" prefix. Use it to inspect state after a wake-up or when the human explicitly asks, not to poll while waiting for a dispatched Session.';
|
|
514
672
|
var PROMPT_SESSION_DESCRIPTION = "Admit a follow-up 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.";
|
|
515
673
|
var WATCH_SESSION_DESCRIPTION = "Add one Session to, or remove it from, this DevLead Session's watch set. Only watched Sessions produce wake-up notifications, so unwatch work that no longer needs attention. A Session cannot watch itself.";
|
|
@@ -535,6 +693,19 @@ function apply(ctx) {
|
|
|
535
693
|
}));
|
|
536
694
|
}
|
|
537
695
|
}), { when: ({ agent }) => ctx.devLead.isEnabled(agent) });
|
|
696
|
+
ctx.tools.register(defineTool({
|
|
697
|
+
name: "devlead_list_models",
|
|
698
|
+
description: LIST_MODELS_DESCRIPTION,
|
|
699
|
+
parameters: {},
|
|
700
|
+
output: LIST_MODELS_OUTPUT,
|
|
701
|
+
presentCall: presentListModelsCall,
|
|
702
|
+
execute(_args, exec) {
|
|
703
|
+
return runTool(async () => {
|
|
704
|
+
const agent = requireAgent(exec.agent, "devlead_list_models");
|
|
705
|
+
return modelCatalogValue(await ctx.devLead.listModels(agent, exec.signal));
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
}), { when: ({ agent }) => ctx.devLead.isEnabled(agent) });
|
|
538
709
|
ctx.tools.register(defineTool({
|
|
539
710
|
name: "devlead_use_workspace",
|
|
540
711
|
description: USE_WORKSPACE_DESCRIPTION,
|
|
@@ -620,7 +791,7 @@ function apply(ctx) {
|
|
|
620
791
|
},
|
|
621
792
|
prompt: {
|
|
622
793
|
type: "string",
|
|
623
|
-
description: "Optional self-contained prompt the new Session starts with: background, target result, open questions to confirm, deliverables, verification, and boundaries. The child cannot see this conversation."
|
|
794
|
+
description: "Optional self-contained prompt the new Session starts with: background, target result, open questions to confirm, deliverables, verification, and boundaries. The child cannot see this conversation. When the prompt pins a model, call devlead_list_models first."
|
|
624
795
|
},
|
|
625
796
|
title: {
|
|
626
797
|
type: "string",
|
|
@@ -638,6 +809,22 @@ function apply(ctx) {
|
|
|
638
809
|
type: "string",
|
|
639
810
|
enum: ["none", "worktree"],
|
|
640
811
|
description: 'Optional checkout isolation for the new Session; defaults to "none". "worktree" asks for a best-effort isolated Git checkout of the owning Workspace for the new Session. It is applied only when the Host composes the experimental Git worktree service, and a non-active outcome (unavailable or failed) is returned in the isolation field of the result, never as an error.'
|
|
812
|
+
},
|
|
813
|
+
provider: {
|
|
814
|
+
type: "string",
|
|
815
|
+
description: "Optional model provider route for the new Session; requires model. Omit to inherit the Host default (recommended unless the human asked or the brief requires a specific route). Call devlead_list_models first when pinning; validated before the Session is created. Creation-time only."
|
|
816
|
+
},
|
|
817
|
+
model: {
|
|
818
|
+
type: "string",
|
|
819
|
+
description: "Optional model id for the new Session; requires provider. Omit to inherit the Host default. Use it only for explicit cost/capability routing or reproducibility, and call devlead_list_models first. Creation-time only; never changes the Host/profile default."
|
|
820
|
+
},
|
|
821
|
+
reasoning_effort: {
|
|
822
|
+
type: "string",
|
|
823
|
+
description: "Optional adapter reasoning effort for the new Session; requires provider and model. Omit to inherit the model's default effort (recommended unless the human asked). Call devlead_list_models for the supported effort ids."
|
|
824
|
+
},
|
|
825
|
+
agent_teams: {
|
|
826
|
+
type: "boolean",
|
|
827
|
+
description: "Agent Teams for the new Session: true for complex, multi-step, or parallel work that benefits from subagent collaboration, false to disable, omit for simple linear work (Host default). Obey an explicit human on/off. Creation-time only. true requires DSH 0.2.2-rc.2 or newer with the Agent Teams service composed; otherwise it fails with DEVLEAD_TEAM_UNAVAILABLE\u2014omit it and continue without Team mode."
|
|
641
828
|
}
|
|
642
829
|
},
|
|
643
830
|
output: CREATE_SESSION_OUTPUT,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yankeguo/dsh-tool-devlead",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
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",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"@deepseek-ai/schemastery": "~3.19.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@yankeguo/dsh-devlead": "0.2.
|
|
29
|
-
"@yankeguo/dsh-devlead-protocol": "0.2.
|
|
28
|
+
"@yankeguo/dsh-devlead": "0.2.3",
|
|
29
|
+
"@yankeguo/dsh-devlead-protocol": "0.2.3"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
32
|
"dsh": ">=0.2.2-rc.1 <0.3.0"
|