flowcollab 0.1.1 → 0.1.3

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.
package/bin/_client.mjs CHANGED
@@ -55,8 +55,22 @@ export async function flowFetch(path, { method = 'GET', body } = {}) {
55
55
  return parsed;
56
56
  }
57
57
 
58
+ export const RESOLVED_BASE = DEFAULT_BASE;
59
+ export const RESOLVED_ACTOR = process.env.FLOW_DEFAULT_ASSIGNEE || _gc.actorId || '';
60
+ export function resolvedTokenDisplay() {
61
+ const raw = envToken();
62
+ if (!raw) return '(none — run `flow-login`)';
63
+ return '*'.repeat(Math.max(0, raw.length - 4)) + raw.slice(-4);
64
+ }
65
+ export function resolvedTokenSource() {
66
+ if (process.env.FLOW_API_TOKEN_OWNER) return 'env (owner)';
67
+ if (process.env.FLOW_API_TOKEN_CONTRIBUTOR) return 'env (contributor)';
68
+ if (_gc.token) return 'flow-login';
69
+ return 'none';
70
+ }
71
+
58
72
  export function die(msg, code = 1) {
59
- process.stderr.write(`flow-cli: ${msg}\n`);
73
+ process.stderr.write(`flow: ${msg}\n`);
60
74
  process.exit(code);
61
75
  }
62
76
 
package/bin/pull.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  /* flow:pull — fetch tasks + decisions + recent timeline and print a Claude-ready summary.
3
3
 
4
4
  Usage:
5
- flow-pull # respects FLOW_DEFAULT_ASSIGNEE env
5
+ flow-pull # actor from ~/.flow/config.json or FLOW_DEFAULT_ASSIGNEE env
6
6
  flow-pull --assignee=nate # explicit filter
7
7
  flow-pull --assignee=all # unfiltered (full board)
8
8
 
@@ -12,7 +12,7 @@
12
12
  3. Recent timeline activity on YOUR tasks (last 5 per task)
13
13
  */
14
14
 
15
- import { flowFetch, arg } from './_client.mjs';
15
+ import { flowFetch, arg, RESOLVED_ACTOR } from './_client.mjs';
16
16
  import { existsSync, writeFileSync } from 'fs';
17
17
  import { join } from 'path';
18
18
 
