@indexnetwork/cli 0.10.2-rc.15.1 → 0.10.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/dist/index.js +159 -86
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -2938,91 +2938,164 @@ async function onboardingComplete(client, json) {
|
|
|
2938
2938
|
// src/main.ts
|
|
2939
2939
|
var DEFAULT_API_URL = "https://protocol.index.network";
|
|
2940
2940
|
var DEFAULT_APP_URL = "https://index.network";
|
|
2941
|
-
var VERSION = "0.10.
|
|
2942
|
-
var
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
2941
|
+
var VERSION = "0.10.2";
|
|
2942
|
+
var BOX = { tl: "╭", tr: "╮", bl: "╰", br: "╯", h: "─", v: "│" };
|
|
2943
|
+
function visualLen(s) {
|
|
2944
|
+
return stripAnsi(s).length;
|
|
2945
|
+
}
|
|
2946
|
+
function padVisual(s, width) {
|
|
2947
|
+
return s + " ".repeat(Math.max(0, width - visualLen(s)));
|
|
2948
|
+
}
|
|
2949
|
+
function panel(title, rows) {
|
|
2950
|
+
const innerW = Math.max(52, title.length + 4, ...rows.map((r) => visualLen(r)));
|
|
2951
|
+
const dashRun = Math.max(1, innerW - title.length - 3);
|
|
2952
|
+
const innerTop = `${BOX.h} ${title} ${BOX.h.repeat(dashRun)}`;
|
|
2953
|
+
console.log(`${GRAY}${BOX.tl}${innerTop}${BOX.tr}${RESET}`);
|
|
2954
|
+
for (const row of rows) {
|
|
2955
|
+
console.log(`${GRAY}${BOX.v}${RESET}${padVisual(row, innerW)}${GRAY}${BOX.v}${RESET}`);
|
|
2956
|
+
}
|
|
2957
|
+
console.log(`${GRAY}${BOX.bl}${BOX.h.repeat(innerW)}${BOX.br}${RESET}
|
|
2958
|
+
`);
|
|
2959
|
+
}
|
|
2960
|
+
function helpRowDim(leftW, left, right) {
|
|
2961
|
+
const pad = Math.max(0, leftW - left.length);
|
|
2962
|
+
return ` ${GRAY}${left}${" ".repeat(pad)} ${right}${RESET}`;
|
|
2963
|
+
}
|
|
2964
|
+
function helpRowCmd(leftW, left, right) {
|
|
2965
|
+
const pad = Math.max(0, leftW - left.length);
|
|
2966
|
+
return ` ${BOLD}${CYAN}${left}${RESET}${" ".repeat(pad)} ${right}`;
|
|
2967
|
+
}
|
|
2968
|
+
function helpRowCont(leftW, right) {
|
|
2969
|
+
return ` ${" ".repeat(leftW)} ${right}`;
|
|
2970
|
+
}
|
|
2971
|
+
function renderHelp() {
|
|
2972
|
+
const gsLefts = [
|
|
2973
|
+
"index login",
|
|
2974
|
+
"index login --token <token>",
|
|
2975
|
+
"index logout",
|
|
2976
|
+
'index intent create "..."',
|
|
2977
|
+
"index negotiation list",
|
|
2978
|
+
"index opportunity list"
|
|
2979
|
+
];
|
|
2980
|
+
const gsLW = Math.max(...gsLefts.map((s) => s.length));
|
|
2981
|
+
const formsLefts = [
|
|
2982
|
+
'index conversation "message"',
|
|
2983
|
+
"index conversation --session <id>",
|
|
2984
|
+
"index sync --json",
|
|
2985
|
+
"index profile create",
|
|
2986
|
+
"index profile update",
|
|
2987
|
+
"index intent list",
|
|
2988
|
+
"index negotiation list",
|
|
2989
|
+
"index opportunity list",
|
|
2990
|
+
"index opportunity discover"
|
|
2991
|
+
];
|
|
2992
|
+
const formsLW = Math.max(...formsLefts.map((s) => s.length));
|
|
2993
|
+
const cmdLefts = [
|
|
2994
|
+
"pattern",
|
|
2995
|
+
"example",
|
|
2996
|
+
"intent",
|
|
2997
|
+
"negotiation",
|
|
2998
|
+
"opportunity",
|
|
2999
|
+
"profile",
|
|
3000
|
+
"conversation",
|
|
3001
|
+
"network",
|
|
3002
|
+
"contact",
|
|
3003
|
+
"scrape",
|
|
3004
|
+
"sync",
|
|
3005
|
+
"onboarding"
|
|
3006
|
+
];
|
|
3007
|
+
const cmdLW = Math.max(...cmdLefts.map((s) => s.length));
|
|
3008
|
+
const optLefts = [
|
|
3009
|
+
"--api-url <url>",
|
|
3010
|
+
"--app-url <url>",
|
|
3011
|
+
"--token <token>",
|
|
3012
|
+
"--session <id>",
|
|
3013
|
+
"--archived",
|
|
3014
|
+
"--status <status>",
|
|
3015
|
+
"--limit <n>",
|
|
3016
|
+
"--since <date>",
|
|
3017
|
+
"--json",
|
|
3018
|
+
"--name <name>",
|
|
3019
|
+
"--gmail",
|
|
3020
|
+
"--objective <text>",
|
|
3021
|
+
"--target <uid>",
|
|
3022
|
+
"--introduce <uid>",
|
|
3023
|
+
"--linkedin <url>",
|
|
3024
|
+
"--github <url>",
|
|
3025
|
+
"--twitter <url>",
|
|
3026
|
+
"--title <text>",
|
|
3027
|
+
"--details <text>",
|
|
3028
|
+
"--help",
|
|
3029
|
+
"--version"
|
|
3030
|
+
];
|
|
3031
|
+
const optLW = Math.max(...optLefts.map((s) => s.length));
|
|
3032
|
+
console.log();
|
|
3033
|
+
console.log(` ${BOLD}${CYAN}I N D E X${RESET} ${GRAY}cli${RESET}`);
|
|
3034
|
+
console.log(` ${GRAY}v${VERSION}${RESET}
|
|
3035
|
+
`);
|
|
3036
|
+
panel("getting started", [
|
|
3037
|
+
helpRowCmd(gsLW, "index login", "authenticate via browser"),
|
|
3038
|
+
helpRowCmd(gsLW, "index login --token <token>", "authenticate with a bearer token"),
|
|
3039
|
+
helpRowCmd(gsLW, "index logout", "clear stored session"),
|
|
3040
|
+
helpRowCmd(gsLW, 'index intent create "..."', "describe what you're looking for"),
|
|
3041
|
+
helpRowCmd(gsLW, "index negotiation list", "see agent debates in progress"),
|
|
3042
|
+
helpRowCmd(gsLW, "index opportunity list", "see what was found for you")
|
|
3043
|
+
]);
|
|
3044
|
+
panel("common forms", [
|
|
3045
|
+
helpRowCmd(formsLW, 'index conversation "message"', "send a one-shot agent message"),
|
|
3046
|
+
helpRowCmd(formsLW, "index conversation --session <id>", "resume an agent chat session"),
|
|
3047
|
+
helpRowCmd(formsLW, "index sync --json", "print synced context as JSON"),
|
|
3048
|
+
"",
|
|
3049
|
+
helpRowCmd(formsLW, "index profile create", "use social URL flags"),
|
|
3050
|
+
helpRowCmd(formsLW, "index profile update", "use action text or --details"),
|
|
3051
|
+
helpRowCmd(formsLW, "index intent list", "supports --archived and --limit"),
|
|
3052
|
+
helpRowCmd(formsLW, "index negotiation list", "supports --since and --limit"),
|
|
3053
|
+
helpRowCmd(formsLW, "index opportunity list", "supports --status and --limit"),
|
|
3054
|
+
helpRowCmd(formsLW, "index opportunity discover", "supports --target and --introduce")
|
|
3055
|
+
]);
|
|
3056
|
+
panel("commands", [
|
|
3057
|
+
helpRowDim(cmdLW, "pattern", "index <command> [args] [options]"),
|
|
3058
|
+
helpRowDim(cmdLW, "example", 'index intent create "looking for a CTO"'),
|
|
3059
|
+
"",
|
|
3060
|
+
helpRowCmd(cmdLW, "intent", "list · show · create · update · archive"),
|
|
3061
|
+
helpRowCont(cmdLW, "link · unlink · links"),
|
|
3062
|
+
helpRowCmd(cmdLW, "negotiation", "list · show"),
|
|
3063
|
+
helpRowCmd(cmdLW, "opportunity", "list · show · accept · reject · discover"),
|
|
3064
|
+
"",
|
|
3065
|
+
helpRowCmd(cmdLW, "profile", "show · sync · search · create · update"),
|
|
3066
|
+
helpRowCmd(cmdLW, "conversation", "sessions · list · with · show · send · stream"),
|
|
3067
|
+
helpRowCmd(cmdLW, "network", "list · create · show · update · delete"),
|
|
3068
|
+
helpRowCont(cmdLW, "join · leave · invite"),
|
|
3069
|
+
helpRowCmd(cmdLW, "contact", "list · add · remove · import"),
|
|
3070
|
+
"",
|
|
3071
|
+
helpRowCmd(cmdLW, "scrape", "extract content from a URL"),
|
|
3072
|
+
helpRowCmd(cmdLW, "sync", "download your context locally"),
|
|
3073
|
+
helpRowCmd(cmdLW, "onboarding", "finish account setup")
|
|
3074
|
+
]);
|
|
3075
|
+
panel("options", [
|
|
3076
|
+
helpRowDim(optLW, "--api-url <url>", "override API server URL"),
|
|
3077
|
+
helpRowDim(optLW, "--app-url <url>", "override app URL for login"),
|
|
3078
|
+
helpRowDim(optLW, "--token <token>", "provide bearer token directly"),
|
|
3079
|
+
helpRowDim(optLW, "--session <id>", "resume a chat session"),
|
|
3080
|
+
helpRowDim(optLW, "--archived", "include archived signals"),
|
|
3081
|
+
helpRowDim(optLW, "--status <status>", "filter opportunities by status"),
|
|
3082
|
+
helpRowDim(optLW, "--limit <n>", "limit number of results"),
|
|
3083
|
+
helpRowDim(optLW, "--since <date>", "filter by ISO date or duration"),
|
|
3084
|
+
helpRowDim(optLW, "--json", "output raw JSON"),
|
|
3085
|
+
helpRowDim(optLW, "--name <name>", "name for contact add"),
|
|
3086
|
+
helpRowDim(optLW, "--gmail", "import contacts from Gmail"),
|
|
3087
|
+
helpRowDim(optLW, "--objective <text>", "objective for scrape command"),
|
|
3088
|
+
helpRowDim(optLW, "--target <uid>", "target user for opportunity discovery"),
|
|
3089
|
+
helpRowDim(optLW, "--introduce <uid>", "source user for introduction discovery"),
|
|
3090
|
+
helpRowDim(optLW, "--linkedin <url>", "LinkedIn URL for profile create"),
|
|
3091
|
+
helpRowDim(optLW, "--github <url>", "GitHub URL for profile create"),
|
|
3092
|
+
helpRowDim(optLW, "--twitter <url>", "Twitter URL for profile create"),
|
|
3093
|
+
helpRowDim(optLW, "--title <text>", "title for network update"),
|
|
3094
|
+
helpRowDim(optLW, "--details <text>", "details for profile update"),
|
|
3095
|
+
helpRowDim(optLW, "--help", "show help for any command"),
|
|
3096
|
+
helpRowDim(optLW, "--version", "show version")
|
|
3097
|
+
]);
|
|
3098
|
+
}
|
|
3026
3099
|
async function requireAuth(apiUrlOverride) {
|
|
3027
3100
|
const store = new CredentialStore;
|
|
3028
3101
|
const creds = await store.load();
|
|
@@ -3086,7 +3159,7 @@ async function main() {
|
|
|
3086
3159
|
const args = parseArgs(process.argv.slice(2));
|
|
3087
3160
|
switch (args.command) {
|
|
3088
3161
|
case "help":
|
|
3089
|
-
|
|
3162
|
+
renderHelp();
|
|
3090
3163
|
return;
|
|
3091
3164
|
case "version":
|
|
3092
3165
|
console.log(VERSION);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indexnetwork/cli",
|
|
3
|
-
"version": "0.10.2
|
|
3
|
+
"version": "0.10.2",
|
|
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.10.2
|
|
24
|
-
"@indexnetwork/cli-linux-arm64": "0.10.2
|
|
25
|
-
"@indexnetwork/cli-darwin-x64": "0.10.2
|
|
26
|
-
"@indexnetwork/cli-darwin-arm64": "0.10.2
|
|
23
|
+
"@indexnetwork/cli-linux-x64": "0.10.2",
|
|
24
|
+
"@indexnetwork/cli-linux-arm64": "0.10.2",
|
|
25
|
+
"@indexnetwork/cli-darwin-x64": "0.10.2",
|
|
26
|
+
"@indexnetwork/cli-darwin-arm64": "0.10.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/bun": "latest"
|