aismemory 0.8.3 → 0.8.6
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/README.md +163 -5
- package/dist/__tests__/agent-archive.test.js +1 -0
- package/dist/__tests__/agent-archive.test.js.map +1 -1
- package/dist/__tests__/agent-key-mode.test.js +52 -5
- package/dist/__tests__/agent-key-mode.test.js.map +1 -1
- package/dist/__tests__/agent-load-persistence.test.js +12 -4
- package/dist/__tests__/agent-load-persistence.test.js.map +1 -1
- package/dist/__tests__/agent-load-session-override-e2e.test.js +1 -1
- package/dist/__tests__/agent-load-session-override-e2e.test.js.map +1 -1
- package/dist/__tests__/agentmemory.test.js +16 -3
- package/dist/__tests__/agentmemory.test.js.map +1 -1
- package/dist/__tests__/ais-http.test.js +102 -1
- package/dist/__tests__/ais-http.test.js.map +1 -1
- package/dist/__tests__/auto-enroll-key.test.js +20 -1
- package/dist/__tests__/auto-enroll-key.test.js.map +1 -1
- package/dist/__tests__/auto-handoff-identity-gate.test.d.ts +1 -0
- package/dist/__tests__/auto-handoff-identity-gate.test.js +64 -0
- package/dist/__tests__/auto-handoff-identity-gate.test.js.map +1 -0
- package/dist/__tests__/cli-info.test.js +8 -4
- package/dist/__tests__/cli-info.test.js.map +1 -1
- package/dist/__tests__/client-credential-expiry.test.d.ts +1 -0
- package/dist/__tests__/client-credential-expiry.test.js +319 -0
- package/dist/__tests__/client-credential-expiry.test.js.map +1 -0
- package/dist/__tests__/declared-agent.test.d.ts +1 -0
- package/dist/__tests__/declared-agent.test.js +60 -0
- package/dist/__tests__/declared-agent.test.js.map +1 -0
- package/dist/__tests__/delegated-read-args.test.js +1 -1
- package/dist/__tests__/delegated-read-args.test.js.map +1 -1
- package/dist/__tests__/device-flow-gate-e2e.test.js +1 -1
- package/dist/__tests__/device-flow-gate-e2e.test.js.map +1 -1
- package/dist/__tests__/disk-bearer-host-binding-e2e.test.d.ts +1 -0
- package/dist/__tests__/disk-bearer-host-binding-e2e.test.js +235 -0
- package/dist/__tests__/disk-bearer-host-binding-e2e.test.js.map +1 -0
- package/dist/__tests__/doctor-bin-insecure-ais-url.test.d.ts +1 -0
- package/dist/__tests__/doctor-bin-insecure-ais-url.test.js +29 -0
- package/dist/__tests__/doctor-bin-insecure-ais-url.test.js.map +1 -0
- package/dist/__tests__/doctor.test.js +65 -6
- package/dist/__tests__/doctor.test.js.map +1 -1
- package/dist/__tests__/dream-poll.test.d.ts +1 -0
- package/dist/__tests__/dream-poll.test.js +130 -0
- package/dist/__tests__/dream-poll.test.js.map +1 -0
- package/dist/__tests__/enable-key-auth.test.d.ts +1 -0
- package/dist/__tests__/enable-key-auth.test.js +212 -0
- package/dist/__tests__/enable-key-auth.test.js.map +1 -0
- package/dist/__tests__/existing-hashes.test.js +3 -6
- package/dist/__tests__/existing-hashes.test.js.map +1 -1
- package/dist/__tests__/full-context-view-forwarding.test.js +72 -5
- package/dist/__tests__/full-context-view-forwarding.test.js.map +1 -1
- package/dist/__tests__/helpers/setup-credential-source.d.ts +3 -0
- package/dist/__tests__/helpers/setup-credential-source.js +43 -0
- package/dist/__tests__/helpers/setup-credential-source.js.map +1 -0
- package/dist/__tests__/hooks.test.d.ts +1 -0
- package/dist/__tests__/hooks.test.js +476 -0
- package/dist/__tests__/hooks.test.js.map +1 -0
- package/dist/__tests__/hydration.test.js +2 -0
- package/dist/__tests__/hydration.test.js.map +1 -1
- package/dist/__tests__/install.test.js +45 -1
- package/dist/__tests__/install.test.js.map +1 -1
- package/dist/__tests__/invite-accept.test.js +167 -3
- package/dist/__tests__/invite-accept.test.js.map +1 -1
- package/dist/__tests__/key-auth-host-binding.test.d.ts +1 -0
- package/dist/__tests__/key-auth-host-binding.test.js +120 -0
- package/dist/__tests__/key-auth-host-binding.test.js.map +1 -0
- package/dist/__tests__/key-auth.test.js +35 -27
- package/dist/__tests__/key-auth.test.js.map +1 -1
- package/dist/__tests__/keyauth-error-surface-e2e.test.js +1 -1
- package/dist/__tests__/keyauth-error-surface-e2e.test.js.map +1 -1
- package/dist/__tests__/list-all-agents.test.js +17 -15
- package/dist/__tests__/list-all-agents.test.js.map +1 -1
- package/dist/__tests__/mcp-init-no-auth.test.js +1 -1
- package/dist/__tests__/mcp-init-no-auth.test.js.map +1 -1
- package/dist/__tests__/mcp-instructions.test.d.ts +1 -0
- package/dist/__tests__/mcp-instructions.test.js +26 -0
- package/dist/__tests__/mcp-instructions.test.js.map +1 -0
- package/dist/__tests__/mcp-tools.test.js +157 -2
- package/dist/__tests__/mcp-tools.test.js.map +1 -1
- package/dist/__tests__/memory-export.test.d.ts +1 -0
- package/dist/__tests__/memory-export.test.js +78 -0
- package/dist/__tests__/memory-export.test.js.map +1 -0
- package/dist/__tests__/memory-get.test.d.ts +1 -0
- package/dist/__tests__/memory-get.test.js +178 -0
- package/dist/__tests__/memory-get.test.js.map +1 -0
- package/dist/__tests__/memory-write-failure.test.js +1 -1
- package/dist/__tests__/memory-write-failure.test.js.map +1 -1
- package/dist/__tests__/no-registered-keys-disk-bearer-fallback.test.js +1 -1
- package/dist/__tests__/no-registered-keys-disk-bearer-fallback.test.js.map +1 -1
- package/dist/__tests__/oauth-credentials.test.js +9 -0
- package/dist/__tests__/oauth-credentials.test.js.map +1 -1
- package/dist/__tests__/operating-layer-put.test.d.ts +1 -0
- package/dist/__tests__/operating-layer-put.test.js +159 -0
- package/dist/__tests__/operating-layer-put.test.js.map +1 -0
- package/dist/__tests__/owner-credentials.test.d.ts +1 -0
- package/dist/__tests__/owner-credentials.test.js +266 -0
- package/dist/__tests__/owner-credentials.test.js.map +1 -0
- package/dist/__tests__/owner-keychain-agent-load.test.d.ts +1 -0
- package/dist/__tests__/owner-keychain-agent-load.test.js +57 -0
- package/dist/__tests__/owner-keychain-agent-load.test.js.map +1 -0
- package/dist/__tests__/recall-order-by.test.d.ts +1 -0
- package/dist/__tests__/recall-order-by.test.js +115 -0
- package/dist/__tests__/recall-order-by.test.js.map +1 -0
- package/dist/__tests__/reconnect-survival-e2e.test.js +264 -0
- package/dist/__tests__/reconnect-survival-e2e.test.js.map +1 -1
- package/dist/__tests__/remember-duplicate-truth.test.js +11 -0
- package/dist/__tests__/remember-duplicate-truth.test.js.map +1 -1
- package/dist/__tests__/remember-expires-in.test.d.ts +1 -0
- package/dist/__tests__/remember-expires-in.test.js +125 -0
- package/dist/__tests__/remember-expires-in.test.js.map +1 -0
- package/dist/__tests__/resolve-agent-preference-e2e.test.js +2 -1
- package/dist/__tests__/resolve-agent-preference-e2e.test.js.map +1 -1
- package/dist/__tests__/resolve-agent-preference.test.js +19 -8
- package/dist/__tests__/resolve-agent-preference.test.js.map +1 -1
- package/dist/__tests__/session-identity.test.js +23 -1
- package/dist/__tests__/session-identity.test.js.map +1 -1
- package/dist/__tests__/session-start.test.d.ts +1 -0
- package/dist/__tests__/session-start.test.js +179 -0
- package/dist/__tests__/session-start.test.js.map +1 -0
- package/dist/__tests__/setup-codex-get.test.d.ts +1 -0
- package/dist/__tests__/setup-codex-get.test.js +101 -0
- package/dist/__tests__/setup-codex-get.test.js.map +1 -0
- package/dist/__tests__/setup-links.test.d.ts +1 -0
- package/dist/__tests__/setup-links.test.js +37 -0
- package/dist/__tests__/setup-links.test.js.map +1 -0
- package/dist/__tests__/setup-orientation-codex.test.d.ts +1 -0
- package/dist/__tests__/setup-orientation-codex.test.js +76 -0
- package/dist/__tests__/setup-orientation-codex.test.js.map +1 -0
- package/dist/__tests__/setup-remove-cli.test.d.ts +1 -0
- package/dist/__tests__/setup-remove-cli.test.js +327 -0
- package/dist/__tests__/setup-remove-cli.test.js.map +1 -0
- package/dist/__tests__/setup-signed-in.test.d.ts +1 -0
- package/dist/__tests__/setup-signed-in.test.js +506 -0
- package/dist/__tests__/setup-signed-in.test.js.map +1 -0
- package/dist/__tests__/setup.test.d.ts +1 -0
- package/dist/__tests__/setup.test.js +1253 -0
- package/dist/__tests__/setup.test.js.map +1 -0
- package/dist/__tests__/signin-keychain.test.d.ts +1 -0
- package/dist/__tests__/signin-keychain.test.js +79 -0
- package/dist/__tests__/signin-keychain.test.js.map +1 -0
- package/dist/__tests__/silent-renewal-e2e.test.js +1 -1
- package/dist/__tests__/silent-renewal-e2e.test.js.map +1 -1
- package/dist/__tests__/split-brain-upgrade-e2e.test.js +1 -1
- package/dist/__tests__/split-brain-upgrade-e2e.test.js.map +1 -1
- package/dist/__tests__/startup-credential-warning-e2e.test.js +13 -7
- package/dist/__tests__/startup-credential-warning-e2e.test.js.map +1 -1
- package/dist/__tests__/startup-identity.test.d.ts +1 -0
- package/dist/__tests__/startup-identity.test.js +252 -0
- package/dist/__tests__/startup-identity.test.js.map +1 -0
- package/dist/__tests__/startup-insecure-ais-url.test.d.ts +1 -0
- package/dist/__tests__/startup-insecure-ais-url.test.js +36 -0
- package/dist/__tests__/startup-insecure-ais-url.test.js.map +1 -0
- package/dist/__tests__/sync-auth.test.d.ts +1 -0
- package/dist/__tests__/sync-auth.test.js +69 -0
- package/dist/__tests__/sync-auth.test.js.map +1 -0
- package/dist/__tests__/sync-doc.test.d.ts +1 -0
- package/dist/__tests__/sync-doc.test.js +13 -0
- package/dist/__tests__/sync-doc.test.js.map +1 -0
- package/dist/__tests__/sync-memory-cli.test.js +1 -1
- package/dist/__tests__/sync-memory-cli.test.js.map +1 -1
- package/dist/__tests__/test-home-isolation.test.d.ts +1 -0
- package/dist/__tests__/test-home-isolation.test.js +29 -0
- package/dist/__tests__/test-home-isolation.test.js.map +1 -0
- package/dist/__tests__/token-expiry-reauth.test.js +1 -1
- package/dist/__tests__/token-expiry-reauth.test.js.map +1 -1
- package/dist/__tests__/token-manager-permanent-failures.test.d.ts +1 -0
- package/dist/__tests__/token-manager-permanent-failures.test.js +162 -0
- package/dist/__tests__/token-manager-permanent-failures.test.js.map +1 -0
- package/dist/__tests__/token-rejection-reauth-e2e.test.js +1 -1
- package/dist/__tests__/token-rejection-reauth-e2e.test.js.map +1 -1
- package/dist/__tests__/tool-args.test.js +12 -0
- package/dist/__tests__/tool-args.test.js.map +1 -1
- package/dist/__tests__/workspace-key-mode.test.js +5 -1
- package/dist/__tests__/workspace-key-mode.test.js.map +1 -1
- package/dist/agent-key-mode.d.ts +1 -0
- package/dist/agent-key-mode.js +57 -28
- package/dist/agent-key-mode.js.map +1 -1
- package/dist/agent-preference.d.ts +12 -0
- package/dist/agent-preference.js +10 -1
- package/dist/agent-preference.js.map +1 -1
- package/dist/ais-http-error.d.ts +5 -0
- package/dist/ais-http-error.js +10 -0
- package/dist/ais-http-error.js.map +1 -1
- package/dist/ais-http.d.ts +4 -0
- package/dist/ais-http.js +28 -9
- package/dist/ais-http.js.map +1 -1
- package/dist/auto-handoff.js +2 -1
- package/dist/auto-handoff.js.map +1 -1
- package/dist/cli/doctor.d.ts +8 -0
- package/dist/cli/doctor.js +22 -2
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/enable-key-auth.js +41 -20
- package/dist/cli/enable-key-auth.js.map +1 -1
- package/dist/cli/export-harness.d.ts +13 -0
- package/dist/cli/export-harness.js +110 -0
- package/dist/cli/export-harness.js.map +1 -0
- package/dist/cli/hooks.d.ts +95 -0
- package/dist/cli/hooks.js +665 -0
- package/dist/cli/hooks.js.map +1 -0
- package/dist/cli/install.d.ts +4 -0
- package/dist/cli/install.js +47 -5
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/invite-accept.d.ts +36 -1
- package/dist/cli/invite-accept.js +137 -3
- package/dist/cli/invite-accept.js.map +1 -1
- package/dist/cli/owner-credentials.d.ts +52 -0
- package/dist/cli/owner-credentials.js +387 -0
- package/dist/cli/owner-credentials.js.map +1 -0
- package/dist/cli/pull-memory.js +2 -2
- package/dist/cli/pull-memory.js.map +1 -1
- package/dist/cli/setup-core.d.ts +220 -0
- package/dist/cli/setup-core.js +2381 -0
- package/dist/cli/setup-core.js.map +1 -0
- package/dist/cli/setup.d.ts +59 -0
- package/dist/cli/setup.js +407 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli/sync-memory.js +7 -9
- package/dist/cli/sync-memory.js.map +1 -1
- package/dist/cli-info.js +6 -1
- package/dist/cli-info.js.map +1 -1
- package/dist/credential-expiry.d.ts +10 -0
- package/dist/credential-expiry.js +41 -0
- package/dist/credential-expiry.js.map +1 -0
- package/dist/declared-agent.d.ts +20 -0
- package/dist/declared-agent.js +40 -0
- package/dist/declared-agent.js.map +1 -0
- package/dist/device-poll.d.ts +1 -0
- package/dist/device-poll.js.map +1 -1
- package/dist/dream-poll.d.ts +19 -0
- package/dist/dream-poll.js +93 -0
- package/dist/dream-poll.js.map +1 -0
- package/dist/env-agent.d.ts +6 -1
- package/dist/env-agent.js +18 -5
- package/dist/env-agent.js.map +1 -1
- package/dist/hydration.js +2 -1
- package/dist/hydration.js.map +1 -1
- package/dist/index.js +199 -27
- package/dist/index.js.map +1 -1
- package/dist/key-auth.d.ts +49 -3
- package/dist/key-auth.js +175 -7
- package/dist/key-auth.js.map +1 -1
- package/dist/mcp/tools.d.ts +2 -0
- package/dist/mcp/tools.js +79 -35
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp-instructions.d.ts +6 -0
- package/dist/mcp-instructions.js +7 -0
- package/dist/mcp-instructions.js.map +1 -0
- package/dist/memory-export.d.ts +30 -0
- package/dist/memory-export.js +116 -0
- package/dist/memory-export.js.map +1 -0
- package/dist/oauth-credentials.d.ts +1 -1
- package/dist/oauth-credentials.js +3 -3
- package/dist/oauth-credentials.js.map +1 -1
- package/dist/operating-layer-write.d.ts +134 -0
- package/dist/operating-layer-write.js +224 -0
- package/dist/operating-layer-write.js.map +1 -0
- package/dist/pipeline/bulk-store.d.ts +2 -5
- package/dist/pipeline/bulk-store.js +2 -4
- package/dist/pipeline/bulk-store.js.map +1 -1
- package/dist/pipeline/existing-hashes.d.ts +2 -5
- package/dist/pipeline/existing-hashes.js +1 -2
- package/dist/pipeline/existing-hashes.js.map +1 -1
- package/dist/pipeline/sync-auth.d.ts +12 -0
- package/dist/pipeline/sync-auth.js +64 -0
- package/dist/pipeline/sync-auth.js.map +1 -0
- package/dist/refresh.js +2 -1
- package/dist/refresh.js.map +1 -1
- package/dist/run-pass-mode.js +15 -19
- package/dist/run-pass-mode.js.map +1 -1
- package/dist/session-identity.d.ts +32 -0
- package/dist/session-identity.js +73 -1
- package/dist/session-identity.js.map +1 -1
- package/dist/session-start.d.ts +68 -0
- package/dist/session-start.js +176 -0
- package/dist/session-start.js.map +1 -0
- package/dist/signin-keychain.d.ts +54 -0
- package/dist/signin-keychain.js +200 -0
- package/dist/signin-keychain.js.map +1 -0
- package/dist/startup-identity.d.ts +71 -0
- package/dist/startup-identity.js +233 -0
- package/dist/startup-identity.js.map +1 -0
- package/dist/token-manager.d.ts +14 -0
- package/dist/token-manager.js +68 -6
- package/dist/token-manager.js.map +1 -1
- package/dist/tool-args.d.ts +64 -1
- package/dist/tool-args.js +184 -1
- package/dist/tool-args.js.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/workspace-key-mode.d.ts +2 -0
- package/dist/workspace-key-mode.js +28 -26
- package/dist/workspace-key-mode.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { type SessionIdentity } from '../session-identity.js';
|
|
2
|
+
import { type HookClient } from './hooks.js';
|
|
3
|
+
export declare const SETUP_NEW_WARNING = "This is new and has not been checked end to end on a fresh machine yet.";
|
|
4
|
+
/** Prefix for setup-owned MCP connections (distinct from `aismemory` install). */
|
|
5
|
+
export declare const SETUP_MCP_NAME_PREFIX = "aismemory-setup-";
|
|
6
|
+
export declare const CURSOR_SETUP_FILE_MARKER = "# made by aismemory setup";
|
|
7
|
+
export declare function setupMcpServerName(agentId: string): string;
|
|
8
|
+
export declare function configReadErrorMessage(path: string): string;
|
|
9
|
+
export type SetupToolId = 'claude-code' | 'cursor' | 'codex';
|
|
10
|
+
export type SetupChangeStatus = 'new' | 'changed' | 'unchanged' | 'skipped';
|
|
11
|
+
export interface SetupMcpPlan {
|
|
12
|
+
transport: 'file' | 'command';
|
|
13
|
+
path: string;
|
|
14
|
+
status: SetupChangeStatus;
|
|
15
|
+
/** Full file content after apply (file transport only). */
|
|
16
|
+
content?: string;
|
|
17
|
+
/** Fingerprint of file content at plan time (file transport only). */
|
|
18
|
+
planFingerprint: string | null;
|
|
19
|
+
/** JSON object for our server entry only (safe to print). */
|
|
20
|
+
ourServerEntry: Record<string, unknown> | null;
|
|
21
|
+
/** External command argv (command transport). */
|
|
22
|
+
commandArgv?: readonly string[];
|
|
23
|
+
/** Printed when the user must run a command manually. */
|
|
24
|
+
manualCommand?: string;
|
|
25
|
+
skipReason?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface SetupInstructionPlan {
|
|
28
|
+
path: string | null;
|
|
29
|
+
status: SetupChangeStatus;
|
|
30
|
+
content: string;
|
|
31
|
+
planFingerprint: string | null;
|
|
32
|
+
skipMessage?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface SetupToolPlan {
|
|
35
|
+
tool: SetupToolId;
|
|
36
|
+
found: boolean;
|
|
37
|
+
mcpPlan: SetupMcpPlan | null;
|
|
38
|
+
instructionPlan: SetupInstructionPlan | null;
|
|
39
|
+
ownNotes: readonly string[];
|
|
40
|
+
refused?: boolean;
|
|
41
|
+
otherAismemoryNames?: readonly string[];
|
|
42
|
+
}
|
|
43
|
+
export type SetupPlanBuildResult = {
|
|
44
|
+
ok: true;
|
|
45
|
+
plan: SetupPlan;
|
|
46
|
+
} | {
|
|
47
|
+
ok: false;
|
|
48
|
+
plan: SetupPlan;
|
|
49
|
+
messages: readonly string[];
|
|
50
|
+
};
|
|
51
|
+
export interface SetupPlan {
|
|
52
|
+
agentId: string;
|
|
53
|
+
tools: SetupToolPlan[];
|
|
54
|
+
rulesOmitted?: number;
|
|
55
|
+
noAccountRules?: boolean;
|
|
56
|
+
claudeConnectionCheckNote?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface SetupOrientationLine {
|
|
59
|
+
label: string;
|
|
60
|
+
status: 'present' | 'missing' | 'not-installed';
|
|
61
|
+
}
|
|
62
|
+
export interface SetupToolchain {
|
|
63
|
+
claudeOnPath: boolean;
|
|
64
|
+
codexMcpAdd: boolean;
|
|
65
|
+
}
|
|
66
|
+
export interface CommandRunResult {
|
|
67
|
+
stdout: string;
|
|
68
|
+
stderr: string;
|
|
69
|
+
code: number;
|
|
70
|
+
}
|
|
71
|
+
export type CommandRunner = (command: string, args: readonly string[], timeoutMs: number) => Promise<CommandRunResult>;
|
|
72
|
+
export declare function setupRulesFileName(agentId: string): string;
|
|
73
|
+
export declare function setupBeginMarker(agentId: string, blockId: string): string;
|
|
74
|
+
export declare function setupEndMarker(agentId: string, blockId: string): string;
|
|
75
|
+
export declare const UNRECOGNISED_CONTEXT_MSG = "the service answer was not understood; nothing was changed";
|
|
76
|
+
export declare function sanitizeForTerminal(text: string): string;
|
|
77
|
+
/** Service-supplied text for banners and refusals: strip controls and cap length; ids are not passed through this. */
|
|
78
|
+
export declare function displayServiceStringForTerminal(text: string): string;
|
|
79
|
+
export declare function splitOperatingLayerRules(raw: unknown): {
|
|
80
|
+
accountRules: string[];
|
|
81
|
+
ownNotes: string[];
|
|
82
|
+
rulesOmitted: number;
|
|
83
|
+
};
|
|
84
|
+
/** Refuse or neutralise hostile rule text; null means drop the rule. */
|
|
85
|
+
export declare function formatSetupRuleLine(description: string): string | null;
|
|
86
|
+
export declare function buildInstructionBlock(agentId: string, blockId: string, entryInstructions: string, ruleLines: readonly string[], setDate: string): string;
|
|
87
|
+
export declare function buildCursorRulesFile(agentId: string, blockId: string, entryInstructions: string, ruleLines: readonly string[], setDate: string, includeFrontMatter: boolean): string;
|
|
88
|
+
export declare function cursorFileCreatedBySetup(content: string): boolean;
|
|
89
|
+
export declare function contentIsOnlySetupCursorShell(content: string, agentId: string): boolean;
|
|
90
|
+
export declare function readBlockIdFromFile(content: string, agentId: string): string | null;
|
|
91
|
+
export declare function hasDamagedSetupMarker(content: string, agentId: string): boolean;
|
|
92
|
+
export declare function blockIdForPlan(existingContent: string | null, agentId: string): string;
|
|
93
|
+
export declare function applyInstructionBlock(existing: string | null, block: string, agentId: string): string;
|
|
94
|
+
export declare function removeInstructionBlock(content: string, agentId: string, requireBlockId: boolean): string;
|
|
95
|
+
/** Refuse when a symlink on the path to `targetPath` resolves outside `root`. */
|
|
96
|
+
export declare function refuseSymlinkWrite(root: string, targetPath: string): string | null;
|
|
97
|
+
export declare function detectSetupTool(home: string, tool: SetupToolId): boolean;
|
|
98
|
+
export declare function mcpEntryAgentId(entry: Record<string, unknown>): string | null;
|
|
99
|
+
export declare function otherAismemoryConnectionNames(servers: Record<string, unknown>, ourName: string): string[];
|
|
100
|
+
export declare function agentIdFromMcpGetOutput(stdout: string): string | null;
|
|
101
|
+
export declare const MCP_GET_TIMEOUT_MS = 60000;
|
|
102
|
+
export declare function claudeMcpGetArgv(serverName: string): string[];
|
|
103
|
+
export type McpGetPresence = 'present' | 'absent' | 'unknown';
|
|
104
|
+
export declare function classifyMcpGetResult(result: CommandRunResult, serverName: string): McpGetPresence;
|
|
105
|
+
export declare function codexMcpGetArgv(serverName: string): string[];
|
|
106
|
+
export declare function manualClaudeMcpRemoveCommand(serverName: string): string;
|
|
107
|
+
export declare function mergeJsonMcpConfig(existingJson: string | null, agentId: string, version: string, serverName: string, configPath?: string): {
|
|
108
|
+
content: string;
|
|
109
|
+
entryOnly: Record<string, unknown>;
|
|
110
|
+
};
|
|
111
|
+
export declare function jsonHasMcpServer(existingJson: string | null, serverName: string): boolean;
|
|
112
|
+
export declare function removeJsonMcpEntry(existingJson: string, serverName: string, configPath: string, keepEmptyServers?: boolean): string;
|
|
113
|
+
export declare function mergeCodexTomlMcp(existing: string | null, agentId: string, version: string, serverName: string, _configPath?: string): {
|
|
114
|
+
content: string;
|
|
115
|
+
blockId: string;
|
|
116
|
+
};
|
|
117
|
+
export declare function codexTomlTablesOnce(content: string): boolean;
|
|
118
|
+
export declare function removeCodexTomlMcpEntry(existing: string, agentId: string, configPath?: string): string;
|
|
119
|
+
export declare function claudeMcpAddArgv(agentId: string, version: string, serverName: string): string[];
|
|
120
|
+
export declare function claudeMcpRemoveArgv(serverName: string): string[];
|
|
121
|
+
export declare function codexMcpAddArgv(agentId: string, version: string, serverName: string): string[];
|
|
122
|
+
export declare function codexMcpRemoveArgv(serverName: string): string[];
|
|
123
|
+
export declare function manualClaudeMcpAddCommand(agentId: string, version: string, serverName: string): string;
|
|
124
|
+
export interface BuildSetupPlanOptions {
|
|
125
|
+
home: string;
|
|
126
|
+
project?: string;
|
|
127
|
+
agentId: string;
|
|
128
|
+
fullContext: unknown;
|
|
129
|
+
setDate: string;
|
|
130
|
+
packageVersion?: string;
|
|
131
|
+
toolchain?: SetupToolchain;
|
|
132
|
+
commandRunner?: CommandRunner;
|
|
133
|
+
}
|
|
134
|
+
export declare function buildSetupPlan(opts: BuildSetupPlanOptions): Promise<SetupPlan>;
|
|
135
|
+
export declare function otherAismemoryNotice(names: readonly string[]): string[];
|
|
136
|
+
export declare function plannedFileWrites(plan: SetupPlan): string[];
|
|
137
|
+
export declare function planHasRefusedTool(plan: SetupPlan): boolean;
|
|
138
|
+
export interface FormatDryRunOptions {
|
|
139
|
+
home?: string;
|
|
140
|
+
}
|
|
141
|
+
export declare function formatDryRun(plan: SetupPlan, opts?: FormatDryRunOptions): string;
|
|
142
|
+
export interface ApplySetupPlanOptions {
|
|
143
|
+
plan: SetupPlan;
|
|
144
|
+
home: string;
|
|
145
|
+
project?: string;
|
|
146
|
+
commandRunner?: CommandRunner;
|
|
147
|
+
writeStdout?: (text: string) => void;
|
|
148
|
+
writeStderr?: (text: string) => void;
|
|
149
|
+
}
|
|
150
|
+
export declare function writableRoots(home: string, project: string | undefined): string[];
|
|
151
|
+
export declare function assertPathWritable(roots: string[], path: string, resolvedWriteTarget?: string): void;
|
|
152
|
+
export declare function applySetupPlan(opts: ApplySetupPlanOptions): Promise<void>;
|
|
153
|
+
export interface RemoveSetupPlanOptions {
|
|
154
|
+
plan: SetupPlan;
|
|
155
|
+
home: string;
|
|
156
|
+
project?: string;
|
|
157
|
+
requireBlockId?: boolean;
|
|
158
|
+
commandRunner?: CommandRunner;
|
|
159
|
+
dryRun?: boolean;
|
|
160
|
+
writeStderr?: (text: string) => void;
|
|
161
|
+
}
|
|
162
|
+
export interface PlanRemoveSetupOptions {
|
|
163
|
+
home: string;
|
|
164
|
+
project?: string;
|
|
165
|
+
agentId: string;
|
|
166
|
+
toolchain?: SetupToolchain;
|
|
167
|
+
commandRunner?: CommandRunner;
|
|
168
|
+
}
|
|
169
|
+
export interface RemoveValidationFailure {
|
|
170
|
+
tool: SetupToolId;
|
|
171
|
+
message: string;
|
|
172
|
+
}
|
|
173
|
+
/** Plans removal using only local files (no network, no full_context). */
|
|
174
|
+
export declare function planRemoveSetup(opts: PlanRemoveSetupOptions): Promise<SetupPlan>;
|
|
175
|
+
export declare function collectRemoveValidationFailures(plan: SetupPlan, roots: string[]): RemoveValidationFailure[];
|
|
176
|
+
export declare function applyRemoveSetupPlan(opts: RemoveSetupPlanOptions): Promise<void>;
|
|
177
|
+
export declare function summarizeSetupOrientation(home: string, plan: SetupPlan, runner?: CommandRunner): Promise<SetupOrientationLine[]>;
|
|
178
|
+
export declare function formatOrientationSummary(lines: readonly SetupOrientationLine[]): string;
|
|
179
|
+
export declare function plannedPaths(plan: SetupPlan): string[];
|
|
180
|
+
export declare function fingerprintFileAtPath(path: string): string;
|
|
181
|
+
type SetupSignedInAuthKind = 'workspace-key' | 'agent-api-key' | 'run-pass' | 'oauth';
|
|
182
|
+
export interface SetupSignedInClient {
|
|
183
|
+
agentId: string;
|
|
184
|
+
pin: SessionIdentity | null;
|
|
185
|
+
authKind: SetupSignedInAuthKind;
|
|
186
|
+
callWhoami: () => Promise<unknown>;
|
|
187
|
+
}
|
|
188
|
+
/** Agent display name from the same whoami body hooks and the MCP server return. */
|
|
189
|
+
export declare function agentDisplayNameFromWhoami(body: unknown): string | null;
|
|
190
|
+
export declare function formatSignedInBannerLine(agentName: string | null, agentId: string, signInSource: string, opts?: {
|
|
191
|
+
nameLookedUp?: boolean;
|
|
192
|
+
}): string;
|
|
193
|
+
export declare function humanSignInSourceLabel(env: NodeJS.ProcessEnv, home: string, resolvedAgentId: string, authKind: SetupSignedInAuthKind): string;
|
|
194
|
+
/** Path of a sign-in file that exists but cannot be parsed; null when nothing is unreadable. */
|
|
195
|
+
export declare function unreadableSignInFilePath(home: string, env: NodeJS.ProcessEnv): string | null;
|
|
196
|
+
export declare function setupAuthKindFromHookClient(client: HookClient): SetupSignedInAuthKind;
|
|
197
|
+
export declare function setupSignedInClientFromHookClient(client: HookClient): SetupSignedInClient;
|
|
198
|
+
/**
|
|
199
|
+
* Resolve the signed-in agent via `resolveHookClient` (credential order matches MCP main() / whoami).
|
|
200
|
+
*/
|
|
201
|
+
export declare function resolveSetupSignedInClient(env: NodeJS.ProcessEnv, home: string): Promise<SetupSignedInClient>;
|
|
202
|
+
export type DiscoverSignedInResult = {
|
|
203
|
+
ok: true;
|
|
204
|
+
agentId: string;
|
|
205
|
+
agentName: string | null;
|
|
206
|
+
signInSource: string;
|
|
207
|
+
} | {
|
|
208
|
+
ok: false;
|
|
209
|
+
exitCode: 1;
|
|
210
|
+
message: string;
|
|
211
|
+
};
|
|
212
|
+
export declare const SETUP_NOT_SIGNED_IN_MSG = "This machine is not signed in to your memory account. Run `aismemory` once to sign in, or pass --identity <agent id>.";
|
|
213
|
+
export declare const SETUP_SIGN_IN_CHECK_FAILED_MSG = "Could not check the sign-in on this machine. Pass --identity <agent id>, or run `aismemory` to sign in again.";
|
|
214
|
+
export interface DiscoverSignedInAgentOptions {
|
|
215
|
+
skipAgentDisplayName?: boolean;
|
|
216
|
+
/** How the signed-in client is found; the default reads this machine's credentials. */
|
|
217
|
+
resolveClient?: (env: NodeJS.ProcessEnv, home: string) => Promise<SetupSignedInClient>;
|
|
218
|
+
}
|
|
219
|
+
export declare function discoverSignedInAgentForSetup(home: string, env: NodeJS.ProcessEnv, options?: DiscoverSignedInAgentOptions): Promise<DiscoverSignedInResult>;
|
|
220
|
+
export {};
|