@agentage/cli 0.26.0 → 0.28.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 (49) hide show
  1. package/dist/commands/auth/setup.js +1 -1
  2. package/dist/commands/daemon/daemon-cmd.js +0 -17
  3. package/dist/commands/vault/vault-sync.d.ts +2 -4
  4. package/dist/commands/vault/vault-sync.js +32 -42
  5. package/dist/commands/vault/vault.js +3 -2
  6. package/dist/daemon/server.d.ts +1 -4
  7. package/dist/daemon/server.js +0 -1
  8. package/dist/daemon-entry.js +6 -16
  9. package/dist/lib/auth/api.d.ts +0 -1
  10. package/dist/lib/auth/api.js +6 -16
  11. package/dist/lib/auth/provision.d.ts +1 -1
  12. package/dist/lib/auth/provision.js +5 -27
  13. package/dist/lib/daemon/daemon-client.d.ts +1 -3
  14. package/dist/lib/daemon/daemon-client.js +1 -2
  15. package/dist/lib/fs/config.d.ts +1 -1
  16. package/dist/lib/fs/config.js +8 -3
  17. package/dist/lib/status/status-info.js +11 -9
  18. package/dist/lib/status/vaults-format.js +7 -2
  19. package/dist/lib/status/vaults-status.d.ts +2 -2
  20. package/dist/lib/status/vaults-status.js +13 -12
  21. package/dist/lib/vault/vault-registry.js +2 -3
  22. package/dist/sync/discover/watcher.js +1 -1
  23. package/dist/sync/git/manager.d.ts +0 -2
  24. package/dist/sync/git/planner.js +3 -3
  25. package/package.json +4 -4
  26. package/dist/sync/couch/cycle.d.ts +0 -2
  27. package/dist/sync/couch/cycle.js +0 -58
  28. package/dist/sync/couch/discovery.d.ts +0 -22
  29. package/dist/sync/couch/discovery.js +0 -34
  30. package/dist/sync/couch/file-store.d.ts +0 -2
  31. package/dist/sync/couch/file-store.js +0 -47
  32. package/dist/sync/couch/local-commit.d.ts +0 -2
  33. package/dist/sync/couch/local-commit.js +0 -24
  34. package/dist/sync/couch/manager.d.ts +0 -4
  35. package/dist/sync/couch/manager.fixtures.d.ts +0 -20
  36. package/dist/sync/couch/manager.fixtures.js +0 -56
  37. package/dist/sync/couch/manager.js +0 -126
  38. package/dist/sync/couch/manager.types.d.ts +0 -81
  39. package/dist/sync/couch/manager.types.js +0 -1
  40. package/dist/sync/couch/mutation-target.d.ts +0 -5
  41. package/dist/sync/couch/mutation-target.js +0 -33
  42. package/dist/sync/couch/push-on-write.d.ts +0 -3
  43. package/dist/sync/couch/push-on-write.js +0 -33
  44. package/dist/sync/couch/state-store.d.ts +0 -3
  45. package/dist/sync/couch/state-store.js +0 -28
  46. package/dist/sync/couch/targets.d.ts +0 -9
  47. package/dist/sync/couch/targets.js +0 -23
  48. package/dist/sync/couch/wire.d.ts +0 -6
  49. package/dist/sync/couch/wire.js +0 -16
@@ -1,9 +0,0 @@
1
- import { type VaultsConfig } from '@agentage/memory-core';
2
- export declare const ACCOUNT_REMOTE = "agentage";
3
- export interface CouchTarget {
4
- vault: string;
5
- path: string;
6
- intervalSeconds: number;
7
- }
8
- export declare const couchTargets: (config: VaultsConfig) => CouchTarget[];
9
- export declare const autoCouchTargets: (config: VaultsConfig) => CouchTarget[];
@@ -1,23 +0,0 @@
1
- import { expandPath, isAccountVault } from '@agentage/memory-core';
2
- import { DEFAULT_INTERVAL_SECONDS } from '../git/planner.js';
3
- // The account (agentage) channel a couch target syncs to. Unlike a git target it has no external
4
- // remote URL: the daemon resolves the per-memory CouchDB + JWT endpoints from discovery at runtime.
5
- export const ACCOUNT_REMOTE = 'agentage';
6
- // Every account vault (agentage origin) with a local mirror path is a couch target. Interval rides
7
- // on the agentage origin and matches git semantics: absent = 300s, 0 = manual-only.
8
- export const couchTargets = (config) => {
9
- const out = [];
10
- for (const [vault, entry] of Object.entries(config.vaults ?? {})) {
11
- if (!isAccountVault(entry) || !entry.path)
12
- continue;
13
- const origin = entry.origin?.find((o) => o.remote === ACCOUNT_REMOTE);
14
- out.push({
15
- vault,
16
- path: expandPath(entry.path),
17
- intervalSeconds: origin?.interval ?? DEFAULT_INTERVAL_SECONDS,
18
- });
19
- }
20
- return out;
21
- };
22
- // The couch targets the daemon auto-loop schedules: interval 0 is manual-only and excluded.
23
- export const autoCouchTargets = (config) => couchTargets(config).filter((t) => t.intervalSeconds > 0);
@@ -1,6 +0,0 @@
1
- import { type CouchState } from '@agentage/memory-core';
2
- import { type ChannelDecision } from './discovery.js';
3
- import { type CouchLike, type CouchRuntime, type TargetState } from './manager.types.js';
4
- export declare const pendingCount: (st: TargetState | undefined) => number;
5
- export declare const getState: (rt: CouchRuntime, st: TargetState) => Promise<CouchState>;
6
- export declare const ensureWire: (rt: CouchRuntime, st: TargetState, d: ChannelDecision) => Promise<CouchLike>;
@@ -1,16 +0,0 @@
1
- import { createCouchState, CouchTokenClient } from '@agentage/memory-core';
2
- // Everything queued for retry: failed/deferred pushes plus not-yet-tombstoned deletions.
3
- export const pendingCount = (st) => st?.state ? st.state.pendingPaths().length + st.state.deletionPaths().length : 0;
4
- export const getState = (rt, st) => (st.statePromise ??= createCouchState(rt.makeStatePersistence(rt.configDir(), st.target.vault)).then((s) => (st.state = s)));
5
- export const ensureWire = async (rt, st, d) => {
6
- if (d.kind !== 'couch')
7
- throw new Error('ensureWire: not a couch channel');
8
- const key = `${d.endpoint}|${d.db}|${d.tokenUrl}`;
9
- if (st.couch && st.wireKey === key)
10
- return st.couch;
11
- const state = await getState(rt, st);
12
- const tokens = new CouchTokenClient(d.tokenUrl, st.target.vault, rt.fetch, rt.getBearer, Date.now);
13
- st.couch = rt.makeCouchSync(st.files, { endpoint: d.endpoint, db: d.db }, rt.fetch, () => tokens.token(), () => tokens.invalidate(), state, rt.log);
14
- st.wireKey = key;
15
- return st.couch;
16
- };