@@ -94,8 +94,7 @@ function mentionRegex(assignee) {
94
94
 
95
95
  async function main() {
96
96
  const explicit = arg('assignee');
97
- const envDefault = process.env.FLOW_DEFAULT_ASSIGNEE || '';
98
- const filterAssignee = explicit === 'all' ? '' : (explicit || envDefault);
97
+ const filterAssignee = explicit === 'all' ? '' : (explicit || RESOLVED_ACTOR);
99
98
  const focusMode = arg('focus') !== undefined;
100
99
  const filterMilestone = arg('milestone') || '';
101
100
 
@@ -121,7 +120,7 @@ async function main() {
121
120
 
122
121
  // 0. Active agents — other agents heartbeating right now
123
122
  if (presenceRes?.agents?.length) {
124
- const myActorId = process.env.FLOW_TOKEN_OWNER_ACTOR || process.env.FLOW_TOKEN_CONTRIBUTOR_ACTOR || '';
123
+ const myActorId = RESOLVED_ACTOR;
125
124
  const others = presenceRes.agents.filter(a => a.actor_id !== myActorId);
126
125
  if (others.length) {
127
126
  out.push(`[active agents — ${others.length} other${others.length === 1 ? '' : 's'} online]`);
package/bin/standup.mjs CHANGED
@@ -9,7 +9,7 @@
9
9
  flow-standup --velocity # include week-over-week velocity (last 4 weeks)
10
10
  */
11
11
 
12
- import { flowFetch, arg } from './_client.mjs';
12
+ import { flowFetch, arg, RESOLVED_ACTOR } from './_client.mjs';
13
13
 
14
14
  function sanitizeText(s, maxLen = 200) {
15
15
  if (!s || typeof s !== 'string') return '';
@@ -42,7 +42,7 @@ async function main() {
42
42
  const decisions = decRes.decisions || [];
43
43
  const agents = presenceRes?.agents || [];
44
44
  const taskById = new Map(tasks.map(t => [t.id, t]));
45
- const myId = process.env.FLOW_TOKEN_OWNER_ACTOR || process.env.FLOW_TOKEN_CONTRIBUTOR_ACTOR || '';
45
+ const myId = RESOLVED_ACTOR;
46
46
 
47
47
  // Done since N hours — de-dup by task (most recent close per task)
48
48
  const doneEvents = timeline
package/bin/sync.mjs CHANGED
@@ -9,7 +9,7 @@
9
9
  flow-sync --since=30 # last 30 minutes
10
10
  */
11
11
 
12
- import { flowFetch, arg } from './_client.mjs';
12
+ import { flowFetch, arg, RESOLVED_ACTOR } from './_client.mjs';
13
13
 
14
14
  // Same sanitizer as pull.mjs — keep parity for injection defense.
15
15
  function sanitizeText(s, maxLen = 400) {
@@ -42,7 +42,7 @@ async function main() {
42
42
 
43
43
  // Active agents
44
44
  if (r.agents?.length) {
45
- const myId = process.env.FLOW_TOKEN_OWNER_ACTOR || process.env.FLOW_TOKEN_CONTRIBUTOR_ACTOR || '';
45
+ const myId = RESOLVED_ACTOR;
46
46
  const others = r.agents.filter(a => a.actor_id !== myId);
47
47
  if (others.length) {
48
48
  out.push(`\n[active agents — ${others.length} online]`);
package/bin/whoami.mjs CHANGED
@@ -1,29 +1,18 @@
1
1
  #!/usr/bin/env node
2
- /* flow:whoami — print current session identity and verify API connectivity.
2
+ /* flow-whoami — print current session identity and verify API connectivity.
3
3
  Usage: flow-whoami
4
- Run at session start to confirm you're acting as the right actor with a live token.
5
4
  */
6
5
 
7
- import 'dotenv/config';
8
- import { flowFetch } from './_client.mjs';
6
+ import { flowFetch, RESOLVED_BASE, RESOLVED_ACTOR, resolvedTokenDisplay, resolvedTokenSource } from './_client.mjs';
9
7
 
10
8
  async function main() {
11
- const actor = process.env.FLOW_DEFAULT_ASSIGNEE || '(not set — add FLOW_DEFAULT_ASSIGNEE to .env)';
12
- const base = process.env.FLOW_API_BASE || 'http://localhost:3000';
9
+ const actor = RESOLVED_ACTOR || '(not set — run flow-login)';
13
10
  const actingVia = (process.env.FLOW_ACTING_VIA || 'claude').toLowerCase();
14
11
 
15
- const ownerToken = process.env.FLOW_API_TOKEN_OWNER || '';
16
- const contribToken = process.env.FLOW_API_TOKEN_CONTRIBUTOR || '';
17
- const tokenKind = ownerToken ? 'owner' : contribToken ? 'contributor' : 'none';
18
- const rawToken = ownerToken || contribToken;
19
- const tokenDisplay = rawToken.length > 4
20
- ? `${'*'.repeat(rawToken.length - 4)}${rawToken.slice(-4)}`
21
- : rawToken ? '****' : '(missing)';
22
-
23
12
  process.stdout.write('Flow identity:\n');
24
13
  process.stdout.write(` actor: ${actor}\n`);
25
- process.stdout.write(` token: ${tokenKind} ${tokenDisplay}\n`);
26
- process.stdout.write(` api_base: ${base}\n`);
14
+ process.stdout.write(` token: ${resolvedTokenSource()} ${resolvedTokenDisplay()}\n`);
15
+ process.stdout.write(` server: ${RESOLVED_BASE}\n`);
27
16
  process.stdout.write(` acting_via: ${actingVia}\n`);
28
17
 
29
18
  try {
@@ -36,4 +25,4 @@ async function main() {
36
25
  }
37
26
  }
38
27
 
39
- main().catch(e => { process.stderr.write('flow-cli: ' + (e.message || e) + '\n'); process.exit(1); });
28
+ main().catch(e => { process.stderr.write('flow-whoami: ' + (e.message || e) + '\n'); process.exit(1); });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowcollab",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Multi-Claude coordination layer — shared task board + CLI for teams running Claude Code",
5
5
  "type": "module",
6
6
  "files": [