autotouch-cli 0.2.108__tar.gz → 0.2.112__tar.gz

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.
Files changed (61) hide show
  1. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/PKG-INFO +10 -3
  2. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/README.md +9 -2
  3. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/cli.py +2 -0
  4. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/list_build.py +5 -2
  5. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/sequences.py +170 -1
  6. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/data/CLI_REFERENCE.md +56 -5
  7. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/data/cli-manifest.json +333 -6
  8. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/parser.py +1 -0
  9. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/templates.py +26 -0
  10. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/workflows/registry.py +31 -0
  11. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli.egg-info/PKG-INFO +10 -3
  12. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_shared/list_build_contract.py +2 -2
  13. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/pyproject.toml +1 -1
  14. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/MANIFEST.in +0 -0
  15. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/__init__.py +0 -0
  16. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/cli_contracts.py +0 -0
  17. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/__init__.py +0 -0
  18. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/agents.py +0 -0
  19. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/auth.py +0 -0
  20. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/cells.py +0 -0
  21. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/columns.py +0 -0
  22. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/integrations.py +0 -0
  23. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/jobs.py +0 -0
  24. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/leads.py +0 -0
  25. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/linkedin.py +0 -0
  26. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/outreach.py +0 -0
  27. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/prompts.py +0 -0
  28. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/rows.py +0 -0
  29. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/search.py +0 -0
  30. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/sender_accounts.py +0 -0
  31. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/tables.py +0 -0
  32. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/tasks.py +0 -0
  33. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/webhooks.py +0 -0
  34. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/commands/workspace_secrets.py +0 -0
  35. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/core/__init__.py +0 -0
  36. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/core/auth.py +0 -0
  37. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/core/config.py +0 -0
  38. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/core/csv_import.py +0 -0
  39. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/core/http.py +0 -0
  40. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/core/io.py +0 -0
  41. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/core/output.py +0 -0
  42. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/core/polling.py +0 -0
  43. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/core/run.py +0 -0
  44. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/core/validation.py +0 -0
  45. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/exceptions.py +0 -0
  46. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/mongo_status.py +0 -0
  47. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/parser_groups.py +0 -0
  48. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/sequence_support.py +0 -0
  49. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli/workflows/__init__.py +0 -0
  50. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli.egg-info/SOURCES.txt +0 -0
  51. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli.egg-info/dependency_links.txt +0 -0
  52. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli.egg-info/entry_points.txt +0 -0
  53. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli.egg-info/requires.txt +0 -0
  54. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_cli.egg-info/top_level.txt +0 -0
  55. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_shared/__init__.py +0 -0
  56. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_shared/linkedin_contract.py +0 -0
  57. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_shared/linkedin_filters.py +0 -0
  58. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_shared/product_lifecycle.py +0 -0
  59. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_shared/provider_registry.py +0 -0
  60. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/autotouch_shared/search_contract.py +0 -0
  61. {autotouch_cli-0.2.108 → autotouch_cli-0.2.112}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: autotouch-cli
3
- Version: 0.2.108
3
+ Version: 0.2.112
4
4
  Summary: Autotouch Smart Table CLI
5
5
  Project-URL: Homepage, https://app.autotouch.ai
6
6
  Project-URL: Documentation, https://github.com/nicolonic/autotouch_main/tree/main/docs/research-table/reference
@@ -169,6 +169,7 @@ autotouch rows get --table-id "$TABLE_ID" --row-id "$ROW_ID" --output json
169
169
  - Run controlled slices: `autotouch columns run-next`
170
170
  - Poll authoritative state: `autotouch jobs get`
171
171
  - Create/activate sequences: `autotouch sequences recipe`, `autotouch sequences create`, `autotouch sequences activate`
172
+ - Choose Instantly/Smartlead sender pools for bulk sequences: `autotouch sequences sync-accounts`
172
173
  - Query leads: `autotouch leads query`
173
174
  - Find a lead by email or phone: `autotouch leads query --search '<email-or-phone>' --limit 10`
174
175
  - Create table webhook ingest tokens: `autotouch webhooks rotate`, `autotouch webhooks configure-ingest`, `autotouch webhooks ingest`
@@ -183,9 +184,13 @@ When a user asks to create a campaign sequence, distinguish three separate decis
183
184
 
184
185
  If the user says "automate the sequence" without asking for AI-written sends, choose the template-based automated path. Offer manual AI-draft review as the higher-personalization path, but call out that it creates upfront manual tasks while the system learns.
185
186
 
187
+ For bulk Instantly/Smartlead sequences, email sender accounts live on the provider campaign, not on each enrollment. Use `autotouch sequences sync-accounts --sequence-id <SEQUENCE_ID> --account-selection all_eligible` for the org's eligible provider-account group, or `--account-selection selected --selected-account sender@example.com` for specific provider mailboxes. For personal mailbox or LinkedIn steps, use enrollment sender routing only when the user asks for explicit sender pinning or team routing.
188
+
189
+ Keep `requiredVariables` limited to variables that the sequence actually needs. If a variable is listed there, every provider enrollment must hydrate it from lead context, research-table mappings, or explicit overrides; unused required variables can block an otherwise valid bulk campaign.
190
+
186
191
  Version guard:
