@staff0rd/assist 0.58.2 → 0.59.0

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 (3) hide show
  1. package/README.md +1 -0
  2. package/dist/index.js +68 -18
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -57,6 +57,7 @@ After installation, the `assist` command will be available globally.
57
57
  - `assist backlog add` - Add a new backlog item interactively
58
58
  - `assist backlog start <id>` - Set a backlog item to in-progress
59
59
  - `assist backlog done <id>` - Set a backlog item to done
60
+ - `assist roam auth` - Configure Roam API credentials (saved to ~/.assist.yml)
60
61
  - `assist run <name>` - Run a configured command from assist.yml
61
62
  - `assist run add` - Add a new run configuration to assist.yml
62
63
  - `assist config set <key> <value>` - Set a config value (e.g. commit.push true)
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.58.2",
9
+ version: "0.59.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -71,6 +71,7 @@ import { execSync } from "child_process";
71
71
 
72
72
  // src/shared/loadConfig.ts
73
73
  import { existsSync, readFileSync, writeFileSync } from "fs";
74
+ import { homedir } from "os";
74
75
  import { basename, join } from "path";
75
76
  import chalk from "chalk";
76
77
  import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
@@ -109,6 +110,10 @@ var assistConfigSchema = z.strictObject({
109
110
  restructure: z.strictObject({
110
111
  ignore: z.array(z.string()).default([])
111
112
  }).optional(),
113
+ roam: z.strictObject({
114
+ clientId: z.string(),
115
+ clientSecret: z.string()
116
+ }).optional(),
112
117
  run: z.array(runConfigSchema).optional(),
113
118
  transcript: transcriptConfigSchema.optional()
114
119
  });
@@ -121,18 +126,31 @@ function getConfigPath() {
121
126
  }
122
127
  return join(process.cwd(), "assist.yml");
123
128
  }
