overlord-cli 4.11.0 → 4.13.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.
@@ -1082,6 +1082,92 @@ async function protocolSpawn(args) {
1082
1082
  }
1083
1083
  }
1084
1084
 
1085
+ // ---------------------------------------------------------------------------
1086
+ // create (create follow-up ticket draft only)
1087
+ // ---------------------------------------------------------------------------
1088
+
1089
+ async function protocolCreateTicket(args) {
1090
+ const flags = parseFlags(args);
1091
+ const { sessionKey, ticketId } = resolveSessionFlags(flags);
1092
+ const objective = requireFlag(flags, 'objective', undefined);
1093
+ const { platformUrl, agentToken, localSecret } = resolveAuth();
1094
+ const timeoutMs = resolveTimeout(flags);
1095
+ const agentIdentifier = resolveProtocolAgentIdentifier(flags);
1096
+
1097
+ const hasSessionContext = Boolean(sessionKey && ticketId);
1098
+
1099
+ // Follow-up mode: create a draft ticket linked to the current session ticket.
1100
+ if (hasSessionContext) {
1101
+ const body = {
1102
+ sessionKey,
1103
+ ticketId,
1104
+ objective,
1105
+ ...(flags.title ? { title: String(flags.title) } : {}),
1106
+ ...(flags.priority ? { priority: String(flags.priority) } : {}),
1107
+ ...(flags['acceptance-criteria'] ? { acceptanceCriteria: String(flags['acceptance-criteria']) } : {}),
1108
+ ...(flags['available-tools'] ? { availableTools: String(flags['available-tools']) } : {}),
1109
+ ...(flags['execution-target'] ? { executionTarget: String(flags['execution-target']) } : {}),
1110
+ delegate: resolveProtocolTicketDelegate(flags, agentIdentifier)
1111
+ };
1112
+
1113
+ const data = await apiPost(
1114
+ platformUrl,
1115
+ agentToken,
1116
+ localSecret,
1117
+ '/api/protocol/create-ticket',
1118
+ body,
1119
+ timeoutMs
1120
+ );
1121
+ console.log(JSON.stringify(data, null, 2));
1122
+ return;
1123
+ }
1124
+
1125
+ // Standalone mode: resolve project from cwd/--working-directory first, then create draft ticket.
1126
+ if (sessionKey || ticketId) {
1127
+ throw new Error(
1128
+ 'Provide both --session-key and --ticket-id for follow-up create, or provide neither for standalone create.'
1129
+ );
1130
+ }
1131
+
1132
+ const workingDirectory = String(flags['working-directory'] ?? process.cwd());
1133
+ const discovered = await apiPost(
1134
+ platformUrl,
1135
+ agentToken,
1136
+ localSecret,
1137
+ '/api/protocol/discover-project',
1138
+ { workingDirectory },
1139
+ timeoutMs
1140
+ );
1141
+
1142
+ const projectId = discovered?.project?.id;
1143
+ if (!projectId) {
1144
+ throw new Error(
1145
+ 'Could not resolve project from working directory. Set project local working directory in Overlord or pass --working-directory.'
1146
+ );
1147
+ }
1148
+
1149
+ const standaloneBody = {
1150
+ objective,
1151
+ projectId,
1152
+ ...(flags.title ? { title: String(flags.title) } : {}),
1153
+ ...(flags.priority ? { priority: String(flags.priority) } : {}),
1154
+ ...(flags['acceptance-criteria'] ? { acceptanceCriteria: String(flags['acceptance-criteria']) } : {}),
1155
+ ...(flags['available-tools'] ? { availableTools: String(flags['available-tools']) } : {}),
1156
+ ...(flags['execution-target'] ? { executionTarget: String(flags['execution-target']) } : {}),
1157
+ delegate: resolveProtocolTicketDelegate(flags, agentIdentifier)
1158
+ };
1159
+
1160
+ const data = await apiPost(
1161
+ platformUrl,
1162
+ agentToken,
1163
+ localSecret,
1164
+ '/api/protocol/tickets',
1165
+ standaloneBody,
1166
+ timeoutMs
1167
+ );
1168
+ console.log(JSON.stringify(data, null, 2));
1169
+ }
1170
+
1085
1171
  // ---------------------------------------------------------------------------
1086
1172
  // auth-status (agent-friendly auth diagnostics)
1087
1173
  // ---------------------------------------------------------------------------
@@ -1139,6 +1225,7 @@ Subcommands:
1139
1225
  attach Start a ticket session and return full working context
1140
1226
  connect Start a lightweight session without full context
1141
1227
  load-context Read ticket context without creating a session
1228
+ create Create a draft ticket without attaching (follow-up or standalone)
1142
1229
  spawn Create a follow-up ticket and attach to it immediately
1143
1230
  update Post progress, activity events, and optional change rationales
1144
1231
  record-change-rationales Persist structured change rationales without a progress update
@@ -1335,6 +1422,27 @@ spawn:
1335
1422
  Returns:
1336
1423
  New ticket/session JSON plus SESSION_KEY and TICKET_ID on stderr when available
1337
1424
 
1425
+ create:
1426
+ Purpose:
1427
+ Create a draft ticket without attaching to it.
1428
+ If session flags are provided, creates a follow-up draft linked to the current ticket.
1429
+ If session flags are omitted, resolves project by working directory and creates a standalone draft.
1430
+ Required:
1431
+ --objective <text>
1432
+ Optional:
1433
+ --session-key <key>
1434
+ --ticket-id <id>
1435
+ --working-directory <path> Resolve project by local working directory (default: cwd)
1436
+ --title <text>
1437
+ --priority <level> low | medium | high | urgent
1438
+ --acceptance-criteria <text>
1439
+ --available-tools <text>
1440
+ --execution-target <t> agent | human
1441
+ --delegate <model> Model or delegate identifier that created the ticket
1442
+ --agent <identifier>
1443
+ Returns:
1444
+ New draft ticket JSON (follow-up draft when session flags are provided)
1445
+
1338
1446
  artifact-prepare-upload:
