synomem 0.1.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.
- package/AGENTS.md +42 -0
- package/ARCHITECTURE.md +126 -0
- package/CHANGELOG.md +35 -0
- package/CODE_OF_CONDUCT.md +29 -0
- package/CONTRIBUTING.md +48 -0
- package/LICENSE +21 -0
- package/README.md +247 -0
- package/SECURITY.md +117 -0
- package/dist/backend.d.ts +9 -0
- package/dist/backend.d.ts.map +1 -0
- package/dist/backend.js +60 -0
- package/dist/backend.js.map +1 -0
- package/dist/cli.d.ts +34 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +1040 -0
- package/dist/cli.js.map +1 -0
- package/dist/client.d.ts +168 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +1031 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +33 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +153 -0
- package/dist/config.js.map +1 -0
- package/dist/credentials.d.ts +36 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +127 -0
- package/dist/credentials.js.map +1 -0
- package/dist/errors.d.ts +9 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +60 -0
- package/dist/errors.js.map +1 -0
- package/dist/fs-utils.d.ts +7 -0
- package/dist/fs-utils.d.ts.map +1 -0
- package/dist/fs-utils.js +68 -0
- package/dist/fs-utils.js.map +1 -0
- package/dist/import.d.ts +655 -0
- package/dist/import.d.ts.map +1 -0
- package/dist/import.js +226 -0
- package/dist/import.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/index.d.ts +14 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +698 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp-server.d.ts +3 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +45 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/oauth.d.ts +27 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +201 -0
- package/dist/oauth.js.map +1 -0
- package/dist/ports/projections.d.ts +6 -0
- package/dist/ports/projections.d.ts.map +1 -0
- package/dist/ports/projections.js +2 -0
- package/dist/ports/projections.js.map +1 -0
- package/dist/ports/repository.d.ts +31 -0
- package/dist/ports/repository.d.ts.map +1 -0
- package/dist/ports/repository.js +2 -0
- package/dist/ports/repository.js.map +1 -0
- package/dist/projections.d.ts +24 -0
- package/dist/projections.d.ts.map +1 -0
- package/dist/projections.js +531 -0
- package/dist/projections.js.map +1 -0
- package/dist/remote.d.ts +120 -0
- package/dist/remote.d.ts.map +1 -0
- package/dist/remote.js +286 -0
- package/dist/remote.js.map +1 -0
- package/dist/schemas.d.ts +901 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +424 -0
- package/dist/schemas.js.map +1 -0
- package/dist/service.d.ts +126 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +2 -0
- package/dist/service.js.map +1 -0
- package/dist/skill-install.d.ts +34 -0
- package/dist/skill-install.d.ts.map +1 -0
- package/dist/skill-install.js +256 -0
- package/dist/skill-install.js.map +1 -0
- package/dist/storage.d.ts +94 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +1229 -0
- package/dist/storage.js.map +1 -0
- package/dist/types.d.ts +442 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +14 -0
- package/dist/version.js.map +1 -0
- package/docs/cli.md +180 -0
- package/docs/examples.md +70 -0
- package/docs/mcp.md +96 -0
- package/docs/recovery.md +45 -0
- package/docs/releasing.md +61 -0
- package/docs/skill.md +93 -0
- package/docs/storage-format.md +83 -0
- package/openapi/synomem-v1.yaml +674 -0
- package/package.json +100 -0
- package/skills/synomem/SKILL.md +71 -0
- package/skills/synomem/agents/openai.yaml +8 -0
- package/skills/synomem/references/examples.md +28 -0
- package/src/backend.ts +91 -0
- package/src/cli.ts +1623 -0
- package/src/client.ts +1261 -0
- package/src/config.ts +170 -0
- package/src/credentials.ts +194 -0
- package/src/errors.ts +64 -0
- package/src/fs-utils.ts +85 -0
- package/src/import.ts +284 -0
- package/src/index.ts +61 -0
- package/src/mcp/index.ts +973 -0
- package/src/mcp-server.ts +46 -0
- package/src/oauth.ts +252 -0
- package/src/ports/projections.ts +6 -0
- package/src/ports/repository.ts +67 -0
- package/src/projections.ts +624 -0
- package/src/remote.ts +516 -0
- package/src/schemas.ts +457 -0
- package/src/service.ts +140 -0
- package/src/skill-install.ts +332 -0
- package/src/storage.ts +1603 -0
- package/src/types.ts +458 -0
- package/src/version.ts +16 -0
package/SECURITY.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
## Supported versions and reporting
|
|
4
|
+
|
|
5
|
+
Synomem is pre-release. Security fixes target the latest release and `main`. Report vulnerabilities
|
|
6
|
+
through GitHub private vulnerability reporting for `Coaden/synomem`; do not open a public issue with
|
|
7
|
+
exploit details, secrets, or private record data.
|
|
8
|
+
|
|
9
|
+
## Trust model
|
|
10
|
+
|
|
11
|
+
Synomem is a local audit-friendly record, not a tamper-proof ledger.
|
|
12
|
+
|
|
13
|
+
- The local filesystem owner can alter the database, configuration, binaries, and projections.
|
|
14
|
+
- Actor-bound MCP processes prevent ordinary callers from selecting another actor per tool call;
|
|
15
|
+
they do not cryptographically prove who launched the process.
|
|
16
|
+
- The CLI intentionally permits a local human to choose an actor within the local-owner boundary.
|
|
17
|
+
- MCP clients can invoke mutations available to the configured actor and are trusted local software.
|
|
18
|
+
- Visibility policies constrain application behavior, not the filesystem owner.
|
|
19
|
+
|
|
20
|
+
## Authorization model
|
|
21
|
+
|
|
22
|
+
- Humans have local administrative authority.
|
|
23
|
+
- Actor principals are the `(kind, id)` pair. A system or agent does not inherit another kind's
|
|
24
|
+
author access merely because its textual ID matches.
|
|
25
|
+
- Agents may acknowledge only their own kudos and change only memo state addressed to them.
|
|
26
|
+
- Agents may create and revise only their own notes.
|
|
27
|
+
- Todo creators and assignees may change a todo; cross-agent assignment is configurable.
|
|
28
|
+
- System actors are automation identities with no implicit agent or administrative authority.
|
|
29
|
+
- Administrative MCP tools are disabled by default.
|
|
30
|
+
|
|
31
|
+
`private` records remain visible to their direct participants. `workspace` records are visible to
|
|
32
|
+
authorized actors in the local workspace. `public` means eligible for public export; it does not
|
|
33
|
+
automatically publish anything.
|
|
34
|
+
|
|
35
|
+
## Filesystem and SQLite
|
|
36
|
+
|
|
37
|
+
- IDs reject traversal syntax, separators, controls, and reserved names.
|
|
38
|
+
- Existing symlink components are rejected, and all derived paths stay under the configured home.
|
|
39
|
+
- Cleanup removes only regular files recorded in the generated-files manifest.
|
|
40
|
+
- Database, WAL, shared-memory, configuration, projection, export, and backup files are restricted to
|
|
41
|
+
the local user where POSIX modes are available.
|
|
42
|
+
- WAL, foreign keys, full synchronization, bounded busy waits, and transactions reduce corruption
|
|
43
|
+
and concurrency risks.
|
|
44
|
+
- Database triggers reject event updates and deletes. Lifecycle changes append events.
|
|
45
|
+
- Backups use SQLite `VACUUM INTO`; never copy a live database naively.
|
|
46
|
+
- Never use Git, Dropbox, generic network storage, or file-copy synchronization as a multi-writer
|
|
47
|
+
protocol for the live database.
|
|
48
|
+
|
|
49
|
+
## Sensitive content
|
|
50
|
+
|
|
51
|
+
Synomem never captures tool output automatically. Do not record:
|
|
52
|
+
|
|
53
|
+
- tokens, passwords, cookies, private keys, authentication headers, or environment values;
|
|
54
|
+
- raw sensitive tool arguments or outputs;
|
|
55
|
+
- private file contents or whole chat transcripts;
|
|
56
|
+
- sensitive URLs or query strings;
|
|
57
|
+
- personal information unnecessary for the durable purpose.
|
|
58
|
+
|
|
59
|
+
Evidence is descriptive metadata such as a safe task reference, relative file path, commit, URL, or
|
|
60
|
+
sanitized tool description. Memos, notes, and todos often contain operational detail, so use the
|
|
61
|
+
least content necessary. Review every export before sharing it.
|
|
62
|
+
|
|
63
|
+
## Malformed and future data
|
|
64
|
+
|
|
65
|
+
Canonical payloads are validated on read. Diagnostics identify malformed or unsupported rows by
|
|
66
|
+
storage ID. Writes and full rebuilds fail closed when installed code cannot interpret the complete
|
|
67
|
+
event stream. Raw JSON and JSONL export remains available for recovery.
|
|
68
|
+
|
|
69
|
+
Read-only clients never migrate databases. Newer database versions fail before queries interpret
|
|
70
|
+
their schema. Use `synomem backup` before any migration that cannot be safely reversed.
|
|
71
|
+
|
|
72
|
+
## Nonrepudiation and hosted operation
|
|
73
|
+
|
|
74
|
+
Append-only application behavior makes ordinary changes explicit, but an unsigned database owned by
|
|
75
|
+
the local user can be rewritten. Do not describe Synomem as cryptographically tamper-proof or legally
|
|
76
|
+
nonrepudiable.
|
|
77
|
+
|
|
78
|
+
The local data plane and stdio MCP server expose no inbound network listener or hosted trust
|
|
79
|
+
boundary. `synomem auth login` temporarily opens an exact loopback OAuth callback and closes it when
|
|
80
|
+
the flow finishes. A hosted service requires server-side authentication, authorization, workspace
|
|
81
|
+
isolation, transport security, conflict handling, availability controls, audit policy, and explicit
|
|
82
|
+
migration. Client-side checks alone are insufficient.
|
|
83
|
+
|
|
84
|
+
The experimental remote client accepts only HTTPS origins, with an explicit loopback HTTP exception
|
|
85
|
+
for development. It does not follow redirects, bounds response bodies, keeps credentials out of
|
|
86
|
+
configuration and request bodies, and never sends its expected actor as authority. The future
|
|
87
|
+
server must derive actor and workspace authority from a validated audience-bound credential; these
|
|
88
|
+
client checks are not a substitute for server-side authorization.
|
|
89
|
+
|
|
90
|
+
Backend configuration may contain a remote service origin and workspace identifier, but never an
|
|
91
|
+
access token, refresh token, password, or private key. The SQLite-backed client fails closed when it
|
|
92
|
+
encounters a remote backend and does so before creating or opening a database. This prevents a
|
|
93
|
+
misconfigured remote workspace from silently diverging into local state.
|
|
94
|
+
|
|
95
|
+
Interactive CLI credentials are stored in macOS Keychain or Linux Secret Service and keyed to the
|
|
96
|
+
service, workspace, and stable actor pair. The macOS helper receives secret JSON through stdin
|
|
97
|
+
rather than command-line arguments. OAuth login requires PKCE S256, validates callback state, binds
|
|
98
|
+
the token request to the discovered resource, refuses non-HTTPS authorization/token endpoints, and
|
|
99
|
+
verifies the returned credential against the configured actor before retaining it.
|
|
100
|
+
|
|
101
|
+
The local import client snapshots SQLite with `VACUUM INTO`, validates bounded event/profile counts
|
|
102
|
+
and a whole-bundle checksum, and requires separate preview and confirmation commands. The remote
|
|
103
|
+
service—not this package—is responsible for administrative authorization, signed-plan validation,
|
|
104
|
+
empty-target enforcement, and atomic ingestion.
|
|
105
|
+
|
|
106
|
+
## Skill installer
|
|
107
|
+
|
|
108
|
+
No install hook changes agent configuration. `synomem skill install` and `uninstall` are explicit and
|
|
109
|
+
dry-run unless `--yes` is supplied. They recognize verified Claude Code, Codex, Hermes, OpenClaw,
|
|
110
|
+
Cursor, and local Grok layouts; honor documented runtime-home overrides; never create a missing
|
|
111
|
+
runtime home; constrain changes to `skills/synomem`; and refuse unowned conflicts without `--force`.
|
|
112
|
+
Copied skill files preserve their packaged permission modes, including execute bits needed by helper
|
|
113
|
+
scripts. Skill bundles are operational instructions rather than confidential Synomem data; the
|
|
114
|
+
`0600`/`0700` data-file policy above does not apply to them. The ownership stamp is written `0600`
|
|
115
|
+
where POSIX modes are available.
|
|
116
|
+
The installer prints MCP setup commands where the harness has a verified noninteractive command but
|
|
117
|
+
does not execute them or rewrite shared MCP configuration.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SynomemClient } from './client.js';
|
|
2
|
+
import { RemoteSynomemService } from './remote.js';
|
|
3
|
+
import type { SynomemServiceFactory } from './service.js';
|
|
4
|
+
import type { SynomemBackendConfig, SynomemClientOptions, SynomemConfig } from './types.js';
|
|
5
|
+
export declare function readSynomemConfig(explicitHome?: string, env?: NodeJS.ProcessEnv): SynomemConfig | undefined;
|
|
6
|
+
export declare function writeSynomemBackend(backend: SynomemBackendConfig, explicitHome?: string): SynomemConfig;
|
|
7
|
+
export declare function createConfiguredService(options?: SynomemClientOptions, env?: NodeJS.ProcessEnv): SynomemClient | RemoteSynomemService;
|
|
8
|
+
export declare const configuredServiceFactory: SynomemServiceFactory;
|
|
9
|
+
//# sourceMappingURL=backend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAS5C,OAAO,EAAiC,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAEV,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACd,MAAM,YAAY,CAAC;AAYpB,wBAAgB,iBAAiB,CAC/B,YAAY,CAAC,EAAE,MAAM,EACrB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,aAAa,GAAG,SAAS,CAQ3B;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,oBAAoB,EAC7B,YAAY,CAAC,EAAE,MAAM,GACpB,aAAa,CAef;AAED,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,oBAAyB,EAClC,GAAG,GAAE,MAAM,CAAC,UAAwB,wCAmBrC;AAED,eAAO,MAAM,wBAAwB,EAAE,qBACL,CAAC"}
|
package/dist/backend.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { chmodSync, existsSync, lstatSync, mkdirSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { ulid } from 'ulid';
|
|
4
|
+
import { SynomemClient } from './client.js';
|
|
5
|
+
import { defaultConfig, mergeConfig, resolveHome } from './config.js';
|
|
6
|
+
import { SynomemError } from './errors.js';
|
|
7
|
+
import { assertNoSymlinkEscape, atomicWriteFile, ensureDirectory, readJsonFile, } from './fs-utils.js';
|
|
8
|
+
import { environmentCredentialProvider, RemoteSynomemService } from './remote.js';
|
|
9
|
+
import { credentialReference, OsCredentialStore } from './credentials.js';
|
|
10
|
+
import { StoredCredentialProvider } from './oauth.js';
|
|
11
|
+
function configLocation(explicitHome) {
|
|
12
|
+
const home = resolveHome(explicitHome);
|
|
13
|
+
const storageDirectory = join(home, 'synomem');
|
|
14
|
+
return { home, storageDirectory, configPath: join(storageDirectory, 'config.json') };
|
|
15
|
+
}
|
|
16
|
+
export function readSynomemConfig(explicitHome, env = process.env) {
|
|
17
|
+
const { home, storageDirectory, configPath } = configLocation(explicitHome);
|
|
18
|
+
if (!existsSync(configPath))
|
|
19
|
+
return undefined;
|
|
20
|
+
if (!existsSync(home) || lstatSync(home).isSymbolicLink()) {
|
|
21
|
+
throw new SynomemError('UNSAFE_PATH', 'The configured Synomem home is unsafe.');
|
|
22
|
+
}
|
|
23
|
+
assertNoSymlinkEscape(home, storageDirectory);
|
|
24
|
+
return mergeConfig(readJsonFile(configPath), undefined, env);
|
|
25
|
+
}
|
|
26
|
+
export function writeSynomemBackend(backend, explicitHome) {
|
|
27
|
+
const { home, storageDirectory, configPath } = configLocation(explicitHome);
|
|
28
|
+
if (!existsSync(home))
|
|
29
|
+
mkdirSync(home, { recursive: true, mode: 0o700 });
|
|
30
|
+
if (lstatSync(home).isSymbolicLink()) {
|
|
31
|
+
throw new SynomemError('UNSAFE_PATH', 'The configured Synomem home cannot be a symbolic link.');
|
|
32
|
+
}
|
|
33
|
+
ensureDirectory(storageDirectory);
|
|
34
|
+
assertNoSymlinkEscape(home, storageDirectory);
|
|
35
|
+
chmodSync(storageDirectory, 0o700);
|
|
36
|
+
const existing = existsSync(configPath)
|
|
37
|
+
? mergeConfig(readJsonFile(configPath), undefined, {})
|
|
38
|
+
: { ...defaultConfig, workspaceId: ulid() };
|
|
39
|
+
const config = mergeConfig({ ...existing, backend }, undefined, {});
|
|
40
|
+
atomicWriteFile(configPath, `${JSON.stringify(config, null, 2)}\n`);
|
|
41
|
+
return config;
|
|
42
|
+
}
|
|
43
|
+
export function createConfiguredService(options = {}, env = process.env) {
|
|
44
|
+
const persisted = readSynomemConfig(options.home, env);
|
|
45
|
+
const backend = options.config?.backend ?? persisted?.backend ?? defaultConfig.backend;
|
|
46
|
+
if (backend.kind === 'local')
|
|
47
|
+
return new SynomemClient(options);
|
|
48
|
+
const expectedActor = options.actor ?? { kind: 'system', id: 'workspace' };
|
|
49
|
+
return new RemoteSynomemService({
|
|
50
|
+
baseUrl: backend.baseUrl,
|
|
51
|
+
workspaceId: backend.workspaceId,
|
|
52
|
+
expectedActor,
|
|
53
|
+
credentialProvider: env.SYNOMEM_ACCESS_TOKEN
|
|
54
|
+
? environmentCredentialProvider(env)
|
|
55
|
+
: new StoredCredentialProvider(credentialReference(backend.baseUrl, backend.workspaceId, expectedActor), new OsCredentialStore(), env),
|
|
56
|
+
...(options.signal ? { signal: options.signal } : {}),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export const configuredServiceFactory = (options) => createConfiguredService(options);
|
|
60
|
+
//# sourceMappingURL=backend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,eAA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M,aAAa,GAAkB,OAAO,CAAC,KAAK,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC;IAC1F,OAAO,IAAI,oBAAoB,CAAC;QAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,aAAa;QACb,kBAAkB,EAAE,GAAG,CAAC,oBAAoB;YAC1C,CAAC,CAAC,6BAA6B,CAAC,GAAG,CAAC;YACpC,CAAC,CAAC,IAAI,wBAAwB,CAC1B,mBAAmB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,EAAE,aAAa,CAAC,EACxE,IAAI,iBAAiB,EAAE,EACvB,GAAG,CACJ;QACL,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAA0B,CAAC,OAAO,EAAE,EAAE,CACzE,uBAAuB,CAAC,OAAO,CAAC,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { type CredentialStore } from './credentials.js';
|
|
4
|
+
import { type OAuthLoginOptions } from './oauth.js';
|
|
5
|
+
import { type ImportBundle, type ImportPreview, type ImportResult } from './import.js';
|
|
6
|
+
import type { ActorIdentity } from './types.js';
|
|
7
|
+
import type { SynomemServiceFactory } from './service.js';
|
|
8
|
+
export interface CliIo {
|
|
9
|
+
stdout: (text: string) => void;
|
|
10
|
+
stderr: (text: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface CliDependencies {
|
|
13
|
+
credentialStore?: CredentialStore;
|
|
14
|
+
oauthLogin?: (options: OAuthLoginOptions) => Promise<void>;
|
|
15
|
+
env?: NodeJS.ProcessEnv;
|
|
16
|
+
verifyRemoteCredential?: (options: {
|
|
17
|
+
baseUrl: string;
|
|
18
|
+
workspaceId: string;
|
|
19
|
+
actor: ActorIdentity;
|
|
20
|
+
reference: string;
|
|
21
|
+
credentialStore: CredentialStore;
|
|
22
|
+
}) => Promise<void>;
|
|
23
|
+
createImportBundle?: (home: string) => Promise<ImportBundle>;
|
|
24
|
+
remoteImport?: (options: {
|
|
25
|
+
baseUrl: string;
|
|
26
|
+
workspaceId: string;
|
|
27
|
+
actor: ActorIdentity;
|
|
28
|
+
bundle: ImportBundle;
|
|
29
|
+
planId?: string;
|
|
30
|
+
}) => Promise<ImportPreview | ImportResult>;
|
|
31
|
+
}
|
|
32
|
+
export declare function createCli(io?: CliIo, serviceFactory?: SynomemServiceFactory, dependencies?: CliDependencies): Command;
|
|
33
|
+
export declare function runCli(argv?: string[], io?: CliIo, serviceFactory?: SynomemServiceFactory, dependencies?: CliDependencies): Promise<number>;
|
|
34
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,OAAO,EAA0B,MAAM,WAAW,CAAC;AAE5D,OAAO,EAA0C,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIhG,OAAO,EAA4C,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE9F,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AASrB,OAAO,KAAK,EACV,aAAa,EAQd,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAkB,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1E,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,M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