@thelakeprotocol/agent 0.0.0-stage → 0.1.0
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/LICENSE +202 -0
- package/README.md +20 -2
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +21 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp.d.ts +7 -0
- package/dist/mcp.js +73 -0
- package/dist/mcp.js.map +1 -0
- package/package.json +52 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @thelakeprotocol/agent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Status: runs, end-to-end tested.** Join the Lake in ten lines, or give any MCP assistant the Lake.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { joinLake } from '@thelakeprotocol/agent';
|
|
7
|
+
|
|
8
|
+
const me = await joinLake({ name: 'My study bot', domain: 'me.example', node: 'http://lake-node:7000' });
|
|
9
|
+
const r = await me.study('Do over-60s on drug X get readmitted less?', { priceUsd: 2, budgetUsd: 500 });
|
|
10
|
+
console.log(r.answer.summary);
|
|
11
|
+
await me.close();
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
| API | Does |
|
|
15
|
+
|---|---|
|
|
16
|
+
| `joinLake(o)` | Key, signed card served next to your endpoint, registration with the node |
|
|
17
|
+
| `me.find({ skill, tag, role })` | Search the node; every result is a signed card |
|
|
18
|
+
| `me.knock(houseUrl, terms)` | One signed offer to one house; its signed answer |
|
|
19
|
+
| `me.study(question, o)` | The whole mission: mandate, ethics, audit, knock, bargain, agree, compute in place, pay, answer |
|
|
20
|
+
|
|
21
|
+
**MCP connector:** `lake mcp` (this package's `lake` bin, also `docker run -i --rm --network lake_default ghcr.io/thelakeprotocol/lake mcp`). Tools: `lake_overview`, `lake_search`, `lake_knock`, `lake_dispatch_study`. Setup: [Build an agent](https://lake.doneinfifty.com/docs/build-an-agent).
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// `lake mcp` runs the Lake MCP connector over stdio; every other `lake` command is the visitor CLI.
|
|
3
|
+
if (process.argv[2] === 'mcp') {
|
|
4
|
+
const { StdioServerTransport } = await import('@modelcontextprotocol/sdk/server/stdio.js');
|
|
5
|
+
const { createLakeMcpServer } = await import('./mcp.js');
|
|
6
|
+
const env = process.env;
|
|
7
|
+
const server = createLakeMcpServer({
|
|
8
|
+
name: env.LAKE_AGENT_NAME ?? 'Assistant (via MCP)',
|
|
9
|
+
domain: env.LAKE_AS ?? 'assistant.example',
|
|
10
|
+
node: env.LAKE_NODE_URL ?? 'http://lake-node:7000',
|
|
11
|
+
port: Number(env.LAKE_MCP_PORT ?? 4890),
|
|
12
|
+
keyFile: env.LAKE_KEY_FILE,
|
|
13
|
+
ethics: env.LAKE_ETHICS_URL, auditor: env.LAKE_AUDITOR_URL, payments: env.LAKE_PAYMENTS_URL,
|
|
14
|
+
});
|
|
15
|
+
await server.connect(new StdioServerTransport());
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
await import('@thelakeprotocol/visitor/dist/cli.js');
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,oGAAoG;AACpG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC;IAC9B,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,MAAM,CAAC,2CAA2C,CAAC,CAAC;IAC3F,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;IACzD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IACxB,MAAM,MAAM,GAAG,mBAAmB,CAAC;QACjC,IAAI,EAAE,GAAG,CAAC,eAAe,IAAI,qBAAqB;QAClD,MAAM,EAAE,GAAG,CAAC,OAAO,IAAI,mBAAmB;QAC1C,IAAI,EAAE,GAAG,CAAC,aAAa,IAAI,uBAAuB;QAClD,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,aAAa,IAAI,IAAI,CAAC;QACvC,OAAO,EAAE,GAAG,CAAC,aAAa;QAC1B,MAAM,EAAE,GAAG,CAAC,eAAe,EAAE,OAAO,EAAE,GAAG,CAAC,gBAAgB,EAAE,QAAQ,EAAE,GAAG,CAAC,iBAAiB;KAC5F,CAAC,CAAC;IACH,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;AACnD,CAAC;KAAM,CAAC;IACN,MAAM,MAAM,CAAC,sCAAsC,CAAC,CAAC;AACvD,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type AgentCard, type Offer, type Study } from '@thelakeprotocol/core';
|
|
2
|
+
import { type MissionResult } from '@thelakeprotocol/visitor';
|
|
3
|
+
export type { MissionResult, Study };
|
|
4
|
+
export interface LakeAgentOptions {
|
|
5
|
+
/** What people see on the map. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** The domain that answers for this agent. Outside a sandbox it must publish your key (SPEC §2.3). */
|
|
8
|
+
domain: string;
|
|
9
|
+
/** A Lake node to register with and search. */
|
|
10
|
+
node: string;
|
|
11
|
+
/** Port to serve this agent's card on. Default 4800. */
|
|
12
|
+
port?: number;
|
|
13
|
+
/** Where others reach this agent, without /a2a. Default http://<host>:<port>. */
|
|
14
|
+
publicUrl?: string;
|
|
15
|
+
/** Keep the agent's key here so it keeps its identity (and reputation) across runs. Default: a fresh key. */
|
|
16
|
+
keyFile?: string;
|
|
17
|
+
/** Specialists to use. Defaults are the demo Lake's (docker compose). */
|
|
18
|
+
ethics?: string;
|
|
19
|
+
auditor?: string;
|
|
20
|
+
payments?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface StudyOptions {
|
|
23
|
+
priceUsd?: number;
|
|
24
|
+
/** The most a human at your organisation lets this study spend. Signs an AP2 Intent Mandate. 0: unpaid. */
|
|
25
|
+
budgetUsd?: number;
|
|
26
|
+
/** Fields beyond what the study reads, to see houses push back (e.g. postcode). */
|
|
27
|
+
extraFields?: string[];
|
|
28
|
+
/** Wait this long for owners who were asked to tap Allow. */
|
|
29
|
+
waitSeconds?: number;
|
|
30
|
+
/** A custom declarative study. Default: the readmission study for `question`. */
|
|
31
|
+
study?: Study;
|
|
32
|
+
log?: (step: string, detail: string) => void;
|
|
33
|
+
}
|
|
34
|
+
export interface LakeAgent {
|
|
35
|
+
card: AgentCard;
|
|
36
|
+
webId: string;
|
|
37
|
+
domain: string;
|
|
38
|
+
/** Search the node: houses by skill or interest, specialists, other agents. */
|
|
39
|
+
find(q?: {
|
|
40
|
+
skill?: string;
|
|
41
|
+
tag?: string;
|
|
42
|
+
role?: string;
|
|
43
|
+
}): Promise<{
|
|
44
|
+
name: string;
|
|
45
|
+
role: string;
|
|
46
|
+
domain: string;
|
|
47
|
+
tags: string[];
|
|
48
|
+
url: string;
|
|
49
|
+
}[]>;
|
|
50
|
+
/** One signed offer to one house; the house's verified, signed reply. */
|
|
51
|
+
knock(houseUrl: string, terms: Omit<Offer, 'id' | 'requester'>): Promise<Record<string, unknown>>;
|
|
52
|
+
/** A whole study: ethics, audit, knock every house, bargain, agree, compute in place, pay, answer. */
|
|
53
|
+
study(question: string, o?: StudyOptions): Promise<MissionResult>;
|
|
54
|
+
close(): Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Join the Lake:
|
|
58
|
+
*
|
|
59
|
+
* const me = await joinLake({ name: 'My study bot', domain: 'me.example', node: 'http://lake-node:7000' });
|
|
60
|
+
* const r = await me.study('Do over-60s on drug X get readmitted less?', { priceUsd: 5, budgetUsd: 500 });
|
|
61
|
+
* console.log(r.answer.summary);
|
|
62
|
+
* await me.close();
|
|
63
|
+
*/
|
|
64
|
+
export declare function joinLake(o: LakeAgentOptions): Promise<LakeAgent>;
|
|
65
|
+
export { createLakeMcpServer } from './mcp.js';
|
|
66
|
+
export declare const defaultKeyFile: (domain: string) => string;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { homedir, hostname } from 'node:os';
|
|
3
|
+
import { generateIdentity, lakeAgentApp, LakeLink, loadOrCreateIdentity, signMessage, } from '@thelakeprotocol/core';
|
|
4
|
+
import { dispatch, knock, makeHuman, makeVisitor, readmissionStudy } from '@thelakeprotocol/visitor';
|
|
5
|
+
/**
|
|
6
|
+
* Join the Lake:
|
|
7
|
+
*
|
|
8
|
+
* const me = await joinLake({ name: 'My study bot', domain: 'me.example', node: 'http://lake-node:7000' });
|
|
9
|
+
* const r = await me.study('Do over-60s on drug X get readmitted less?', { priceUsd: 5, budgetUsd: 500 });
|
|
10
|
+
* console.log(r.answer.summary);
|
|
11
|
+
* await me.close();
|
|
12
|
+
*/
|
|
13
|
+
export async function joinLake(o) {
|
|
14
|
+
const port = o.port ?? 4800;
|
|
15
|
+
const base = (o.publicUrl ?? `http://${existsSync('/.dockerenv') ? hostname() : 'localhost'}:${port}`).replace(/\/$/, '');
|
|
16
|
+
const id = o.keyFile ? await loadOrCreateIdentity(o.keyFile) : await generateIdentity();
|
|
17
|
+
const visitor = await makeVisitor(id, o.domain, o.name, `${base}/a2a`);
|
|
18
|
+
const node = o.node.replace(/\/$/, '');
|
|
19
|
+
// Serve our card while we're around, so a node can verify it and others can look us up.
|
|
20
|
+
const busy = async () => ({ lake: '0.1', card: visitor.card, envelope: (await signMessage({ kind: 'rejected', code: 'busy', why: 'this agent visits; it does not take offers' }, id, { iss: visitor.webId })) });
|
|
21
|
+
const server = lakeAgentApp(visitor.card, busy).listen(port);
|
|
22
|
+
await new Promise((ok) => server.once('listening', ok));
|
|
23
|
+
const link = new LakeLink({ nodeUrl: node, card: visitor.card, identity: id, webId: visitor.webId });
|
|
24
|
+
await link.register(10);
|
|
25
|
+
return {
|
|
26
|
+
card: visitor.card,
|
|
27
|
+
webId: visitor.webId,
|
|
28
|
+
domain: o.domain,
|
|
29
|
+
async find(q = {}) {
|
|
30
|
+
const params = new URLSearchParams(Object.entries(q).filter(([, v]) => v));
|
|
31
|
+
const found = (await (await fetch(`${node}/cards?${params}`)).json());
|
|
32
|
+
return found.map(({ card }) => {
|
|
33
|
+
const p = card.capabilities?.extensions?.[0]?.params;
|
|
34
|
+
return { name: card.name, role: p.role, domain: p.ownerDomain, tags: p.tags, url: card.supportedInterfaces[0].url };
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
async knock(houseUrl, terms) {
|
|
38
|
+
return (await knock(houseUrl, visitor, terms)).reply;
|
|
39
|
+
},
|
|
40
|
+
async study(question, s = {}) {
|
|
41
|
+
const budget = s.budgetUsd ?? 0;
|
|
42
|
+
return dispatch({
|
|
43
|
+
visitor, node, link, log: s.log,
|
|
44
|
+
ethics: o.ethics ?? 'http://ethics:4500',
|
|
45
|
+
auditor: o.auditor ?? 'http://auditor:4400',
|
|
46
|
+
study: s.study ?? readmissionStudy(question),
|
|
47
|
+
priceUsd: s.priceUsd ?? 2,
|
|
48
|
+
extraFields: s.extraFields,
|
|
49
|
+
waitSeconds: s.waitSeconds,
|
|
50
|
+
money: budget > 0
|
|
51
|
+
? { human: await makeHuman(o.keyFile ? await loadOrCreateIdentity(`${o.keyFile}.human`) : await generateIdentity(), o.domain), budgetUsd: budget, payments: o.payments ?? 'http://payments:4600' }
|
|
52
|
+
: undefined,
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
async close() {
|
|
56
|
+
await link.flush();
|
|
57
|
+
await new Promise((ok) => server.close(ok));
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export { createLakeMcpServer } from './mcp.js';
|
|
62
|
+
export const defaultKeyFile = (domain) => `${homedir()}/.lake/agent-${domain}.json`;
|
|
63
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EACL,gBAAgB,EAAE,YAAY,EAAE,QAAQ,EAAE,oBAAoB,EAAE,WAAW,GAE5E,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAoC,MAAM,0BAA0B,CAAC;AAiDvI;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,CAAmB;IAChD,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC;IAC5B,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,UAAU,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC1H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|
|
4
|
+
* The Lake MCP connector: lets any MCP-capable assistant search the Lake, knock, and dispatch whole
|
|
5
|
+
* studies, as its own signed agent. The assistant brings the model; the Lake bundles none.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createLakeMcpServer(o: LakeAgentOptions): McpServer;
|
package/dist/mcp.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { joinLake } from './index.js';
|
|
4
|
+
/**
|
|
5
|
+
* The Lake MCP connector: lets any MCP-capable assistant search the Lake, knock, and dispatch whole
|
|
6
|
+
* studies, as its own signed agent. The assistant brings the model; the Lake bundles none.
|
|
7
|
+
*/
|
|
8
|
+
export function createLakeMcpServer(o) {
|
|
9
|
+
const server = new McpServer({ name: 'lake', version: '0.1.0' });
|
|
10
|
+
let me = null;
|
|
11
|
+
const agent = () => (me ??= joinLake(o));
|
|
12
|
+
const json = (v) => ({ content: [{ type: 'text', text: JSON.stringify(v, null, 2) }] });
|
|
13
|
+
const fail = (e) => ({ content: [{ type: 'text', text: `Lake error: ${e.message}` }], isError: true });
|
|
14
|
+
server.registerTool('lake_overview', { description: 'What is happening in this Lake right now: houses, agents, conversations, value settled, attacks blocked, records moved (the target is 0), guilds.', inputSchema: {} }, async () => {
|
|
15
|
+
try {
|
|
16
|
+
const s = await (await fetch(`${o.node.replace(/\/$/, '')}/state`)).json();
|
|
17
|
+
const roles = {};
|
|
18
|
+
for (const p of s.participants)
|
|
19
|
+
roles[p.role] = (roles[p.role] ?? 0) + 1;
|
|
20
|
+
return json({ counters: s.counters, participants: roles, guilds: s.guilds, explain: 'https://lake.doneinfifty.com/docs/agents' });
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
return fail(e);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
server.registerTool('lake_search', { description: 'Find participants by skill (e.g. "health-study"), interest tag (e.g. "research-volunteers") or role (house, specialist, visitor, agent).', inputSchema: { skill: z.string().optional(), tag: z.string().optional(), role: z.string().optional() } }, async (q) => {
|
|
27
|
+
try {
|
|
28
|
+
return json(await (await agent()).find(q));
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
return fail(e);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
server.registerTool('lake_knock', {
|
|
35
|
+
description: "Send one signed offer to one house and get its owner's rules' answer (join, decline, ask, counter). Free text never changes a decision.",
|
|
36
|
+
inputSchema: {
|
|
37
|
+
house_url: z.string().describe('The house A2A endpoint, from lake_search'),
|
|
38
|
+
purpose: z.string().describe('e.g. research, care, marketing'),
|
|
39
|
+
fields: z.array(z.string()).describe('Canonical fields, e.g. age_band, medications, readmissions'),
|
|
40
|
+
price_usd: z.number().default(0),
|
|
41
|
+
retention: z.string().default('none').describe('"none" or an ISO 8601 duration'),
|
|
42
|
+
},
|
|
43
|
+
}, async (a) => {
|
|
44
|
+
try {
|
|
45
|
+
return json(await (await agent()).knock(a.house_url, { purpose: a.purpose, fields: a.fields, priceUsd: a.price_usd, retention: a.retention, credentials: { ethicsApproved: false, sponsorVerified: true, auditCertified: false } }));
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
return fail(e);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
server.registerTool('lake_dispatch_study', {
|
|
52
|
+
description: 'Run a whole study across the Lake: ethics approval, audit, knock on every house, bargain, sign agreements, compute inside each house (only randomised answers leave), pay under a signed budget, and return the answer. Records moved stays 0.',
|
|
53
|
+
inputSchema: {
|
|
54
|
+
question: z.string().default('Do over-60s on drug X get readmitted less?'),
|
|
55
|
+
price_usd: z.number().default(2),
|
|
56
|
+
budget_usd: z.number().default(500).describe('The most this study may spend; 0 for unpaid'),
|
|
57
|
+
extra_fields: z.array(z.string()).optional().describe('Ask for more than the study needs, to see houses push back (e.g. postcode)'),
|
|
58
|
+
wait_seconds: z.number().default(0).describe('How long to wait for owners asked to tap Allow'),
|
|
59
|
+
},
|
|
60
|
+
}, async (a) => {
|
|
61
|
+
try {
|
|
62
|
+
const steps = [];
|
|
63
|
+
const r = await (await agent()).study(a.question, { priceUsd: a.price_usd, budgetUsd: a.budget_usd, extraFields: a.extra_fields, waitSeconds: a.wait_seconds, log: (s, d) => steps.push(`${s}: ${d}`) });
|
|
64
|
+
const { grants: _, ...result } = r;
|
|
65
|
+
return json({ ...result, steps });
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
return fail(e);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
return server;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=mcp.js.map
|
package/dist/mcp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAyC,MAAM,YAAY,CAAC;AAE7E;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,CAAmB;IACrD,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IACjE,IAAI,EAAE,GAA8B,IAAI,CAAC;IACzC,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,MAAM,IAAI,GAAG,CAAC,CAAU,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC1G,MAAM,IAAI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E,MAAM,EAAE,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC;YACnC,OAAO,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QACpC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;IACH,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thelakeprotocol/agent",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Join the Lake in ten lines: a signed card, discovery, offers, and whole studies, for any agent.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@modelcontextprotocol/sdk": "1.32.1",
|
|
20
|
+
"zod": "3",
|
|
21
|
+
"@thelakeprotocol/core": "^0.1.0",
|
|
22
|
+
"@thelakeprotocol/visitor": "^0.1.0"
|
|
23
|
+
},
|
|
24
|
+
"bin": {
|
|
25
|
+
"lake": "dist/cli.js"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/thelakeprotocol/lake.git",
|
|
30
|
+
"directory": "packages/agent"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://lake.doneinfifty.com",
|
|
33
|
+
"bugs": "https://github.com/thelakeprotocol/lake/issues",
|
|
34
|
+
"keywords": [
|
|
35
|
+
"lake",
|
|
36
|
+
"solid",
|
|
37
|
+
"a2a",
|
|
38
|
+
"mcp",
|
|
39
|
+
"agents",
|
|
40
|
+
"odrl",
|
|
41
|
+
"verifiable-credentials",
|
|
42
|
+
"ap2",
|
|
43
|
+
"privacy"
|
|
44
|
+
],
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public",
|
|
47
|
+
"provenance": true
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=20"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsc -b"
|
|
54
|
+
}
|
|
6
55
|
}
|