ethos-cli 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/ethos.js CHANGED
@@ -13,6 +13,7 @@ import { registerHooks } from "../commands/hooks.js";
13
13
  import { registerLists } from "../commands/lists.js";
14
14
  import { registerSkills } from "../commands/skills.js";
15
15
  import { registerTables } from "../commands/tables.js";
16
+ import { registerWorkflows } from "../commands/workflows.js";
16
17
  import { registerWorkspaceContext } from "../commands/workspace-context.js";
17
18
  import { addGlobalOptions } from "../lib/config.js";
18
19
  import { printError } from "../lib/output.js";
@@ -33,6 +34,7 @@ export function createEthosProgram() {
33
34
  registerLists(program);
34
35
  registerSkills(program);
35
36
  registerTables(program);
37
+ registerWorkflows(program);
36
38
  registerWorkspaceContext(program);
37
39
  return program;
38
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ethos.js","sourceRoot":"","sources":["../../src/bin/ethos.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAA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AC,UAAU,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,kBAAkB;IACzB,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9B,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,YAAY,CAAC,KAAK,CAAC,CAAC;IAC9E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,IAAI,kBAAkB,EAAE,EAAE,CAAC;IACzB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACrB,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function registerWorkflows(program: Command): void;
@@ -0,0 +1,148 @@
1
+ import { collect, compactObject, jsonRequest, parsePositiveInteger, pathId, withClient } from "../lib/command-helpers.js";
2
+ import { printResult } from "../lib/output.js";
3
+ const STEP_CONFIG_KEYS = {
4
+ add_to_campaign: "campaign_id",
5
+ add_to_table: "table_id",
6
+ };
7
+ function parseStepOption(value, position) {
8
+ const separator = value.indexOf(":");
9
+ if (separator === -1) {
10
+ throw new Error(`--step must look like <action>:<id> or <action>:<json>, got '${value}'`);
11
+ }
12
+ const actionType = value.slice(0, separator);
13
+ const rest = value.slice(separator + 1);
14
+ let config;
15
+ if (rest.trim().startsWith("{")) {
16
+ config = JSON.parse(rest);
17
+ }
18
+ else {
19
+ const configKey = STEP_CONFIG_KEYS[actionType];
20
+ if (!configKey) {
21
+ throw new Error(`Unknown step action '${actionType}'; pass explicit JSON config as <action>:{"..."}`);
22
+ }
23
+ config = { [configKey]: rest };
24
+ }
25
+ return { position, action_type: actionType, config };
26
+ }
27
+ function parseFilterOption(value) {
28
+ const separator = value.indexOf("=");
29
+ if (separator === -1) {
30
+ throw new Error(`--filter must look like <field>=<value>, got '${value}'`);
31
+ }
32
+ return { field: value.slice(0, separator), op: "equals", value: value.slice(separator + 1) };
33
+ }
34
+ function parseJsonOption(value, name) {
35
+ if (!value)
36
+ return {};
37
+ try {
38
+ const parsed = JSON.parse(value);
39
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
40
+ throw new Error("not an object");
41
+ }
42
+ return parsed;
43
+ }
44
+ catch {
45
+ throw new Error(`${name} must be a JSON object.`);
46
+ }
47
+ }
48
+ export function registerWorkflows(program) {
49
+ const signals = program.command("signals").description("Browse signal types available as workflow triggers");
50
+ const signalsListCommand = signals.command("list").description("List signal types and their config schemas");
51
+ signalsListCommand.action(async () => {
52
+ await withClient(signalsListCommand, async (client, config) => {
53
+ const definitions = await client.request("/v1/signal-defs");
54
+ printResult(config, {
55
+ label: `${definitions.length} signal types`,
56
+ data: definitions,
57
+ });
58
+ });
59
+ });
60
+ const workflows = program.command("workflows").alias("workflow").description("Manage signal-triggered workflows");
61
+ const createCommand = workflows
62
+ .command("create <name>")
63
+ .description("Create a draft workflow from a signal trigger and steps")
64
+ .requiredOption("--signal <key>", "signal key from `ethos signals list`")
65
+ .option("--config <json>", "trigger config JSON for the signal")
66
+ .option("--description <text>", "workflow description")
67
+ .option("--step <action:id-or-json>", "workflow step, e.g. add_to_campaign:<campaign-id> or add_to_table:<table-id>; repeatable", collect, [])
68
+ .option("--filter <field=value>", "only fire when the match payload field equals value; repeatable", collect, [])
69
+ .option("--cooldown <minutes>", "per-person cooldown window in minutes");
70
+ createCommand.action(async (name) => {
71
+ await withClient(createCommand, async (client, config) => {
72
+ const options = createCommand.opts();
73
+ if (options.step.length === 0) {
74
+ throw new Error("At least one --step is required.");
75
+ }
76
+ const payload = compactObject({
77
+ name,
78
+ description: options.description,
79
+ signal_key: options.signal,
80
+ trigger_config: parseJsonOption(options.config, "--config"),
81
+ payload_filters: options.filter.map(parseFilterOption),
82
+ cooldown_minutes: options.cooldown ? parsePositiveInteger(options.cooldown, "--cooldown") : undefined,
83
+ steps: options.step.map((step, index) => parseStepOption(step, index)),
84
+ });
85
+ const detail = await client.request("/v1/workflows", jsonRequest("POST", payload));
86
+ printResult(config, {
87
+ label: `Created draft workflow ${detail.workflow.name} (${detail.workflow.id})`,
88
+ data: detail,
89
+ });
90
+ });
91
+ });
92
+ const listCommand = workflows.command("list").description("List workflows");
93
+ listCommand.action(async () => {
94
+ await withClient(listCommand, async (client, config) => {
95
+ printResult(config, await client.request("/v1/workflows"));
96
+ });
97
+ });
98
+ const getCommand = workflows.command("get <workflow-id>").description("Show a workflow's trigger and steps");
99
+ getCommand.action(async (workflowId) => {
100
+ await withClient(getCommand, async (client, config) => {
101
+ printResult(config, await client.request(`/v1/workflows/${pathId(workflowId)}`));
102
+ });
103
+ });
104
+ const activateCommand = workflows
105
+ .command("activate <workflow-id>")
106
+ .description("Start watching: the workflow fires on new signal matches")
107
+ .option("--backfill", "also process existing activity, then keep watching");
108
+ activateCommand.action(async (workflowId) => {
109
+ await withClient(activateCommand, async (client, config) => {
110
+ const options = activateCommand.opts();
111
+ const detail = await client.request(`/v1/workflows/${pathId(workflowId)}/activate`, jsonRequest("POST", { backfill: Boolean(options.backfill) }));
112
+ printResult(config, {
113
+ label: `Workflow ${detail.workflow.name} is now watching`,
114
+ data: detail,
115
+ });
116
+ });
117
+ });
118
+ const pauseCommand = workflows.command("pause <workflow-id>").description("Pause an active workflow");
119
+ pauseCommand.action(async (workflowId) => {
120
+ await withClient(pauseCommand, async (client, config) => {
121
+ printResult(config, await client.request(`/v1/workflows/${pathId(workflowId)}/pause`, { method: "POST" }));
122
+ });
123
+ });
124
+ const archiveCommand = workflows
125
+ .command("archive <workflow-id>")
126
+ .description("Archive a workflow and release its watcher");
127
+ archiveCommand.action(async (workflowId) => {
128
+ await withClient(archiveCommand, async (client, config) => {
129
+ printResult(config, await client.request(`/v1/workflows/${pathId(workflowId)}/archive`, { method: "POST" }));
130
+ });
131
+ });
132
+ const runsCommand = workflows
133
+ .command("runs <workflow-id>")
134
+ .description("Show the match feed: who matched, when, and step outcomes")
135
+ .option("--limit <count>", "max matches to return (default 50)");
136
+ runsCommand.action(async (workflowId) => {
137
+ await withClient(runsCommand, async (client, config) => {
138
+ const options = runsCommand.opts();
139
+ const limit = options.limit ? parsePositiveInteger(options.limit, "--limit", 200) : 50;
140
+ const feed = await client.request(`/v1/workflows/${pathId(workflowId)}/runs?limit=${limit}`);
141
+ printResult(config, {
142
+ label: `${feed.length} matches`,
143
+ data: feed,
144
+ });
145
+ });
146
+ });
147
+ }
148
+ //# sourceMappingURL=workflows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../src/commands/workflows.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC1H,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAsC/C,MAAM,gBAAgB,GAA2B;IAC/C,eAAe,EAAE,aAAa;IAC9B,YAAY,EAAE,UAAU;CACzB,CAAC;AAEF,SAAS,eAAe,CAAC,KAAa,EAAE,QAAgB;IACtD,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,SAAS,KAAK,CAAC,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,gEAAgE,KAAK,GAAG,CAAC,CAAC;IAC5F,CAAC;IACD,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CA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U,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CACxG,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,SAAS;SAC1B,OAAO,CAAC,oBAAoB,CAAC;SAC7B,WAAW,CAAC,2DAA2D,CAAC;SACxE,MAAM,CAAC,iBAAiB,EAAE,oCAAoC,CAAC,CAAC;IACnE,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,UAAkB,EAAE,EAAE;QAC9C,MAAM,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YACrD,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,EAAsB,CAAC;YACvD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACvF,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAC/B,iBAAiB,MAAM,CAAC,UAAU,CAAC,eAAe,KAAK,EAAE,CAC1D,CAAC;YACF,WAAW,CAAC,MAAM,EAAE;gBAClB,KAAK,EAAE,GAAG,IAAI,CAAC,MAAM,UAAU;gBAC/B,IAAI,EAAE,IAAI;aACX,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ethos-cli",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Commander-based CLI for Ethos table operations",
5
5
  "homepage": "https://github.com/cluster-software/ethos#readme",
