artemys 0.1.2 → 0.2.1

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 (114) hide show
  1. package/CHANGELOG.md +18 -5
  2. package/README.md +213 -70
  3. package/dist/cli/index.d.ts.map +1 -1
  4. package/dist/cli/index.js +319 -27
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/coffeeshop/client.d.ts +103 -279
  7. package/dist/coffeeshop/client.d.ts.map +1 -1
  8. package/dist/coffeeshop/client.js +137 -4
  9. package/dist/coffeeshop/client.js.map +1 -1
  10. package/dist/coffeeshop/index.d.ts +1 -1
  11. package/dist/coffeeshop/index.d.ts.map +1 -1
  12. package/dist/coffeeshop/index.js +1 -1
  13. package/dist/coffeeshop/index.js.map +1 -1
  14. package/dist/discovery/agent-card.schema.d.ts +37 -109
  15. package/dist/discovery/agent-card.schema.d.ts.map +1 -1
  16. package/dist/discovery/discovery-query.schema.d.ts +6 -15
  17. package/dist/discovery/discovery-query.schema.d.ts.map +1 -1
  18. package/dist/discovery/index.d.ts +1 -1
  19. package/dist/discovery/index.d.ts.map +1 -1
  20. package/dist/discovery/index.js +1 -1
  21. package/dist/discovery/index.js.map +1 -1
  22. package/dist/discovery/intro-decision.schema.d.ts +9 -11
  23. package/dist/discovery/intro-decision.schema.d.ts.map +1 -1
  24. package/dist/discovery/intro-request.schema.d.ts +2 -14
  25. package/dist/discovery/intro-request.schema.d.ts.map +1 -1
  26. package/dist/discovery/session-bootstrap.schema.d.ts +86 -66
  27. package/dist/discovery/session-bootstrap.schema.d.ts.map +1 -1
  28. package/dist/discovery/session-bootstrap.schema.js +84 -8
  29. package/dist/discovery/session-bootstrap.schema.js.map +1 -1
  30. package/dist/mcp-server/index.d.ts +2 -1
  31. package/dist/mcp-server/index.d.ts.map +1 -1
  32. package/dist/mcp-server/index.js +2 -1
  33. package/dist/mcp-server/index.js.map +1 -1
  34. package/dist/mcp-server/persistence.d.ts +37 -0
  35. package/dist/mcp-server/persistence.d.ts.map +1 -0
  36. package/dist/mcp-server/persistence.js +309 -0
  37. package/dist/mcp-server/persistence.js.map +1 -0
  38. package/dist/mcp-server/server.d.ts +10 -1
  39. package/dist/mcp-server/server.d.ts.map +1 -1
  40. package/dist/mcp-server/server.js +144 -34
  41. package/dist/mcp-server/server.js.map +1 -1
  42. package/dist/mcp-server/state.d.ts +25 -1
  43. package/dist/mcp-server/state.d.ts.map +1 -1
  44. package/dist/mcp-server/state.js +69 -0
  45. package/dist/mcp-server/state.js.map +1 -1
  46. package/dist/mcp-server/tools/common.d.ts +37 -34
  47. package/dist/mcp-server/tools/common.d.ts.map +1 -1
  48. package/dist/mcp-server/tools/common.js.map +1 -1
  49. package/dist/mcp-server/tools/index.d.ts.map +1 -1
  50. package/dist/mcp-server/tools/index.js +5 -1
  51. package/dist/mcp-server/tools/index.js.map +1 -1
  52. package/dist/mcp-server/tools/intro.d.ts.map +1 -1
  53. package/dist/mcp-server/tools/intro.js +3 -0
  54. package/dist/mcp-server/tools/intro.js.map +1 -1
  55. package/dist/mcp-server/tools/protocol.d.ts.map +1 -1
  56. package/dist/mcp-server/tools/protocol.js +5 -1
  57. package/dist/mcp-server/tools/protocol.js.map +1 -1
  58. package/dist/mcp-server/tools/talent.d.ts +3 -0
  59. package/dist/mcp-server/tools/talent.d.ts.map +1 -0
  60. package/dist/mcp-server/tools/talent.js +226 -0
  61. package/dist/mcp-server/tools/talent.js.map +1 -0
  62. package/dist/openclaw/index.d.ts +2 -0
  63. package/dist/openclaw/index.d.ts.map +1 -0
  64. package/dist/openclaw/index.js +2 -0
  65. package/dist/openclaw/index.js.map +1 -0
  66. package/dist/openclaw/skill.d.ts +13 -0
  67. package/dist/openclaw/skill.d.ts.map +1 -0
  68. package/dist/openclaw/skill.js +18 -0
  69. package/dist/openclaw/skill.js.map +1 -0
  70. package/dist/protocol/consent.schema.d.ts +17 -47
  71. package/dist/protocol/consent.schema.d.ts.map +1 -1
  72. package/dist/protocol/dialogue.schema.d.ts +21 -177
  73. package/dist/protocol/dialogue.schema.d.ts.map +1 -1
  74. package/dist/protocol/envelope.schema.d.ts +46 -28
  75. package/dist/protocol/envelope.schema.d.ts.map +1 -1
  76. package/dist/protocol/errors.d.ts +8 -1
  77. package/dist/protocol/errors.d.ts.map +1 -1
  78. package/dist/protocol/handshake.schema.d.ts +130 -385
  79. package/dist/protocol/handshake.schema.d.ts.map +1 -1
  80. package/dist/protocol/handshake.schema.js +1 -0
  81. package/dist/protocol/handshake.schema.js.map +1 -1
  82. package/dist/protocol/identity.schema.d.ts +44 -94
  83. package/dist/protocol/identity.schema.d.ts.map +1 -1
  84. package/dist/protocol/index.d.ts +1 -0
  85. package/dist/protocol/index.d.ts.map +1 -1
  86. package/dist/protocol/index.js +1 -0
  87. package/dist/protocol/index.js.map +1 -1
  88. package/dist/protocol/message-types.d.ts +14 -1
  89. package/dist/protocol/message-types.d.ts.map +1 -1
  90. package/dist/protocol/message.schema.d.ts +99 -714
  91. package/dist/protocol/message.schema.d.ts.map +1 -1
  92. package/dist/protocol/resolution.schema.d.ts +20 -266
  93. package/dist/protocol/resolution.schema.d.ts.map +1 -1
  94. package/dist/protocol/state-machine.d.ts +10 -1
  95. package/dist/protocol/state-machine.d.ts.map +1 -1
  96. package/dist/protocol/talent.schema.d.ts +106 -0
  97. package/dist/protocol/talent.schema.d.ts.map +1 -0
  98. package/dist/protocol/talent.schema.js +47 -0
  99. package/dist/protocol/talent.schema.js.map +1 -0
  100. package/dist/protocol/transport.schema.d.ts +16 -18
  101. package/dist/protocol/transport.schema.d.ts.map +1 -1
  102. package/dist/transport/client.d.ts +4 -1
  103. package/dist/transport/client.d.ts.map +1 -1
  104. package/dist/transport/client.js +2 -2
  105. package/dist/transport/client.js.map +1 -1
  106. package/dist/transport/index.d.ts +2 -1
  107. package/dist/transport/index.d.ts.map +1 -1
  108. package/dist/transport/index.js +2 -1
  109. package/dist/transport/index.js.map +1 -1
  110. package/dist/transport/reference-runner.d.ts +37 -0
  111. package/dist/transport/reference-runner.d.ts.map +1 -0
  112. package/dist/transport/reference-runner.js +372 -0
  113. package/dist/transport/reference-runner.js.map +1 -0
  114. package/package.json +7 -3
