@automagik/omni 2.260406.1 → 2.260409.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"mock-api.d.ts","sourceRoot":"","sources":["../../src/__tests__/mock-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,YAAY,4BAA4B,CAAC;AAgStD,UAAU,aAAa;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAID;;;;GAIG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,aAAa,CAAC,CA2B3D;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAIlC"}
1
+ {"version":3,"file":"mock-api.d.ts","sourceRoot":"","sources":["../../src/__tests__/mock-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,YAAY,4BAA4B,CAAC;AAmdtD,UAAU,aAAa;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAID;;;;GAIG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,aAAa,CAAC,CA6B3D;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAIlC"}
@@ -4,6 +4,7 @@
4
4
  * omni agents list [--provider <p>] [--inactive-only] [--limit <n>]
5
5
  * omni agents get <id>
6
6
  * omni agents create --name <name> --provider <provider> [--agent-provider <id>] [--model <model>] [--type <type>]
7
+ * omni agents update <id> [--name <name>] [--model <model>] [--provider <provider>] [--agent-provider <id>] [--type <type>] [--active|--inactive]
7
8
  * omni agents delete <id>
8
9
  */
9
10
  import { Command } from 'commander';
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,wBAAgB,mBAAmB,IAAI,OAAO,CAkI7C"}
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0DpC,wBAAgB,mBAAmB,IAAI,OAAO,CA+J7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/commands/events.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkMpC,wBAAgB,mBAAmB,IAAI,OAAO,CA6L7C"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/commands/events.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkMpC,wBAAgB,mBAAmB,IAAI,OAAO,CA6M7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/commands/logs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyCpC,wBAAgB,iBAAiB,IAAI,OAAO,CA4C3C"}
1
+ {"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/commands/logs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgFpC,wBAAgB,iBAAiB,IAAI,OAAO,CAsE3C"}
package/dist/index.js CHANGED
@@ -75939,6 +75939,15 @@ function createOmniClient(config) {
75939
75939
  meta: data?.meta ?? { hasMore: false }
75940
75940
  };
75941
75941
  },
