@liquidmetal-ai/raindrop 0.13.0 → 0.15.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 +327 -89
- package/bundle/build-CBEGQPJT.js +62 -0
- package/bundle/{chunk-IEF2XC25.js → chunk-2PH3PHH3.js} +5 -3
- package/bundle/{chunk-4HZ22KOV.js → chunk-3CMR7ES5.js} +4 -4
- package/bundle/{chunk-JSBM2JYW.js → chunk-3EYKCHIK.js} +1 -1
- package/bundle/chunk-5XHDP4VK.js +1697 -0
- package/bundle/{chunk-TSQK4HH6.js → chunk-674GMSXY.js} +1 -1
- package/bundle/{chunk-PS3WZBDF.js → chunk-6L4V66WZ.js} +1105 -2728
- package/bundle/{chunk-5245CEUM.js → chunk-AGG7JZVH.js} +2 -2
- package/bundle/{chunk-3GFKUF5D.js → chunk-B3IY2XS6.js} +4 -2
- package/bundle/{chunk-WIDI65NO.js → chunk-CBAXTRCS.js} +1 -1
- package/bundle/{chunk-JLVDTXO2.js → chunk-DPV5HIG7.js} +4 -4
- package/bundle/{chunk-36GNZK4A.js → chunk-EVXLXWP7.js} +1 -1
- package/bundle/{chunk-4YVU5KEQ.js → chunk-HN3AAKRY.js} +4 -2
- package/bundle/{chunk-NVNEQXHN.js → chunk-IGLE4Y3B.js} +7 -5
- package/bundle/{chunk-FGSYWVBA.js → chunk-IQ6HFRA6.js} +1 -1
- package/bundle/{chunk-O3QZDJ75.js → chunk-JQONDSHY.js} +2 -2
- package/bundle/{chunk-W4IPOFZC.js → chunk-KADMFJLN.js} +8 -6
- package/bundle/chunk-KG5BLUGU.js +246 -0
- package/bundle/{chunk-V5LHJTYS.js → chunk-KLOYSTZY.js} +13 -2
- package/bundle/{chunk-ETC5VU7H.js → chunk-KXHVSLAI.js} +1 -1
- package/bundle/{chunk-Y4WFGNPM.js → chunk-L6FRQULN.js} +1 -1
- package/bundle/{chunk-3QCVYSRU.js → chunk-LT3BFQ4O.js} +1 -1
- package/bundle/{chunk-KQZJHBNG.js → chunk-MBLKVNI5.js} +1 -1
- package/bundle/{chunk-6AIUQUUM.js → chunk-MFMVJZW6.js} +71 -15
- package/bundle/{chunk-25T7MEKO.js → chunk-MJBLNWG3.js} +1 -1
- package/bundle/{chunk-MSJ33O5Y.js → chunk-NRCQIE3Z.js} +95 -115
- package/bundle/{chunk-XKKPPSPC.js → chunk-OCYTN4IH.js} +2 -2
- package/bundle/{chunk-2GAMWFJE.js → chunk-QEF5D4VE.js} +1 -1
- package/bundle/{chunk-4B3QYXBA.js → chunk-T7MQCLXF.js} +5 -3
- package/bundle/{chunk-LDFYPOXJ.js → chunk-TFQY5TSY.js} +1 -1
- package/bundle/{chunk-BWK4MC7Y.js → chunk-USZXZZAR.js} +8 -6
- package/bundle/{chunk-ER2RCPCY.js → chunk-V54KHS5B.js} +2 -2
- package/bundle/{chunk-YSKASURB.js → chunk-V6J23FL2.js} +1 -1
- package/bundle/{chunk-UHSTDJ7X.js → chunk-VN2QYX4C.js} +1 -1
- package/bundle/{chunk-Z4OWKG7J.js → chunk-VOT5MMEY.js} +1 -1
- package/bundle/{chunk-W6GU26WO.js → chunk-WG6BDFPZ.js} +1 -1
- package/bundle/{chunk-AK77X5GL.js → chunk-XX74I5RK.js} +4 -2
- package/bundle/{chunk-6BT265R3.js → chunk-YQCRWPNI.js} +1 -1
- package/bundle/commands/annotation/get.js +3 -3
- package/bundle/commands/annotation/list.js +3 -3
- package/bundle/commands/annotation/put.js +3 -3
- package/bundle/commands/auth/apikey.js +2 -2
- package/bundle/commands/auth/list.js +2 -2
- package/bundle/commands/auth/login.js +2 -2
- package/bundle/commands/auth/logout.js +2 -2
- package/bundle/commands/auth/select.js +3 -3
- package/bundle/commands/bucket/create-credential.js +2 -2
- package/bundle/commands/bucket/delete-credential.js +2 -2
- package/bundle/commands/bucket/get-credential.js +2 -2
- package/bundle/commands/bucket/list-credentials.js +2 -2
- package/bundle/commands/build/actor/setup.js +124 -0
- package/bundle/commands/build/branch.js +10 -10
- package/bundle/commands/build/bucket-events/setup.js +146 -0
- package/bundle/commands/build/checkout.js +8 -8
- package/bundle/commands/build/clone.js +6 -6
- package/bundle/commands/build/delete.js +8 -8
- package/bundle/commands/build/deploy.js +10 -10
- package/bundle/commands/build/env/get.js +3 -3
- package/bundle/commands/build/env/list.js +2 -2
- package/bundle/commands/build/env/set.js +3 -3
- package/bundle/commands/build/env.js +2 -2
- package/bundle/commands/build/features.js +192 -0
- package/bundle/commands/build/find.js +4 -4
- package/bundle/commands/build/generate.js +52 -3
- package/bundle/commands/build/init-workspace.js +3 -3
- package/bundle/commands/build/init.js +15 -3
- package/bundle/commands/build/list.js +5 -5
- package/bundle/commands/build/queue/setup.js +133 -0
- package/bundle/commands/build/sandbox.js +6 -6
- package/bundle/commands/build/smartbucket/setup.js +165 -0
- package/bundle/commands/build/smartmemory/setup.js +171 -0
- package/bundle/commands/build/smartsql/setup.js +167 -0
- package/bundle/commands/build/start.js +2 -2
- package/bundle/commands/build/status.js +5 -5
- package/bundle/commands/build/stop.js +2 -2
- package/bundle/commands/build/stripe/dashboard.js +3 -3
- package/bundle/commands/build/stripe/onboard.js +3 -3
- package/bundle/commands/build/stripe/setup.js +3 -3
- package/bundle/commands/build/stripe/start.js +14 -14
- package/bundle/commands/build/stripe/status.js +3 -3
- package/bundle/commands/build/stripe/subscription/create.js +4 -4
- package/bundle/commands/build/stripe/subscription/get.js +4 -4
- package/bundle/commands/build/stripe/subscription/update.js +4 -4
- package/bundle/commands/build/tools/check.js +2 -2
- package/bundle/commands/build/tools/fmt.js +2 -2
- package/bundle/commands/build/unsandbox.js +6 -6
- package/bundle/commands/build/upload.js +5 -5
- package/bundle/commands/build/validate.js +85 -14
- package/bundle/commands/build/workos/delete.js +6 -6
- package/bundle/commands/build/workos/env/attach.js +3 -3
- package/bundle/commands/build/workos/env/attached.js +3 -3
- package/bundle/commands/build/workos/env/create.js +3 -3
- package/bundle/commands/build/workos/env/delete.js +3 -3
- package/bundle/commands/build/workos/env/detach.js +3 -3
- package/bundle/commands/build/workos/env/dev-login.js +3 -3
- package/bundle/commands/build/workos/env/get.js +3 -3
- package/bundle/commands/build/workos/env/list.js +3 -3
- package/bundle/commands/build/workos/env/set.js +3 -3
- package/bundle/commands/build/workos/invite.js +3 -3
- package/bundle/commands/build/workos/jwt.js +172 -0
- package/bundle/commands/build/workos/setup.js +3 -3
- package/bundle/commands/build/workos/status.js +3 -3
- package/bundle/commands/dns/create.js +2 -2
- package/bundle/commands/dns/delete.js +6 -6
- package/bundle/commands/dns/get.js +6 -6
- package/bundle/commands/dns/list.js +3 -3
- package/bundle/commands/dns/records/create.js +2 -2
- package/bundle/commands/dns/records/delete.js +3 -3
- package/bundle/commands/dns/records/get.js +2 -2
- package/bundle/commands/dns/records/list.js +2 -2
- package/bundle/commands/dns/records/update.js +2 -2
- package/bundle/commands/doctor.js +309 -0
- package/bundle/commands/logs/query.js +3 -3
- package/bundle/commands/logs/tail.js +3 -3
- package/bundle/commands/mcp/install-claude.js +2 -2
- package/bundle/commands/mcp/install-gemini.js +2 -2
- package/bundle/commands/mcp/install-goose.js +2 -2
- package/bundle/commands/mcp/status.js +2 -2
- package/bundle/commands/object/delete.js +5 -37
- package/bundle/commands/object/get.js +5 -37
- package/bundle/commands/object/list.js +7 -39
- package/bundle/commands/object/put.js +5 -37
- package/bundle/commands/query/chunk-search.js +14 -46
- package/bundle/commands/query/document.js +17 -55
- package/bundle/commands/query/events.js +2 -2
- package/bundle/commands/query/reindex.js +2 -2
- package/bundle/commands/query/search.js +14 -46
- package/bundle/commands/tail.js +2 -2
- package/bundle/index.js +1 -1
- package/dist/commands/build/actor/setup.d.ts +22 -0
- package/dist/commands/build/actor/setup.d.ts.map +1 -0
- package/dist/commands/build/actor/setup.js +116 -0
- package/dist/commands/build/bucket-events/setup.d.ts +22 -0
- package/dist/commands/build/bucket-events/setup.d.ts.map +1 -0
- package/dist/commands/build/bucket-events/setup.js +134 -0
- package/dist/commands/build/features.d.ts +19 -0
- package/dist/commands/build/features.d.ts.map +1 -0
- package/dist/commands/build/features.js +97 -0
- package/dist/commands/build/generate.d.ts +2 -0
- package/dist/commands/build/generate.d.ts.map +1 -1
- package/dist/commands/build/generate.js +52 -0
- package/dist/commands/build/init.d.ts.map +1 -1
- package/dist/commands/build/init.js +10 -0
- package/dist/commands/build/queue/setup.d.ts +21 -0
- package/dist/commands/build/queue/setup.d.ts.map +1 -0
- package/dist/commands/build/queue/setup.js +120 -0
- package/dist/commands/build/smartbucket/setup.d.ts +23 -0
- package/dist/commands/build/smartbucket/setup.d.ts.map +1 -0
- package/dist/commands/build/smartbucket/setup.js +167 -0
- package/dist/commands/build/smartmemory/setup.d.ts +23 -0
- package/dist/commands/build/smartmemory/setup.d.ts.map +1 -0
- package/dist/commands/build/smartmemory/setup.js +172 -0
- package/dist/commands/build/smartsql/setup.d.ts +23 -0
- package/dist/commands/build/smartsql/setup.d.ts.map +1 -0
- package/dist/commands/build/smartsql/setup.js +169 -0
- package/dist/commands/build/validate.d.ts +2 -0
- package/dist/commands/build/validate.d.ts.map +1 -1
- package/dist/commands/build/validate.js +80 -8
- package/dist/commands/build/workos/jwt.d.ts +23 -0
- package/dist/commands/build/workos/jwt.d.ts.map +1 -0
- package/dist/commands/build/workos/jwt.js +172 -0
- package/dist/commands/doctor.d.ts +27 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +328 -0
- package/dist/commands/object/delete.d.ts +0 -2
- package/dist/commands/object/delete.d.ts.map +1 -1
- package/dist/commands/object/delete.js +3 -38
- package/dist/commands/object/get.d.ts +0 -2
- package/dist/commands/object/get.d.ts.map +1 -1
- package/dist/commands/object/get.js +3 -38
- package/dist/commands/object/list.d.ts +0 -2
- package/dist/commands/object/list.d.ts.map +1 -1
- package/dist/commands/object/list.js +5 -40
- package/dist/commands/object/put.d.ts +0 -2
- package/dist/commands/object/put.d.ts.map +1 -1
- package/dist/commands/object/put.js +3 -38
- package/dist/commands/query/chunk-search.d.ts +0 -2
- package/dist/commands/query/chunk-search.d.ts.map +1 -1
- package/dist/commands/query/chunk-search.js +12 -46
- package/dist/commands/query/document.d.ts +1 -3
- package/dist/commands/query/document.d.ts.map +1 -1
- package/dist/commands/query/document.js +16 -60
- package/dist/commands/query/search.d.ts +0 -2
- package/dist/commands/query/search.d.ts.map +1 -1
- package/dist/commands/query/search.js +12 -46
- package/dist/feature-catalog.d.ts +28 -0
- package/dist/feature-catalog.d.ts.map +1 -0
- package/dist/feature-catalog.js +104 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -2
- package/oclif.manifest.json +4811 -3433
- package/package.json +3 -3
- package/templates/examples/smartbucket-minimal.ts.hbs +87 -0
- package/templates/examples/smartmemory-minimal.ts.hbs +82 -0
- package/templates/examples/smartsql-minimal.ts.hbs +69 -0
- package/templates/handlers/actor/index.test.ts.hbs +48 -85
- package/templates/handlers/actor/index.ts.hbs +16 -316
- package/templates/handlers/bucket-event-notification/index.ts.hbs +32 -235
- package/templates/handlers/bucket-event-observer.ts.hbs +79 -0
- package/templates/handlers/http-service/index.test.ts.hbs +3 -0
- package/templates/handlers/http-service/index.ts.hbs +43 -15
- package/templates/handlers/queue-consumer-setup.ts.hbs +45 -0
- package/templates/handlers/task/index.test.ts.hbs +30 -112
- package/templates/handlers/task/index.ts.hbs +19 -58
- package/templates/init/RAINDROP.md.hbs +97 -1
- package/templates/init/eslint.config.js +43 -0
- package/templates/init/package.json.hbs +4 -1
- package/templates/init/tsconfig.json +3 -3
- package/bundle/chunk-23UBI7BN.js +0 -48
- package/bundle/chunk-2QWMBNE3.js +0 -384
- package/bundle/chunk-45IYWQDC.js +0 -384
- package/bundle/chunk-5YUO23QU.js +0 -4585
- package/bundle/chunk-6MIGCNUO.js +0 -75
- package/bundle/chunk-7ZJWA6HP.js +0 -805
- package/bundle/chunk-AIYVX2M7.js +0 -44
- package/bundle/chunk-BB5TNIEM.js +0 -48
- package/bundle/chunk-BUR3HFKH.js +0 -488
- package/bundle/chunk-BYSBS7KT.js +0 -488
- package/bundle/chunk-CX3RWI62.js +0 -28658
- package/bundle/chunk-DLH7MI57.js +0 -305
- package/bundle/chunk-E3WJIYJZ.js +0 -12148
- package/bundle/chunk-EX7NOPRF.js +0 -12148
- package/bundle/chunk-F76JQS2J.js +0 -231
- package/bundle/chunk-FBOXMVKD.js +0 -28679
- package/bundle/chunk-FTPZ6SQW.js +0 -238909
- package/bundle/chunk-H3CFZ7ZH.js +0 -74
- package/bundle/chunk-HXOILVWA.js +0 -384
- package/bundle/chunk-IMP7O5AC.js +0 -22452
- package/bundle/chunk-IPYOAKRE.js +0 -231
- package/bundle/chunk-J7HN6XF2.js +0 -4461
- package/bundle/chunk-JOLOAALA.js +0 -231
- package/bundle/chunk-JZ2G4Q35.js +0 -4585
- package/bundle/chunk-KVAWPWF7.js +0 -231
- package/bundle/chunk-MEUAAIXV.js +0 -28657
- package/bundle/chunk-QBWFE57Z.js +0 -384
- package/bundle/chunk-SP3LOXPC.js +0 -46
- package/bundle/chunk-T7C564PR.js +0 -28678
- package/bundle/chunk-UFH545WJ.js +0 -22452
- package/bundle/chunk-UHVMPWM5.js +0 -315
- package/bundle/chunk-VB7ZTSZV.js +0 -1089
- package/bundle/chunk-VBIJDFMJ.js +0 -384
- package/bundle/chunk-VR7RLTE3.js +0 -231
- package/bundle/chunk-WFZUJLEC.js +0 -231
- package/bundle/chunk-YDGJTLVZ.js +0 -133
- package/bundle/chunk-YPNQ7UFK.js +0 -502
- package/bundle/chunk-YXFDRMSN.js +0 -384
- package/dist/lib/dns-utils.d.ts +0 -7
- package/dist/lib/dns-utils.d.ts.map +0 -1
- package/dist/lib/dns-utils.js +0 -44
package/bundle/chunk-UHVMPWM5.js
DELETED
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
source_default
|
|
3
|
-
} from "./chunk-YPNQ7UFK.js";
|
|
4
|
-
import {
|
|
5
|
-
UnitState,
|
|
6
|
-
init_cjs_shims,
|
|
7
|
-
timestampDate,
|
|
8
|
-
valueOf
|
|
9
|
-
} from "./chunk-FTPZ6SQW.js";
|
|
10
|
-
|
|
11
|
-
// src/status.ts
|
|
12
|
-
init_cjs_shims();
|
|
13
|
-
import * as readline from "readline";
|
|
14
|
-
var statusString = {
|
|
15
|
-
[UnitState.UNSPECIFIED]: "<unknown>",
|
|
16
|
-
[UnitState.PENDING]: "pending...",
|
|
17
|
-
[UnitState.STARTING]: "starting...",
|
|
18
|
-
[UnitState.RUNNING]: "running",
|
|
19
|
-
[UnitState.STOPPING]: "stopping...",
|
|
20
|
-
[UnitState.STOPPED]: "stopped",
|
|
21
|
-
[UnitState.DELETING]: "deleting...",
|
|
22
|
-
[UnitState.DELETED]: "deleted"
|
|
23
|
-
};
|
|
24
|
-
function mergeStatusWithDetails(statusResponse, modulesResponse) {
|
|
25
|
-
const enhancedModules = statusResponse.modules.map((statusModule) => {
|
|
26
|
-
const detailsModule = modulesResponse.modules.find(
|
|
27
|
-
(m) => m.name === statusModule.name
|
|
28
|
-
);
|
|
29
|
-
const enhancedModule = {
|
|
30
|
-
// From status API
|
|
31
|
-
name: statusModule.name,
|
|
32
|
-
state: statusModule.state,
|
|
33
|
-
notification: statusModule.notification
|
|
34
|
-
};
|
|
35
|
-
if (detailsModule) {
|
|
36
|
-
enhancedModule.moduleId = detailsModule.moduleId;
|
|
37
|
-
enhancedModule.type = detailsModule.type;
|
|
38
|
-
enhancedModule.moduleType = detailsModule.moduleType;
|
|
39
|
-
enhancedModule.convergedAt = detailsModule.convergedAt ? timestampDate(detailsModule.convergedAt) : void 0;
|
|
40
|
-
enhancedModule.organizationId = detailsModule.organizationId;
|
|
41
|
-
enhancedModule.applicationName = detailsModule.applicationName;
|
|
42
|
-
enhancedModule.applicationVersionId = detailsModule.applicationVersionId;
|
|
43
|
-
if (detailsModule.smartBucket) enhancedModule.smartBucket = detailsModule.smartBucket;
|
|
44
|
-
if (detailsModule.bucket) enhancedModule.bucket = detailsModule.bucket;
|
|
45
|
-
if (detailsModule.service) enhancedModule.service = detailsModule.service;
|
|
46
|
-
if (detailsModule.actor) enhancedModule.actor = detailsModule.actor;
|
|
47
|
-
if (detailsModule.observer) enhancedModule.observer = detailsModule.observer;
|
|
48
|
-
if (detailsModule.task) enhancedModule.task = detailsModule.task;
|
|
49
|
-
if (detailsModule.sqlDatabase) enhancedModule.sqlDatabase = detailsModule.sqlDatabase;
|
|
50
|
-
if (detailsModule.vectorIndex) enhancedModule.vectorIndex = detailsModule.vectorIndex;
|
|
51
|
-
if (detailsModule.queue) enhancedModule.queue = detailsModule.queue;
|
|
52
|
-
if (detailsModule.kvCache) enhancedModule.kvCache = detailsModule.kvCache;
|
|
53
|
-
if (detailsModule.smartMemory) enhancedModule.smartMemory = detailsModule.smartMemory;
|
|
54
|
-
if (detailsModule.smartSql) enhancedModule.smartSql = detailsModule.smartSql;
|
|
55
|
-
if (detailsModule.mcpService) enhancedModule.mcpService = detailsModule.mcpService;
|
|
56
|
-
}
|
|
57
|
-
return enhancedModule;
|
|
58
|
-
});
|
|
59
|
-
return {
|
|
60
|
-
state: statusResponse.state,
|
|
61
|
-
modules: enhancedModules,
|
|
62
|
-
lock: statusResponse.lock
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
async function getStatus(options) {
|
|
66
|
-
const { command, impersonate } = options;
|
|
67
|
-
let applicationName = options.applicationName;
|
|
68
|
-
let versionId = options.versionId;
|
|
69
|
-
if (!versionId) {
|
|
70
|
-
const config = await command.loadConfig();
|
|
71
|
-
versionId = config.versionId;
|
|
72
|
-
}
|
|
73
|
-
if (!applicationName) {
|
|
74
|
-
const apps = await command.loadManifest();
|
|
75
|
-
const app = apps[0];
|
|
76
|
-
if (app === void 0) {
|
|
77
|
-
command.error("No application provided or found in manifest");
|
|
78
|
-
}
|
|
79
|
-
applicationName = valueOf(app.name);
|
|
80
|
-
}
|
|
81
|
-
const { client: catalogService, userId, organizationId: defaultOrganizationId } = await command.catalogService();
|
|
82
|
-
const organizationId = impersonate ?? defaultOrganizationId;
|
|
83
|
-
const status = await catalogService.status({
|
|
84
|
-
userId,
|
|
85
|
-
organizationId,
|
|
86
|
-
applicationName,
|
|
87
|
-
currentVersionId: versionId || ""
|
|
88
|
-
});
|
|
89
|
-
if (status === void 0) {
|
|
90
|
-
command.error(`Application ${applicationName} not found`);
|
|
91
|
-
}
|
|
92
|
-
return status;
|
|
93
|
-
}
|
|
94
|
-
async function getEnhancedStatus(options) {
|
|
95
|
-
const { command, impersonate } = options;
|
|
96
|
-
let applicationName = options.applicationName;
|
|
97
|
-
let versionId = options.versionId;
|
|
98
|
-
if (!versionId) {
|
|
99
|
-
const config = await command.loadConfig();
|
|
100
|
-
versionId = config.versionId;
|
|
101
|
-
}
|
|
102
|
-
if (!applicationName) {
|
|
103
|
-
const apps = await command.loadManifest();
|
|
104
|
-
const app = apps[0];
|
|
105
|
-
if (app === void 0) {
|
|
106
|
-
command.error("No application provided or found in manifest");
|
|
107
|
-
}
|
|
108
|
-
applicationName = valueOf(app.name);
|
|
109
|
-
}
|
|
110
|
-
const { client: catalogService, userId, organizationId: defaultOrganizationId } = await command.catalogService();
|
|
111
|
-
const organizationId = impersonate ?? defaultOrganizationId;
|
|
112
|
-
const statusResponse = await catalogService.status({
|
|
113
|
-
userId,
|
|
114
|
-
organizationId,
|
|
115
|
-
applicationName,
|
|
116
|
-
currentVersionId: versionId || ""
|
|
117
|
-
});
|
|
118
|
-
if (statusResponse === void 0) {
|
|
119
|
-
command.error(`Application ${applicationName} not found`);
|
|
120
|
-
}
|
|
121
|
-
if (statusResponse.state === UnitState.RUNNING) {
|
|
122
|
-
try {
|
|
123
|
-
const modulesResponse = await catalogService.queryModules({
|
|
124
|
-
userId,
|
|
125
|
-
organizationId,
|
|
126
|
-
applicationName,
|
|
127
|
-
applicationVersionId: versionId || ""
|
|
128
|
-
});
|
|
129
|
-
return mergeStatusWithDetails(statusResponse, modulesResponse);
|
|
130
|
-
} catch (error) {
|
|
131
|
-
command.log(`Warning: Could not fetch module details: ${error}`);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
return {
|
|
135
|
-
state: statusResponse.state,
|
|
136
|
-
modules: statusResponse.modules.map((module) => ({
|
|
137
|
-
name: module.name,
|
|
138
|
-
state: module.state,
|
|
139
|
-
notification: module.notification
|
|
140
|
-
})),
|
|
141
|
-
lock: statusResponse.lock
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
async function watchStatus(options) {
|
|
145
|
-
const { command } = options;
|
|
146
|
-
const renderer = new StatusRenderer();
|
|
147
|
-
let applicationName = options.applicationName;
|
|
148
|
-
let versionId = options.versionId;
|
|
149
|
-
if (!applicationName) {
|
|
150
|
-
const apps = await command.loadManifest();
|
|
151
|
-
const app = apps[0];
|
|
152
|
-
if (app) {
|
|
153
|
-
applicationName = valueOf(app.name);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
if (!versionId) {
|
|
157
|
-
const config = await command.loadConfig();
|
|
158
|
-
versionId = config.versionId;
|
|
159
|
-
}
|
|
160
|
-
let status = await getEnhancedStatus(options);
|
|
161
|
-
while (true) {
|
|
162
|
-
renderer.renderLive(status, applicationName, versionId);
|
|
163
|
-
if (status.state === UnitState.RUNNING || status.state === UnitState.STOPPED) {
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
167
|
-
status = await getEnhancedStatus(options);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
var StatusRenderer = class {
|
|
171
|
-
linesLastRendered = 0;
|
|
172
|
-
getStatusColor(state) {
|
|
173
|
-
switch (state) {
|
|
174
|
-
case UnitState.RUNNING:
|
|
175
|
-
return source_default.green;
|
|
176
|
-
case UnitState.PENDING:
|
|
177
|
-
case UnitState.STARTING:
|
|
178
|
-
return source_default.yellow;
|
|
179
|
-
case UnitState.STOPPING:
|
|
180
|
-
case UnitState.DELETING:
|
|
181
|
-
return source_default.yellow;
|
|
182
|
-
case UnitState.STOPPED:
|
|
183
|
-
case UnitState.DELETED:
|
|
184
|
-
return source_default.red;
|
|
185
|
-
default:
|
|
186
|
-
return source_default.gray;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
formatConvergedInfo(module) {
|
|
190
|
-
if (!module.convergedAt) return "";
|
|
191
|
-
const now = /* @__PURE__ */ new Date();
|
|
192
|
-
const converged = new Date(module.convergedAt);
|
|
193
|
-
const diffMs = now.getTime() - converged.getTime();
|
|
194
|
-
const diffMinutes = Math.floor(diffMs / 6e4);
|
|
195
|
-
if (diffMinutes < 1) return source_default.green("converged just now");
|
|
196
|
-
if (diffMinutes < 60) return source_default.green(`converged ${diffMinutes}m ago`);
|
|
197
|
-
const diffHours = Math.floor(diffMinutes / 60);
|
|
198
|
-
if (diffHours < 24) return source_default.green(`converged ${diffHours}h ago`);
|
|
199
|
-
return source_default.green(`converged ${converged.toLocaleDateString()}`);
|
|
200
|
-
}
|
|
201
|
-
renderModuleRoutes(module) {
|
|
202
|
-
const routes = [];
|
|
203
|
-
const serviceOrActor = module.service || module.actor || module.mcpService;
|
|
204
|
-
if (serviceOrActor?.routes && serviceOrActor.routes.length > 0) {
|
|
205
|
-
for (const route of serviceOrActor.routes) {
|
|
206
|
-
const routeInfo = route.id ? `${source_default.green(route.domain)} ${source_default.cyan(`[${route.id}]`)}` : source_default.green(route.domain);
|
|
207
|
-
routes.push(` \u2192 ${routeInfo}`);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
return routes;
|
|
211
|
-
}
|
|
212
|
-
renderModuleAttributes(module) {
|
|
213
|
-
const attributes = [];
|
|
214
|
-
if (module.smartBucket?.url) {
|
|
215
|
-
attributes.push(` Url: ${source_default.yellow(module.smartBucket.url)}`);
|
|
216
|
-
}
|
|
217
|
-
if (module.service?.visibility || module.actor?.visibility || module.mcpService?.visibility) {
|
|
218
|
-
const visibility = module.service?.visibility || module.actor?.visibility || module.mcpService?.visibility;
|
|
219
|
-
attributes.push(` visibility: ${source_default.yellow(visibility)}`);
|
|
220
|
-
}
|
|
221
|
-
return attributes;
|
|
222
|
-
}
|
|
223
|
-
renderLive(status, applicationName, versionId) {
|
|
224
|
-
if (this.linesLastRendered > 0) {
|
|
225
|
-
readline.moveCursor(process.stdout, 0, -this.linesLastRendered);
|
|
226
|
-
readline.clearScreenDown(process.stdout);
|
|
227
|
-
}
|
|
228
|
-
const lines = [];
|
|
229
|
-
lines.push(`${source_default.bold(applicationName)} ${source_default.dim(versionId ? `@${versionId.substring(0, 8)}...` : "")} ${source_default.dim(`(${status.modules.length} module${status.modules.length !== 1 ? "s" : ""})`)}`);
|
|
230
|
-
lines.push(source_default.dim(`Status: ${this.getStatusColor(status.state)(statusString[status.state])}`));
|
|
231
|
-
const hasEnhancedDetails = status.modules.some((m) => m.type);
|
|
232
|
-
if (hasEnhancedDetails) {
|
|
233
|
-
for (const module of status.modules) {
|
|
234
|
-
const statusColor = this.getStatusColor(module.state);
|
|
235
|
-
const typeInfo = module.type ? source_default.yellow(module.type) : source_default.gray("unknown");
|
|
236
|
-
const convergedInfo = this.formatConvergedInfo(module);
|
|
237
|
-
const hasExtraInfo = convergedInfo || this.renderModuleRoutes(module).length > 0 || this.renderModuleAttributes(module).length > 0;
|
|
238
|
-
const separator = hasExtraInfo ? convergedInfo ? ` - ${convergedInfo}` : "" : "";
|
|
239
|
-
lines.push(`\u2514\u2500 ${source_default.cyan(module.name)} ${typeInfo} - ${statusColor(statusString[module.state])}${separator}`);
|
|
240
|
-
const routes = this.renderModuleRoutes(module);
|
|
241
|
-
if (routes.length > 0) {
|
|
242
|
-
lines.push(...routes);
|
|
243
|
-
}
|
|
244
|
-
const attributes = this.renderModuleAttributes(module);
|
|
245
|
-
if (attributes.length > 0) {
|
|
246
|
-
lines.push(...attributes);
|
|
247
|
-
}
|
|
248
|
-
if ((routes.length > 0 || attributes.length > 0) && module !== status.modules[status.modules.length - 1]) {
|
|
249
|
-
lines.push("");
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
} else {
|
|
253
|
-
lines.push(`${source_default.bold("Modules")} ${source_default.dim(`(${status.modules.length})`)}`);
|
|
254
|
-
for (const module of status.modules) {
|
|
255
|
-
const statusColor = this.getStatusColor(module.state);
|
|
256
|
-
const notification = module.notification ? ` - ${source_default.cyan(module.notification)}` : "";
|
|
257
|
-
lines.push(` \u2514\u2500 ${source_default.yellow(module.name)} - ${statusColor(statusString[module.state])}${notification}`);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
const runningModules = status.modules.filter((m) => m.state === UnitState.RUNNING).length;
|
|
261
|
-
const totalModules = status.modules.length;
|
|
262
|
-
lines.push(source_default.dim("\u2500".repeat(50)));
|
|
263
|
-
lines.push(source_default.dim(`Total: ${totalModules} modules (${runningModules} running)`));
|
|
264
|
-
for (const line of lines) {
|
|
265
|
-
console.log(line);
|
|
266
|
-
}
|
|
267
|
-
this.linesLastRendered = lines.length;
|
|
268
|
-
}
|
|
269
|
-
renderCompact(status, applicationName, versionId) {
|
|
270
|
-
console.log(`${source_default.bold(applicationName)} ${source_default.dim(versionId ? `@${versionId.substring(0, 8)}...` : "")} ${source_default.dim(`(${status.modules.length} module${status.modules.length !== 1 ? "s" : ""})`)}`);
|
|
271
|
-
console.log(source_default.dim(`Status: ${this.getStatusColor(status.state)(statusString[status.state])}`));
|
|
272
|
-
const hasEnhancedDetails = status.modules.some((m) => m.type);
|
|
273
|
-
if (hasEnhancedDetails) {
|
|
274
|
-
for (const module of status.modules) {
|
|
275
|
-
const statusColor = this.getStatusColor(module.state);
|
|
276
|
-
const typeInfo = module.type ? source_default.yellow(module.type) : source_default.gray("unknown");
|
|
277
|
-
const convergedInfo = this.formatConvergedInfo(module);
|
|
278
|
-
const hasExtraInfo = convergedInfo || this.renderModuleRoutes(module).length > 0 || this.renderModuleAttributes(module).length > 0;
|
|
279
|
-
const separator = hasExtraInfo ? convergedInfo ? ` - ${convergedInfo}` : "" : "";
|
|
280
|
-
console.log(`\u2514\u2500 ${source_default.cyan(module.name)} ${typeInfo} - ${statusColor(statusString[module.state])}${separator}`);
|
|
281
|
-
const routes = this.renderModuleRoutes(module);
|
|
282
|
-
if (routes.length > 0) {
|
|
283
|
-
for (const route of routes) {
|
|
284
|
-
console.log(route);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
const attributes = this.renderModuleAttributes(module);
|
|
288
|
-
if (attributes.length > 0) {
|
|
289
|
-
for (const attribute of attributes) {
|
|
290
|
-
console.log(attribute);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
} else {
|
|
295
|
-
console.log(`${source_default.bold("Modules")} ${source_default.dim(`(${status.modules.length})`)}`);
|
|
296
|
-
for (const module of status.modules) {
|
|
297
|
-
const statusColor = this.getStatusColor(module.state);
|
|
298
|
-
const notification = module.notification ? ` - ${source_default.cyan(module.notification)}` : "";
|
|
299
|
-
console.log(` \u2514\u2500 ${source_default.yellow(module.name)} - ${statusColor(statusString[module.state])}${notification}`);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
const runningModules = status.modules.filter((m) => m.state === UnitState.RUNNING).length;
|
|
303
|
-
const totalModules = status.modules.length;
|
|
304
|
-
console.log(source_default.dim("\u2500".repeat(50)));
|
|
305
|
-
console.log(source_default.dim(`Total: ${totalModules} modules (${runningModules} running)`));
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
|
|
309
|
-
export {
|
|
310
|
-
statusString,
|
|
311
|
-
getStatus,
|
|
312
|
-
getEnhancedStatus,
|
|
313
|
-
watchStatus,
|
|
314
|
-
StatusRenderer
|
|
315
|
-
};
|