package/CHANGELOG.md CHANGED
@@ -2,9 +2,22 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
- ## 0.3.0 - 2026-02-24
5
+ ## Unreleased
6
6
 
7
- - Removed `artemys/scanning` and `artemys/notifications` from package exports.
8
- - Removed scanning and notification source modules from the SDK codebase.
9
- - Updated docs to reflect SDK boundary: protocol/runtime/addons in `artemys`, product workflows in downstream apps (Artie).
10
- - Added migration guidance for consumers upgrading from `0.2.x`.
7
+ ## 0.2.1 - 2026-03-02
8
+
9
+ - Added SQLite-backed MCP persistence for profile + conversation state and exposed persistence APIs from `artemys/mcp-server`.
10
+ - Added `artemys talent` CLI subcommands and `--persist` support for `artemys mcp-server`.
11
+ - Added OpenClaw/MCP/talent quickstart docs and protocol flow diagrams.
12
+ - Hardened Coffee Shop service with API rate limiting, attestation expiry enforcement in discovery paths, and richer health/monitoring output.
13
+
14
+ - Added secure intro handoff contract in Coffee Shop bootstrap responses with explicit relay/direct handoff fields.
15
+ - Added bootstrap-issued shared secret lifecycle metadata and intro session secret rotation endpoint.
16
+ - Added Coffee Shop client and CLI fallback support for resolving transport shared secrets from accepted intros.
17
+ - Added runnable reference runtime loop (`examples/reference-runtime-loop.ts`) with happy path and timeout/deferred behavior.
18
+ - Updated docs for fundamentals, getting started, versioning, and current SDK/product boundary.
19
+
20
+ ## 0.1.2 - 2026-02-24
21
+
22
+ - Scope cleanup to keep Artemys focused on interoperability primitives.
23
+ - Removed stale references to previously extracted product workflows from package exports and docs.
package/README.md CHANGED
@@ -1,139 +1,282 @@
1
1
  <div align="center">
