@shipers-dev/multi 0.9.4 → 0.9.5

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/dist/index.js CHANGED
@@ -5703,7 +5703,7 @@ import { join as join3, dirname as dirname2 } from "path";
5703
5703
  // package.json
5704
5704
  var package_default = {
5705
5705
  name: "@shipers-dev/multi",
5706
- version: "0.9.4",
5706
+ version: "0.9.5",
5707
5707
  type: "module",
5708
5708
  bin: {
5709
5709
  "multi-agent": "./dist/index.js"
@@ -6772,7 +6772,7 @@ ${userPart}` : userPart;
6772
6772
  }
6773
6773
  async function buildPlanningPreamble(apiUrl, task) {
6774
6774
  const depth = typeof task.planning_depth === "number" ? task.planning_depth : 0;
6775
- if (depth >= 1) {
6775
+ if (depth >= PLANNING_DEPTH_LIMIT) {
6776
6776
  return `# Planning (sub-task context)
6777
6777
 
6778
6778
  You are acting on a sub-issue spawned by another agent. You MAY emit a \`multi-plan\` block to update your own issue's status (e.g. mark done/failed) but CANNOT create child issues or delegate further.
@@ -6817,7 +6817,7 @@ Syntax:
6817
6817
  Rules:
6818
6818
  - Omit the block entirely if no actions are needed.
6819
6819
  - Max 10 actions per turn; additional actions are dropped.
6820
- - Sub-issues spawned from your plan run one-shot: they cannot themselves spawn further children (only \`update\` allowed there).
6820
+ - Planning depth is capped at ${PLANNING_DEPTH_LIMIT}: descendants beyond that depth may only \`update\` their own issue.
6821
6821
  - \`create\` defaults \`project_id\` to the current project and \`parent_id\` to the current issue.
6822
6822
  - \`update\` may change title, description, status (todo/in_progress/done/failed), priority, assignee_type, assignee_id.
6823
6823
  - \`delegate\` is shorthand for reassigning and resetting status to todo.
@@ -6845,6 +6845,7 @@ function extractPlanActions(text) {
6845
6845
  return out;
6846
6846
  }
6847
6847
  var PLAN_ACTION_LIMIT = 10;
6848
+ var PLANNING_DEPTH_LIMIT = 10;
6848
6849
  async function executePlanActions(apiUrl, parentTask, actions, ctx) {
6849
6850
  const lines = [];
6850
6851
  let truncated = false;
@@ -6853,11 +6854,11 @@ async function executePlanActions(apiUrl, parentTask, actions, ctx) {
6853
6854
  actions = actions.slice(0, PLAN_ACTION_LIMIT);
6854
6855
  }
6855
6856
  const depth = typeof parentTask.planning_depth === "number" ? parentTask.planning_depth : 0;
6856
- if (depth >= 1) {
6857
+ if (depth >= PLANNING_DEPTH_LIMIT) {
6857
6858
  const blocked = actions.filter((a) => a.type === "create" || a.type === "delegate").length;
6858
6859
  actions = actions.filter((a) => a.type === "update");
6859
6860
  if (blocked)
6860
- lines.push(`- \u26A0 ${blocked} create/delegate action(s) blocked (planning depth limit)`);
6861
+ lines.push(`- \u26A0 ${blocked} create/delegate action(s) blocked (planning depth limit ${PLANNING_DEPTH_LIMIT})`);
6861
6862
  }
6862
6863
  const parentId = parentTask.issue_id;
6863
6864
  const parentProjectId = await (async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipers-dev/multi",
3
- "version": "0.9.4",
3
+ "version": "0.9.5",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "multi-agent": "./dist/index.js"
package/src/index.ts CHANGED
@@ -972,7 +972,7 @@ async function handleRunTask(apiUrl: string, deviceId: string, task: any, detect
972
972
  // the project, or delegate to other agents.
973
973
  async function buildPlanningPreamble(apiUrl: string, task: any): Promise<string> {
974
974
  const depth = typeof task.planning_depth === 'number' ? task.planning_depth : 0;
975
- if (depth >= 1) {
975
+ if (depth >= PLANNING_DEPTH_LIMIT) {
976
976
  return `# Planning (sub-task context)
977
977
 
978
978
  You are acting on a sub-issue spawned by another agent. You MAY emit a \`multi-plan\` block to update your own issue's status (e.g. mark done/failed) but CANNOT create child issues or delegate further.
@@ -1017,7 +1017,7 @@ Syntax:
1017
1017
  Rules:
1018
1018
  - Omit the block entirely if no actions are needed.
1019
1019
  - Max 10 actions per turn; additional actions are dropped.
1020
- - Sub-issues spawned from your plan run one-shot: they cannot themselves spawn further children (only \`update\` allowed there).
1020
+ - Planning depth is capped at ${PLANNING_DEPTH_LIMIT}: descendants beyond that depth may only \`update\` their own issue.
1021
1021
  - \`create\` defaults \`project_id\` to the current project and \`parent_id\` to the current issue.
1022
1022
  - \`update\` may change title, description, status (todo/in_progress/done/failed), priority, assignee_type, assignee_id.
1023
1023
  - \`delegate\` is shorthand for reassigning and resetting status to todo.
@@ -1048,6 +1048,7 @@ function extractPlanActions(text: string): PlanAction[] {
1048
1048
  }
1049
1049
 
1050
1050
  const PLAN_ACTION_LIMIT = 10;
1051
+ const PLANNING_DEPTH_LIMIT = 10;
1051
1052
 
1052
1053
  async function executePlanActions(apiUrl: string, parentTask: any, actions: PlanAction[], ctx: RuntimeCtx): Promise<string> {
1053
1054
  const lines: string[] = [];
@@ -1059,10 +1060,10 @@ async function executePlanActions(apiUrl: string, parentTask: any, actions: Plan
1059
1060
  // Prevent agent recursion: a child turn's plan cannot itself spawn more children.
1060
1061
  // `planning_depth` is carried on each dispatched task (set server-side from issue row).
1061
1062
  const depth = typeof parentTask.planning_depth === 'number' ? parentTask.planning_depth : 0;
1062
- if (depth >= 1) {
1063
+ if (depth >= PLANNING_DEPTH_LIMIT) {
1063
1064
  const blocked = actions.filter(a => a.type === 'create' || a.type === 'delegate').length;
1064
1065
  actions = actions.filter(a => a.type === 'update');
1065
- if (blocked) lines.push(`- ⚠ ${blocked} create/delegate action(s) blocked (planning depth limit)`);
1066
+ if (blocked) lines.push(`- ⚠ ${blocked} create/delegate action(s) blocked (planning depth limit ${PLANNING_DEPTH_LIMIT})`);
1066
1067
  }
1067
1068
  const parentId = parentTask.issue_id;
1068
1069
  const parentProjectId = await (async () => {