@erdoai/cli 0.38.0 → 0.40.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/README.md +2 -1
- package/dist/index.js +48 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -40,6 +40,7 @@ Env overrides for CI/scripting: `ERDO_API_KEY`, `ERDO_ORG`, `ERDO_API_URL`,
|
|
|
40
40
|
erdo agent ask "what was revenue last week?" --datasets sales
|
|
41
41
|
erdo agent thread --name "landing build" # -> thread id
|
|
42
42
|
erdo agent send <thread> "Build a landing page for ACME ..." --agent erdo.artifact-builder
|
|
43
|
+
erdo agent send <thread> "What should I do next?" --context "Current screen: checkout experiment"
|
|
43
44
|
|
|
44
45
|
erdo pages deploy --title "ACME" --html @page.html --js @page.js --public
|
|
45
46
|
erdo pages list --type html_page
|
|
@@ -96,4 +97,4 @@ git push origin cli-v0.4.1
|
|
|
96
97
|
```
|
|
97
98
|
|
|
98
99
|
The tag's version (`cli-v0.4.1` → `0.4.1`) is the published version; keep
|
|
99
|
-
`cli/package.json` in sync so `erdo --version` matches locally.
|
|
100
|
+
`cli/package.json` in sync so `erdo --version` matches locally.
|
package/dist/index.js
CHANGED
|
@@ -669,6 +669,13 @@ var ErdoClient = class {
|
|
|
669
669
|
body
|
|
670
670
|
);
|
|
671
671
|
}
|
|
672
|
+
configureIntegrationDataset(datasetID, body) {
|
|
673
|
+
return this.request(
|
|
674
|
+
"POST",
|
|
675
|
+
`/v1/integration-datasets/${encodeURIComponent(datasetID)}/configure`,
|
|
676
|
+
body
|
|
677
|
+
);
|
|
678
|
+
}
|
|
672
679
|
// --- integrations ---
|
|
673
680
|
discoverIntegrationTables(integration, schemaName) {
|
|
674
681
|
const qs = schemaName ? `?schema_name=${encodeURIComponent(schemaName)}` : "";
|
|
@@ -750,6 +757,13 @@ var ErdoClient = class {
|
|
|
750
757
|
runHeartbeat(id) {
|
|
751
758
|
return this.request("POST", `/v1/heartbeats/${encodeURIComponent(id)}/run`, {});
|
|
752
759
|
}
|
|
760
|
+
setHeartbeatState(id, state) {
|
|
761
|
+
return this.request(
|
|
762
|
+
"POST",
|
|
763
|
+
`/v1/heartbeats/${encodeURIComponent(id)}/state`,
|
|
764
|
+
{ state }
|
|
765
|
+
);
|
|
766
|
+
}
|
|
753
767
|
// --- kv (named key/value stores, a.k.a. collections) ---
|
|
754
768
|
listKVStores() {
|
|
755
769
|
return this.request("GET", "/v1/kv");
|
|
@@ -2144,6 +2158,9 @@ thread: ${res.thread_id}`);
|
|
|
2144
2158
|
}
|
|
2145
2159
|
});
|
|
2146
2160
|
agentCmd.command("send <threadId> <message>").description("Send a message to a thread and print the agent's reply").option("-a, --agent <key>", "agent to invoke (e.g. erdo.artifact-builder)").option(
|
|
2161
|
+
"--context <text>",
|
|
2162
|
+
"application context for this turn; available to the agent but omitted from the visible user message"
|
|
2163
|
+
).option(
|
|
2147
2164
|
"--sync",
|
|
2148
2165
|
"hold one long HTTP request open until the run finishes, instead of polling. Faster for quick questions; a proxy will time it out on any run over ~100s while the run continues server-side"
|
|
2149
2166
|
).action(async (threadId, message, opts) => {
|
|
@@ -2152,6 +2169,7 @@ agentCmd.command("send <threadId> <message>").description("Send a message to a t
|
|
|
2152
2169
|
const baselineRunID = opts.sync ? void 0 : await client.latestRunID(threadId);
|
|
2153
2170
|
const res = await client.sendMessage(threadId, {
|
|
2154
2171
|
message,
|
|
2172
|
+
context: opts.context,
|
|
2155
2173
|
agent_key: opts.agent,
|
|
2156
2174
|
async: !opts.sync
|
|
2157
2175
|
});
|
|
@@ -2857,6 +2875,20 @@ datasetsCmd.command("from-integration <app>").description("Create a dataset back
|
|
|
2857
2875
|
fail(e);
|
|
2858
2876
|
}
|
|
2859
2877
|
});
|
|
2878
|
+
datasetsCmd.command("configure-integration <dataset-id>").description("Set an integration dataset's segment scope and optionally enable canonical sync").requiredOption("-s, --segments <csv>", "segment names or ids (see: erdo integrations tables <app>)").option("--enable-sync", "enable canonical data-platform sync").action(async (datasetID, opts) => {
|
|
2879
|
+
try {
|
|
2880
|
+
const segments = opts.segments.split(",").map((segment) => segment.trim()).filter(Boolean);
|
|
2881
|
+
const result = await new ErdoClient().configureIntegrationDataset(datasetID, {
|
|
2882
|
+
segments,
|
|
2883
|
+
enable_sync: opts.enableSync
|
|
2884
|
+
});
|
|
2885
|
+
console.log(
|
|
2886
|
+
`Configured dataset ${result.dataset_id}, status: ${result.status}, sync: ${result.sync_enabled ? "enabled" : "unchanged"}`
|
|
2887
|
+
);
|
|
2888
|
+
} catch (e) {
|
|
2889
|
+
fail(e);
|
|
2890
|
+
}
|
|
2891
|
+
});
|
|
2860
2892
|
function printAnalyticsTable(columns, rows) {
|
|
2861
2893
|
const cell = (v) => v === null || v === void 0 ? "" : typeof v === "object" ? JSON.stringify(v) : String(v);
|
|
2862
2894
|
const widths = columns.map((c, i) => Math.max(c.length, ...rows.map((r) => cell(r[i]).length), 0));
|
|
@@ -3057,6 +3089,22 @@ autoCmd.command("run <id>").description("Trigger an automation now").action(asyn
|
|
|
3057
3089
|
fail(e);
|
|
3058
3090
|
}
|
|
3059
3091
|
});
|
|
3092
|
+
autoCmd.command("disable <id>").description("Disable an automation so it stops running").action(async (id) => {
|
|
3093
|
+
try {
|
|
3094
|
+
const h = await new ErdoClient().setHeartbeatState(id, "disabled");
|
|
3095
|
+
console.log(`${h.id} ${h.state} ${h.name}`);
|
|
3096
|
+
} catch (e) {
|
|
3097
|
+
fail(e);
|
|
3098
|
+
}
|
|
3099
|
+
});
|
|
3100
|
+
autoCmd.command("enable <id>").description("Re-enable a disabled automation").action(async (id) => {
|
|
3101
|
+
try {
|
|
3102
|
+
const h = await new ErdoClient().setHeartbeatState(id, "active");
|
|
3103
|
+
console.log(`${h.id} ${h.state} ${h.name}`);
|
|
3104
|
+
} catch (e) {
|
|
3105
|
+
fail(e);
|
|
3106
|
+
}
|
|
3107
|
+
});
|
|
3060
3108
|
var kvCmd = program.command("kv").description("Named key/value stores");
|
|
3061
3109
|
kvCmd.command("list").description("List KV stores").action(async () => {
|
|
3062
3110
|
try {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@erdoai/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Erdo CLI
|
|
3
|
+
"version": "0.40.0",
|
|
4
|
+
"description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"erdo": "dist/index.js"
|