@liquidmetal-ai/raindrop 0.9.1 → 0.9.2

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.
Files changed (159) hide show
  1. package/README.md +111 -85
  2. package/bundle/{chunk-ZHYJWVIA.js → chunk-33VVNTZ7.js} +2 -2
  3. package/bundle/{chunk-SP4Q3T7T.js → chunk-3EXF5SKZ.js} +1 -1
  4. package/bundle/{chunk-JXNZYHAI.js → chunk-3TJC2HRW.js} +89 -105
  5. package/bundle/{chunk-HBDFBL3W.js → chunk-44MKXST7.js} +1 -1
  6. package/bundle/{chunk-GDYEPR67.js → chunk-4RZFURCF.js} +1 -1
  7. package/bundle/{chunk-67CBWZ7Y.js → chunk-4UNXUMLE.js} +3 -3
  8. package/bundle/chunk-4VJ2X7ZI.js +48 -0
  9. package/bundle/{chunk-IMQTVYRB.js → chunk-4WGY3ATR.js} +1 -1
  10. package/bundle/{chunk-ORPX7FPP.js → chunk-5TPOE7P2.js} +1 -5
  11. package/bundle/chunk-7JFKALLH.js +133 -0
  12. package/bundle/chunk-7O6U3ZAR.js +75 -0
  13. package/bundle/chunk-AWUA3C2V.js +114 -0
  14. package/bundle/{chunk-QKHN66ZN.js → chunk-BEN3KZQU.js} +1 -1
  15. package/bundle/{chunk-JDMAG4KE.js → chunk-BPZWIRQS.js} +2 -2
  16. package/bundle/chunk-C7G6I3MQ.js +292 -0
  17. package/bundle/chunk-D23L4WLL.js +502 -0
  18. package/bundle/chunk-E2TCXKAT.js +48 -0
  19. package/bundle/{chunk-FTG32FZ4.js → chunk-E7K6Y6GO.js} +1 -1
  20. package/bundle/chunk-EBK2SJTZ.js +805 -0
  21. package/bundle/chunk-FTH4A227.js +46 -0
  22. package/bundle/chunk-HBWEGYBW.js +4486 -0
  23. package/bundle/chunk-HFEVZZHW.js +46 -0
  24. package/bundle/chunk-I5M6WZPS.js +384 -0
  25. package/bundle/chunk-J44ZDCXF.js +44 -0
  26. package/bundle/{chunk-D5TOYPUE.js → chunk-J6XV5EH5.js} +1 -1
  27. package/bundle/chunk-KE7CMLHP.js +292 -0
  28. package/bundle/{chunk-ZLRYUJ5P.js → chunk-KHYRZQSK.js} +4 -4
  29. package/bundle/chunk-KOYRAC7N.js +74 -0
  30. package/bundle/chunk-KQ3F5KG7.js +231 -0
  31. package/bundle/chunk-KSXGB4ZG.js +4539 -0
  32. package/bundle/{chunk-7ERI6IFL.js → chunk-LP3LXBGR.js} +1 -1
  33. package/bundle/chunk-MH3BACIP.js +238722 -0
  34. package/bundle/chunk-MM7BYDBJ.js +238725 -0
  35. package/bundle/chunk-MQUFNQI5.js +231 -0
  36. package/bundle/{chunk-4RVUC2XX.js → chunk-N3LTFUBJ.js} +1 -1
  37. package/bundle/chunk-NWYJJVCF.js +22452 -0
  38. package/bundle/chunk-OAMLVMOY.js +133 -0
  39. package/bundle/chunk-PBVMMANP.js +4480 -0
  40. package/bundle/chunk-PT6CYFBD.js +74 -0
  41. package/bundle/chunk-QAG6TIB7.js +12148 -0
  42. package/bundle/chunk-RSLQIAJB.js +12148 -0
  43. package/bundle/chunk-SAU2NEDC.js +147 -0
  44. package/bundle/chunk-SZ6TMVT4.js +22452 -0
  45. package/bundle/chunk-T3MAVQWW.js +292 -0
  46. package/bundle/chunk-TCGZNSBY.js +4539 -0
  47. package/bundle/chunk-TRIIBQDR.js +4480 -0
  48. package/bundle/chunk-UUTXTOE3.js +231 -0
  49. package/bundle/chunk-VMKGSIXK.js +75 -0
  50. package/bundle/chunk-XDCRA7Y2.js +805 -0
  51. package/bundle/chunk-XEMONOX2.js +384 -0
  52. package/bundle/chunk-YAPQ2CKV.js +115 -0
  53. package/bundle/chunk-YDDBYUDC.js +502 -0
  54. package/bundle/chunk-ZGLCW5YO.js +380 -0
  55. package/bundle/chunk-ZQ6BFQSX.js +44 -0
  56. package/bundle/chunk-ZZTNAQSE.js +147 -0
  57. package/bundle/commands/annotation/get.js +3 -3
  58. package/bundle/commands/annotation/list.js +3 -3
  59. package/bundle/commands/annotation/put.js +3 -3
  60. package/bundle/commands/auth/list.js +2 -2
  61. package/bundle/commands/auth/login.js +3 -3
  62. package/bundle/commands/auth/logout.js +2 -2
  63. package/bundle/commands/auth/select.js +3 -3
  64. package/bundle/commands/bucket/create-credential.js +2 -2
  65. package/bundle/commands/bucket/delete-credential.js +2 -2
  66. package/bundle/commands/bucket/get-credential.js +2 -2
  67. package/bundle/commands/bucket/list-credentials.js +2 -2
  68. package/bundle/commands/build/branch.js +9 -9
  69. package/bundle/commands/build/checkout.js +6 -5
  70. package/bundle/commands/build/clone.js +5 -5
  71. package/bundle/commands/build/delete.js +6 -5
  72. package/bundle/commands/build/deploy.js +9 -9
  73. package/bundle/commands/build/env/get.js +2 -2
  74. package/bundle/commands/build/env/set.js +2 -2
  75. package/bundle/commands/build/find.js +7 -3
  76. package/bundle/commands/build/generate.js +3 -3
  77. package/bundle/commands/build/init-workspace.js +102 -0
  78. package/bundle/commands/build/init.js +3 -3
  79. package/bundle/commands/build/list.js +5 -4
  80. package/bundle/commands/build/sandbox.js +7 -7
  81. package/bundle/commands/build/start.js +2 -2
  82. package/bundle/commands/build/status.js +8 -4
  83. package/bundle/commands/build/stop.js +2 -2
  84. package/bundle/commands/build/tools/check.js +2 -2
  85. package/bundle/commands/build/tools/fmt.js +2 -2
  86. package/bundle/commands/build/unsandbox.js +7 -7
  87. package/bundle/commands/build/upload.js +5 -5
  88. package/bundle/commands/build/validate.js +4 -4
  89. package/bundle/commands/build/workos/delete.js +4 -4
  90. package/bundle/commands/build/workos/env/attach.js +3 -3
  91. package/bundle/commands/build/workos/env/create.js +3 -3
  92. package/bundle/commands/build/workos/env/delete.js +3 -3
  93. package/bundle/commands/build/workos/env/detach.js +3 -3
  94. package/bundle/commands/build/workos/env/get.js +3 -3
  95. package/bundle/commands/build/workos/env/list.js +3 -3
  96. package/bundle/commands/build/workos/env/set.js +3 -3
  97. package/bundle/commands/build/workos/invite.js +3 -3
  98. package/bundle/commands/build/workos/setup.js +3 -3
  99. package/bundle/commands/build/workos/status.js +3 -3
  100. package/bundle/commands/dns/create.js +2 -2
  101. package/bundle/commands/dns/delete.js +4 -4
  102. package/bundle/commands/dns/get.js +4 -4
  103. package/bundle/commands/dns/list.js +3 -3
  104. package/bundle/commands/dns/records/create.js +2 -2
  105. package/bundle/commands/dns/records/delete.js +3 -3
  106. package/bundle/commands/dns/records/get.js +2 -2
  107. package/bundle/commands/dns/records/list.js +2 -2
  108. package/bundle/commands/dns/records/update.js +2 -2
  109. package/bundle/commands/logs/query.js +3 -3
  110. package/bundle/commands/logs/tail.js +3 -3
  111. package/bundle/commands/mcp/install-claude.js +2 -2
  112. package/bundle/commands/mcp/install-gemini.js +2 -2
  113. package/bundle/commands/mcp/install-goose.js +2 -2
  114. package/bundle/commands/mcp/status.js +2 -2
  115. package/bundle/commands/object/delete.js +2 -2
  116. package/bundle/commands/object/get.js +2 -2
  117. package/bundle/commands/object/list.js +2 -2
  118. package/bundle/commands/object/put.js +2 -2
  119. package/bundle/commands/query/chunk-search.js +3 -3
  120. package/bundle/commands/query/document.js +3 -3
  121. package/bundle/commands/query/events.js +2 -2
  122. package/bundle/commands/query/reindex.js +2 -2
  123. package/bundle/commands/query/search.js +3 -3
  124. package/bundle/commands/tail.js +2 -2
  125. package/bundle/index.js +1 -1
  126. package/dist/commands/build/find.d.ts.map +1 -1
  127. package/dist/commands/build/find.js +3 -0
  128. package/dist/commands/build/init-workspace.d.ts +16 -0
  129. package/dist/commands/build/init-workspace.d.ts.map +1 -0
  130. package/dist/commands/build/init-workspace.js +95 -0
  131. package/dist/commands/build/list.d.ts.map +1 -1
  132. package/dist/commands/build/list.js +3 -0
  133. package/dist/commands/build/status.d.ts.map +1 -1
  134. package/dist/commands/build/status.js +3 -0
  135. package/dist/killswitch-utils.d.ts +30 -0
  136. package/dist/killswitch-utils.d.ts.map +1 -0
  137. package/dist/killswitch-utils.js +83 -0
  138. package/oclif.manifest.json +2114 -2007
  139. package/package.json +3 -3
  140. package/templates/claude-code/debug-raindrop-app.md +12 -39
  141. package/templates/claude-code/update-raindrop-app.md +5 -6
  142. package/templates/db/node_modules/.bin/prisma +2 -2
  143. package/templates/db/node_modules/.bin/prisma-kysely +2 -2
  144. package/templates/db/node_modules/.bin/tsc +2 -2
  145. package/templates/db/node_modules/.bin/tsserver +2 -2
  146. package/templates/db/node_modules/.bin/zx +2 -2
  147. package/templates/gemini-code/debug-raindrop-app.toml +12 -39
  148. package/templates/gemini-code/update-raindrop-app.toml +5 -6
  149. package/templates/goose/debug-raindrop-app.yaml +12 -39
  150. package/templates/goose/update-raindrop-app.yaml +5 -6
  151. package/templates/workspace/.gitignore.hbs +40 -0
  152. package/templates/workspace/package.json.hbs +22 -0
  153. package/dist/commands/killswitch.d.ts +0 -20
  154. package/dist/commands/killswitch.d.ts.map +0 -1
  155. package/dist/commands/killswitch.js +0 -58
  156. package/dist/tsconfig.tsbuildinfo +0 -1
  157. package/dist/utils/mixpanel.d.ts +0 -10
  158. package/dist/utils/mixpanel.d.ts.map +0 -1
  159. package/dist/utils/mixpanel.js +0 -43
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  BaseCommand
3
- } from "../chunk-GCLJVMUS.js";
3
+ } from "../chunk-TCGZNSBY.js";
4
4
  import {
5
5
  init_cjs_shims
6
- } from "../chunk-VEVVJAL6.js";
6
+ } from "../chunk-3TJC2HRW.js";
7
7
 