6
6
  "repository": {
@@ -22,6 +22,12 @@ Prefer Ethos MCP tools when available:
22
22
  2. Inspect the sample result or open the returned table URL.
23
23
  3. Call `enrich_contact_info` with the returned contact-info column ID and `scope: "empty"`.
24
24
 
25
+ The `table_id` must be a PEOPLE table, never the company table a sourcing run
26
+ started from. After people sourcing, `inspect_table_summary` on the company
27
+ table returns the linked `people_table_id` once it exists; if it does not exist
28
+ yet, call `create_people_table` on the company table first and enrich the table
29
+ it returns.
30
+
25
31
  Use the CLI sections below only when MCP tools are unavailable or the user
26
32
  explicitly asks for the local CLI.
27
33
 
@@ -21,6 +21,10 @@ Prefer Ethos MCP tools when available:
21
21
  3. Poll `get_upload_handoff_status` until it returns a `result_table_id`.
22
22
  4. Use `search_ethos_tools` for table inspection if column/view IDs are needed.
23
23
  5. Call `source_people_from_company_table`, then run a small sample first.
24
+ 6. Poll `inspect_table_summary` on the company table until the sourcing run in
25
+ `recent_runs` is terminal, then call `create_people_table` to materialize the
26
+ linked people table. Run `enrich_contact_info` and campaign steps against
27
+ that people table id, never the company table.
24
28
 
25
29
  Use the CLI/hook sections below only when MCP tools are unavailable or the user
26
30
  explicitly asks for the local CLI. Avoid creating duplicate handoffs when MCP,
@@ -18,8 +18,13 @@ development or an explicitly requested environment.
18
18
  Prefer Ethos MCP tools when available:
19
19
 
20
20
  1. Call `find_people` with the final natural-language query.
21
- 2. Poll `get_find_people_status` with the returned `search_id`.
22
- 3. Return the people table ID/URL, counts, status, and refinement suggestions.
21
+ 2. If the response status is `needs_refinement` with no `search_id`, the query
22
+ was declined before starting; follow the response `next_action` either
23
+ rewrite the query to describe both companies and people, or pivot to
24
+ `create_table` + `source_people_from_company_table` using
25
+ `data.company_names`. Do not retry the same query.
26
+ 3. Poll `get_find_people_status` with the returned `search_id`.
27
+ 4. Return the people table ID/URL, counts, status, and refinement suggestions.
23
28
 
24
29
  Use the CLI sections below only when MCP tools are unavailable or the user
25
30
  explicitly asks for the local CLI.
@@ -130,10 +135,14 @@ ethos find-people start --query "$QUERY" --json
130
135
  Save `response.search_id`, `response.parsedParams`, `response.status`, and
131
136
  `response.progressMessage`.
132
137
 
133
- If the command returns `success: false`, inspect `error.suggestedAction` and
134
- `error.parsedParams`. When `suggestedAction` is not `combinedSearch`, tell the
135
- user the parser understood only company criteria or only person criteria, then
136
- rewrite the query so it includes both target companies and target individuals.
138
+ If the command returns `success: false`, inspect `error.suggestedAction`,
139
+ `error.companyNames`, and `error.parsedParams`. Queries that name specific
140
+ employers are converted to a search over exactly those companies automatically,
141
+ so a decline means the parse could not be run as-is. When `error.companyNames`
142
+ is non-empty, do not retry the same query; pivot to the
143
+ find-people-at-companies flow (create a company table with those companies and
144
+ run people sourcing on it). Otherwise rewrite the query so it includes both
145
+ target companies and target individuals.
137
146
 
138
147
  After a successful start, summarize the parsed params in plain language. Do not
139
148
  paste the full JSON unless the user asks for it.