autotouch-cli 0.2.114__tar.gz → 0.2.116__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.
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/PKG-INFO +47 -16
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/README.md +46 -15
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/cli.py +250 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/cli_contracts.py +1 -0
- autotouch_cli-0.2.116/autotouch_cli/commands/capacity.py +308 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/search.py +9 -10
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/data/CLI_REFERENCE.md +293 -20
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/data/cli-manifest.json +1782 -55
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/parser.py +64 -8
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/templates.py +103 -340
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli.egg-info/PKG-INFO +47 -16
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli.egg-info/SOURCES.txt +5 -3
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_shared/list_build_contract.py +15 -6
- autotouch_cli-0.2.116/autotouch_shared/pipeline_patterns.py +550 -0
- autotouch_cli-0.2.116/autotouch_shared/product_use_cases.py +671 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_shared/provider_registry.py +17 -14
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_shared/search_contract.py +5 -7
- autotouch_cli-0.2.116/autotouch_shared/workflow_plans.py +1164 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/pyproject.toml +2 -2
- autotouch_cli-0.2.114/autotouch_cli/workflows/__init__.py +0 -5
- autotouch_cli-0.2.114/autotouch_cli/workflows/registry.py +0 -470
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/MANIFEST.in +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/__init__.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/__init__.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/agents.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/auth.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/cells.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/columns.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/integrations.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/jobs.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/leads.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/linkedin.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/list_build.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/outreach.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/prompts.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/rows.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/sender_accounts.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/sequences.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/tables.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/tasks.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/webhooks.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/commands/workspace_secrets.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/core/__init__.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/core/auth.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/core/config.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/core/csv_import.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/core/http.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/core/io.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/core/output.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/core/polling.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/core/run.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/core/validation.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/exceptions.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/mongo_status.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/parser_groups.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli/sequence_support.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli.egg-info/dependency_links.txt +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli.egg-info/entry_points.txt +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli.egg-info/requires.txt +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_cli.egg-info/top_level.txt +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_shared/__init__.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_shared/linkedin_contract.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_shared/linkedin_filters.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/autotouch_shared/product_lifecycle.py +0 -0
- {autotouch_cli-0.2.114 → autotouch_cli-0.2.116}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: autotouch-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.116
|
|
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
|
|
@@ -47,6 +47,33 @@ Use the lifecycle to choose commands:
|
|
|
47
47
|
|
|
48
48
|
Smart Table is the operating layer. Most workflows should land records there before enrichment, dedupe, routing, or engagement. Run `autotouch workflows list --output json` for lifecycle-grouped plans.
|
|
49
49
|
|
|
50
|
+
## Codex-Style Agent Use
|
|
51
|
+
|
|
52
|
+
The CLI is designed to be used like a Codex tool surface: inspect the local contract, plan from explicit state, run one bounded primitive, observe authoritative backend state, then continue from the observed IDs.
|
|
53
|
+
|
|
54
|
+
Recommended loop:
|
|
55
|
+
|
|
56
|
+
1. Discover / inspect: `autotouch auth check --output json`, `autotouch capabilities --output json`, `autotouch capabilities operations search "<goal>"`, `autotouch cli-manifest --output json`, and the relevant `recipe` / `schema` command.
|
|
57
|
+
2. Plan: choose a lifecycle workflow from `autotouch workflows list --output json`; prefer Smart Table as the operating layer.
|
|
58
|
+
3. Preview/scaffold: write payloads to files with `recipe` / `schema` / `workflows scaffold` before mutation-heavy runs.
|
|
59
|
+
4. Execute a bounded slice: use `--scope firstN`, `--first-n`, `--unprocessed-only`, `--wait`, or small list-build targets when validating.
|
|
60
|
+
5. Observe: treat `autotouch jobs get`, `rows get`, and `cells get` as source of truth; do not infer success from terminal text alone.
|
|
61
|
+
6. Continue: pass explicit `TABLE_ID`, `ROW_ID`, `COLUMN_ID`, `JOB_ID`, `LEAD_ID`, and `SEQUENCE_ID` values into the next command instead of relying on hidden session state.
|
|
62
|
+
|
|
63
|
+
For the detailed agent operating model, use `docs/research-table/guides/autotouch-cli-agent-playbook.md`. For maintainer rules, use `docs/development/autotouch-cli-architecture.md`. The local Codex reference checkout at `/private/tmp/openai-codex` may be used as inspiration for operating-model patterns only; never make that temporary repository a package dependency or source of truth.
|
|
64
|
+
|
|
65
|
+
Discovery is a phase, not a separate top-level command. Use the existing inspection commands:
|
|
66
|
+
|
|
67
|
+
| Need | Command |
|
|
68
|
+
| --- | --- |
|
|
69
|
+
| Product operations and whether CLI can run them | `autotouch capabilities operations search "<goal>" --cli-available` |
|
|
70
|
+
| Exact operation detail and CLI bindings | `autotouch capabilities operations get <operation_id>` |
|
|
71
|
+
| Goal-level workflow choices | `autotouch workflows list --output json` and `autotouch workflows plan --type <TYPE>` |
|
|
72
|
+
| Current command grammar | `autotouch cli-manifest --output json` or `autotouch cli-reference` |
|
|
73
|
+
| Connected sources and destinations | `autotouch integrations list` and `autotouch integrations status --provider <provider>` |
|
|
74
|
+
| List-build filter IDs and pricing | `autotouch list-build inputs` and `autotouch list-build pricing` |
|
|
75
|
+
| Scheduled-agent signal choices | `autotouch agents signals --target LEADS` or `--target ACCOUNTS` |
|
|
76
|
+
|
|
50
77
|
## Install
|
|
51
78
|
|
|
52
79
|
Released package:
|
|
@@ -54,9 +81,12 @@ Released package:
|
|
|
54
81
|
```bash
|
|
55
82
|
pipx install autotouch-cli
|
|
56
83
|
# or
|
|
57
|
-
pip install autotouch-cli
|
|
84
|
+
python -m pip install autotouch-cli
|
|
85
|
+
|
|
58
86
|
# upgrade
|
|
59
|
-
|
|
87
|
+
pipx upgrade autotouch-cli
|
|
88
|
+
# or
|
|
89
|
+
python -m pip install --upgrade autotouch-cli
|
|
60
90
|
```
|
|
61
91
|
|
|
62
92
|
Unreleased branch or pre-publish build:
|
|
@@ -180,7 +210,7 @@ When a user asks to create a campaign sequence, distinguish these separate decis
|
|
|
180
210
|
|
|
181
211
|
- Manual AI-draft review: `autotouch sequences recipe --type manual_review` (or `create`) sets `executionMode=MANUAL` and `aiDraft=true`; AI drafts content and a human approves/completes each task.
|
|
182
212
|
- Template-based automated send: `autotouch sequences recipe --type automated_template` (or `bulk_automated`) sets `executionMode=AUTOMATED` and `emailSendMode=AUTOMATED` with fixed templates; use this when the user explicitly asks to automate sending without review.
|
|
183
|
-
- LinkedIn-assisted outreach: `autotouch sequences recipe --type linkedin_outreach` uses an automated profile visit followed by manual AI-draft LinkedIn connection, LinkedIn
|
|
213
|
+
- LinkedIn-assisted outreach: `autotouch sequences recipe --type linkedin_outreach` uses an automated profile visit followed by manual AI-draft LinkedIn connection, connected-only LinkedIn chat, and fallback email tasks. Use it only when LinkedIn touches are part of the campaign. Use `LINKEDIN_MESSAGE` for best-available LinkedIn delivery on paths that are not guaranteed to be connected.
|
|
184
214
|
- Research-field routing: `autotouch sequences recipe --type research_field_routing` starts one source-table sequence that routes each enrollment by a research-table column value, such as persona, segment, territory, product line, or campaign path.
|
|
185
215
|
|
|
186
216
|
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.
|
|
@@ -193,7 +223,7 @@ Keep `requiredVariables` limited to variables that the sequence actually needs.
|
|
|
193
223
|
|
|
194
224
|
Version guard:
|
|
195
225
|
|
|
196
|
-
- Use `autotouch --version` before relying on recipe defaults. This repo expects `autotouch-cli` `0.2.
|
|
226
|
+
- Use `autotouch --version` before relying on recipe defaults. This repo expects `autotouch-cli` `0.2.116` or newer.
|
|
197
227
|
- 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.
|
|
198
228
|
- Before authoring a LinkedIn sequence, inspect the live recipe:
|
|
199
229
|
|
|
@@ -201,12 +231,12 @@ Version guard:
|
|
|
201
231
|
autotouch sequences recipe --type linkedin_outreach --output json --compact
|
|
202
232
|
```
|
|
203
233
|
|
|
204
|
-
As of `0.2.
|
|
234
|
+
As of `0.2.115`, that recipe emits:
|
|
205
235
|
|
|
206
236
|
1. `LINKEDIN_VISIT_PROFILE` - `AUTOMATED`
|
|
207
237
|
2. `LINKEDIN_CONNECT` - `MANUAL`, `aiDraft=true`, empty `scriptTemplate`, after 7 minutes
|
|
208
238
|
3. outcome wait for `linkedin_connection_accepted` - up to 7 days
|
|
209
|
-
4. connected branch -> `LINKEDIN_CHAT_MESSAGE` - `MANUAL`, `aiDraft=true
|
|
239
|
+
4. connected branch -> `LINKEDIN_CHAT_MESSAGE` - `MANUAL`, `aiDraft=true`; chat-only after connection acceptance
|
|
210
240
|
5. not-connected branch -> `EMAIL` - `MANUAL`, `emailSendMode=MANUAL`, `aiDraft=true`
|
|
211
241
|
|
|
212
242
|
For one sequence with multiple paths based on a source-table value, inspect the route recipe:
|
|
@@ -225,7 +255,7 @@ Use `autotouch search companies` for Exa Company Search when the target is basic
|
|
|
225
255
|
|
|
226
256
|
Use `autotouch search similar-companies` as a convenience wrapper for Exa Company Search similarity. Prefer `--query` for Exa's documented semantic patterns, such as "companies like Notion", "competitors of Stripe", or "companies working on making space travel cheaper". The older seed fields `company_name`, `company_domain`, and `company_description` remain available when you want the CLI/API to compose that query; it does not use Exa `/findSimilar`.
|
|
227
257
|
|
|
228
|
-
Use `autotouch search people` for provider-hidden people search when the target is niche, semantic, or hard to express with structured filters.
|
|
258
|
+
Use `autotouch search people` for provider-hidden people search when the target is niche, semantic, or hard to express with structured filters. Send `--person-description` / `person_description` as a responsibility, for example "person responsible for endpoint management and SaaS app access", and use only company, domain, or location as optional public-search anchors. The CLI still accepts `--query` as a deprecated alias. Legacy `lead_description`, title, skills, and plural criteria are rejected by the backend people-search contract so the provider does not guess from ambiguous fields. People search currently returns at most 10 results per API call and costs 1 credit per API call.
|
|
229
259
|
|
|
230
260
|
Use `autotouch list-build companies` and `autotouch list-build leads` for structured, repeatable LinkedIn/Sales Navigator list construction. This is the only CLI path for building LinkedIn-sourced company and lead lists. Treat list builds as the sourcing step for the Smart Table research workspace: build company/account records first by default, sync the records to a research table with `autotouch list-build sync-to-table`, then enrich, score, segment, find related leads, attach signals/notes, and continue downstream workflows from that table. Use lead builds directly when the request is explicitly person/contact focused. This path uses Autotouch-managed provider access, so users do not need to connect their own LinkedIn account. Use filters like geography IDs, company size, industry IDs, title/persona, and current company IDs; call `autotouch list-build inputs` for supported values. Durable list builds run as background jobs with status/results endpoints and cost 1 credit per successful non-empty result page.
|
|
231
261
|
|
|
@@ -235,7 +265,7 @@ For structured company builds, start with industry IDs plus geo/company-size fil
|
|
|
235
265
|
|
|
236
266
|
For account-first prospecting from LinkedIn/Sales Navigator, build companies/accounts first, inspect the returned company IDs, then pass those IDs to `autotouch list-build leads --current-company-id ...`. Do not use Exa company search as a default pre-step for every LinkedIn list build; use it when the user's target is genuinely semantic, niche, competitor-based, or not meant to be LinkedIn-sourced.
|
|
237
267
|
|
|
238
|
-
Use `autotouch agents ...` for recurring signal-based discovery. Scheduled agents support `--target ACCOUNTS` for company/account output and `--target LEADS` for people output. Every agent writes a source/signal table for the evidence it used; lead agents then write `candidate_research.candidates[]` on source rows and list-sync those candidates into the lead/candidate output table. LinkedIn engagement lead agents screen all harvested engagers by headline/title before company resolution and final lead scoring; company agents can keep matches in review or auto-promote qualified matches into the Companies workspace. See the agent playbook for the full source-table, candidate-sync,
|
|
268
|
+
Use `autotouch agents ...` for recurring signal-based discovery. Scheduled agents support `--target ACCOUNTS` for company/account output and `--target LEADS` for people output. Every agent writes a source/signal table for the evidence it used; lead agents then write `candidate_research.candidates[]` on source rows and list-sync those candidates into the lead/candidate output table. LinkedIn engagement lead agents screen all harvested engagers by headline/title before company resolution and final lead scoring; company agents can keep matches in review or auto-promote qualified matches into the Companies workspace. See the agent playbook and `docs/systems/scheduled-agents.md` for the full source-table, candidate-sync, company-promotion, and runtime contract.
|
|
239
269
|
|
|
240
270
|
## Workflow Plans
|
|
241
271
|
|
|
@@ -250,7 +280,7 @@ discover -> plan -> scaffold -> run primitives -> inspect
|
|
|
250
280
|
- `autotouch workflows scaffold --type <TYPE> --out-dir <DIR>` writes payload files and a command runbook.
|
|
251
281
|
- `autotouch columns recipe` and `autotouch sequences recipe` remain leaf-level templates.
|
|
252
282
|
|
|
253
|
-
Goal-level workflow types include `
|
|
283
|
+
Goal-level workflow types include `bulk_outreach`, `company_table_to_people`, `table_to_outreach`, `research_to_sequence`, `agent_to_sequence`, `agent_to_leads`, `account_research`, `signal_outreach`, `website_visitors`, `list_build_to_table`, and `system_to_table`. These keep CRM, outreach providers, Autotouch Leads, Autotouch Sequences, scheduled agents, webhooks, visitor sources, external intent sources, and existing Autotouch workspace records as sources/destinations inside one organized workflow layer instead of creating one-off top-level commands.
|
|
254
284
|
|
|
255
285
|
## Sources And Destinations
|
|
256
286
|
|
|
@@ -293,7 +323,7 @@ https://app.autotouch.ai/api/webhooks/tables/<TABLE_ID>/ingest?token=<WEBHOOK_TO
|
|
|
293
323
|
|
|
294
324
|
Use query-token URLs only for no-header providers because URLs may appear in provider logs or history. Rotate the table token if it is exposed.
|
|
295
325
|
|
|
296
|
-
Webhook ingest stores the raw provider object in the `Webhook Payload` JSON column. For website visitor and external intent provider workflows, use `autotouch workflows plan --type
|
|
326
|
+
Webhook ingest stores the raw provider object in the `Webhook Payload` JSON column. For website visitor and external intent provider workflows, use `autotouch workflows plan --type website_visitors` first. The recommended shape is usually two starter tables: one for company-level events and one for person-level events. After a sample payload lands, use `autotouch columns projections` to split provider-specific JSON into stable columns such as `company_domain`, `linkedin_url`, `email`, `page_url`, `event_type`, and `last_seen_at`, then continue with enrichment, email finding, and the chosen destination.
|
|
297
327
|
|
|
298
328
|
CRM round trip:
|
|
299
329
|
|
|
@@ -322,13 +352,14 @@ For automation or agent-driven setup, use:
|
|
|
322
352
|
- `autotouch cli-manifest --output json` for the local machine-readable command contract
|
|
323
353
|
- `autotouch cli-reference` for the shipped parser-generated reference
|
|
324
354
|
- `autotouch capabilities --output json` for provider/workflow contracts
|
|
325
|
-
- `autotouch
|
|
355
|
+
- `autotouch capabilities operations search "find work emails"` and `autotouch capabilities operations get research_table.email_finder` to map product operations to the current CLI command path
|
|
356
|
+
- `autotouch --version` should be `0.2.116` or newer for product-operation discovery via `capabilities operations list/search/get`, 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, `LINKEDIN_MESSAGE` best-available delivery versus `LINKEDIN_CHAT_MESSAGE` chat-only guidance, 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
|
|
326
357
|
- `autotouch capabilities --output json --select list_builds` for documented list-build inputs such as geography IDs, company size buckets, profile language, and company IDs
|
|
327
358
|
- `autotouch integrations list` and `autotouch integrations status --provider <provider>` before choosing source/destination workflows
|
|
328
|
-
- `autotouch workflows plan --type
|
|
329
|
-
- `autotouch workflows plan --type
|
|
330
|
-
- `autotouch workflows plan --type
|
|
331
|
-
- `autotouch workflows plan --type
|
|
359
|
+
- `autotouch workflows plan --type bulk_outreach` and `autotouch workflows scaffold --type bulk_outreach --out-dir workflow` for goal-level workflow planning
|
|
360
|
+
- `autotouch workflows plan --type agent_to_leads` and `autotouch workflows scaffold --type agent_to_leads --out-dir workflow` for scheduled agent discovery into qualified Autotouch Leads without sequence tasks
|
|
361
|
+
- `autotouch workflows plan --type agent_to_sequence` and `autotouch workflows scaffold --type agent_to_sequence --out-dir workflow` for scheduled agent discovery into Autotouch Sequence tasks
|
|
362
|
+
- `autotouch workflows plan --type website_visitors` and `autotouch workflows scaffold --type website_visitors --out-dir workflow` for website visitor or external intent provider webhook workflows
|
|
332
363
|
- `autotouch integrations recipe --type from_crm --provider hubspot` for CRM-to-research-table imports
|
|
333
364
|
- `autotouch columns recipe --type to_crm|to_outreach|to_leads|to_sequence` for research-table destination workflows
|
|
334
365
|
- `autotouch list-build inputs` and `autotouch list-build pricing` before creating durable list-build jobs
|
|
@@ -22,6 +22,33 @@ Use the lifecycle to choose commands:
|
|
|
22
22
|
|
|
23
23
|
Smart Table is the operating layer. Most workflows should land records there before enrichment, dedupe, routing, or engagement. Run `autotouch workflows list --output json` for lifecycle-grouped plans.
|
|
24
24
|
|
|
25
|
+
## Codex-Style Agent Use
|
|
26
|
+
|
|
27
|
+
The CLI is designed to be used like a Codex tool surface: inspect the local contract, plan from explicit state, run one bounded primitive, observe authoritative backend state, then continue from the observed IDs.
|
|
28
|
+
|
|
29
|
+
Recommended loop:
|
|
30
|
+
|
|
31
|
+
1. Discover / inspect: `autotouch auth check --output json`, `autotouch capabilities --output json`, `autotouch capabilities operations search "<goal>"`, `autotouch cli-manifest --output json`, and the relevant `recipe` / `schema` command.
|
|
32
|
+
2. Plan: choose a lifecycle workflow from `autotouch workflows list --output json`; prefer Smart Table as the operating layer.
|
|
33
|
+
3. Preview/scaffold: write payloads to files with `recipe` / `schema` / `workflows scaffold` before mutation-heavy runs.
|
|
34
|
+
4. Execute a bounded slice: use `--scope firstN`, `--first-n`, `--unprocessed-only`, `--wait`, or small list-build targets when validating.
|
|
35
|
+
5. Observe: treat `autotouch jobs get`, `rows get`, and `cells get` as source of truth; do not infer success from terminal text alone.
|
|
36
|
+
6. Continue: pass explicit `TABLE_ID`, `ROW_ID`, `COLUMN_ID`, `JOB_ID`, `LEAD_ID`, and `SEQUENCE_ID` values into the next command instead of relying on hidden session state.
|
|
37
|
+
|
|
38
|
+
For the detailed agent operating model, use `docs/research-table/guides/autotouch-cli-agent-playbook.md`. For maintainer rules, use `docs/development/autotouch-cli-architecture.md`. The local Codex reference checkout at `/private/tmp/openai-codex` may be used as inspiration for operating-model patterns only; never make that temporary repository a package dependency or source of truth.
|
|
39
|
+
|
|
40
|
+
Discovery is a phase, not a separate top-level command. Use the existing inspection commands:
|
|
41
|
+
|
|
42
|
+
| Need | Command |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| Product operations and whether CLI can run them | `autotouch capabilities operations search "<goal>" --cli-available` |
|
|
45
|
+
| Exact operation detail and CLI bindings | `autotouch capabilities operations get <operation_id>` |
|
|
46
|
+
| Goal-level workflow choices | `autotouch workflows list --output json` and `autotouch workflows plan --type <TYPE>` |
|
|
47
|
+
| Current command grammar | `autotouch cli-manifest --output json` or `autotouch cli-reference` |
|
|
48
|
+
| Connected sources and destinations | `autotouch integrations list` and `autotouch integrations status --provider <provider>` |
|
|
49
|
+
| List-build filter IDs and pricing | `autotouch list-build inputs` and `autotouch list-build pricing` |
|
|
50
|
+
| Scheduled-agent signal choices | `autotouch agents signals --target LEADS` or `--target ACCOUNTS` |
|
|
51
|
+
|
|
25
52
|
## Install
|
|
26
53
|
|
|
27
54
|
Released package:
|
|
@@ -29,9 +56,12 @@ Released package:
|
|
|
29
56
|
```bash
|
|
30
57
|
pipx install autotouch-cli
|
|
31
58
|
# or
|
|
32
|
-
pip install autotouch-cli
|
|
59
|
+
python -m pip install autotouch-cli
|
|
60
|
+
|
|
33
61
|
# upgrade
|
|
34
|
-
|
|
62
|
+
pipx upgrade autotouch-cli
|
|
63
|
+
# or
|
|
64
|
+
python -m pip install --upgrade autotouch-cli
|
|
35
65
|
```
|
|
36
66
|
|
|
37
67
|
Unreleased branch or pre-publish build:
|
|
@@ -155,7 +185,7 @@ When a user asks to create a campaign sequence, distinguish these separate decis
|
|
|
155
185
|
|
|
156
186
|
- Manual AI-draft review: `autotouch sequences recipe --type manual_review` (or `create`) sets `executionMode=MANUAL` and `aiDraft=true`; AI drafts content and a human approves/completes each task.
|
|
157
187
|
- Template-based automated send: `autotouch sequences recipe --type automated_template` (or `bulk_automated`) sets `executionMode=AUTOMATED` and `emailSendMode=AUTOMATED` with fixed templates; use this when the user explicitly asks to automate sending without review.
|
|
158
|
-
- LinkedIn-assisted outreach: `autotouch sequences recipe --type linkedin_outreach` uses an automated profile visit followed by manual AI-draft LinkedIn connection, LinkedIn
|
|
188
|
+
- LinkedIn-assisted outreach: `autotouch sequences recipe --type linkedin_outreach` uses an automated profile visit followed by manual AI-draft LinkedIn connection, connected-only LinkedIn chat, and fallback email tasks. Use it only when LinkedIn touches are part of the campaign. Use `LINKEDIN_MESSAGE` for best-available LinkedIn delivery on paths that are not guaranteed to be connected.
|
|
159
189
|
- Research-field routing: `autotouch sequences recipe --type research_field_routing` starts one source-table sequence that routes each enrollment by a research-table column value, such as persona, segment, territory, product line, or campaign path.
|
|
160
190
|
|
|
161
191
|
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.
|
|
@@ -168,7 +198,7 @@ Keep `requiredVariables` limited to variables that the sequence actually needs.
|
|
|
168
198
|
|
|
169
199
|
Version guard:
|
|
170
200
|
|
|
171
|
-
- Use `autotouch --version` before relying on recipe defaults. This repo expects `autotouch-cli` `0.2.
|
|
201
|
+
- Use `autotouch --version` before relying on recipe defaults. This repo expects `autotouch-cli` `0.2.116` or newer.
|
|
172
202
|
- 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.
|
|
173
203
|
- Before authoring a LinkedIn sequence, inspect the live recipe:
|
|
174
204
|
|
|
@@ -176,12 +206,12 @@ Version guard:
|
|
|
176
206
|
autotouch sequences recipe --type linkedin_outreach --output json --compact
|
|
177
207
|
```
|
|
178
208
|
|
|
179
|
-
As of `0.2.
|
|
209
|
+
As of `0.2.115`, that recipe emits:
|
|
180
210
|
|
|
181
211
|
1. `LINKEDIN_VISIT_PROFILE` - `AUTOMATED`
|
|
182
212
|
2. `LINKEDIN_CONNECT` - `MANUAL`, `aiDraft=true`, empty `scriptTemplate`, after 7 minutes
|
|
183
213
|
3. outcome wait for `linkedin_connection_accepted` - up to 7 days
|
|
184
|
-
4. connected branch -> `LINKEDIN_CHAT_MESSAGE` - `MANUAL`, `aiDraft=true
|
|
214
|
+
4. connected branch -> `LINKEDIN_CHAT_MESSAGE` - `MANUAL`, `aiDraft=true`; chat-only after connection acceptance
|
|
185
215
|
5. not-connected branch -> `EMAIL` - `MANUAL`, `emailSendMode=MANUAL`, `aiDraft=true`
|
|
186
216
|
|
|
187
217
|
For one sequence with multiple paths based on a source-table value, inspect the route recipe:
|
|
@@ -200,7 +230,7 @@ Use `autotouch search companies` for Exa Company Search when the target is basic
|
|
|
200
230
|
|
|
201
231
|
Use `autotouch search similar-companies` as a convenience wrapper for Exa Company Search similarity. Prefer `--query` for Exa's documented semantic patterns, such as "companies like Notion", "competitors of Stripe", or "companies working on making space travel cheaper". The older seed fields `company_name`, `company_domain`, and `company_description` remain available when you want the CLI/API to compose that query; it does not use Exa `/findSimilar`.
|
|
202
232
|
|
|
203
|
-
Use `autotouch search people` for provider-hidden people search when the target is niche, semantic, or hard to express with structured filters.
|
|
233
|
+
Use `autotouch search people` for provider-hidden people search when the target is niche, semantic, or hard to express with structured filters. Send `--person-description` / `person_description` as a responsibility, for example "person responsible for endpoint management and SaaS app access", and use only company, domain, or location as optional public-search anchors. The CLI still accepts `--query` as a deprecated alias. Legacy `lead_description`, title, skills, and plural criteria are rejected by the backend people-search contract so the provider does not guess from ambiguous fields. People search currently returns at most 10 results per API call and costs 1 credit per API call.
|
|
204
234
|
|
|
205
235
|
Use `autotouch list-build companies` and `autotouch list-build leads` for structured, repeatable LinkedIn/Sales Navigator list construction. This is the only CLI path for building LinkedIn-sourced company and lead lists. Treat list builds as the sourcing step for the Smart Table research workspace: build company/account records first by default, sync the records to a research table with `autotouch list-build sync-to-table`, then enrich, score, segment, find related leads, attach signals/notes, and continue downstream workflows from that table. Use lead builds directly when the request is explicitly person/contact focused. This path uses Autotouch-managed provider access, so users do not need to connect their own LinkedIn account. Use filters like geography IDs, company size, industry IDs, title/persona, and current company IDs; call `autotouch list-build inputs` for supported values. Durable list builds run as background jobs with status/results endpoints and cost 1 credit per successful non-empty result page.
|
|
206
236
|
|
|
@@ -210,7 +240,7 @@ For structured company builds, start with industry IDs plus geo/company-size fil
|
|
|
210
240
|
|
|
211
241
|
For account-first prospecting from LinkedIn/Sales Navigator, build companies/accounts first, inspect the returned company IDs, then pass those IDs to `autotouch list-build leads --current-company-id ...`. Do not use Exa company search as a default pre-step for every LinkedIn list build; use it when the user's target is genuinely semantic, niche, competitor-based, or not meant to be LinkedIn-sourced.
|
|
212
242
|
|
|
213
|
-
Use `autotouch agents ...` for recurring signal-based discovery. Scheduled agents support `--target ACCOUNTS` for company/account output and `--target LEADS` for people output. Every agent writes a source/signal table for the evidence it used; lead agents then write `candidate_research.candidates[]` on source rows and list-sync those candidates into the lead/candidate output table. LinkedIn engagement lead agents screen all harvested engagers by headline/title before company resolution and final lead scoring; company agents can keep matches in review or auto-promote qualified matches into the Companies workspace. See the agent playbook for the full source-table, candidate-sync,
|
|
243
|
+
Use `autotouch agents ...` for recurring signal-based discovery. Scheduled agents support `--target ACCOUNTS` for company/account output and `--target LEADS` for people output. Every agent writes a source/signal table for the evidence it used; lead agents then write `candidate_research.candidates[]` on source rows and list-sync those candidates into the lead/candidate output table. LinkedIn engagement lead agents screen all harvested engagers by headline/title before company resolution and final lead scoring; company agents can keep matches in review or auto-promote qualified matches into the Companies workspace. See the agent playbook and `docs/systems/scheduled-agents.md` for the full source-table, candidate-sync, company-promotion, and runtime contract.
|
|
214
244
|
|
|
215
245
|
## Workflow Plans
|
|
216
246
|
|
|
@@ -225,7 +255,7 @@ discover -> plan -> scaffold -> run primitives -> inspect
|
|
|
225
255
|
- `autotouch workflows scaffold --type <TYPE> --out-dir <DIR>` writes payload files and a command runbook.
|
|
226
256
|
- `autotouch columns recipe` and `autotouch sequences recipe` remain leaf-level templates.
|
|
227
257
|
|
|
228
|
-
Goal-level workflow types include `
|
|
258
|
+
Goal-level workflow types include `bulk_outreach`, `company_table_to_people`, `table_to_outreach`, `research_to_sequence`, `agent_to_sequence`, `agent_to_leads`, `account_research`, `signal_outreach`, `website_visitors`, `list_build_to_table`, and `system_to_table`. These keep CRM, outreach providers, Autotouch Leads, Autotouch Sequences, scheduled agents, webhooks, visitor sources, external intent sources, and existing Autotouch workspace records as sources/destinations inside one organized workflow layer instead of creating one-off top-level commands.
|
|
229
259
|
|
|
230
260
|
## Sources And Destinations
|
|
231
261
|
|
|
@@ -268,7 +298,7 @@ https://app.autotouch.ai/api/webhooks/tables/<TABLE_ID>/ingest?token=<WEBHOOK_TO
|
|
|
268
298
|
|
|
269
299
|
Use query-token URLs only for no-header providers because URLs may appear in provider logs or history. Rotate the table token if it is exposed.
|
|
270
300
|
|
|
271
|
-
Webhook ingest stores the raw provider object in the `Webhook Payload` JSON column. For website visitor and external intent provider workflows, use `autotouch workflows plan --type
|
|
301
|
+
Webhook ingest stores the raw provider object in the `Webhook Payload` JSON column. For website visitor and external intent provider workflows, use `autotouch workflows plan --type website_visitors` first. The recommended shape is usually two starter tables: one for company-level events and one for person-level events. After a sample payload lands, use `autotouch columns projections` to split provider-specific JSON into stable columns such as `company_domain`, `linkedin_url`, `email`, `page_url`, `event_type`, and `last_seen_at`, then continue with enrichment, email finding, and the chosen destination.
|
|
272
302
|
|
|
273
303
|
CRM round trip:
|
|
274
304
|
|
|
@@ -297,13 +327,14 @@ For automation or agent-driven setup, use:
|
|
|
297
327
|
- `autotouch cli-manifest --output json` for the local machine-readable command contract
|
|
298
328
|
- `autotouch cli-reference` for the shipped parser-generated reference
|
|
299
329
|
- `autotouch capabilities --output json` for provider/workflow contracts
|
|
300
|
-
- `autotouch
|
|
330
|
+
- `autotouch capabilities operations search "find work emails"` and `autotouch capabilities operations get research_table.email_finder` to map product operations to the current CLI command path
|
|
331
|
+
- `autotouch --version` should be `0.2.116` or newer for product-operation discovery via `capabilities operations list/search/get`, 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, `LINKEDIN_MESSAGE` best-available delivery versus `LINKEDIN_CHAT_MESSAGE` chat-only guidance, 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
|
|
301
332
|
- `autotouch capabilities --output json --select list_builds` for documented list-build inputs such as geography IDs, company size buckets, profile language, and company IDs
|
|
302
333
|
- `autotouch integrations list` and `autotouch integrations status --provider <provider>` before choosing source/destination workflows
|
|
303
|
-
- `autotouch workflows plan --type
|
|
304
|
-
- `autotouch workflows plan --type
|
|
305
|
-
- `autotouch workflows plan --type
|
|
306
|
-
- `autotouch workflows plan --type
|
|
334
|
+
- `autotouch workflows plan --type bulk_outreach` and `autotouch workflows scaffold --type bulk_outreach --out-dir workflow` for goal-level workflow planning
|
|
335
|
+
- `autotouch workflows plan --type agent_to_leads` and `autotouch workflows scaffold --type agent_to_leads --out-dir workflow` for scheduled agent discovery into qualified Autotouch Leads without sequence tasks
|
|
336
|
+
- `autotouch workflows plan --type agent_to_sequence` and `autotouch workflows scaffold --type agent_to_sequence --out-dir workflow` for scheduled agent discovery into Autotouch Sequence tasks
|
|
337
|
+
- `autotouch workflows plan --type website_visitors` and `autotouch workflows scaffold --type website_visitors --out-dir workflow` for website visitor or external intent provider webhook workflows
|
|
307
338
|
- `autotouch integrations recipe --type from_crm --provider hubspot` for CRM-to-research-table imports
|
|
308
339
|
- `autotouch columns recipe --type to_crm|to_outreach|to_leads|to_sequence` for research-table destination workflows
|
|
309
340
|
- `autotouch list-build inputs` and `autotouch list-build pricing` before creating durable list-build jobs
|
|
@@ -71,6 +71,12 @@ from autotouch_cli.commands.auth import (
|
|
|
71
71
|
cmd_auth_show as cmd_auth_show_impl,
|
|
72
72
|
cmd_auth_whoami as cmd_auth_whoami_impl,
|
|
73
73
|
)
|
|
74
|
+
from autotouch_cli.commands.capacity import (
|
|
75
|
+
CapacityCommandRuntime as CapacityCommandHandlerRuntime,
|
|
76
|
+
cmd_capacity_channels as cmd_capacity_channels_impl,
|
|
77
|
+
cmd_capacity_overview as cmd_capacity_overview_impl,
|
|
78
|
+
cmd_capacity_recommend as cmd_capacity_recommend_impl,
|
|
79
|
+
)
|
|
74
80
|
from autotouch_cli.commands.jobs import (
|
|
75
81
|
JobCommandRuntime as JobCommandHandlerRuntime,
|
|
76
82
|
cmd_jobs_get as cmd_jobs_get_impl,
|
|
@@ -1349,6 +1355,14 @@ def _prompt_command_runtime() -> PromptCommandHandlerRuntime:
|
|
|
1349
1355
|
)
|
|
1350
1356
|
|
|
1351
1357
|
|
|
1358
|
+
def _capacity_command_runtime() -> CapacityCommandHandlerRuntime:
|
|
1359
|
+
return CapacityCommandHandlerRuntime(
|
|
1360
|
+
resolve_token=_resolve_token,
|
|
1361
|
+
request_api=_request_api,
|
|
1362
|
+
print_json=lambda data, compact=False: _print_json(data, compact=compact),
|
|
1363
|
+
)
|
|
1364
|
+
|
|
1365
|
+
|
|
1352
1366
|
def _workspace_secret_command_runtime() -> WorkspaceSecretCommandHandlerRuntime:
|
|
1353
1367
|
return WorkspaceSecretCommandHandlerRuntime(
|
|
1354
1368
|
resolve_token=_resolve_token,
|
|
@@ -1490,6 +1504,11 @@ _register("prompts_create", cmd_prompts_create_impl, _prompt_command_runtime)
|
|
|
1490
1504
|
_register("prompts_update", cmd_prompts_update_impl, _prompt_command_runtime)
|
|
1491
1505
|
_register("prompts_delete", cmd_prompts_delete_impl, _prompt_command_runtime)
|
|
1492
1506
|
|
|
1507
|
+
# -- Capacity commands --
|
|
1508
|
+
_register("capacity_overview", cmd_capacity_overview_impl, _capacity_command_runtime)
|
|
1509
|
+
_register("capacity_channels", cmd_capacity_channels_impl, _capacity_command_runtime)
|
|
1510
|
+
_register("capacity_recommend", cmd_capacity_recommend_impl, _capacity_command_runtime)
|
|
1511
|
+
|
|
1493
1512
|
# -- Workspace secrets commands --
|
|
1494
1513
|
_register("workspace_secrets_list", cmd_workspace_secrets_list_impl, _workspace_secret_command_runtime)
|
|
1495
1514
|
_register("workspace_secrets_set", cmd_workspace_secrets_set_impl, _workspace_secret_command_runtime)
|
|
@@ -2165,6 +2184,234 @@ def cmd_capabilities(args: argparse.Namespace) -> None:
|
|
|
2165
2184
|
_print_json(data, compact=args.compact)
|
|
2166
2185
|
|
|
2167
2186
|
|
|
2187
|
+
_EXECUTABLE_ACTION_SUPPORT = {"approval_required", "direct_write", "read_only"}
|
|
2188
|
+
|
|
2189
|
+
|
|
2190
|
+
def _fetch_capabilities_payload(args: argparse.Namespace) -> Any:
|
|
2191
|
+
token = _resolve_token(args.token, required=False)
|
|
2192
|
+
return _request_api(
|
|
2193
|
+
"GET",
|
|
2194
|
+
"/api/capabilities",
|
|
2195
|
+
base_url=args.base_url,
|
|
2196
|
+
token=token,
|
|
2197
|
+
use_x_api_key=args.use_x_api_key,
|
|
2198
|
+
timeout=args.timeout,
|
|
2199
|
+
verbose=args.verbose,
|
|
2200
|
+
)
|
|
2201
|
+
|
|
2202
|
+
|
|
2203
|
+
def _fetch_operation_detail(args: argparse.Namespace, operation_id: str) -> Any:
|
|
2204
|
+
token = _resolve_token(args.token, required=False)
|
|
2205
|
+
return _request_api(
|
|
2206
|
+
"GET",
|
|
2207
|
+
f"/api/capabilities/operations/{operation_id}",
|
|
2208
|
+
base_url=args.base_url,
|
|
2209
|
+
token=token,
|
|
2210
|
+
use_x_api_key=args.use_x_api_key,
|
|
2211
|
+
timeout=args.timeout,
|
|
2212
|
+
verbose=args.verbose,
|
|
2213
|
+
)
|
|
2214
|
+
|
|
2215
|
+
|
|
2216
|
+
def _operation_index_from_capabilities(payload: Any) -> List[Dict[str, Any]]:
|
|
2217
|
+
if not isinstance(payload, dict):
|
|
2218
|
+
return []
|
|
2219
|
+
operations = payload.get("operations")
|
|
2220
|
+
if not isinstance(operations, dict):
|
|
2221
|
+
return []
|
|
2222
|
+
index = operations.get("index")
|
|
2223
|
+
if not isinstance(index, list):
|
|
2224
|
+
return []
|
|
2225
|
+
return [entry for entry in index if isinstance(entry, dict)]
|
|
2226
|
+
|
|
2227
|
+
|
|
2228
|
+
def _operation_matches_filters(entry: Dict[str, Any], args: argparse.Namespace) -> bool:
|
|
2229
|
+
surface = getattr(args, "surface", None)
|
|
2230
|
+
if surface and str(entry.get("surface") or "") != str(surface):
|
|
2231
|
+
return False
|
|
2232
|
+
cli_status = getattr(args, "cli_status", None)
|
|
2233
|
+
if cli_status and str(entry.get("cli_status") or "") != str(cli_status):
|
|
2234
|
+
return False
|
|
2235
|
+
if bool(getattr(args, "cli_available", False)) and bool(entry.get("cli_available")) is not True:
|
|
2236
|
+
return False
|
|
2237
|
+
if bool(getattr(args, "approval_required", False)) and bool(entry.get("approval_required")) is not True:
|
|
2238
|
+
return False
|
|
2239
|
+
if bool(getattr(args, "no_approval_required", False)) and bool(entry.get("approval_required")) is True:
|
|
2240
|
+
return False
|
|
2241
|
+
if bool(getattr(args, "executable_only", False)) and str(entry.get("action_support") or "") not in _EXECUTABLE_ACTION_SUPPORT:
|
|
2242
|
+
return False
|
|
2243
|
+
return True
|
|
2244
|
+
|
|
2245
|
+
|
|
2246
|
+
def _operation_matches_query(entry: Dict[str, Any], query: str) -> bool:
|
|
2247
|
+
needle = query.strip().lower()
|
|
2248
|
+
if not needle:
|
|
2249
|
+
return True
|
|
2250
|
+
searchable: List[str] = []
|
|
2251
|
+
for key in ("id", "surface", "label", "description", "action_support", "cli_status"):
|
|
2252
|
+
value = entry.get(key)
|
|
2253
|
+
if value is not None:
|
|
2254
|
+
searchable.append(str(value))
|
|
2255
|
+
tags = entry.get("tags")
|
|
2256
|
+
if isinstance(tags, list):
|
|
2257
|
+
searchable.extend(str(tag) for tag in tags)
|
|
2258
|
+
return needle in " ".join(searchable).lower()
|
|
2259
|
+
|
|
2260
|
+
|
|
2261
|
+
def _filtered_operation_index(args: argparse.Namespace, *, query: Optional[str] = None) -> Tuple[Any, List[Dict[str, Any]]]:
|
|
2262
|
+
payload = _fetch_capabilities_payload(args)
|
|
2263
|
+
entries = [
|
|
2264
|
+
entry
|
|
2265
|
+
for entry in _operation_index_from_capabilities(payload)
|
|
2266
|
+
if _operation_matches_filters(entry, args)
|
|
2267
|
+
and (query is None or _operation_matches_query(entry, query))
|
|
2268
|
+
]
|
|
2269
|
+
return payload, entries
|
|
2270
|
+
|
|
2271
|
+
|
|
2272
|
+
def _operation_index_from_capability_search(payload: Any) -> List[Dict[str, Any]]:
|
|
2273
|
+
if not isinstance(payload, dict):
|
|
2274
|
+
return []
|
|
2275
|
+
results = payload.get("results")
|
|
2276
|
+
if not isinstance(results, list):
|
|
2277
|
+
return []
|
|
2278
|
+
entries: List[Dict[str, Any]] = []
|
|
2279
|
+
for result in results:
|
|
2280
|
+
if not isinstance(result, dict) or result.get("kind") != "operation":
|
|
2281
|
+
continue
|
|
2282
|
+
item = result.get("item")
|
|
2283
|
+
if isinstance(item, dict):
|
|
2284
|
+
entries.append(item)
|
|
2285
|
+
return entries
|
|
2286
|
+
|
|
2287
|
+
|
|
2288
|
+
def _search_operation_index(args: argparse.Namespace, *, query: str) -> Tuple[Any, List[Dict[str, Any]]]:
|
|
2289
|
+
token = _resolve_token(args.token, required=False)
|
|
2290
|
+
params: Dict[str, Any] = {
|
|
2291
|
+
"q": query,
|
|
2292
|
+
"limit": 25,
|
|
2293
|
+
"executable_only": bool(getattr(args, "executable_only", False)),
|
|
2294
|
+
}
|
|
2295
|
+
surface = str(getattr(args, "surface", "") or "").strip()
|
|
2296
|
+
if surface:
|
|
2297
|
+
params["surface"] = surface
|
|
2298
|
+
payload = _request_api(
|
|
2299
|
+
"GET",
|
|
2300
|
+
"/api/capabilities/search",
|
|
2301
|
+
base_url=args.base_url,
|
|
2302
|
+
token=token,
|
|
2303
|
+
use_x_api_key=args.use_x_api_key,
|
|
2304
|
+
params=params,
|
|
2305
|
+
timeout=args.timeout,
|
|
2306
|
+
verbose=args.verbose,
|
|
2307
|
+
)
|
|
2308
|
+
entries = [
|
|
2309
|
+
entry
|
|
2310
|
+
for entry in _operation_index_from_capability_search(payload)
|
|
2311
|
+
if _operation_matches_filters(entry, args)
|
|
2312
|
+
]
|
|
2313
|
+
return payload, entries
|
|
2314
|
+
|
|
2315
|
+
|
|
2316
|
+
def _operation_command_path(operation: Dict[str, Any]) -> str:
|
|
2317
|
+
bindings = operation.get("cli_bindings")
|
|
2318
|
+
if not isinstance(bindings, list):
|
|
2319
|
+
cli = operation.get("cli")
|
|
2320
|
+
if isinstance(cli, dict):
|
|
2321
|
+
bindings = cli.get("bindings")
|
|
2322
|
+
if not isinstance(bindings, list):
|
|
2323
|
+
return "-"
|
|
2324
|
+
paths: List[str] = []
|
|
2325
|
+
for binding in bindings:
|
|
2326
|
+
if not isinstance(binding, dict):
|
|
2327
|
+
continue
|
|
2328
|
+
command_keys = binding.get("command_keys")
|
|
2329
|
+
if not isinstance(command_keys, list):
|
|
2330
|
+
continue
|
|
2331
|
+
for command_key in command_keys:
|
|
2332
|
+
command_text = " ".join(str(command_key).split(".")).strip()
|
|
2333
|
+
if command_text:
|
|
2334
|
+
paths.append(f"autotouch {command_text}")
|
|
2335
|
+
return ", ".join(paths) if paths else "-"
|
|
2336
|
+
|
|
2337
|
+
|
|
2338
|
+
def _enrich_operations_for_human(args: argparse.Namespace, entries: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
|
|
2339
|
+
enriched: List[Dict[str, Any]] = []
|
|
2340
|
+
for entry in entries:
|
|
2341
|
+
operation_id = str(entry.get("id") or "").strip()
|
|
2342
|
+
if not operation_id:
|
|
2343
|
+
enriched.append(entry)
|
|
2344
|
+
continue
|
|
2345
|
+
detail = _fetch_operation_detail(args, operation_id)
|
|
2346
|
+
if isinstance(detail, dict):
|
|
2347
|
+
merged = dict(entry)
|
|
2348
|
+
merged["cli_bindings"] = detail.get("cli_bindings", [])
|
|
2349
|
+
merged["cli"] = detail.get("cli", entry.get("cli"))
|
|
2350
|
+
enriched.append(merged)
|
|
2351
|
+
else:
|
|
2352
|
+
enriched.append(entry)
|
|
2353
|
+
return enriched
|
|
2354
|
+
|
|
2355
|
+
|
|
2356
|
+
def _print_operations_human(entries: List[Dict[str, Any]], *, heading: str) -> None:
|
|
2357
|
+
print(heading)
|
|
2358
|
+
print("-" * len(heading))
|
|
2359
|
+
if not entries:
|
|
2360
|
+
print("No matching operations.")
|
|
2361
|
+
return
|
|
2362
|
+
for entry in entries:
|
|
2363
|
+
operation_id = _as_display(entry.get("id"))
|
|
2364
|
+
label = _as_display(entry.get("label"))
|
|
2365
|
+
support = _as_display(entry.get("action_support"))
|
|
2366
|
+
approval = "approval" if entry.get("approval_required") else "no approval"
|
|
2367
|
+
cli_status = _as_display(entry.get("cli_status"))
|
|
2368
|
+
command_path = _operation_command_path(entry)
|
|
2369
|
+
print(f"{operation_id} | {label}")
|
|
2370
|
+
print(f" support={support} | {approval} | cli={cli_status} | command={command_path}")
|
|
2371
|
+
|
|
2372
|
+
|
|
2373
|
+
def _operation_list_payload(entries: List[Dict[str, Any]], *, query: Optional[str] = None) -> Dict[str, Any]:
|
|
2374
|
+
payload: Dict[str, Any] = {"operations": {"index": entries, "count": len(entries)}}
|
|
2375
|
+
if query is not None:
|
|
2376
|
+
payload["query"] = query
|
|
2377
|
+
return payload
|
|
2378
|
+
|
|
2379
|
+
|
|
2380
|
+
def cmd_capabilities_operations_list(args: argparse.Namespace) -> None:
|
|
2381
|
+
_payload, entries = _filtered_operation_index(args)
|
|
2382
|
+
if OUTPUT_MODE == "human" and not (OUTPUT_SELECT or OUTPUT_JSON_POINTER):
|
|
2383
|
+
_print_operations_human(
|
|
2384
|
+
_enrich_operations_for_human(args, entries),
|
|
2385
|
+
heading="Product operations",
|
|
2386
|
+
)
|
|
2387
|
+
return
|
|
2388
|
+
_print_json(_operation_list_payload(entries), compact=args.compact)
|
|
2389
|
+
|
|
2390
|
+
|
|
2391
|
+
def cmd_capabilities_operations_search(args: argparse.Namespace) -> None:
|
|
2392
|
+
query = str(getattr(args, "query", "") or "")
|
|
2393
|
+
_payload, entries = _search_operation_index(args, query=query)
|
|
2394
|
+
if OUTPUT_MODE == "human" and not (OUTPUT_SELECT or OUTPUT_JSON_POINTER):
|
|
2395
|
+
_print_operations_human(
|
|
2396
|
+
_enrich_operations_for_human(args, entries),
|
|
2397
|
+
heading=f"Product operations matching {query!r}",
|
|
2398
|
+
)
|
|
2399
|
+
return
|
|
2400
|
+
_print_json(_operation_list_payload(entries, query=query), compact=args.compact)
|
|
2401
|
+
|
|
2402
|
+
|
|
2403
|
+
def cmd_capabilities_operations_get(args: argparse.Namespace) -> None:
|
|
2404
|
+
operation_id = str(getattr(args, "operation_id", "") or "").strip()
|
|
2405
|
+
data = _fetch_operation_detail(args, operation_id)
|
|
2406
|
+
if OUTPUT_MODE == "human" and isinstance(data, dict) and not (OUTPUT_SELECT or OUTPUT_JSON_POINTER):
|
|
2407
|
+
_print_operations_human([data], heading="Product operation")
|
|
2408
|
+
description = data.get("description")
|
|
2409
|
+
if description:
|
|
2410
|
+
print(f" description={description}")
|
|
2411
|
+
return
|
|
2412
|
+
_print_json(data, compact=args.compact)
|
|
2413
|
+
|
|
2414
|
+
|
|
2168
2415
|
def cmd_sop(args: argparse.Namespace) -> None:
|
|
2169
2416
|
if args.out_file:
|
|
2170
2417
|
with open(args.out_file, "w", encoding="utf-8") as f:
|
|
@@ -2549,6 +2796,9 @@ def _build_commands_dict() -> Dict[str, Callable]:
|
|
|
2549
2796
|
commands["personal_context_set"] = cmd_personal_context_set
|
|
2550
2797
|
commands["context_resolved"] = cmd_context_resolved
|
|
2551
2798
|
commands["capabilities"] = cmd_capabilities
|
|
2799
|
+
commands["capabilities_operations_list"] = cmd_capabilities_operations_list
|
|
2800
|
+
commands["capabilities_operations_search"] = cmd_capabilities_operations_search
|
|
2801
|
+
commands["capabilities_operations_get"] = cmd_capabilities_operations_get
|
|
2552
2802
|
commands["blacklist_list"] = cmd_blacklist_list
|
|
2553
2803
|
commands["blacklist_add"] = cmd_blacklist_add
|
|
2554
2804
|
commands["blacklist_remove"] = cmd_blacklist_remove
|
|
@@ -40,6 +40,7 @@ _AUTH_MODE_PREFIXES: Tuple[Tuple[str, str], ...] = (
|
|
|
40
40
|
("org-context.", "user_session"),
|
|
41
41
|
("personal-context.", "user_session"),
|
|
42
42
|
("context.", "user_session"),
|
|
43
|
+
("capabilities.", "optional"),
|
|
43
44
|
("workspace-secrets.", "developer_key_or_user_session"),
|
|
44
45
|
("tables.", "developer_key_or_user_session"),
|
|
45
46
|
("blacklist.", "developer_key_or_user_session"),
|