@memberjunction/cli 6.2.0-edge.3 → 6.2.0-edge.4

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 (51) hide show
  1. package/README.md +9 -0
  2. package/dist/commands/artifacts/reclassify.d.ts.map +1 -1
  3. package/dist/commands/artifacts/reclassify.js +4 -2
  4. package/dist/commands/artifacts/reclassify.js.map +1 -1
  5. package/dist/commands/cache/clear.d.ts +25 -0
  6. package/dist/commands/cache/clear.d.ts.map +1 -0
  7. package/dist/commands/cache/clear.js +79 -0
  8. package/dist/commands/cache/clear.js.map +1 -0
  9. package/dist/commands/cache/usage.d.ts +7 -0
  10. package/dist/commands/cache/usage.d.ts.map +1 -0
  11. package/dist/commands/cache/usage.js +10 -0
  12. package/dist/commands/cache/usage.js.map +1 -0
  13. package/dist/commands/codegen/index.d.ts +15 -6
  14. package/dist/commands/codegen/index.d.ts.map +1 -1
  15. package/dist/commands/codegen/index.js +35 -4
  16. package/dist/commands/codegen/index.js.map +1 -1
  17. package/dist/commands/install/index.d.ts.map +1 -1
  18. package/dist/commands/install/index.js +7 -1
  19. package/dist/commands/install/index.js.map +1 -1
  20. package/dist/commands/migrate/index.d.ts +10 -0
  21. package/dist/commands/migrate/index.d.ts.map +1 -1
  22. package/dist/commands/migrate/index.js +42 -0
  23. package/dist/commands/migrate/index.js.map +1 -1
  24. package/dist/commands/sync/push.d.ts +33 -8
  25. package/dist/commands/sync/push.d.ts.map +1 -1
  26. package/dist/commands/sync/push.js +94 -6
  27. package/dist/commands/sync/push.js.map +1 -1
  28. package/dist/commands/user/clone.d.ts +27 -0
  29. package/dist/commands/user/clone.d.ts.map +1 -0
  30. package/dist/commands/user/clone.js +106 -0
  31. package/dist/commands/user/clone.js.map +1 -0
  32. package/dist/hooks/prerun.d.ts.map +1 -1
  33. package/dist/hooks/prerun.js +9 -0
  34. package/dist/hooks/prerun.js.map +1 -1
  35. package/dist/lib/domain-profiles.d.ts.map +1 -1
  36. package/dist/lib/domain-profiles.js +4 -0
  37. package/dist/lib/domain-profiles.js.map +1 -1
  38. package/dist/lib/keep-awake.d.ts +45 -0
  39. package/dist/lib/keep-awake.d.ts.map +1 -0
  40. package/dist/lib/keep-awake.js +71 -0
  41. package/dist/lib/keep-awake.js.map +1 -0
  42. package/dist/lib/shared-cache.d.ts +84 -0
  43. package/dist/lib/shared-cache.d.ts.map +1 -0
  44. package/dist/lib/shared-cache.js +160 -0
  45. package/dist/lib/shared-cache.js.map +1 -0
  46. package/dist/light-commands.d.ts +8 -0
  47. package/dist/light-commands.d.ts.map +1 -1
  48. package/dist/light-commands.js +33 -0
  49. package/dist/light-commands.js.map +1 -1
  50. package/oclif.manifest.json +2181 -1977
  51. package/package.json +29 -27
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-cache.d.ts","sourceRoot":"","sources":["../../src/lib/shared-cache.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAEpG,kGAAkG;AAClG,eAAO,MAAM,oBAAoB,+BAA+B,CAAC;AAKjE,mFAAmF;AACnF,MAAM,MAAM,uBAAuB,GAAG;IAClC,2DAA2D;IAC3D,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,uBAAuB,CAiBxG;AAED,mEAAmE;AACnE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,gEAAgE;IAChE,KAAK,EAAE,OAAO,CAAC;IACf,gCAAgC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,yEAAyE;IACzE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kGAAkG;IAClG,eAAe,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;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sBAAsB,GAAG,IAAI,EACrC,IAAI,EAAE,qBAAqB,GAC5B,CAAC,CAWH"}
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Clearing the shared (Redis) cache after the CLI changes the database.
3
+ *
4
+ * `mj sync push`, `mj codegen` and `mj migrate` write to the database from a process that is not
5
+ * part of the server fleet's cache, so no server hears about the change and each keeps serving what
6
+ * it cached before — indefinitely, because server-side cache hits are never re-validated (#4083).
7
+ * When `REDIS_URL` is configured (in the environment or the dotenv file the CLI loads), these
8
+ * commands clear the cache categories and the metadata snapshot afterwards; every server reloads its
9
+ * engines and re-checks its metadata. `mj cache clear` does the same on demand.
10
+ *
11
+ * A failed clear never fails the command — the database change already succeeded — but it is
12
+ * reported loudly, with the command to run by hand.
13
+ */
14
+ import { ClearSharedCacheCategories, SHARED_CACHE_WRITE_CATEGORIES } from '@memberjunction/redis-provider';
15
+ /** Setting this to `1`/`true` disables the automatic clear (the explicit command still works). */
16
+ export const SKIP_CACHE_CLEAR_ENV = 'MJ_SKIP_SHARED_CACHE_CLEAR';
17
+ /** The categories a clear may target: everything a CLI write invalidates, plus the proxy-key store. */
18
+ const CLEARABLE_CATEGORIES = [...SHARED_CACHE_WRITE_CATEGORIES, 'default'];
19
+ /**
20
+ * Maps requested category names onto their canonical spelling.
21
+ *
22
+ * Names are accepted case-insensitively because nobody should have to remember that it is
23
+ * `RunViewCache` and not `runviewcache`. But Redis keys ARE case-sensitive, so accepting a
24
+ * spelling and then using it verbatim scanned `{prefix}:runviewcache:*`, matched nothing, and
25
+ * reported a successful clear of 0 keys — the operator is told the fleet will reload and it never
26
+ * does. Accept the spelling, then hand the store the canonical name.
27
+ */
28
+ export function ResolveCacheCategories(requested) {
29
+ if (!requested?.length) {
30
+ return { Categories: [...SHARED_CACHE_WRITE_CATEGORIES], Unknown: [] };
31
+ }
32
+ const resolved = [];
33
+ const unknown = [];
34
+ for (const raw of requested) {
35
+ const canonical = CLEARABLE_CATEGORIES.find(known => known.toLowerCase() === raw.trim().toLowerCase());
36
+ if (canonical) {
37
+ if (!resolved.includes(canonical)) {
38
+ resolved.push(canonical);
39
+ }
40
+ }
41
+ else {
42
+ unknown.push(raw);
43
+ }
44
+ }
45
+ return { Categories: resolved, Unknown: unknown };
46
+ }
47
+ /**
48
+ * Whether a migration run may have changed the database, and so whether the fleet's cache is stale.
49
+ *
50
+ * On success the count is authoritative: a run that found nothing pending must NOT make every server
51
+ * drop its cache and reload every engine for nothing.
52
+ *
53
+ * On a failure — including one that threw rather than returning — the count is not trustworthy and
54
+ * neither is the detail list, which can be empty precisely because the run died before assembling
55
+ * it. What IS known is whether a migration started executing. DDL is not transactional across
56
+ * batches on SQL Server, so a migration that began and failed can still have committed statements;
57
+ * a run that never started one cannot have. That makes "did anything start" the honest gate: a bad
58
+ * connection string or a config error leaves the fleet alone, and anything that touched the database
59
+ * clears.
60
+ */
61
+ export function MigrationChangedDatabase(outcome) {
62
+ if (outcome.Threw || !outcome.Succeeded) {
63
+ return outcome.StartedApplying;
64
+ }
65
+ return outcome.MigrationsApplied > 0;
66
+ }
67
+ /** The category names a clear can be asked for, for error messages and help text. */
68
+ export function KnownCacheCategories() {
69
+ return [...CLEARABLE_CATEGORIES];
70
+ }
71
+ /** Resolves the shared cache from `REDIS_URL` / `REDIS_KEY_PREFIX`, the variables MJAPI reads. */
72
+ export function ResolveSharedCacheTarget(env = process.env) {
73
+ const url = env.REDIS_URL?.trim();
74
+ if (!url) {
75
+ return null;
76
+ }
77
+ const keyPrefix = env.REDIS_KEY_PREFIX || 'mj';
78
+ return { Connection: { url, keyPrefix }, Description: `${DescribeRedisUrl(url)} (prefix "${keyPrefix}")` };
79
+ }
80
+ /** `host:port/db` of a Redis URL, without user or password. */
81
+ export function DescribeRedisUrl(url) {
82
+ try {
83
+ const parsed = new URL(url);
84
+ const db = parsed.pathname && parsed.pathname !== '/' ? parsed.pathname : '';
85
+ return `${parsed.protocol}//${parsed.hostname}${parsed.port ? `:${parsed.port}` : ''}${db}`;
86
+ }
87
+ catch {
88
+ return '(unparseable REDIS_URL)';
89
+ }
90
+ }
91
+ /** True when the automatic clear has been switched off by flag or environment. */
92
+ export function IsAutomaticClearDisabled(skipFlag, env = process.env) {
93
+ if (skipFlag) {
94
+ return true;
95
+ }
96
+ const value = env[SKIP_CACHE_CLEAR_ENV]?.trim().toLowerCase();
97
+ return value === '1' || value === 'true';
98
+ }
99
+ /**
100
+ * Clears the shared cache after `commandName` changed the database. Returns null when there is
101
+ * nothing to do (no `REDIS_URL`, or disabled).
102
+ */
103
+ export async function ClearSharedCacheAfterWrite(commandName, skipFlag) {
104
+ const target = ResolveSharedCacheTarget();
105
+ if (!target || IsAutomaticClearDisabled(skipFlag)) {
106
+ return null;
107
+ }
108
+ try {
109
+ const categories = await ClearSharedCacheCategories({
110
+ Connection: target.Connection, Categories: SHARED_CACHE_WRITE_CATEGORIES, IncludeMetadataSnapshot: true,
111
+ });
112
+ const total = categories.reduce((n, c) => n + c.KeyCount, 0);
113
+ // A category can fail on its own: ClearSharedCacheCategories reports per-category Ok/Error
114
+ // and returns normally on a partial failure. Reporting the whole clear as a success then
115
+ // told the operator "servers will reload" about categories that were never cleared, which
116
+ // is the same false-success the per-category outcomes were added to expose.
117
+ const failed = categories.filter(c => c.Ok === false);
118
+ if (failed.length > 0) {
119
+ const detail = failed.map(c => `${c.Category} (${c.Error ?? 'unknown error'})`).join('; ');
120
+ return {
121
+ Ok: false,
122
+ Message: `${commandName} changed the database and the shared cache on ${target.Description} was only partly cleared — ` +
123
+ `${failed.length} of ${categories.length} categories failed: ${detail}. ` +
124
+ `Servers may serve stale data for those categories until you run: mj cache clear`,
125
+ Categories: categories,
126
+ };
127
+ }
128
+ return {
129
+ Ok: true,
130
+ Message: `Cleared ${total} shared cache entr${total === 1 ? 'y' : 'ies'} on ${target.Description} after ${commandName}; running servers will reload.`,
131
+ Categories: categories,
132
+ };
133
+ }
134
+ catch (e) {
135
+ const reason = e instanceof Error ? e.message : String(e);
136
+ return {
137
+ Ok: false,
138
+ Message: `${commandName} changed the database but the shared cache on ${target.Description} could not be cleared (${reason}). ` +
139
+ `Running servers may serve stale data until you run: mj cache clear`,
140
+ Categories: [],
141
+ };
142
+ }
143
+ }
144
+ /**
145
+ * Logs a clear report and folds it into a plugin command's result: `data.sharedCacheClear`
146
+ * always, and a warning when the clear failed. Returns the result unchanged when there is no report.
147
+ */
148
+ export function AppendSharedCacheClear(result, report, sink) {
149
+ if (!report) {
150
+ return result;
151
+ }
152
+ sink.Log(report.Message, report.Ok ? 'info' : 'warn');
153
+ const warnings = report.Ok ? result.warnings : [...(result.warnings ?? []), report.Message];
154
+ return {
155
+ ...result,
156
+ data: { ...(result.data ?? {}), sharedCacheClear: { ok: report.Ok, categories: report.Categories } },
157
+ warnings,
158
+ };
159
+ }
160
+ //# sourceMappingURL=shared-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-cache.js","sourceRoot":"","sources":["../../src/lib/shared-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAG3G,kGAAkG;AAClG,MAAM,CAAC,MAAM,oBAAoB,GAAG,4BAA4B,CAAC;AAEjE,uGAAuG;AACvG,MAAM,oBAAoB,GAAsB,CAAC,GAAG,6BAA6B,EAAE,SAAS,CAAC,CAAC;AAU9F;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAAwC;IAC3E,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;QACrB,OAAO,EAAE,UAAU,EAAE,CAAC,GAAG,6BAA6B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC3E,CAAC;IACD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC1B,MAAM,SAAS,GAAG,oBAAoB,CAAC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EAAE,KAAK;YACT,OAAO,EAAE,GAAG,WAAW,iDAAiD,MAAM,CAAC,WAAW,0BAA0B,MAAM,KAAK;gBAC3H,oEAAoE;YACxE,UAAU,EAAE,EAAE;SACjB,CAAC;IACN,CAAC;AACL,CAAC;AAOD;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAClC,MAAS,EACT,MAAqC,EACrC,IAA2B;IAE3B,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5F,OAAO;QACH,GAAG,MAAM;QACT,IAAI,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,gBAAgB,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,EAAE;QACpG,QAAQ;KACX,CAAC;AACN,CAAC"}
@@ -13,5 +13,13 @@
13
13
  * - If the command uses only standard npm packages or light @memberjunction
14
14
  * packages (like @memberjunction/config), add its oclif command ID here.
15
15
  */
16
+ /**
17
+ * NOTE on spelling: oclif command ids are **colon**-separated (`cache:clear`), whatever
18
+ * `topicSeparator` is set to — that only affects how a user types it. The space forms below are
19
+ * kept because they read the way the command is invoked, but each one is paired with its colon id,
20
+ * which is what `Command.id` actually equals at runtime. Without the colon form the entry never
21
+ * matches and the command silently pays the full bootstrap: `cache clear` measured 4.4-7.4 s
22
+ * against 0.19-0.29 s. `light-commands.ids.test.ts` fails on a space-only entry.
23
+ */
16
24
  export declare const LIGHT_COMMANDS: ReadonlySet<string>;
17
25
  //# sourceMappingURL=light-commands.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"light-commands.d.ts","sourceRoot":"","sources":["../src/light-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAkH7C,CAAC"}
1
+ {"version":3,"file":"light-commands.d.ts","sourceRoot":"","sources":["../src/light-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CA4I7C,CAAC"}
@@ -13,6 +13,14 @@
13
13
  * - If the command uses only standard npm packages or light @memberjunction
14
14
  * packages (like @memberjunction/config), add its oclif command ID here.
15
15
  */
16
+ /**
17
+ * NOTE on spelling: oclif command ids are **colon**-separated (`cache:clear`), whatever
18
+ * `topicSeparator` is set to — that only affects how a user types it. The space forms below are
19
+ * kept because they read the way the command is invoked, but each one is paired with its colon id,
20
+ * which is what `Command.id` actually equals at runtime. Without the colon form the entry never
21
+ * matches and the command silently pays the full bootstrap: `cache clear` measured 4.4-7.4 s
22
+ * against 0.19-0.29 s. `light-commands.ids.test.ts` fails on a space-only entry.
23
+ */
16
24
  export const LIGHT_COMMANDS = new Set([
17
25
  // Built-in oclif plugins
18
26
  'version',
@@ -21,8 +29,11 @@ export const LIGHT_COMMANDS = new Set([
21
29
  // metadata only; no bootstrap needed. Plugin entry points are light.
22
30
  'usage',
23
31
  'sync usage',
32
+ 'sync:usage',
24
33
  'codegen usage',
34
+ 'codegen:usage',
25
35
  'dev usage',
36
+ 'dev:usage',
26
37
  // Every remaining domain's tier-2 page. These compose oclif's own manifest plus the
27
38
  // light plugin entry points — the whole point of the surface is that an agent can
28
39
  // read it without paying for a runtime boot. Both id spellings are listed because
@@ -70,13 +81,22 @@ export const LIGHT_COMMANDS = new Set([
70
81
  'update:usage',
71
82
  // Plugin registry editing — just writes mj-cli-plugins.json
72
83
  'plugin add',
84
+ 'plugin:add',
73
85
  // Bump - uses zod, fast-glob, fs only
74
86
  'bump',
87
+ // Shared cache - uses @memberjunction/redis-provider (ioredis + core) only
88
+ 'cache',
89
+ 'cache clear',
90
+ 'cache:clear',
91
+ 'cache usage',
92
+ 'cache:usage',
75
93
  // Database commands - use @memberjunction/skyway-core + config only
76
94
  'clean',
77
95
  'migrate',
78
96
  'migrate convert',
97
+ 'migrate:convert',
79
98
  'migrate create',
99
+ 'migrate:create',
80
100
  // Install wizard - uses @memberjunction/installer engine (lightweight, no bootstrap)
81
101
  'install',
82
102
  // Doctor - uses @memberjunction/installer engine (lightweight, no bootstrap)
@@ -87,14 +107,19 @@ export const LIGHT_COMMANDS = new Set([
87
107
  'ai',
88
108
  'queue',
89
109
  'ai audit',
110
+ 'ai:audit',
90
111
  'test',
91
112
  'dbdoc',
92
113
  'dev',
93
114
  // Dev workspace generator - node stdlib + chalk only, no bootstrap
94
115
  'dev workspace',
116
+ 'dev:workspace',
95
117
  'dev workspace status',
118
+ 'dev:workspace:status',
96
119
  'dev workspace doctor',
120
+ 'dev:workspace:doctor',
97
121
  'dev workspace clean',
122
+ 'dev:workspace:clean',
98
123
  // SQL conversion commands - use @memberjunction/sql-converter + sqlglot-ts only
99
124
  'sql-convert',
100
125
  'sql-audit',
@@ -106,13 +131,21 @@ export const LIGHT_COMMANDS = new Set([
106
131
  // Must be light to break the circular dependency: server-bootstrap-lite's prebuild calls
107
132
  // `mj codegen manifest`, but bootstrap-lite must be built before MJCLI's prerun can import it.
108
133
  'codegen manifest',
134
+ 'codegen:manifest',
109
135
  // DBDoc commands - already use dynamic imports internally
110
136
  'dbdoc init',
137
+ 'dbdoc:init',
111
138
  'dbdoc analyze',
139
+ 'dbdoc:analyze',
112
140
  'dbdoc export',
141
+ 'dbdoc:export',
113
142
  'dbdoc export-sample-queries',
143
+ 'dbdoc:export-sample-queries',
114
144
  'dbdoc generate-queries',
145
+ 'dbdoc:generate-queries',
115
146
  'dbdoc reset',
147
+ 'dbdoc:reset',
116
148
  'dbdoc status',
149
+ 'dbdoc:status',
117
150
  ]);
118
151
  //# sourceMappingURL=light-commands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"light-commands.js","sourceRoot":"","sources":["../src/light-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IACzD,yBAAyB;IACzB,SAAS;IACT,MAAM;IAEN,0EAA0E;IAC1E,qEAAqE;IACrE,OAAO;IACP,YAAY;IACZ,eAAe;IACf,WAAW;IACX,oFAAoF;IACpF,kFAAkF;IAClF,kFAAkF;IAClF,oFAAoF;IACpF,2CAA2C;IAC3C,UAAU;IACV,UAAU;IACV,aAAa;IACb,aAAa;IACb,WAAW;IACX,WAAW;IACX,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,cAAc;IACd,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,eAAe;IACf,eAAe;IACf,eAAe;IACf,eAAe;IACf,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;IACjB,YAAY;IACZ,YAAY;IACZ,qBAAqB;IACrB,qBAAqB;IACrB,cAAc;IACd,cAAc;IAEd,4DAA4D;IAC5D,YAAY;IAEZ,sCAAsC;IACtC,MAAM;IAEN,oEAAoE;IACpE,OAAO;IACP,SAAS;IACT,iBAAiB;IACjB,gBAAgB;IAEhB,qFAAqF;IACrF,SAAS;IAET,6EAA6E;IAC7E,QAAQ;IAER,4FAA4F;IAC5F,QAAQ;IAER,kEAAkE;IAClE,IAAI;IACJ,OAAO;IACP,UAAU;IACV,MAAM;IACN,OAAO;IACP,KAAK;IAEL,mEAAmE;IACnE,eAAe;IACf,sBAAsB;IACtB,sBAAsB;IACtB,qBAAqB;IAErB,gFAAgF;IAChF,aAAa;IACb,WAAW;IAEX,8EAA8E;IAC9E,oCAAoC;IACpC,gBAAgB;IAChB,eAAe;IAEf,kGAAkG;IAClG,yFAAyF;IACzF,+FAA+F;IAC/F,kBAAkB;IAElB,0DAA0D;IAC1D,YAAY;IACZ,eAAe;IACf,cAAc;IACd,6BAA6B;IAC7B,wBAAwB;IACxB,aAAa;IACb,cAAc;CACf,CAAC,CAAC"}
1
+ {"version":3,"file":"light-commands.js","sourceRoot":"","sources":["../src/light-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IACzD,yBAAyB;IACzB,SAAS;IACT,MAAM;IAEN,0EAA0E;IAC1E,qEAAqE;IACrE,OAAO;IACP,YAAY;IACZ,YAAY;IACZ,eAAe;IACf,eAAe;IACf,WAAW;IACX,WAAW;IACX,oFAAoF;IACpF,kFAAkF;IAClF,kFAAkF;IAClF,oFAAoF;IACpF,2CAA2C;IAC3C,UAAU;IACV,UAAU;IACV,aAAa;IACb,aAAa;IACb,WAAW;IACX,WAAW;IACX,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,cAAc;IACd,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,eAAe;IACf,eAAe;IACf,eAAe;IACf,eAAe;IACf,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;IACjB,YAAY;IACZ,YAAY;IACZ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