@todoforai/tfa-memory 0.4.3 → 0.4.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/cli.js +16 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -11,6 +11,9 @@ import { readFileSync, writeFileSync, mkdirSync, chmodSync } from "node:fs";
11
11
  import { join, dirname } from "node:path";
12
12
  import { homedir, platform } from "node:os";
13
13
  var DEFAULT_API_URL = "https://api.todofor.ai";
14
+ function runActorToken() {
15
+ return process.env.TODOFORAI_USER_ID ? process.env.TODOFORAI_API_TOKEN || "" : "";
16
+ }
14
17
  function normalizeApiUrl(url) {
15
18
  if (url.startsWith("localhost"))
16
19
  return `http://${url}`;
@@ -68,6 +71,8 @@ async function refreshDeviceToken(opts = {}) {
68
71
  const apiUrl = normalizeApiUrl(opts.apiUrl || envUrl || stored.apiUrl || DEFAULT_API_URL);
69
72
  if (!stored.deviceId || !stored.deviceSecret)
70
73
  return "";
74
+ if (runActorToken())
75
+ return "";
71
76
  if (stored.apiUrl && normalizeApiUrl(stored.apiUrl) !== apiUrl)
72
77
  return "";
73
78
  try {
@@ -122,6 +127,9 @@ import { homedir as homedir2, platform as platform2 } from "node:os";
122
127
  import { spawn } from "node:child_process";
123
128
  import { platform as platform22, hostname } from "node:os";
124
129
  var DEFAULT_API_URL2 = "https://api.todofor.ai";
130
+ function runActorToken2() {
131
+ return process.env.TODOFORAI_USER_ID ? process.env.TODOFORAI_API_TOKEN || "" : "";
132
+ }
125
133
  function normalizeApiUrl2(url) {
126
134
  if (url.startsWith("localhost"))
127
135
  return `http://${url}`;
@@ -182,6 +190,8 @@ async function refreshDeviceToken2(opts = {}) {
182
190
  const apiUrl = normalizeApiUrl2(opts.apiUrl || envUrl || stored.apiUrl || DEFAULT_API_URL2);
183
191
  if (!stored.deviceId || !stored.deviceSecret)
184
192
  return "";
193
+ if (runActorToken2())
194
+ return "";
185
195
  if (stored.apiUrl && normalizeApiUrl2(stored.apiUrl) !== apiUrl)
186
196
  return "";
187
197
  try {
@@ -302,6 +312,9 @@ import { readFileSync as readFileSync3, writeFileSync as writeFileSync3, mkdirSy
302
312
  import { join as join3, dirname as dirname3 } from "node:path";
303
313
  import { homedir as homedir3, platform as platform3 } from "node:os";
304
314
  var DEFAULT_API_URL3 = "https://api.todofor.ai";
315
+ function runActorToken3() {
316
+ return process.env.TODOFORAI_USER_ID ? process.env.TODOFORAI_API_TOKEN || "" : "";
317
+ }
305
318
  function normalizeApiUrl3(url) {
306
319
  if (url.startsWith("localhost"))
307
320
  return `http://${url}`;
@@ -359,6 +372,8 @@ async function refreshDeviceToken3(opts = {}) {
359
372
  const apiUrl = normalizeApiUrl3(opts.apiUrl || envUrl || stored.apiUrl || DEFAULT_API_URL3);
360
373
  if (!stored.deviceId || !stored.deviceSecret)
361
374
  return "";
375
+ if (runActorToken3())
376
+ return "";
362
377
  if (stored.apiUrl && normalizeApiUrl3(stored.apiUrl) !== apiUrl)
363
378
  return "";
364
379
  try {
@@ -497,7 +512,7 @@ function checkForUpdates(pkg) {
497
512
  // package.json
498
513
  var package_default = {
499
514
  name: "@todoforai/tfa-memory",
500
- version: "0.4.3",
515
+ version: "0.4.5",
501
516
  description: "Zero-config TODOforAI memory CLI — add/search/ls/get/rm/live text memory rows addressed as source/ref, plus federated search over every message of every past TODO (read-only `todo` source), with full-text and semantic search, plus L2 working-memory re-render. Reuses bridge credentials.",
502
517
  type: "module",
503
518
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todoforai/tfa-memory",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "Zero-config TODOforAI memory CLI — add/search/ls/get/rm/live text memory rows addressed as source/ref, plus federated search over every message of every past TODO (read-only `todo` source), with full-text and semantic search, plus L2 working-memory re-render. Reuses bridge credentials.",
5
5
  "type": "module",
6
6
  "bin": {