@oh-my-dsh/auto-team 0.1.3 → 0.1.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/README.md CHANGED
@@ -60,7 +60,7 @@ dsh plugin --profile <profile> add @oh-my-dsh/auto-team
60
60
  Or install a locally packed tarball:
61
61
 
62
62
  ```sh
63
- dsh plugin --profile <profile> add ./oh-my-dsh-auto-team-0.1.3.tgz
63
+ dsh plugin --profile <profile> add ./oh-my-dsh-auto-team-0.1.4.tgz
64
64
  ```
65
65
 
66
66
  The package name is `@oh-my-dsh/auto-team`, published under the `@oh-my-dsh` scope.
package/README.zh.md CHANGED
@@ -60,7 +60,7 @@ dsh plugin --profile <profile> add @oh-my-dsh/auto-team
60
60
  或者安装本地打包的 tarball:
61
61
 
62
62
  ```sh
63
- dsh plugin --profile <profile> add ./oh-my-dsh-auto-team-0.1.3.tgz
63
+ dsh plugin --profile <profile> add ./oh-my-dsh-auto-team-0.1.4.tgz
64
64
  ```
65
65
 
66
66
  包名是 `@oh-my-dsh/auto-team`,发布在 `@oh-my-dsh` scope 下。
package/lib/index.js CHANGED
@@ -205,8 +205,8 @@ const autoTeamProjectionDefinition = {
205
205
  *
206
206
  * @module @oh-my-dsh/auto-team/prompt
207
207
  */
208
- /** First-round steering text used when the scoring tool has not run yet. */
209
- const FIRST_ROUND_STEER_TEXT = `Auto Team: the first round has no score yet. Call auto_team_score now with the five difficulty factors and the task's universal-semantic objective; the turn stays open until the decision is recorded.`;
208
+ /** Steering text used whenever no score is recorded, including after a reset. */
209
+ const NO_SCORE_STEER_TEXT = `Auto Team: no score is recorded. Call auto_team_score now with the current task's difficulty factors and objective; the turn stays open until the decision is recorded.`;
210
210
  /** System prompt section that states the Lead's auto-team obligations. */
211
211
  function policyText(reportingAgentName, leadDeniedTools) {
212
212
  return `Auto Team policy
@@ -651,7 +651,7 @@ function createPluginRuntime(ctx) {
651
651
  }
652
652
  /** Install the prompt, scoring tool, and stop guard in one Lead scope. */
653
653
  function installLead(options) {
654
- const { agent, autoTeam, config, source } = options;
654
+ const { agent, autoTeam, config } = options;
655
655
  const systemPrompt = agent.ctx.systemPrompt;
656
656
  const tools = agent.ctx.tools;
657
657
  const disposers = [];
@@ -665,22 +665,20 @@ function installLead(options) {
665
665
  text: policyText(config.reportingAgentName, config.leadDeniedTools)
666
666
  }));
667
667
  if (!autoTeam.hasScore(agent)) register(registerScoreTool(tools, autoTeam));
668
- if (source === "startup" || source === "clear") {
669
- const stop = agent.ctx.on("agent/turn-stopping", (payload) => {
670
- if (payload.agent !== agent || payload.turn !== 1 || autoTeam.hasScore(agent)) return;
671
- agent.steer(createMessage({
672
- role: "user",
673
- content: [{
674
- type: "text",
675
- text: FIRST_ROUND_STEER_TEXT
676
- }],
677
- source: { kind: "user" }
678
- }));
679
- });
680
- register(() => {
681
- stop();
682
- });
683
- }
668
+ const stop = agent.ctx.on("agent/turn-stopping", () => {
669
+ if (autoTeam.hasScore(agent)) return;
670
+ agent.steer(createMessage({
671
+ role: "user",
672
+ content: [{
673
+ type: "text",
674
+ text: NO_SCORE_STEER_TEXT
675
+ }],
676
+ source: { kind: "user" }
677
+ }));
678
+ });
679
+ register(() => {
680
+ stop();
681
+ });
684
682
  if (config.enforceLeadNoCode) {
685
683
  const guard = agent.ctx.on("tools/pre-execute", async (exec, next) => {
686
684
  if (exec.agent !== agent || autoTeam.decisionOf(agent) !== "team" || !config.leadDeniedTools.includes(exec.name)) return await next();
@@ -731,7 +729,7 @@ function apply(ctx, config) {
731
729
  resetCommandRegistered = true;
732
730
  };
733
731
  ensureResetCommand();
734
- const install = (agent, source) => {
732
+ const install = (agent) => {
735
733
  if (installed.has(agent)) return;
736
734
  ensureProjection();
737
735
  if (!servicesReady(ctx)) {
@@ -752,13 +750,12 @@ function apply(ctx, config) {
752
750
  installed.set(agent, installLead({
753
751
  agent,
754
752
  autoTeam,
755
- config: resolved,
756
- source
753
+ config: resolved
757
754
  }));
758
755
  };
759
756
  for (const agent of ctx.get("agents")?.list() ?? []) install(agent);
760
- ctx.on("agent/created", ({ agent, source }) => {
761
- install(agent, source);
757
+ ctx.on("agent/created", ({ agent }) => {
758
+ install(agent);
762
759
  });
763
760
  ctx.on("agent/disposed", ({ agent }) => {
764
761
  installed.get(agent)?.();
package/package.json CHANGED
@@ -29,7 +29,7 @@
29
29
  "dsh": ">=0.2.1-rc.2 <0.3.0"
30
30
  },
31
31
  "type": "module",
32
- "version": "0.1.3",
32
+ "version": "0.1.4",
33
33
  "imports": {
34
34
  "#src/*": "./src/*.ts"
35
35
  },