@nessielabs/daemon 0.5.26 → 0.5.27
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/dist/commands/login.js +23 -1
- package/package.json +1 -1
package/dist/commands/login.js
CHANGED
|
@@ -6,6 +6,13 @@ import { openBrowser } from "../platform/openBrowser.js";
|
|
|
6
6
|
import { service } from "./service.js";
|
|
7
7
|
import { enableCloudSyncForTeam } from "./teams.js";
|
|
8
8
|
import { applyTeamPoliciesForRuntime } from "./sharing.js";
|
|
9
|
+
const HEADLESS_DEFAULT_SOURCES = [
|
|
10
|
+
{ kind: "claude_code", displayName: "Claude Code", basePath: "~/.claude" },
|
|
11
|
+
{ kind: "codex", displayName: "Codex", basePath: "~/.codex" },
|
|
12
|
+
{ kind: "cursor", displayName: "Cursor", basePath: "~/.cursor" },
|
|
13
|
+
{ kind: "claude_cowork", displayName: "Claude Cowork", basePath: "~/Library/Application Support/Claude/local-agent-mode-sessions" },
|
|
14
|
+
{ kind: "pi", displayName: "Pi", basePath: "~/.pi" },
|
|
15
|
+
];
|
|
9
16
|
export async function login(options) {
|
|
10
17
|
const runtime = await ensureRuntime({ detached: true });
|
|
11
18
|
if (runtime.started)
|
|
@@ -102,7 +109,10 @@ async function handleTeamInvites(runtime) {
|
|
|
102
109
|
await enableCloudSyncForTeam(runtime, joinedTeamId);
|
|
103
110
|
}
|
|
104
111
|
async function configureSources(runtime, options) {
|
|
105
|
-
const
|
|
112
|
+
const existingSources = await listSources(runtime);
|
|
113
|
+
const sources = options.nonInteractive
|
|
114
|
+
? headlessSetupSources(existingSources.sources)
|
|
115
|
+
: (await discoverSources(runtime)).sources;
|
|
106
116
|
const enabledSources = new Set(existingSources.sources.filter((source) => source.enabled).map((source) => `${source.kind}:${source.basePath}`));
|
|
107
117
|
if (sources.length === 0) {
|
|
108
118
|
console.log("No supported local data integrations were found.");
|
|
@@ -122,6 +132,18 @@ async function configureSources(runtime, options) {
|
|
|
122
132
|
? `Enabled ${changed.length} integration(s) (${alreadyEnabled} already enabled).`
|
|
123
133
|
: `Enabled ${changed.length} integration(s).`);
|
|
124
134
|
}
|
|
135
|
+
export function headlessSetupSources(existingSources) {
|
|
136
|
+
const existingByKind = new Map(existingSources.map((source) => [source.kind, source]));
|
|
137
|
+
return HEADLESS_DEFAULT_SOURCES.map((source) => {
|
|
138
|
+
const existing = existingByKind.get(source.kind);
|
|
139
|
+
return {
|
|
140
|
+
kind: source.kind,
|
|
141
|
+
displayName: existing?.displayName ?? source.displayName,
|
|
142
|
+
basePath: existing?.basePath ?? source.basePath,
|
|
143
|
+
alreadyAdded: existing !== undefined,
|
|
144
|
+
};
|
|
145
|
+
});
|
|
146
|
+
}
|
|
125
147
|
/** Fast path first: ingest everything detected; the checkbox is opt-in friction. */
|
|
126
148
|
async function selectSources(sources, enabledSources) {
|
|
127
149
|
for (const source of sources) {
|