187
192
 
188
- - Use `autotouch --version` before relying on recipe defaults. This repo expects `autotouch-cli` `0.2.107` or newer.
193
+ - Use `autotouch --version` before relying on recipe defaults. This repo expects `autotouch-cli` `0.2.112` or newer.
189
194
  - If `python3 -m pip install -U autotouch-cli` upgrades the package but `which autotouch` still points at an older shim, run the upgraded binary directly or fix PATH before creating production sequences.
190
195
  - Before authoring a LinkedIn sequence, inspect the live recipe:
191
196
 
@@ -306,7 +311,7 @@ For automation or agent-driven setup, use:
306
311
  - `autotouch cli-manifest --output json` for the local machine-readable command contract
307
312
  - `autotouch cli-reference` for the shipped parser-generated reference
308
313
  - `autotouch capabilities --output json` for provider/workflow contracts
309
- - `autotouch --version` should be `0.2.107` or newer for structured company list builds without user-supplied keywords, stored list-build input lookup, research-workspace list-build guidance, the cleaned single LinkedIn-sourced list-build path, Exa Company Search up to 100 results, scheduled agent `--target ACCOUNTS|LEADS`, `agents signals --target`, the `agent-to-sequence` and `agent-to-leads` workflow scaffolds, paced HTTP Request column contracts, branch-aware LinkedIn sequence recipes, real agent soft-delete with associated-table handling, research-table sequence handoff assignee and active-sequence-conflict guard config, backend-owned directional source/destination helpers, goal-level workflow plans, website visitor/external intent webhook workflow guidance, create-time agent assignment defaults, company-page signal configuration guidance, sequence authoring warnings when AI draft is mixed with fixed templates, sender-account discovery/management for explicit sequence routing, and mixed parent-row/child-list Sync to Table and Sync to Leads recipe configs
314
+ - `autotouch --version` should be `0.2.112` or newer for structured company list builds without user-supplied keywords, stored list-build input lookup, research-workspace list-build guidance, the cleaned single LinkedIn-sourced list-build path, Exa Company Search up to 100 results, scheduled agent `--target ACCOUNTS|LEADS`, `agents signals --target`, the `agent-to-sequence` and `agent-to-leads` workflow scaffolds, paced HTTP Request column contracts, branch-aware LinkedIn sequence recipes, sequence campaign intake guards before mutating objects, real agent soft-delete with associated-table handling, research-table sequence handoff assignee and active-sequence-conflict guard config, backend-owned directional source/destination helpers, goal-level workflow plans, website visitor/external intent webhook workflow guidance, create-time agent assignment defaults, company-page signal configuration guidance, sequence authoring warnings when AI draft is mixed with fixed templates, sender-account discovery/management for explicit sequence routing, mixed parent-row/child-list Sync to Table and Sync to Leads recipe configs, and company variable guidance for `company_name_clean` versus internal match keys
310
315
  - `autotouch capabilities --output json --select list_builds` for documented list-build inputs such as geography IDs, company size buckets, profile language, and company IDs
311
316
  - `autotouch integrations list` and `autotouch integrations status --provider <provider>` before choosing source/destination workflows
312
317
  - `autotouch workflows plan --type bulk-outreach` and `autotouch workflows scaffold --type bulk-outreach --out-dir workflow` for goal-level workflow planning
@@ -345,6 +350,8 @@ Schema ownership rules:
345
350
 
346
351
  Prompt variables in authored prompts support nested JSON access:
347
352
  - Use flat row variables like `{{company_name}}` for scalar columns.
353
+ - Use `{{company_name_clean}}` in outreach copy when you want a suffix-stripped readable company name (`Acme, Inc.` → `Acme`).
354
+ - Do not use `{{company_name_normalized}}` in outreach copy; it is an internal company match key for fallback lookup/debug use.
348
355
  - Use dotted placeholders like `{{linkedin_lookup.linkedin_url}}` when the source column stores JSON or stringified JSON.
349
356
  - For arrays, use numeric indexes such as `{{contacts.0.email}}`.
350
357
  - This is different from config payload mappings, which use objects like `{ "column": "linkedin_lookup", "path": "linkedin_url" }`.
@@ -144,6 +144,7 @@ autotouch rows get --table-id "$TABLE_ID" --row-id "$ROW_ID" --output json
144
144
  - Run controlled slices: `autotouch columns run-next`
145
145
  - Poll authoritative state: `autotouch jobs get`
146
146
  - Create/activate sequences: `autotouch sequences recipe`, `autotouch sequences create`, `autotouch sequences activate`
147
+ - Choose Instantly/Smartlead sender pools for bulk sequences: `autotouch sequences sync-accounts`
147
148
  - Query leads: `autotouch leads query`
148
149
  - Find a lead by email or phone: `autotouch leads query --search '<email-or-phone>' --limit 10`