8
8
  // src/commands/tail.ts
9
9
  init_cjs_shims();
package/bundle/index.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  serviceClient,
23
23
  versionInterceptor,
24
24
  workosIntegrationService
25
- } from "./chunk-VEVVJAL6.js";
25
+ } from "./chunk-3TJC2HRW.js";
26
26
  var export_run = import_core.run;
27
27
  export {
28
28
  EPOCH_TS,
@@ -1 +1 @@
1
- {"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../src/commands/build/find.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;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,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,GAAG,CAAC,EAAE,OAAO,CAAC;KACf;IAoLD,OAAO,CAAC,uBAAuB;IAgB/B,OAAO,CAAC,aAAa;IAiCf,cAAc,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;IAiD5G,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAU3B"}
@@ -6,6 +6,7 @@ import { Flags } from '@oclif/core';
6
6
  import chalk from 'chalk';
7
7
  import { BaseCommand } from '../../base-command.js';
8
8
  import { EPOCH_TS } from '../../index.js';
9
+ import { checkAndDisplayKillswitchStatus } from '../../killswitch-utils.js';
9
10
  export default class Find extends BaseCommand {
10
11
  static args = {};
11
12
  static description = 'find resources in Raindrop';
@@ -353,6 +354,8 @@ Find modules for a specific application and version.
353
354
  }
354
355
  }
