@impractical-ai/motion 0.1.15 → 0.1.16
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/{api-UXWCLV7P.js → api-V7Q3PIWY.js} +6 -2
- package/dist/{chunk-52D5QRLI.js → chunk-AP27EKRR.js} +4 -4
- package/dist/{chunk-2VIBS7AS.js → chunk-CJLGKZMD.js} +11 -3
- package/dist/{chunk-TPFRXA7C.js → chunk-UEPY33MB.js} +5 -5
- package/dist/{commands-MJSGITIZ.js → commands-6F7HITZN.js} +15 -15
- package/dist/index.js +8 -8
- package/dist/{main-GQ76ZNJB.js → main-BEONOBG5.js} +2 -2
- package/dist/{stdio-LWBKGIWN.js → stdio-R4RCWJIS.js} +528 -526
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
AGENT_HEADER,
|
|
3
4
|
ApiContractError,
|
|
4
5
|
ApiError,
|
|
5
6
|
ApiTransportError,
|
|
@@ -9,16 +10,18 @@ import {
|
|
|
9
10
|
invoke,
|
|
10
11
|
invokeAt,
|
|
11
12
|
jobStatus,
|
|
13
|
+
setAgentName,
|
|
12
14
|
studioLink,
|
|
13
15
|
studioQuery,
|
|
14
16
|
validateApiResponse,
|
|
15
17
|
waitForJobs,
|
|
16
18
|
withAdmissionReceipt,
|
|
17
19
|
withMeteredCall
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-CJLGKZMD.js";
|
|
21
|
+
import "./chunk-AP27EKRR.js";
|
|
20
22
|
import "./chunk-77HVPD4G.js";
|
|
21
23
|
export {
|
|
24
|
+
AGENT_HEADER,
|
|
22
25
|
ApiContractError,
|
|
23
26
|
ApiError,
|
|
24
27
|
ApiTransportError,
|
|
@@ -28,6 +31,7 @@ export {
|
|
|
28
31
|
invoke,
|
|
29
32
|
invokeAt,
|
|
30
33
|
jobStatus,
|
|
34
|
+
setAgentName,
|
|
31
35
|
studioLink,
|
|
32
36
|
studioQuery,
|
|
33
37
|
validateApiResponse,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
//
|
|
3
|
+
// package.json
|
|
4
4
|
var package_default = {
|
|
5
5
|
name: "@impractical-ai/motion",
|
|
6
|
-
version: "0.1.
|
|
6
|
+
version: "0.1.16",
|
|
7
7
|
private: false,
|
|
8
8
|
description: "Create and refine Impractical Motion videos from coding agents and the terminal.",
|
|
9
9
|
homepage: "https://github.com/Openpod/impractical-motion#readme",
|
|
@@ -49,7 +49,7 @@ var package_default = {
|
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
//
|
|
52
|
+
// src/constants.ts
|
|
53
53
|
if (package_default.name !== "@impractical-ai/motion" || typeof package_default.version !== "string" || !package_default.version) {
|
|
54
54
|
throw new Error("The packaged CLI manifest is missing valid release metadata");
|
|
55
55
|
}
|
|
@@ -57,7 +57,7 @@ var PRODUCTION_APP_URL = "https://motion.impractical.ai";
|
|
|
57
57
|
var PRODUCTION_SUPABASE_URL = "https://uaxjweednprtbhbceify.supabase.co";
|
|
58
58
|
var PACKAGE_NAME = "@impractical-ai/motion";
|
|
59
59
|
var PACKAGE_VERSION = package_default.version;
|
|
60
|
-
var BUILD_COMMIT = "
|
|
60
|
+
var BUILD_COMMIT = "a212b8f" ? "a212b8f" : "dev";
|
|
61
61
|
var BUILD_ID = `${PACKAGE_VERSION}+${BUILD_COMMIT}`;
|
|
62
62
|
var PACKAGE_COMMAND = `npx --yes ${PACKAGE_NAME}`;
|
|
63
63
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
PRODUCTION_APP_URL,
|
|
4
4
|
PRODUCTION_SUPABASE_URL
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AP27EKRR.js";
|
|
6
6
|
|
|
7
|
-
//
|
|
7
|
+
// src/config.ts
|
|
8
8
|
import {
|
|
9
9
|
chmodSync,
|
|
10
10
|
existsSync,
|
|
@@ -106,7 +106,7 @@ function requireConfig() {
|
|
|
106
106
|
return config;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
//
|
|
109
|
+
// src/api.ts
|
|
110
110
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
111
111
|
import { randomUUID } from "node:crypto";
|
|
112
112
|
var admissionContext = new AsyncLocalStorage();
|
|
@@ -199,6 +199,11 @@ function validateApiResponse(name, body, data) {
|
|
|
199
199
|
return data;
|
|
200
200
|
}
|
|
201
201
|
var WORKSPACE_HEADER = "x-impractical-workspace";
|
|
202
|
+
var AGENT_HEADER = "x-impractical-agent";
|
|
203
|
+
var agentName;
|
|
204
|
+
function setAgentName(name) {
|
|
205
|
+
agentName = name?.replace(/[^\x20-\x7e]/g, "").trim().slice(0, 80) || void 0;
|
|
206
|
+
}
|
|
202
207
|
async function invoke(name, body = {}) {
|
|
203
208
|
const { apiKey, supabaseUrl, workspace } = requireConfig();
|
|
204
209
|
const call = admissionContext.getStore();
|
|
@@ -214,6 +219,7 @@ async function invokeAt(supabaseUrl, name, body = {}, apiKey, admissionReceipt,
|
|
|
214
219
|
...apiKey ? { authorization: `Bearer ${apiKey}` } : {},
|
|
215
220
|
...admissionReceipt ? { "x-impractical-admission": admissionReceipt } : {},
|
|
216
221
|
...apiKey && workspace ? { [WORKSPACE_HEADER]: workspace } : {},
|
|
222
|
+
...agentName ? { [AGENT_HEADER]: agentName } : {},
|
|
217
223
|
"content-type": "application/json"
|
|
218
224
|
},
|
|
219
225
|
body: JSON.stringify(body)
|
|
@@ -308,6 +314,8 @@ export {
|
|
|
308
314
|
ApiTransportError,
|
|
309
315
|
validateApiResponse,
|
|
310
316
|
WORKSPACE_HEADER,
|
|
317
|
+
AGENT_HEADER,
|
|
318
|
+
setAgentName,
|
|
311
319
|
invoke,
|
|
312
320
|
invokeAt,
|
|
313
321
|
admitMcpCall,
|
|
@@ -7,16 +7,16 @@ import {
|
|
|
7
7
|
loadConfig,
|
|
8
8
|
recoverCorruptConfig,
|
|
9
9
|
saveConfig
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CJLGKZMD.js";
|
|
11
11
|
import {
|
|
12
12
|
PACKAGE_COMMAND,
|
|
13
13
|
PACKAGE_NAME,
|
|
14
14
|
PACKAGE_VERSION,
|
|
15
15
|
PRODUCTION_APP_URL,
|
|
16
16
|
PRODUCTION_SUPABASE_URL
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AP27EKRR.js";
|
|
18
18
|
|
|
19
|
-
//
|
|
19
|
+
// src/onboarding.ts
|
|
20
20
|
import {
|
|
21
21
|
chmodSync,
|
|
22
22
|
existsSync,
|
|
@@ -33,7 +33,7 @@ import { fileURLToPath } from "node:url";
|
|
|
33
33
|
import { spawnSync } from "node:child_process";
|
|
34
34
|
import { createRequire } from "node:module";
|
|
35
35
|
|
|
36
|
-
//
|
|
36
|
+
// src/workspaces.ts
|
|
37
37
|
var UNSUPPORTED = {
|
|
38
38
|
supported: false,
|
|
39
39
|
keyScope: null,
|
|
@@ -73,7 +73,7 @@ function grantScope(grant) {
|
|
|
73
73
|
return grant.scope === "user" ? "user" : "org";
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
//
|
|
76
|
+
// src/onboarding.ts
|
|
77
77
|
var CLAUDE_MARKETPLACE = "Openpod/impractical-agent-plugins";
|
|
78
78
|
var CLAUDE_PLUGIN = "impractical-motion@impractical";
|
|
79
79
|
var CLAUDE_MARKETPLACE_NAME = "impractical";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
setup
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UEPY33MB.js";
|
|
5
5
|
import {
|
|
6
6
|
invoke,
|
|
7
7
|
invokeAt,
|
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
saveConfig,
|
|
12
12
|
studioLink,
|
|
13
13
|
waitForJobs
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-CJLGKZMD.js";
|
|
15
|
+
import "./chunk-AP27EKRR.js";
|
|
16
16
|
import "./chunk-77HVPD4G.js";
|
|
17
17
|
|
|
18
|
-
//
|
|
18
|
+
// src/commands.ts
|
|
19
19
|
import { readFileSync as readFileSync2, writeFileSync } from "node:fs";
|
|
20
20
|
import { randomBytes } from "node:crypto";
|
|
21
21
|
|
|
22
|
-
//
|
|
22
|
+
// src/media.ts
|
|
23
23
|
import { readFileSync, statSync } from "node:fs";
|
|
24
24
|
import { basename, extname } from "node:path";
|
|
25
25
|
var MAX_UPLOAD_BYTES = 3e8;
|
|
@@ -79,7 +79,7 @@ async function uploadAsset(input) {
|
|
|
79
79
|
return registered.assetId;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
// src/studio/sampleLogos.ts
|
|
82
|
+
// ../src/studio/sampleLogos.ts
|
|
83
83
|
var SAMPLE_LOGOS = [
|
|
84
84
|
{
|
|
85
85
|
id: "bolt",
|
|
@@ -117,7 +117,7 @@ function sampleLogo(id) {
|
|
|
117
117
|
return SAMPLE_LOGOS.find((s) => s.id === id);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
// src/studio/templates.ts
|
|
120
|
+
// ../src/studio/templates.ts
|
|
121
121
|
var esc = (s) => s.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
|
|
122
122
|
var escTemplate = (s) => s.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
|
|
123
123
|
var num = (v, fallback) => {
|
|
@@ -1091,7 +1091,7 @@ var TEMPLATES = [
|
|
|
1091
1091
|
blank
|
|
1092
1092
|
];
|
|
1093
1093
|
|
|
1094
|
-
// src/studio/parseFiles.ts
|
|
1094
|
+
// ../src/studio/parseFiles.ts
|
|
1095
1095
|
var FENCE = /```([^\n`]*)\n([\s\S]*?)```/g;
|
|
1096
1096
|
var DROP = /* @__PURE__ */ new Set([
|
|
1097
1097
|
"index.tsx",
|
|
@@ -1143,7 +1143,7 @@ function parseSceneFiles(pasted) {
|
|
|
1143
1143
|
return files;
|
|
1144
1144
|
}
|
|
1145
1145
|
|
|
1146
|
-
// src/shared/local-project.ts
|
|
1146
|
+
// ../src/shared/local-project.ts
|
|
1147
1147
|
var LOCAL_PROJECT_ID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
1148
1148
|
var LOCAL_SCENE_NAME_RE = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
1149
1149
|
function isLocalProjectId(value) {
|
|
@@ -1163,7 +1163,7 @@ function localProjectMarker(input) {
|
|
|
1163
1163
|
`;
|
|
1164
1164
|
}
|
|
1165
1165
|
|
|
1166
|
-
// src/shared/initial-files.ts
|
|
1166
|
+
// ../src/shared/initial-files.ts
|
|
1167
1167
|
var TITLE_TEMPLATE = TEMPLATES.find((t) => t.id === "title-card");
|
|
1168
1168
|
var BLANK_DIRECTION = TEMPLATES.find((t) => t.id === "blank").generate({});
|
|
1169
1169
|
var defaultParams = (t) => Object.fromEntries(t.params.map((p) => [p.key, p.default]));
|
|
@@ -1201,10 +1201,10 @@ function buildInitialFiles(input) {
|
|
|
1201
1201
|
};
|
|
1202
1202
|
}
|
|
1203
1203
|
|
|
1204
|
-
// src/shared/video-models.ts
|
|
1204
|
+
// ../src/shared/video-models.ts
|
|
1205
1205
|
var DEFAULT_OPENROUTER_VIDEO_MODEL = "anthropic/claude-opus-5";
|
|
1206
1206
|
|
|
1207
|
-
// src/shared/video-clone-command.ts
|
|
1207
|
+
// ../src/shared/video-clone-command.ts
|
|
1208
1208
|
var TOKEN = /^[A-Za-z0-9_-]{43}$/;
|
|
1209
1209
|
var SHARE_HOSTS = /* @__PURE__ */ new Set(["impractical.ai", "www.impractical.ai", "impractical-video-shares.vercel.app"]);
|
|
1210
1210
|
function videoShareToken(source) {
|
|
@@ -1218,7 +1218,7 @@ function videoShareToken(source) {
|
|
|
1218
1218
|
throw new Error("Use an Impractical video share URL: https://impractical.ai/v/<token>");
|
|
1219
1219
|
}
|
|
1220
1220
|
|
|
1221
|
-
//
|
|
1221
|
+
// src/clone-video-project.ts
|
|
1222
1222
|
async function cloneVideoProject(source, json = false) {
|
|
1223
1223
|
const token = videoShareToken(source);
|
|
1224
1224
|
const result = await invoke("video-shares", { action: "clone", token });
|
|
@@ -1234,7 +1234,7 @@ async function cloneVideoProject(source, json = false) {
|
|
|
1234
1234
|
console.log(`Use Impractical to open project ${result.projectId} and help me iterate on this video.`);
|
|
1235
1235
|
}
|
|
1236
1236
|
|
|
1237
|
-
//
|
|
1237
|
+
// src/video-sharing.ts
|
|
1238
1238
|
import { openAsBlob } from "node:fs";
|
|
1239
1239
|
import { readFile, stat } from "node:fs/promises";
|
|
1240
1240
|
import { basename as basename2, extname as extname2 } from "node:path";
|
|
@@ -1335,7 +1335,7 @@ async function shareVideo(rest, flags) {
|
|
|
1335
1335
|
}
|
|
1336
1336
|
}
|
|
1337
1337
|
|
|
1338
|
-
//
|
|
1338
|
+
// src/commands.ts
|
|
1339
1339
|
var flagString = (flags, name) => {
|
|
1340
1340
|
const value = flags[name];
|
|
1341
1341
|
if (Array.isArray(value)) return value[value.length - 1];
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
PACKAGE_VERSION
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AP27EKRR.js";
|
|
5
5
|
import "./chunk-77HVPD4G.js";
|
|
6
6
|
|
|
7
|
-
//
|
|
7
|
+
// src/cli-args.ts
|
|
8
8
|
import { parseArgs } from "node:util";
|
|
9
9
|
var CLI_OPTIONS = {
|
|
10
10
|
key: { type: "string" },
|
|
@@ -48,7 +48,7 @@ function parseCliArgs(args) {
|
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
//
|
|
51
|
+
// src/cli-runtime.ts
|
|
52
52
|
var HELP = `impractical \u2014 Impractical Motion from your terminal (and your coding agent)
|
|
53
53
|
|
|
54
54
|
Setup
|
|
@@ -157,14 +157,14 @@ async function runCli(args, deps) {
|
|
|
157
157
|
throw new Error(`Unknown command "${[command, ...rest].join(" ")}"`);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
//
|
|
160
|
+
// src/index.ts
|
|
161
161
|
runCli(process.argv.slice(2), {
|
|
162
162
|
writeLine: (line) => console.log(line),
|
|
163
|
-
loadCommands: () => import("./commands-
|
|
164
|
-
loadApi: () => import("./api-
|
|
165
|
-
loadMcp: () => import("./stdio-
|
|
163
|
+
loadCommands: () => import("./commands-6F7HITZN.js"),
|
|
164
|
+
loadApi: () => import("./api-V7Q3PIWY.js"),
|
|
165
|
+
loadMcp: () => import("./stdio-R4RCWJIS.js")
|
|
166
166
|
}).catch(async (error) => {
|
|
167
|
-
const { ApiError } = await import("./api-
|
|
167
|
+
const { ApiError } = await import("./api-V7Q3PIWY.js");
|
|
168
168
|
if (error instanceof ApiError) {
|
|
169
169
|
console.error(`Error (${error.status} from ${error.fn}): ${error.message}`);
|
|
170
170
|
if (error.status === 429) console.error("Weekly MCP allowance reached. Upgrade or wait for Monday UTC.");
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
__require
|
|
5
5
|
} from "./chunk-77HVPD4G.js";
|
|
6
6
|
|
|
7
|
-
//
|
|
7
|
+
// node_modules/esbuild/lib/main.js
|
|
8
8
|
var require_main = __commonJS({
|
|
9
|
-
"
|
|
9
|
+
"node_modules/esbuild/lib/main.js"(exports, module) {
|
|
10
10
|
var __defProp = Object.defineProperty;
|
|
11
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|