@diffin/cli 0.1.0 → 0.1.2
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/lib/backfill.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import { ensureInit } from './init.mjs';
|
|
|
16
16
|
import { watchAll, watchJourney } from './watch.mjs';
|
|
17
17
|
import { journey } from './journey.mjs';
|
|
18
18
|
import { machineHash } from './machine.mjs';
|
|
19
|
-
import { ALL_LOOKBACK_MS, withoutIgnored, excludeFolders, excludedFrom, allowFolders, allowedFrom, folderCensus, folderTree } from './ignore.mjs';
|
|
19
|
+
import { ALL_LOOKBACK_MS, withoutIgnored, excludeFolders, excludedFrom, excludedFolders, allowFolders, allowedFolders, allowedFrom, folderCensus, folderTree } from './ignore.mjs';
|
|
20
20
|
import { deviceId, foldersAsked, markFoldersAsked } from './state.mjs';
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -128,6 +128,22 @@ async function chooseFolders(plans, { ask, title = '올릴 폴더', note = '작
|
|
|
128
128
|
return { cancelled: false, excluded };
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
/**
|
|
132
|
+
* The lists the person just picked, told to the server at once (2026-10-12): the app's folder screen read empty after
|
|
133
|
+
* the first production onboarding, because only a capture reported folders. Names only — the same two fields a
|
|
134
|
+
* capture sends (`syncFolders` in capture.mjs) — and no `held`: onboarding does not look for held folders, and the
|
|
135
|
+
* server leaves its waiting list alone when the field is absent. A machine with no list yet (a pipe, `--yes`) has
|
|
136
|
+
* nothing to say; and nothing here may stop a backfill — no network, or an older server, leaves it for the next capture.
|
|
137
|
+
*/
|
|
138
|
+
export async function reportFolders(token) {
|
|
139
|
+
const allowed = allowedFolders();
|
|
140
|
+
if (allowed === null) return false;
|
|
141
|
+
try {
|
|
142
|
+
const res = await fetchRetry(`${SERVER}/folders/held`, () => ({ method: 'POST', headers: { authorization: `Bearer ${token}`, 'content-type': 'application/json' }, body: JSON.stringify({ device: deviceId(), allowed: allowed.map((f) => posixPath(scrub(f))), excluded: excludedFolders().map((f) => posixPath(scrub(f))) }) }), 1);
|
|
143
|
+
return res.ok;
|
|
144
|
+
} catch { return false; }
|
|
145
|
+
}
|
|
146
|
+
|
|
131
147
|
export async function backfill(argv = []) {
|
|
132
148
|
const noWait = argv.includes('--no-wait');
|
|
133
149
|
const vals = (name) => argv.reduce((a, x, i) => (x === name && argv[i + 1] ? [...a, argv[i + 1]] : a), []);
|
|
@@ -209,6 +225,8 @@ export async function backfill(argv = []) {
|
|
|
209
225
|
const kept = await chooseFolders(recent, { ask: true, title: '기록할 폴더', note: '이 기기에서 최근 작업한 폴더입니다. 앞으로 기록하지 않을 폴더는 선택을 해제하세요.', unit: '기록' });
|
|
210
226
|
if (kept.excluded.length) stepSkip('제외한 폴더', kept.excluded.map((f) => posixPath(scrub(f))).join(' · '), dim('이 기기에서 기록하지 않습니다 · 되돌리려면 diffin include <폴더>'));
|
|
211
227
|
}
|
|
228
|
+
// the allow and deny lists as they stand now, so the app shows them before the first capture
|
|
229
|
+
await reportFolders(token);
|
|
212
230
|
|
|
213
231
|
// What a person watches is FILES, not sessions. One Claude Code session carries its own transcript and every
|
|
214
232
|
// subagent's — measured, 3 sessions were 638 files — so a counter that moves once per session sat still for minutes
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: capture
|
|
3
|
-
description: Records the work of every agent session on this machine to diffin (the AI-work ledger). Run `diffin capture` at the end of ANY turn in which a step of work got done
|
|
3
|
+
description: "Records the work of every agent session on this machine to diffin (the AI-work ledger). Run `diffin capture` at the end of ANY turn in which a step of work got done, in any kind of work, not only code. A step is done when (1) something left the person's hands (sent, submitted, published, shared, exported, committed, merged, deployed); (2) a version was accepted (a draft, design, plan or fix the person said yes to); (3) a question got its answer (research, comparison, diagnosis the person will act on); (4) a direction was decided; (5) the person wrapped up or moved on. Outside code: an email ready to send, a report section finished, a deck shared, an analysis answered. Always when the user says \"기록해\", \"캡처해\", \"record this\", \"capture\". The bar is low: when unsure, run it. The command ends a call that comes too soon without sending, so an extra call costs nothing and a missed one loses the record. A failed call never ends capturing: run it again at the next step. Runs alone, no confirmation."
|
|
4
4
|
license: Proprietary. Part of the diffin CLI.
|
|
5
5
|
compatibility: Requires the diffin CLI on PATH (`npx @diffin/cli onboard` installs it; or npm i -g @diffin/cli), signed in once with `diffin login`, and network access to the diffin server. Reads the agent session transcripts on this machine — every session that moved since it was last recorded. Capture supports Claude Code, Codex, Antigravity and Hermes sessions; under other agents the command says so.
|
|
6
6
|
allowed-tools: Bash(diffin capture:*)
|
|
7
7
|
metadata:
|
|
8
8
|
author: diffin
|
|
9
|
-
version: "3.
|
|
9
|
+
version: "3.14"
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
# Capture (diffin)
|
|
@@ -96,6 +96,11 @@ Then one short line at most, and stop:
|
|
|
96
96
|
| a daily limit | nothing — tomorrow |
|
|
97
97
|
| anything else | show the message once; do not retry |
|
|
98
98
|
|
|
99
|
+
"Do not retry" is about THAT call, never about the session. A capture that failed, crashed or was refused does not
|
|
100
|
+
end capturing here: at the next finished step, run `diffin capture` again as if nothing had happened — the cause may
|
|
101
|
+
already be fixed, and the command decides for itself whether it may send. Do not leave capturing to another session,
|
|
102
|
+
another agent or the person because one call failed.
|
|
103
|
+
|
|
99
104
|
## Never
|
|
100
105
|
|
|
101
106
|
- Write, edit or summarise the record yourself — the server extracts it.
|