355
356
  async run() {
357
+ // Check and display killswitch status before finding resources
358
+ await checkAndDisplayKillswitchStatus(this);
356
359
  if (this.flags.sudo) {
357
360
  await this.queryResources(this.flags);
358
361
  }
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class InitWorkspace extends BaseCommand<typeof InitWorkspace> {
3
+ static args: {
4
+ path: import("@oclif/core/interfaces").Arg<string, {
5
+ exists?: boolean;
6
+ }>;
7
+ };
8
+ static description: string;
9
+ static examples: string[];
10
+ static flags: {
11
+ overwrite: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
16
+ //# sourceMappingURL=init-workspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init-workspace.d.ts","sourceRoot":"","sources":["../../../src/commands/build/init-workspace.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAOpD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,WAAW,CAAC,OAAO,aAAa,CAAC;IAC1E,MAAM,CAAC,IAAI;;;;MAET;IAEF,MAAM,CAAC,WAAW,SAA8D;IAEhF,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;MAGV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAoF3B"}
@@ -0,0 +1,95 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import fs from 'node:fs/promises';
3
+ import * as path from 'node:path';
4
+ import { BaseCommand } from '../../base-command.js';
5
+ import { fileExists, renderTemplateFromFile, TEMPLATES_DIR } from '../../codegen.js';
6
+ // Constants for workspace configuration
7
+ const MIN_NODE_VERSION = '>=18.0.0';
8
+ const WORKSPACE_DESCRIPTION = 'LiquidMetal AI workspace';
9
+ export default class InitWorkspace extends BaseCommand {
10
+ static args = {
11
+ path: Args.directory({ default: '.', description: 'Path to initialize the workspace in', required: false }),
12
+ };
13
+ static description = 'initialize a new npm workspace for Raindrop applications';
14
+ static examples = [
15
+ `<%= config.bin %> <%= command.id %> .
16
+ Initialize a workspace in the current directory.
17
+ `,
18
+ ];
19
+ static flags = {
20
+ overwrite: Flags.boolean({ description: 'Overwrite existing files', default: false }),
21
+ name: Flags.string({ char: 'n', description: 'Name of the workspace' }),
22
+ };
23
+ async run() {
24
+ const workspacePath = path.resolve(this.args.path);
25
+ // Use the directory name as default workspace name, or the flag if provided
26
+ const workspaceName = this.flags.name || path.basename(workspacePath);
27
+ this.log(`Initializing npm workspace at: ${workspacePath}`);
28
+ // Validate destination directory exists
29
+ if (!(await fileExists(workspacePath))) {
30
+ try {
31
+ await fs.mkdir(workspacePath, { recursive: true });
32
+ }
33
+ catch (error) {
34
+ this.error(`Could not create directory ${workspacePath}: ${error}`, { exit: 1 });
35
+ }
36
+ }
37
+ const pathStat = await fs.lstat(workspacePath);
38
+ if (!pathStat.isDirectory()) {
39
+ this.error(`${workspacePath} is not a directory.`, { exit: 1 });
40
+ }
41
+ // Check if directory already has a package.json (workspace might already exist)
42
+ const packageJsonPath = path.join(workspacePath, 'package.json');
43
+ if (!this.flags.overwrite && (await fileExists(packageJsonPath))) {
44
+ // Check if it's already a workspace
45
+ let existingPackageJson;
46
+ try {
47
+ existingPackageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));
48
+ }
49
+ catch (error) {
50
+ this.error(`Invalid package.json in ${workspacePath}: ${error}`, { exit: 1 });
51
+ }
52
+ if (existingPackageJson.workspaces) {
53
+ this.error(`This directory already contains an npm workspace.`, { exit: 1 });
54
+ }
55
+ else {
56
+ this.error(`A package.json already exists in ${workspacePath}. Use --overwrite to replace it.`, { exit: 1 });
57
+ }
58
+ }
59
+ // Check if apps directory already exists
60
+ const appsDir = path.join(workspacePath, 'apps');
61
+ if (!this.flags.overwrite && (await fileExists(appsDir))) {
62
+ this.error(`Apps directory already exists. Use --overwrite to replace it.`, { exit: 1 });
63
+ }
64
+ try {
65
+ // Create root package.json with workspace configuration using template
66
+ const templatePath = path.join(TEMPLATES_DIR, 'workspace', 'package.json.hbs');
67
+ const packageJsonContent = await renderTemplateFromFile(templatePath, {
68
+ workspaceName,
69
+ workspaceDescription: WORKSPACE_DESCRIPTION,
70
+ minNodeVersion: MIN_NODE_VERSION,
71
+ });
72
+ await fs.writeFile(packageJsonPath, packageJsonContent);
73
+ // Create apps directory
74
+ await fs.mkdir(appsDir, { recursive: true });
75
+ // Create .gitignore for workspace using template
76
+ const gitignorePath = path.join(workspacePath, '.gitignore');
77
+ if (!this.flags.overwrite || !(await fileExists(gitignorePath))) {
78
+ const gitignoreTemplatePath = path.join(TEMPLATES_DIR, 'workspace', '.gitignore.hbs');
79
+ const gitignoreContent = await renderTemplateFromFile(gitignoreTemplatePath, {});
80
+ await fs.writeFile(gitignorePath, gitignoreContent);
81
+ }
82
+ this.log(`✅ Successfully initialized npm workspace at ${workspacePath}`);
83
+ this.log(`📁 Created apps/ directory for your Raindrop applications`);
84
+ this.log(`📝 Next steps:`);
85
+ this.log(` 1. cd ${workspacePath}`);
86
+ this.log(` 2. npm install`);
87
+ this.log(` 3. cd apps`);
88
+ this.log(` 4. raindrop build init <app-name>`);
89
+ }
90
+ catch (error) {
91
+ const errorMessage = error instanceof Error ? error.message : String(error);
92
+ this.error(`Could not initialize workspace at ${workspacePath}: ${errorMessage}`, { exit: 1 });
93
+ }
94
+ }
95
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/build/list.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gCAAgC,EAEhC,SAAS,EACV,MAAM,yDAAyD,CAAC;AAGjE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIpD,UAAU,WAAW;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,WAAW,EAAE,gCAAgC,CAAC;IAC9C,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CASzC,CAAC;AAEX,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW,CAAC,OAAO,IAAI,CAAC;IACxD,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,WAAW,SAAqC;IAEvD,MAAM,CAAC,QAAQ,WAgBb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;;;;;MAmCV;IAEF,gBAAgB,CAAC,YAAY,EAAE,gCAAgC,EAAE;;;;IAkCjE,iBAAiB,CAAC,YAAY,EAAE,gCAAgC,EAAE;IA0IlE,aAAa,CAAC,GAAG,EAAE,gCAAgC,GAAG,MAA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I,OAAO,CAAC,IAAI,CAAC;CAK3B"}
@@ -5,6 +5,7 @@ import { Flags } from '@oclif/core';
5
5
  import chalk from 'chalk';
6
6
  import { BaseCommand } from '../../base-command.js';
7
7
  import { EPOCH_TS } from '../../index.js';
8
+ import { checkAndDisplayKillswitchStatus } from '../../killswitch-utils.js';
8
9
  export const statusString = {
9
10
  [UnitState.UNSPECIFIED]: '<unknown>',
10
11
  [UnitState.PENDING]: 'pending...',
@@ -415,6 +416,8 @@ Show only running/active versions.
415
416
  }
416
417
  }
417
418
  async run() {
419
+ // Check and display killswitch status before listing applications
420
+ await checkAndDisplayKillswitchStatus(this);
418
421
  await this.listApplications();
419
422
  }
420
423
  }
