@yaks/connections 0.0.0-stage → 0.2.36

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.
Files changed (184) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +609 -2
  3. package/_dist/authorize.d.ts +38 -0
  4. package/_dist/authorize.d.ts.map +1 -0
  5. package/_dist/authorize_cli.d.ts +12 -0
  6. package/_dist/authorize_cli.d.ts.map +1 -0
  7. package/_dist/brokers.d.ts +66 -0
  8. package/_dist/brokers.d.ts.map +1 -0
  9. package/_dist/catalog.d.ts +33 -0
  10. package/_dist/catalog.d.ts.map +1 -0
  11. package/_dist/cli.d.ts +3 -0
  12. package/_dist/cli.d.ts.map +1 -0
  13. package/_dist/clients.d.ts +18 -0
  14. package/_dist/clients.d.ts.map +1 -0
  15. package/_dist/connections.d.ts +296 -0
  16. package/_dist/connections.d.ts.map +1 -0
  17. package/_dist/effects.d.ts +15 -0
  18. package/_dist/effects.d.ts.map +1 -0
  19. package/_dist/field.d.ts +17 -0
  20. package/_dist/field.d.ts.map +1 -0
  21. package/_dist/form.d.ts +49 -0
  22. package/_dist/form.d.ts.map +1 -0
  23. package/_dist/given.d.ts +10 -0
  24. package/_dist/given.d.ts.map +1 -0
  25. package/_dist/graph.d.ts +15 -0
  26. package/_dist/graph.d.ts.map +1 -0
  27. package/_dist/history.d.ts +4 -0
  28. package/_dist/history.d.ts.map +1 -0
  29. package/_dist/identity.d.ts +9 -0
  30. package/_dist/identity.d.ts.map +1 -0
  31. package/_dist/integrations.d.ts +196 -0
  32. package/_dist/integrations.d.ts.map +1 -0
  33. package/_dist/loopback.d.ts +7 -0
  34. package/_dist/loopback.d.ts.map +1 -0
  35. package/_dist/mcp-retirement.d.ts +33 -0
  36. package/_dist/mcp-retirement.d.ts.map +1 -0
  37. package/_dist/mcp.d.ts +179 -0
  38. package/_dist/mcp.d.ts.map +1 -0
  39. package/_dist/mod.d.ts +70 -0
  40. package/_dist/mod.d.ts.map +1 -0
  41. package/_dist/paste.d.ts +13 -0
  42. package/_dist/paste.d.ts.map +1 -0
  43. package/_dist/requests.d.ts +30 -0
  44. package/_dist/requests.d.ts.map +1 -0
  45. package/_dist/services.d.ts +25 -0
  46. package/_dist/services.d.ts.map +1 -0
  47. package/_dist/sign-in.d.ts +9 -0
  48. package/_dist/sign-in.d.ts.map +1 -0
  49. package/_dist/signin-mail.d.ts +12 -0
  50. package/_dist/signin-mail.d.ts.map +1 -0
  51. package/_dist/signin.d.ts +19 -0
  52. package/_dist/signin.d.ts.map +1 -0
  53. package/_dist/sources.d.ts +61 -0
  54. package/_dist/sources.d.ts.map +1 -0
  55. package/_dist/tools.d.ts +3 -0
  56. package/_dist/tools.d.ts.map +1 -0
  57. package/_dist/views.d.ts +3 -0
  58. package/_dist/views.d.ts.map +1 -0
  59. package/_dist/vocab.d.ts +6 -0
  60. package/_dist/vocab.d.ts.map +1 -0
  61. package/_dist/yaks-app.d.ts +29 -0
  62. package/_dist/yaks-app.d.ts.map +1 -0
  63. package/anthropic.json +12 -0
  64. package/auth_command.js +69 -0
  65. package/auth_command.js.map +1 -0
  66. package/auth_command.ts +74 -0
  67. package/authorize.js +89 -0
  68. package/authorize.js.map +1 -0
  69. package/authorize.ts +138 -0
  70. package/authorize_cli.js +167 -0
  71. package/authorize_cli.js.map +1 -0
  72. package/authorize_cli.ts +211 -0
  73. package/brokers.js +318 -0
  74. package/brokers.js.map +1 -0
  75. package/brokers.ts +423 -0
  76. package/canva.json +32 -0
  77. package/catalog.js +178 -0
  78. package/catalog.js.map +1 -0
  79. package/catalog.ts +216 -0
  80. package/cli.js +30 -0
  81. package/cli.js.map +1 -0
  82. package/cli.ts +26 -0
  83. package/clients.js +34 -0
  84. package/clients.js.map +1 -0
  85. package/clients.ts +65 -0
  86. package/connections.js +1961 -0
  87. package/connections.js.map +1 -0
  88. package/connections.ts +2561 -0
  89. package/deno.json +1 -0
  90. package/discord-account.json +22 -0
  91. package/discord-bot.json +20 -0
  92. package/discord.json +26 -0
  93. package/effects.js +168 -0
  94. package/effects.js.map +1 -0
  95. package/effects.ts +160 -0
  96. package/elevenlabs.json +18 -0
  97. package/facebook.json +18 -0
  98. package/field.js +19 -0
  99. package/field.js.map +1 -0
  100. package/field.ts +31 -0
  101. package/form.js +112 -0
  102. package/form.js.map +1 -0
  103. package/form.ts +178 -0
  104. package/git-config.js +44 -0
  105. package/git-config.js.map +1 -0
  106. package/git-config.ts +26 -0
  107. package/given.js +83 -0
  108. package/given.js.map +1 -0
  109. package/given.ts +88 -0
  110. package/gmail-mailbox.json +29 -0
  111. package/gmail.json +31 -0
  112. package/google-calendar.json +31 -0
  113. package/google-drive.json +31 -0
  114. package/google-search-console.json +29 -0
  115. package/graph.js +36 -0
  116. package/graph.js.map +1 -0
  117. package/graph.ts +52 -0
  118. package/history.js +31 -0
  119. package/history.js.map +1 -0
  120. package/history.ts +32 -0
  121. package/identity.js +15 -0
  122. package/identity.js.map +1 -0
  123. package/identity.ts +18 -0
  124. package/integrations.js +493 -0
  125. package/integrations.js.map +1 -0
  126. package/integrations.ts +725 -0
  127. package/loopback.js +72 -0
  128. package/loopback.js.map +1 -0
  129. package/loopback.ts +89 -0
  130. package/lulu.json +32 -0
  131. package/mcp-retirement.js +133 -0
  132. package/mcp-retirement.js.map +1 -0
  133. package/mcp-retirement.ts +200 -0
  134. package/mcp-signin.js +14 -0
  135. package/mcp-signin.js.map +1 -0
  136. package/mcp-signin.ts +13 -0
  137. package/mcp.js +1036 -0
  138. package/mcp.js.map +1 -0
  139. package/mcp.ts +1283 -0
  140. package/mod.js +70 -0
  141. package/mod.js.map +1 -0
  142. package/mod.ts +216 -0
  143. package/openai-api.json +12 -0
  144. package/openai.json +25 -0
  145. package/openrouter.json +14 -0
  146. package/package.json +89 -4
  147. package/paste.js +36 -0
  148. package/paste.js.map +1 -0
  149. package/paste.ts +55 -0
  150. package/requests.js +137 -0
  151. package/requests.js.map +1 -0
  152. package/requests.ts +200 -0
  153. package/services.js +84 -0
  154. package/services.js.map +1 -0
  155. package/services.ts +111 -0
  156. package/sign-in.js +36 -0
  157. package/sign-in.js.map +1 -0
  158. package/sign-in.ts +53 -0
  159. package/signin-mail.js +29 -0
  160. package/signin-mail.js.map +1 -0
  161. package/signin-mail.ts +56 -0
  162. package/signin.js +68 -0
  163. package/signin.js.map +1 -0
  164. package/signin.ts +109 -0
  165. package/slack.json +90 -0
  166. package/sources.js +178 -0
  167. package/sources.js.map +1 -0
  168. package/sources.ts +237 -0
  169. package/tools.js +39 -0
  170. package/tools.js.map +1 -0
  171. package/tools.ts +46 -0
  172. package/views.js +85 -0
  173. package/views.js.map +1 -0
  174. package/views.ts +89 -0
  175. package/visitor-defaults.json +8 -0
  176. package/vocab.js +17 -0
  177. package/vocab.js.map +1 -0
  178. package/vocab.json +863 -0
  179. package/vocab.ts +18 -0
  180. package/voipms.json +32 -0
  181. package/yaks-app.js +159 -0
  182. package/yaks-app.js.map +1 -0
  183. package/yaks-app.ts +177 -0
  184. package/youtube.json +26 -0
