@somewhere-cloud/cli 0.38.101 → 0.38.104
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/CHANGELOG.md +12 -0
- package/README.md +1 -0
- package/dist/commands/deploy.d.ts +1 -0
- package/dist/commands/deploy.js +2 -0
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/privacy.d.ts +2 -0
- package/dist/commands/privacy.js +29 -0
- package/dist/commands/privacy.js.map +1 -0
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/commands/app.d.ts +0 -2
- package/dist/commands/app.js +0 -143
- package/dist/commands/app.js.map +0 -1
- package/dist/lib/app-mcp.d.ts +0 -72
- package/dist/lib/app-mcp.js +0 -581
- package/dist/lib/app-mcp.js.map +0 -1
package/dist/commands/app.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { AppMcpCliError, appLogin, appLogout, callTool, inputShape, listTools, redactTokens, } from '../lib/app-mcp.js';
|
|
2
|
-
import { bold, dim, error, printJsonError, success, warn } from '../lib/output.js';
|
|
3
|
-
// Everything these commands print passes through redactTokens: an app can echo the
|
|
4
|
-
// token it received in a result or an error, and the terminal never shows one.
|
|
5
|
-
function printJson(value) {
|
|
6
|
-
console.log(redactTokens(JSON.stringify(value ?? null, null, 2)));
|
|
7
|
-
}
|
|
8
|
-
function fail(err, json) {
|
|
9
|
-
const message = redactTokens(err instanceof Error ? err.message : String(err));
|
|
10
|
-
if (json)
|
|
11
|
-
printJsonError(err instanceof AppMcpCliError ? err.code : 'CLI_ERROR', message);
|
|
12
|
-
else
|
|
13
|
-
error(message, err);
|
|
14
|
-
process.exitCode = 1;
|
|
15
|
-
}
|
|
16
|
-
export function registerApp(program) {
|
|
17
|
-
const app = program
|
|
18
|
-
.command('app')
|
|
19
|
-
.description('Sign in to an app built on Somewhere as its user, and call its MCP tools from this terminal')
|
|
20
|
-
.addHelpText('after', `
|
|
21
|
-
Sign-in opens a browser on this computer, where you sign in to the app and approve
|
|
22
|
-
this terminal. Signing in over SSH, in a container or in a headless shell is not supported.
|
|
23
|
-
Your app sign-in is kept apart from your Somewhere developer login and is sent only to that app.
|
|
24
|
-
Signing out of the app in the browser also ends the terminal's access.
|
|
25
|
-
|
|
26
|
-
Examples:
|
|
27
|
-
somewhere app login https://notes.somewhere.site
|
|
28
|
-
somewhere app tools https://notes.somewhere.site
|
|
29
|
-
somewhere app call https://notes.somewhere.site add_note '{"text":"hello"}'
|
|
30
|
-
somewhere app logout https://notes.somewhere.site`);
|
|
31
|
-
app
|
|
32
|
-
.command('login <app-url>')
|
|
33
|
-
.description('Sign in to the app in your browser and approve this terminal')
|
|
34
|
-
.option('--json', 'Print the outcome as JSON')
|
|
35
|
-
.action(async (url, opts) => {
|
|
36
|
-
try {
|
|
37
|
-
const result = await appLogin(url, (line) => (opts.json ? process.stderr : process.stdout).write(` ${line}\n`));
|
|
38
|
-
if (opts.json)
|
|
39
|
-
printJson({ ok: true, origin: result.origin, client_reused: result.clientReused });
|
|
40
|
-
else {
|
|
41
|
-
success(`Signed in to ${result.origin}.`);
|
|
42
|
-
console.log(dim(` Next: somewhere app tools ${result.origin}`));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
catch (err) {
|
|
46
|
-
fail(err, opts.json);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
app
|
|
50
|
-
.command('tools <app-url>')
|
|
51
|
-
.description('List the tools the app offers you: name, description and arguments')
|
|
52
|
-
.option('--json', 'Print the tool list as JSON')
|
|
53
|
-
.action(async (url, opts) => {
|
|
54
|
-
try {
|
|
55
|
-
const tools = await listTools(url);
|
|
56
|
-
if (opts.json) {
|
|
57
|
-
printJson(tools);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (!tools.length) {
|
|
61
|
-
console.log(dim('This app offers no tools to your sign-in.'));
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
for (const tool of tools) {
|
|
65
|
-
console.log(bold(tool.name));
|
|
66
|
-
if (tool.description)
|
|
67
|
-
console.log(redactTokens(` ${tool.description}`));
|
|
68
|
-
console.log(dim(` arguments: ${inputShape(tool)}`));
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
catch (err) {
|
|
72
|
-
fail(err, opts.json);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
app
|
|
76
|
-
.command('call <app-url> <tool> [json]')
|
|
77
|
-
.description('Call one of the app\'s tools with JSON arguments and print the result')
|
|
78
|
-
.option('--json', 'Print the complete MCP result as JSON')
|
|
79
|
-
.action(async (url, tool, json, opts) => {
|
|
80
|
-
try {
|
|
81
|
-
let args = {};
|
|
82
|
-
if (json !== undefined) {
|
|
83
|
-
try {
|
|
84
|
-
args = JSON.parse(json);
|
|
85
|
-
}
|
|
86
|
-
catch {
|
|
87
|
-
throw new AppMcpCliError(`The arguments are not valid JSON: ${json}`, 'INVALID_ARGUMENTS');
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if (!args || typeof args !== 'object' || Array.isArray(args)) {
|
|
91
|
-
throw new AppMcpCliError('The arguments must be a JSON object, for example \'{"text":"hello"}\'.', 'INVALID_ARGUMENTS');
|
|
92
|
-
}
|
|
93
|
-
const { result } = await callTool(url, tool, args);
|
|
94
|
-
const text = (result.content ?? []).filter((item) => item.type === 'text' && typeof item.text === 'string').map((item) => item.text).join('\n');
|
|
95
|
-
if (opts.json) {
|
|
96
|
-
printJson(result);
|
|
97
|
-
if (result.isError)
|
|
98
|
-
process.exitCode = 1;
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
if (result.isError) {
|
|
102
|
-
error(redactTokens(`${tool} failed: ${text || 'the app returned an error with no message.'}`));
|
|
103
|
-
process.exitCode = 1;
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
if (result.structuredContent !== undefined)
|
|
107
|
-
printJson(result.structuredContent);
|
|
108
|
-
else
|
|
109
|
-
console.log(redactTokens(text));
|
|
110
|
-
}
|
|
111
|
-
catch (err) {
|
|
112
|
-
fail(err, opts.json);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
app
|
|
116
|
-
.command('logout <app-url>')
|
|
117
|
-
.description('Revoke this terminal\'s access to the app and remove the stored sign-in')
|
|
118
|
-
.option('--json', 'Print the outcome as JSON')
|
|
119
|
-
.action(async (url, opts) => {
|
|
120
|
-
try {
|
|
121
|
-
const result = await appLogout(url);
|
|
122
|
-
// The local copy is gone either way; a refused revoke still fails the command.
|
|
123
|
-
if (result.signedIn && !result.revoked)
|
|
124
|
-
process.exitCode = 1;
|
|
125
|
-
if (opts.json) {
|
|
126
|
-
printJson({ ok: result.revoked || !result.signedIn, origin: result.origin, was_signed_in: result.signedIn, revoked: result.revoked, ...(result.revokeProblem ? { revoke_problem: result.revokeProblem } : {}) });
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
if (!result.signedIn) {
|
|
130
|
-
console.log(dim(`Not signed in to ${result.origin}; nothing to remove.`));
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
if (!result.revoked) {
|
|
134
|
-
warn(redactTokens(`Could not revoke the sign-in at the server (${result.revokeProblem}). It stays valid there until it expires or you sign out of the app in the browser.`));
|
|
135
|
-
}
|
|
136
|
-
success(`Removed the sign-in to ${result.origin} from this computer${result.revoked ? ' and revoked it at the server' : ''}.`);
|
|
137
|
-
}
|
|
138
|
-
catch (err) {
|
|
139
|
-
fail(err, opts.json);
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
//# sourceMappingURL=app.js.map
|
package/dist/commands/app.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/commands/app.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,UAAU,EACV,SAAS,E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
-
/**
|
|
2
|
-
* A user of an app built on Somewhere signs in to that app from a terminal and
|
|
3
|
-
* calls its MCP tools. The app's own OAuth server does the work:
|
|
4
|
-
* the CLI is one more public client, registered once per app on this machine.
|
|
5
|
-
*
|
|
6
|
-
* Two principals never mix here: nothing in this file reads the developer
|
|
7
|
-
* login (config.json), and the app user's tokens live in their own file and are
|
|
8
|
-
* sent only to the app origin (access token) or the app's Somewhere issuer
|
|
9
|
-
* (refresh token, revoke).
|
|
10
|
-
*/
|
|
11
|
-
export declare const CLIENT_NAME = "Somewhere CLI (terminal)";
|
|
12
|
-
/** One fixed loopback port and one fixed fallback, both registered on the one client. */
|
|
13
|
-
export declare const CALLBACK_PORTS: readonly [47623, 47624];
|
|
14
|
-
export declare class AppMcpCliError extends Error {
|
|
15
|
-
readonly code: string;
|
|
16
|
-
constructor(message: string, code: string);
|
|
17
|
-
}
|
|
18
|
-
/** The app's origin from what the user typed: `notes.somewhere.site`, `https://notes.somewhere.site/mcp`. */
|
|
19
|
-
export declare function appOrigin(input: string): string;
|
|
20
|
-
export declare function isSomewhereIssuer(issuer: string): boolean;
|
|
21
|
-
export interface AppEntry {
|
|
22
|
-
issuer: string;
|
|
23
|
-
client_id: string;
|
|
24
|
-
redirect_uris: string[];
|
|
25
|
-
access_token?: string;
|
|
26
|
-
refresh_token?: string;
|
|
27
|
-
/** Epoch ms. */
|
|
28
|
-
access_expires_at?: number;
|
|
29
|
-
}
|
|
30
|
-
export declare function storePath(): string;
|
|
31
|
-
export declare function redactTokens(text: string): string;
|
|
32
|
-
export declare function loadEntry(origin: string): AppEntry | undefined;
|
|
33
|
-
/** Why a browser cannot be opened here, before anything is sent. */
|
|
34
|
-
export declare function browserUnavailable(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): string | null;
|
|
35
|
-
export interface LoginResult {
|
|
36
|
-
origin: string;
|
|
37
|
-
clientReused: boolean;
|
|
38
|
-
}
|
|
39
|
-
export declare function appLogin(input: string, log: (line: string) => void): Promise<LoginResult>;
|
|
40
|
-
export interface AppTool {
|
|
41
|
-
name: string;
|
|
42
|
-
description?: string;
|
|
43
|
-
inputSchema?: {
|
|
44
|
-
properties?: Record<string, {
|
|
45
|
-
type?: unknown;
|
|
46
|
-
description?: unknown;
|
|
47
|
-
}>;
|
|
48
|
-
required?: string[];
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
export declare function listTools(input: string): Promise<AppTool[]>;
|
|
52
|
-
/** `count (number, required), note (string)` from a tool's input schema. */
|
|
53
|
-
export declare function inputShape(tool: AppTool): string;
|
|
54
|
-
export interface CallOutcome {
|
|
55
|
-
result: {
|
|
56
|
-
content?: Array<{
|
|
57
|
-
type?: string;
|
|
58
|
-
text?: string;
|
|
59
|
-
}>;
|
|
60
|
-
structuredContent?: unknown;
|
|
61
|
-
isError?: boolean;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
export declare function callTool(input: string, name: string, args: Record<string, unknown>): Promise<CallOutcome>;
|
|
65
|
-
export interface LogoutResult {
|
|
66
|
-
origin: string;
|
|
67
|
-
signedIn: boolean;
|
|
68
|
-
revoked: boolean;
|
|
69
|
-
revokeProblem?: string;
|
|
70
|
-
}
|
|
71
|
-
/** Revoke at the issuer, then remove the local tokens whatever the issuer said. */
|
|
72
|
-
export declare function appLogout(input: string): Promise<LogoutResult>;
|