2
2
 
3
- <img src="https://gist.githubusercontent.com/jblue-ops/4f2ddf27e37b2ca8358168535c8fd8ee/raw/artemys-icon.svg" width="52" alt="Artemys">
3
+ <img src="https://gist.githubusercontent.com/jblue-ops/4f2ddf27e37b2ca8358168535c8fd8ee/raw/artemys-icon.svg" width="56" alt="Artemys">
4
4
 
5
- # A R T E M Y S
5
+ # Artemys
6
6
 
7
- **Protocol + network SDK for agent-to-agent career communication**
7
+ **Open protocol and ecosystem for agent-to-agent career communication**
8
8
 
9
9
  [![npm](https://img.shields.io/npm/v/artemys?style=flat-square&color=000&label=npm)](https://www.npmjs.com/package/artemys)
10
+ [![protocol](https://img.shields.io/badge/protocol-v0.1.0-000?style=flat-square)](protocol/)
10
11
  [![license](https://img.shields.io/badge/license-MIT-000?style=flat-square)](LICENSE)
11
- [![TypeScript](https://img.shields.io/badge/TypeScript-first-000?style=flat-square&logo=typescript&logoColor=fff)](https://www.typescriptlang.org/)
12
+ [![TypeScript](https://img.shields.io/badge/TypeScript-000?style=flat-square&logo=typescript&logoColor=fff)](https://www.typescriptlang.org/)
12
13
 
13
- **[Protocol Spec](protocol/)** · **[Docs](docs/)** · **[Vision](docs/VISION.md)**
14
+ [Quickstart](docs/quickstart.md) &middot; [Getting Started](docs/start/GETTING-STARTED.md) &middot; [Fundamentals](docs/FUNDAMENTALS.md) &middot; [Protocol Flow](docs/protocol-flow.md) &middot; [Vision](docs/VISION.md) &middot; [npm](https://www.npmjs.com/package/artemys)
14
15
 
15
16
  </div>
16
17
 
17
- ---
18
+ <br>
18
19
 
19
- Artemys is now focused on ecosystem interoperability:
20
+ Artemys defines how AI agents representing candidates and employers discover each other, establish trust, and conduct structured career conversations — so humans only engage at moments of meaningful choice.
20
21
 
21
- - `artemys/protocol` - normative protocol schemas and state machine
22
- - `artemys/discovery` - Coffee Shop discovery schemas
23
- - `artemys/transport` - HTTP transport client/server with HMAC-SHA256
24
- - `artemys/coffeeshop` - Coffee Shop API client
25
- - `artemys/mcp-server` - MCP bridge for BYOA agents
26
- - `artemys/integrations` - job board integration utilities
22
+ This package provides the interoperability primitives: protocol schemas, authenticated transport, discovery, and an MCP bridge. Runtime and product logic belong downstream.
27
23
 
28
- Runtime and channel orchestration are extracted to downstream app repos.
24
+ Start with `docs/FUNDAMENTALS.md` for the implementation map (plug in -> meet -> converse).
25
+
26
+ <br>
27
+
28
+ ## Architecture
29
+
30
+ ```
31
+ ┌──────────────────────────────────┐
32
+ │ Coffee Shop │
33
+ │ (discovery + introductions) │
34
+ └──────┬───────────────┬───────────┘
35
+ │ │
36
+ discover introduce
37
+ │ │
38
+ ┌───────────────┴───┐ ┌───┴───────────────┐
39
+ │ Candidate Agent │ │ Talent Agent │
40
+ │ │ │ │
41
+ │ ┌─────────────┐ │ │ ┌─────────────┐ │
42
+ │ │ Protocol │◄─┼───────┼──► Protocol │ │
43
+ │ │ Schemas │ │ HMAC │ │ Schemas │ │
44
+ │ └─────────────┘ │ HTTP │ └─────────────┘ │
45
+ └───────────────────┘ └───────────────────┘
46
+ ```
47
+
48
+ <br>
29
49
 
30
50
  ## Install
31
51
 
32
52
  ```bash
33
53
  npm install artemys
34
- # or
35
- bun add artemys
36
54
  ```
37
55
 
38
- ## Package Exports
56
+ <br>
57
+
58
+ ## Modules
59
+
60
+ | Import | What it does |
61
+ |--------|-------------|
62
+ | `artemys` | 47 Zod schemas, 8-state machine, 12 message types |
63
+ | `artemys/discovery` | Agent cards, discovery queries, intro requests |
64
+ | `artemys/transport` | HMAC-SHA256 authenticated HTTP client and server |
65
+ | `artemys/coffeeshop` | Client for the Coffee Shop discovery API |
66
+ | `artemys/mcp-server` | MCP bridge — expose the protocol to any agent |
67
+ | `artemys/integrations` | Job board connectors (Ashby, Greenhouse, Lever, Remotive) |
68
+
69
+ <br>
70
+
71
+ ## Quick Start
72
+
73
+ Reference runnable examples: `examples/README.md`
74
+
75
+ ### Validate a protocol message
39
76
 
40
77
  ```typescript
41
- import { HandshakeInitiateSchema } from "artemys"
42
- import { AgentCardSchema } from "artemys/discovery"
43
- import { ProtocolTransportClient } from "artemys/transport"
44
- import { CoffeeShopClient } from "artemys/coffeeshop"
45
- import { startArtemysMcpServer } from "artemys/mcp-server"
46
- import { fetchWatchlistSourceOpportunities } from "artemys/integrations"
78
+ import { ProtocolMessageSchema, HandshakeInitiateSchema } from "artemys"
79
+
80
+ const result = ProtocolMessageSchema.safeParse(incomingMessage)
81
+ if (!result.success) {
82
+ console.error(result.error.issues)
83
+ }
47
84
  ```
48
85
 
49
- ## Transport Example
86
+ ### Send a signed message
50
87
 
51
88
  ```typescript
52
89
  import { ProtocolTransportClient } from "artemys/transport"
53
90
 
54
- const client = new ProtocolTransportClient({
55
- agentId: "agent-a",
56
- getSharedSecret: async (targetAgentId) => getSecretForPeer(targetAgentId),
91
+ const transport = new ProtocolTransportClient({
92
+ agentId: "candidate-agent-01",
93
+ getSharedSecret: async (peerId) => secrets.get(peerId),
57
94
  })
58
95
 
59
- const result = await client.send("https://peer.example.com/artemys/v0.1/messages", message)
60
- if (!result.ok) {
61
- console.error(result.error)
62
- }
96
+ const result = await transport.send(
97
+ "https://peer.example.com/artemys/v0.1/messages",
98
+ message
99
+ )
63
100
  ```
64
101
 
65
- ## Coffee Shop Client Example
102
+ ### Discover agents via Coffee Shop
103
+
104
+ Coffee Shop is the network receptionist for agents:
105
+
106
+ - Agents register their public card (who they are, what they can do, where they can be reached)
107
+ - Agents discover compatible peers for a given role/capability
108
+ - Agents request intros, and the target agent can accept or decline
109
+ - On accept, Coffee Shop returns a session bootstrap with peer endpoints, transport profile, shared secret, and rotation metadata
110
+ - Coffee Shop tracks intro lifecycle events and enforces safety checks (auth, compatibility, consent rules, retry-safe idempotency)
111
+
112
+ Coffee Shop handles matchmaking and safe handoff. The actual career conversation happens agent-to-agent through the protocol.
66
113
 
67
114
  ```typescript
68
115
  import { CoffeeShopClient } from "artemys/coffeeshop"
69
116
 
70
- const client = new CoffeeShopClient({
117
+ const shop = new CoffeeShopClient({
71
118
  baseUrl: "https://coffeeshop.artemys.ai",
72
- apiKey: process.env.ARTEMYS_COFFEESHOP_API_KEY,
73
- agentId: "agent-a",
119
+ apiKey: process.env.ARTEMYS_API_KEY,
120
+ agentId: "candidate-agent-01",
74
121
  })
75
122
 
76
- const agents = await client.discover({
77
- requester_agent_id: "agent-a",
123
+ const agents = await shop.discover({
124
+ requester_agent_id: "candidate-agent-01",
78
125
  role: "talent_agent",
79
126
  limit: 20,
80
127
  })
81
128
  ```
82
129
 
83
- ## CLI
130
+ ### Run the reference runtime loop
131
+
132
+ ```bash
133
+ bun run examples/reference-runtime-loop.ts
134
+ ```
135
+
136
+ ```bash
137
+ bun run examples/reference-runtime-loop.ts timeout
138
+ ```
139
+
140
+ ### Run the MCP server
84
141
 
85
142
  ```bash
86
143
  artemys mcp-server --agent-card ./agent-card.json
87
- artemys register --agent-card ./agent-card.json
88
- artemys discover --requester-agent-id agent-123 --role talent_agent
89
- artemys version
90
144
  ```
91
145
 
92
- ## Repo Structure
146
+ The MCP server exposes protocol, discovery, and intro tools — letting any MCP-compatible agent participate in the Artemys network without writing transport code.
147
+ Set `ARTEMYS_COFFEESHOP_API_KEY` to enable intro tools; without it, the bridge registers discovery + protocol tools.
148
+
149
+ <br>
150
+
151
+ ## Protocol
152
+
153
+ The protocol defines how two agents conduct a structured career conversation, from first contact to resolution.
154
+
155
+ ```
156
+ NEW ──► HANDSHAKE_INITIATED ──► DIALOGUE_ACTIVE ──► RESOLVED
157
+ │ │
158
+ ▼ ▼
159
+ CANDIDATE_DECLINE PAUSED_HUMAN_APPROVAL
160
+ ```
161
+
162
+ **12 message types** across 4 phases — handshake, dialogue, consent, resolution — with sender role constraints, schema validation, and deterministic state transitions.
163
+
164
+ The protocol spec is frozen at **v0.1.0** with 41 contract fixtures and conformance tests.
165
+
166
+ **[Read the full spec &rarr;](protocol/)**
167
+
168
+ <br>
169
+
170
+ ## Transport
93
171
 
94
- ```text
172
+ Messages travel over HTTPS with HMAC-SHA256 authentication:
173
+
174
+ - **Endpoint:** `POST /artemys/v0.1/messages`
175
+ - **Signing:** `agent_id.timestamp.body` with shared secret
176
+ - **Replay protection:** 5-minute timestamp window
177
+ - **Deduplication:** by sender + message ID
178
+ - **Retries:** exponential backoff (5 attempts, 60s cap)
179
+
180
+ **[Transport spec &rarr;](protocol/docs/TRANSPORT_HTTP.md)**
181
+
182
+ <br>
183
+
184
+ ## CLI
185
+
186
+ ```bash
187
+ artemys mcp-server # Start the MCP bridge server
188
+ artemys talent # Candidate talent workflow helpers
189
+ artemys register # Register an agent card with Coffee Shop
190
+ artemys discover # Query for compatible agents
191
+ artemys rotate-key # Rotate Coffee Shop API key
192
+ artemys intro-events # Show intro lifecycle events
193
+ artemys version # Print CLI package version
194
+ ```
195
+
196
+ <br>
197
+
198
+ ## Project Structure
199
+
200
+ ```
95
201
  src/
96
- protocol/
97
- discovery/
98
- transport/
99
- coffeeshop/
100
- mcp-server/
101
- integrations/
102
- cli/
103
- service/
104
- api/
105
- src/
106
- tests/
107
- protocol/
108
- docs/
109
- conformance/
202
+ protocol/ Zod schemas, state machine, message types
203
+ discovery/ Agent cards, queries, OpenAPI spec
204
+ transport/ HMAC client, server handler, dedup
205
+ coffeeshop/ Coffee Shop API client
206
+ mcp-server/ MCP tools (protocol, discovery, intro)
207
+ integrations/ Job board connectors
208
+ cli/ CLI commands
209
+
210
+ protocol/ Protocol spec, contracts, fixtures
211
+ service/ Coffee Shop service (Vercel)
110
212
  ```
111
213
 
214
+ <br>
215
+
112
216
  ## Development
113
217
 
114
218
  ```bash
115
- bun install
116
- bun run type-check
117
- bun run test
118
- bun run build
119
- bun run protocol:check
219
+ bun install # Install dependencies
220
+ bun run type-check # Type-check without emitting
221
+ bun run test # Run test suite
222
+ bun run build # Build to dist/
223
+ bun run protocol:check # Run protocol contract tests
120
224
  ```
121
225
 
122
- For Coffee Shop service work:
226
+ ### Coffee Shop Service (Turso/libSQL)
123
227
 
124
228
  ```bash
125
229
  cd service
126
230
  bun install
231
+
232
+ # Use durable DB mode
233
+ export ARTEMYS_DB_DRIVER=libsql
234
+ export TURSO_DATABASE_URL="libsql://..."
235
+ export TURSO_AUTH_TOKEN="..."
236
+
237
+ # Run schema migrations once per environment
238
+ bun run migrate
239
+
240
+ # Run service tests/type-check
241
+ bun run type-check
127
242
  bun run test
128
- vercel dev
243
+
244
+ # Optional: run coverage gate locally (same thresholded path as CI)
245
+ bun run test:coverage
246
+ ```
247
+
248
+ Non-local runtimes fail closed if durable DB config is missing.
249
+ If you intentionally want non-local ephemeral mode, set:
250
+
251
+ ```bash
252
+ export ARTEMYS_ALLOW_IN_MEMORY_DB=true
129
253
  ```
130
254
 
131
- ## Notes
255
+ Metrics endpoint auth:
132
256
 
133
- - Discovery schemas are stable and used by both SDK and service.
134
- - Transport profile follows `protocol/docs/TRANSPORT_HTTP.md`.
135
- - Keep protocol behavior deterministic and fixture-compatible.
257
+ - Non-local runtimes require `ARTEMYS_METRICS_TOKEN`
258
+ - Local/test runtimes can leave it unset for local debugging
136
259
 
137
- ---
260
+ ```bash
261
+ export ARTEMYS_METRICS_TOKEN="your-shared-metrics-token"
262
+ ```
138
263
 
139
- MIT License
264
+ Attestation policy defaults to enforce. Explicit local opt-out:
265
+
266
+ ```bash
267
+ export ARTEMYS_ATTESTATION_MODE=warn
268
+ ```
269
+
270
+ <br>
271
+
272
+ ## Contributing
273
+
274
+ Artemys is open source under the [MIT License](LICENSE).
275
+
276
+ The protocol spec is frozen — changes require a version bump and updated contract fixtures. Contributions should stay focused on interoperability primitives; product-specific logic belongs in downstream repos.
277
+
278
+ <br>
279
+
280
+ <div align="center">
281
+ <sub>Built by <a href="https://artemys.ai">Artemys</a></sub>
282
+ </div>
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAmOA,wBAAsB,MAAM,CAAC,IAAI,WAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BxE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AA+kBA,wBAAsB,MAAM,CAAC,IAAI,WAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6CxE"}