@impractical-ai/motion 0.1.15 → 0.1.18

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.
@@ -1,22 +1,27 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- ApiContractError,
3
+ DEVICE_START_BODY,
4
+ fetchWorkspaces,
5
+ grantScope,
6
+ workspaceLabel
7
+ } from "./chunk-XWCSIM4L.js";
8
+ import {
4
9
  ApiError,
5
10
  delay,
6
11
  invokeAt,
7
12
  loadConfig,
8
13
  recoverCorruptConfig,
9
14
  saveConfig
10
- } from "./chunk-2VIBS7AS.js";
15
+ } from "./chunk-FTSZCIMV.js";
11
16
  import {
12
17
  PACKAGE_COMMAND,
13
18
  PACKAGE_NAME,
14
19
  PACKAGE_VERSION,
15
20
  PRODUCTION_APP_URL,
16
21
  PRODUCTION_SUPABASE_URL
17
- } from "./chunk-52D5QRLI.js";
22
+ } from "./chunk-2GCSX3YN.js";
18
23
 
19
- // cli/src/onboarding.ts
24
+ // src/onboarding.ts
20
25
  import {
21
26
  chmodSync,
22
27
  existsSync,
@@ -32,48 +37,6 @@ import { dirname, join } from "node:path";
32
37
  import { fileURLToPath } from "node:url";
33
38
  import { spawnSync } from "node:child_process";
34
39
  import { createRequire } from "node:module";
35
-
36
- // cli/src/workspaces.ts
37
- var UNSUPPORTED = {
38
- supported: false,
39
- keyScope: null,
40
- lastOpenWorkspaceId: null,
41
- workspaces: []
42
- };
43
- async function fetchWorkspaces(request) {
44
- let result;
45
- try {
46
- result = await request("workspace-bootstrap", { action: "list_workspaces" });
47
- } catch (error) {
48
- if (error instanceof ApiContractError) return UNSUPPORTED;
49
- throw error;
50
- }
51
- if (!Array.isArray(result?.workspaces)) return UNSUPPORTED;
52
- const keyScope = result.keyScope === "user" ? "user" : result.keyScope === "org" ? "org" : null;
53
- const workspaces = result.workspaces.filter((row) => typeof row?.id === "string").map((row) => ({
54
- id: String(row.id),
55
- name: typeof row.name === "string" ? row.name : null,
56
- slug: typeof row.slug === "string" ? row.slug : null,
57
- role: typeof row.role === "string" ? row.role : "",
58
- plan: typeof row.plan === "string" ? row.plan : null,
59
- usage: row.usage && typeof row.usage === "object" ? row.usage : null
60
- }));
61
- return {
62
- supported: true,
63
- keyScope,
64
- lastOpenWorkspaceId: typeof result.lastOpenWorkspaceId === "string" ? result.lastOpenWorkspaceId : null,
65
- workspaces
66
- };
67
- }
68
- function workspaceLabel(workspace) {
69
- return workspace.name ? `${workspace.name} (${workspace.id})` : workspace.id;
70
- }
71
- var DEVICE_START_BODY = { action: "start", scope: "user" };
72
- function grantScope(grant) {
73
- return grant.scope === "user" ? "user" : "org";
74
- }
75
-
76
- // cli/src/onboarding.ts
77
40
  var CLAUDE_MARKETPLACE = "Openpod/impractical-agent-plugins";
78
41
  var CLAUDE_PLUGIN = "impractical-motion@impractical";
79
42
  var CLAUDE_MARKETPLACE_NAME = "impractical";
@@ -817,10 +780,6 @@ async function setup(options) {
817
780
  }
818
781
 
819
782
  export {
820
- fetchWorkspaces,
821
- workspaceLabel,
822
- DEVICE_START_BODY,
823
- grantScope,
824
783
  openBrowser,
825
784
  setup
826
785
  };
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ ApiContractError
4
+ } from "./chunk-FTSZCIMV.js";
5
+
6
+ // src/workspaces.ts
7
+ var UNSUPPORTED = {
8
+ supported: false,
9
+ keyScope: null,
10
+ lastOpenWorkspaceId: null,
11
+ workspaces: []
12
+ };
13
+ async function fetchWorkspaces(request) {
14
+ let result;
15
+ try {
16
+ result = await request("workspace-bootstrap", { action: "list_workspaces" });
17
+ } catch (error) {
18
+ if (error instanceof ApiContractError) return UNSUPPORTED;
19
+ throw error;
20
+ }
21
+ if (!Array.isArray(result?.workspaces)) return UNSUPPORTED;
22
+ const keyScope = result.keyScope === "user" ? "user" : result.keyScope === "org" ? "org" : null;
23
+ const workspaces = result.workspaces.filter((row) => typeof row?.id === "string").map((row) => ({
24
+ id: String(row.id),
25
+ name: typeof row.name === "string" ? row.name : null,
26
+ slug: typeof row.slug === "string" ? row.slug : null,
27
+ role: typeof row.role === "string" ? row.role : "",
28
+ plan: typeof row.plan === "string" ? row.plan : null,
29
+ usage: row.usage && typeof row.usage === "object" ? row.usage : null
30
+ }));
31
+ return {
32
+ supported: true,
33
+ keyScope,
34
+ lastOpenWorkspaceId: typeof result.lastOpenWorkspaceId === "string" ? result.lastOpenWorkspaceId : null,
35
+ workspaces
36
+ };
37
+ }
38
+ function workspaceLabel(workspace) {
39
+ return workspace.name ? `${workspace.name} (${workspace.id})` : workspace.id;
40
+ }
41
+ var DEVICE_START_BODY = { action: "start", scope: "user" };
42
+ function grantScope(grant) {
43
+ return grant.scope === "user" ? "user" : "org";
44
+ }
45
+
46
+ export {
47
+ fetchWorkspaces,
48
+ workspaceLabel,
49
+ DEVICE_START_BODY,
50
+ grantScope
51
+ };