package/tools.ts ADDED
@@ -0,0 +1,46 @@
1
+ // What anybody may ask about connections: the `@yaks/connections/tools` entry
2
+ // point, the implementations behind the two `tool: true` declarations in
3
+ // ./vocab.json. Neither touches a credential: `need` makes a connection with
4
+ // none, and `list` shows the handle where one is kept. Keys and grants arrive
5
+ // through trusted code (`connect`), never through a tool's arguments, which a
6
+ // graph keeps as the text of a call.
7
+
8
+ import { argsOf } from '@yaks/graph/call'
9
+ import type { Runs } from 'jsr:@yaks/graph@0.2.36/tools'
10
+ import { list, need } from './connections.js'
11
+ import { ABOUT, type About } from './integrations.js'
12
+
13
+ let str = (v: unknown): string => v == null ? '' : String(v)
14
+
15
+ let strs = (v: unknown): string[] => Array.isArray(v) ? v.map(String) : []
16
+
17
+ // What was said about a custom integration, each property as given.
18
+ let about = (args: Record<string, unknown>): About =>
19
+ Object.fromEntries(
20
+ ABOUT.filter((k) => args[k] != null).map((k) => [k, str(args[k])]),
21
+ )
22
+
23
+ /** The implementations of the tools ./vocab.json declares. */
24
+ export let runs = (): Runs => ({
25
+ connection_need: (call, graph) => {
26
+ let args = argsOf(call)
27
+ return need(graph.read, {
28
+ app: args.app == null ? undefined : str(args.app),
29
+ owner: str(args.owner),
30
+ integration: str(args.integration),
31
+ scopes: strs(args.scopes),
32
+ hosts: Array.isArray(args.hosts) ? strs(args.hosts) : undefined,
33
+ fields: Array.isArray(args.fields) ? args.fields : undefined,
34
+ each: args.each == true,
35
+ binding: args.binding == null ? undefined : str(args.binding),
36
+ separate: args.separate == true,
37
+ direct: args.direct == null ? undefined : args.direct == true,
38
+ task: args.task == null ? undefined : str(args.task),
39
+ keep: Array.isArray(args.keep) ? args.keep : undefined,
40
+ ...about(args),
41
+ image: args.image == null ? undefined : str(args.image),
42
+ }, true)
43
+ },
44
+
45
+ connection_list: (call, graph) => list(graph.read, str(argsOf(call).owner)),
46
+ })
package/views.js ADDED
@@ -0,0 +1,85 @@
1
+ // A connection's public face, shared by browser and terminal: its integration,
2
+ // account and status, followed by the apps whose uses links the host holds.
3
+ import { parse } from "@yaks/query/core";
4
+ import { define } from "@yaks/render";
5
+ import { integrationEid } from "./identity.js";
6
+ let connection = (b)=>b.connection;
7
+ let needs = (b)=>[
8
+ integrationEid(connection(b).integration)
9
+ ];
10
+ let match = parse('.connection .connection.integration .connection.status');
11
+ let title = (b, h, ctx)=>{
12
+ let s = ctx;
13
+ let c = connection(b);
14
+ let integration = s.get?.(integrationEid(c.integration))?.integration;
15
+ return h('span', null, [
16
+ integration?.title || c.integration,
17
+ c.account,
18
+ c.status
19
+ ].filter(Boolean).join(' · '));
20
+ };
21
+ let using = (b, h, ctx)=>{
22
+ let s = ctx;
23
+ let apps = s.related?.(b.entity.eid, 'uses') ?? [];
24
+ return h('span', null, apps.length ? ' · used by ' : '', apps.map((app, i)=>[
25
+ i ? ', ' : '',
26
+ s.show(app, 'Title') ?? s.name(app.entity.eid)
27
+ ]));
28
+ };
29
+ let page = (b, h, ctx)=>h('article', {
30
+ class: 'Page'
31
+ }, h('h1', {
32
+ class: 'Page_Title'
33
+ }, ctx.render?.('Title'), using(b, h, ctx)));
34
+ let uses = (b, h, ctx)=>{
35
+ let s = ctx;
36
+ let edge = b.edge;
37
+ let name = (eid)=>{
38
+ let held = s.get?.(eid);
39
+ return held ? s.show(held, 'Title') ?? s.name(eid) : s.name(eid);
40
+ };
41
+ return h('span', null, name(edge.from), ' uses ', name(edge.to));
42
+ };
43
+ /** Connections draw by their public fields, even when they also wear secret. */ export let views = define([
44
+ {
45
+ view: 'Title',
46
+ match,
47
+ needs,
48
+ render: title
49
+ },
50
+ {
51
+ view: 'Card.Title',
52
+ match,
53
+ needs,
54
+ render: title
55
+ },
56
+ {
57
+ view: 'Tile',
58
+ match,
59
+ needs,
60
+ render: (b, h, ctx)=>h('a', {
61
+ class: 'Tile',
62
+ href: ctx.link?.(b.entity.eid)
63
+ }, h('span', {
64
+ class: 'Tile_Title'
65
+ }, ctx.render?.('Title'), using(b, h, ctx)))
66
+ },
67
+ {
68
+ view: 'Page',
69
+ match,
70
+ needs,
71
+ render: page
72
+ },
73
+ {
74
+ view: 'Full',
75
+ match,
76
+ needs,
77
+ render: page
78
+ },
79
+ {
80
+ view: 'Tile',
81
+ match: parse('.uses .edge'),
82
+ render: uses
83
+ }
84
+ ]);
85
+ //# sourceMappingURL=views.js.map
package/views.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"views.js","sources":["./views.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,4EAA4E;AAC5E,SAAS,KAAK,gCAAqC;AACnD,SAAS,MAAM,4BAA4E;AAE3F,SAAS,cAAc,wBAAuB;AAI9C,IAAI,aAAa,CAAC,IAAc,EAAE,UAAU;AAC5C,IAAI,QAAQ,CAAC,IAAc;IAAC,eAAe,WAAW,GAAG,WAAW;GAAE;AACtE,IAAI,QAAQ,MAAM;AAElB,IAAI,QAAQ,CAAO,GAAW,GAAY;EACxC,IAAI,IAAI;EACR,IAAI,IAA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ACb,EACE,KACA;QACE,OAAO;QACP,MAAM,AAAC,IAAuB,IAAI,GAAG,EAAE,MAAM,CAAC,GAAG;MACnD,GACA,EACE,QACA;QAAE,OAAO;MAAa,GACtB,IAAI,MAAM,GAAG,UACb,MAAM,GAAG,GAAG;EAGpB;EACA;IAAE,MAAM;IAAQ;IAAO;IAAO,QAAQ;EAAK;EAC3C;IAAE,MAAM;IAAQ;IAAO;IAAO,QAAQ;EAAK;EAC3C;IACE,MAAM;IACN,OAAO,MAAM;IACb,QAAQ;EACV;CACD,EAAC"}
package/views.ts ADDED
@@ -0,0 +1,89 @@
1
+ // A connection's public face, shared by browser and terminal: its integration,
2
+ // account and status, followed by the apps whose uses links the host holds.
3
+ import { parse } from '@yaks/query/core'
4
+ import { define, type H, type Registry, type RenderContext } from '@yaks/render'
5
+ import type { Shown } from 'jsr:@yaks/render@0.2.36/views'
6
+ import { integrationEid } from './identity.js'
7
+ import type { Bundle } from '@yaks/render'
8
+
9
+ type Connection = { integration: string; account?: string; status: string }
10
+ let connection = (b: Bundle) => b.connection as Connection
11
+ let needs = (b: Bundle) => [integrationEid(connection(b).integration)]
12
+ let match = parse('.connection .connection.integration .connection.status')
13
+
14
+ let title = <Node>(b: Bundle, h: H<Node>, ctx: RenderContext<Node>): Node => {
15
+ let s = ctx as RenderContext<Node> & Shown<Node>
16
+ let c = connection(b)
17
+ let integration = s.get?.(integrationEid(c.integration))?.integration as
18
+ | { title?: string }
19
+ | undefined
20
+ return h(
21
+ 'span',
22
+ null,
23
+ [integration?.title || c.integration, c.account, c.status]
24
+ .filter(Boolean).join(' · '),
25
+ )
26
+ }
27
+
28
+ let using = <Node>(b: Bundle, h: H<Node>, ctx: RenderContext<Node>): Node => {
29
+ let s = ctx as RenderContext<Node> & Shown<Node>
30
+ let apps = s.related?.(b.entity.eid, 'uses') ?? []
31
+ return h(
32
+ 'span',
33
+ null,
34
+ apps.length ? ' · used by ' : '',
35
+ apps.map((app, i) => [
36
+ i ? ', ' : '',
37
+ s.show(app, 'Title') ?? s.name(app.entity.eid),
38
+ ]),
39
+ )
40
+ }
41
+
42
+ let page = <Node>(b: Bundle, h: H<Node>, ctx: RenderContext<Node>): Node =>
43
+ h(
44
+ 'article',
45
+ { class: 'Page' },
46
+ h('h1', { class: 'Page_Title' }, ctx.render?.('Title'), using(b, h, ctx)),
47
+ )
48
+
49
+ let uses = <Node>(b: Bundle, h: H<Node>, ctx: RenderContext<Node>): Node => {
50
+ let s = ctx as RenderContext<Node> & Shown<Node>
51
+ let edge = b.edge as { from: string; to: string }
52
+ let name = (eid: string) => {
53
+ let held = s.get?.(eid)
54
+ return held ? s.show(held, 'Title') ?? s.name(eid) : s.name(eid)
55
+ }
56
+ return h('span', null, name(edge.from), ' uses ', name(edge.to))
57
+ }
58
+
59
+ /** Connections draw by their public fields, even when they also wear secret. */
60
+ export let views: Registry = define([
61
+ { view: 'Title', match, needs, render: title },
62
+ { view: 'Card.Title', match, needs, render: title },
63
+ {
64
+ view: 'Tile',
65
+ match,
66
+ needs,
67
+ render: (b, h, ctx) =>
68
+ h(
69
+ 'a',
70
+ {
71
+ class: 'Tile',
72
+ href: (ctx as Shown<unknown>).link?.(b.entity.eid),
73
+ },
74
+ h(
75
+ 'span',
76
+ { class: 'Tile_Title' },
77
+ ctx.render?.('Title'),
78
+ using(b, h, ctx),
79
+ ),
80
+ ),
81
+ },
82
+ { view: 'Page', match, needs, render: page },
83
+ { view: 'Full', match, needs, render: page },
84
+ {
85
+ view: 'Tile',
86
+ match: parse('.uses .edge'),
87
+ render: uses,
88
+ },
89
+ ])
@@ -0,0 +1,8 @@
1
+ {
2
+ "accuweather": "on",
3
+ "google-maps": "on",
4
+ "mapbox": "on",
5
+ "openweathermap": "on",
6
+ "stripe-api-key": "never",
7
+ "weatherapi": "on"
8
+ }
package/vocab.js ADDED
@@ -0,0 +1,17 @@
1
+ // The component and tool declarations, and nothing else: the module a server or
2
+ // a browser page imports at `@yaks/connections/vocab`. It reaches no storage,
3
+ // no vault and no runtime, so a browser tab loading this vocabulary loads
4
+ // nothing else.
5
+ import doc from './vocab.json' with {
6
+ type: 'json'
7
+ };
8
+ import manifest from './package.json' with {
9
+ type: 'json'
10
+ };
11
+ /** `integration`, `connection`, the `uses` relation, and the two tools. */ export let connectionsDoc = doc;
12
+ /** What this package is: its manifest's description, the one place it is
13
+ * written, which a host stamps on each document here. */ export let description = manifest.description;
14
+ /** Every document this plugin declares. */ export let docs = [
15
+ connectionsDoc
16
+ ];
17
+ //# sourceMappingURL=vocab.js.map
package/vocab.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocab.js","sources":["./vocab.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,8EAA8E;AAC9E,0EAA0E;AAC1E,gBAAgB;AAGhB,OAAO,SAAS,oBAAoB;EAAE,MAAM;AAAO,EAAC;AACpD,OAAO,cAAc,sBAAsB;EAAE,MAAM;AAAO,EAAC;AAE3D,yEAAyE,GACzE,OAAO,IAAI,iBAA2B,IAAe;AAErD;uDACuD,GACvD,OAAO,IAAI,cAAsB,SAAS,WAAW,CAAA;AAErD,yCAAyC,GACzC,OAAO,IAAI,OAAmB;EAAC;CAAe,CAAA"}