@vaultysclaw/shared 0.0.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.
- package/LICENSE +21 -0
- package/README.md +33 -0
- package/dist/channel-types.d.ts +170 -0
- package/dist/channel-types.d.ts.map +1 -0
- package/dist/channel-types.js +6 -0
- package/dist/channel-types.js.map +1 -0
- package/dist/constants/docs.d.ts +4 -0
- package/dist/constants/docs.d.ts.map +1 -0
- package/dist/constants/docs.js +4 -0
- package/dist/constants/docs.js.map +1 -0
- package/dist/constants/git.d.ts +7 -0
- package/dist/constants/git.d.ts.map +1 -0
- package/dist/constants/git.js +7 -0
- package/dist/constants/git.js.map +1 -0
- package/dist/constants/index.d.ts +9 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +9 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/vaultys.d.ts +2 -0
- package/dist/constants/vaultys.d.ts.map +1 -0
- package/dist/constants/vaultys.js +2 -0
- package/dist/constants/vaultys.js.map +1 -0
- package/dist/errors.d.ts +54 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +77 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/security.d.ts +17 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/security.js +19 -0
- package/dist/security.js.map +1 -0
- package/dist/types.d.ts +554 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/colors.d.ts +73 -0
- package/dist/utils/colors.d.ts.map +1 -0
- package/dist/utils/colors.js +92 -0
- package/dist/utils/colors.js.map +1 -0
- package/dist/utils/formatting.d.ts +57 -0
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/utils/formatting.js +154 -0
- package/dist/utils/formatting.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +26 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 François-Xavier Thoorens
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @vaultysclaw/shared
|
|
2
|
+
|
|
3
|
+
Shared types, security utilities, and channel protocol definitions used across all
|
|
4
|
+
VaultysClaw packages. This is the contract layer that keeps the control plane,
|
|
5
|
+
agent controller, agent runtime, and MCP gateway in sync.
|
|
6
|
+
|
|
7
|
+
## What's inside
|
|
8
|
+
|
|
9
|
+
- **`src/types.ts`** — core domain types: `VaultysIdentity`, `AgentCapability`,
|
|
10
|
+
`ResourceLimits`, `AgentPolicy`, `SignedIntent`, `ExecutionResult`.
|
|
11
|
+
- **`src/channel-types.ts`** — the typed WebSocket message envelope exchanged
|
|
12
|
+
between agents and the control plane (`register`, `intent`, `result`,
|
|
13
|
+
`policy_update`, …). Critical messages carry ECDSA signatures.
|
|
14
|
+
- **`src/constants/`** — shared constants (e.g. Vaultys URLs).
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
Import via the workspace path alias:
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import type { SignedIntent, AgentCapability } from "@vaultysclaw/shared";
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Scripts
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pnpm build # compile to dist/ with tsc
|
|
28
|
+
pnpm type-check # tsc --noEmit
|
|
29
|
+
pnpm lint
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This package has no runtime entry point — it is consumed as a library by the other
|
|
33
|
+
workspace packages.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Channel-based messaging system types for VaultysClaw
|
|
3
|
+
* Supports multi-agent/user collaboration, threading, and external service integration
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Channel represents a collaboration space for agents and users
|
|
7
|
+
* Can be realm-scoped or global (accessible across all realms)
|
|
8
|
+
*/
|
|
9
|
+
export interface Channel {
|
|
10
|
+
id: string;
|
|
11
|
+
realmId: string | null;
|
|
12
|
+
name: string;
|
|
13
|
+
slug: string;
|
|
14
|
+
description: string | null;
|
|
15
|
+
isPublic: boolean;
|
|
16
|
+
isArchived: boolean;
|
|
17
|
+
topic: string | null;
|
|
18
|
+
creatorDid: string;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
}
|
|
22
|
+
export type ChannelInput = Omit<Channel, "id" | "createdAt" | "updatedAt">;
|
|
23
|
+
/**
|
|
24
|
+
* Channel member relationship - agents and users can join channels with roles
|
|
25
|
+
*/
|
|
26
|
+
export interface ChannelMember {
|
|
27
|
+
id: string;
|
|
28
|
+
channelId: string;
|
|
29
|
+
memberDid: string;
|
|
30
|
+
memberType: "user" | "agent";
|
|
31
|
+
memberName?: string | null;
|
|
32
|
+
role: "member" | "moderator" | "owner";
|
|
33
|
+
joinedAt: string;
|
|
34
|
+
invitedBy: string | null;
|
|
35
|
+
}
|
|
36
|
+
export type ChannelMemberInput = Omit<ChannelMember, "id" | "joinedAt" | "memberName">;
|
|
37
|
+
/**
|
|
38
|
+
* Message attachment metadata
|
|
39
|
+
*/
|
|
40
|
+
export interface Attachment {
|
|
41
|
+
type: "file" | "link" | "json";
|
|
42
|
+
data: unknown;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Message metadata - tool calls, mentions, reactions, etc.
|
|
46
|
+
*/
|
|
47
|
+
export interface MessageMetadata {
|
|
48
|
+
toolCalls?: Record<string, unknown>;
|
|
49
|
+
attachments?: Attachment[];
|
|
50
|
+
mentions?: string[];
|
|
51
|
+
agentAction?: string;
|
|
52
|
+
agentMention?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Channel message with threading support
|
|
56
|
+
*/
|
|
57
|
+
export interface ChannelMessage {
|
|
58
|
+
id: string;
|
|
59
|
+
channelId: string;
|
|
60
|
+
threadId: string | null;
|
|
61
|
+
authorDid: string;
|
|
62
|
+
authorType: "user" | "agent";
|
|
63
|
+
authorName?: string | null;
|
|
64
|
+
content: string;
|
|
65
|
+
metadata: MessageMetadata;
|
|
66
|
+
reactions: Record<string, string[]>;
|
|
67
|
+
editedAt: string | null;
|
|
68
|
+
deletedAt: string | null;
|
|
69
|
+
createdAt: string;
|
|
70
|
+
}
|
|
71
|
+
export type ChannelMessageInput = Omit<ChannelMessage, "id" | "reactions" | "editedAt" | "deletedAt" | "createdAt" | "authorName">;
|
|
72
|
+
/**
|
|
73
|
+
* External service bridge configuration
|
|
74
|
+
* Syncs messages between VaultysClaw channels and external services (Teams, webhooks, etc.)
|
|
75
|
+
*/
|
|
76
|
+
export interface ChannelBridge {
|
|
77
|
+
id: string;
|
|
78
|
+
channelId: string;
|
|
79
|
+
externalService: "teams" | "webhook";
|
|
80
|
+
externalChannelId: string;
|
|
81
|
+
externalChannelName: string;
|
|
82
|
+
externalWorkspaceId: string;
|
|
83
|
+
syncDirection: "incoming" | "outgoing" | "bidirectional";
|
|
84
|
+
isSyncEnabled: boolean;
|
|
85
|
+
createdAt: string;
|
|
86
|
+
configJson: string;
|
|
87
|
+
}
|
|
88
|
+
export type ChannelBridgeInput = Omit<ChannelBridge, "id" | "createdAt">;
|
|
89
|
+
/**
|
|
90
|
+
* Teams-specific bridge configuration (stored in configJson, encrypted)
|
|
91
|
+
*/
|
|
92
|
+
export interface TeamsBridgeConfig {
|
|
93
|
+
accessToken: string;
|
|
94
|
+
refreshToken?: string;
|
|
95
|
+
expiresAt?: string;
|
|
96
|
+
tenantId: string;
|
|
97
|
+
botId: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Webhook-specific bridge configuration (stored in configJson, encrypted)
|
|
101
|
+
*/
|
|
102
|
+
export interface WebhookBridgeConfig {
|
|
103
|
+
webhookUrl: string;
|
|
104
|
+
outgoingUrl: string;
|
|
105
|
+
secret: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* WebSocket events for channel updates
|
|
109
|
+
* Published to all channel subscribers in real-time
|
|
110
|
+
*/
|
|
111
|
+
export type ChannelEvent = {
|
|
112
|
+
type: "message_created";
|
|
113
|
+
channelId: string;
|
|
114
|
+
message: ChannelMessage;
|
|
115
|
+
threadId?: string;
|
|
116
|
+
} | {
|
|
117
|
+
type: "message_edited";
|
|
118
|
+
channelId: string;
|
|
119
|
+
messageId: string;
|
|
120
|
+
content: string;
|
|
121
|
+
editedAt: string;
|
|
122
|
+
} | {
|
|
123
|
+
type: "message_deleted";
|
|
124
|
+
channelId: string;
|
|
125
|
+
messageId: string;
|
|
126
|
+
} | {
|
|
127
|
+
type: "thread_created";
|
|
128
|
+
channelId: string;
|
|
129
|
+
parentMessageId: string;
|
|
130
|
+
threadId: string;
|
|
131
|
+
agentMention: string;
|
|
132
|
+
} | {
|
|
133
|
+
type: "member_joined";
|
|
134
|
+
channelId: string;
|
|
135
|
+
member: ChannelMember;
|
|
136
|
+
} | {
|
|
137
|
+
type: "member_left";
|
|
138
|
+
channelId: string;
|
|
139
|
+
memberDid: string;
|
|
140
|
+
} | {
|
|
141
|
+
type: "typing";
|
|
142
|
+
channelId: string;
|
|
143
|
+
authorDid: string;
|
|
144
|
+
threadId?: string;
|
|
145
|
+
} | {
|
|
146
|
+
type: "reaction_added";
|
|
147
|
+
channelId: string;
|
|
148
|
+
messageId: string;
|
|
149
|
+
emoji: string;
|
|
150
|
+
byDid: string;
|
|
151
|
+
} | {
|
|
152
|
+
type: "bridge_synced";
|
|
153
|
+
channelId: string;
|
|
154
|
+
bridgeId: string;
|
|
155
|
+
externalMessageId: string;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Agent mention context passed to agent when @mentioned in a channel
|
|
159
|
+
*/
|
|
160
|
+
export interface AgentMentionContext {
|
|
161
|
+
channelId: string;
|
|
162
|
+
channelName: string;
|
|
163
|
+
messageText: string;
|
|
164
|
+
authorDid: string;
|
|
165
|
+
authorType: "user" | "agent";
|
|
166
|
+
threadId: string;
|
|
167
|
+
realmId: string | null;
|
|
168
|
+
parentMessageContent: string;
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=channel-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-types.d.ts","sourceRoot":"","sources":["../src/channel-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MA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B,GACD;IACE,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,IAAI,EAAE,eAAe,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEN;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-types.js","sourceRoot":"","sources":["../src/channel-types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const ARCHITECTURE_DOC_URL = "https://github.com/vaultys/VaultysClaw/blob/main/docs/ARCHITECTURE.md";
|
|
2
|
+
export declare const QUICK_START_DOC_URL = "https://github.com/vaultys/VaultysClaw/blob/main/docs/QUICK_START.md ";
|
|
3
|
+
export declare const SECURITY_DOC_URL = "https://github.com/vaultys/VaultysClaw/blob/main/docs/SECURITY.md";
|
|
4
|
+
//# sourceMappingURL=docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/constants/docs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,0EACwC,CAAC;AAC1E,eAAO,MAAM,mBAAmB,0EACyC,CAAC;AAC1E,eAAO,MAAM,gBAAgB,sEACwC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const ARCHITECTURE_DOC_URL = "https://github.com/vaultys/VaultysClaw/blob/main/docs/ARCHITECTURE.md";
|
|
2
|
+
export const QUICK_START_DOC_URL = "https://github.com/vaultys/VaultysClaw/blob/main/docs/QUICK_START.md ";
|
|
3
|
+
export const SECURITY_DOC_URL = "https://github.com/vaultys/VaultysClaw/blob/main/docs/SECURITY.md";
|
|
4
|
+
//# sourceMappingURL=docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/constants/docs.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAC/B,uEAAuE,CAAC;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAC9B,uEAAuE,CAAC;AAC1E,MAAM,CAAC,MAAM,gBAAgB,GAC3B,mEAAmE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const GITHUB_URL = "https://github.com/vaultys";
|
|
2
|
+
export declare const GITHUB_VAULTYSCLAW_URL = "https://github.com/vaultys/VaultysClaw";
|
|
3
|
+
export declare const GITHUB_VAULTYSCLAW_STARS_URL = "https://github.com/vaultys/VaultysClaw/stargazers";
|
|
4
|
+
export declare const GITHUB_VAULTYSCLAW_ISSUES_URL = "https://github.com/vaultys/VaultysClaw/issues";
|
|
5
|
+
export declare const GITHUB_VAULTYSCLAW_FORK_URL = "https://github.com/vaultys/VaultysClaw/fork";
|
|
6
|
+
export declare const GITHUB_SPONSORS_URL = "https://github.com/sponsors/vaultys";
|
|
7
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/constants/git.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,+BAA+B,CAAC;AACvD,eAAO,MAAM,sBAAsB,2CAA2C,CAAC;AAC/E,eAAO,MAAM,4BAA4B,sDAAyC,CAAC;AACnF,eAAO,MAAM,6BAA6B,kDAAqC,CAAC;AAChF,eAAO,MAAM,2BAA2B,gDAAmC,CAAC;AAC5E,eAAO,MAAM,mBAAmB,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const GITHUB_URL = "https://github.com/vaultys";
|
|
2
|
+
export const GITHUB_VAULTYSCLAW_URL = "https://github.com/vaultys/VaultysClaw";
|
|
3
|
+
export const GITHUB_VAULTYSCLAW_STARS_URL = `${GITHUB_VAULTYSCLAW_URL}/stargazers`;
|
|
4
|
+
export const GITHUB_VAULTYSCLAW_ISSUES_URL = `${GITHUB_VAULTYSCLAW_URL}/issues`;
|
|
5
|
+
export const GITHUB_VAULTYSCLAW_FORK_URL = `${GITHUB_VAULTYSCLAW_URL}/fork`;
|
|
6
|
+
export const GITHUB_SPONSORS_URL = "https://github.com/sponsors/vaultys";
|
|
7
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/constants/git.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,4BAA4B,CAAC;AACvD,MAAM,CAAC,MAAM,sBAAsB,GAAG,wCAAwC,CAAC;AAC/E,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,sBAAsB,aAAa,CAAC;AACnF,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,sBAAsB,SAAS,CAAC;AAChF,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,sBAAsB,OAAO,CAAC;AAC5E,MAAM,CAAC,MAAM,mBAAmB,GAAG,qCAAqC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAE/B,eAAO,MAAM,SAAS;;;;CAIrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAE/B,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,GAAG;IACH,OAAO;IACP,IAAI;CACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vaultys.d.ts","sourceRoot":"","sources":["../../src/constants/vaultys.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vaultys.js","sourceRoot":"","sources":["../../src/constants/vaultys.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,qBAAqB,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized error classes for VaultysClaw
|
|
3
|
+
* Used by both agent-controller and control-plane
|
|
4
|
+
*/
|
|
5
|
+
/** Base error class for all VaultysClaw errors */
|
|
6
|
+
export declare class VaultysError extends Error {
|
|
7
|
+
code: string;
|
|
8
|
+
statusCode: number;
|
|
9
|
+
details?: Record<string, any> | undefined;
|
|
10
|
+
constructor(message: string, code: string, statusCode?: number, details?: Record<string, any> | undefined);
|
|
11
|
+
}
|
|
12
|
+
/** LLM is not configured or configuration is invalid */
|
|
13
|
+
export declare class LlmNotConfiguredError extends VaultysError {
|
|
14
|
+
constructor(message?: string, details?: Record<string, any>);
|
|
15
|
+
}
|
|
16
|
+
/** LLM provider error (API error, rate limit, etc.) */
|
|
17
|
+
export declare class LlmProviderError extends VaultysError {
|
|
18
|
+
provider: string;
|
|
19
|
+
originalError?: Error | undefined;
|
|
20
|
+
constructor(message: string, provider: string, originalError?: Error | undefined, statusCode?: number);
|
|
21
|
+
}
|
|
22
|
+
/** Invalid configuration or validation error */
|
|
23
|
+
export declare class ValidationError extends VaultysError {
|
|
24
|
+
constructor(message: string, details?: Record<string, any>);
|
|
25
|
+
}
|
|
26
|
+
/** Resource not found */
|
|
27
|
+
export declare class NotFoundError extends VaultysError {
|
|
28
|
+
constructor(message: string, details?: Record<string, any>);
|
|
29
|
+
}
|
|
30
|
+
/** User is not authorized */
|
|
31
|
+
export declare class UnauthorizedError extends VaultysError {
|
|
32
|
+
constructor(message?: string, details?: Record<string, any>);
|
|
33
|
+
}
|
|
34
|
+
/** User does not have permission */
|
|
35
|
+
export declare class ForbiddenError extends VaultysError {
|
|
36
|
+
constructor(message?: string, details?: Record<string, any>);
|
|
37
|
+
}
|
|
38
|
+
/** Conflict error (e.g., resource already exists) */
|
|
39
|
+
export declare class ConflictError extends VaultysError {
|
|
40
|
+
constructor(message: string, details?: Record<string, any>);
|
|
41
|
+
}
|
|
42
|
+
/** Workflow or operation timeout */
|
|
43
|
+
export declare class TimeoutError extends VaultysError {
|
|
44
|
+
constructor(message: string, details?: Record<string, any>);
|
|
45
|
+
}
|
|
46
|
+
/** Agent is not available */
|
|
47
|
+
export declare class AgentNotAvailableError extends VaultysError {
|
|
48
|
+
constructor(message?: string, details?: Record<string, any>);
|
|
49
|
+
}
|
|
50
|
+
/** Workflow or task execution error */
|
|
51
|
+
export declare class ExecutionError extends VaultysError {
|
|
52
|
+
constructor(message: string, details?: Record<string, any>);
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AA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AC;CAGzE;AAED,qDAAqD;AACrD,qBAAa,aAAc,SAAQ,YAAY;gBACjC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAG3D;AAED,oCAAoC;AACpC,qBAAa,YAAa,SAAQ,YAAY;gBAChC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAG3D;AAED,6BAA6B;AAC7B,qBAAa,sBAAuB,SAAQ,YAAY;gBAEpD,OAAO,GAAE,MAAiC,EAC1C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAIhC;AAED,uCAAuC;AACvC,qBAAa,cAAe,SAAQ,YAAY;gBAClC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAG3D"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized error classes for VaultysClaw
|
|
3
|
+
* Used by both agent-controller and control-plane
|
|
4
|
+
*/
|
|
5
|
+
/** Base error class for all VaultysClaw errors */
|
|
6
|
+
export class VaultysError extends Error {
|
|
7
|
+
constructor(message, code, statusCode = 500, details) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.code = code;
|
|
10
|
+
this.statusCode = statusCode;
|
|
11
|
+
this.details = details;
|
|
12
|
+
this.name = this.constructor.name;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/** LLM is not configured or configuration is invalid */
|
|
16
|
+
export class LlmNotConfiguredError extends VaultysError {
|
|
17
|
+
constructor(message = "LLM is not configured", details) {
|
|
18
|
+
super(message, "LLM_NOT_CONFIGURED", 400, details);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/** LLM provider error (API error, rate limit, etc.) */
|
|
22
|
+
export class LlmProviderError extends VaultysError {
|
|
23
|
+
constructor(message, provider, originalError, statusCode = 500) {
|
|
24
|
+
super(message, "LLM_PROVIDER_ERROR", statusCode);
|
|
25
|
+
this.provider = provider;
|
|
26
|
+
this.originalError = originalError;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** Invalid configuration or validation error */
|
|
30
|
+
export class ValidationError extends VaultysError {
|
|
31
|
+
constructor(message, details) {
|
|
32
|
+
super(message, "VALIDATION_ERROR", 400, details);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** Resource not found */
|
|
36
|
+
export class NotFoundError extends VaultysError {
|
|
37
|
+
constructor(message, details) {
|
|
38
|
+
super(message, "NOT_FOUND", 404, details);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** User is not authorized */
|
|
42
|
+
export class UnauthorizedError extends VaultysError {
|
|
43
|
+
constructor(message = "Unauthorized", details) {
|
|
44
|
+
super(message, "UNAUTHORIZED", 401, details);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** User does not have permission */
|
|
48
|
+
export class ForbiddenError extends VaultysError {
|
|
49
|
+
constructor(message = "Forbidden", details) {
|
|
50
|
+
super(message, "FORBIDDEN", 403, details);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** Conflict error (e.g., resource already exists) */
|
|
54
|
+
export class ConflictError extends VaultysError {
|
|
55
|
+
constructor(message, details) {
|
|
56
|
+
super(message, "CONFLICT", 409, details);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/** Workflow or operation timeout */
|
|
60
|
+
export class TimeoutError extends VaultysError {
|
|
61
|
+
constructor(message, details) {
|
|
62
|
+
super(message, "TIMEOUT", 408, details);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/** Agent is not available */
|
|
66
|
+
export class AgentNotAvailableError extends VaultysError {
|
|
67
|
+
constructor(message = "Agent is not available", details) {
|
|
68
|
+
super(message, "AGENT_NOT_AVAILABLE", 503, details);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/** Workflow or task execution error */
|
|
72
|
+
export class ExecutionError extends VaultysError {
|
|
73
|
+
constructor(message, details) {
|
|
74
|
+
super(message, "EXECUTION_ERROR", 500, details);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kDAAkD;AAClD,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YACE,OAAe,EACR,IAAY,EACZ,aAAqB,GAAG,EACxB,OAA6B;QAEpC,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,SAAI,GAAJ,IAAI,CAAQ;QACZ,eAAU,GAAV,UAAU,CAAc;QACxB,YAAO,GAAP,OAAO,CAAsB;QAGpC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AAED,wDAAwD;AACxD,MAAM,OAAO,qBAAsB,SAAQ,YAAY;IACrD,YACE,UAAkB,uBAAuB,EACzC,OAA6B;QAE7B,KAAK,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;CACF;AAED,uDAAuD;AACvD,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IAChD,YACE,OAAe,EACR,QAAgB,EAChB,aAAqB,EAC5B,aAAqB,GAAG;QAExB,KAAK,CAAC,OAAO,EAAE,oBAAoB,EAAE,UAAU,CAAC,CAAC;QAJ1C,aAAQ,GAAR,QAAQ,CAAQ;QAChB,kBAAa,GAAb,aAAa,CAAQ;IAI9B,CAAC;CACF;AAED,gDAAgD;AAChD,MAAM,OAAO,eAAgB,SAAQ,YAAY;IAC/C,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IACnD,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,CAAC;IAClD,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security utilities using VaultysId for decentralized identity and verification
|
|
3
|
+
*/
|
|
4
|
+
import { type Challenger } from "@vaultys/id";
|
|
5
|
+
/**
|
|
6
|
+
* Verify a VaultysId challenge-response protocol context.
|
|
7
|
+
* Returns true if the protocol is "p2p" and the service is "register" or "auth".
|
|
8
|
+
*/
|
|
9
|
+
export declare function verifyProtocol(challenger: Challenger): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Check if an agent controller has a specific capability
|
|
12
|
+
* using the signed policy from control plane
|
|
13
|
+
*/
|
|
14
|
+
export declare function hasCapability(capability: string, policy: {
|
|
15
|
+
capabilities?: string[];
|
|
16
|
+
}): boolean;
|
|
17
|
+
//# sourceMappingURL=security.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../src/security.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAG9D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAClC,OAAO,CAET"}
|
package/dist/security.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security utilities using VaultysId for decentralized identity and verification
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Verify a VaultysId challenge-response protocol context.
|
|
6
|
+
* Returns true if the protocol is "p2p" and the service is "register" or "auth".
|
|
7
|
+
*/
|
|
8
|
+
export function verifyProtocol(challenger) {
|
|
9
|
+
const { protocol, service } = challenger.getContext();
|
|
10
|
+
return protocol === "p2p" && (service === "register" || service === "auth");
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Check if an agent controller has a specific capability
|
|
14
|
+
* using the signed policy from control plane
|
|
15
|
+
*/
|
|
16
|
+
export function hasCapability(capability, policy) {
|
|
17
|
+
return policy.capabilities?.includes(capability) ?? false;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=security.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.js","sourceRoot":"","sources":["../src/security.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,UAAsB;IACnD,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC;IACtD,OAAO,QAAQ,KAAK,KAAK,IAAI,CAAC,OAAO,KAAK,UAAU,IAAI,OAAO,KAAK,MAAM,CAAC,CAAC;AAC9E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,UAAkB,EAClB,MAAmC;IAEnC,OAAO,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC;AAC5D,CAAC"}
|