@lidtop/loadout 0.3.0 → 0.3.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.
package/dist/terminal.js CHANGED
@@ -1,6 +1,18 @@
1
1
  import { createInterface } from 'node:readline';
2
2
  import { Writable } from 'node:stream';
3
- const prepared = new WeakSet();
3
+ const prepared = new WeakMap();
4
+ // Review has a back stack: consecutive Escapes navigate rather than cancel.
5
+ export function suspendEscapeCancellation(input) {
6
+ prepareInput(input);
7
+ const state = prepared.get(input);
8
+ const cancel = state.cancel;
9
+ state.cancel = false;
10
+ state.lastEscape = undefined;
11
+ return () => {
12
+ state.cancel = cancel;
13
+ state.lastEscape = undefined;
14
+ };
15
+ }
4
16
  export function prepareInput(input) {
5
17
  if (prepared.has(input))
6
18
  return;
@@ -15,16 +27,16 @@ export function prepareInput(input) {
15
27
  });
16
28
  decoder.close();
17
29
  output.end();
18
- let lastEscape;
30
+ const state = { cancel: true, lastEscape: undefined };
19
31
  input.on('keypress', (_text, key) => {
20
- if (key.name !== 'escape') {
21
- lastEscape = undefined;
32
+ if (key.name !== 'escape' || !state.cancel) {
33
+ state.lastEscape = undefined;
22
34
  return;
23
35
  }
24
36
  const now = performance.now();
25
37
  if (key.sequence === '\u001b\u001b' ||
26
- (lastEscape !== undefined && now - lastEscape <= 500)) {
27
- lastEscape = undefined;
38
+ (state.lastEscape !== undefined && now - state.lastEscape <= 500)) {
39
+ state.lastEscape = undefined;
28
40
  // Use the same cancellation path as Ctrl+C, including later prompts.
29
41
  input.emit('keypress', '\u0003', {
30
42
  name: 'c',
@@ -35,7 +47,7 @@ export function prepareInput(input) {
35
47
  });
36
48
  }
37
49
  else
38
- lastEscape = now;
50
+ state.lastEscape = now;
39
51
  });
40
- prepared.add(input);
52
+ prepared.set(input, state);
41
53
  }
@@ -0,0 +1 @@
1
+ Do not commit changes or perform Git operations. Leave Git to the user.
@@ -0,0 +1,6 @@
1
+ schemaVersion: 1
2
+ id: dont-commit
3
+ description: Leave commits and Git operations to the user
4
+ outputs:
5
+ - type: instructions
6
+ source: instructions.md
@@ -5,6 +5,8 @@ description: Create or edit private or shared Loadout kits.
5
5
 
6
6
  Use `.loadout-personal/kits/` for private kits, `.loadout/kits/` for shared kits, or `~/.loadout/kits/` for kits you can enable in any repository. Adapt this example; drop unused questions, outputs, and files.
7
7
 
8
+ State each requirement once as a direct instruction, including its exceptions. Preserve its exact trigger and scope. Omit introductions, summaries, explanations of familiar concepts, and lists of actions a rule already covers. Do not add unrequested rules or steps.
9
+
8
10
  `.loadout-personal/kits/review/kit.yaml`:
9
11
 
10
12
  ```yaml
@@ -52,4 +54,4 @@ loadout enable review --answer review.diagrams=true --answer review.detail=detai
52
54
  loadout disable review
53
55
  ```
54
56
 
55
- Drop `--dry-run --diff` to apply, or select via `loadout` → Browse → Personal → Continue.
57
+ Drop `--dry-run --diff` to apply, or select via `loadout` → Browse → Personal → Review changes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lidtop/loadout",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Choose and manage agent instruction and skill kits for repositories and your home directory.",
5
5
  "type": "module",
6
6
  "bin": {