@gizai/cli 2.2.3 → 2.2.5
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/cli/giz.mjs +9 -2
- package/package.json +1 -1
package/cli/giz.mjs
CHANGED
|
@@ -24,7 +24,10 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
|
24
24
|
const { version: CLI_VERSION } = createRequire(import.meta.url)('../package.json')
|
|
25
25
|
const DEFAULT_URL = 'https://www.giz.ai'
|
|
26
26
|
const CLIENT_ID = 'giz-cli'
|
|
27
|
-
|
|
27
|
+
// openid and email: GizStack admits a Giz token only with a verified email claim (gizstack gizid verified).
|
|
28
|
+
const SCOPES = ['giz.read', 'giz.inference', 'giz.write', 'giz.execute', 'giz.destructive', 'openid', 'email', 'offline_access']
|
|
29
|
+
// Named at sign-in: giz.ai exchanges a refresh token only for a resource the sign-in named (signin.giz gizstackToken).
|
|
30
|
+
const GIZSTACK_RESOURCE = 'https://gizstack.com'
|
|
28
31
|
const BOOLEAN_OPTIONS = new Set(['help', 'json', 'no-open', 'version', 'device'])
|
|
29
32
|
const configPath = path.resolve(process.env.GIZ_CONFIG ||
|
|
30
33
|
path.join(os.homedir(), '.config', 'giz', 'credentials.json'))
|
|
@@ -269,6 +272,7 @@ async function login(baseUrl, options) {
|
|
|
269
272
|
prompt: 'consent',
|
|
270
273
|
state
|
|
271
274
|
})) authorization.searchParams.set(name, value)
|
|
275
|
+
authorization.searchParams.append('resource', GIZSTACK_RESOURCE)
|
|
272
276
|
process.stderr.write(`Opening Giz sign-in:\n${authorization}\n`)
|
|
273
277
|
if (options.open !== 'false' && options['no-open'] !== true) openBrowser(authorization.href)
|
|
274
278
|
const code = await callback.code
|
|
@@ -282,7 +286,10 @@ async function deviceLogin(baseUrl, metadata) {
|
|
|
282
286
|
if (!metadata.device_authorization_endpoint) throw new CliError('OAuth device authorization is not supported.')
|
|
283
287
|
const response = await fetch(metadata.device_authorization_endpoint, {
|
|
284
288
|
method: 'POST', headers: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
285
|
-
body: new URLSearchParams(
|
|
289
|
+
body: new URLSearchParams([
|
|
290
|
+
['client_id', CLIENT_ID], ['scope', SCOPES.join(' ')], ['resource', new URL('/api/mcp', baseUrl).href],
|
|
291
|
+
['resource', GIZSTACK_RESOURCE]
|
|
292
|
+
]),
|
|
286
293
|
signal: AbortSignal.timeout(30_000)
|
|
287
294
|
})
|
|
288
295
|
const device = await response.json()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gizai/cli",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.5",
|
|
4
4
|
"description": "The official command-line interface for giz.ai: run AI models, Drive, Computers and Apps, connect Claude Code, Codex and other agents over MCP, and run Gizlang (giz init, run, deploy), installed on first use.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"giz",
|