@fnndsc/brasa 0.15.0 → 0.16.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.
Files changed (42) hide show
  1. package/dist/buildinfo.json +1 -1
  2. package/dist/builtins/feedTotals.d.ts +24 -0
  3. package/dist/builtins/feedTotals.js +46 -0
  4. package/dist/builtins/feedTotals.js.map +1 -0
  5. package/dist/builtins/fs/acl.args.d.ts +69 -0
  6. package/dist/builtins/fs/acl.args.js +125 -0
  7. package/dist/builtins/fs/acl.args.js.map +1 -0
  8. package/dist/builtins/fs/acl.d.ts +27 -0
  9. package/dist/builtins/fs/acl.js +79 -0
  10. package/dist/builtins/fs/acl.js.map +1 -0
  11. package/dist/builtins/fs/cd.d.ts +8 -0
  12. package/dist/builtins/fs/cd.js +28 -0
  13. package/dist/builtins/fs/cd.js.map +1 -1
  14. package/dist/builtins/fs/upload.js +8 -0
  15. package/dist/builtins/fs/upload.js.map +1 -1
  16. package/dist/builtins/help.js +25 -0
  17. package/dist/builtins/help.js.map +1 -1
  18. package/dist/builtins/index.d.ts +2 -0
  19. package/dist/builtins/index.js +2 -0
  20. package/dist/builtins/index.js.map +1 -1
  21. package/dist/builtins/proc.js +2 -0
  22. package/dist/builtins/proc.js.map +1 -1
  23. package/dist/builtins/res/feed.diagram.js +5 -0
  24. package/dist/builtins/res/feed.diagram.js.map +1 -1
  25. package/dist/core/dispatch.js +5 -1
  26. package/dist/core/dispatch.js.map +1 -1
  27. package/dist/core/promptContext.d.ts +9 -0
  28. package/dist/core/promptContext.js +19 -2
  29. package/dist/core/promptContext.js.map +1 -1
  30. package/dist/core/warmupFailures.d.ts +44 -0
  31. package/dist/core/warmupFailures.js +45 -0
  32. package/dist/core/warmupFailures.js.map +1 -0
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +1 -0
  35. package/dist/index.js.map +1 -1
  36. package/dist/lib/announceIndent.d.ts +28 -0
  37. package/dist/lib/announceIndent.js +32 -0
  38. package/dist/lib/announceIndent.js.map +1 -0
  39. package/dist/lib/prefetch.d.ts +3 -1
  40. package/dist/lib/prefetch.js +18 -5
  41. package/dist/lib/prefetch.js.map +1 -1
  42. package/package.json +3 -3
package/dist/index.d.ts CHANGED
@@ -16,6 +16,7 @@ export * from './core/sink.js';
16
16
  export * from './core/progress.js';
17
17
  export * from './core/surface.js';
18
18
  export * from './core/promptContext.js';
19
+ export * from './core/warmupFailures.js';
19
20
  export * from './core/connect.js';
20
21
  export * from './core/question.js';
21
22
  export * from './core/elevation.js';
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ export * from './core/sink.js';
17
17
  export * from './core/progress.js';
18
18
  export * from './core/surface.js';
19
19
  export * from './core/promptContext.js';
20
+ export * from './core/warmupFailures.js';
20
21
  export * from './core/connect.js';
21
22
  export * from './core/question.js';
22
23
  export * from './core/elevation.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,cAAc,kBAAkB,CAAC;AACjC,iEAAiE;AACjE,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,cAAc,kBAAkB,CAAC;AACjC,iEAAiE;AACjE,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @file Where a boot step's label starts.
3
+ *
4
+ * A step is announced while it runs and again when it finishes. Both lines
5
+ * describe the same step, so their labels must begin in the same column;
6
+ * otherwise the readout jitters as each step settles.
7
+ *
8
+ * The finished line is rendered by the host as a status tag padded to a
9
+ * fixed width, a space, then the label. The running line has to reproduce
10
+ * that column without knowing the tag. An animated spinner draws a frame
11
+ * and a space of its own and owes only the remainder; a plain log line
12
+ * draws nothing and owes the whole width.
13
+ *
14
+ * Kept free of imports so it can be unit tested: the wider engine graph
15
+ * cannot be loaded under jest.
16
+ *
17
+ * @module
18
+ */
19
+ /** Columns an animated spinner draws for itself: one glyph and one space. */
20
+ export declare const SPINNER_GLYPH_WIDTH: number;
21
+ /**
22
+ * Spaces a running announcement must emit before its label.
23
+ *
24
+ * @param statusWidth - Width of the host's status-tag column.
25
+ * @param animated - Whether a spinner glyph precedes the text.
26
+ * @returns Leading spaces, never negative.
27
+ */
28
+ export declare function announceIndent_get(statusWidth: number, animated: boolean): number;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @file Where a boot step's label starts.
3
+ *
4
+ * A step is announced while it runs and again when it finishes. Both lines
5
+ * describe the same step, so their labels must begin in the same column;
6
+ * otherwise the readout jitters as each step settles.
7
+ *
8
+ * The finished line is rendered by the host as a status tag padded to a
9
+ * fixed width, a space, then the label. The running line has to reproduce
10
+ * that column without knowing the tag. An animated spinner draws a frame
11
+ * and a space of its own and owes only the remainder; a plain log line
12
+ * draws nothing and owes the whole width.
13
+ *
14
+ * Kept free of imports so it can be unit tested: the wider engine graph
15
+ * cannot be loaded under jest.
16
+ *
17
+ * @module
18
+ */
19
+ /** Columns an animated spinner draws for itself: one glyph and one space. */
20
+ export const SPINNER_GLYPH_WIDTH = 2;
21
+ /**
22
+ * Spaces a running announcement must emit before its label.
23
+ *
24
+ * @param statusWidth - Width of the host's status-tag column.
25
+ * @param animated - Whether a spinner glyph precedes the text.
26
+ * @returns Leading spaces, never negative.
27
+ */
28
+ export function announceIndent_get(statusWidth, animated) {
29
+ const target = statusWidth + 1;
30
+ return Math.max(target - (animated ? SPINNER_GLYPH_WIDTH : 0), 0);
31
+ }
32
+ //# sourceMappingURL=announceIndent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"announceIndent.js","sourceRoot":"","sources":["../../src/lib/announceIndent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,mBAAmB,GAAW,CAAC,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAmB,EAAE,QAAiB;IACvE,MAAM,MAAM,GAAW,WAAW,GAAG,CAAC,CAAC;IACvC,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACpE,CAAC"}
@@ -21,5 +21,7 @@ export declare function prefetch_path(target: string): Promise<PrefetchResult>;
21
21
  * @param message - Descriptive message shown next to the label.
22
22
  * @param isInteractive - Whether the session is interactive (controls spinner vs plain log).
23
23
  * @param action - Async work to run; returns a PrefetchResult.
24
+ * @param statusWidth - Width of the host's status-tag column, so a running
25
+ * row's label lines up with the finished row that replaces it.
24
26
  */
25
- export declare function prefetch_withSpinner(label: string, message: string, isInteractive: boolean, action: () => Promise<PrefetchResult>): Promise<PrefetchResult>;
27
+ export declare function prefetch_withSpinner(label: string, message: string, isInteractive: boolean, action: () => Promise<PrefetchResult>, statusWidth?: number): Promise<PrefetchResult>;
@@ -10,6 +10,14 @@ import { errorStack } from '@fnndsc/cumin';
10
10
  import { vfs } from './vfs/vfs.js';
11
11
  import { spinner } from './spinner.js';
12
12
  import { error_stripDebugPrefix } from '../builtins/index.js';