124
- function loadConfig() {
125
- const configPath = getConfigPath();
126
- let raw = {};
127
- if (existsSync(configPath)) {
128
- try {
129
- const content = readFileSync(configPath, "utf-8");
130
- raw = parseYaml(content) || {};
131
- } catch {
132
- }
129
+ function getGlobalConfigPath() {
130
+ return join(homedir(), ".assist.yml");
131
+ }
132
+ function loadRawConfig(path31) {
133
+ if (!existsSync(path31)) return {};
134
+ try {
135
+ const content = readFileSync(path31, "utf-8");
136
+ return parseYaml(content) || {};
137
+ } catch {
138
+ return {};
133
139
  }
140
+ }
141
+ function loadConfig() {
142
+ const globalRaw = loadRawConfig(getGlobalConfigPath());
143
+ const projectRaw = loadRawConfig(getConfigPath());
144
+ const merged = { ...globalRaw, ...projectRaw };
145
+ return assistConfigSchema.parse(merged);
146
+ }
147
+ function loadGlobalConfig() {
148
+ const raw = loadRawConfig(getGlobalConfigPath());
134
149
  return assistConfigSchema.parse(raw);
135
150
  }
151
+ function saveGlobalConfig(config) {
152
+ writeFileSync(getGlobalConfigPath(), stringifyYaml(config, { lineWidth: 0 }));
153
+ }
136
154
  function saveConfig(config) {
137
155
  const configPath = getConfigPath();
138
156
  writeFileSync(configPath, stringifyYaml(config, { lineWidth: 0 }));
@@ -2583,9 +2601,9 @@ import chalk35 from "chalk";
2583
2601
 
2584
2602
  // src/commands/devlog/loadDevlogEntries.ts
2585
2603
  import { readdirSync, readFileSync as readFileSync12 } from "fs";
2586
- import { homedir } from "os";
2604
+ import { homedir as homedir2 } from "os";
2587
2605
  import { join as join10 } from "path";
2588
- var DEVLOG_DIR = join10(homedir(), "git/blog/src/content/devlog");
2606
+ var DEVLOG_DIR = join10(homedir2(), "git/blog/src/content/devlog");
2589
2607
  function loadDevlogEntries(repoName) {
2590
2608
  const entries = /* @__PURE__ */ new Map();
2591
2609
  try {
@@ -4841,6 +4859,37 @@ function registerVerify(program2) {
4841
4859
  verifyCommand.command("hardcoded-colors").description("Check for hardcoded hex colors in src/").action(hardcodedColors);
4842
4860
  }
4843
4861
 
4862
+ // src/commands/roam/auth.ts
4863
+ import chalk49 from "chalk";
4864
+ import enquirer6 from "enquirer";
4865
+ async function auth() {
4866
+ const { clientId } = await enquirer6.prompt({
4867
+ type: "input",
4868
+ name: "clientId",
4869
+ message: "Client ID:",
4870
+ validate: (value) => value.trim().length > 0 || "Client ID is required"
4871
+ });
4872
+ const { clientSecret } = await enquirer6.prompt({
4873
+ type: "input",
4874
+ name: "clientSecret",
4875
+ message: "Client Secret:",
4876
+ validate: (value) => value.trim().length > 0 || "Client Secret is required"
4877
+ });
4878
+ const config = loadGlobalConfig();
4879
+ config.roam = {
4880
+ clientId: clientId.trim(),
4881
+ clientSecret: clientSecret.trim()
4882
+ };
4883
+ saveGlobalConfig(config);
4884
+ console.log(chalk49.green("Roam credentials saved to ~/.assist.yml"));
4885
+ }
4886
+
4887
+ // src/commands/roam/registerRoam.ts
4888
+ function registerRoam(program2) {
4889
+ const roamCommand = program2.command("roam").description("Roam Research utilities");
4890
+ roamCommand.command("auth").description("Configure Roam API credentials").action(auth);
4891
+ }
4892
+
4844
4893
  // src/commands/run/index.ts
4845
4894
  import { spawn as spawn4 } from "child_process";
4846
4895
 
@@ -4978,7 +5027,7 @@ import { fileURLToPath as fileURLToPath3 } from "url";
4978
5027
  // src/commands/sync/syncClaudeMd.ts
4979
5028
  import * as fs21 from "fs";
4980
5029
  import * as path27 from "path";
4981
- import chalk49 from "chalk";
5030
+ import chalk50 from "chalk";
4982
5031
  async function syncClaudeMd(claudeDir, targetBase) {
4983
5032
  const source = path27.join(claudeDir, "CLAUDE.md");
4984
5033
  const target = path27.join(targetBase, "CLAUDE.md");
@@ -4987,12 +5036,12 @@ async function syncClaudeMd(claudeDir, targetBase) {
4987
5036
  const targetContent = fs21.readFileSync(target, "utf-8");
4988
5037
  if (sourceContent !== targetContent) {
4989
5038
  console.log(
4990
- chalk49.yellow("\n\u26A0\uFE0F Warning: CLAUDE.md differs from existing file")
5039
+ chalk50.yellow("\n\u26A0\uFE0F Warning: CLAUDE.md differs from existing file")
4991
5040
  );
4992
5041
  console.log();
4993
5042
  printDiff(targetContent, sourceContent);
4994
5043
  const confirm = await promptConfirm(
4995
- chalk49.red("Overwrite existing CLAUDE.md?"),
5044
+ chalk50.red("Overwrite existing CLAUDE.md?"),
4996
5045
  false
4997
5046
  );
4998
5047
  if (!confirm) {
@@ -5008,7 +5057,7 @@ async function syncClaudeMd(claudeDir, targetBase) {
5008
5057
  // src/commands/sync/syncSettings.ts
5009
5058
  import * as fs22 from "fs";
5010
5059
  import * as path28 from "path";
5011
- import chalk50 from "chalk";
5060
+ import chalk51 from "chalk";
5012
5061
  async function syncSettings(claudeDir, targetBase) {
5013
5062
  const source = path28.join(claudeDir, "settings.json");
5014
5063
  const target = path28.join(targetBase, "settings.json");
@@ -5019,12 +5068,12 @@ async function syncSettings(claudeDir, targetBase) {
5019
5068
  const normalizedTarget = JSON.stringify(JSON.parse(targetContent), null, 2);
5020
5069
  if (normalizedSource !== normalizedTarget) {
5021
5070
  console.log(
5022
- chalk50.yellow("\n\u26A0\uFE0F Warning: settings.json differs from existing file")
5071
+ chalk51.yellow("\n\u26A0\uFE0F Warning: settings.json differs from existing file")
5023
5072
  );
5024
5073
  console.log();
5025
5074
  printDiff(targetContent, sourceContent);
5026
5075
  const confirm = await promptConfirm(
5027
- chalk50.red("Overwrite existing settings.json?"),
5076
+ chalk51.red("Overwrite existing settings.json?"),
5028
5077
  false
5029
5078
  );
5030
5079
  if (!confirm) {
@@ -5135,6 +5184,7 @@ program.command("notify").description(
5135
5184
  ).action(notify);
5136
5185
  program.command("update").description("Update assist to the latest version and sync commands").action(update);
5137
5186
  registerPrs(program);
5187
+ registerRoam(program);
5138
5188
  registerBacklog(program);
5139
5189
  registerVerify(program);
5140
5190
  registerRefactor(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.58.2",
3
+ "version": "0.59.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {