@hanzo/app 0.2.33 → 0.2.34
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/Directory.js +5 -5
- package/dist/RightPane.js +1 -1
- package/dist/Setup.js +3 -3
- package/dist/bots/api.d.ts +1 -1
- package/dist/bots/api.js +1 -1
- package/dist/bots/runtime.js +1 -1
- package/dist/connect.d.ts +1 -1
- package/dist/connect.js +2 -2
- package/dist/lib/gmail.js +2 -2
- package/dist/lib/home.js +1 -1
- package/dist/tools.js +2 -2
- package/package.json +1 -1
package/dist/Directory.js
CHANGED
|
@@ -21,7 +21,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
21
21
|
// install flow — one `+` everywhere, branching internally.
|
|
22
22
|
//
|
|
23
23
|
// TWO TABS, and the channels are tiles. A channel is a provider the org can
|
|
24
|
-
// hold an account with, read from `/v1/
|
|
24
|
+
// hold an account with, read from `/v1/provider` — which says whether this
|
|
25
25
|
// deployment can open a connection and whether this org has one — and every
|
|
26
26
|
// tile's button is a call to that registry. The Inbox's "Connect an app" opens
|
|
27
27
|
// this same directory on this tab; there is no second grid. Skills, plugins and
|
|
@@ -36,7 +36,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
36
36
|
//
|
|
37
37
|
// SIGNED IN, EACH TAB READS ITS OWN REGISTRY. Apps is this site's public catalog
|
|
38
38
|
// AND the org's connected accounts; Channels is the org's own list at
|
|
39
|
-
// `/v1/
|
|
39
|
+
// `/v1/provider`. That one needs the bearer, so signed-out asks the reader to
|
|
40
40
|
// sign in rather than drawing a catalogue nobody can connect from, and a
|
|
41
41
|
// registry that cannot be reached says so rather than claiming the list is
|
|
42
42
|
// empty. Nothing stands in for an answer: no row is drawn that the registry did
|
|
@@ -65,7 +65,7 @@ const TABS = [
|
|
|
65
65
|
{ id: 'channels', label: phrase('Channels') },
|
|
66
66
|
];
|
|
67
67
|
/** The org-plane catalogue: every provider the platform can connect an account to, with THIS org's connection and whether the deployment can open one. */
|
|
68
|
-
const CHANNELS = '/v1/
|
|
68
|
+
const CHANNELS = '/v1/provider';
|
|
69
69
|
/**
|
|
70
70
|
* Under a channel's name, what the registry knows, in the reader's order of
|
|
71
71
|
* interest: the account connected, else whether a connection can be opened here
|
|
@@ -173,7 +173,7 @@ export function Catalog({ tab }) {
|
|
|
173
173
|
if (auth) {
|
|
174
174
|
Promise.all([
|
|
175
175
|
apps(),
|
|
176
|
-
fetch(`${api()}/v1/
|
|
176
|
+
fetch(`${api()}/v1/connection`, { headers: auth }).then((r) => (r.ok ? r.json() : null)),
|
|
177
177
|
])
|
|
178
178
|
.then(([list, j]) => {
|
|
179
179
|
if (!live || !j?.connectors)
|
|
@@ -263,7 +263,7 @@ function Channel({ row, onChange }) {
|
|
|
263
263
|
setBusy(true);
|
|
264
264
|
setWrong(null);
|
|
265
265
|
try {
|
|
266
|
-
const r = await fetch(`${api()}/v1/
|
|
266
|
+
const r = await fetch(`${api()}/v1/provider/${encodeURIComponent(row.id)}/${verb}`, {
|
|
267
267
|
method: 'POST',
|
|
268
268
|
headers: { ...scope(), 'Content-Type': 'application/json' },
|
|
269
269
|
body: '{}',
|
package/dist/RightPane.js
CHANGED
|
@@ -132,7 +132,7 @@ const Note = ({ children }) => (_jsx(DropdownMenuLabel, { children: _jsx(Text, {
|
|
|
132
132
|
* EVERY ROW DOES SOMETHING. Files come off the reader's own disk. Skills are
|
|
133
133
|
* `GET /v1/tools/skills` and toggling one is `PUT /v1/tools/activation`, the
|
|
134
134
|
* one write path that turns skills, plugins and connectors into callable tools.
|
|
135
|
-
* Services are `GET /v1/
|
|
135
|
+
* Services are `GET /v1/connection/providers`, connected by the
|
|
136
136
|
* device flow their cards declare. One panel, not flyouts: it hangs off the
|
|
137
137
|
* right edge of the window, where a submenu has no room to open.
|
|
138
138
|
*/
|
package/dist/Setup.js
CHANGED
|
@@ -89,10 +89,10 @@ export function Setup({ go } = {}) {
|
|
|
89
89
|
let live = true;
|
|
90
90
|
const auth = scope();
|
|
91
91
|
Promise.all([
|
|
92
|
-
fetch(`${api()}/v1/
|
|
92
|
+
fetch(`${api()}/v1/provider`, { headers: auth })
|
|
93
93
|
.then((r) => (r.ok ? r.json() : null))
|
|
94
94
|
.catch(() => null),
|
|
95
|
-
fetch(`${api()}/v1/
|
|
95
|
+
fetch(`${api()}/v1/connection`, { headers: auth })
|
|
96
96
|
.then((r) => (r.ok ? r.json() : null))
|
|
97
97
|
.catch(() => null),
|
|
98
98
|
fetch(`${api()}/v1/tool/plugins/authored`, { headers: auth })
|
|
@@ -235,7 +235,7 @@ export function Setup({ go } = {}) {
|
|
|
235
235
|
}
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
|
-
const res = await fetch(`${api()}/v1/
|
|
238
|
+
const res = await fetch(`${api()}/v1/provider/${provider}/connect`, {
|
|
239
239
|
method: 'POST',
|
|
240
240
|
headers: { ...scope(), 'Content-Type': 'application/json' },
|
|
241
241
|
body: '{}',
|
package/dist/bots/api.d.ts
CHANGED
|
@@ -98,7 +98,7 @@ export interface Secret {
|
|
|
98
98
|
scheme?: string;
|
|
99
99
|
}
|
|
100
100
|
export declare const secrets: (c: Client, path: string, signal?: AbortSignal) => Promise<Secret[]>;
|
|
101
|
-
/** A connector as `/v1/
|
|
101
|
+
/** A connector as `/v1/connection` answers it. Held by the PERSON
|
|
102
102
|
* who signed in to it: the contract publishes no per-agent binding. */
|
|
103
103
|
export interface Connector {
|
|
104
104
|
id: string;
|
package/dist/bots/api.js
CHANGED
|
@@ -71,5 +71,5 @@ export const call = (c, name, op, input = {}) => rpc(c, 'tools/call', { name, ar
|
|
|
71
71
|
export const workOn = (c, params) => c.http.json({ method: 'POST', path: '/v1/agents/coding', body: params });
|
|
72
72
|
export const projects = (c, signal) => c.http.json({ path: '/v1/project', signal });
|
|
73
73
|
export const secrets = (c, path, signal) => c.http.collection('secrets', { path: '/v1/kms/secrets', query: { path }, signal });
|
|
74
|
-
export const connectors = (c, signal) => c.http.collection('connectors', { path: '/v1/
|
|
74
|
+
export const connectors = (c, signal) => c.http.collection('connectors', { path: '/v1/connection', signal });
|
|
75
75
|
export const grant = (c, id, kind) => c.http.json({ method: 'POST', path: `/v1/sandbox/${encodeURIComponent(id)}/${kind}/ticket` });
|
package/dist/bots/runtime.js
CHANGED
|
@@ -312,7 +312,7 @@ function Secrets({ bot, keys, why }) {
|
|
|
312
312
|
* The one thing that is NOT this Bot's.
|
|
313
313
|
*
|
|
314
314
|
* A connector is held by the person who signed in to it.
|
|
315
|
-
* `/v1/
|
|
315
|
+
* `/v1/connection` answers one set for the caller and no route in
|
|
316
316
|
* the contract narrows it to one agent — so it is listed as what it is, and
|
|
317
317
|
* there is no switch to press.
|
|
318
318
|
*/
|
package/dist/connect.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface Device {
|
|
|
21
21
|
*
|
|
22
22
|
* THE PANE STARTS IT AND DOES NOT WATCH IT. Polling belongs where the result is
|
|
23
23
|
* used — the connector appears in the Directory's own list, which reads
|
|
24
|
-
* `/v1/
|
|
24
|
+
* `/v1/connection` — and a menu that closes the moment the reader
|
|
25
25
|
* leaves for the provider's page has nowhere to put a result anyway. Starting
|
|
26
26
|
* the flow, showing the code and opening the page is the whole of this control's
|
|
27
27
|
* job; `flow` is returned so a surface that does want to watch has the id.
|
package/dist/connect.js
CHANGED
|
@@ -51,13 +51,13 @@ export async function activate(name, on) {
|
|
|
51
51
|
*
|
|
52
52
|
* THE PANE STARTS IT AND DOES NOT WATCH IT. Polling belongs where the result is
|
|
53
53
|
* used — the connector appears in the Directory's own list, which reads
|
|
54
|
-
* `/v1/
|
|
54
|
+
* `/v1/connection` — and a menu that closes the moment the reader
|
|
55
55
|
* leaves for the provider's page has nowhere to put a result anyway. Starting
|
|
56
56
|
* the flow, showing the code and opening the page is the whole of this control's
|
|
57
57
|
* job; `flow` is returned so a surface that does want to watch has the id.
|
|
58
58
|
*/
|
|
59
59
|
export async function startDevice(provider) {
|
|
60
|
-
const begun = await ask(`/v1/
|
|
60
|
+
const begun = await ask(`/v1/connection/${encodeURIComponent(provider)}/device`, {});
|
|
61
61
|
if (!begun.userCode || !begun.verifyUrl)
|
|
62
62
|
throw new Error('This service did not start a sign-in.');
|
|
63
63
|
return { userCode: begun.userCode, verifyUrl: begun.verifyUrl, flow: begun.flow ?? '' };
|
package/dist/lib/gmail.js
CHANGED
|
@@ -146,7 +146,7 @@ export function buildGoogleWorkspaceAuthorizeUrl(origin, clientId = DEFAULT_GOOG
|
|
|
146
146
|
async function authorizeUrl() {
|
|
147
147
|
let clientId = DEFAULT_GOOGLE_CLIENT_ID;
|
|
148
148
|
try {
|
|
149
|
-
const res = await fetch(`${api()}/v1/
|
|
149
|
+
const res = await fetch(`${api()}/v1/provider/google/connect`, {
|
|
150
150
|
method: 'POST',
|
|
151
151
|
headers: { ...scope(), 'Content-Type': 'application/json' },
|
|
152
152
|
body: '{}',
|
|
@@ -188,7 +188,7 @@ async function complete(accessToken, granted, expiresIn) {
|
|
|
188
188
|
/* an unnamed account is kept as `default` */
|
|
189
189
|
}
|
|
190
190
|
keep(email, { accessToken, scope: granted || GOOGLE_WORKSPACE_SCOPES, expiresIn });
|
|
191
|
-
fetch(`${api()}/v1/
|
|
191
|
+
fetch(`${api()}/v1/provider/google/connect`, {
|
|
192
192
|
method: 'POST',
|
|
193
193
|
headers: { ...scope(), 'Content-Type': 'application/json' },
|
|
194
194
|
body: JSON.stringify({ token: accessToken, accountId: email }),
|
package/dist/lib/home.js
CHANGED
|
@@ -50,6 +50,6 @@ export async function projects(client, signal) {
|
|
|
50
50
|
* counts rather than being told a number.
|
|
51
51
|
*/
|
|
52
52
|
export async function apps(client, signal) {
|
|
53
|
-
const out = await client.http.json({ path: '/v1/
|
|
53
|
+
const out = await client.http.json({ path: '/v1/provider', signal });
|
|
54
54
|
return out?.providers ?? [];
|
|
55
55
|
}
|
package/dist/tools.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// TWO READS, AND THEY ARE NOT THE SAME LIST. `/v1/tools/skills` is what THIS
|
|
5
5
|
// org's agents already know how to do, each with the flag saying whether it is
|
|
6
|
-
// switched on; `/v1/
|
|
6
|
+
// switched on; `/v1/connection/providers` is the catalogue of what
|
|
7
7
|
// a person could connect that they have not. One answers "use something", the
|
|
8
8
|
// other "connect something", which is why the menu has two rows and not one
|
|
9
9
|
// list with a mixed meaning in it.
|
|
@@ -147,5 +147,5 @@ export function useSkills() {
|
|
|
147
147
|
}
|
|
148
148
|
/** What this account could connect and has not. */
|
|
149
149
|
export function useProviders() {
|
|
150
|
-
return useList('/v1/
|
|
150
|
+
return useList('/v1/connection/providers', asProviders);
|
|
151
151
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/app",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.34",
|
|
4
4
|
"description": "Hanzo's app: the shell and its apps (Home, Chat, Inbox, Contacts, Meet, Calendar, Drive, Board, Work, Bots), once, for every Hanzo surface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|