@agentuity/cli 1.0.31 → 1.0.33
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/agent-detection.js +1 -1
- package/dist/agent-detection.js.map +1 -1
- package/dist/api.d.ts +1 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +1 -1
- package/dist/api.js.map +1 -1
- package/dist/cache/agent-intro.d.ts.map +1 -1
- package/dist/cache/agent-intro.js.map +1 -1
- package/dist/cache/resource-region.d.ts.map +1 -1
- package/dist/cache/resource-region.js.map +1 -1
- package/dist/cache/user-cache.d.ts.map +1 -1
- package/dist/cache/user-cache.js.map +1 -1
- package/dist/catalyst.d.ts +3 -1
- package/dist/catalyst.d.ts.map +1 -1
- package/dist/catalyst.js +5 -1
- package/dist/catalyst.js.map +1 -1
- package/dist/cmd/ai/opencode/install.js +1 -1
- package/dist/cmd/ai/opencode/install.js.map +1 -1
- package/dist/cmd/build/ast.js +2 -2
- package/dist/cmd/build/ast.js.map +1 -1
- package/dist/cmd/build/patch/_util.d.ts +1 -1
- package/dist/cmd/build/patch/_util.d.ts.map +1 -1
- package/dist/cmd/build/patch/_util.js +2 -2
- package/dist/cmd/build/patch/_util.js.map +1 -1
- package/dist/cmd/build/vite/bun-dev-server.js +9 -1
- package/dist/cmd/build/vite/bun-dev-server.js.map +1 -1
- package/dist/cmd/build/vite/config-loader.js +9 -1
- package/dist/cmd/build/vite/config-loader.js.map +1 -1
- package/dist/cmd/build/vite/registry-generator.js.map +1 -1
- package/dist/cmd/build/vite/server-bundler.js +9 -1
- package/dist/cmd/build/vite/server-bundler.js.map +1 -1
- package/dist/cmd/build/vite/static-renderer.js +11 -3
- package/dist/cmd/build/vite/static-renderer.js.map +1 -1
- package/dist/cmd/build/vite/vite-asset-server-config.js +9 -1
- package/dist/cmd/build/vite/vite-asset-server-config.js.map +1 -1
- package/dist/cmd/build/vite/vite-asset-server.js +9 -1
- package/dist/cmd/build/vite/vite-asset-server.js.map +1 -1
- package/dist/cmd/build/vite/vite-builder.js +10 -2
- package/dist/cmd/build/vite/vite-builder.js.map +1 -1
- package/dist/cmd/build/vite/workbench-generator.d.ts +1 -1
- package/dist/cmd/build/vite/workbench-generator.d.ts.map +1 -1
- package/dist/cmd/build/vite/workbench-generator.js +1 -1
- package/dist/cmd/build/vite/workbench-generator.js.map +1 -1
- package/dist/cmd/cloud/db/create.d.ts.map +1 -1
- package/dist/cmd/cloud/db/create.js +8 -10
- package/dist/cmd/cloud/db/create.js.map +1 -1
- package/dist/cmd/cloud/db/delete.d.ts.map +1 -1
- package/dist/cmd/cloud/db/delete.js +12 -14
- package/dist/cmd/cloud/db/delete.js.map +1 -1
- package/dist/cmd/cloud/db/get.d.ts.map +1 -1
- package/dist/cmd/cloud/db/get.js +7 -7
- package/dist/cmd/cloud/db/get.js.map +1 -1
- package/dist/cmd/cloud/db/list.d.ts.map +1 -1
- package/dist/cmd/cloud/db/list.js +5 -5
- package/dist/cmd/cloud/db/list.js.map +1 -1
- package/dist/cmd/cloud/db/logs.d.ts.map +1 -1
- package/dist/cmd/cloud/db/logs.js +7 -7
- package/dist/cmd/cloud/db/logs.js.map +1 -1
- package/dist/cmd/cloud/db/sql.js +5 -5
- package/dist/cmd/cloud/db/sql.js.map +1 -1
- package/dist/cmd/cloud/db/stats.d.ts.map +1 -1
- package/dist/cmd/cloud/db/stats.js +5 -5
- package/dist/cmd/cloud/db/stats.js.map +1 -1
- package/dist/cmd/cloud/deploy.d.ts.map +1 -1
- package/dist/cmd/cloud/deploy.js +1 -1
- package/dist/cmd/cloud/deploy.js.map +1 -1
- package/dist/cmd/cloud/email/stats.d.ts.map +1 -1
- package/dist/cmd/cloud/email/stats.js +5 -5
- package/dist/cmd/cloud/email/stats.js.map +1 -1
- package/dist/cmd/cloud/email/util.d.ts +2 -2
- package/dist/cmd/cloud/email/util.d.ts.map +1 -1
- package/dist/cmd/cloud/email/util.js +2 -2
- package/dist/cmd/cloud/email/util.js.map +1 -1
- package/dist/cmd/cloud/keyvalue/repl.d.ts.map +1 -1
- package/dist/cmd/cloud/keyvalue/repl.js +4 -2
- package/dist/cmd/cloud/keyvalue/repl.js.map +1 -1
- package/dist/cmd/cloud/keyvalue/search.d.ts.map +1 -1
- package/dist/cmd/cloud/keyvalue/search.js.map +1 -1
- package/dist/cmd/cloud/keyvalue/util.d.ts.map +1 -1
- package/dist/cmd/cloud/keyvalue/util.js +1 -1
- package/dist/cmd/cloud/keyvalue/util.js.map +1 -1
- package/dist/cmd/cloud/machine/delete.d.ts.map +1 -1
- package/dist/cmd/cloud/machine/delete.js +6 -6
- package/dist/cmd/cloud/machine/delete.js.map +1 -1
- package/dist/cmd/cloud/machine/deployments.d.ts.map +1 -1
- package/dist/cmd/cloud/machine/deployments.js +5 -5
- package/dist/cmd/cloud/machine/deployments.js.map +1 -1
- package/dist/cmd/cloud/machine/get.d.ts.map +1 -1
- package/dist/cmd/cloud/machine/get.js +5 -5
- package/dist/cmd/cloud/machine/get.js.map +1 -1
- package/dist/cmd/cloud/machine/list.d.ts.map +1 -1
- package/dist/cmd/cloud/machine/list.js +5 -5
- package/dist/cmd/cloud/machine/list.js.map +1 -1
- package/dist/cmd/cloud/queue/util.d.ts +1 -1
- package/dist/cmd/cloud/queue/util.d.ts.map +1 -1
- package/dist/cmd/cloud/queue/util.js +1 -1
- package/dist/cmd/cloud/queue/util.js.map +1 -1
- package/dist/cmd/cloud/redis/get.js +5 -5
- package/dist/cmd/cloud/redis/get.js.map +1 -1
- package/dist/cmd/cloud/sandbox/cp.js +2 -2
- package/dist/cmd/cloud/sandbox/cp.js.map +1 -1
- package/dist/cmd/cloud/sandbox/execution/get.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/execution/get.js +4 -4
- package/dist/cmd/cloud/sandbox/execution/get.js.map +1 -1
- package/dist/cmd/cloud/sandbox/execution/list.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/execution/list.js +5 -5
- package/dist/cmd/cloud/sandbox/execution/list.js.map +1 -1
- package/dist/cmd/cloud/sandbox/runtime/list.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/runtime/list.js +4 -4
- package/dist/cmd/cloud/sandbox/runtime/list.js.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/build.js +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/build.js.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/create.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/create.js +5 -5
- package/dist/cmd/cloud/sandbox/snapshot/create.js.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/delete.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/delete.js +4 -4
- package/dist/cmd/cloud/sandbox/snapshot/delete.js.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/get.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/get.js +4 -4
- package/dist/cmd/cloud/sandbox/snapshot/get.js.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/list.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/list.js +4 -4
- package/dist/cmd/cloud/sandbox/snapshot/list.js.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/tag.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/tag.js +4 -4
- package/dist/cmd/cloud/sandbox/snapshot/tag.js.map +1 -1
- package/dist/cmd/cloud/sandbox/stats.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/stats.js +5 -5
- package/dist/cmd/cloud/sandbox/stats.js.map +1 -1
- package/dist/cmd/cloud/sandbox/util.d.ts +3 -3
- package/dist/cmd/cloud/sandbox/util.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/util.js +5 -5
- package/dist/cmd/cloud/sandbox/util.js.map +1 -1
- package/dist/cmd/cloud/schedule/stats.d.ts.map +1 -1
- package/dist/cmd/cloud/schedule/stats.js +5 -5
- package/dist/cmd/cloud/schedule/stats.js.map +1 -1
- package/dist/cmd/cloud/schedule/util.d.ts +1 -1
- package/dist/cmd/cloud/schedule/util.d.ts.map +1 -1
- package/dist/cmd/cloud/schedule/util.js +1 -1
- package/dist/cmd/cloud/schedule/util.js.map +1 -1
- package/dist/cmd/cloud/services/stats.d.ts.map +1 -1
- package/dist/cmd/cloud/services/stats.js +5 -5
- package/dist/cmd/cloud/services/stats.js.map +1 -1
- package/dist/cmd/cloud/session/get.d.ts.map +1 -1
- package/dist/cmd/cloud/session/get.js +5 -5
- package/dist/cmd/cloud/session/get.js.map +1 -1
- package/dist/cmd/cloud/session/list.d.ts.map +1 -1
- package/dist/cmd/cloud/session/list.js +5 -5
- package/dist/cmd/cloud/session/list.js.map +1 -1
- package/dist/cmd/cloud/storage/config.d.ts.map +1 -1
- package/dist/cmd/cloud/storage/config.js +8 -9
- package/dist/cmd/cloud/storage/config.js.map +1 -1
- package/dist/cmd/cloud/storage/create.d.ts.map +1 -1
- package/dist/cmd/cloud/storage/create.js +8 -10
- package/dist/cmd/cloud/storage/create.js.map +1 -1
- package/dist/cmd/cloud/storage/delete.d.ts.map +1 -1
- package/dist/cmd/cloud/storage/delete.js +12 -14
- package/dist/cmd/cloud/storage/delete.js.map +1 -1
- package/dist/cmd/cloud/storage/download.d.ts.map +1 -1
- package/dist/cmd/cloud/storage/download.js +6 -6
- package/dist/cmd/cloud/storage/download.js.map +1 -1
- package/dist/cmd/cloud/storage/get.d.ts.map +1 -1
- package/dist/cmd/cloud/storage/get.js +6 -6
- package/dist/cmd/cloud/storage/get.js.map +1 -1
- package/dist/cmd/cloud/storage/list.d.ts.map +1 -1
- package/dist/cmd/cloud/storage/list.js +6 -6
- package/dist/cmd/cloud/storage/list.js.map +1 -1
- package/dist/cmd/cloud/storage/upload.d.ts.map +1 -1
- package/dist/cmd/cloud/storage/upload.js +7 -7
- package/dist/cmd/cloud/storage/upload.js.map +1 -1
- package/dist/cmd/cloud/stream/create.js +1 -1
- package/dist/cmd/cloud/stream/create.js.map +1 -1
- package/dist/cmd/cloud/stream/stats.d.ts.map +1 -1
- package/dist/cmd/cloud/stream/stats.js +5 -5
- package/dist/cmd/cloud/stream/stats.js.map +1 -1
- package/dist/cmd/cloud/task/delete.d.ts.map +1 -1
- package/dist/cmd/cloud/task/delete.js +6 -1
- package/dist/cmd/cloud/task/delete.js.map +1 -1
- package/dist/cmd/cloud/task/stats.d.ts.map +1 -1
- package/dist/cmd/cloud/task/stats.js +5 -5
- package/dist/cmd/cloud/task/stats.js.map +1 -1
- package/dist/cmd/cloud/task/util.d.ts +1 -1
- package/dist/cmd/cloud/task/util.d.ts.map +1 -1
- package/dist/cmd/cloud/task/util.js +2 -2
- package/dist/cmd/cloud/task/util.js.map +1 -1
- package/dist/cmd/cloud/thread/delete.d.ts.map +1 -1
- package/dist/cmd/cloud/thread/delete.js +5 -5
- package/dist/cmd/cloud/thread/delete.js.map +1 -1
- package/dist/cmd/cloud/thread/get.d.ts.map +1 -1
- package/dist/cmd/cloud/thread/get.js +5 -5
- package/dist/cmd/cloud/thread/get.js.map +1 -1
- package/dist/cmd/cloud/thread/list.d.ts.map +1 -1
- package/dist/cmd/cloud/thread/list.js +5 -5
- package/dist/cmd/cloud/thread/list.js.map +1 -1
- package/dist/cmd/cloud/vector/util.d.ts.map +1 -1
- package/dist/cmd/cloud/vector/util.js +1 -1
- package/dist/cmd/cloud/vector/util.js.map +1 -1
- package/dist/cmd/cloud/webhook/util.d.ts +1 -1
- package/dist/cmd/cloud/webhook/util.d.ts.map +1 -1
- package/dist/cmd/cloud/webhook/util.js +1 -1
- package/dist/cmd/cloud/webhook/util.js.map +1 -1
- package/dist/cmd/dev/dev-lock.js +2 -2
- package/dist/cmd/dev/dev-lock.js.map +1 -1
- package/dist/cmd/dev/templates.d.ts.map +1 -1
- package/dist/cmd/dev/templates.js +0 -1
- package/dist/cmd/dev/templates.js.map +1 -1
- package/dist/cmd/git/api.d.ts +38 -0
- package/dist/cmd/git/api.d.ts.map +1 -1
- package/dist/cmd/git/api.js +55 -0
- package/dist/cmd/git/api.js.map +1 -1
- package/dist/cmd/project/add/database.js +8 -8
- package/dist/cmd/project/add/database.js.map +1 -1
- package/dist/cmd/project/add/storage.js +8 -8
- package/dist/cmd/project/add/storage.js.map +1 -1
- package/dist/cmd/project/auth/init.d.ts.map +1 -1
- package/dist/cmd/project/auth/init.js +7 -6
- package/dist/cmd/project/auth/init.js.map +1 -1
- package/dist/cmd/project/auth/shared.d.ts +2 -3
- package/dist/cmd/project/auth/shared.d.ts.map +1 -1
- package/dist/cmd/project/auth/shared.js +7 -7
- package/dist/cmd/project/auth/shared.js.map +1 -1
- package/dist/cmd/project/download.d.ts +12 -1
- package/dist/cmd/project/download.d.ts.map +1 -1
- package/dist/cmd/project/download.js +38 -15
- package/dist/cmd/project/download.js.map +1 -1
- package/dist/cmd/project/import.d.ts.map +1 -1
- package/dist/cmd/project/import.js +67 -9
- package/dist/cmd/project/import.js.map +1 -1
- package/dist/cmd/project/remote-import.d.ts +41 -0
- package/dist/cmd/project/remote-import.d.ts.map +1 -0
- package/dist/cmd/project/remote-import.js +1074 -0
- package/dist/cmd/project/remote-import.js.map +1 -0
- package/dist/cmd/project/template-flow.d.ts +1 -1
- package/dist/cmd/project/template-flow.d.ts.map +1 -1
- package/dist/cmd/project/template-flow.js +27 -11
- package/dist/cmd/project/template-flow.js.map +1 -1
- package/dist/config.d.ts +29 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +13 -14
- package/dist/config.js.map +1 -1
- package/dist/domain.js +1 -1
- package/dist/domain.js.map +1 -1
- package/dist/schema-generator.d.ts +1 -1
- package/dist/schema-generator.d.ts.map +1 -1
- package/dist/schema-generator.js +1 -1
- package/dist/schema-generator.js.map +1 -1
- package/dist/schema-parser.d.ts.map +1 -1
- package/dist/schema-parser.js +48 -6
- package/dist/schema-parser.js.map +1 -1
- package/dist/terminal.d.ts.map +1 -1
- package/dist/terminal.js +12 -17
- package/dist/terminal.js.map +1 -1
- package/dist/tui.js +1 -1
- package/dist/tui.js.map +1 -1
- package/dist/types.d.ts +28 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +42 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/date.js +1 -1
- package/dist/utils/date.js.map +1 -1
- package/package.json +6 -6
- package/src/agent-detection.ts +1 -1
- package/src/api.ts +1 -1
- package/src/cache/agent-intro.ts +3 -4
- package/src/cache/resource-region.ts +3 -1
- package/src/cache/user-cache.ts +3 -4
- package/src/catalyst.ts +9 -1
- package/src/cmd/ai/opencode/install.ts +1 -1
- package/src/cmd/build/ast.ts +2 -2
- package/src/cmd/build/patch/_util.ts +2 -2
- package/src/cmd/build/vite/registry-generator.ts +4 -4
- package/src/cmd/build/vite/workbench-generator.ts +1 -1
- package/src/cmd/cloud/db/create.ts +8 -9
- package/src/cmd/cloud/db/delete.ts +18 -13
- package/src/cmd/cloud/db/get.ts +13 -7
- package/src/cmd/cloud/db/list.ts +11 -5
- package/src/cmd/cloud/db/logs.ts +13 -7
- package/src/cmd/cloud/db/sql.ts +5 -5
- package/src/cmd/cloud/db/stats.ts +11 -5
- package/src/cmd/cloud/deploy.ts +7 -1
- package/src/cmd/cloud/email/stats.ts +11 -5
- package/src/cmd/cloud/email/util.ts +4 -4
- package/src/cmd/cloud/keyvalue/repl.ts +6 -2
- package/src/cmd/cloud/keyvalue/search.ts +2 -1
- package/src/cmd/cloud/keyvalue/util.ts +2 -2
- package/src/cmd/cloud/machine/delete.ts +12 -6
- package/src/cmd/cloud/machine/deployments.ts +11 -5
- package/src/cmd/cloud/machine/get.ts +11 -5
- package/src/cmd/cloud/machine/list.ts +11 -5
- package/src/cmd/cloud/queue/util.ts +2 -2
- package/src/cmd/cloud/redis/get.ts +5 -5
- package/src/cmd/cloud/sandbox/cp.ts +2 -2
- package/src/cmd/cloud/sandbox/execution/get.ts +10 -4
- package/src/cmd/cloud/sandbox/execution/list.ts +6 -5
- package/src/cmd/cloud/sandbox/runtime/list.ts +10 -4
- package/src/cmd/cloud/sandbox/snapshot/build.ts +1 -1
- package/src/cmd/cloud/sandbox/snapshot/create.ts +12 -5
- package/src/cmd/cloud/sandbox/snapshot/delete.ts +10 -4
- package/src/cmd/cloud/sandbox/snapshot/get.ts +12 -6
- package/src/cmd/cloud/sandbox/snapshot/list.ts +10 -4
- package/src/cmd/cloud/sandbox/snapshot/tag.ts +10 -4
- package/src/cmd/cloud/sandbox/stats.ts +11 -5
- package/src/cmd/cloud/sandbox/util.ts +14 -7
- package/src/cmd/cloud/schedule/stats.ts +11 -5
- package/src/cmd/cloud/schedule/util.ts +3 -3
- package/src/cmd/cloud/services/stats.ts +13 -7
- package/src/cmd/cloud/session/get.ts +14 -8
- package/src/cmd/cloud/session/list.ts +11 -5
- package/src/cmd/cloud/storage/config.ts +27 -20
- package/src/cmd/cloud/storage/create.ts +8 -9
- package/src/cmd/cloud/storage/delete.ts +18 -13
- package/src/cmd/cloud/storage/download.ts +12 -6
- package/src/cmd/cloud/storage/get.ts +12 -6
- package/src/cmd/cloud/storage/list.ts +20 -9
- package/src/cmd/cloud/storage/upload.ts +13 -7
- package/src/cmd/cloud/stream/create.ts +1 -1
- package/src/cmd/cloud/stream/stats.ts +11 -5
- package/src/cmd/cloud/task/delete.ts +13 -2
- package/src/cmd/cloud/task/stats.ts +11 -5
- package/src/cmd/cloud/task/util.ts +4 -4
- package/src/cmd/cloud/thread/delete.ts +11 -5
- package/src/cmd/cloud/thread/get.ts +11 -5
- package/src/cmd/cloud/thread/list.ts +11 -5
- package/src/cmd/cloud/vector/util.ts +2 -2
- package/src/cmd/cloud/webhook/util.ts +2 -2
- package/src/cmd/dev/dev-lock.ts +2 -2
- package/src/cmd/dev/templates.ts +0 -1
- package/src/cmd/git/api.ts +127 -0
- package/src/cmd/project/add/database.ts +9 -9
- package/src/cmd/project/add/storage.ts +9 -9
- package/src/cmd/project/auth/init.ts +11 -10
- package/src/cmd/project/auth/shared.ts +15 -10
- package/src/cmd/project/download.ts +53 -17
- package/src/cmd/project/import.ts +71 -9
- package/src/cmd/project/remote-import.ts +1347 -0
- package/src/cmd/project/template-flow.ts +38 -22
- package/src/config.ts +23 -18
- package/src/domain.ts +3 -3
- package/src/schema-generator.ts +1 -1
- package/src/schema-parser.ts +49 -6
- package/src/terminal.ts +12 -14
- package/src/tui.ts +1 -1
- package/src/types.ts +45 -0
- package/src/utils/date.ts +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { getServiceStats, type ServiceStatsData } from '@agentuity/server';
|
|
1
2
|
import { z } from 'zod';
|
|
2
|
-
import { createCommand } from '../../../types';
|
|
3
|
-
import * as tui from '../../../tui';
|
|
4
|
-
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
5
3
|
import { getCommand } from '../../../command-prefix';
|
|
6
|
-
import {
|
|
4
|
+
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
5
|
+
import * as tui from '../../../tui';
|
|
6
|
+
import { createCommand } from '../../../types';
|
|
7
7
|
|
|
8
8
|
function formatNumber(n: number): string {
|
|
9
9
|
if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
|
|
@@ -56,7 +56,13 @@ export const statsSubcommand = createCommand({
|
|
|
56
56
|
|
|
57
57
|
async handler(ctx) {
|
|
58
58
|
const { opts, options } = ctx;
|
|
59
|
-
const client = await getGlobalCatalystAPIClient(
|
|
59
|
+
const client = await getGlobalCatalystAPIClient(
|
|
60
|
+
ctx.logger,
|
|
61
|
+
ctx.auth,
|
|
62
|
+
ctx.config?.name,
|
|
63
|
+
undefined,
|
|
64
|
+
ctx.config
|
|
65
|
+
);
|
|
60
66
|
const orgId = ctx.orgId ?? ctx.options.orgId ?? ctx.config?.preferences?.orgId;
|
|
61
67
|
|
|
62
68
|
if (!orgId) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
|
-
import type {
|
|
4
|
-
import { APIClient,
|
|
5
|
-
import
|
|
3
|
+
import type { FileToWrite, Logger } from '@agentuity/core';
|
|
4
|
+
import { APIClient, getServiceUrls, sandboxGet } from '@agentuity/server';
|
|
5
|
+
import { deleteResourceRegion, getResourceInfo, setResourceInfo } from '../../../cache';
|
|
6
6
|
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
7
|
-
import { getResourceInfo, setResourceInfo, deleteResourceRegion } from '../../../cache';
|
|
8
|
-
import * as tui from '../../../tui';
|
|
9
7
|
import { ErrorCode } from '../../../errors';
|
|
8
|
+
import * as tui from '../../../tui';
|
|
9
|
+
import type { AuthData, Config } from '../../../types';
|
|
10
10
|
|
|
11
11
|
export function createSandboxClient(logger: Logger, auth: AuthData, region: string): APIClient {
|
|
12
12
|
return new APIClient(getServiceUrls(region).catalyst, logger, auth.apiKey);
|
|
@@ -21,7 +21,8 @@ export async function getSandboxRegion(
|
|
|
21
21
|
auth: AuthData,
|
|
22
22
|
profileName = 'production',
|
|
23
23
|
sandboxId: string,
|
|
24
|
-
orgId?: string
|
|
24
|
+
orgId?: string,
|
|
25
|
+
config?: Config | null
|
|
25
26
|
): Promise<string> {
|
|
26
27
|
// Check cache first
|
|
27
28
|
const cachedInfo = await getResourceInfo('sandbox', profileName, sandboxId);
|
|
@@ -32,7 +33,13 @@ export async function getSandboxRegion(
|
|
|
32
33
|
|
|
33
34
|
// Fallback to API lookup using global client
|
|
34
35
|
logger.trace(`[sandbox] Cache miss for ${sandboxId}, fetching from API`);
|
|
35
|
-
const globalClient = await getGlobalCatalystAPIClient(
|
|
36
|
+
const globalClient = await getGlobalCatalystAPIClient(
|
|
37
|
+
logger,
|
|
38
|
+
auth,
|
|
39
|
+
profileName,
|
|
40
|
+
undefined,
|
|
41
|
+
config
|
|
42
|
+
);
|
|
36
43
|
|
|
37
44
|
const sandbox = await sandboxGet(globalClient, { sandboxId, orgId });
|
|
38
45
|
if (!sandbox.region) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { getServiceStats, type ServiceStatsData } from '@agentuity/server';
|
|
1
2
|
import { z } from 'zod';
|
|
2
|
-
import { createCommand } from '../../../types';
|
|
3
|
-
import * as tui from '../../../tui';
|
|
4
|
-
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
5
3
|
import { getCommand } from '../../../command-prefix';
|
|
6
|
-
import {
|
|
4
|
+
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
5
|
+
import * as tui from '../../../tui';
|
|
6
|
+
import { createCommand } from '../../../types';
|
|
7
7
|
|
|
8
8
|
function formatNumber(n: number): string {
|
|
9
9
|
if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
|
|
@@ -46,7 +46,13 @@ export const statsSubcommand = createCommand({
|
|
|
46
46
|
|
|
47
47
|
async handler(ctx) {
|
|
48
48
|
const { opts, options } = ctx;
|
|
49
|
-
const client = await getGlobalCatalystAPIClient(
|
|
49
|
+
const client = await getGlobalCatalystAPIClient(
|
|
50
|
+
ctx.logger,
|
|
51
|
+
ctx.auth,
|
|
52
|
+
ctx.config?.name,
|
|
53
|
+
undefined,
|
|
54
|
+
ctx.config
|
|
55
|
+
);
|
|
50
56
|
const orgId = ctx.orgId ?? ctx.options.orgId ?? ctx.config?.preferences?.orgId;
|
|
51
57
|
|
|
52
58
|
if (!orgId) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type Logger, ScheduleService } from '@agentuity/core';
|
|
2
2
|
import { createServerFetchAdapter } from '@agentuity/server';
|
|
3
|
-
import type { AuthData, Config, GlobalOptions } from '../../../types';
|
|
4
3
|
import { getCatalystUrl } from '../../../catalyst';
|
|
5
4
|
import { defaultProfileName, getDefaultRegion } from '../../../config';
|
|
6
5
|
import * as tui from '../../../tui';
|
|
6
|
+
import type { AuthData, Config, GlobalOptions } from '../../../types';
|
|
7
7
|
|
|
8
8
|
export interface ScheduleContext {
|
|
9
9
|
logger: Logger;
|
|
@@ -23,6 +23,6 @@ export async function createScheduleAdapter(ctx: ScheduleContext) {
|
|
|
23
23
|
ctx.logger
|
|
24
24
|
);
|
|
25
25
|
const region = await getDefaultRegion(ctx.config?.name ?? defaultProfileName, ctx.config);
|
|
26
|
-
const baseUrl = getCatalystUrl(region);
|
|
26
|
+
const baseUrl = getCatalystUrl(region, ctx.config?.overrides);
|
|
27
27
|
return new ScheduleService(baseUrl, adapter);
|
|
28
28
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { createCommand } from '../../../types';
|
|
3
|
-
import * as tui from '../../../tui';
|
|
4
|
-
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
5
|
-
import { getCommand } from '../../../command-prefix';
|
|
6
1
|
import {
|
|
7
2
|
getServiceStats,
|
|
8
|
-
VALID_SERVICES,
|
|
9
3
|
type ServiceName,
|
|
10
4
|
type ServiceStatsData,
|
|
5
|
+
VALID_SERVICES,
|
|
11
6
|
} from '@agentuity/server';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { getCommand } from '../../../command-prefix';
|
|
9
|
+
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
10
|
+
import * as tui from '../../../tui';
|
|
11
|
+
import { createCommand } from '../../../types';
|
|
12
12
|
|
|
13
13
|
function formatNumber(n: number): string {
|
|
14
14
|
if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
|
|
@@ -173,7 +173,13 @@ export const statsSubcommand = createCommand({
|
|
|
173
173
|
|
|
174
174
|
async handler(ctx) {
|
|
175
175
|
const { opts, options } = ctx;
|
|
176
|
-
const client = await getGlobalCatalystAPIClient(
|
|
176
|
+
const client = await getGlobalCatalystAPIClient(
|
|
177
|
+
ctx.logger,
|
|
178
|
+
ctx.auth,
|
|
179
|
+
ctx.config?.name,
|
|
180
|
+
undefined,
|
|
181
|
+
ctx.config
|
|
182
|
+
);
|
|
177
183
|
const orgId = ctx.orgId ?? ctx.options.orgId ?? ctx.config?.preferences?.orgId;
|
|
178
184
|
|
|
179
185
|
if (!orgId) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { createSubcommand } from '../../../types';
|
|
3
|
-
import * as tui from '../../../tui';
|
|
4
1
|
import {
|
|
5
|
-
sessionGet,
|
|
6
|
-
type SpanNode,
|
|
7
|
-
type EvalRun,
|
|
8
2
|
type AgentInfo,
|
|
9
3
|
APIError,
|
|
4
|
+
type EvalRun,
|
|
5
|
+
type SpanNode,
|
|
6
|
+
sessionGet,
|
|
10
7
|
} from '@agentuity/server';
|
|
8
|
+
import { z } from 'zod';
|
|
11
9
|
import { getCommand } from '../../../command-prefix';
|
|
12
|
-
import { ErrorCode } from '../../../errors';
|
|
13
10
|
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
11
|
+
import { ErrorCode } from '../../../errors';
|
|
12
|
+
import * as tui from '../../../tui';
|
|
13
|
+
import { createSubcommand } from '../../../types';
|
|
14
14
|
|
|
15
15
|
const SpanNodeSchema: z.ZodType<SpanNode> = z.lazy(() =>
|
|
16
16
|
z.object({
|
|
@@ -126,7 +126,13 @@ export const getSubcommand = createSubcommand({
|
|
|
126
126
|
},
|
|
127
127
|
async handler(ctx) {
|
|
128
128
|
const { logger, auth, args, options, config } = ctx;
|
|
129
|
-
const catalystClient = await getGlobalCatalystAPIClient(
|
|
129
|
+
const catalystClient = await getGlobalCatalystAPIClient(
|
|
130
|
+
logger,
|
|
131
|
+
auth,
|
|
132
|
+
config?.name,
|
|
133
|
+
undefined,
|
|
134
|
+
config
|
|
135
|
+
);
|
|
130
136
|
|
|
131
137
|
try {
|
|
132
138
|
const enriched = await sessionGet(catalystClient, { id: args.session_id });
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { createSubcommand } from '../../../types';
|
|
3
|
-
import * as tui from '../../../tui';
|
|
4
1
|
import { sessionList } from '@agentuity/server';
|
|
2
|
+
import { z } from 'zod';
|
|
5
3
|
import { getCommand } from '../../../command-prefix';
|
|
6
|
-
import { ErrorCode } from '../../../errors';
|
|
7
4
|
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
5
|
+
import { ErrorCode } from '../../../errors';
|
|
6
|
+
import * as tui from '../../../tui';
|
|
7
|
+
import { createSubcommand } from '../../../types';
|
|
8
8
|
|
|
9
9
|
const SessionListResponseSchema = z.array(
|
|
10
10
|
z.object({
|
|
@@ -105,7 +105,13 @@ export const listSubcommand = createSubcommand({
|
|
|
105
105
|
},
|
|
106
106
|
async handler(ctx) {
|
|
107
107
|
const { logger, auth, project, opts, options, config } = ctx;
|
|
108
|
-
const catalystClient = await getGlobalCatalystAPIClient(
|
|
108
|
+
const catalystClient = await getGlobalCatalystAPIClient(
|
|
109
|
+
logger,
|
|
110
|
+
auth,
|
|
111
|
+
config?.name,
|
|
112
|
+
undefined,
|
|
113
|
+
config
|
|
114
|
+
);
|
|
109
115
|
|
|
110
116
|
if (opts?.orgId && opts?.projectId) {
|
|
111
117
|
tui.fatal('--org-id and --project-id are mutually exclusive. Use one or the other.');
|
|
@@ -1,37 +1,32 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import {
|
|
3
|
-
|
|
4
|
-
updateBucketConfig,
|
|
5
|
-
deleteBucketConfig,
|
|
2
|
+
type BucketConfig,
|
|
6
3
|
BucketConfigResponseError,
|
|
7
|
-
listOrgResources,
|
|
8
4
|
type BucketConfigUpdate,
|
|
9
|
-
|
|
5
|
+
deleteBucketConfig,
|
|
6
|
+
getBucketConfig,
|
|
7
|
+
listOrgResources,
|
|
10
8
|
StorageTierSchema,
|
|
9
|
+
updateBucketConfig,
|
|
11
10
|
} from '@agentuity/server';
|
|
12
|
-
import {
|
|
13
|
-
import * as tui from '../../../tui';
|
|
14
|
-
import { getCatalystAPIClient, getGlobalCatalystAPIClient } from '../../../config';
|
|
15
|
-
import { getCommand } from '../../../command-prefix';
|
|
11
|
+
import { z } from 'zod';
|
|
16
12
|
import { getResourceInfo, setResourceInfo } from '../../../cache';
|
|
13
|
+
import { getCommand } from '../../../command-prefix';
|
|
14
|
+
import { getCatalystAPIClient, getGlobalCatalystAPIClient } from '../../../config';
|
|
15
|
+
import * as tui from '../../../tui';
|
|
16
|
+
import { createSubcommand } from '../../../types';
|
|
17
17
|
|
|
18
18
|
function displayConfig(config: BucketConfig) {
|
|
19
19
|
tui.newline();
|
|
20
20
|
console.log(tui.bold('Bucket: ') + config.bucket_name);
|
|
21
|
+
console.log(tui.bold('Storage Tier: ') + (config.storage_tier ?? tui.muted('default')));
|
|
21
22
|
console.log(
|
|
22
|
-
tui.bold('
|
|
23
|
-
);
|
|
24
|
-
console.log(
|
|
25
|
-
tui.bold('TTL: ') +
|
|
26
|
-
(config.ttl != null ? `${config.ttl}s` : tui.muted('default'))
|
|
23
|
+
tui.bold('TTL: ') + (config.ttl != null ? `${config.ttl}s` : tui.muted('default'))
|
|
27
24
|
);
|
|
28
25
|
console.log(
|
|
29
26
|
tui.bold('Public: ') +
|
|
30
27
|
(config.public != null ? String(config.public) : tui.muted('default'))
|
|
31
28
|
);
|
|
32
|
-
console.log(
|
|
33
|
-
tui.bold('Cache Control: ') + (config.cache_control ?? tui.muted('default'))
|
|
34
|
-
);
|
|
29
|
+
console.log(tui.bold('Cache Control: ') + (config.cache_control ?? tui.muted('default')));
|
|
35
30
|
|
|
36
31
|
if (config.cors) {
|
|
37
32
|
console.log(tui.bold('CORS:'));
|
|
@@ -122,7 +117,13 @@ export const configSubcommand = createSubcommand({
|
|
|
122
117
|
const { name: bucketName } = args;
|
|
123
118
|
|
|
124
119
|
const profileName = config?.name ?? 'production';
|
|
125
|
-
const catalystClient = await getGlobalCatalystAPIClient(
|
|
120
|
+
const catalystClient = await getGlobalCatalystAPIClient(
|
|
121
|
+
logger,
|
|
122
|
+
auth,
|
|
123
|
+
profileName,
|
|
124
|
+
undefined,
|
|
125
|
+
config
|
|
126
|
+
);
|
|
126
127
|
|
|
127
128
|
// Look up bucket to get cloud_region
|
|
128
129
|
const cachedInfo = await getResourceInfo('bucket', profileName, bucketName);
|
|
@@ -157,7 +158,13 @@ export const configSubcommand = createSubcommand({
|
|
|
157
158
|
}
|
|
158
159
|
|
|
159
160
|
// Create regional client for bucket config operations (orgId required for CLI auth)
|
|
160
|
-
const regionalClient = getCatalystAPIClient(
|
|
161
|
+
const regionalClient = getCatalystAPIClient(
|
|
162
|
+
logger,
|
|
163
|
+
auth,
|
|
164
|
+
bucket.cloud_region,
|
|
165
|
+
bucket.org_id,
|
|
166
|
+
config
|
|
167
|
+
);
|
|
161
168
|
|
|
162
169
|
// Handle --reset flag (DELETE)
|
|
163
170
|
if (opts.reset) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { APIError, createResources, validateBucketName } from '@agentuity/server';
|
|
1
2
|
import { z } from 'zod';
|
|
2
|
-
import { createResources, APIError, validateBucketName } from '@agentuity/server';
|
|
3
|
-
import { createSubcommand as defineSubcommand } from '../../../types';
|
|
4
|
-
import * as tui from '../../../tui';
|
|
5
|
-
import { getCatalystAPIClient } from '../../../config';
|
|
6
3
|
import { getCommand } from '../../../command-prefix';
|
|
7
|
-
import {
|
|
8
|
-
import { ErrorCode } from '../../../errors';
|
|
4
|
+
import { getCatalystAPIClient } from '../../../config';
|
|
9
5
|
import { addResourceEnvVars } from '../../../env-util';
|
|
6
|
+
import { ErrorCode } from '../../../errors';
|
|
7
|
+
import { isDryRunMode, outputDryRun } from '../../../explain';
|
|
8
|
+
import * as tui from '../../../tui';
|
|
9
|
+
import { createSubcommand as defineSubcommand } from '../../../types';
|
|
10
10
|
|
|
11
11
|
export const createSubcommand = defineSubcommand({
|
|
12
12
|
name: 'create',
|
|
@@ -74,7 +74,7 @@ export const createSubcommand = defineSubcommand({
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
const catalystClient = getCatalystAPIClient(logger, auth, region);
|
|
77
|
+
const catalystClient = getCatalystAPIClient(logger, auth, region, undefined, ctx.config);
|
|
78
78
|
|
|
79
79
|
try {
|
|
80
80
|
const created = await tui.spinner({
|
|
@@ -104,9 +104,8 @@ export const createSubcommand = defineSubcommand({
|
|
|
104
104
|
success: true,
|
|
105
105
|
name: resource.name,
|
|
106
106
|
};
|
|
107
|
-
} else {
|
|
108
|
-
tui.fatal('Failed to create storage');
|
|
109
107
|
}
|
|
108
|
+
tui.fatal('Failed to create storage');
|
|
110
109
|
} catch (ex) {
|
|
111
110
|
if (ex instanceof APIError) {
|
|
112
111
|
if (ex.status === 409) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { listOrgResources, deleteResources } from '@agentuity/server';
|
|
1
|
+
import { deleteResources, listOrgResources } from '@agentuity/server';
|
|
3
2
|
import enquirer from 'enquirer';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { getGlobalCatalystAPIClient, getCatalystAPIClient } from '../../../config';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { deleteResourceRegion, getResourceInfo, setResourceInfo } from '../../../cache';
|
|
7
5
|
import { getCommand } from '../../../command-prefix';
|
|
8
|
-
import {
|
|
6
|
+
import { getCatalystAPIClient, getGlobalCatalystAPIClient } from '../../../config';
|
|
7
|
+
import { removeResourceEnvVars } from '../../../env-util';
|
|
9
8
|
import { ErrorCode } from '../../../errors';
|
|
9
|
+
import { isDryRunMode, outputDryRun } from '../../../explain';
|
|
10
|
+
import * as tui from '../../../tui';
|
|
11
|
+
import { createSubcommand } from '../../../types';
|
|
10
12
|
import { createS3Client } from './utils';
|
|
11
|
-
import { removeResourceEnvVars } from '../../../env-util';
|
|
12
|
-
import { getResourceInfo, setResourceInfo, deleteResourceRegion } from '../../../cache';
|
|
13
13
|
|
|
14
14
|
export const deleteSubcommand = createSubcommand({
|
|
15
15
|
name: 'delete',
|
|
@@ -60,7 +60,13 @@ export const deleteSubcommand = createSubcommand({
|
|
|
60
60
|
const { logger, args, opts, auth, options, config } = ctx;
|
|
61
61
|
|
|
62
62
|
const profileName = config?.name ?? 'production';
|
|
63
|
-
const catalystClient = await getGlobalCatalystAPIClient(
|
|
63
|
+
const catalystClient = await getGlobalCatalystAPIClient(
|
|
64
|
+
logger,
|
|
65
|
+
auth,
|
|
66
|
+
profileName,
|
|
67
|
+
undefined,
|
|
68
|
+
config
|
|
69
|
+
);
|
|
64
70
|
|
|
65
71
|
let bucketName = args.name;
|
|
66
72
|
|
|
@@ -350,7 +356,7 @@ export const deleteSubcommand = createSubcommand({
|
|
|
350
356
|
}
|
|
351
357
|
|
|
352
358
|
// Use regional client for the delete operation
|
|
353
|
-
const regionalClient = getCatalystAPIClient(logger, auth, region);
|
|
359
|
+
const regionalClient = getCatalystAPIClient(logger, auth, region, undefined, config);
|
|
354
360
|
const deleted = await tui.spinner({
|
|
355
361
|
message: `Deleting storage bucket ${bucketName}`,
|
|
356
362
|
clearOnSuccess: true,
|
|
@@ -381,9 +387,8 @@ export const deleteSubcommand = createSubcommand({
|
|
|
381
387
|
success: true,
|
|
382
388
|
name: resource.name,
|
|
383
389
|
};
|
|
384
|
-
} else {
|
|
385
|
-
tui.error('Failed to delete storage bucket');
|
|
386
|
-
return { success: false, name: bucketName };
|
|
387
390
|
}
|
|
391
|
+
tui.error('Failed to delete storage bucket');
|
|
392
|
+
return { success: false, name: bucketName };
|
|
388
393
|
},
|
|
389
394
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import { listOrgResources } from '@agentuity/server';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { getResourceInfo, setResourceInfo } from '../../../cache';
|
|
6
4
|
import { getCommand } from '../../../command-prefix';
|
|
5
|
+
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
7
6
|
import { ErrorCode } from '../../../errors';
|
|
7
|
+
import * as tui from '../../../tui';
|
|
8
|
+
import { createSubcommand } from '../../../types';
|
|
8
9
|
import { createS3Client } from './utils';
|
|
9
|
-
import { getResourceInfo, setResourceInfo } from '../../../cache';
|
|
10
10
|
|
|
11
11
|
export const downloadSubcommand = createSubcommand({
|
|
12
12
|
name: 'download',
|
|
@@ -56,7 +56,13 @@ export const downloadSubcommand = createSubcommand({
|
|
|
56
56
|
const { logger, args, opts, options, auth, config } = ctx;
|
|
57
57
|
|
|
58
58
|
const profileName = config?.name ?? 'production';
|
|
59
|
-
const catalystClient = await getGlobalCatalystAPIClient(
|
|
59
|
+
const catalystClient = await getGlobalCatalystAPIClient(
|
|
60
|
+
logger,
|
|
61
|
+
auth,
|
|
62
|
+
profileName,
|
|
63
|
+
undefined,
|
|
64
|
+
config
|
|
65
|
+
);
|
|
60
66
|
|
|
61
67
|
// Check cache first for orgId
|
|
62
68
|
const cachedInfo = await getResourceInfo('bucket', profileName, args.name);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import { listOrgResources } from '@agentuity/server';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { setResourceInfo } from '../../../cache';
|
|
6
4
|
import { getCommand } from '../../../command-prefix';
|
|
5
|
+
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
7
6
|
import { ErrorCode } from '../../../errors';
|
|
8
|
-
import
|
|
7
|
+
import * as tui from '../../../tui';
|
|
8
|
+
import { createSubcommand } from '../../../types';
|
|
9
9
|
|
|
10
10
|
const StorageGetResponseSchema = z.object({
|
|
11
11
|
bucket_name: z.string().describe('Storage bucket name'),
|
|
@@ -61,7 +61,13 @@ export const getSubcommand = createSubcommand({
|
|
|
61
61
|
const { logger, args, opts, options, auth, config } = ctx;
|
|
62
62
|
|
|
63
63
|
const profileName = config?.name ?? 'production';
|
|
64
|
-
const catalystClient = await getGlobalCatalystAPIClient(
|
|
64
|
+
const catalystClient = await getGlobalCatalystAPIClient(
|
|
65
|
+
logger,
|
|
66
|
+
auth,
|
|
67
|
+
profileName,
|
|
68
|
+
undefined,
|
|
69
|
+
config
|
|
70
|
+
);
|
|
65
71
|
|
|
66
72
|
// Search across all orgs the user has access to
|
|
67
73
|
const resources = await tui.spinner({
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import { listOrgResources } from '@agentuity/server';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { setResourceInfo } from '../../../cache';
|
|
6
4
|
import { getCommand } from '../../../command-prefix';
|
|
5
|
+
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
7
6
|
import { ErrorCode } from '../../../errors';
|
|
7
|
+
import * as tui from '../../../tui';
|
|
8
|
+
import { createSubcommand } from '../../../types';
|
|
8
9
|
import { createS3Client } from './utils';
|
|
9
|
-
import { setResourceInfo } from '../../../cache';
|
|
10
10
|
|
|
11
11
|
const StorageListResponseSchema = z.object({
|
|
12
12
|
buckets: z
|
|
@@ -99,7 +99,13 @@ export const listSubcommand = createSubcommand({
|
|
|
99
99
|
async handler(ctx) {
|
|
100
100
|
const { logger, args, opts, options, auth, config } = ctx;
|
|
101
101
|
|
|
102
|
-
const catalystClient = await getGlobalCatalystAPIClient(
|
|
102
|
+
const catalystClient = await getGlobalCatalystAPIClient(
|
|
103
|
+
logger,
|
|
104
|
+
auth,
|
|
105
|
+
config?.name,
|
|
106
|
+
undefined,
|
|
107
|
+
config
|
|
108
|
+
);
|
|
103
109
|
|
|
104
110
|
const profileName = config?.name ?? 'production';
|
|
105
111
|
const resources = await tui.spinner({
|
|
@@ -260,15 +266,20 @@ export const listSubcommand = createSubcommand({
|
|
|
260
266
|
if (s3.region) console.log(` Region: ${tui.muted(s3.region)}`);
|
|
261
267
|
if (s3.endpoint) console.log(` Endpoint: ${tui.muted(s3.endpoint)}`);
|
|
262
268
|
if (s3.object_count != null) {
|
|
263
|
-
const sizeStr =
|
|
264
|
-
|
|
269
|
+
const sizeStr =
|
|
270
|
+
s3.total_size != null ? tui.formatBytes(s3.total_size) : 'unknown';
|
|
271
|
+
console.log(
|
|
272
|
+
` Objects: ${tui.muted(`${s3.object_count.toLocaleString()} (${sizeStr})`)}`
|
|
273
|
+
);
|
|
265
274
|
}
|
|
266
275
|
if (s3.last_event_at) {
|
|
267
276
|
const date = new Date(s3.last_event_at);
|
|
268
277
|
if (Number.isNaN(date.getTime())) {
|
|
269
278
|
console.log(` Activity: ${tui.muted('unknown')}`);
|
|
270
279
|
} else {
|
|
271
|
-
console.log(
|
|
280
|
+
console.log(
|
|
281
|
+
` Activity: ${tui.muted(date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric', hour: '2-digit', minute: '2-digit' }))}`
|
|
282
|
+
);
|
|
272
283
|
}
|
|
273
284
|
}
|
|
274
285
|
tui.newline();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { basename } from 'path';
|
|
3
1
|
import { listOrgResources } from '@agentuity/server';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
2
|
+
import { basename } from 'path';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { getResourceInfo, setResourceInfo } from '../../../cache';
|
|
7
5
|
import { getCommand } from '../../../command-prefix';
|
|
6
|
+
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
8
7
|
import { ErrorCode } from '../../../errors';
|
|
8
|
+
import * as tui from '../../../tui';
|
|
9
|
+
import { createSubcommand } from '../../../types';
|
|
9
10
|
import { createS3Client } from './utils';
|
|
10
|
-
import { getResourceInfo, setResourceInfo } from '../../../cache';
|
|
11
11
|
|
|
12
12
|
export const uploadSubcommand = createSubcommand({
|
|
13
13
|
name: 'upload',
|
|
@@ -66,7 +66,13 @@ export const uploadSubcommand = createSubcommand({
|
|
|
66
66
|
const { logger, args, opts, options, auth, config } = ctx;
|
|
67
67
|
|
|
68
68
|
const profileName = config?.name ?? 'production';
|
|
69
|
-
const catalystClient = await getGlobalCatalystAPIClient(
|
|
69
|
+
const catalystClient = await getGlobalCatalystAPIClient(
|
|
70
|
+
logger,
|
|
71
|
+
auth,
|
|
72
|
+
profileName,
|
|
73
|
+
undefined,
|
|
74
|
+
config
|
|
75
|
+
);
|
|
70
76
|
|
|
71
77
|
// Check cache first for orgId
|
|
72
78
|
const cachedInfo = await getResourceInfo('bucket', profileName, args.name);
|
|
@@ -212,7 +212,7 @@ export const createSubcommand = createCommand({
|
|
|
212
212
|
let expiresAt: string | undefined;
|
|
213
213
|
try {
|
|
214
214
|
const info = await storage.get(stream.id);
|
|
215
|
-
expiresAt = info.expiresAt;
|
|
215
|
+
expiresAt = info.expiresAt ?? undefined;
|
|
216
216
|
} catch {
|
|
217
217
|
// expiresAt is optional, ignore errors
|
|
218
218
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { getServiceStats, type ServiceStatsData } from '@agentuity/server';
|
|
1
2
|
import { z } from 'zod';
|
|
2
|
-
import { createCommand } from '../../../types';
|
|
3
|
-
import * as tui from '../../../tui';
|
|
4
|
-
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
5
3
|
import { getCommand } from '../../../command-prefix';
|
|
6
|
-
import {
|
|
4
|
+
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
5
|
+
import * as tui from '../../../tui';
|
|
6
|
+
import { createCommand } from '../../../types';
|
|
7
7
|
|
|
8
8
|
function formatNumber(n: number): string {
|
|
9
9
|
if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
|
|
@@ -44,7 +44,13 @@ export const statsSubcommand = createCommand({
|
|
|
44
44
|
|
|
45
45
|
async handler(ctx) {
|
|
46
46
|
const { opts, options } = ctx;
|
|
47
|
-
const client = await getGlobalCatalystAPIClient(
|
|
47
|
+
const client = await getGlobalCatalystAPIClient(
|
|
48
|
+
ctx.logger,
|
|
49
|
+
ctx.auth,
|
|
50
|
+
ctx.config?.name,
|
|
51
|
+
undefined,
|
|
52
|
+
ctx.config
|
|
53
|
+
);
|
|
48
54
|
const orgId = ctx.orgId ?? ctx.options.orgId ?? ctx.config?.preferences?.orgId;
|
|
49
55
|
|
|
50
56
|
if (!orgId) {
|
|
@@ -125,7 +125,12 @@ export const deleteSubcommand = createCommand({
|
|
|
125
125
|
// Determine mode: single delete or batch delete
|
|
126
126
|
const isSingleDelete = !!args.id;
|
|
127
127
|
const hasFilters =
|
|
128
|
-
opts.status ||
|
|
128
|
+
opts.status ||
|
|
129
|
+
opts.type ||
|
|
130
|
+
opts.priority ||
|
|
131
|
+
opts.olderThan ||
|
|
132
|
+
opts.parentId ||
|
|
133
|
+
opts.createdId;
|
|
129
134
|
|
|
130
135
|
if (!isSingleDelete && !hasFilters) {
|
|
131
136
|
tui.fatal(
|
|
@@ -246,7 +251,13 @@ export const deleteSubcommand = createCommand({
|
|
|
246
251
|
tui.newline();
|
|
247
252
|
|
|
248
253
|
const tableData = candidates.map(
|
|
249
|
-
(task: {
|
|
254
|
+
(task: {
|
|
255
|
+
id: string;
|
|
256
|
+
title: string;
|
|
257
|
+
status: string;
|
|
258
|
+
type: string;
|
|
259
|
+
created_at: string;
|
|
260
|
+
}) => ({
|
|
250
261
|
ID: tui.muted(truncate(task.id, 28)),
|
|
251
262
|
Title: truncate(task.title, 40),
|
|
252
263
|
Status: task.status,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { getServiceStats, type ServiceStatsData } from '@agentuity/server';
|
|
1
2
|
import { z } from 'zod';
|
|
2
|
-
import { createCommand } from '../../../types';
|
|
3
|
-
import * as tui from '../../../tui';
|
|
4
|
-
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
5
3
|
import { getCommand } from '../../../command-prefix';
|
|
6
|
-
import {
|
|
4
|
+
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
5
|
+
import * as tui from '../../../tui';
|
|
6
|
+
import { createCommand } from '../../../types';
|
|
7
7
|
|
|
8
8
|
function formatNumber(n: number): string {
|
|
9
9
|
if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
|
|
@@ -48,7 +48,13 @@ export const statsSubcommand = createCommand({
|
|
|
48
48
|
|
|
49
49
|
async handler(ctx) {
|
|
50
50
|
const { opts, options } = ctx;
|
|
51
|
-
const client = await getGlobalCatalystAPIClient(
|
|
51
|
+
const client = await getGlobalCatalystAPIClient(
|
|
52
|
+
ctx.logger,
|
|
53
|
+
ctx.auth,
|
|
54
|
+
ctx.config?.name,
|
|
55
|
+
undefined,
|
|
56
|
+
ctx.config
|
|
57
|
+
);
|
|
52
58
|
const orgId = ctx.orgId ?? ctx.options.orgId ?? ctx.config?.preferences?.orgId;
|
|
53
59
|
|
|
54
60
|
if (!orgId) {
|