@todoforai/cli 0.1.4 → 0.1.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 (2) hide show
  1. package/dist/todoai.js +56 -8
  2. package/package.json +1 -1
package/dist/todoai.js CHANGED
@@ -12960,7 +12960,7 @@ var require_http = __commonJS((exports, module) => {
12960
12960
  return joined;
12961
12961
  }
12962
12962
  function http(hljs) {
12963
- const VERSION = "HTTP/(2|1\\.[01])";
12963
+ const VERSION2 = "HTTP/(2|1\\.[01])";
12964
12964
  const HEADER_NAME = /[A-Za-z][A-Za-z0-9-]*/;
12965
12965
  const HEADER = {
12966
12966
  className: "attribute",
@@ -12992,12 +12992,12 @@ var require_http = __commonJS((exports, module) => {
12992
12992
  illegal: /\S/,
12993
12993
  contains: [
12994
12994
  {
12995
- begin: "^(?=" + VERSION + " \\d{3})",
12995
+ begin: "^(?=" + VERSION2 + " \\d{3})",
12996
12996
  end: /$/,
12997
12997
  contains: [
12998
12998
  {
12999
12999
  className: "meta",
13000
- begin: VERSION
13000
+ begin: VERSION2
13001
13001
  },
13002
13002
  {
13003
13003
  className: "number",
@@ -13011,7 +13011,7 @@ var require_http = __commonJS((exports, module) => {
13011
13011
  }
13012
13012
  },
13013
13013
  {
13014
- begin: "(?=^[A-Z]+ (.*?) " + VERSION + "$)",
13014
+ begin: "(?=^[A-Z]+ (.*?) " + VERSION2 + "$)",
13015
13015
  end: /$/,
13016
13016
  contains: [
13017
13017
  {
@@ -13023,7 +13023,7 @@ var require_http = __commonJS((exports, module) => {
13023
13023
  },
13024
13024
  {
13025
13025
  className: "meta",
13026
- begin: VERSION
13026
+ begin: VERSION2
13027
13027
  },
13028
13028
  {
13029
13029
  className: "keyword",
@@ -43028,7 +43028,45 @@ class FrontendWebSocket {
43028
43028
 
43029
43029
  // src/args.ts
43030
43030
  import { parseArgs } from "util";
43031
+ // package.json
43032
+ var package_default = {
43033
+ name: "@todoforai/cli",
43034
+ version: "0.1.3",
43035
+ type: "module",
43036
+ bin: {
43037
+ todoai: "dist/todoai.js"
43038
+ },
43039
+ files: ["dist/todoai.js"],
43040
+ scripts: {
43041
+ build: "bun build src/index.ts --target=bun --outfile dist/todoai.js --external ws",
43042
+ prepublishOnly: "bun run build",
43043
+ start: "bun run src/index.ts",
43044
+ dev: "bun run src/index.ts",
43045
+ postinstall: "rm -rf node_modules/@todoforai/edge && ln -s ../../../edge/bun node_modules/@todoforai/edge"
43046
+ },
43047
+ dependencies: {
43048
+ "cli-highlight": "^2.1.11",
43049
+ "diff-match-patch": "^1.0.5",
43050
+ ws: "^8.18.0"
43051
+ },
43052
+ peerDependencies: {
43053
+ "@todoforai/edge": "file:../edge/bun"
43054
+ },
43055
+ peerDependenciesMeta: {
43056
+ "@todoforai/edge": {
43057
+ optional: true
43058
+ }
43059
+ },
43060
+ devDependencies: {
43061
+ "@types/ws": "^8.5.13",
43062
+ "@todoforai/edge": "file:../edge/bun",
43063
+ typescript: "^5.7.0"
43064
+ }
43065
+ };
43066
+
43067
+ // src/args.ts
43031
43068
  var DEFAULT_API_URL = "https://api.todofor.ai";
43069
+ var VERSION = package_default.version;
43032
43070
  function getEnv(name) {
43033
43071
  return process.env[`TODOFORAI_${name}`] || process.env[`TODO4AI_${name}`] || "";
43034
43072
  }
@@ -43071,6 +43109,7 @@ Options:
43071
43109
  --show-config Show config
43072
43110
  --set-default-api-url Set default API URL
43073
43111
  --reset-config Reset config file
43112
+ --version, -v Print version and exit
43074
43113
  --help, -h Show this help
43075
43114
  `);
43076
43115
  }
@@ -43101,7 +43140,8 @@ function parseCliArgs() {
43101
43140
  "set-default-api-url": { type: "string" },
43102
43141
  "reset-config": { type: "boolean", default: false },
43103
43142
  "config-path": { type: "string" },
43104
- help: { type: "boolean", short: "h", default: false }
43143
+ help: { type: "boolean", short: "h", default: false },
43144
+ version: { type: "boolean", short: "v", default: false }
43105
43145
  },
43106
43146
  allowPositionals: true,
43107
43147
  strict: false
@@ -44955,6 +44995,10 @@ Cancelled by user (Ctrl+C)
44955
44995
  process.exit(130);
44956
44996
  });
44957
44997
  const { values: args, positionals } = parseCliArgs();
44998
+ if (args.version) {
44999
+ console.log(VERSION);
45000
+ process.exit(0);
45001
+ }
44958
45002
  if (args.help) {
44959
45003
  printUsage();
44960
45004
  process.exit(0);
@@ -45039,8 +45083,6 @@ Cancelled by user (Ctrl+C)
45039
45083
  apiKey = await deviceLogin();
45040
45084
  }
45041
45085
  const api = new ApiClient(apiUrl, apiKey);
45042
- if (!args["no-edge"])
45043
- ensureEdgeRunning(apiUrl, apiKey);
45044
45086
  if (args["list-agents"]) {
45045
45087
  await listAgentsCommand(api, { json: !!args.json, formatPath: formatPathWithTilde });
45046
45088
  return;
@@ -45054,6 +45096,8 @@ Cancelled by user (Ctrl+C)
45054
45096
  if (process.stderr.isTTY)
45055
45097
  printLogo();
45056
45098
  if (args.template) {
45099
+ if (!args["no-edge"])
45100
+ ensureEdgeRunning(apiUrl, apiKey);
45057
45101
  const templateId = args.template;
45058
45102
  const inputValues = {};
45059
45103
  for (const kv of args.input || []) {
@@ -45141,6 +45185,8 @@ ${"\u2500".repeat(40)}
45141
45185
  `);
45142
45186
  }
45143
45187
  if (args.resume || args.continue) {
45188
+ if (!args["no-edge"])
45189
+ ensureEdgeRunning(apiUrl, apiKey);
45144
45190
  const todoId = args.resume || cfg.data.last_todo_id;
45145
45191
  if (!todoId) {
45146
45192
  process.stderr.write(`Error: No recent todo found
@@ -45208,6 +45254,8 @@ Resumed todo: ${todoId}
45208
45254
  }
45209
45255
  process.stderr.write(`${DIM}Tip: ${randomTip()}${RESET}
45210
45256
  `);
45257
+ if (!args["no-edge"])
45258
+ ensureEdgeRunning(apiUrl, apiKey);
45211
45259
  let content;
45212
45260
  if (positionals.length > 0) {
45213
45261
  content = positionals.join(" ");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todoforai/cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "todoai": "dist/todoai.js"