ultraclaude-agent 0.0.21 → 0.0.23
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/__tests__/daemon-reconcile.test.ts +1 -0
- package/__tests__/daemon.test.ts +1 -0
- package/__tests__/hide-branches.test.ts +129 -0
- package/__tests__/logger-multistream.test.ts +151 -0
- package/__tests__/repl-reset.test.ts +3 -0
- package/__tests__/repl-status-account.test.ts +3 -0
- package/__tests__/repl.test.ts +7 -2
- package/__tests__/snapshot-sync.test.ts +6 -6
- package/__tests__/status-command.test.ts +479 -0
- package/__tests__/status-service-type.test.ts +177 -0
- package/__tests__/sync-bugs.test.ts +8 -7
- package/__tests__/sync-queue-credentials.test.ts +4 -4
- package/__tests__/sync-reorder.test.ts +8 -8
- package/__tests__/sync.test.ts +4 -3
- package/__tests__/version-check.test.ts +1 -1
- package/__tests__/version-watcher.test.ts +8 -2
- package/__tests__/watcher-branch.test.ts +68 -0
- package/dist/cli.js +6 -96
- package/dist/cli.js.map +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +3 -70
- package/dist/daemon.js.map +1 -1
- package/dist/repl.d.ts.map +1 -1
- package/dist/repl.js +6 -143
- package/dist/repl.js.map +1 -1
- package/dist/sync.d.ts +13 -8
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +45 -21
- package/dist/sync.js.map +1 -1
- package/dist/watcher.d.ts +6 -0
- package/dist/watcher.d.ts.map +1 -1
- package/dist/watcher.js +92 -7
- package/dist/watcher.js.map +1 -1
- package/node_modules/@ultra-claude/shared/dist/api/schemas/projects.d.ts +11 -0
- package/node_modules/@ultra-claude/shared/dist/api/schemas/projects.d.ts.map +1 -1
- package/node_modules/@ultra-claude/shared/dist/api/schemas/projects.js +8 -0
- package/node_modules/@ultra-claude/shared/dist/api/schemas/projects.js.map +1 -1
- package/node_modules/@ultra-claude/shared/dist/api/schemas/sync.d.ts +11 -0
- package/node_modules/@ultra-claude/shared/dist/api/schemas/sync.d.ts.map +1 -1
- package/node_modules/@ultra-claude/shared/dist/api/schemas/sync.js +11 -0
- package/node_modules/@ultra-claude/shared/dist/api/schemas/sync.js.map +1 -1
- package/node_modules/@ultra-claude/shared/dist/index.d.ts +3 -3
- package/node_modules/@ultra-claude/shared/dist/index.d.ts.map +1 -1
- package/node_modules/@ultra-claude/shared/dist/index.js +2 -2
- package/node_modules/@ultra-claude/shared/dist/index.js.map +1 -1
- package/node_modules/@ultra-claude/shared/dist/types.d.ts +0 -32
- package/node_modules/@ultra-claude/shared/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cli.ts +6 -120
- package/src/daemon.ts +3 -82
- package/src/repl.ts +6 -166
- package/src/sync.ts +56 -14
- package/src/watcher.ts +101 -7
- package/__tests__/claude-profiles-ops.test.ts +0 -441
- package/__tests__/claude-profiles.test.ts +0 -407
- package/__tests__/credential-watcher.test.ts +0 -229
- package/dist/claude-profiles.d.ts +0 -83
- package/dist/claude-profiles.d.ts.map +0 -1
- package/dist/claude-profiles.js +0 -499
- package/dist/claude-profiles.js.map +0 -1
- package/src/claude-profiles.ts +0 -597
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../../src/api/schemas/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAE/C,MAAM,QAAQ,GAAG,CAAC;KACf,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,GAAG,CAAC;KACR,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,4BAA4B,CAAC;KAC9D,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,4BAA4B,CAAC,CAAC;AA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,CAAC,CAAC,MAAM,CAAC;IACtC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC5B,MAAM,EAAE,UAAU;IAClB,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;CACzC,CAAC,CAAC;AAIH,qCAAqC;AAErC,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC5B,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;CAC9D,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { createProjectSchema, updateProjectSchema, moveProjectSchema, type CreateProjectInput, type UpdateProjectInput, type MoveProjectInput, } from './api/schemas/projects.js';
|
|
2
|
-
export { syncSectionsSchema, sectionItemSchema, syncFilesSchema, syncFileItemSchema, createSnapshotSchema, deleteFilesSchema, reconcileSchema, type SyncSectionsInput, type SectionItem, type SyncFilesInput, type CreateSnapshotInput, type DeleteFilesInput, type ReconcileInput, } from './api/schemas/sync.js';
|
|
1
|
+
export { createProjectSchema, updateProjectSchema, moveProjectSchema, branchListItemSchema, branchListResponseSchema, type CreateProjectInput, type UpdateProjectInput, type MoveProjectInput, type BranchListResponse, } from './api/schemas/projects.js';
|
|
2
|
+
export { branchName, syncSectionsSchema, sectionItemSchema, syncFilesSchema, syncFileItemSchema, createSnapshotSchema, deleteFilesSchema, reconcileSchema, branchHideRequestSchema, type SyncSectionsInput, type SectionItem, type SyncFilesInput, type CreateSnapshotInput, type DeleteFilesInput, type BranchHideRequestInput, type ReconcileInput, } from './api/schemas/sync.js';
|
|
3
3
|
export { computeContentHash, verifyContentHash } from './hashing.js';
|
|
4
4
|
export { parseMarkdownSections, generateSlug } from './sections.js';
|
|
5
|
-
export type { SectionData, ManifestEntry, ProjectRegistryEntry, ProjectRegistry, AgentCredentials,
|
|
5
|
+
export type { SectionData, ManifestEntry, ProjectRegistryEntry, ProjectRegistry, AgentCredentials, } from './types.js';
|
|
6
6
|
export { ok, err, type Result } from './result.js';
|
|
7
7
|
export { createCommentSchema, commentResponseSchema, discussionResponseSchema, discussionCountsResponseSchema, type CreateCommentInput, type CommentResponse, type DiscussionResponse, type DiscussionCountsResponse, } from './api/schemas/discussions.js';
|
|
8
8
|
export { syncUsageRequestSchema, syncUsageAccountSchema, type SyncUsageRequest, type SyncUsageAccount, type UsageAccount, } from './api/schemas/usage.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,GACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEpE,YAAY,EACV,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,8BAA8B,EAC9B,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,GAC9B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,6BAA6B,EAC7B,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,uBAAuB,GAC7B,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @ultra-claude/shared — shared types, API contracts, block parsing
|
|
2
|
-
export { createProjectSchema, updateProjectSchema, moveProjectSchema, } from './api/schemas/projects.js';
|
|
3
|
-
export { syncSectionsSchema, sectionItemSchema, syncFilesSchema, syncFileItemSchema, createSnapshotSchema, deleteFilesSchema, reconcileSchema, } from './api/schemas/sync.js';
|
|
2
|
+
export { createProjectSchema, updateProjectSchema, moveProjectSchema, branchListItemSchema, branchListResponseSchema, } from './api/schemas/projects.js';
|
|
3
|
+
export { branchName, syncSectionsSchema, sectionItemSchema, syncFilesSchema, syncFileItemSchema, createSnapshotSchema, deleteFilesSchema, reconcileSchema, branchHideRequestSchema, } from './api/schemas/sync.js';
|
|
4
4
|
export { computeContentHash, verifyContentHash } from './hashing.js';
|
|
5
5
|
export { parseMarkdownSections, generateSlug } from './sections.js';
|
|
6
6
|
export { ok, err } from './result.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,GAKzB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,uBAAuB,GAQxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAUpE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAe,MAAM,aAAa,CAAC;AAEnD,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,8BAA8B,GAK/B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GAIvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,6BAA6B,GAM9B,MAAM,4BAA4B,CAAC"}
|
|
@@ -38,36 +38,4 @@ export interface AgentCredentials {
|
|
|
38
38
|
/** User's email address (for display). Missing on migrated accounts. */
|
|
39
39
|
email?: string;
|
|
40
40
|
}
|
|
41
|
-
/** OAuth credentials structure from ~/.claude/.credentials.json */
|
|
42
|
-
export interface ClaudeOAuthCredentials {
|
|
43
|
-
claudeAiOauth: {
|
|
44
|
-
accessToken: string;
|
|
45
|
-
refreshToken: string;
|
|
46
|
-
expiresAt: number;
|
|
47
|
-
scopes: string[];
|
|
48
|
-
subscriptionType: string;
|
|
49
|
-
rateLimitTier: string;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
/** A saved Claude Code credential profile */
|
|
53
|
-
export interface ClaudeProfile {
|
|
54
|
-
name: string;
|
|
55
|
-
email: string;
|
|
56
|
-
orgName: string;
|
|
57
|
-
subscriptionType: string;
|
|
58
|
-
savedAt: string;
|
|
59
|
-
credentials: ClaudeOAuthCredentials;
|
|
60
|
-
}
|
|
61
|
-
/** Active profile tracker in active.json */
|
|
62
|
-
export interface ClaudeProfileActive {
|
|
63
|
-
profile: string;
|
|
64
|
-
switchedAt: string;
|
|
65
|
-
}
|
|
66
|
-
/** Identity info returned by `claude auth status` */
|
|
67
|
-
export interface ClaudeAuthIdentity {
|
|
68
|
-
email: string;
|
|
69
|
-
orgName: string;
|
|
70
|
-
subscriptionType: string;
|
|
71
|
-
loggedIn: boolean;
|
|
72
|
-
}
|
|
73
41
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,0DAA0D;AAC1D,MAAM,WAAW,WAAW;IAC1B,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,uFAAuF;IACvF,OAAO,EAAE,MAAM,CAAC;IAChB,m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AAC;CACd;AAED,iDAAiD;AACjD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,oBAAoB,EAAE,CAAC;CAClC;AAED,kFAAkF;AAClF,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -22,17 +22,8 @@ import { login } from './auth.js';
|
|
|
22
22
|
import { startDaemon, forkDaemon, getDaemonStatus } from './daemon.js';
|
|
23
23
|
import { installService, isServiceInstalled, getServiceType } from './service.js';
|
|
24
24
|
import { initialSync, createSnapshot as createSnapshotOnServer } from './sync.js';
|
|
25
|
+
import { getCurrentBranch } from './watcher.js';
|
|
25
26
|
import { startRepl } from './repl.js';
|
|
26
|
-
import {
|
|
27
|
-
listProfiles,
|
|
28
|
-
switchProfile,
|
|
29
|
-
loginProfile,
|
|
30
|
-
saveCurrentAsProfile,
|
|
31
|
-
deleteProfileByName,
|
|
32
|
-
getClaudeStatus,
|
|
33
|
-
getExpiryStatus,
|
|
34
|
-
loadActiveProfile,
|
|
35
|
-
} from './claude-profiles.js';
|
|
36
27
|
import { logger, initMultistreamLogger } from './logger.js';
|
|
37
28
|
import type { AgentCredentials } from '@ultra-claude/shared';
|
|
38
29
|
|
|
@@ -404,8 +395,9 @@ program
|
|
|
404
395
|
continue;
|
|
405
396
|
}
|
|
406
397
|
|
|
407
|
-
|
|
408
|
-
|
|
398
|
+
const branch = getCurrentBranch(project.path);
|
|
399
|
+
console.log(`Pushing ${project.name} (branch: ${branch})...`);
|
|
400
|
+
await initialSync(projectId, project.path, creds, branch);
|
|
409
401
|
console.log(`Done: ${project.name}`);
|
|
410
402
|
}
|
|
411
403
|
});
|
|
@@ -448,7 +440,8 @@ program
|
|
|
448
440
|
continue;
|
|
449
441
|
}
|
|
450
442
|
|
|
451
|
-
const
|
|
443
|
+
const branch = getCurrentBranch(project.path);
|
|
444
|
+
const success = await createSnapshotOnServer(projectId, label, branch, undefined, undefined, creds);
|
|
452
445
|
if (success) {
|
|
453
446
|
console.log(`Snapshot "${label}" created for ${project.name}`);
|
|
454
447
|
} else {
|
|
@@ -516,111 +509,4 @@ program
|
|
|
516
509
|
|
|
517
510
|
// unlink removed — projects are auto-discovered from ~/.claude/projects/
|
|
518
511
|
|
|
519
|
-
// --- claude-profile ---
|
|
520
|
-
|
|
521
|
-
const claudeProfile = program
|
|
522
|
-
.command('claude-profile')
|
|
523
|
-
.description('Manage Claude Code credential profiles');
|
|
524
|
-
|
|
525
|
-
claudeProfile
|
|
526
|
-
.command('list')
|
|
527
|
-
.description('List all saved Claude credential profiles')
|
|
528
|
-
.action(async () => {
|
|
529
|
-
const profiles = await listProfiles();
|
|
530
|
-
if (profiles.length === 0) {
|
|
531
|
-
console.log('No saved Claude profiles.');
|
|
532
|
-
return;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
const active = await loadActiveProfile();
|
|
536
|
-
|
|
537
|
-
console.log('');
|
|
538
|
-
console.log(
|
|
539
|
-
' ' +
|
|
540
|
-
'Name'.padEnd(16) +
|
|
541
|
-
'Email'.padEnd(30) +
|
|
542
|
-
'Org'.padEnd(16) +
|
|
543
|
-
'Subscription'.padEnd(14) +
|
|
544
|
-
'Active'.padEnd(8) +
|
|
545
|
-
'Token',
|
|
546
|
-
);
|
|
547
|
-
console.log(' ' + '-'.repeat(90));
|
|
548
|
-
|
|
549
|
-
for (const profile of profiles) {
|
|
550
|
-
const isActive = active?.profile === profile.name;
|
|
551
|
-
const expiry = getExpiryStatus(profile);
|
|
552
|
-
console.log(
|
|
553
|
-
' ' +
|
|
554
|
-
profile.name.padEnd(16) +
|
|
555
|
-
profile.email.padEnd(30) +
|
|
556
|
-
(profile.orgName || '-').padEnd(16) +
|
|
557
|
-
(profile.subscriptionType || '-').padEnd(14) +
|
|
558
|
-
(isActive ? '*' : '').padEnd(8) +
|
|
559
|
-
expiry.label,
|
|
560
|
-
);
|
|
561
|
-
}
|
|
562
|
-
console.log('');
|
|
563
|
-
});
|
|
564
|
-
|
|
565
|
-
claudeProfile
|
|
566
|
-
.command('switch')
|
|
567
|
-
.argument('<name>', 'Profile name to switch to')
|
|
568
|
-
.description('Switch to a saved Claude credential profile')
|
|
569
|
-
.action(async (name: string) => {
|
|
570
|
-
const result = await switchProfile(name);
|
|
571
|
-
console.log(result.message);
|
|
572
|
-
process.exitCode = result.success ? 0 : 1;
|
|
573
|
-
});
|
|
574
|
-
|
|
575
|
-
claudeProfile
|
|
576
|
-
.command('login')
|
|
577
|
-
.argument('<name>', 'Profile name to save as')
|
|
578
|
-
.option('--email <email>', 'Pre-populate login email')
|
|
579
|
-
.description('Open browser login and save as named profile')
|
|
580
|
-
.action(async (name: string, options: { email?: string }) => {
|
|
581
|
-
const result = await loginProfile(name, options.email);
|
|
582
|
-
console.log(result.message);
|
|
583
|
-
process.exitCode = result.success ? 0 : 1;
|
|
584
|
-
});
|
|
585
|
-
|
|
586
|
-
claudeProfile
|
|
587
|
-
.command('save')
|
|
588
|
-
.argument('<name>', 'Profile name')
|
|
589
|
-
.description('Save current credentials as a named profile')
|
|
590
|
-
.action(async (name: string) => {
|
|
591
|
-
const result = await saveCurrentAsProfile(name);
|
|
592
|
-
console.log(result.message);
|
|
593
|
-
process.exitCode = result.success ? 0 : 1;
|
|
594
|
-
});
|
|
595
|
-
|
|
596
|
-
claudeProfile
|
|
597
|
-
.command('delete')
|
|
598
|
-
.argument('<name>', 'Profile name to delete')
|
|
599
|
-
.description('Delete a saved credential profile')
|
|
600
|
-
.action(async (name: string) => {
|
|
601
|
-
const result = await deleteProfileByName(name);
|
|
602
|
-
if (result.wasActive) {
|
|
603
|
-
console.log(`Warning: "${name}" was the active profile.`);
|
|
604
|
-
}
|
|
605
|
-
console.log(result.message);
|
|
606
|
-
process.exitCode = result.success ? 0 : 1;
|
|
607
|
-
});
|
|
608
|
-
|
|
609
|
-
claudeProfile
|
|
610
|
-
.command('status')
|
|
611
|
-
.description('Show current Claude auth status')
|
|
612
|
-
.action(async () => {
|
|
613
|
-
const result = await getClaudeStatus();
|
|
614
|
-
if (!result.success) {
|
|
615
|
-
console.log(result.message);
|
|
616
|
-
process.exitCode = 1;
|
|
617
|
-
return;
|
|
618
|
-
}
|
|
619
|
-
const id = result.identity!;
|
|
620
|
-
console.log(`Email: ${id.email}`);
|
|
621
|
-
console.log(`Org: ${id.orgName || '-'}`);
|
|
622
|
-
console.log(`Subscription: ${id.subscriptionType || '-'}`);
|
|
623
|
-
console.log(`Logged in: ${id.loggedIn ? 'yes' : 'no'}`);
|
|
624
|
-
});
|
|
625
|
-
|
|
626
512
|
await program.parseAsync(process.argv);
|
package/src/daemon.ts
CHANGED
|
@@ -24,13 +24,12 @@ import {
|
|
|
24
24
|
setProjectAccount,
|
|
25
25
|
getDefaultAccount,
|
|
26
26
|
} from './config.js';
|
|
27
|
-
import { startProjectWatcher, type ProjectWatcher } from './watcher.js';
|
|
27
|
+
import { startProjectWatcher, getCurrentBranch, type ProjectWatcher } from './watcher.js';
|
|
28
28
|
import { createProjectOnServer, initialSync, fetchManifest, stopSync, pushVersionMetadata } from './sync.js';
|
|
29
29
|
import { startUsageWatcher, type UsageWatcher } from './usage-sync.js';
|
|
30
30
|
import { startStatusLoop, readStatusFile, removeStatusFile, type StatusLoop, type StatusFileData } from './status.js';
|
|
31
31
|
import { isServiceActive } from './service.js';
|
|
32
32
|
import * as socketClient from './socket-client.js';
|
|
33
|
-
import { CREDENTIALS_FILE, handleCredentialChange, pruneBackups } from './claude-profiles.js';
|
|
34
33
|
import { logger } from './logger.js';
|
|
35
34
|
import { ok, err, type Result, type AgentCredentials } from '@ultra-claude/shared';
|
|
36
35
|
import type { ProjectRegistryEntry } from '@ultra-claude/shared';
|
|
@@ -93,11 +92,6 @@ let registryWatcher: ReturnType<typeof chokidar.watch> | null = null;
|
|
|
93
92
|
let discoveryTimer: ReturnType<typeof setInterval> | null = null;
|
|
94
93
|
let versionWatcherTimer: ReturnType<typeof setInterval> | null = null;
|
|
95
94
|
let usageWatcher: UsageWatcher | null = null;
|
|
96
|
-
interface CredentialWatcher {
|
|
97
|
-
close(): Promise<void>;
|
|
98
|
-
}
|
|
99
|
-
let credentialWatcher: CredentialWatcher | null = null;
|
|
100
|
-
let credentialPruneTimer: ReturnType<typeof setInterval> | null = null;
|
|
101
95
|
let statusLoop: StatusLoop | null = null;
|
|
102
96
|
let running = false;
|
|
103
97
|
let daemonStartedAt: string | null = null;
|
|
@@ -199,19 +193,6 @@ export async function startDaemon(): Promise<Result<void, StartDaemonError>> {
|
|
|
199
193
|
// Start global usage watcher (watches ~/.claude/ultra/ for usage-status.json and accounts/)
|
|
200
194
|
usageWatcher = startUsageWatcher();
|
|
201
195
|
|
|
202
|
-
// Start credential watcher for Claude Code profiles
|
|
203
|
-
credentialWatcher = startCredentialWatcher();
|
|
204
|
-
|
|
205
|
-
// Prune old credential backups on startup, then daily
|
|
206
|
-
pruneBackups().catch((pruneErr: unknown) => {
|
|
207
|
-
log.error({ err: pruneErr }, 'Initial backup prune failed');
|
|
208
|
-
});
|
|
209
|
-
credentialPruneTimer = setInterval(() => {
|
|
210
|
-
pruneBackups().catch((pruneErr: unknown) => {
|
|
211
|
-
log.error({ err: pruneErr }, 'Daily backup prune failed');
|
|
212
|
-
});
|
|
213
|
-
}, 24 * 60 * 60 * 1000);
|
|
214
|
-
|
|
215
196
|
// Load initial registry and start watchers
|
|
216
197
|
const registry = await loadRegistry();
|
|
217
198
|
log.info({ projectCount: registry.projects.length }, 'Registry loaded');
|
|
@@ -286,16 +267,6 @@ export async function stopDaemon(): Promise<void> {
|
|
|
286
267
|
usageWatcher = null;
|
|
287
268
|
}
|
|
288
269
|
|
|
289
|
-
// Close credential watcher and prune timer
|
|
290
|
-
if (credentialWatcher) {
|
|
291
|
-
await credentialWatcher.close();
|
|
292
|
-
credentialWatcher = null;
|
|
293
|
-
}
|
|
294
|
-
if (credentialPruneTimer) {
|
|
295
|
-
clearInterval(credentialPruneTimer);
|
|
296
|
-
credentialPruneTimer = null;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
270
|
// Close registry watcher
|
|
300
271
|
if (registryWatcher) {
|
|
301
272
|
await registryWatcher.close();
|
|
@@ -389,7 +360,8 @@ async function ensureProject(entry: ProjectRegistryEntry, serverUrl: string, cre
|
|
|
389
360
|
activeWatchers.set(entry.path, watcher);
|
|
390
361
|
|
|
391
362
|
// Initial sync in background (wrapped in catch per error-handling standard)
|
|
392
|
-
|
|
363
|
+
const branch = getCurrentBranch(entry.path);
|
|
364
|
+
initialSync(projectId, entry.path, credentials, branch)
|
|
393
365
|
.then(async () => {
|
|
394
366
|
updateProjectSyncState(entry.path, { lastSyncAt: new Date() });
|
|
395
367
|
// Push version metadata after initial sync
|
|
@@ -723,56 +695,5 @@ function startVersionWatcher(serverUrl: string): ReturnType<typeof setInterval>
|
|
|
723
695
|
}, 60_000);
|
|
724
696
|
}
|
|
725
697
|
|
|
726
|
-
// --- Credential watcher ---
|
|
727
|
-
|
|
728
|
-
/**
|
|
729
|
-
* Watch ~/.claude/.credentials.json for external changes.
|
|
730
|
-
* Creates timestamped backups, identifies the account, and updates matching profiles.
|
|
731
|
-
* Self-trigger detection skips processing for switch-initiated writes.
|
|
732
|
-
* Returns a lifecycle object with close() that cancels pending debounce timers.
|
|
733
|
-
*/
|
|
734
|
-
function startCredentialWatcher(): CredentialWatcher {
|
|
735
|
-
const log = logger.child({ op: 'credentialWatcher' });
|
|
736
|
-
|
|
737
|
-
let debounceTimer: ReturnType<typeof setTimeout> | null = null;
|
|
738
|
-
|
|
739
|
-
const watcher = chokidar.watch(CREDENTIALS_FILE, {
|
|
740
|
-
persistent: true,
|
|
741
|
-
ignoreInitial: true,
|
|
742
|
-
awaitWriteFinish: {
|
|
743
|
-
stabilityThreshold: 300,
|
|
744
|
-
pollInterval: 100,
|
|
745
|
-
},
|
|
746
|
-
});
|
|
747
|
-
|
|
748
|
-
watcher
|
|
749
|
-
.on('change', () => {
|
|
750
|
-
// Debounce rapid changes
|
|
751
|
-
if (debounceTimer) clearTimeout(debounceTimer);
|
|
752
|
-
debounceTimer = setTimeout(() => {
|
|
753
|
-
debounceTimer = null;
|
|
754
|
-
handleCredentialChange().catch((changeErr: unknown) => {
|
|
755
|
-
log.error({ err: changeErr }, 'Credential change handler failed');
|
|
756
|
-
});
|
|
757
|
-
}, 500);
|
|
758
|
-
})
|
|
759
|
-
.on('error', (watcherErr) => {
|
|
760
|
-
log.error({ err: watcherErr }, 'Credential watcher error');
|
|
761
|
-
});
|
|
762
|
-
|
|
763
|
-
log.info({ path: CREDENTIALS_FILE }, 'Credential watcher started');
|
|
764
|
-
|
|
765
|
-
return {
|
|
766
|
-
async close() {
|
|
767
|
-
if (debounceTimer) {
|
|
768
|
-
clearTimeout(debounceTimer);
|
|
769
|
-
debounceTimer = null;
|
|
770
|
-
}
|
|
771
|
-
await watcher.close();
|
|
772
|
-
log.info('Credential watcher stopped');
|
|
773
|
-
},
|
|
774
|
-
};
|
|
775
|
-
}
|
|
776
|
-
|
|
777
698
|
/** Expose LOADED_VERSION for use by other modules (e.g., status) */
|
|
778
699
|
export { LOADED_VERSION };
|
package/src/repl.ts
CHANGED
|
@@ -23,17 +23,7 @@ import { login } from './auth.js';
|
|
|
23
23
|
import { stopDaemon, getDaemonStatus, isRunningInProcess, forkDaemon } from './daemon.js';
|
|
24
24
|
import { isServiceInstalled } from './service.js';
|
|
25
25
|
import { initialSync, createSnapshot as createSnapshotOnServer } from './sync.js';
|
|
26
|
-
import {
|
|
27
|
-
listProfiles,
|
|
28
|
-
switchProfile,
|
|
29
|
-
loginProfile,
|
|
30
|
-
saveCurrentAsProfile,
|
|
31
|
-
deleteProfileByName,
|
|
32
|
-
getClaudeStatus,
|
|
33
|
-
getExpiryStatus,
|
|
34
|
-
loadActiveProfile,
|
|
35
|
-
loadProfile,
|
|
36
|
-
} from './claude-profiles.js';
|
|
26
|
+
import { getCurrentBranch } from './watcher.js';
|
|
37
27
|
import { logger } from './logger.js';
|
|
38
28
|
import type { AgentCredentials, ProjectRegistryEntry } from '@ultra-claude/shared';
|
|
39
29
|
|
|
@@ -426,8 +416,9 @@ async function cmdPush(args: string[], ctx: ReplContext): Promise<void> {
|
|
|
426
416
|
continue;
|
|
427
417
|
}
|
|
428
418
|
|
|
429
|
-
|
|
430
|
-
|
|
419
|
+
const branch = getCurrentBranch(project.path);
|
|
420
|
+
console.log(`Pushing ${project.name} (branch: ${branch})...`);
|
|
421
|
+
await initialSync(projectId, project.path, creds, branch);
|
|
431
422
|
console.log(`Done: ${project.name}`);
|
|
432
423
|
}
|
|
433
424
|
}
|
|
@@ -460,7 +451,8 @@ async function cmdSnapshot(args: string[], ctx: ReplContext): Promise<void> {
|
|
|
460
451
|
return;
|
|
461
452
|
}
|
|
462
453
|
|
|
463
|
-
const
|
|
454
|
+
const branch = getCurrentBranch(project.path);
|
|
455
|
+
const success = await createSnapshotOnServer(projectId, label, branch, undefined, undefined, creds);
|
|
464
456
|
if (success) {
|
|
465
457
|
console.log(`Snapshot "${label}" created for ${project.name}`);
|
|
466
458
|
} else {
|
|
@@ -527,130 +519,6 @@ async function cmdReset(_args: string[], ctx: ReplContext): Promise<void> {
|
|
|
527
519
|
ctx.rl.close();
|
|
528
520
|
}
|
|
529
521
|
|
|
530
|
-
async function cmdClaude(args: string[], _ctx: ReplContext): Promise<void> {
|
|
531
|
-
const subcmd = args[0]?.toLowerCase();
|
|
532
|
-
const subArgs = args.slice(1);
|
|
533
|
-
|
|
534
|
-
switch (subcmd) {
|
|
535
|
-
case 'list': {
|
|
536
|
-
const profiles = await listProfiles();
|
|
537
|
-
if (profiles.length === 0) {
|
|
538
|
-
console.log('No saved Claude profiles. Run "claude save <name>" or "claude login <name>" to create one.');
|
|
539
|
-
return;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
const active = await loadActiveProfile();
|
|
543
|
-
|
|
544
|
-
// Table header
|
|
545
|
-
console.log('');
|
|
546
|
-
console.log(
|
|
547
|
-
' ' +
|
|
548
|
-
'Name'.padEnd(16) +
|
|
549
|
-
'Email'.padEnd(30) +
|
|
550
|
-
'Org'.padEnd(16) +
|
|
551
|
-
'Subscription'.padEnd(14) +
|
|
552
|
-
'Active'.padEnd(8) +
|
|
553
|
-
'Token',
|
|
554
|
-
);
|
|
555
|
-
console.log(' ' + '-'.repeat(90));
|
|
556
|
-
|
|
557
|
-
for (const profile of profiles) {
|
|
558
|
-
const isActive = active?.profile === profile.name;
|
|
559
|
-
const expiry = getExpiryStatus(profile);
|
|
560
|
-
console.log(
|
|
561
|
-
' ' +
|
|
562
|
-
profile.name.padEnd(16) +
|
|
563
|
-
profile.email.padEnd(30) +
|
|
564
|
-
(profile.orgName || '-').padEnd(16) +
|
|
565
|
-
(profile.subscriptionType || '-').padEnd(14) +
|
|
566
|
-
(isActive ? '*' : '').padEnd(8) +
|
|
567
|
-
expiry.label,
|
|
568
|
-
);
|
|
569
|
-
}
|
|
570
|
-
console.log('');
|
|
571
|
-
break;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
case 'switch': {
|
|
575
|
-
const name = subArgs[0];
|
|
576
|
-
if (!name) {
|
|
577
|
-
console.log('Usage: claude switch <name>');
|
|
578
|
-
return;
|
|
579
|
-
}
|
|
580
|
-
const result = await switchProfile(name);
|
|
581
|
-
console.log(result.message);
|
|
582
|
-
break;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
case 'login': {
|
|
586
|
-
const name = subArgs[0];
|
|
587
|
-
if (!name) {
|
|
588
|
-
console.log('Usage: claude login <name> [--email <email>]');
|
|
589
|
-
return;
|
|
590
|
-
}
|
|
591
|
-
const emailIdx = subArgs.indexOf('--email');
|
|
592
|
-
const email = emailIdx >= 0 ? subArgs[emailIdx + 1] : undefined;
|
|
593
|
-
const result = await loginProfile(name, email);
|
|
594
|
-
console.log(result.message);
|
|
595
|
-
break;
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
case 'save': {
|
|
599
|
-
const name = subArgs[0];
|
|
600
|
-
if (!name) {
|
|
601
|
-
console.log('Usage: claude save <name>');
|
|
602
|
-
return;
|
|
603
|
-
}
|
|
604
|
-
const result = await saveCurrentAsProfile(name);
|
|
605
|
-
console.log(result.message);
|
|
606
|
-
break;
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
case 'delete': {
|
|
610
|
-
const name = subArgs[0];
|
|
611
|
-
if (!name) {
|
|
612
|
-
console.log('Usage: claude delete <name>');
|
|
613
|
-
return;
|
|
614
|
-
}
|
|
615
|
-
const result = await deleteProfileByName(name);
|
|
616
|
-
if (result.wasActive) {
|
|
617
|
-
console.log(`Warning: "${name}" was the active profile.`);
|
|
618
|
-
}
|
|
619
|
-
console.log(result.message);
|
|
620
|
-
break;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
case 'status': {
|
|
624
|
-
const result = await getClaudeStatus();
|
|
625
|
-
if (!result.success) {
|
|
626
|
-
console.log(result.message);
|
|
627
|
-
return;
|
|
628
|
-
}
|
|
629
|
-
const id = result.identity!;
|
|
630
|
-
console.log('');
|
|
631
|
-
console.log(` Email: ${id.email}`);
|
|
632
|
-
console.log(` Org: ${id.orgName || '-'}`);
|
|
633
|
-
console.log(` Subscription: ${id.subscriptionType || '-'}`);
|
|
634
|
-
console.log(` Logged in: ${id.loggedIn ? 'yes' : 'no'}`);
|
|
635
|
-
console.log('');
|
|
636
|
-
break;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
default: {
|
|
640
|
-
console.log(`
|
|
641
|
-
Claude profile commands:
|
|
642
|
-
claude list Show all saved credential profiles
|
|
643
|
-
claude switch <name> Switch to a saved profile
|
|
644
|
-
claude login <name> Login via browser and save as profile
|
|
645
|
-
claude save <name> Save current credentials as a profile
|
|
646
|
-
claude delete <name> Remove a saved profile
|
|
647
|
-
claude status Show current Claude auth status
|
|
648
|
-
`);
|
|
649
|
-
break;
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
|
|
654
522
|
function cmdHelp(): void {
|
|
655
523
|
console.log(`
|
|
656
524
|
Available commands:
|
|
@@ -668,13 +536,6 @@ Available commands:
|
|
|
668
536
|
auto-assign on|off Toggle automatic project assignment
|
|
669
537
|
reset Wipe all accounts and project mappings
|
|
670
538
|
|
|
671
|
-
claude list Show Claude Code credential profiles
|
|
672
|
-
claude switch <name> Switch to a saved Claude profile
|
|
673
|
-
claude login <name> Login and save as Claude profile
|
|
674
|
-
claude save <name> Save current Claude credentials as profile
|
|
675
|
-
claude delete <name> Remove a Claude profile
|
|
676
|
-
claude status Show current Claude auth status
|
|
677
|
-
|
|
678
539
|
help Show this help
|
|
679
540
|
quit / exit Exit
|
|
680
541
|
|
|
@@ -699,7 +560,6 @@ const COMMANDS: Record<string, CommandHandler> = {
|
|
|
699
560
|
snapshot: cmdSnapshot,
|
|
700
561
|
'auto-assign': cmdAutoAssign,
|
|
701
562
|
reset: cmdReset,
|
|
702
|
-
claude: cmdClaude,
|
|
703
563
|
help: async () => cmdHelp(),
|
|
704
564
|
quit: async () => process.exit(0),
|
|
705
565
|
exit: async () => process.exit(0),
|
|
@@ -718,32 +578,12 @@ export async function startRepl(serverUrl?: string): Promise<void> {
|
|
|
718
578
|
|
|
719
579
|
const mappedCount = Object.keys(config.projectAccounts).length;
|
|
720
580
|
|
|
721
|
-
// Load active Claude profile for banner
|
|
722
|
-
let claudeBannerLine = '';
|
|
723
|
-
try {
|
|
724
|
-
const activeClaudeProfile = await loadActiveProfile();
|
|
725
|
-
if (activeClaudeProfile) {
|
|
726
|
-
const profile = await loadProfile(activeClaudeProfile.profile);
|
|
727
|
-
if (profile) {
|
|
728
|
-
const parts = [profile.email];
|
|
729
|
-
if (profile.orgName) parts.push(profile.orgName);
|
|
730
|
-
if (profile.subscriptionType) parts.push(profile.subscriptionType);
|
|
731
|
-
claudeBannerLine = ` Claude: ${parts[0]}${parts.length > 1 ? ` (${parts.slice(1).join(', ')})` : ''}`;
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
} catch (profileErr: unknown) {
|
|
735
|
-
logger.debug({ err: profileErr }, 'Failed to load active Claude profile for banner');
|
|
736
|
-
}
|
|
737
|
-
|
|
738
581
|
// Status banner
|
|
739
582
|
console.log('');
|
|
740
583
|
console.log(' Ultra Claude Agent — Interactive Mode');
|
|
741
584
|
console.log(` Server: ${resolvedUrl}`);
|
|
742
585
|
console.log(` Accounts: ${accounts.size}`);
|
|
743
586
|
console.log(` Projects: ${registry.projects.length} discovered, ${mappedCount} mapped`);
|
|
744
|
-
if (claudeBannerLine) {
|
|
745
|
-
console.log(claudeBannerLine);
|
|
746
|
-
}
|
|
747
587
|
console.log('');
|
|
748
588
|
console.log(' Type "help" for available commands.');
|
|
749
589
|
console.log('');
|