@erdoai/cli 0.39.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 +25 -0
- package/package.json +1 -1
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)}` : "";
|
|
@@ -2151,6 +2158,9 @@ thread: ${res.thread_id}`);
|
|
|
2151
2158
|
}
|
|
2152
2159
|
});
|
|
2153
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(
|
|
2154
2164
|
"--sync",
|
|
2155
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"
|
|
2156
2166
|
).action(async (threadId, message, opts) => {
|
|
@@ -2159,6 +2169,7 @@ agentCmd.command("send <threadId> <message>").description("Send a message to a t
|
|
|
2159
2169
|
const baselineRunID = opts.sync ? void 0 : await client.latestRunID(threadId);
|
|
2160
2170
|
const res = await client.sendMessage(threadId, {
|
|
2161
2171
|
message,
|
|
2172
|
+
context: opts.context,
|
|
2162
2173
|
agent_key: opts.agent,
|
|
2163
2174
|
async: !opts.sync
|
|
2164
2175
|
});
|
|
@@ -2864,6 +2875,20 @@ datasetsCmd.command("from-integration <app>").description("Create a dataset back
|
|
|
2864
2875
|
fail(e);
|
|
2865
2876
|
}
|
|
2866
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
|
+
});
|
|
2867
2892
|
function printAnalyticsTable(columns, rows) {
|
|
2868
2893
|
const cell = (v) => v === null || v === void 0 ? "" : typeof v === "object" ? JSON.stringify(v) : String(v);
|
|
2869
2894
|
const widths = columns.map((c, i) => Math.max(c.length, ...rows.map((r) => cell(r[i]).length), 0));
|