@soulcraft/sdk 1.0.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/dist/client/index.d.ts +62 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +60 -0
- package/dist/client/index.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/ai/index.d.ts +55 -0
- package/dist/modules/ai/index.d.ts.map +1 -0
- package/dist/modules/ai/index.js +263 -0
- package/dist/modules/ai/index.js.map +1 -0
- package/dist/modules/ai/types.d.ts +216 -0
- package/dist/modules/ai/types.d.ts.map +1 -0
- package/dist/modules/ai/types.js +30 -0
- package/dist/modules/ai/types.js.map +1 -0
- package/dist/modules/auth/backchannel.d.ts +85 -0
- package/dist/modules/auth/backchannel.d.ts.map +1 -0
- package/dist/modules/auth/backchannel.js +168 -0
- package/dist/modules/auth/backchannel.js.map +1 -0
- package/dist/modules/auth/config.d.ts +122 -0
- package/dist/modules/auth/config.d.ts.map +1 -0
- package/dist/modules/auth/config.js +158 -0
- package/dist/modules/auth/config.js.map +1 -0
- package/dist/modules/auth/middleware.d.ts +146 -0
- package/dist/modules/auth/middleware.d.ts.map +1 -0
- package/dist/modules/auth/middleware.js +204 -0
- package/dist/modules/auth/middleware.js.map +1 -0
- package/dist/modules/auth/types.d.ts +162 -0
- package/dist/modules/auth/types.d.ts.map +1 -0
- package/dist/modules/auth/types.js +14 -0
- package/dist/modules/auth/types.js.map +1 -0
- package/dist/modules/billing/types.d.ts +7 -0
- package/dist/modules/billing/types.d.ts.map +1 -0
- package/dist/modules/billing/types.js +7 -0
- package/dist/modules/billing/types.js.map +1 -0
- package/dist/modules/brainy/auth.d.ts +104 -0
- package/dist/modules/brainy/auth.d.ts.map +1 -0
- package/dist/modules/brainy/auth.js +144 -0
- package/dist/modules/brainy/auth.js.map +1 -0
- package/dist/modules/brainy/errors.d.ts +118 -0
- package/dist/modules/brainy/errors.d.ts.map +1 -0
- package/dist/modules/brainy/errors.js +142 -0
- package/dist/modules/brainy/errors.js.map +1 -0
- package/dist/modules/brainy/events.d.ts +63 -0
- package/dist/modules/brainy/events.d.ts.map +1 -0
- package/dist/modules/brainy/events.js +14 -0
- package/dist/modules/brainy/events.js.map +1 -0
- package/dist/modules/brainy/proxy.d.ts +48 -0
- package/dist/modules/brainy/proxy.d.ts.map +1 -0
- package/dist/modules/brainy/proxy.js +95 -0
- package/dist/modules/brainy/proxy.js.map +1 -0
- package/dist/modules/brainy/types.d.ts +83 -0
- package/dist/modules/brainy/types.d.ts.map +1 -0
- package/dist/modules/brainy/types.js +21 -0
- package/dist/modules/brainy/types.js.map +1 -0
- package/dist/modules/events/index.d.ts +41 -0
- package/dist/modules/events/index.d.ts.map +1 -0
- package/dist/modules/events/index.js +53 -0
- package/dist/modules/events/index.js.map +1 -0
- package/dist/modules/events/types.d.ts +129 -0
- package/dist/modules/events/types.d.ts.map +1 -0
- package/dist/modules/events/types.js +32 -0
- package/dist/modules/events/types.js.map +1 -0
- package/dist/modules/formats/types.d.ts +7 -0
- package/dist/modules/formats/types.d.ts.map +1 -0
- package/dist/modules/formats/types.js +7 -0
- package/dist/modules/formats/types.js.map +1 -0
- package/dist/modules/hall/types.d.ts +56 -0
- package/dist/modules/hall/types.d.ts.map +1 -0
- package/dist/modules/hall/types.js +16 -0
- package/dist/modules/hall/types.js.map +1 -0
- package/dist/modules/kits/types.d.ts +7 -0
- package/dist/modules/kits/types.d.ts.map +1 -0
- package/dist/modules/kits/types.js +7 -0
- package/dist/modules/kits/types.js.map +1 -0
- package/dist/modules/license/types.d.ts +7 -0
- package/dist/modules/license/types.d.ts.map +1 -0
- package/dist/modules/license/types.js +7 -0
- package/dist/modules/license/types.js.map +1 -0
- package/dist/modules/notifications/types.d.ts +7 -0
- package/dist/modules/notifications/types.d.ts.map +1 -0
- package/dist/modules/notifications/types.js +7 -0
- package/dist/modules/notifications/types.js.map +1 -0
- package/dist/modules/skills/index.d.ts +60 -0
- package/dist/modules/skills/index.d.ts.map +1 -0
- package/dist/modules/skills/index.js +253 -0
- package/dist/modules/skills/index.js.map +1 -0
- package/dist/modules/skills/types.d.ts +127 -0
- package/dist/modules/skills/types.d.ts.map +1 -0
- package/dist/modules/skills/types.js +23 -0
- package/dist/modules/skills/types.js.map +1 -0
- package/dist/modules/versions/types.d.ts +31 -0
- package/dist/modules/versions/types.d.ts.map +1 -0
- package/dist/modules/versions/types.js +9 -0
- package/dist/modules/versions/types.js.map +1 -0
- package/dist/modules/vfs/types.d.ts +26 -0
- package/dist/modules/vfs/types.d.ts.map +1 -0
- package/dist/modules/vfs/types.js +11 -0
- package/dist/modules/vfs/types.js.map +1 -0
- package/dist/server/create-sdk.d.ts +70 -0
- package/dist/server/create-sdk.d.ts.map +1 -0
- package/dist/server/create-sdk.js +125 -0
- package/dist/server/create-sdk.js.map +1 -0
- package/dist/server/hall-handlers.d.ts +195 -0
- package/dist/server/hall-handlers.d.ts.map +1 -0
- package/dist/server/hall-handlers.js +239 -0
- package/dist/server/hall-handlers.js.map +1 -0
- package/dist/server/handlers.d.ts +216 -0
- package/dist/server/handlers.d.ts.map +1 -0
- package/dist/server/handlers.js +214 -0
- package/dist/server/handlers.js.map +1 -0
- package/dist/server/index.d.ts +52 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +50 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/instance-pool.d.ts +299 -0
- package/dist/server/instance-pool.d.ts.map +1 -0
- package/dist/server/instance-pool.js +359 -0
- package/dist/server/instance-pool.js.map +1 -0
- package/dist/transports/http.d.ts +86 -0
- package/dist/transports/http.d.ts.map +1 -0
- package/dist/transports/http.js +134 -0
- package/dist/transports/http.js.map +1 -0
- package/dist/transports/local.d.ts +76 -0
- package/dist/transports/local.d.ts.map +1 -0
- package/dist/transports/local.js +101 -0
- package/dist/transports/local.js.map +1 -0
- package/dist/transports/sse.d.ts +99 -0
- package/dist/transports/sse.d.ts.map +1 -0
- package/dist/transports/sse.js +192 -0
- package/dist/transports/sse.js.map +1 -0
- package/dist/transports/transport.d.ts +68 -0
- package/dist/transports/transport.d.ts.map +1 -0
- package/dist/transports/transport.js +14 -0
- package/dist/transports/transport.js.map +1 -0
- package/dist/transports/ws.d.ts +135 -0
- package/dist/transports/ws.d.ts.map +1 -0
- package/dist/transports/ws.js +331 -0
- package/dist/transports/ws.js.map +1 -0
- package/dist/types.d.ts +152 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/docs/ADR-001-sdk-design.md +282 -0
- package/docs/IMPLEMENTATION-PLAN.md +708 -0
- package/docs/USAGE.md +646 -0
- package/docs/kit-sdk-guide.md +474 -0
- package/package.json +61 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @soulcraft/sdk/client
|
|
3
|
+
* @description Browser/client entry point for @soulcraft/sdk. Exports everything needed
|
|
4
|
+
* for kit apps running in a browser context to connect to a Soulcraft product backend.
|
|
5
|
+
*
|
|
6
|
+
* Includes: HTTP (JSON RPC), WebSocket (MessagePack binary RPC + change push), and
|
|
7
|
+
* SSE (server-push) transports. Cookie-based and Bearer token auth. The Brainy proxy
|
|
8
|
+
* factory for creating a fully-typed `sdk.brainy` API surface over any transport.
|
|
9
|
+
*
|
|
10
|
+
* This entry point has no server-only dependencies — it is safe to bundle for the
|
|
11
|
+
* browser. The trade-off is that it cannot create Brainy instances directly.
|
|
12
|
+
*
|
|
13
|
+
* @example HTTP transport (kit apps, stateless)
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { createBrainyProxy, HttpTransport } from '@soulcraft/sdk/client'
|
|
16
|
+
*
|
|
17
|
+
* const brainy = createBrainyProxy(
|
|
18
|
+
* new HttpTransport('https://workshop.soulcraft.com', undefined, true)
|
|
19
|
+
* )
|
|
20
|
+
*
|
|
21
|
+
* const results = await brainy.find({ query: 'candle kits', limit: 10 })
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example WebSocket transport (real-time, change push)
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import { createBrainyProxy, WsTransport } from '@soulcraft/sdk/client'
|
|
27
|
+
*
|
|
28
|
+
* const transport = new WsTransport(
|
|
29
|
+
* 'wss://venue.soulcraft.com/api/brainy/ws',
|
|
30
|
+
* capabilityToken,
|
|
31
|
+
* 'wicks-and-whiskers'
|
|
32
|
+
* )
|
|
33
|
+
* await transport.connect()
|
|
34
|
+
*
|
|
35
|
+
* const brainy = createBrainyProxy(transport)
|
|
36
|
+
* brainy.onDataChange((event) => console.log('live change:', event))
|
|
37
|
+
*
|
|
38
|
+
* const items = await brainy.find({ query: 'inventory' })
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example SSE transport (receive-only change events, paired with HTTP)
|
|
42
|
+
* ```typescript
|
|
43
|
+
* import { createBrainyProxy, HttpTransport, SseTransport } from '@soulcraft/sdk/client'
|
|
44
|
+
*
|
|
45
|
+
* const http = new HttpTransport('https://venue.soulcraft.com', undefined, true)
|
|
46
|
+
* const sse = new SseTransport('https://venue.soulcraft.com', workspaceId)
|
|
47
|
+
* sse.connect()
|
|
48
|
+
*
|
|
49
|
+
* const brainy = createBrainyProxy(http)
|
|
50
|
+
* sse.onEvent((event) => refreshUI(event))
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export { HttpTransport } from '../transports/http.js';
|
|
54
|
+
export { WsTransport } from '../transports/ws.js';
|
|
55
|
+
export { SseTransport } from '../transports/sse.js';
|
|
56
|
+
export type { SDKTransport } from '../transports/transport.js';
|
|
57
|
+
export { createBrainyProxy } from '../modules/brainy/proxy.js';
|
|
58
|
+
export type { ClientSDKOptions } from '../types.js';
|
|
59
|
+
export type { SoulcraftBrainy } from '../modules/brainy/types.js';
|
|
60
|
+
export type { BrainyChangeEvent } from '../modules/brainy/events.js';
|
|
61
|
+
export { SDKError, SDKDisconnectedError, SDKTimeoutError, SDKAuthError, SDKForbiddenError, SDKRpcError, SDKMethodNotFoundError, } from '../modules/brainy/errors.js';
|
|
62
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,YAAY,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAG9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAG9D,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnD,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,sBAAsB,GACvB,MAAM,6BAA6B,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @soulcraft/sdk/client
|
|
3
|
+
* @description Browser/client entry point for @soulcraft/sdk. Exports everything needed
|
|
4
|
+
* for kit apps running in a browser context to connect to a Soulcraft product backend.
|
|
5
|
+
*
|
|
6
|
+
* Includes: HTTP (JSON RPC), WebSocket (MessagePack binary RPC + change push), and
|
|
7
|
+
* SSE (server-push) transports. Cookie-based and Bearer token auth. The Brainy proxy
|
|
8
|
+
* factory for creating a fully-typed `sdk.brainy` API surface over any transport.
|
|
9
|
+
*
|
|
10
|
+
* This entry point has no server-only dependencies — it is safe to bundle for the
|
|
11
|
+
* browser. The trade-off is that it cannot create Brainy instances directly.
|
|
12
|
+
*
|
|
13
|
+
* @example HTTP transport (kit apps, stateless)
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { createBrainyProxy, HttpTransport } from '@soulcraft/sdk/client'
|
|
16
|
+
*
|
|
17
|
+
* const brainy = createBrainyProxy(
|
|
18
|
+
* new HttpTransport('https://workshop.soulcraft.com', undefined, true)
|
|
19
|
+
* )
|
|
20
|
+
*
|
|
21
|
+
* const results = await brainy.find({ query: 'candle kits', limit: 10 })
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example WebSocket transport (real-time, change push)
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import { createBrainyProxy, WsTransport } from '@soulcraft/sdk/client'
|
|
27
|
+
*
|
|
28
|
+
* const transport = new WsTransport(
|
|
29
|
+
* 'wss://venue.soulcraft.com/api/brainy/ws',
|
|
30
|
+
* capabilityToken,
|
|
31
|
+
* 'wicks-and-whiskers'
|
|
32
|
+
* )
|
|
33
|
+
* await transport.connect()
|
|
34
|
+
*
|
|
35
|
+
* const brainy = createBrainyProxy(transport)
|
|
36
|
+
* brainy.onDataChange((event) => console.log('live change:', event))
|
|
37
|
+
*
|
|
38
|
+
* const items = await brainy.find({ query: 'inventory' })
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example SSE transport (receive-only change events, paired with HTTP)
|
|
42
|
+
* ```typescript
|
|
43
|
+
* import { createBrainyProxy, HttpTransport, SseTransport } from '@soulcraft/sdk/client'
|
|
44
|
+
*
|
|
45
|
+
* const http = new HttpTransport('https://venue.soulcraft.com', undefined, true)
|
|
46
|
+
* const sse = new SseTransport('https://venue.soulcraft.com', workspaceId)
|
|
47
|
+
* sse.connect()
|
|
48
|
+
*
|
|
49
|
+
* const brainy = createBrainyProxy(http)
|
|
50
|
+
* sse.onEvent((event) => refreshUI(event))
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
// ── Transport classes ─────────────────────────────────────────────────────────
|
|
54
|
+
export { HttpTransport } from '../transports/http.js';
|
|
55
|
+
export { WsTransport } from '../transports/ws.js';
|
|
56
|
+
export { SseTransport } from '../transports/sse.js';
|
|
57
|
+
// ── Proxy factory ─────────────────────────────────────────────────────────────
|
|
58
|
+
export { createBrainyProxy } from '../modules/brainy/proxy.js';
|
|
59
|
+
export { SDKError, SDKDisconnectedError, SDKTimeoutError, SDKAuthError, SDKForbiddenError, SDKRpcError, SDKMethodNotFoundError, } from '../modules/brainy/errors.js';
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,iFAAiF;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGnD,iFAAiF;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAM9D,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,sBAAsB,GACvB,MAAM,6BAA6B,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @soulcraft/sdk
|
|
3
|
+
* @description Shared entry point for @soulcraft/sdk. Exports the createSDK factory,
|
|
4
|
+
* all shared types, and re-exports from every module namespace. This entry point is
|
|
5
|
+
* safe to import in any environment (server or browser).
|
|
6
|
+
*
|
|
7
|
+
* For server-specific exports (Brainy lifecycle, Cortex, auth middleware, RPC handlers),
|
|
8
|
+
* use `@soulcraft/sdk/server`.
|
|
9
|
+
*
|
|
10
|
+
* For browser-specific exports (HTTP/WS/SSE transports, cookie auth), use
|
|
11
|
+
* `@soulcraft/sdk/client`.
|
|
12
|
+
*/
|
|
13
|
+
export type { SoulcraftSDK, SDKOptions, ServerSDKOptions, ClientSDKOptions } from './types.js';
|
|
14
|
+
export type { SoulcraftBrainy } from './modules/brainy/types.js';
|
|
15
|
+
export type { Entity, Relation, Result, AddParams, UpdateParams, RelateParams, FindParams, BrainyConfig, AggregateDefinition, DiagnosticsResult, MigrationResult, MigrateOptions, MigrationPreview, NounType, VerbType, BrainyChangeEvent, BrainyChangeEntity, BrainyChangeRelation, } from './modules/brainy/types.js';
|
|
16
|
+
export type { CreateCapabilityTokenOptions, CapabilityTokenClaims, } from './modules/brainy/auth.js';
|
|
17
|
+
export { createCapabilityToken, verifyCapabilityToken, } from './modules/brainy/auth.js';
|
|
18
|
+
export { SDKError, SDKDisconnectedError, SDKTimeoutError, SDKAuthError, SDKForbiddenError, SDKRpcError, SDKMethodNotFoundError, } from './modules/brainy/errors.js';
|
|
19
|
+
export type { VfsModule } from './modules/vfs/types.js';
|
|
20
|
+
export type { VersionsModule } from './modules/versions/types.js';
|
|
21
|
+
export type { HallModule, HallConfig, RoomOptions, RecordingManifest, ConceptEvent, RelationProposedEvent, AttentionEvent, RoomEventMap, } from './modules/hall/types.js';
|
|
22
|
+
export type { AuthModule, PlatformRole, SoulcraftAuthProvider, SoulcraftOrganization, SoulcraftUserFields, SoulcraftSessionUser, SoulcraftSession, OIDCClientConfig, AuthMode, } from './modules/auth/types.js';
|
|
23
|
+
export { SOULCRAFT_USER_FIELDS, SOULCRAFT_SESSION_CONFIG, computeEmailHash, getAuthMode, getOIDCClientConfig, } from './modules/auth/config.js';
|
|
24
|
+
export type { AiModule, AiCompleteOptions, AiCompleteResult, AiStreamOptions, AiStreamEvent, AiToolCall, AiMessage, AiContentBlock, AiTool, AiModel, } from './modules/ai/types.js';
|
|
25
|
+
export { AI_MODELS } from './modules/ai/types.js';
|
|
26
|
+
export type { EventsModule, SoulcraftEventMap, SoulcraftEventName, VfsWriteEvent, VfsDeleteEvent, VfsRenameEvent, } from './modules/events/types.js';
|
|
27
|
+
export type { SkillsModule, Skill, SkillListOptions, SkillInstallOptions, } from './modules/skills/types.js';
|
|
28
|
+
export type * from './modules/license/types.js';
|
|
29
|
+
export type * from './modules/kits/types.js';
|
|
30
|
+
export type * from './modules/formats/types.js';
|
|
31
|
+
export type * from './modules/billing/types.js';
|
|
32
|
+
export type * from './modules/notifications/types.js';
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAG9F,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,YAAY,EACV,MAAM,EACN,QAAQ,EACR,MAAM,EACN,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,2BAA2B,CAAA;AAClC,YAAY,EACV,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,sBAAsB,GACvB,MAAM,4BAA4B,CAAA;AAGnC,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGvD,YAAY,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAGjE,YAAY,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,YAAY,GACb,MAAM,yBAAyB,CAAA;AAGhC,YAAY,EACV,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,GACT,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,WAAW,EACX,mBAAmB,GACpB,MAAM,0BAA0B,CAAA;AAGjC,YAAY,EACV,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACN,OAAO,GACR,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAGjD,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,cAAc,GACf,MAAM,2BAA2B,CAAA;AAGlC,YAAY,EACV,YAAY,EACZ,KAAK,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,2BAA2B,CAAA;AAGlC,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,yBAAyB,CAAA;AAC5C,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,kCAAkC,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @soulcraft/sdk
|
|
3
|
+
* @description Shared entry point for @soulcraft/sdk. Exports the createSDK factory,
|
|
4
|
+
* all shared types, and re-exports from every module namespace. This entry point is
|
|
5
|
+
* safe to import in any environment (server or browser).
|
|
6
|
+
*
|
|
7
|
+
* For server-specific exports (Brainy lifecycle, Cortex, auth middleware, RPC handlers),
|
|
8
|
+
* use `@soulcraft/sdk/server`.
|
|
9
|
+
*
|
|
10
|
+
* For browser-specific exports (HTTP/WS/SSE transports, cookie auth), use
|
|
11
|
+
* `@soulcraft/sdk/client`.
|
|
12
|
+
*/
|
|
13
|
+
export { createCapabilityToken, verifyCapabilityToken, } from './modules/brainy/auth.js';
|
|
14
|
+
export { SDKError, SDKDisconnectedError, SDKTimeoutError, SDKAuthError, SDKForbiddenError, SDKRpcError, SDKMethodNotFoundError, } from './modules/brainy/errors.js';
|
|
15
|
+
export { SOULCRAFT_USER_FIELDS, SOULCRAFT_SESSION_CONFIG, computeEmailHash, getAuthMode, getOIDCClientConfig, } from './modules/auth/config.js';
|
|
16
|
+
export { AI_MODELS } from './modules/ai/types.js';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA8BH,OAAO,EACL,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,sBAAsB,GACvB,MAAM,4BAA4B,CAAA;AAgCnC,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,WAAW,EACX,mBAAmB,GACpB,MAAM,0BAA0B,CAAA;AAejC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module modules/ai
|
|
3
|
+
* @description Claude AI integration for @soulcraft/sdk.
|
|
4
|
+
*
|
|
5
|
+
* Wraps the `@anthropic-ai/sdk` client with Soulcraft-specific defaults and
|
|
6
|
+
* conventions. Exposes a simple `complete()` + `stream()` API that handles
|
|
7
|
+
* message formatting, tool call extraction, and usage tracking without
|
|
8
|
+
* per-callsite boilerplate.
|
|
9
|
+
*
|
|
10
|
+
* The Anthropic API key is read from `ANTHROPIC_API_KEY` in the environment.
|
|
11
|
+
* The module fails fast (at SDK creation time) if the key is absent in
|
|
12
|
+
* production (`NODE_ENV=production`).
|
|
13
|
+
*
|
|
14
|
+
* ## Tool call flow
|
|
15
|
+
*
|
|
16
|
+
* When Claude calls a tool, `complete()` returns a result with `toolCalls`
|
|
17
|
+
* populated and `stopReason === 'tool_use'`. The caller executes the tool,
|
|
18
|
+
* appends a `tool_result` content block to the messages, and calls `complete()`
|
|
19
|
+
* again to get Claude's follow-up response. The SDK does not auto-loop tool
|
|
20
|
+
* calls — explicit control keeps kit code predictable.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* import { createAiModule } from '@soulcraft/sdk/server'
|
|
25
|
+
*
|
|
26
|
+
* const ai = createAiModule()
|
|
27
|
+
*
|
|
28
|
+
* const result = await ai.complete({
|
|
29
|
+
* model: 'claude-haiku-4-5-20251001',
|
|
30
|
+
* systemPrompt: kit.shared.aiPersona,
|
|
31
|
+
* messages: [{ role: 'user', content: 'What candles are low in stock?' }],
|
|
32
|
+
* tools: [searchInventoryTool],
|
|
33
|
+
* })
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
import type { AiModule } from './types.js';
|
|
37
|
+
/**
|
|
38
|
+
* Creates an `AiModule` backed by the Anthropic Claude API.
|
|
39
|
+
*
|
|
40
|
+
* Reads `ANTHROPIC_API_KEY` from the environment. In production, throws if
|
|
41
|
+
* the key is absent so misconfigured deployments fail loudly at startup.
|
|
42
|
+
*
|
|
43
|
+
* @returns A configured {@link AiModule} instance.
|
|
44
|
+
* @throws {Error} If `ANTHROPIC_API_KEY` is absent in production.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const ai = createAiModule()
|
|
49
|
+
* const result = await ai.complete({ messages: [...], model: 'claude-sonnet-4-6' })
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function createAiModule(): AiModule;
|
|
53
|
+
export type { AiModule, AiCompleteOptions, AiCompleteResult, AiStreamOptions, AiStreamEvent, AiToolCall, AiMessage, AiContentBlock, AiTool, AiModel, } from './types.js';
|
|
54
|
+
export { AI_MODELS } from './types.js';
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/ai/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,KAAK,EACV,QAAQ,EAMT,MAAM,YAAY,CAAA;AAOnB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,IAAI,QAAQ,CAqBzC;AA6MD,YAAY,EACV,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACN,OAAO,GACR,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module modules/ai
|
|
3
|
+
* @description Claude AI integration for @soulcraft/sdk.
|
|
4
|
+
*
|
|
5
|
+
* Wraps the `@anthropic-ai/sdk` client with Soulcraft-specific defaults and
|
|
6
|
+
* conventions. Exposes a simple `complete()` + `stream()` API that handles
|
|
7
|
+
* message formatting, tool call extraction, and usage tracking without
|
|
8
|
+
* per-callsite boilerplate.
|
|
9
|
+
*
|
|
10
|
+
* The Anthropic API key is read from `ANTHROPIC_API_KEY` in the environment.
|
|
11
|
+
* The module fails fast (at SDK creation time) if the key is absent in
|
|
12
|
+
* production (`NODE_ENV=production`).
|
|
13
|
+
*
|
|
14
|
+
* ## Tool call flow
|
|
15
|
+
*
|
|
16
|
+
* When Claude calls a tool, `complete()` returns a result with `toolCalls`
|
|
17
|
+
* populated and `stopReason === 'tool_use'`. The caller executes the tool,
|
|
18
|
+
* appends a `tool_result` content block to the messages, and calls `complete()`
|
|
19
|
+
* again to get Claude's follow-up response. The SDK does not auto-loop tool
|
|
20
|
+
* calls — explicit control keeps kit code predictable.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* import { createAiModule } from '@soulcraft/sdk/server'
|
|
25
|
+
*
|
|
26
|
+
* const ai = createAiModule()
|
|
27
|
+
*
|
|
28
|
+
* const result = await ai.complete({
|
|
29
|
+
* model: 'claude-haiku-4-5-20251001',
|
|
30
|
+
* systemPrompt: kit.shared.aiPersona,
|
|
31
|
+
* messages: [{ role: 'user', content: 'What candles are low in stock?' }],
|
|
32
|
+
* tools: [searchInventoryTool],
|
|
33
|
+
* })
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
import Anthropic from '@anthropic-ai/sdk';
|
|
37
|
+
import { AI_MODELS } from './types.js';
|
|
38
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
39
|
+
// Factory
|
|
40
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
41
|
+
/**
|
|
42
|
+
* Creates an `AiModule` backed by the Anthropic Claude API.
|
|
43
|
+
*
|
|
44
|
+
* Reads `ANTHROPIC_API_KEY` from the environment. In production, throws if
|
|
45
|
+
* the key is absent so misconfigured deployments fail loudly at startup.
|
|
46
|
+
*
|
|
47
|
+
* @returns A configured {@link AiModule} instance.
|
|
48
|
+
* @throws {Error} If `ANTHROPIC_API_KEY` is absent in production.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const ai = createAiModule()
|
|
53
|
+
* const result = await ai.complete({ messages: [...], model: 'claude-sonnet-4-6' })
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export function createAiModule() {
|
|
57
|
+
const apiKey = process.env['ANTHROPIC_API_KEY'];
|
|
58
|
+
if (!apiKey && process.env['NODE_ENV'] === 'production') {
|
|
59
|
+
throw new Error('ANTHROPIC_API_KEY is required in production. ' +
|
|
60
|
+
'Set this environment variable to your Anthropic API key.');
|
|
61
|
+
}
|
|
62
|
+
const client = new Anthropic({ apiKey: apiKey ?? 'placeholder-for-dev' });
|
|
63
|
+
return {
|
|
64
|
+
async complete(options) {
|
|
65
|
+
return _complete(client, options);
|
|
66
|
+
},
|
|
67
|
+
async *stream(options) {
|
|
68
|
+
yield* _stream(client, options);
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
73
|
+
// Internal implementation
|
|
74
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
75
|
+
/**
|
|
76
|
+
* Execute a non-streaming Claude completion.
|
|
77
|
+
*
|
|
78
|
+
* @param client - The Anthropic SDK client.
|
|
79
|
+
* @param options - Completion options.
|
|
80
|
+
* @returns The full result including text, tool calls, stop reason, and usage.
|
|
81
|
+
*/
|
|
82
|
+
async function _complete(client, options) {
|
|
83
|
+
const { messages, systemPrompt, model, tools, maxTokens = 8192, temperature } = options;
|
|
84
|
+
const params = {
|
|
85
|
+
model: model ?? AI_MODELS.sonnet,
|
|
86
|
+
max_tokens: maxTokens,
|
|
87
|
+
messages: messages.map(_toAnthropicMessage),
|
|
88
|
+
...(systemPrompt ? { system: systemPrompt } : {}),
|
|
89
|
+
...(tools && tools.length > 0
|
|
90
|
+
? {
|
|
91
|
+
tools: tools.map((t) => ({
|
|
92
|
+
name: t.name,
|
|
93
|
+
description: t.description,
|
|
94
|
+
input_schema: t.inputSchema,
|
|
95
|
+
})),
|
|
96
|
+
}
|
|
97
|
+
: {}),
|
|
98
|
+
...(temperature !== undefined ? { temperature } : {}),
|
|
99
|
+
};
|
|
100
|
+
const response = await client.messages.create(params);
|
|
101
|
+
return _parseResponse(response);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Execute a streaming Claude completion, yielding typed events.
|
|
105
|
+
*
|
|
106
|
+
* @param client - The Anthropic SDK client.
|
|
107
|
+
* @param options - Completion options (same shape as {@link _complete}).
|
|
108
|
+
* @yields `AiStreamEvent` — text chunks, tool use blocks, and a final done event.
|
|
109
|
+
*/
|
|
110
|
+
async function* _stream(client, options) {
|
|
111
|
+
const { messages, systemPrompt, model, tools, maxTokens = 8192, temperature } = options;
|
|
112
|
+
const params = {
|
|
113
|
+
model: model ?? AI_MODELS.sonnet,
|
|
114
|
+
max_tokens: maxTokens,
|
|
115
|
+
stream: true,
|
|
116
|
+
messages: messages.map(_toAnthropicMessage),
|
|
117
|
+
...(systemPrompt ? { system: systemPrompt } : {}),
|
|
118
|
+
...(tools && tools.length > 0
|
|
119
|
+
? {
|
|
120
|
+
tools: tools.map((t) => ({
|
|
121
|
+
name: t.name,
|
|
122
|
+
description: t.description,
|
|
123
|
+
input_schema: t.inputSchema,
|
|
124
|
+
})),
|
|
125
|
+
}
|
|
126
|
+
: {}),
|
|
127
|
+
...(temperature !== undefined ? { temperature } : {}),
|
|
128
|
+
};
|
|
129
|
+
// Accumulate state for the final done event
|
|
130
|
+
let accumulatedText = '';
|
|
131
|
+
const accumulatedToolCalls = [];
|
|
132
|
+
let currentToolCall = null;
|
|
133
|
+
const stream = await client.messages.stream(params);
|
|
134
|
+
for await (const event of stream) {
|
|
135
|
+
if (event.type === 'content_block_start') {
|
|
136
|
+
if (event.content_block.type === 'tool_use') {
|
|
137
|
+
currentToolCall = {
|
|
138
|
+
id: event.content_block.id,
|
|
139
|
+
name: event.content_block.name,
|
|
140
|
+
inputJson: '',
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else if (event.type === 'content_block_delta') {
|
|
145
|
+
if (event.delta.type === 'text_delta') {
|
|
146
|
+
accumulatedText += event.delta.text;
|
|
147
|
+
yield { type: 'text', text: event.delta.text };
|
|
148
|
+
}
|
|
149
|
+
else if (event.delta.type === 'input_json_delta' && currentToolCall) {
|
|
150
|
+
currentToolCall.inputJson += event.delta.partial_json;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else if (event.type === 'content_block_stop') {
|
|
154
|
+
if (currentToolCall) {
|
|
155
|
+
let input = {};
|
|
156
|
+
try {
|
|
157
|
+
input = JSON.parse(currentToolCall.inputJson);
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
// Malformed JSON from the model — use empty object
|
|
161
|
+
}
|
|
162
|
+
const toolCall = {
|
|
163
|
+
id: currentToolCall.id,
|
|
164
|
+
name: currentToolCall.name,
|
|
165
|
+
input,
|
|
166
|
+
};
|
|
167
|
+
accumulatedToolCalls.push(toolCall);
|
|
168
|
+
yield { type: 'tool_use', toolCall };
|
|
169
|
+
currentToolCall = null;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else if (event.type === 'message_stop') {
|
|
173
|
+
const finalMessage = await stream.finalMessage();
|
|
174
|
+
yield {
|
|
175
|
+
type: 'done',
|
|
176
|
+
result: {
|
|
177
|
+
text: accumulatedText || null,
|
|
178
|
+
toolCalls: accumulatedToolCalls.length > 0 ? accumulatedToolCalls : null,
|
|
179
|
+
stopReason: finalMessage.stop_reason ?? 'end_turn',
|
|
180
|
+
usage: {
|
|
181
|
+
inputTokens: finalMessage.usage.input_tokens,
|
|
182
|
+
outputTokens: finalMessage.usage.output_tokens,
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Convert a {@link AiMessage} to the Anthropic SDK's message format.
|
|
191
|
+
*
|
|
192
|
+
* @param msg - An SDK-typed message.
|
|
193
|
+
* @returns An Anthropic API message param.
|
|
194
|
+
*/
|
|
195
|
+
function _toAnthropicMessage(msg) {
|
|
196
|
+
if (typeof msg.content === 'string') {
|
|
197
|
+
return { role: msg.role, content: msg.content };
|
|
198
|
+
}
|
|
199
|
+
// Map SDK content blocks to Anthropic content blocks
|
|
200
|
+
const blocks = msg.content.map((block) => {
|
|
201
|
+
if (block.type === 'text') {
|
|
202
|
+
return { type: 'text', text: block.text };
|
|
203
|
+
}
|
|
204
|
+
if (block.type === 'image') {
|
|
205
|
+
return {
|
|
206
|
+
type: 'image',
|
|
207
|
+
source: {
|
|
208
|
+
type: 'base64',
|
|
209
|
+
media_type: block.source.media_type,
|
|
210
|
+
data: block.source.data,
|
|
211
|
+
},
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
if (block.type === 'tool_use') {
|
|
215
|
+
return {
|
|
216
|
+
type: 'tool_use',
|
|
217
|
+
id: block.id,
|
|
218
|
+
name: block.name,
|
|
219
|
+
input: block.input,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
// tool_result
|
|
223
|
+
return {
|
|
224
|
+
type: 'tool_result',
|
|
225
|
+
tool_use_id: block.tool_use_id,
|
|
226
|
+
content: block.content,
|
|
227
|
+
};
|
|
228
|
+
});
|
|
229
|
+
return { role: msg.role, content: blocks };
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Parse an Anthropic API response into an {@link AiCompleteResult}.
|
|
233
|
+
*
|
|
234
|
+
* @param response - The raw Anthropic message response.
|
|
235
|
+
* @returns A normalized SDK result.
|
|
236
|
+
*/
|
|
237
|
+
function _parseResponse(response) {
|
|
238
|
+
let text = null;
|
|
239
|
+
const toolCalls = [];
|
|
240
|
+
for (const block of response.content) {
|
|
241
|
+
if (block.type === 'text') {
|
|
242
|
+
text = (text ?? '') + block.text;
|
|
243
|
+
}
|
|
244
|
+
else if (block.type === 'tool_use') {
|
|
245
|
+
toolCalls.push({
|
|
246
|
+
id: block.id,
|
|
247
|
+
name: block.name,
|
|
248
|
+
input: block.input,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
text,
|
|
254
|
+
toolCalls: toolCalls.length > 0 ? toolCalls : null,
|
|
255
|
+
stopReason: response.stop_reason ?? 'end_turn',
|
|
256
|
+
usage: {
|
|
257
|
+
inputTokens: response.usage.input_tokens,
|
|
258
|
+
outputTokens: response.usage.output_tokens,
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
export { AI_MODELS } from './types.js';
|
|
263
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/ai/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,SAAS,MAAM,mBAAmB,CAAA;AASzC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;IAE/C,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,YAAY,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CACb,+CAA+C;YAC/C,0DAA0D,CAC3D,CAAA;IACH,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,MAAM,EAAE,MAAM,IAAI,qBAAqB,EAAE,CAAC,CAAA;IAEzE,OAAO;QACL,KAAK,CAAC,QAAQ,CAAC,OAA0B;YACvC,OAAO,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QACnC,CAAC;QAED,KAAK,CAAC,CAAC,MAAM,CAAC,OAAwB;YACpC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QACjC,CAAC;KACF,CAAA;AACH,CAAC;AAED,gFAAgF;AAChF,0BAA0B;AAC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