@peer2peer/cli 0.1.0 → 0.1.2
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 +21 -15
- package/dist/app.d.ts +83 -0
- package/dist/app.js +155 -40
- package/dist/cli.d.ts +76 -6
- package/dist/cli.js +386 -34
- package/dist/config.d.ts +52 -0
- package/dist/config.js +51 -0
- package/dist/doctor.d.ts +84 -1
- package/dist/doctor.js +198 -6
- package/dist/ext-host.d.ts +6 -0
- package/dist/ext-host.js +41 -3
- package/dist/extensions.d.ts +101 -0
- package/dist/extensions.js +13 -2
- package/dist/graph-memory.d.ts +107 -0
- package/dist/graph-memory.js +393 -0
- package/dist/history.d.ts +155 -0
- package/dist/history.js +697 -0
- package/dist/identity.d.ts +31 -2
- package/dist/identity.js +80 -10
- package/dist/inbound.js +4 -1
- package/dist/ix-local.d.ts +128 -0
- package/dist/ix-local.js +260 -0
- package/dist/pretty.d.ts +3 -1
- package/dist/pretty.js +9 -2
- package/dist/projects.d.ts +330 -12
- package/dist/projects.js +1044 -74
- package/dist/receipts.js +3 -1
- package/dist/rotation.js +15 -7
- package/dist/sessions.d.ts +28 -5
- package/dist/sessions.js +182 -30
- package/dist/social.js +11 -0
- package/dist/state.d.ts +26 -0
- package/dist/state.js +3 -0
- package/dist/tui/model.d.ts +7 -1
- package/dist/tui/model.js +8 -4
- package/dist/tui/tui.d.ts +9 -2
- package/dist/tui/tui.js +47 -6
- package/dist/tui/view.js +6 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/watch.js +6 -0
- package/package.json +6 -3
package/dist/cli.d.ts
CHANGED
|
@@ -25,16 +25,30 @@ export declare const realOps: {
|
|
|
25
25
|
sessionDirs(env: Record<string, string | undefined>): {
|
|
26
26
|
dirs: string[];
|
|
27
27
|
over: boolean;
|
|
28
|
+
why: projects.OverWhy[];
|
|
28
29
|
};
|
|
30
|
+
overWhys(v: unknown): projects.OverWhy[];
|
|
31
|
+
hasDotDot(p: string): boolean;
|
|
32
|
+
physicalPath(p: string): string;
|
|
33
|
+
pseudoPath(p: string): boolean;
|
|
34
|
+
braceChoice(c: string): boolean;
|
|
35
|
+
dirProjectId(root: string): string;
|
|
29
36
|
normalizeRemote(url: string): string | undefined;
|
|
30
|
-
projectOf(dir: string): projects.ProjectRef;
|
|
37
|
+
projectOf(dir: string, doc?: projects.ProjectsDoc): projects.ProjectRef;
|
|
31
38
|
projectsDoc(app: App): Promise<projects.ProjectsDoc>;
|
|
32
39
|
shareOf(doc: projects.ProjectsDoc, id: string): projects.ProjectShare;
|
|
33
40
|
projectView(app: App, ref: Pick<projects.ProjectRef, "id" | "name" | "kind" | "root" | "remote" | "repoPrivate">, doc?: projects.ProjectsDoc): Promise<projects.ProjectView>;
|
|
41
|
+
broadRoot(root: string, env?: Record<string, string | undefined>): string | undefined;
|
|
42
|
+
nestedBoundaries(root: string): {
|
|
43
|
+
repos: string[];
|
|
44
|
+
private: string[];
|
|
45
|
+
capped: boolean;
|
|
46
|
+
};
|
|
34
47
|
shareProject(app: App, dir: string, targets: {
|
|
35
48
|
circles?: string[];
|
|
36
49
|
people?: string[];
|
|
37
50
|
add?: boolean;
|
|
51
|
+
subfolders?: boolean;
|
|
38
52
|
}): Promise<{
|
|
39
53
|
project: projects.ProjectView;
|
|
40
54
|
warnings: string[];
|
|
@@ -42,25 +56,37 @@ export declare const realOps: {
|
|
|
42
56
|
makeProjectPrivate(app: App, dir: string): Promise<projects.ProjectView>;
|
|
43
57
|
listProjects(app: App): Promise<projects.ProjectView[]>;
|
|
44
58
|
showProject(app: App, dir: string): Promise<projects.ProjectView>;
|
|
59
|
+
sessionScratch(raw: string | undefined): projects.SessionScratch | undefined;
|
|
60
|
+
scratchRoot(dir: string, s: projects.SessionScratch): string | undefined;
|
|
45
61
|
bindSession(app: App, sid: string, dirs: readonly string[], o?: {
|
|
46
62
|
person?: boolean;
|
|
47
|
-
over?: boolean;
|
|
63
|
+
over?: boolean | readonly projects.OverWhy[];
|
|
48
64
|
constraint?: projects.ProjectShare;
|
|
49
65
|
inbound?: boolean;
|
|
66
|
+
scratch?: projects.SessionScratch;
|
|
50
67
|
}): Promise<projects.SessionBinding | undefined>;
|
|
51
68
|
agentEnv(env: Record<string, string | undefined> | undefined): boolean;
|
|
52
69
|
agentContext(env: Record<string, string | undefined> | undefined): boolean;
|
|
53
70
|
personTokenFile(home: string): string;
|
|
54
71
|
personToken(home: string): string;
|
|
72
|
+
renewPersonToken(home: string): string;
|
|
73
|
+
identityHere(home: string): boolean;
|
|
55
74
|
personTokenOk(env: Record<string, string | undefined> | undefined, home: string | undefined): boolean;
|
|
56
75
|
takePersonToken(env: Record<string, string | undefined>, home: string | undefined): boolean;
|
|
57
76
|
assertPersonForWidening(app: Pick<App, "env"> & {
|
|
58
77
|
front?: boolean;
|
|
59
|
-
|
|
78
|
+
home?: string;
|
|
79
|
+
}, what: string, confirm: projects.ConfirmTty, why?: string, opts?: {
|
|
80
|
+
noTokenBeforeIdentity?: boolean;
|
|
81
|
+
}): Promise<void>;
|
|
82
|
+
assertSpeaksFor(app: App, sid: string): Promise<void>;
|
|
60
83
|
personHere(app: Pick<App, "env"> & {
|
|
61
84
|
front?: boolean;
|
|
62
85
|
}): boolean;
|
|
63
86
|
sessionBinding(app: App, sid: string): Promise<projects.SessionBinding | undefined>;
|
|
87
|
+
privateReasons(doc: projects.ProjectsDoc, b: projects.SessionBinding): projects.PrivateReason[];
|
|
88
|
+
privateRemedy(causes: readonly projects.PrivateCause[], names: string[]): string;
|
|
89
|
+
stickyPrivate(c: projects.Ceiling): boolean;
|
|
64
90
|
sessionCeiling(app: App, sid: string, binding?: projects.SessionBinding | null): Promise<projects.Ceiling>;
|
|
65
91
|
ceilingAudience(app: App, c: projects.Ceiling): Promise<Set<string> | undefined>;
|
|
66
92
|
shareHint(names: string[]): string;
|
|
@@ -70,17 +96,50 @@ export declare const realOps: {
|
|
|
70
96
|
}): Promise<void>;
|
|
71
97
|
friendIds(app: App): Promise<Set<string>>;
|
|
72
98
|
sessionProjectView(app: App, sid: string): Promise<projects.SessionProjectView>;
|
|
99
|
+
showSession(app: App, sid: string): Promise<projects.SessionShow>;
|
|
73
100
|
defaultCircleNotice(app: App, sid: string): Promise<string | undefined>;
|
|
101
|
+
isLoopbackEndpoint(url: unknown): url is string;
|
|
102
|
+
normalizeLoopbackEndpoint(url: unknown): string | undefined;
|
|
103
|
+
localGraphEndpoint(_env: Record<string, string | undefined>, file?: {
|
|
104
|
+
ixEndpoint?: unknown;
|
|
105
|
+
}): string;
|
|
106
|
+
graphTargetOf(inputs: readonly projects.GraphShareInput[], o: {
|
|
107
|
+
local: string;
|
|
108
|
+
sharedGraphs?: ReadonlyMap<string, string>;
|
|
109
|
+
}): projects.GraphTarget;
|
|
110
|
+
normalizeSharedEndpoint(url: unknown): string | undefined;
|
|
111
|
+
graphTarget(app: App, o?: {
|
|
112
|
+
sid?: string;
|
|
113
|
+
dirs?: readonly string[];
|
|
114
|
+
paths?: readonly string[];
|
|
115
|
+
over?: boolean;
|
|
116
|
+
}, sharedGraphs?: ReadonlyMap<string, string>): Promise<projects.GraphTarget>;
|
|
117
|
+
projectGraphTarget(app: Pick<App, "env" | "file">, ref: Pick<projects.ProjectRef, "id" | "name" | "repoPrivate">, doc: projects.ProjectsDoc): projects.GraphTarget;
|
|
118
|
+
describeGraphTarget(t: projects.GraphTarget): string;
|
|
119
|
+
graphTargetLine(t: projects.GraphTarget): string;
|
|
120
|
+
graphPlaintextNote(t: projects.GraphTarget): string;
|
|
121
|
+
graphPinnedEnv(env: Record<string, string | undefined>, target: projects.GraphTarget, base?: Record<string, string | undefined>): Record<string, string | undefined>;
|
|
74
122
|
PERSON_SESSION: "tui";
|
|
75
123
|
PRIVATE_MARKER: ".p2p-private";
|
|
76
124
|
MAX_SESSION_DIRS: 512;
|
|
77
|
-
MAX_SESSION_PROJECTS:
|
|
125
|
+
MAX_SESSION_PROJECTS: 64;
|
|
78
126
|
SESSION_BINDING_TTL_MS: number;
|
|
79
127
|
MAX_PROJECT_SHARES: 32;
|
|
80
128
|
MAX_SESSION_CONSTRAINTS: 16;
|
|
129
|
+
MAX_UNDER: 64;
|
|
130
|
+
NESTED_SCAN_DEPTH: 4;
|
|
131
|
+
NESTED_SCAN_ENTRIES: 2000;
|
|
132
|
+
SCRATCH_ENV: "P2P_SESSION_SCRATCH";
|
|
133
|
+
SCRATCH_SCAN_ENTRIES: 4096;
|
|
81
134
|
AGENT_ENV_VARS: readonly string[];
|
|
82
135
|
isAgentProcess: typeof projects.isAgentProcess;
|
|
83
136
|
PROJECT_NOTICE_PREFIX: "project boundaries:";
|
|
137
|
+
GRAPH_LOCAL_ONLY: "local only";
|
|
138
|
+
DEFAULT_IX_ENDPOINT: "http://localhost:8090";
|
|
139
|
+
SHARED_GRAPHS: ReadonlyMap<string, string>;
|
|
140
|
+
MAX_GRAPH_PATHS: 64;
|
|
141
|
+
IX_CLOUD_ENV: readonly string[];
|
|
142
|
+
IX_KEEP: readonly string[];
|
|
84
143
|
readRotationState(home: string): Promise<rotation.RotationState | undefined>;
|
|
85
144
|
adoptHome(app: App, src: string, tag: string): Promise<string>;
|
|
86
145
|
raiseRotationAlert(app: App, r: import("@peer2peer/core/v3").VerifiedRotation, by?: string): Promise<boolean>;
|
|
@@ -234,6 +293,7 @@ export declare const realOps: {
|
|
|
234
293
|
user: string;
|
|
235
294
|
pick?: string;
|
|
236
295
|
};
|
|
296
|
+
tuiTaintNote(app: App, toUserId: string, now?: number): Promise<string | undefined>;
|
|
237
297
|
sendSharing(app: App, o: sessions.SendOpts): Promise<{
|
|
238
298
|
result: sessions.SendResult;
|
|
239
299
|
shared?: {
|
|
@@ -246,7 +306,7 @@ export declare const realOps: {
|
|
|
246
306
|
onSessionEnvelope(app: App, env: string, r: import("@peer2peer/core/v3").AcceptedMessageV3): Promise<import("./inbound.js").NewEvent[]>;
|
|
247
307
|
bindFromEnv(app: App, sid: string, extra?: readonly string[], o?: {
|
|
248
308
|
person?: boolean;
|
|
249
|
-
over?:
|
|
309
|
+
over?: projects.OverWhy[];
|
|
250
310
|
}): Promise<void>;
|
|
251
311
|
sessionsWithin(app: App, b: import("@peer2peer/core/v3").ProjectBound, now?: number): Promise<string[]>;
|
|
252
312
|
bindBound(app: App, sid: string, bound: unknown): Promise<projects.SessionProjectView>;
|
|
@@ -265,6 +325,9 @@ export declare const realOps: {
|
|
|
265
325
|
OPEN_CIRCLE_NO_FOLLOW: "kept private: your default circle is open (anyone its owner admits can see what's shared there), so a session already running doesn't move into it by itself; share it with `p2p session roster <sid> --circle <cid>` (or /peers circle <cid>)";
|
|
266
326
|
STATUS_FANOUT: 8;
|
|
267
327
|
OFFLINE_TARGET_MS: number;
|
|
328
|
+
LOCAL_SEND_TTL_MS: number;
|
|
329
|
+
LOCAL_SENDS_MAX: 4096;
|
|
330
|
+
TUI_TAINT_MS: number;
|
|
268
331
|
MAX_EXT_PLAINTEXT_BYTES: number;
|
|
269
332
|
resolveCircle(app: App, input: string): Promise<import("@peer2peer/core/v3").LoadedCircle>;
|
|
270
333
|
encodeCircleLink(head: string, hint: circles.CircleHint | undefined, web?: boolean): string;
|
|
@@ -497,6 +560,8 @@ export declare const realOps: {
|
|
|
497
560
|
})[]>;
|
|
498
561
|
getHeld(app: App, id: string): Promise<import("./state.js").HeldItem>;
|
|
499
562
|
HELD_ID_MIN_PREFIX: 8;
|
|
563
|
+
p2pCommand(platform?: NodeJS.Platform): string;
|
|
564
|
+
noRelaysReason(home: string, platform?: NodeJS.Platform): string;
|
|
500
565
|
init(app: App, opts: {
|
|
501
566
|
name?: string;
|
|
502
567
|
relays?: string[];
|
|
@@ -504,8 +569,10 @@ export declare const realOps: {
|
|
|
504
569
|
setup(app: App, opts: {
|
|
505
570
|
name?: string;
|
|
506
571
|
relays?: string[];
|
|
507
|
-
backup?:
|
|
572
|
+
backup?: identity.BackupMode;
|
|
508
573
|
backupFile?: string;
|
|
574
|
+
ix?: boolean;
|
|
575
|
+
chooseBackup?: (created: identity.InitResult) => Promise<identity.BackupMode>;
|
|
509
576
|
}): Promise<identity.SetupResult>;
|
|
510
577
|
relaysList(app: App): Promise<{
|
|
511
578
|
relays: string[];
|
|
@@ -532,6 +599,7 @@ export declare const realOps: {
|
|
|
532
599
|
linkJoin(app: App, code: string, opts?: {
|
|
533
600
|
label?: string;
|
|
534
601
|
maxWaitMs?: number;
|
|
602
|
+
allowPrivateRelay?: boolean;
|
|
535
603
|
}): Promise<identity.LinkJoin>;
|
|
536
604
|
backupShow(app: App): Promise<{
|
|
537
605
|
phrase: string;
|
|
@@ -599,6 +667,8 @@ export interface ProgramDeps {
|
|
|
599
667
|
noInput?: boolean;
|
|
600
668
|
/** The person token was valid (main() checks it once and removes it from the environment: projects.ts). */
|
|
601
669
|
front?: boolean;
|
|
670
|
+
/** A person token was passed that isn't this home's (person.key was replaced since): every command refuses it (main()). */
|
|
671
|
+
personTokenStale?: boolean;
|
|
602
672
|
/** The person's "yes" on their controlling terminal (tty-confirm.ts; tests stand in). */
|
|
603
673
|
confirmTty?: projects.ConfirmTty;
|
|
604
674
|
}
|