@@ -1 +1 @@
1
- {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/build/status.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,WAAW,SAAmD;IAErE,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;;;;;;MA0CV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAsD3B"}
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/build/status.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIpD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,WAAW,SAAmD;IAErE,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;;;;;;MA0CV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAyD3B"}
@@ -3,6 +3,7 @@ import { StatusResponseSchema } from '@liquidmetal-ai/drizzle/liquidmetal/v1alph
3
3
  import { Flags } from '@oclif/core';
4
4
  import Table from 'cli-table3';
5
5
  import { BaseCommand } from '../../base-command.js';
6
+ import { checkAndDisplayKillswitchStatus } from '../../killswitch-utils.js';
6
7
  import { getStatus, StatusRenderer, statusString, watchStatus } from '../../status.js';
7
8
  export default class Status extends BaseCommand {
8
9
  static args = {};
@@ -55,6 +56,8 @@ export default class Status extends BaseCommand {
55
56
  }),
56
57
  };
57
58
  async run() {
59
+ // Check and display killswitch status before showing application status
60
+ await checkAndDisplayKillswitchStatus(this);
58
61
  const flags = (await this.parse(Status)).flags;
59
62
  // Normalize flags (support both old and new names)
60
63
  const versionId = flags['version-id'] || flags.version;
@@ -0,0 +1,30 @@
1
+ import { BaseCommand } from './base-command.js';
2
+ export interface KillswitchStatus {
3
+ isActive: boolean;
4
+ reason?: string;
5
+ updatedAt?: Date;
6
+ }
7
+ /**
8
+ * Utility function to fetch killswitch status from the catalog service
9
+ * @param command - BaseCommand instance with catalogService access
10
+ * @returns Promise<KillswitchStatus> - Killswitch status information
11
+ */
12
+ export declare function getKillswitchStatus<T extends typeof BaseCommand>(command: BaseCommand<T>): Promise<{
13
+ status: KillswitchStatus;
14
+ organizationId: string;
15
+ }>;
16
+ /**
17
+ * Utility function to display killswitch warning if active
18
+ * @param killswitchStatus - Killswitch status to check
19
+ * @param command - BaseCommand instance for logging
20
+ * @param organizationId - Organization ID to display in the message
21
+ */
22
+ export declare function displayKillswitchWarning<T extends typeof BaseCommand>(killswitchStatus: KillswitchStatus, command: BaseCommand<T>, organizationId: string): void;
23
+ /**
24
+ * Combined utility function to fetch and display killswitch status
25
+ * This follows DRY principles by combining the common pattern
26
+ * @param command - BaseCommand instance with catalogService access
27
+ * @returns Promise<KillswitchStatus> - Killswitch status information (for potential further use)
28
+ */
29
+ export declare function checkAndDisplayKillswitchStatus<T extends typeof BaseCommand>(command: BaseCommand<T>): Promise<KillswitchStatus>;
30
+ //# sourceMappingURL=killswitch-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"killswitch-utils.d.ts","sourceRoot":"","sources":["../src/killswitch-utils.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,CAAC,SAAS,OAAO,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAAC,CA6B9J;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,OAAO,WAAW,EACnE,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,EACvB,cAAc,EAAE,MAAM,GACrB,IAAI,CAgCN;AAED;;;;;GAKG;AACH,wBAAsB,+BAA+B,CAAC,CAAC,SAAS,OAAO,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAItI"}
@@ -0,0 +1,83 @@
1
+ // External imports
2
+ import { timestampDate } from '@bufbuild/protobuf/wkt';
3
+ import chalk from 'chalk';
4
+ // Internal imports
5
+ import { GetKillswitchStatusResponse_State } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/catalog_pb';
6
+ /**
7
+ * Utility function to fetch killswitch status from the catalog service
8
+ * @param command - BaseCommand instance with catalogService access
9
+ * @returns Promise<KillswitchStatus> - Killswitch status information
10
+ */
11
+ export async function getKillswitchStatus(command) {
12
+ try {
13
+ const { client: catalogService, userId, organizationId } = await command.catalogService();
14
+ const response = await catalogService.getKillswitchStatus({
15
+ userId,
16
+ organizationId,
17
+ });
18
+ const killswitchResponse = response;
19
+ return {
20
+ status: {
21
+ isActive: killswitchResponse.state === GetKillswitchStatusResponse_State.ACTIVE,
22
+ reason: killswitchResponse.reason || undefined,
23
+ updatedAt: killswitchResponse.at ? timestampDate(killswitchResponse.at) : undefined,
24
+ },
25
+ organizationId,
26
+ };
27
+ }
28
+ catch (_error) {
29
+ // If we can't fetch killswitch status, log a debug message and return inactive
30
+ command.log('[DEBUG] Could not fetch killswitch status: Service unavailable');
31
+ return {
32
+ status: {
33
+ isActive: false,
34
+ },
35
+ organizationId: 'unknown',
36
+ };
37
+ }
38
+ }
39
+ /**
40
+ * Utility function to display killswitch warning if active
41
+ * @param killswitchStatus - Killswitch status to check
42
+ * @param command - BaseCommand instance for logging
43
+ * @param organizationId - Organization ID to display in the message
44
+ */
45
+ export function displayKillswitchWarning(killswitchStatus, command, organizationId) {
46
+ if (!killswitchStatus.isActive) {
47
+ return;
48
+ }
49
+ const warningLines = [
50
+ '',
51
+ chalk.yellow.bold('⚠️ NOTICE'),
52
+ chalk.yellow(`Organization ${organizationId} is in a partially disabled state.`),
53
+ ];
54
+ if (killswitchStatus.reason) {
55
+ warningLines.push(chalk.yellow(`Reason: ${killswitchStatus.reason}`));
56
+ }
57
+ if (killswitchStatus.updatedAt) {
58
+ const formattedDate = killswitchStatus.updatedAt.toLocaleString('en-US', {
59
+ weekday: 'short',
60
+ month: 'short',
61
+ day: 'numeric',
62
+ hour: 'numeric',
63
+ minute: 'numeric',
64
+ second: 'numeric',
65
+ hour12: false,
66
+ timeZoneName: 'short',
67
+ });
68
+ warningLines.push(chalk.dim(`Updated: ${formattedDate}`));
69
+ }
70
+ warningLines.push('');
71
+ command.log(warningLines.join('\n'));
72
+ }
73
+ /**
74
+ * Combined utility function to fetch and display killswitch status
75
+ * This follows DRY principles by combining the common pattern
76
+ * @param command - BaseCommand instance with catalogService access
77
+ * @returns Promise<KillswitchStatus> - Killswitch status information (for potential further use)
78
+ */
79
+ export async function checkAndDisplayKillswitchStatus(command) {
80
+ const { status: killswitchStatus, organizationId } = await getKillswitchStatus(command);
81
+ displayKillswitchWarning(killswitchStatus, command, organizationId);
82
+ return killswitchStatus;
83
+ }