149
150
  - Create table webhook ingest tokens: `autotouch webhooks rotate`, `autotouch webhooks configure-ingest`, `autotouch webhooks ingest`
@@ -158,9 +159,13 @@ When a user asks to create a campaign sequence, distinguish three separate decis
158
159
 
159
160
  If the user says "automate the sequence" without asking for AI-written sends, choose the template-based automated path. Offer manual AI-draft review as the higher-personalization path, but call out that it creates upfront manual tasks while the system learns.
160
161
 
162
+ For bulk Instantly/Smartlead sequences, email sender accounts live on the provider campaign, not on each enrollment. Use `autotouch sequences sync-accounts --sequence-id <SEQUENCE_ID> --account-selection all_eligible` for the org's eligible provider-account group, or `--account-selection selected --selected-account sender@example.com` for specific provider mailboxes. For personal mailbox or LinkedIn steps, use enrollment sender routing only when the user asks for explicit sender pinning or team routing.
163
+
164
+ Keep `requiredVariables` limited to variables that the sequence actually needs. If a variable is listed there, every provider enrollment must hydrate it from lead context, research-table mappings, or explicit overrides; unused required variables can block an otherwise valid bulk campaign.
165
+
161
166
  Version guard:
162
167
 
163
- - Use `autotouch --version` before relying on recipe defaults. This repo expects `autotouch-cli` `0.2.107` or newer.
168
+ - Use `autotouch --version` before relying on recipe defaults. This repo expects `autotouch-cli` `0.2.112` or newer.
164
169
  - If `python3 -m pip install -U autotouch-cli` upgrades the package but `which autotouch` still points at an older shim, run the upgraded binary directly or fix PATH before creating production sequences.
165
170
  - Before authoring a LinkedIn sequence, inspect the live recipe:
166
171
 
@@ -281,7 +286,7 @@ For automation or agent-driven setup, use:
281
286
  - `autotouch cli-manifest --output json` for the local machine-readable command contract
282
287
  - `autotouch cli-reference` for the shipped parser-generated reference
283
288
  - `autotouch capabilities --output json` for provider/workflow contracts
284
- - `autotouch --version` should be `0.2.107` or newer for structured company list builds without user-supplied keywords, stored list-build input lookup, research-workspace list-build guidance, the cleaned single LinkedIn-sourced list-build path, Exa Company Search up to 100 results, scheduled agent `--target ACCOUNTS|LEADS`, `agents signals --target`, the `agent-to-sequence` and `agent-to-leads` workflow scaffolds, paced HTTP Request column contracts, branch-aware LinkedIn sequence recipes, real agent soft-delete with associated-table handling, research-table sequence handoff assignee and active-sequence-conflict guard config, backend-owned directional source/destination helpers, goal-level workflow plans, website visitor/external intent webhook workflow guidance, create-time agent assignment defaults, company-page signal configuration guidance, sequence authoring warnings when AI draft is mixed with fixed templates, sender-account discovery/management for explicit sequence routing, and mixed parent-row/child-list Sync to Table and Sync to Leads recipe configs
289
+ - `autotouch --version` should be `0.2.112` or newer for structured company list builds without user-supplied keywords, stored list-build input lookup, research-workspace list-build guidance, the cleaned single LinkedIn-sourced list-build path, Exa Company Search up to 100 results, scheduled agent `--target ACCOUNTS|LEADS`, `agents signals --target`, the `agent-to-sequence` and `agent-to-leads` workflow scaffolds, paced HTTP Request column contracts, branch-aware LinkedIn sequence recipes, sequence campaign intake guards before mutating objects, real agent soft-delete with associated-table handling, research-table sequence handoff assignee and active-sequence-conflict guard config, backend-owned directional source/destination helpers, goal-level workflow plans, website visitor/external intent webhook workflow guidance, create-time agent assignment defaults, company-page signal configuration guidance, sequence authoring warnings when AI draft is mixed with fixed templates, sender-account discovery/management for explicit sequence routing, mixed parent-row/child-list Sync to Table and Sync to Leads recipe configs, and company variable guidance for `company_name_clean` versus internal match keys
285
290
  - `autotouch capabilities --output json --select list_builds` for documented list-build inputs such as geography IDs, company size buckets, profile language, and company IDs
286
291
  - `autotouch integrations list` and `autotouch integrations status --provider <provider>` before choosing source/destination workflows
287
292
  - `autotouch workflows plan --type bulk-outreach` and `autotouch workflows scaffold --type bulk-outreach --out-dir workflow` for goal-level workflow planning
@@ -320,6 +325,8 @@ Schema ownership rules:
320
325
 
321
326
  Prompt variables in authored prompts support nested JSON access:
322
327
  - Use flat row variables like `{{company_name}}` for scalar columns.
328
+ - Use `{{company_name_clean}}` in outreach copy when you want a suffix-stripped readable company name (`Acme, Inc.` → `Acme`).
329
+ - Do not use `{{company_name_normalized}}` in outreach copy; it is an internal company match key for fallback lookup/debug use.
323
330
  - Use dotted placeholders like `{{linkedin_lookup.linkedin_url}}` when the source column stores JSON or stringified JSON.