13
+ import { announceIndent_get } from './announceIndent.js';
14
+ /**
15
+ * Status-tag column assumed when a host does not declare its own.
16
+ *
17
+ * Hosts that render a status tag before the label pass their real width,
18
+ * so the spinner and the finished row agree on where the label starts.
19
+ */
20
+ const DEFAULT_STATUS_WIDTH = 7;
13
21
  /**
14
22
  * Prefetch a VFS path into the list cache.
15
23
  *
@@ -37,14 +45,19 @@ export async function prefetch_path(target) {
37
45
  * @param message - Descriptive message shown next to the label.
38
46
  * @param isInteractive - Whether the session is interactive (controls spinner vs plain log).
39
47
  * @param action - Async work to run; returns a PrefetchResult.
48
+ * @param statusWidth - Width of the host's status-tag column, so a running
49
+ * row's label lines up with the finished row that replaces it.
40
50
  */
41
- export async function prefetch_withSpinner(label, message, isInteractive, action) {
51
+ export async function prefetch_withSpinner(label, message, isInteractive, action, statusWidth = DEFAULT_STATUS_WIDTH) {
42
52
  const paddedLabel = label.padEnd(12);
43
- // Spinner adds its own glyph and a following space. Pad so the label column
44
- // aligns with the fixed-width status logs (e.g., "[ OK ] " = 7 chars).
45
- const spinnerPrefix = ' '.repeat(5); // 1 glyph + 1 space + 5 = 7
46
- const spinnerMessage = `${spinnerPrefix}${paddedLabel} ${message}`;
47
53
  const showSpinner = isInteractive && process.stdout.isTTY;
54
+ // A running row and the finished row that replaces it describe the same
55
+ // step, so their labels must start in the same column. The host writes
56
+ // its status tag then a space, which is the column to match. An animated
57
+ // spinner already writes a glyph and a space of its own and owes only the
58
+ // remainder; a plain log line writes nothing and owes the whole width.
59
+ const indent = announceIndent_get(statusWidth, showSpinner);
60
+ const spinnerMessage = `${' '.repeat(indent)}${paddedLabel} ${message}`;
48
61
  if (showSpinner) {
49
62
  spinner.start(spinnerMessage, true);
50
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"prefetch.js","sourceRoot":"","sources":["../../src/lib/prefetch.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAY9D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAc;IAChD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;YACd,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAClD,CAAC;QACD,MAAM,GAAG,GAAG,UAAU,CAAC,S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AAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,KAAa,EACb,OAAe,EACf,aAAsB,EACtB,MAAqC,EACrC,cAAsB,oBAAoB;IAE1C,MAAM,WAAW,GAAW,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC7C,MAAM,WAAW,GAAY,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;IACnE,wEAAwE;IACxE,uEAAuE;IACvE,yEAAyE;IACzE,0EAA0E;IAC1E,uEAAuE;IACvE,MAAM,MAAM,GAAW,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACpE,MAAM,cAAc,GAAW,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,WAAW,IAAI,OAAO,EAAE,CAAC;IAEhF,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC9B,CAAC;IAED,IAAI,CAAC;QACH,OAAO,MAAM,MAAM,EAAE,CAAC;IACxB,CAAC;YAAS,CAAC;QACT,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fnndsc/brasa",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "BRASA Runs Abstracted Shell Actions - the hostable ChRIS shell engine (kernel)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,8 +44,8 @@
44
44
  "license": "MIT",
45
45
  "dependencies": {
46
46
  "@fnndsc/chili": "^3.6.5",
47
- "@fnndsc/cumin": "^3.16.0",
48
- "@fnndsc/salsa": "^3.11.0",
47
+ "@fnndsc/cumin": "^3.17.0",
48
+ "@fnndsc/salsa": "^3.12.1",
49
49
  "chalk": "^4.1.2",
50
50
  "cli-highlight": "^2.1.11",
51
51
  "js-yaml": "^4.1.0",