75942
+ async get(id) {
75943
+ const { data, error, response } = await client.GET("/events/{id}", {
75944
+ params: { path: { id } }
75945
+ });
75946
+ throwIfError(response, error);
75947
+ if (!data?.data)
75948
+ throw new OmniApiError("Event not found", "NOT_FOUND", undefined, 404);
75949
+ return data.data;
75950
+ },
75942
75951
  async analytics(params) {
75943
75952
  const { data, error, response } = await client.GET("/events/analytics", {
75944
75953
  params: { query: params }
@@ -76847,6 +76856,16 @@ function createOmniClient(config) {
76847
76856
  throw new OmniApiError("Failed to create agent", "CREATE_FAILED", undefined, response.status);
76848
76857
  return data.data;
76849
76858
  },
76859
+ async update(id, body) {
76860
+ const { data, error, response } = await client.PATCH("/agents/{id}", {
76861
+ params: { path: { id } },
76862
+ body
76863
+ });
76864
+ throwIfError(response, error);
76865
+ if (!data?.data)
76866
+ throw new OmniApiError("Failed to update agent", "UPDATE_FAILED", undefined, response.status);
76867
+ return data.data;
76868
+ },
76850
76869
  async delete(id) {
76851
76870
  const { error, response } = await client.DELETE("/agents/{id}", {
76852
76871
  params: { path: { id } }
@@ -76887,7 +76906,7 @@ import { fileURLToPath } from "url";
76887
76906
  // package.json
76888
76907
  var package_default = {
76889
76908
  name: "@automagik/omni",
76890
- version: "2.260406.1",
76909
+ version: "2.260409.3",
76891
76910
  description: "LLM-optimized CLI for Omni",
76892
76911
  type: "module",
76893
76912
  bin: {
@@ -77656,6 +77675,33 @@ function createRoutesCommand() {
77656
77675
  init_output();
77657
77676
  var VALID_PROVIDERS = ["claude", "agno", "openai", "gemini", "custom", "omni-internal"];
77658
77677
  var VALID_TYPES = ["assistant", "workflow", "team", "tool"];
77678
+ function buildUpdateAgentBody(options) {
77679
+ if (options.active && options.inactive) {
77680
+ error("Cannot combine --active and --inactive.");
77681
+ }
77682
+ if (options.provider !== undefined && !VALID_PROVIDERS.includes(options.provider)) {
77683
+ error(`Invalid provider: ${options.provider}. Valid: ${VALID_PROVIDERS.join(", ")}`);
77684
+ }
77685
+ if (options.type !== undefined && !VALID_TYPES.includes(options.type)) {
77686
+ error(`Invalid type: ${options.type}. Valid: ${VALID_TYPES.join(", ")}`);
77687
+ }
77688
+ const body = {};
77689
+ if (options.name !== undefined)
77690
+ body.name = options.name;
77691
+ if (options.model !== undefined)
77692
+ body.model = options.model;
77693
+ if (options.provider !== undefined)
77694
+ body.provider = options.provider;
77695
+ if (options.agentProvider !== undefined)
77696
+ body.agentProviderId = options.agentProvider;
77697
+ if (options.type !== undefined)
77698
+ body.agentType = options.type;
77699
+ if (options.active)
77700
+ body.isActive = true;
77701
+ if (options.inactive)
77702
+ body.isActive = false;
77703
+ return body;
77704
+ }
77659
77705
  function createAgentsCommand() {
77660
77706
  const agents = new Command("agents").description("Manage AI agent entities");
77661
77707
  agents.command("list").description("List all agents").option("--provider <provider>", `Filter by provider (${VALID_PROVIDERS.join(", ")})`).option("--inactive-only", "Show only inactive agents").option("--limit <n>", "Max results", (v) => {
@@ -77724,6 +77770,19 @@ function createAgentsCommand() {
77724
77770
  error(`Failed to create agent: ${message}`);
77725
77771
  }
77726
77772
  });
77773
+ agents.command("update <id>").description("Update an existing agent (partial patch; omitted fields are preserved)").option("--name <name>", "Agent name").option("--model <model>", "Model identifier (e.g. claude-sonnet-4-6)").option("--provider <provider>", `AI provider (${VALID_PROVIDERS.join(", ")})`).option("--agent-provider <agentProviderId>", "Link to an agent provider configuration").option("--type <type>", `Agent type (${VALID_TYPES.join(", ")})`).option("--active", "Mark agent as active").option("--inactive", "Mark agent as inactive").action(async (id, options) => {
77774
+ const body = buildUpdateAgentBody(options);
77775
+ if (Object.keys(body).length === 0) {
77776
+ error("No fields to update. Pass at least one of --name, --model, --provider, --agent-provider, --type, --active, --inactive.");
77777
+ }
77778
+ try {
77779
+ const agent = await getClient().agents.update(id, body);
77780
+ data(agent);
77781
+ } catch (err) {
77782
+ const message = err instanceof Error ? err.message : "Unknown error";
77783
+ error(`Failed to update agent: ${message}`, undefined, 3);
77784
+ }
77785
+ });
77727
77786
  agents.command("delete <id>").description("Delete an agent (soft-delete, sets inactive)").action(async (id) => {
77728
77787
  const client = getClient();
77729
77788
  try {
@@ -80893,6 +80952,16 @@ function createEventsCommand() {
80893
80952
  error(`Failed to list events: ${message}`);
80894
80953
  }
80895
80954
  });
80955
+ events.command("get <id>").description("Get full details for a single event by ID").action(async (id) => {
80956
+ const client = getClient();
80957
+ try {
80958
+ const event = await client.events.get(id);
80959
+ data(event);
80960
+ } catch (err) {
80961
+ const message = err instanceof Error ? err.message : "Unknown error";
80962
+ error(`Failed to get event: ${message}`);
80963
+ }
80964
+ });
80896
80965
  events.command("search <query>").description("Search events by content").option("--since <time>", "Events since (e.g., 24h, 7d)").option("--limit <n>", "Limit results", (v) => Number.parseInt(v, 10), 50).action(async (query, options) => {
80897
80966
  const client = getClient();
80898
80967
  try {
@@ -83904,9 +83973,27 @@ async function streamProcessLogs(service, lines, follow) {
83904
83973
  });
83905
83974
  await proc.exited;
83906
83975
  }
83976
+ function printVerboseEntry(entry) {
83977
+ const time = new Date(entry.time).toISOString();
83978
+ raw(`${time} [${entry.level.toUpperCase()}] ${entry.module}`);
83979
+ raw(` ${entry.msg}`);
83980
+ if (entry.data && Object.keys(entry.data).length > 0) {
83981
+ for (const [key, value] of Object.entries(entry.data)) {
83982
+ const formatted = typeof value === "string" && value.includes(`
83983
+ `) ? `
83984
+ ${value.split(`
83985
+ `).map((line) => ` ${line}`).join(`
83986
+ `)}` : typeof value === "object" ? JSON.stringify(value, null, 2).split(`
83987
+ `).map((line, idx) => idx === 0 ? line : ` ${line}`).join(`
83988
+ `) : String(value);
83989
+ raw(` ${key}: ${formatted}`);
83990
+ }
83991
+ }
83992
+ raw("");
83993
+ }
83907
83994
  function createLogsCommand() {
83908
83995
  const logs = new Command("logs").description("View system logs");
83909
- logs.argument("[level]", "Log level filter (debug, info, warn, error)").option("--modules <modules>", "Comma-separated module names to filter").option("--limit <n>", "Limit results", (v) => Number.parseInt(v, 10), 100).option("--process [service]", "Stream PM2 process logs (default: api)").option("--follow", "Stream live logs (only with --process)", false).action(async (level, options) => {
83996
+ logs.argument("[level]", "Log level filter (debug, info, warn, error)").option("--modules <modules>", "Comma-separated module names to filter").option("--limit <n>", "Limit results", (v) => Number.parseInt(v, 10), 100).option("--process [service]", "Stream PM2 process logs (default: api)").option("--follow", "Stream live logs (only with --process)", false).option("--json", "Emit raw LogEntry[] as JSON (no truncation, no summary line)", false).option("--verbose", "Multi-line pretty-print with stack traces and data fields", false).action(async (level, options) => {
83910
83997
  if (options?.process !== undefined) {
83911
83998
  const service = typeof options.process === "string" ? options.process : "api";
83912
83999
  await streamProcessLogs(service, options.limit, options.follow);
@@ -83919,6 +84006,22 @@ function createLogsCommand() {
83919
84006
  modules: options?.modules,
83920
84007
  limit: options?.limit
83921
84008
  });
84009
+ if (getCurrentFormat() === "json") {
84010
+ raw(JSON.stringify(result.items, null, 2));
84011
+ await flushStdout();
84012
+ return;
84013
+ }
84014
+ if (options?.verbose) {
84015
+ if (result.items.length === 0) {
84016
+ dim("No logs found.");
84017
+ return;
84018
+ }
84019
+ for (const entry of result.items) {
84020
+ printVerboseEntry(entry);
84021
+ }
84022
+ dim(`Showing ${result.items.length} of ${result.meta.total} logs (buffer: ${result.meta.bufferSize})`);
84023
+ return;
84024
+ }
83922
84025
  const items = result.items.map((l) => ({
83923
84026
  time: new Date(l.time).toISOString(),
83924
84027
  level: l.level,