@todoforai/cli 0.1.53 → 0.1.54

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.
@@ -42875,6 +42875,9 @@ class ApiClient {
42875
42875
  setDefaultProject(projectId) {
42876
42876
  return this.request("POST", "/api/v1/users/default-project", { projectId });
42877
42877
  }
42878
+ updateProjectSettings(projectId, settings) {
42879
+ return this.request("PUT", `/api/v1/settings/projects/${projectId}`, { projectId, settings });
42880
+ }
42878
42881
  setProjectDefaultAgent(projectId, agentSettingsId) {
42879
42882
  return this.request("POST", "/api/v1/users/project-agent-mapping", { projectId, agentSettingsId });
42880
42883
  }
@@ -44556,7 +44559,7 @@ import { parseArgs } from "util";
44556
44559
  // package.json
44557
44560
  var package_default = {
44558
44561
  name: "@todoforai/cli",
44559
- version: "0.1.53",
44562
+ version: "0.1.54",
44560
44563
  type: "module",
44561
44564
  bin: {
44562
44565
  "todoforai-cli": "bin/todoforai-cli.js",
@@ -47860,7 +47863,7 @@ function printProjectHelp() {
47860
47863
  process.stderr.write(`
47861
47864
  tfa-cli project — edit the current project
47862
47865
 
47863
- --project <id> or $TODOFORAI_PROJECT_ID selects the project.
47866
+ --project <id>, $TODOFORAI_PROJECT_ID, or the configured default selects the project.
47864
47867
 
47865
47868
  Usage:
47866
47869
  tfa-cli project list Projects you can access (* = default)
@@ -47893,6 +47896,7 @@ var TODO_ALIASES = {
47893
47896
  agent: "agentSettingsId",
47894
47897
  public: "isPublic"
47895
47898
  };
47899
+ var NO_PROJECT = "No project — pass --project <id> or set TODOFORAI_PROJECT_ID";
47896
47900
  function fail(msg) {
47897
47901
  process.stderr.write(`${RED}${msg}${RESET}
47898
47902
  `);
@@ -47943,9 +47947,8 @@ async function todoCommand(api, positionals, args) {
47943
47947
  process.stderr.write(`${GREEN}✅ ${todoId} updated: ${Object.keys(updates).join(", ")}${RESET}
47944
47948
  `);
47945
47949
  }
47946
- async function projectCommand(api, positionals, args) {
47950
+ async function projectCommand(api, positionals, args, projectId) {
47947
47951
  const [, sub, ...rest] = positionals;
47948
- const projectId = args.project || getEnv2("PROJECT_ID");
47949
47952
  if (!sub) {
47950
47953
  printProjectHelp();
47951
47954
  process.exit(0);
@@ -47964,7 +47967,7 @@ async function projectCommand(api, positionals, args) {
47964
47967
  return;
47965
47968
  }
47966
47969
  if (!projectId)
47967
- fail("No project — pass --project <id> or set TODOFORAI_PROJECT_ID");
47970
+ fail(NO_PROJECT);
47968
47971
  if (sub === "set") {
47969
47972
  if (!rest.length)
47970
47973
  fail("Usage: tfa-cli project set <field=value>…");
@@ -48077,7 +48080,7 @@ function printBrandHelp() {
48077
48080
  process.stderr.write(`
48078
48081
  tfa-cli brand — the project's brand page and its learned writing voice
48079
48082
 
48080
- The project IS the brand. --project <id> or $TODOFORAI_PROJECT_ID selects it.
48083
+ The project IS the brand. --project <id>, $TODOFORAI_PROJECT_ID, or the configured default selects it.
48081
48084
  The brand page text itself is a file: read/write todoforai:business-context.
48082
48085
 
48083
48086
  Usage:
@@ -48107,15 +48110,9 @@ Questions the UI asks (keys for 'answers'):
48107
48110
  "A frustrated customer says things aren't working. How do you reply?"
48108
48111
  `);
48109
48112
  }
48110
- function requireProject(args) {
48111
- const projectId = args.project || getEnv2("PROJECT_ID");
48112
- if (!projectId)
48113
- fail("No project — pass --project <id> or set TODOFORAI_PROJECT_ID");
48114
- return projectId;
48115
- }
48116
- async function brandCommand(api, positionals, args) {
48113
+ async function brandCommand(api, positionals, args, scoped) {
48117
48114
  const [, sub, ...rest] = positionals;
48118
- const projectId = requireProject(args);
48115
+ const projectId = scoped || fail(NO_PROJECT);
48119
48116
  if (!sub || sub === "show") {
48120
48117
  const brand = await api.getBusinessContext(projectId);
48121
48118
  if (args.json) {
@@ -73167,12 +73164,13 @@ Cancelled by user (Ctrl+C)
73167
73164
  await todoCommand(api2, positionals, args);
73168
73165
  return;
73169
73166
  }
73167
+ const scopedProject = args.project || getEnv("PROJECT_ID") || cfgScope.data.default_project_id || undefined;
73170
73168
  if (positionals[0] === "project") {
73171
- await projectCommand(api2, positionals, args);
73169
+ await projectCommand(api2, positionals, args, scopedProject);
73172
73170
  return;
73173
73171
  }
73174
73172
  if (positionals[0] === "brand") {
73175
- await brandCommand(api2, positionals, args);
73173
+ await brandCommand(api2, positionals, args, scopedProject);
73176
73174
  return;
73177
73175
  }
73178
73176
  if (positionals[0] === "device") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todoforai/cli",
3
- "version": "0.1.53",
3
+ "version": "0.1.54",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "todoforai-cli": "bin/todoforai-cli.js",