@formlm/cli 0.2.3 → 0.2.5

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.
Files changed (44) hide show
  1. package/dist/commands/app.d.ts.map +1 -1
  2. package/dist/commands/app.js +4 -3
  3. package/dist/commands/app.js.map +1 -1
  4. package/dist/commands/auth.d.ts.map +1 -1
  5. package/dist/commands/auth.js +64 -2
  6. package/dist/commands/auth.js.map +1 -1
  7. package/dist/commands/connect.d.ts.map +1 -1
  8. package/dist/commands/connect.js +34 -41
  9. package/dist/commands/connect.js.map +1 -1
  10. package/dist/commands/expert.d.ts.map +1 -1
  11. package/dist/commands/expert.js +15 -14
  12. package/dist/commands/expert.js.map +1 -1
  13. package/dist/commands/field.d.ts.map +1 -1
  14. package/dist/commands/field.js +17 -27
  15. package/dist/commands/field.js.map +1 -1
  16. package/dist/commands/report.d.ts.map +1 -1
  17. package/dist/commands/report.js +21 -27
  18. package/dist/commands/report.js.map +1 -1
  19. package/dist/commands/scale.d.ts.map +1 -1
  20. package/dist/commands/scale.js +13 -19
  21. package/dist/commands/scale.js.map +1 -1
  22. package/dist/commands/smart.d.ts.map +1 -1
  23. package/dist/commands/smart.js +31 -4
  24. package/dist/commands/smart.js.map +1 -1
  25. package/dist/commands/snapshot.d.ts.map +1 -1
  26. package/dist/commands/snapshot.js +7 -1
  27. package/dist/commands/snapshot.js.map +1 -1
  28. package/dist/exec.d.ts.map +1 -1
  29. package/dist/exec.js +54 -12
  30. package/dist/exec.js.map +1 -1
  31. package/dist/index.js +42 -26
  32. package/dist/index.js.map +1 -1
  33. package/dist/mcp.d.ts.map +1 -1
  34. package/dist/mcp.js +31 -20
  35. package/dist/mcp.js.map +1 -1
  36. package/dist/utils.d.ts +18 -0
  37. package/dist/utils.d.ts.map +1 -0
  38. package/dist/utils.js +34 -0
  39. package/dist/utils.js.map +1 -0
  40. package/dist/version.d.ts +2 -0
  41. package/dist/version.d.ts.map +1 -0
  42. package/dist/version.js +11 -0
  43. package/dist/version.js.map +1 -0
  44. package/package.json +1 -1
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Shared CLI utilities.
3
+ *
4
+ * escapeArg is the single source of truth for escaping user-supplied input
5
+ * before it is embedded into a command string. Both the direct CLI
6
+ * (commands/smart.ts) and the MCP Server (mcp.ts) must use it to prevent
7
+ * argument-boundary breakage when input contains double quotes etc.
8
+ */
9
+ export declare function escapeArg(s: string): string;
10
+ /**
11
+ * Normalize commander optional boolean flags to true/false/undefined.
12
+ * --flag → true
13
+ * --flag=false → false (string)
14
+ * --flag=true → true (string)
15
+ * not passed → undefined
16
+ */
17
+ export declare function normBool(v: unknown): boolean | undefined;
18
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAO3C;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAIxD"}
package/dist/utils.js ADDED
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Shared CLI utilities.
3
+ *
4
+ * escapeArg is the single source of truth for escaping user-supplied input
5
+ * before it is embedded into a command string. Both the direct CLI
6
+ * (commands/smart.ts) and the MCP Server (mcp.ts) must use it to prevent
7
+ * argument-boundary breakage when input contains double quotes etc.
8
+ */
9
+ // tokenizeCommand (server-side PipelineFilterCommand) supports \" as an escaped
10
+ // double-quote inside a quoted arg. Backslashes must be escaped first.
11
+ // Newlines / tabs are normalized to spaces since CLI commands are single-line.
12
+ export function escapeArg(s) {
13
+ return s
14
+ .replace(/\\/g, '\\\\') // \ → \\ (must be first)
15
+ .replace(/"/g, '\\"') // " → \"
16
+ .replace(/\r?\n|\r/g, ' ') // newlines → space
17
+ .replace(/\t/g, ' ') // tabs → space
18
+ .trim();
19
+ }
20
+ /**
21
+ * Normalize commander optional boolean flags to true/false/undefined.
22
+ * --flag → true
23
+ * --flag=false → false (string)
24
+ * --flag=true → true (string)
25
+ * not passed → undefined
26
+ */
27
+ export function normBool(v) {
28
+ if (v === undefined)
29
+ return undefined;
30
+ if (typeof v === 'boolean')
31
+ return v;
32
+ return v === 'true' || v === '1';
33
+ }
34
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,gFAAgF;AAChF,uEAAuE;AACvE,+EAA+E;AAC/E,MAAM,UAAU,SAAS,CAAC,CAAS;IACjC,OAAO,CAAC;SACL,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAG,0BAA0B;SACnD,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAM,SAAS;SACnC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,mBAAmB;SAC7C,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAO,eAAe;SACzC,IAAI,EAAE,CAAC;AACZ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAU;IACjC,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACtC,IAAI,OAAO,CAAC,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC;IACrC,OAAO,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,GAAG,CAAC;AACnC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const VERSION: string;
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,OAAO,EAAE,MAAoB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { createRequire } from 'node:module';
2
+ // package.json is the Single Source of Truth for the version number.
3
+ // Use createRequire (runtime) instead of a static JSON import so that
4
+ // `rootDir: ./src` does not complain about a file outside the src tree.
5
+ // After compilation dist/version.js → ../package.json resolves to the
6
+ // package root both in development and in the published npm tarball
7
+ // (npm always includes package.json regardless of the `files` field).
8
+ const require = createRequire(import.meta.url);
9
+ const pkg = require('../package.json');
10
+ export const VERSION = pkg.version;
11
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,qEAAqE;AACrE,sEAAsE;AACtE,wEAAwE;AACxE,sEAAsE;AACtE,oEAAoE;AACpE,sEAAsE;AACtE,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAwB,CAAC;AAE9D,MAAM,CAAC,MAAM,OAAO,GAAW,GAAG,CAAC,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formlm/cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "The official CLI & MCP Server for FormLM — let AI Agents build and manage your forms directly",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",