324
331
  - For arrays, use numeric indexes such as `{{contacts.0.email}}`.
325
332
  - This is different from config payload mappings, which use objects like `{ "column": "linkedin_lookup", "path": "linkedin_url" }`.
@@ -183,6 +183,7 @@ from autotouch_cli.commands.sequences import (
183
183
  cmd_sequences_pause_enrollment as cmd_sequences_pause_enrollment_impl,
184
184
  cmd_sequences_stats as cmd_sequences_stats_impl,
185
185
  cmd_sequences_status as cmd_sequences_status_impl,
186
+ cmd_sequences_sync_accounts as cmd_sequences_sync_accounts_impl,
186
187
  cmd_sequences_update as cmd_sequences_update_impl,
187
188
  )
188
189
  from autotouch_cli.commands.sender_accounts import (
@@ -1554,6 +1555,7 @@ _register("sequences_update", cmd_sequences_update_impl, _sequence_command_runti
1554
1555
  _register("sequences_delete", cmd_sequences_delete_impl, _sequence_command_runtime)
1555
1556
  _register("sequences_clone", cmd_sequences_clone_impl, _sequence_command_runtime)
1556
1557
  _register("sequences_status", cmd_sequences_status_impl, _sequence_command_runtime)
1558
+ _register("sequences_sync_accounts", cmd_sequences_sync_accounts_impl, _sequence_command_runtime)
1557
1559
  _register("sequences_enroll", cmd_sequences_enroll_impl, _sequence_command_runtime)
1558
1560
  _register("sequences_pause_enrollment", cmd_sequences_pause_enrollment_impl, _sequence_command_runtime)
1559
1561
 
@@ -10,6 +10,9 @@ from urllib.parse import urlencode
10
10
  from autotouch_cli.exceptions import AutotouchInputError, AutotouchTimeoutError
11
11
 
12
12
 
13
+ PROVIDER_PAGE_SIZE_MAX = 50
14
+
15
+
13
16
  @dataclass(frozen=True)
14
17
  class ListBuildCommandRuntime:
15
18
  resolve_token: Callable[[Optional[str], bool], Optional[str]]
@@ -56,7 +59,7 @@ def _payload(args: argparse.Namespace, *, runtime: ListBuildCommandRuntime, kind
56
59
  payload: Dict[str, Any] = {
57
60
  "kind": kind,
58
61
  "num_results": max(1, min(int(getattr(args, "num_results", 100) or 100), 10000)),
59
- "page_size": max(1, min(int(getattr(args, "page_size", 25) or 25), 100)),
62
+ "page_size": max(1, min(int(getattr(args, "page_size", 25) or 25), PROVIDER_PAGE_SIZE_MAX)),
60
63
  "filters": filters,
61
64
  }
62
65
  for attr in ("list_name", "keywords", "title"):
@@ -252,7 +255,7 @@ def register_list_build_subcommands(
252
255
  p.add_argument("--data-file", help="Path to list-build payload JSON file")
253
256
  p.add_argument("--list-name", help="Optional display name")
254
257
  p.add_argument("--num-results", type=int, default=100, help="Target result count, 1-10000")
255
- p.add_argument("--page-size", type=int, default=25, help="Provider page size")
258
+ p.add_argument("--page-size", type=int, default=25, help="Provider page size, max 50")
256
259
  p.add_argument("--wait", action="store_true", help="Poll until terminal status")
257
260
  p.add_argument("--poll-interval", type=int, default=5, help="Polling interval seconds for --wait")
258
261
  p.add_argument("--wait-timeout", type=int, default=0, help="Max seconds to wait (0 = no timeout)")
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  import argparse
4
4
  import json
5
+ import re
5
6
  import sys
6
7
  from dataclasses import dataclass
7
8
  from typing import Any, Callable, Dict, List, Optional, Sequence
@@ -19,6 +20,9 @@ from autotouch_cli.sequence_support import (
19
20
  )
20
21
 
21
22
 
23
+ _TEMPLATE_VARIABLE_RE = re.compile(r"\{\{\s*([A-Za-z0-9_.-]+)\s*\}\}")
24
+
25
+
22
26
  @dataclass(frozen=True)
23
27
  class SequenceCommandRuntime:
24
28
  resolve_token: Callable[[Optional[str], bool], Optional[str]]
@@ -149,8 +153,57 @@ def _sequence_template_ai_draft_warnings(payload: Optional[Dict[str, Any]]) -> L
149
153
  return warnings
150
154
 
151
155
 
156
+ def _sequence_template_variables(payload: Optional[Dict[str, Any]]) -> List[str]:
157
+ if not isinstance(payload, dict):
158
+ return []
159
+ steps = payload.get("steps")
160
+ if not isinstance(steps, list):
161
+ return []
162
+ variables: List[str] = []
163
+ for step in steps:
164
+ if not isinstance(step, dict):
165
+ continue
166
+ for field in ("subjectTemplate", "bodyTemplate", "scriptTemplate"):
167
+ value = step.get(field)
168
+ if not isinstance(value, str):
169
+ continue
170
+ variables.extend(match.group(1).strip() for match in _TEMPLATE_VARIABLE_RE.finditer(value))
171
+ return list(dict.fromkeys(variable for variable in variables if variable))
172
+
173
+
174
+ def _sequence_required_variable_warnings(payload: Optional[Dict[str, Any]]) -> List[Dict[str, Any]]:
175
+ if not isinstance(payload, dict):
176
+ return []
177
+ required = payload.get("requiredVariables")
178
+ if not isinstance(required, list):
179
+ return []
180
+ template_variables = set(_sequence_template_variables(payload))
181
+ variable_map = payload.get("variableMap") if isinstance(payload.get("variableMap"), dict) else {}
182
+ warnings: List[Dict[str, Any]] = []
183
+ for raw in required:
184
+ variable = str(raw or "").strip()
185
+ if not variable:
186
+ continue
187
+ if variable in template_variables or variable in variable_map:
188
+ continue
189
+ warnings.append(
190
+ {
191
+ "code": "required_variable_not_used_or_mapped",
192
+ "variable": variable,
193
+ "message": (
194
+ f"requiredVariables includes {variable!r}, but no template uses it and variableMap does not map it. "
195
+ "Provider enrollments will fail unless this value is supplied by the enrollment payload or the variable is removed."
196
+ ),
197
+ }
198
+ )
199
+ return warnings
200
+
201
+
152
202
  def _attach_sequence_authoring_warnings(output: Dict[str, Any], payload: Optional[Dict[str, Any]]) -> Dict[str, Any]:
153
- warnings = _sequence_template_ai_draft_warnings(payload)
203
+ warnings = [
204
+ *_sequence_template_ai_draft_warnings(payload),
205
+ *_sequence_required_variable_warnings(payload),
206
+ ]
154
207
  if not warnings:
155
208
  return output
156
209
  enriched = dict(output)
@@ -165,6 +218,72 @@ def _attach_sequence_authoring_warnings(output: Dict[str, Any], payload: Optiona
165
218
  return enriched
166
219
 
167
220
 
221
+ def _split_account_values(values: Optional[List[str]]) -> List[str]:
222
+ out: List[str] = []
223
+ seen: set[str] = set()
224
+ for raw in values or []:
225
+ for part in str(raw or "").split(","):
226
+ value = part.strip()
227
+ key = value.lower()
228
+ if value and key not in seen:
229
+ seen.add(key)
230
+ out.append(value)
231
+ return out
232
+
233
+
234
+ def _apply_provider_account_config(payload: Dict[str, Any], args: argparse.Namespace) -> Dict[str, Any]:
235
+ provider = str(getattr(args, "bulk_provider", "") or "").strip().lower()
236
+ account_selection = str(getattr(args, "account_selection", "") or "").strip().lower()
237
+ selected_accounts = _split_account_values(getattr(args, "selected_account", None))
238
+ if not provider and not account_selection and not selected_accounts:
239
+ return payload
240
+
241
+ next_payload = dict(payload)
242
+ delivery = dict(next_payload.get("emailDelivery") or {})
243
+ if provider:
244
+ delivery["mode"] = "bulk"
245
+ delivery["bulkProvider"] = provider
246
+ provider_key = str(delivery.get("bulkProvider") or "").strip().lower()
247
+ if account_selection or selected_accounts:
248
+ if provider_key not in {"instantly", "smartlead"}:
249
+ raise AutotouchInputError("--account-selection/--selected-account requires --bulk-provider instantly|smartlead or existing emailDelivery.bulkProvider")
250
+ if selected_accounts and not account_selection:
251
+ account_selection = "selected"
252
+ if not account_selection:
253
+ account_selection = "all_eligible"
254
+ provider_config = dict(delivery.get("providerConfig") or {})
255
+ provider_entry = dict(provider_config.get(provider_key) or {})
256
+ provider_entry["accountSelection"] = account_selection
257
+ if account_selection == "selected":
258
+ if not selected_accounts:
259
+ raise AutotouchInputError("--selected-account is required when --account-selection selected")
260
+ provider_entry["selectedAccounts"] = selected_accounts
261
+ else:
262
+ provider_entry.pop("selectedAccounts", None)
263
+ provider_config[provider_key] = provider_entry
264
+ delivery["providerConfig"] = provider_config
265
+ next_payload["emailDelivery"] = delivery
266
+ return next_payload
267
+
268
+
269
+ def _add_provider_account_arguments(parser: argparse.ArgumentParser) -> None:
270
+ parser.add_argument(
271
+ "--bulk-provider",
272
+ choices=["instantly", "smartlead"],
273
+ help="Set sequence emailDelivery to bulk mode with this provider",
274
+ )
275
+ parser.add_argument(
276
+ "--account-selection",
277
+ choices=["all_eligible", "selected"],
278
+ help="Bulk provider sender pool: all eligible org accounts or selected account emails",
279
+ )
280
+ parser.add_argument(
281
+ "--selected-account",
282
+ action="append",
283
+ help="Bulk provider sender email for --account-selection selected; repeatable or comma-separated",
284
+ )
285
+
286
+
168
287
  def _fetch_sequence_readback(
169
288
  sequence_id: str,
170
289
  args: argparse.Namespace,
@@ -308,6 +427,7 @@ def cmd_sequences_create(args: argparse.Namespace, *, runtime: SequenceCommandRu
308
427
  )
309
428
  if not isinstance(payload, dict):
310
429
  raise AutotouchInputError("sequence create requires --data-json/--data-file with a JSON object")
430
+ payload = _apply_provider_account_config(payload, args)
311
431
 
312
432
  data = runtime.request_api(
313
433
  "POST",
@@ -335,6 +455,7 @@ def cmd_sequences_update(args: argparse.Namespace, *, runtime: SequenceCommandRu
335
455
  )
336
456
  if not isinstance(payload, dict):
337
457
  raise AutotouchInputError("sequence update requires --data-json/--data-file with a JSON object")
458
+ payload = _apply_provider_account_config(payload, args)
338
459
 
339
460
  try:
340
461
  data = runtime.request_api(
@@ -376,6 +497,31 @@ def cmd_sequences_update(args: argparse.Namespace, *, runtime: SequenceCommandRu
376
497
  runtime.print_json(data, args.compact)
377
498
 
378
499
 
500
+ def cmd_sequences_sync_accounts(args: argparse.Namespace, *, runtime: SequenceCommandRuntime) -> None:
501
+ token = runtime.resolve_token(args.token, required=True)
502
+ selected_accounts = _split_account_values(getattr(args, "selected_account", None))
503
+ payload: Dict[str, Any] = {
504
+ "accountSelection": str(getattr(args, "account_selection", "") or "all_eligible").strip(),
505
+ }
506
+ if selected_accounts:
507
+ payload["selectedAccounts"] = selected_accounts
508
+ if bool(getattr(args, "no_refresh", False)):
509
+ payload["refresh"] = False
510
+
511
+ data = runtime.request_api(
512
+ "POST",
513
+ f"/api/sequences/{args.sequence_id}/sync-account-pool",
514
+ base_url=args.base_url,
515
+ token=token,
516
+ use_x_api_key=args.use_x_api_key,
517
+ params=_sequence_mutation_params(args),
518
+ payload=payload,
519
+ timeout=args.timeout,
520
+ verbose=args.verbose,
521
+ )
522
+ runtime.print_json(data, args.compact)
523
+
524
+
379
525
  def cmd_sequences_delete(args: argparse.Namespace, *, runtime: SequenceCommandRuntime) -> None:
380
526
  if not getattr(args, "yes", False):
381
527
  raise AutotouchInputError("sequence delete is destructive. Re-run with --yes to confirm. Only DRAFT or ARCHIVED sequences can be deleted.")
@@ -598,6 +744,7 @@ def register_sequences_subcommands(
598
744
  psqc = sequences_sub.add_parser("create", help="Create a sequence from a JSON payload")
599
745
  psqc.add_argument("--data-json", help="Sequence create payload JSON")
600
746
  psqc.add_argument("--data-file", help="Sequence create payload file path")
747
+ _add_provider_account_arguments(psqc)
601
748
  add_actor_override_argument(psqc)
602
749
  add_api_common_arguments(psqc)
603
750
  psqc.set_defaults(func=handlers["create"])
@@ -609,10 +756,32 @@ def register_sequences_subcommands(
609
756
  psqu.add_argument("--sequence-id", required=True)
610
757
  psqu.add_argument("--data-json", help="Sequence update payload JSON")
611
758
  psqu.add_argument("--data-file", help="Sequence update payload file path")
759
+ _add_provider_account_arguments(psqu)
612
760
  add_actor_override_argument(psqu)
613
761
  add_api_common_arguments(psqu)
614
762
  psqu.set_defaults(func=handlers["update"])
615
763
 
764
+ psqsa = sequences_sub.add_parser(
765
+ "sync-accounts",
766
+ help="Choose and sync Instantly/Smartlead sender accounts for a managed bulk sequence",
767
+ description=(
768
+ "For bulk sequences, sender accounts live on the provider campaign rather than per enrollment. "
769
+ "Use --account-selection all_eligible for the org's eligible provider account group, or "
770
+ "--account-selection selected with --selected-account for specific mailbox emails."
771
+ ),
772
+ )
773
+ psqsa.add_argument("--sequence-id", required=True)
774
+ psqsa.add_argument("--account-selection", choices=["all_eligible", "selected"], default="all_eligible")
775
+ psqsa.add_argument(
776
+ "--selected-account",
777
+ action="append",
778
+ help="Provider sender email when --account-selection selected; repeatable or comma-separated",
779
+ )
780
+ psqsa.add_argument("--no-refresh", action="store_true", help="Use cached provider account snapshot")
781
+ add_actor_override_argument(psqsa)
782
+ add_api_common_arguments(psqsa)
783
+ psqsa.set_defaults(func=handlers["sync_accounts"])
784
+
616
785
  psqdel = sequences_sub.add_parser("delete", help="Delete a DRAFT or ARCHIVED sequence")
617
786
  psqdel.add_argument("--sequence-id", required=True)
618
787
  psqdel.add_argument("--yes", action="store_true", help="Required confirmation flag for destructive delete")
@@ -1,6 +1,6 @@
1
1
  # Autotouch CLI Reference
2
2
 
3
- Generated from the installed parser for `autotouch-cli` `0.2.108`.
3
+ Generated from the installed parser for `autotouch-cli` `0.2.112`.
4
4
  Manifest schema version: `2`.
5
5
 
6
6
  ## Output Modes
@@ -2527,7 +2527,7 @@ Build a company/account list
2527
2527
  - `--data-file` (kind=file; input=file): Path to list-build payload JSON file
2528
2528
  - `--list-name` (kind=string): Optional display name
2529
2529
  - `--num-results` (kind=integer; default=100): Target result count, 1-10000
2530
- - `--page-size` (kind=integer; default=25): Provider page size
2530
+ - `--page-size` (kind=integer; default=25): Provider page size, max 50
2531
2531
  - `--wait` (kind=boolean; when omitted=False; when present=True): Poll until terminal status
2532
2532
  - `--poll-interval` (kind=integer; default=5): Polling interval seconds for --wait
2533
2533
  - `--wait-timeout` (kind=integer; default=0): Max seconds to wait (0 = no timeout)
@@ -2613,7 +2613,7 @@ Build a lead/contact list
2613
2613
  - `--data-file` (kind=file; input=file): Path to list-build payload JSON file
2614
2614
  - `--list-name` (kind=string): Optional display name
2615
2615
  - `--num-results` (kind=integer; default=100): Target result count, 1-10000
2616
- - `--page-size` (kind=integer; default=25): Provider page size
2616
+ - `--page-size` (kind=integer; default=25): Provider page size, max 50
2617
2617
  - `--wait` (kind=boolean; when omitted=False; when present=True): Poll until terminal status
2618
2618
  - `--poll-interval` (kind=integer; default=5): Polling interval seconds for --wait
2619
2619
  - `--wait-timeout` (kind=integer; default=0): Max seconds to wait (0 = no timeout)
@@ -4595,10 +4595,10 @@ Sequence management and enrollment
4595
4595
  - Auth: `varies_by_subcommand`
4596
4596
  - Stability: `stable`
4597
4597
  - Destructive: `no`
4598
- - Subcommands: `list, get, stats, delivery-status, recipe, create, update, delete, clone, status, activate, pause, archive, enroll, pause-enrollment`
4598
+ - Subcommands: `list, get, stats, delivery-status, recipe, create, update, sync-accounts, delete, clone, status, activate, pause, archive, enroll, pause-enrollment`
4599
4599
  - Example:
4600
4600
  - `autotouch sequences [-h]
4601
- {list,get,stats,delivery-status,recipe,create,update,delete,clone,status,activate,pause,archive,enroll,pause-enrollment} ...`
4601
+ {list,get,stats,delivery-status,recipe,create,update,sync-accounts,delete,clone,status,activate,pause,archive,enroll,pause-enrollment} ...`
4602
4602
 
4603
4603
  #### `autotouch sequences activate`
4604
4604
 
@@ -4701,6 +4701,9 @@ Create a sequence from a JSON payload
4701
4701
  - Example:
4702
4702
  - `autotouch sequences create [-h] [--data-json DATA_JSON]
4703
4703
  [--data-file DATA_FILE]
4704
+ [--bulk-provider {instantly,smartlead}]
4705
+ [--account-selection {all_eligible,selected}]
4706
+ [--selected-account SELECTED_ACCOUNT]
4704
4707
  [--actor-user-id ACTOR_USER_ID]
4705
4708
  [--base-url BASE_URL] [--token TOKEN]
4706
4709
  [--use-x-api-key] [--timeout TIMEOUT]
@@ -4710,6 +4713,9 @@ Create a sequence from a JSON payload
4710
4713
  - Options:
4711
4714
  - `--data-json` (kind=json; input=json): Sequence create payload JSON
4712
4715
  - `--data-file` (kind=file; input=file): Sequence create payload file path
4716
+ - `--bulk-provider` (kind=string; choices=instantly,smartlead): Set sequence emailDelivery to bulk mode with this provider
4717
+ - `--account-selection` (kind=string; choices=all_eligible,selected): Bulk provider sender pool: all eligible org accounts or selected account emails
4718
+ - `--selected-account` (kind=string; repeatable; comma-separated): Bulk provider sender email for --account-selection selected; repeatable or comma-separated
4713
4719
  - `--actor-user-id` (kind=string): Optional actor override; must resolve to an active user in the same organization
4714
4720
  - `--base-url` (kind=string; default=https://app.autotouch.ai): API base URL (default: https://app.autotouch.ai)
4715
4721
  - `--token` (kind=string; sensitive): Developer API key / JWT token
@@ -5080,6 +5086,45 @@ Set sequence status
5080
5086
  - `--json-pointer` (kind=string): Extract a JSON pointer from the final result (for example: /id)
5081
5087
  - `--verbose` (kind=boolean; when omitted=False; when present=True): Print request metadata to stderr
5082
5088
 
5089
+ #### `autotouch sequences sync-accounts`
5090
+
5091
+ Choose and sync Instantly/Smartlead sender accounts for a managed bulk sequence
5092
+
5093
+ For bulk sequences, sender accounts live on the provider campaign rather than per enrollment. Use --account-selection all_eligible for the org's eligible provider account group, or --account-selection selected with --selected-account for specific mailbox emails.
5094
+
5095
+ - Auth: `developer_key_or_user_session`
5096
+ - Stability: `stable`
5097
+ - Destructive: `no`
5098
+ - Required flags: `--sequence-id`
5099
+ - Output modes: `json, ndjson, human`
5100
+ - Example:
5101
+ - `autotouch sequences sync-accounts [-h] --sequence-id SEQUENCE_ID
5102
+ [--account-selection {all_eligible,selected}]
5103
+ [--selected-account SELECTED_ACCOUNT]
5104
+ [--no-refresh]
5105
+ [--actor-user-id ACTOR_USER_ID]
5106
+ [--base-url BASE_URL] [--token TOKEN]
5107
+ [--use-x-api-key] [--timeout TIMEOUT]
5108
+ [--output {json,ndjson,human}]
5109
+ [--compact] [--select SELECT |
5110
+ --json-pointer JSON_POINTER]
5111
+ [--verbose]`
5112
+ - Options:
5113
+ - `--sequence-id` (required; kind=string)
5114
+ - `--account-selection` (kind=string; choices=all_eligible,selected; default=all_eligible)
5115
+ - `--selected-account` (kind=string; repeatable; comma-separated): Provider sender email when --account-selection selected; repeatable or comma-separated
5116
+ - `--no-refresh` (kind=boolean; when omitted=False; when present=True): Use cached provider account snapshot
5117
+ - `--actor-user-id` (kind=string): Optional actor override; must resolve to an active user in the same organization
5118
+ - `--base-url` (kind=string; default=https://app.autotouch.ai): API base URL (default: https://app.autotouch.ai)
5119
+ - `--token` (kind=string; sensitive): Developer API key / JWT token
5120
+ - `--use-x-api-key` (kind=boolean; when omitted=False; when present=True): Send token via X-API-Key header
5121
+ - `--timeout` (kind=integer; default=30): HTTP timeout in seconds
5122
+ - `--output` (kind=string; choices=json,ndjson,human; default=json): Output mode
5123
+ - `--compact` (kind=boolean; when omitted=False; when present=True): Print compact JSON
5124
+ - `--select` (kind=string): Extract a dotted field path from the final result (for example: id or items.0.id)
5125
+ - `--json-pointer` (kind=string): Extract a JSON pointer from the final result (for example: /id)
5126
+ - `--verbose` (kind=boolean; when omitted=False; when present=True): Print request metadata to stderr
5127
+
5083
5128
  #### `autotouch sequences update`
5084
5129
 
5085
5130
  Update a sequence from a JSON payload (schedule changes may rewindow unsent scheduled work)
@@ -5093,6 +5138,9 @@ Update a sequence from a JSON payload (schedule changes may rewindow unsent sche
5093
5138
  - `autotouch sequences update [-h] --sequence-id SEQUENCE_ID
5094
5139
  [--data-json DATA_JSON]
5095
5140
  [--data-file DATA_FILE]
5141
+ [--bulk-provider {instantly,smartlead}]
5142
+ [--account-selection {all_eligible,selected}]
5143
+ [--selected-account SELECTED_ACCOUNT]
5096
5144
  [--actor-user-id ACTOR_USER_ID]
5097
5145
  [--base-url BASE_URL] [--token TOKEN]
5098
5146
  [--use-x-api-key] [--timeout TIMEOUT]
@@ -5103,6 +5151,9 @@ Update a sequence from a JSON payload (schedule changes may rewindow unsent sche
5103
5151
  - `--sequence-id` (required; kind=string)
5104
5152
  - `--data-json` (kind=json; input=json): Sequence update payload JSON
5105
5153
  - `--data-file` (kind=file; input=file): Sequence update payload file path
5154
+ - `--bulk-provider` (kind=string; choices=instantly,smartlead): Set sequence emailDelivery to bulk mode with this provider
5155
+ - `--account-selection` (kind=string; choices=all_eligible,selected): Bulk provider sender pool: all eligible org accounts or selected account emails
5156
+ - `--selected-account` (kind=string; repeatable; comma-separated): Bulk provider sender email for --account-selection selected; repeatable or comma-separated
5106
5157
  - `--actor-user-id` (kind=string): Optional actor override; must resolve to an active user in the same organization
5107
5158
  - `--base-url` (kind=string; default=https://app.autotouch.ai): API base URL (default: https://app.autotouch.ai)
5108
5159
  - `--token` (kind=string; sensitive): Developer API key / JWT token