incremnt 0.4.0 → 0.6.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.
package/src/transport.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { readSnapshot, resolveSnapshotSource } from './local.js';
2
2
  import { createRemoteTransport } from './remote.js';
3
- import { executeReadCommand } from './queries.js';
3
+ import { executeCoachReadTool, executeReadCommand } from './queries.js';
4
4
  import { isSessionExpired } from './state.js';
5
5
 
6
6
  function prefersLocal(options) {
@@ -33,6 +33,14 @@ function createLocalTransport(snapshotSource) {
33
33
 
34
34
  return result.payload;
35
35
  },
36
+ async executeCoachReadTool(toolName, input = {}) {
37
+ if (!snapshotSource) {
38
+ throw snapshotNotFoundError();
39
+ }
40
+
41
+ const snapshot = await readSnapshot(snapshotSource.path);
42
+ return executeCoachReadTool(snapshot, toolName, input);
43
+ },
36
44
  async executeWriteCommand() {
37
45
  const error = new Error('Write commands require a remote session. Run incremnt login first.');
38
46
  error.code = 'WRITE_REQUIRES_REMOTE';