1339
1447
  Required:
1340
1448
  --session-key <key>
@@ -1388,6 +1496,8 @@ Examples:
1388
1496
  ovld protocol attach --ticket-id abc-123 --external-session-id null
1389
1497
  ovld protocol connect --ticket-id abc-123
1390
1498
  ovld protocol load-context --ticket-id abc-123
1499
+ ovld protocol create --objective "Capture follow-up work from this repo"
1500
+ ovld protocol create --session-key <key> --ticket-id <id> --objective "Capture follow-up work"
1391
1501
  ovld protocol spawn --agent codex --objective "Implement user auth" --priority high
1392
1502
  ovld protocol update --session-key <key> --ticket-id <id> --summary "Did X" --phase execute
1393
1503
  ovld protocol update --session-key <key> --ticket-id <id> --summary-file ./update.txt --event-type user_follow_up
@@ -1413,6 +1523,7 @@ Examples:
1413
1523
  if (subcommand === 'attach') { await protocolAttach(args); return; }
1414
1524
  if (subcommand === 'connect') { await protocolConnect(args); return; }
1415
1525
  if (subcommand === 'load-context') { await protocolLoadContext(args); return; }
1526
+ if (subcommand === 'create' || subcommand === 'create-ticket') { await protocolCreateTicket(args); return; }
1416
1527
  if (subcommand === 'spawn') { await protocolSpawn(args); return; }
1417
1528
  if (subcommand === 'artifact-prepare-upload') { await protocolArtifactPrepareUpload(args); return; }
1418
1529
  if (subcommand === 'artifact-finalize-upload') { await protocolArtifactFinalizeUpload(args); return; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "overlord-cli",
3
- "version": "4.11.0",
3
+ "version": "4.13.0",
4
4
  "description": "Overlord CLI — launch AI agents on tickets from anywhere",
5
5
  "type": "module",
6
6
  "bin": {
@@ -71,12 +71,16 @@ For larger delivery payloads, prefer `--payload-file -` and stream the full JSON
71
71
 
72
72
  Use this mode when the conversation starts normally and the user asks Claude to create, inspect, connect to, or otherwise use Overlord.
73
73
 
74
- 1. If the user wants a new ticket, use `/overlord:spawn` or run `ovld protocol spawn --agent claude-code --objective "..."`.
75
- 2. If the user already has a ticket ID and only wants to inspect it, use `/overlord:load` or run `ovld protocol load-context --ticket-id <ticket-id>`.
76
- 3. If the user wants to route the current session onto an existing ticket by ID, use `/overlord:connect` or run `ovld protocol connect --ticket-id <ticket-id>`.
77
- 4. If the user wants to find a ticket but does not know the ID, use `ovld attach` for interactive ticket search and agent launch, or ask the user for the ticket ID if staying strictly inside chat is the better fit.
78
- 5. If you need other lifecycle commands or flags, run `ovld protocol help` and use the real subcommand list instead of guessing.
79
- 6. Once you attach to a ticket, switch back to Mode 1 and follow the full ticket lifecycle.
74
+ 1. If the user wants to create ticket drafts only (do not start execution), run `ovld protocol create --objective "..."`.
75
+ - When `--session-key` and `--ticket-id` are provided, it creates a follow-up draft.
76
+ - When session flags are omitted, it resolves the project by matching current working directory (or `--working-directory`) to Overlord `local_working_directory`, then creates a standalone draft.
77
+ 2. If the user wants to create and start execution immediately, use `/overlord:spawn` or run `ovld protocol spawn --agent claude-code --objective "..."`.
78
+ This creates the ticket in `execute` status and attaches immediately.
79
+ 3. If the user already has a ticket ID and only wants to inspect it, use `/overlord:load` or run `ovld protocol load-context --ticket-id <ticket-id>`.
80
+ 4. If the user wants to route the current session onto an existing ticket by ID, use `/overlord:connect` or run `ovld protocol connect --ticket-id <ticket-id>`.
81
+ 5. If the user wants to find a ticket but does not know the ID, use `ovld attach` for interactive ticket search and agent launch, or ask the user for the ticket ID if staying strictly inside chat is the better fit.
82
+ 6. If you need other lifecycle commands or flags, run `ovld protocol help` and use the real subcommand list instead of guessing.
83
+ 7. Once you attach to a ticket, switch back to Mode 1 and follow the full ticket lifecycle.
80
84
 
81
85
  ## Change Rationales
82
86
 
@@ -102,7 +106,10 @@ Record only meaningful behavioral changes. Skip formatting-only noise.
102
106
 
103
107
  ## Project Discovery And Ticket Creation
104
108
 
105
- When creating tickets from within a repository, `spawn` automatically resolves the correct project from the current working directory. No `--project-id` flag is needed unless you want to override resolution.
109
+ When creating tickets from within a repository:
110
+ - `spawn` automatically resolves the correct project from the current working directory and starts execution.
111
+ - `create` creates a draft follow-up ticket (no auto-attach execution session).
112
+ No `--project-id` flag is needed for `spawn` unless you want to override resolution.
106
113
 
107
114
  ```bash
108
115
  ovld protocol spawn --agent claude-code --objective "Implement feature X" --priority medium