@moda-ai/cli 1.55.17 → 1.55.18
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/cli.js +26 -2
- package/package.json +1 -1
- package/skills/integration/index.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -103,6 +103,9 @@ var daysBackFlag = (fallback) => {
|
|
|
103
103
|
const days = z.number({ invalid_type_error: DAYS_BACK_MESSAGE }).int(DAYS_BACK_MESSAGE).min(1, DAYS_BACK_MESSAGE).max(90, DAYS_BACK_MESSAGE);
|
|
104
104
|
return fallback === undefined ? days.optional() : days.default(fallback).optional();
|
|
105
105
|
};
|
|
106
|
+
var ISO_BOUND_MESSAGE = "must be an ISO 8601 date (2026-10-07) or datetime (2026-10-07T14:30:00Z)";
|
|
107
|
+
var ISO_BOUND = /^\d{4}-\d{2}-\d{2}(?:[Tt ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:[Zz]|[+-]\d{2}:?\d{2})?)?$/;
|
|
108
|
+
var isoBoundFlag = () => z.string().trim().regex(ISO_BOUND, ISO_BOUND_MESSAGE).optional();
|
|
106
109
|
var OverviewSchema = z.object({
|
|
107
110
|
days_back: daysBackFlag(7)
|
|
108
111
|
});
|
|
@@ -124,6 +127,8 @@ var ConversationsSchema = z.object({
|
|
|
124
127
|
cluster_id: z.string().optional(),
|
|
125
128
|
user_id: z.string().optional(),
|
|
126
129
|
time_range: z.enum(["all", "1h", "3d", "24h", "7d", "30d", "90d"]).default("all").optional(),
|
|
130
|
+
since: isoBoundFlag(),
|
|
131
|
+
until: isoBoundFlag(),
|
|
127
132
|
environment: z.enum(["all", "development", "staging", "production"]).default("all").optional(),
|
|
128
133
|
world_state: z.string().max(200).optional(),
|
|
129
134
|
outcome: z.enum(["any", "positive", "negative"]).default("any").optional(),
|
|
@@ -401,6 +406,8 @@ var SearchSchema = z.object({
|
|
|
401
406
|
user_id: z.string().optional(),
|
|
402
407
|
conversation_id: z.string().min(1).max(256).optional(),
|
|
403
408
|
time_range: z.enum(TIME_RANGES).default("all").optional(),
|
|
409
|
+
since: isoBoundFlag(),
|
|
410
|
+
until: isoBoundFlag(),
|
|
404
411
|
limit: z.number().min(1).max(100).default(20).optional(),
|
|
405
412
|
include_tool_io: boolFlag(),
|
|
406
413
|
offset: z.number().min(0).max(1e4).optional()
|
|
@@ -2606,12 +2613,14 @@ Traces flags:
|
|
|
2606
2613
|
--include-world-state Attach each result's world-state summary
|
|
2607
2614
|
--user-id=ID Filter to a single user
|
|
2608
2615
|
--environment=ENV Filter by environment (all|development|staging|production)
|
|
2616
|
+
--since=DATE --until=DATE Absolute UTC bounds: ISO date or datetime, inclusive; a date --until covers that whole day
|
|
2609
2617
|
|
|
2610
2618
|
Search flags:
|
|
2611
2619
|
--mode=keyword|semantic|hybrid Search mode (default hybrid)
|
|
2612
2620
|
--user-id=ID Filter to a single user
|
|
2613
2621
|
--conversation-id=ID Search inside one trace only
|
|
2614
2622
|
--time-range=RANGE Time range filter (all|1h|3d|7d|24h|30d|90d)
|
|
2623
|
+
--since=DATE --until=DATE Absolute UTC bounds: ISO date or datetime, inclusive; a date --until covers that whole day
|
|
2615
2624
|
--limit=N Maximum results to return (1-100, default 20)
|
|
2616
2625
|
|
|
2617
2626
|
World-state flags:
|
|
@@ -3478,6 +3487,10 @@ async function searchFallbackToTraces(params) {
|
|
|
3478
3487
|
query2.set("user_id", params.user_id);
|
|
3479
3488
|
if (params.time_range)
|
|
3480
3489
|
query2.set("time_range", params.time_range);
|
|
3490
|
+
if (params.since)
|
|
3491
|
+
query2.set("since", params.since);
|
|
3492
|
+
if (params.until)
|
|
3493
|
+
query2.set("until", params.until);
|
|
3481
3494
|
query2.set("limit", String(limit));
|
|
3482
3495
|
if (offset > 0)
|
|
3483
3496
|
query2.set("offset", String(offset));
|
|
@@ -3485,6 +3498,8 @@ async function searchFallbackToTraces(params) {
|
|
|
3485
3498
|
`moda traces --search=${shellArg(params.q)}`,
|
|
3486
3499
|
params.user_id ? `--user-id=${shellArg(params.user_id)}` : "",
|
|
3487
3500
|
params.time_range ? `--time-range=${shellArg(params.time_range)}` : "",
|
|
3501
|
+
params.since ? `--since=${shellArg(params.since)}` : "",
|
|
3502
|
+
params.until ? `--until=${shellArg(params.until)}` : "",
|
|
3488
3503
|
`--limit=${limit}`
|
|
3489
3504
|
].filter(Boolean).join(" ");
|
|
3490
3505
|
let traces;
|
|
@@ -4235,6 +4250,10 @@ async function runCommand(command, positional, flags, positionals = positional ?
|
|
|
4235
4250
|
query2.set("user_id", params.user_id);
|
|
4236
4251
|
if (params.time_range)
|
|
4237
4252
|
query2.set("time_range", params.time_range);
|
|
4253
|
+
if (params.since)
|
|
4254
|
+
query2.set("since", params.since);
|
|
4255
|
+
if (params.until)
|
|
4256
|
+
query2.set("until", params.until);
|
|
4238
4257
|
if (params.environment)
|
|
4239
4258
|
query2.set("environment", params.environment);
|
|
4240
4259
|
if (params.world_state)
|
|
@@ -4280,7 +4299,7 @@ async function runCommand(command, positional, flags, positionals = positional ?
|
|
|
4280
4299
|
}
|
|
4281
4300
|
case "search": {
|
|
4282
4301
|
if (!positional || positional.trim() === "") {
|
|
4283
|
-
throw new CliInputError("<query> is required", 'Usage: moda search "<query>" [--mode=keyword|semantic|hybrid] [--user-id=ID] [--conversation-id=ID] [--time-range=RANGE] [--include-tool-io] [--limit=N]');
|
|
4302
|
+
throw new CliInputError("<query> is required", 'Usage: moda search "<query>" [--mode=keyword|semantic|hybrid] [--user-id=ID] [--conversation-id=ID] [--time-range=RANGE] [--since=DATE] [--until=DATE] [--include-tool-io] [--limit=N]');
|
|
4284
4303
|
}
|
|
4285
4304
|
const args = withStringIdFlags(flagsToArgs(flags, "q", positional), flags);
|
|
4286
4305
|
const params = parseCommandFlags(SearchSchema, args, command, { positionalKey: "q" });
|
|
@@ -4294,6 +4313,10 @@ async function runCommand(command, positional, flags, positionals = positional ?
|
|
|
4294
4313
|
query2.set("conversation_id", params.conversation_id);
|
|
4295
4314
|
if (params.time_range)
|
|
4296
4315
|
query2.set("time_range", params.time_range);
|
|
4316
|
+
if (params.since)
|
|
4317
|
+
query2.set("since", params.since);
|
|
4318
|
+
if (params.until)
|
|
4319
|
+
query2.set("until", params.until);
|
|
4297
4320
|
if (params.limit)
|
|
4298
4321
|
query2.set("limit", params.limit.toString());
|
|
4299
4322
|
if (params.include_tool_io)
|
|
@@ -5621,7 +5644,8 @@ var commandRegistry = createCommandRegistry([
|
|
|
5621
5644
|
description: "Search trace messages (keyword, semantic, or hybrid)",
|
|
5622
5645
|
examples: [
|
|
5623
5646
|
'moda search "billing error"',
|
|
5624
|
-
'moda search "refund flow" --mode=semantic --time-range=7d --limit=10'
|
|
5647
|
+
'moda search "refund flow" --mode=semantic --time-range=7d --limit=10',
|
|
5648
|
+
'moda search "area code" --since=2026-10-07 --until=2026-10-07'
|
|
5625
5649
|
],
|
|
5626
5650
|
...dataApiDefaults
|
|
5627
5651
|
}),
|
package/package.json
CHANGED