toolcraft 0.0.161 → 0.0.163

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/composition.json CHANGED
@@ -113,7 +113,7 @@
113
113
  },
114
114
  {
115
115
  "name": "toolcraft",
116
- "version": "0.0.161",
116
+ "version": "0.0.163",
117
117
  "license": "MIT"
118
118
  },
119
119
  {
@@ -123,7 +123,7 @@
123
123
  },
124
124
  {
125
125
  "name": "toolcraft-schema",
126
- "version": "0.0.161",
126
+ "version": "0.0.163",
127
127
  "license": "MIT"
128
128
  },
129
129
  {
@@ -113,7 +113,7 @@
113
113
  },
114
114
  {
115
115
  "name": "toolcraft",
116
- "version": "0.0.161",
116
+ "version": "0.0.163",
117
117
  "license": "MIT"
118
118
  },
119
119
  {
@@ -123,7 +123,7 @@
123
123
  },
124
124
  {
125
125
  "name": "toolcraft-schema",
126
- "version": "0.0.161",
126
+ "version": "0.0.163",
127
127
  "license": "MIT"
128
128
  },
129
129
  {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  {
10
10
  "name": "toolcraft-schema",
11
- "version": "0.0.161",
11
+ "version": "0.0.163",
12
12
  "license": "MIT"
13
13
  }
14
14
  ]
@@ -14,6 +14,7 @@ export type Effect = {
14
14
  resumeWith: (value: unknown) => ExplorerEvent;
15
15
  } | {
16
16
  type: "persistOrder";
17
+ movedId: string;
17
18
  orderedIds: string[];
18
19
  };
19
20
  export type ExplorerEvent = {
@@ -718,7 +718,7 @@ function reorder(state, delta) {
718
718
  };
719
719
  return {
720
720
  state: next,
721
- effects: [{ type: "persistOrder", orderedIds: rows.map((row) => row.id) }]
721
+ effects: [{ type: "persistOrder", movedId: current.id, orderedIds: rows.map((row) => row.id) }]
722
722
  };
723
723
  }
724
724
  function paletteInput(state, key) {
@@ -157,7 +157,7 @@ class ExplorerRuntime {
157
157
  continue;
158
158
  }
159
159
  if (effect.type === "persistOrder") {
160
- this.track(this.persistOrder(effect.orderedIds, previousState.rows, ++this.reorderToken));
160
+ this.track(this.persistOrder(effect.movedId, effect.orderedIds, previousState.rows, ++this.reorderToken));
161
161
  continue;
162
162
  }
163
163
  if (effect.type === "suspend") {
@@ -248,9 +248,10 @@ class ExplorerRuntime {
248
248
  });
249
249
  this.dispatch({ type: "detailLoaded", rowId, token, items: preparedItems });
250
250
  }
251
- async persistOrder(orderedIds, previousRows, token) {
251
+ async persistOrder(movedId, orderedIds, previousRows, token) {
252
252
  try {
253
253
  await this.config.reorder?.onReorder(orderedIds, {
254
+ movedId,
254
255
  refresh: this.runtimeHandles.refresh,
255
256
  toast: this.runtimeHandles.toast
256
257
  });
@@ -102,6 +102,7 @@ export interface PaneRuntimeState {
102
102
  filter: string;
103
103
  }
104
104
  export interface ReorderContext {
105
+ movedId: string;
105
106
  refresh: () => Promise<void>;
106
107
  toast: (msg: string, tone?: Tone) => void;
107
108
  }
@@ -145,8 +145,13 @@ function parseCsi(sequence) {
145
145
  const name = navigationName(final) ?? ({ "5": "pageup", "6": "pagedown" }[sequence.slice(2, -1)]);
146
146
  if (name === undefined)
147
147
  return undefined;
148
- const modifier = sequence.includes(";5") ? { ctrl: true } : {};
149
- return key(name, modifier);
148
+ const parameters = sequence.slice(2, -1).split(";");
149
+ const modifier = parameters.length > 1 ? Number(parameters.at(-1)) : 1;
150
+ return key(name, {
151
+ shift: modifier === 2 || modifier === 4 || modifier === 6 || modifier === 8,
152
+ alt: modifier === 3 || modifier === 4 || modifier === 7 || modifier === 8,
153
+ ctrl: modifier === 5 || modifier === 6 || modifier === 7 || modifier === 8
154
+ });
150
155
  }
151
156
  function navigationName(final) {
152
157
  return { A: "up", B: "down", C: "right", D: "left", H: "home", F: "end" }[final];
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolcraft-schema",
3
- "version": "0.0.161",
3
+ "version": "0.0.163",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolcraft",
3
- "version": "0.0.161",
3
+ "version": "0.0.163",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -158,7 +158,7 @@
158
158
  "yaml"
159
159
  ],
160
160
  "optionalDependencies": {
161
- "toolcraft-schema": "0.0.161",
161
+ "toolcraft-schema": "0.0.163",
162
162
  "toolcraft-design": "*",
163
163
  "@poe-code/frontmatter": "*",
164
164
  "@poe-code/agent-mcp-config": "*",