@indexnetwork/cli 0.13.1 → 0.13.2-rc.58.1
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 +6 -6
- package/dist/index.js +154 -127
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -102,18 +102,18 @@ Status values: `pending`, `accepted`, `rejected`, `expired`.
|
|
|
102
102
|
|
|
103
103
|
### `index network`
|
|
104
104
|
|
|
105
|
-
Manage networks (communities).
|
|
105
|
+
Manage networks (communities). Network creation is direct for eligible staff; otherwise the command submits an early-access request. Invitations accept any valid email and use the server invitation flow.
|
|
106
106
|
|
|
107
107
|
```bash
|
|
108
108
|
index network list # List your networks
|
|
109
|
-
index network create "My Network"
|
|
110
|
-
index network create "AI" --prompt "AI researchers" # Create with description
|
|
109
|
+
index network create "My Network" # Create directly when eligible; otherwise submit an early-access request
|
|
110
|
+
index network create "AI" --prompt "AI researchers" # Create or request with a description
|
|
111
111
|
index network show <id> # Show details and members
|
|
112
112
|
index network update <id> --title "New Name" # Update a network
|
|
113
113
|
index network delete <id> # Delete a network
|
|
114
114
|
index network join <id> # Join a public network
|
|
115
115
|
index network leave <id> # Leave a network
|
|
116
|
-
index network invite <id> user@email
|
|
116
|
+
index network invite <id> user@email # Invite directly by email
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
### `index conversation`
|
|
@@ -134,12 +134,12 @@ index conversation stream # Real-time SSE stream
|
|
|
134
134
|
|
|
135
135
|
### `index profile`
|
|
136
136
|
|
|
137
|
-
View user profiles and
|
|
137
|
+
View user profiles and synchronously enrich your public identity, social, and avatar data.
|
|
138
138
|
|
|
139
139
|
```bash
|
|
140
140
|
index profile # Show your own profile
|
|
141
141
|
index profile show <user-id> # Show another user's profile
|
|
142
|
-
index profile sync #
|
|
142
|
+
index profile sync # Enrich your profile now and return the resolved identity
|
|
143
143
|
index profile search <query> # Search profiles by name or keyword
|
|
144
144
|
index profile create # Generate profile from social links
|
|
145
145
|
index profile update <action> [--details <text>] # Update profile (action is the verb-phrase, e.g. "add interests")
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,38 @@ var __export = (target, all) => {
|
|
|
16
16
|
|
|
17
17
|
// src/main.ts
|
|
18
18
|
import { spawn } from "node:child_process";
|
|
19
|
+
// package.json
|
|
20
|
+
var package_default = {
|
|
21
|
+
name: "@indexnetwork/cli",
|
|
22
|
+
version: "0.13.2",
|
|
23
|
+
description: "Command-line interface for Index Network",
|
|
24
|
+
license: "MIT",
|
|
25
|
+
type: "module",
|
|
26
|
+
bin: {
|
|
27
|
+
index: "bin/index.cjs"
|
|
28
|
+
},
|
|
29
|
+
files: [
|
|
30
|
+
"bin/",
|
|
31
|
+
"dist/",
|
|
32
|
+
"README.md"
|
|
33
|
+
],
|
|
34
|
+
scripts: {
|
|
35
|
+
dev: "bun src/main.ts",
|
|
36
|
+
build: "bun scripts/build.ts",
|
|
37
|
+
test: "NODE_ENV=test bun test",
|
|
38
|
+
lint: "eslint src/**/*.ts",
|
|
39
|
+
"publish:all": "bun scripts/publish.ts"
|
|
40
|
+
},
|
|
41
|
+
optionalDependencies: {
|
|
42
|
+
"@indexnetwork/cli-linux-x64": "0.13.2",
|
|
43
|
+
"@indexnetwork/cli-linux-arm64": "0.13.2",
|
|
44
|
+
"@indexnetwork/cli-darwin-x64": "0.13.2",
|
|
45
|
+
"@indexnetwork/cli-darwin-arm64": "0.13.2"
|
|
46
|
+
},
|
|
47
|
+
devDependencies: {
|
|
48
|
+
"@types/bun": "1.3.14"
|
|
49
|
+
}
|
|
50
|
+
};
|
|
19
51
|
|
|
20
52
|
// src/args.parser.ts
|
|
21
53
|
var KNOWN_COMMANDS = new Set(["login", "logout", "profile", "intent", "opportunity", "negotiation", "network", "conversation", "contact", "scrape", "onboarding", "sync", "help", "version"]);
|
|
@@ -259,6 +291,12 @@ class ApiError extends Error {
|
|
|
259
291
|
this.name = "ApiError";
|
|
260
292
|
}
|
|
261
293
|
}
|
|
294
|
+
function isEarlyAccessNetworkCreationError(error) {
|
|
295
|
+
if (!(error instanceof ApiError) || error.status !== 403)
|
|
296
|
+
return false;
|
|
297
|
+
const response = error.response;
|
|
298
|
+
return typeof response === "object" && response !== null && "error" in response && typeof response.error === "string" && response.error.startsWith("Network creation is in early access.");
|
|
299
|
+
}
|
|
262
300
|
|
|
263
301
|
class ApiClient {
|
|
264
302
|
baseUrl;
|
|
@@ -318,10 +356,10 @@ class ApiClient {
|
|
|
318
356
|
const res = await this.get(`/api/opportunities/${id}`);
|
|
319
357
|
return await res.json();
|
|
320
358
|
}
|
|
321
|
-
async
|
|
359
|
+
async updateOpportunityStatus(id, status, acknowledgedUptakeQuestionIds) {
|
|
322
360
|
const res = await this.patch(`/api/opportunities/${id}/status`, {
|
|
323
|
-
status
|
|
324
|
-
...acknowledgedUptakeQuestionIds ? { acknowledgedUptakeQuestionIds } : {}
|
|
361
|
+
status,
|
|
362
|
+
...status === "accepted" && acknowledgedUptakeQuestionIds ? { acknowledgedUptakeQuestionIds } : {}
|
|
325
363
|
});
|
|
326
364
|
return await res.json();
|
|
327
365
|
}
|
|
@@ -369,6 +407,9 @@ class ApiClient {
|
|
|
369
407
|
const body = await res.json();
|
|
370
408
|
return body;
|
|
371
409
|
}
|
|
410
|
+
async updateIntent(intentId, description) {
|
|
411
|
+
return this.callTool("update_intent", { intentId, description });
|
|
412
|
+
}
|
|
372
413
|
async listNetworks() {
|
|
373
414
|
const res = await this.get("/api/networks");
|
|
374
415
|
const body = await res.json();
|
|
@@ -377,13 +418,24 @@ class ApiClient {
|
|
|
377
418
|
joinPolicy: n.joinPolicy ?? n.permissions?.joinPolicy
|
|
378
419
|
}));
|
|
379
420
|
}
|
|
380
|
-
async
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
421
|
+
async createNetworkOrRequest(title, prompt) {
|
|
422
|
+
try {
|
|
423
|
+
const res2 = await this.post("/api/networks", {
|
|
424
|
+
title,
|
|
425
|
+
...prompt ? { prompt } : {}
|
|
426
|
+
});
|
|
427
|
+
const body2 = await res2.json();
|
|
428
|
+
return { kind: "created", network: body2.network };
|
|
429
|
+
} catch (error) {
|
|
430
|
+
if (!isEarlyAccessNetworkCreationError(error))
|
|
431
|
+
throw error;
|
|
432
|
+
}
|
|
433
|
+
const res = await this.post("/api/network-requests", {
|
|
434
|
+
name: title,
|
|
435
|
+
...prompt ? { purpose: prompt } : {}
|
|
384
436
|
});
|
|
385
437
|
const body = await res.json();
|
|
386
|
-
return body.
|
|
438
|
+
return { kind: "requested", request: body.request };
|
|
387
439
|
}
|
|
388
440
|
async getNetwork(id) {
|
|
389
441
|
const res = await this.get(`/api/networks/${id}`);
|
|
@@ -404,18 +456,12 @@ class ApiClient {
|
|
|
404
456
|
async leaveNetwork(id) {
|
|
405
457
|
await this.post(`/api/networks/${id}/leave`, {});
|
|
406
458
|
}
|
|
407
|
-
async
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
return body.users;
|
|
414
|
-
}
|
|
415
|
-
async addNetworkMember(networkId, userId) {
|
|
416
|
-
const res = await this.post(`/api/networks/${networkId}/members`, { userId });
|
|
417
|
-
const body = await res.json();
|
|
418
|
-
return body;
|
|
459
|
+
async inviteNetworkMember(networkId, email, name) {
|
|
460
|
+
const res = await this.post(`/api/networks/${networkId}/members/invite`, {
|
|
461
|
+
email,
|
|
462
|
+
...name ? { name } : {}
|
|
463
|
+
});
|
|
464
|
+
return await res.json();
|
|
419
465
|
}
|
|
420
466
|
async listConversations() {
|
|
421
467
|
const res = await this.get("/api/conversations");
|
|
@@ -476,6 +522,19 @@ class ApiClient {
|
|
|
476
522
|
const body = await res.json();
|
|
477
523
|
return body.negotiations;
|
|
478
524
|
}
|
|
525
|
+
async enrichProfile() {
|
|
526
|
+
const res = await this.post("/api/enrichment/enrich", {});
|
|
527
|
+
return await res.json();
|
|
528
|
+
}
|
|
529
|
+
async readUserContexts(query = {}) {
|
|
530
|
+
return this.callTool("read_user_contexts", query);
|
|
531
|
+
}
|
|
532
|
+
async createUserContext(query) {
|
|
533
|
+
return this.callTool("create_user_context", query);
|
|
534
|
+
}
|
|
535
|
+
async updateUserContext(query) {
|
|
536
|
+
return this.callTool("update_user_context", query);
|
|
537
|
+
}
|
|
479
538
|
async callTool(toolName, query = {}) {
|
|
480
539
|
const res = await this.post(`/api/tools/${toolName}`, { query });
|
|
481
540
|
return await res.json();
|
|
@@ -651,8 +710,8 @@ async function handleLogin(apiUrl, appUrl, store, options = {}) {
|
|
|
651
710
|
const server = (options.serverFactory ?? createServer)(async (req, res) => {
|
|
652
711
|
const url = new URL(req.url ?? "/", "http://localhost");
|
|
653
712
|
if (req.method !== "GET" || url.pathname !== "/callback") {
|
|
654
|
-
res.writeHead(404, { "Content-Type": "text/
|
|
655
|
-
res.end("Not
|
|
713
|
+
res.writeHead(404, { "Content-Type": "text/html" });
|
|
714
|
+
res.end(callbackHtml("Not found", "Unexpected request."));
|
|
656
715
|
return;
|
|
657
716
|
}
|
|
658
717
|
const callbackState = url.searchParams.get("state");
|
|
@@ -686,7 +745,7 @@ async function handleLogin(apiUrl, appUrl, store, options = {}) {
|
|
|
686
745
|
return;
|
|
687
746
|
}
|
|
688
747
|
res.writeHead(200, { "Content-Type": "text/html" });
|
|
689
|
-
res.end(callbackHtml("CLI authorized", "You can close this window and return to the terminal."));
|
|
748
|
+
res.end(callbackHtml("CLI authorized", "You can close this window and return to the terminal.", true));
|
|
690
749
|
return;
|
|
691
750
|
}
|
|
692
751
|
if (!apiKey && sessionToken) {
|
|
@@ -704,7 +763,7 @@ async function handleLogin(apiUrl, appUrl, store, options = {}) {
|
|
|
704
763
|
return;
|
|
705
764
|
}
|
|
706
765
|
res.writeHead(200, { "Content-Type": "text/html" });
|
|
707
|
-
res.end(callbackHtml("CLI authorized", "You can close this window and return to the terminal."));
|
|
766
|
+
res.end(callbackHtml("CLI authorized", "You can close this window and return to the terminal.", true));
|
|
708
767
|
return;
|
|
709
768
|
}
|
|
710
769
|
resolveCallback({
|
|
@@ -787,51 +846,39 @@ async function handleLogin(apiUrl, appUrl, store, options = {}) {
|
|
|
787
846
|
callbackPromise: wrappedPromise
|
|
788
847
|
};
|
|
789
848
|
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
<
|
|
793
|
-
<
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
color: #666;
|
|
824
|
-
line-height: 1.5;
|
|
825
|
-
}
|
|
826
|
-
</style>
|
|
827
|
-
</head>
|
|
828
|
-
<body>
|
|
829
|
-
<div class="card">
|
|
830
|
-
<h1>${title}</h1>
|
|
831
|
-
<p>${message}</p>
|
|
832
|
-
</div>
|
|
833
|
-
</body>
|
|
834
|
-
</html>`;
|
|
849
|
+
var WORDMARK_SVG = `<svg viewBox="0 0 522 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
850
|
+
<path d="M184.51 21.66C184.51 18.33 187.42 15.73 191.23 15.73C195.04 15.73 197.95 18.33 197.95 21.66C197.95 24.99 195.1 27.54 191.23 27.54C187.36 27.54 184.51 25 184.51 21.66Z" fill="white"/>
|
|
851
|
+
<path d="M0 0.72998H7.47V42.61H0V0.72998Z" fill="white"/>
|
|
852
|
+
<path d="M16.6301 0.72998H25.0701L44.3701 27.26H45.4001V0.72998H52.9301V42.61H44.4301L25.1901 16.08H24.1001V42.61H16.6301V0.72998Z" fill="white"/>
|
|
853
|
+
<path d="M99.91 21.67C99.91 33.63 90.74 42.61 78.54 42.61H62.03V0.72998H78.54C90.74 0.72998 99.91 9.70995 99.91 21.67ZM92.2 21.67C92.2 14.93 86.25 9.88998 78.3 9.88998H69.5V33.44H78.3C86.25 33.44 92.2 28.4 92.2 21.66V21.67Z" fill="white"/>
|
|
854
|
+
<path d="M137.61 33.45V42.62H107.08V0.73999H137.31V9.91H114.55V17.13H135.31V25.99H114.55V33.46H137.62L137.61 33.45Z" fill="white"/>
|
|
855
|
+
<path d="M167.53 21.7899L181.49 42.61H172.75L162.43 27.86H160.97L150.71 42.61H141.3L155.56 21.37L141.84 0.72998H150.58L160.66 15.36H162.06L172.14 0.72998H181.55L167.53 21.7899Z" fill="white"/>
|
|
856
|
+
<path d="M209.87 0.72998H218.31L237.61 27.26H238.64V0.72998H246.17V42.61H237.67L218.43 16.08H217.34V42.61H209.87V0.72998Z" fill="white"/>
|
|
857
|
+
<path d="M285.8 33.45V42.62H255.27V0.73999H285.5V9.91H262.74V17.13H283.5V25.99H262.74V33.46H285.81L285.8 33.45Z" fill="white"/>
|
|
858
|
+
<path d="M324.77 9.88998H311.48V42.61H304.01V9.88998H290.72V0.719971H324.77V9.88998Z" fill="white"/>
|
|
859
|
+
<path d="M328.96 0.72998H336.91L346.14 28.35H347.41L356.09 0.72998H362.71L371.45 28.35H372.79L381.89 0.72998H390.33L376.92 42.61H368.42L360.59 17.24H358.71L350.88 42.61H342.38L328.97 0.72998H328.96Z" fill="white"/>
|
|
860
|
+
<path d="M391.54 21.67C391.54 9.34998 401.07 0 413.7 0C426.33 0 435.86 9.34998 435.86 21.67C435.86 33.99 426.33 43.34 413.7 43.34C401.07 43.34 391.54 33.99 391.54 21.67ZM428.14 21.67C428.14 14.63 421.89 9.35004 413.69 9.35004C405.49 9.35004 399.24 14.63 399.24 21.67C399.24 28.71 405.49 33.99 413.69 33.99C421.89 33.99 428.14 28.71 428.14 21.67Z" fill="white"/>
|
|
861
|
+
<path d="M459.46 29.5H450.42V42.61H442.95V0.72998H462.13C470.57 0.72998 477 6.91996 477 15.12C477 21.31 473.36 26.35 467.9 28.47L477.55 42.61H468.45L459.47 29.5H459.46ZM450.42 20.33H461.95C466.44 20.33 469.23 18.27 469.23 15.11C469.23 11.95 466.44 9.88998 461.95 9.88998H450.42V20.33Z" fill="white"/>
|
|
862
|
+
<path d="M497.83 25.56L491.4 30.96V42.61H483.93V0.72998H491.4V17.67H492.92L509.07 0.72998H521.03L503.31 20.21L521.46 42.61H512.11L497.85 25.55L497.83 25.56Z" fill="white"/>
|
|
863
|
+
</svg>`;
|
|
864
|
+
function callbackHtml(title, message, ok = false) {
|
|
865
|
+
const check = ok ? `<div class="check"><svg viewBox="0 0 24 24" width="26" height="26" fill="none" stroke="#0b1612" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg></div>` : "";
|
|
866
|
+
return `<!doctype html><html><head><meta charset="utf-8"><title>${title} · index</title>
|
|
867
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
868
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
869
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Public+Sans:wght@300;400;500;600&display=swap">
|
|
870
|
+
<style>
|
|
871
|
+
body{margin:0;min-height:100vh;display:flex;flex-direction:column;background:#14241f;color:#F4FBF6;font-family:'Public Sans',system-ui,sans-serif;-webkit-font-smoothing:antialiased}
|
|
872
|
+
.nav{display:flex;align-items:center;padding:22px 56px}
|
|
873
|
+
.nav svg{height:14px;width:auto;display:block}
|
|
874
|
+
main{flex:1;display:flex;align-items:center;justify-content:center;padding:24px}
|
|
875
|
+
.c{text-align:center;max-width:420px}
|
|
876
|
+
.check{width:56px;height:56px;margin:0 auto 26px;border-radius:50%;background:#3FBF7F;display:flex;align-items:center;justify-content:center}
|
|
877
|
+
h1{font-size:20px;font-weight:600;margin:0 0 10px}
|
|
878
|
+
p{font-size:14px;font-weight:500;margin:0;color:rgba(244,251,246,0.78)}
|
|
879
|
+
</style></head>
|
|
880
|
+
<body><nav class="nav">${WORDMARK_SVG}</nav>
|
|
881
|
+
<main><div class="c">${check}<h1>${title}</h1><p>${message}</p></div></main></body></html>`;
|
|
835
882
|
}
|
|
836
883
|
|
|
837
884
|
// src/logout.command.ts
|
|
@@ -982,9 +1029,9 @@ function toolActivity(description) {
|
|
|
982
1029
|
`);
|
|
983
1030
|
}
|
|
984
1031
|
var TOOL_DESCRIPTIONS = {
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1032
|
+
read_user_contexts: "Reading your profile...",
|
|
1033
|
+
create_user_context: "Creating your profile...",
|
|
1034
|
+
update_user_context: "Updating your profile...",
|
|
988
1035
|
read_intents: "Fetching your active signals...",
|
|
989
1036
|
create_intent: "Creating a new signal...",
|
|
990
1037
|
update_intent: "Updating signal...",
|
|
@@ -1688,7 +1735,7 @@ async function handleProfile(client, subcommand, positionals, options = {}) {
|
|
|
1688
1735
|
error("Usage: index profile search <query>", 1);
|
|
1689
1736
|
return;
|
|
1690
1737
|
}
|
|
1691
|
-
const result = await client.
|
|
1738
|
+
const result = await client.readUserContexts({ query });
|
|
1692
1739
|
if (options.json) {
|
|
1693
1740
|
console.log(JSON.stringify(result));
|
|
1694
1741
|
return;
|
|
@@ -1738,32 +1785,18 @@ async function profileShow(client, userId, json) {
|
|
|
1738
1785
|
}
|
|
1739
1786
|
async function profileSync(client, json) {
|
|
1740
1787
|
if (!json)
|
|
1741
|
-
info("
|
|
1742
|
-
const
|
|
1743
|
-
if (!check.success) {
|
|
1744
|
-
if (json) {
|
|
1745
|
-
console.log(JSON.stringify(check));
|
|
1746
|
-
return;
|
|
1747
|
-
}
|
|
1748
|
-
error(check.error ?? "Failed to check profile status", 1);
|
|
1749
|
-
return;
|
|
1750
|
-
}
|
|
1751
|
-
const hasProfile = check.data?.hasProfile;
|
|
1752
|
-
let result;
|
|
1753
|
-
if (hasProfile) {
|
|
1754
|
-
result = await client.callTool("update_user_profile", { action: "regenerate" });
|
|
1755
|
-
} else {
|
|
1756
|
-
result = await client.callTool("create_user_profile", { confirm: true });
|
|
1757
|
-
}
|
|
1788
|
+
info("Enriching profile...");
|
|
1789
|
+
const result = await client.enrichProfile();
|
|
1758
1790
|
if (json) {
|
|
1759
1791
|
console.log(JSON.stringify(result));
|
|
1760
1792
|
return;
|
|
1761
1793
|
}
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1794
|
+
success("Profile enriched.");
|
|
1795
|
+
if (result.profile.name)
|
|
1796
|
+
dim(` Name: ${result.profile.name}`);
|
|
1797
|
+
if (result.profile.location)
|
|
1798
|
+
dim(` Location: ${result.profile.location}`);
|
|
1799
|
+
dim(` Social links: ${result.profile.socials.length}`);
|
|
1767
1800
|
}
|
|
1768
1801
|
async function profileCreate(client, options, json) {
|
|
1769
1802
|
if (!json)
|
|
@@ -1775,7 +1808,7 @@ async function profileCreate(client, options, json) {
|
|
|
1775
1808
|
query.githubUrl = options.github;
|
|
1776
1809
|
if (options.twitter)
|
|
1777
1810
|
query.twitterUrl = options.twitter;
|
|
1778
|
-
const result = await client.
|
|
1811
|
+
const result = await client.createUserContext(query);
|
|
1779
1812
|
if (json) {
|
|
1780
1813
|
console.log(JSON.stringify(result));
|
|
1781
1814
|
return;
|
|
@@ -1792,7 +1825,7 @@ async function profileUpdate(client, action, details, json) {
|
|
|
1792
1825
|
const query = { action };
|
|
1793
1826
|
if (details)
|
|
1794
1827
|
query.details = details;
|
|
1795
|
-
const result = await client.
|
|
1828
|
+
const result = await client.updateUserContext(query);
|
|
1796
1829
|
if (json) {
|
|
1797
1830
|
console.log(JSON.stringify(result));
|
|
1798
1831
|
return;
|
|
@@ -1897,10 +1930,7 @@ async function handleIntent(client, subcommand, options) {
|
|
|
1897
1930
|
}
|
|
1898
1931
|
if (!options.json)
|
|
1899
1932
|
info("Updating signal...");
|
|
1900
|
-
const result = await client.
|
|
1901
|
-
intentId: options.intentId,
|
|
1902
|
-
newDescription: options.intentContent
|
|
1903
|
-
});
|
|
1933
|
+
const result = await client.updateIntent(options.intentId, options.intentContent);
|
|
1904
1934
|
if (options.json) {
|
|
1905
1935
|
console.log(JSON.stringify(result));
|
|
1906
1936
|
return;
|
|
@@ -2063,7 +2093,7 @@ async function opportunityStatusUpdate(client, id, status2, json, acknowledgedUp
|
|
|
2063
2093
|
const opportunity = await client.getOpportunity(id);
|
|
2064
2094
|
if (status2 === "accepted") {
|
|
2065
2095
|
try {
|
|
2066
|
-
const result2 = await client.
|
|
2096
|
+
const result2 = await client.updateOpportunityStatus(opportunity.id, "accepted", acknowledgedUptakeQuestionIds);
|
|
2067
2097
|
if (json) {
|
|
2068
2098
|
console.log(JSON.stringify(result2));
|
|
2069
2099
|
return;
|
|
@@ -2093,18 +2123,11 @@ ${question.title}`);
|
|
|
2093
2123
|
}
|
|
2094
2124
|
return;
|
|
2095
2125
|
}
|
|
2096
|
-
const result = await client.
|
|
2097
|
-
opportunityId: opportunity.id,
|
|
2098
|
-
status: status2
|
|
2099
|
-
});
|
|
2126
|
+
const result = await client.updateOpportunityStatus(opportunity.id, "rejected");
|
|
2100
2127
|
if (json) {
|
|
2101
2128
|
console.log(JSON.stringify(result));
|
|
2102
2129
|
return;
|
|
2103
2130
|
}
|
|
2104
|
-
if (!result.success) {
|
|
2105
|
-
error(result.error ?? "Failed to reject opportunity", 1);
|
|
2106
|
-
return;
|
|
2107
|
-
}
|
|
2108
2131
|
success("Opportunity rejected.");
|
|
2109
2132
|
}
|
|
2110
2133
|
function uptakeAdvisoryFromError(error2) {
|
|
@@ -2285,8 +2308,8 @@ function negotiationCard(n) {
|
|
|
2285
2308
|
var NETWORK_HELP = `
|
|
2286
2309
|
Network Commands:
|
|
2287
2310
|
index network list List your networks
|
|
2288
|
-
index network create <name> Create
|
|
2289
|
-
index network create <name> --prompt Create with a description
|
|
2311
|
+
index network create <name> Create directly or submit an early-access request
|
|
2312
|
+
index network create <name> --prompt Create directly or request early access with a description
|
|
2290
2313
|
index network show <id|key> Show network details and members
|
|
2291
2314
|
index network update <id> [--title <t>] [--prompt <p>]
|
|
2292
2315
|
Update a network
|
|
@@ -2345,11 +2368,18 @@ async function networkCreate(client, name, prompt, json) {
|
|
|
2345
2368
|
error("Usage: index network create <name>", 1);
|
|
2346
2369
|
return;
|
|
2347
2370
|
}
|
|
2348
|
-
const
|
|
2371
|
+
const result = await client.createNetworkOrRequest(name, prompt);
|
|
2349
2372
|
if (json) {
|
|
2350
|
-
console.log(JSON.stringify(
|
|
2373
|
+
console.log(JSON.stringify(result));
|
|
2374
|
+
return;
|
|
2375
|
+
}
|
|
2376
|
+
if (result.kind === "requested") {
|
|
2377
|
+
success(`Network request submitted: ${result.request.title}`);
|
|
2378
|
+
dim(` Status: ${result.request.status}`);
|
|
2379
|
+
dim(` Request ID: ${result.request.id}`);
|
|
2351
2380
|
return;
|
|
2352
2381
|
}
|
|
2382
|
+
const { network } = result;
|
|
2353
2383
|
success(`Network created: ${network.title}`);
|
|
2354
2384
|
if (network.key) {
|
|
2355
2385
|
dim(` Key: ${network.key}`);
|
|
@@ -2443,21 +2473,18 @@ async function networkInvite(client, id, email, json) {
|
|
|
2443
2473
|
error("Usage: index network invite <id> <email>", 1);
|
|
2444
2474
|
return;
|
|
2445
2475
|
}
|
|
2446
|
-
const
|
|
2447
|
-
if (users.length === 0) {
|
|
2448
|
-
error("User not found.");
|
|
2449
|
-
return;
|
|
2450
|
-
}
|
|
2451
|
-
const user = users[0];
|
|
2452
|
-
const result = await client.addNetworkMember(id, user.id);
|
|
2476
|
+
const result = await client.inviteNetworkMember(id, email);
|
|
2453
2477
|
if (json) {
|
|
2454
|
-
console.log(JSON.stringify(
|
|
2478
|
+
console.log(JSON.stringify(result));
|
|
2455
2479
|
return;
|
|
2456
2480
|
}
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2481
|
+
if (result.alreadyMember) {
|
|
2482
|
+
info(`${result.user.email} is already a network member.`);
|
|
2483
|
+
return;
|
|
2460
2484
|
}
|
|
2485
|
+
success(`Invitation sent to ${result.user.email}.`);
|
|
2486
|
+
if (result.created)
|
|
2487
|
+
dim(" Created a pending account for this invitee.");
|
|
2461
2488
|
}
|
|
2462
2489
|
|
|
2463
2490
|
// src/conversation.command.ts
|
|
@@ -3000,7 +3027,7 @@ async function handleSync(client, options) {
|
|
|
3000
3027
|
if (!options.json)
|
|
3001
3028
|
info("Syncing context...");
|
|
3002
3029
|
const [profile, networks, intents, contacts] = await Promise.all([
|
|
3003
|
-
client.
|
|
3030
|
+
client.readUserContexts(),
|
|
3004
3031
|
client.callTool("read_networks", {}),
|
|
3005
3032
|
client.callTool("read_intents", {}),
|
|
3006
3033
|
client.callTool("list_contacts", {})
|
|
@@ -3053,7 +3080,7 @@ async function onboardingComplete(client, json) {
|
|
|
3053
3080
|
// src/main.ts
|
|
3054
3081
|
var DEFAULT_API_URL = "https://protocol.index.network";
|
|
3055
3082
|
var DEFAULT_APP_URL = "https://index.network";
|
|
3056
|
-
var VERSION =
|
|
3083
|
+
var VERSION = package_default.version;
|
|
3057
3084
|
var BOX = { tl: "╭", tr: "╮", bl: "╰", br: "╯", h: "─", v: "│" };
|
|
3058
3085
|
function visualLen(s) {
|
|
3059
3086
|
return stripAnsi(s).length;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indexnetwork/cli",
|
|
3
|
-
"version": "0.13.1",
|
|
3
|
+
"version": "0.13.2-rc.58.1",
|
|
4
4
|
"description": "Command-line interface for Index Network",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"publish:all": "bun scripts/publish.ts"
|
|
21
21
|
},
|
|
22
22
|
"optionalDependencies": {
|
|
23
|
-
"@indexnetwork/cli-linux-x64": "0.13.1",
|
|
24
|
-
"@indexnetwork/cli-linux-arm64": "0.13.1",
|
|
25
|
-
"@indexnetwork/cli-darwin-x64": "0.13.1",
|
|
26
|
-
"@indexnetwork/cli-darwin-arm64": "0.13.1"
|
|
23
|
+
"@indexnetwork/cli-linux-x64": "0.13.2-rc.58.1",
|
|
24
|
+
"@indexnetwork/cli-linux-arm64": "0.13.2-rc.58.1",
|
|
25
|
+
"@indexnetwork/cli-darwin-x64": "0.13.2-rc.58.1",
|
|
26
|
+
"@indexnetwork/cli-darwin-arm64": "0.13.2-rc.58.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/bun": "1.3.14"
|