ferrycat 0.0.0-stage → 0.3.2
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 +209 -2
- package/README_zh.md +212 -0
- package/bin/ferrycat-cli.js +36 -0
- package/bin/ferrycat.js +36 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1015 -0
- package/dist/cli.js.map +1 -0
- package/dist/engine.d.ts +107 -0
- package/dist/engine.js +849 -0
- package/dist/engine.js.map +1 -0
- package/dist/fingerprint.d.ts +31 -0
- package/dist/fingerprint.js +205 -0
- package/dist/fingerprint.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +305 -0
- package/dist/index.js.map +1 -0
- package/dist/schema-validator.d.ts +5 -0
- package/dist/schema-validator.js +49 -0
- package/dist/schema-validator.js.map +1 -0
- package/dist/schemas.d.ts +274 -0
- package/dist/schemas.js +338 -0
- package/dist/schemas.js.map +1 -0
- package/dist/types.d.ts +203 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/glama.json +6 -0
- package/package.json +58 -4
- package/server.json +21 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
export type ContractStatus = 'SUBMITTED' | 'CLAIMED' | 'COMPLETED' | 'POINTER_STALE' | 'VALIDATION_FAILED' | 'TIMED_OUT' | 'FAILED';
|
|
2
|
+
export type TaskType = 'code_review' | 'architecture_audit' | 'implementation' | 'test_generation';
|
|
3
|
+
export interface FilePointerInput {
|
|
4
|
+
path: string;
|
|
5
|
+
line_range?: [number, number];
|
|
6
|
+
}
|
|
7
|
+
export interface FileFingerprint {
|
|
8
|
+
path: string;
|
|
9
|
+
size: number;
|
|
10
|
+
mtime_ms: number;
|
|
11
|
+
sha256: string;
|
|
12
|
+
first_line: string;
|
|
13
|
+
last_line: string;
|
|
14
|
+
line_range?: [number, number];
|
|
15
|
+
}
|
|
16
|
+
export interface ArtifactPointer {
|
|
17
|
+
path: string;
|
|
18
|
+
description: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ContractRow {
|
|
21
|
+
id: string;
|
|
22
|
+
requester_agent: string;
|
|
23
|
+
target_agent: string;
|
|
24
|
+
task_type: TaskType;
|
|
25
|
+
title: string;
|
|
26
|
+
context_summary: string;
|
|
27
|
+
workspace_root: string;
|
|
28
|
+
pointers_json: string;
|
|
29
|
+
contract_schema_json: string | null;
|
|
30
|
+
status: ContractStatus;
|
|
31
|
+
retry_count: number;
|
|
32
|
+
max_retries: number;
|
|
33
|
+
queue_ttl_sec: number;
|
|
34
|
+
exec_ttl_sec: number;
|
|
35
|
+
result_summary: string | null;
|
|
36
|
+
structured_output_json: string | null;
|
|
37
|
+
artifacts_pointers_json: string | null;
|
|
38
|
+
verified_sha256_json?: string | null;
|
|
39
|
+
error_reason: string | null;
|
|
40
|
+
created_at: number;
|
|
41
|
+
/** Start of the current queue window; reset on release. NULL for rows written by pre-0.2 hosts. */
|
|
42
|
+
queued_at: number | null;
|
|
43
|
+
claimed_at: number | null;
|
|
44
|
+
completed_at: number | null;
|
|
45
|
+
/** Number of extend_ttl calls by the current holder (reset on release). */
|
|
46
|
+
extend_count: number;
|
|
47
|
+
/** Number of times the contract was released back to the queue. */
|
|
48
|
+
release_count: number;
|
|
49
|
+
/** Number of fulfill-time TOCTOU mismatch strikes (contract-level, max 1 soft warning before POINTER_STALE). */
|
|
50
|
+
toctou_strike: number;
|
|
51
|
+
/** Preserved submission payload if fulfill transitions to terminal POINTER_STALE. */
|
|
52
|
+
salvaged_result_json?: string | null;
|
|
53
|
+
/** Exclusive lease token issued at claim time (FC-301). NULL for unassigned or released rows. */
|
|
54
|
+
claim_token?: string | null;
|
|
55
|
+
}
|
|
56
|
+
export interface DispatchContractInput {
|
|
57
|
+
requester_agent?: string;
|
|
58
|
+
target_agent: string;
|
|
59
|
+
task_type: TaskType;
|
|
60
|
+
title: string;
|
|
61
|
+
context_summary: string;
|
|
62
|
+
workspace_root: string;
|
|
63
|
+
pointers: FilePointerInput[];
|
|
64
|
+
contract_schema?: Record<string, unknown>;
|
|
65
|
+
queue_ttl_sec?: number;
|
|
66
|
+
exec_ttl_sec?: number;
|
|
67
|
+
}
|
|
68
|
+
export interface DispatchContractResult {
|
|
69
|
+
contract_id: string;
|
|
70
|
+
status: 'SUBMITTED';
|
|
71
|
+
created_at: number;
|
|
72
|
+
files: Array<{
|
|
73
|
+
path: string;
|
|
74
|
+
size: number;
|
|
75
|
+
mtime_ms: number;
|
|
76
|
+
sha256: string;
|
|
77
|
+
first_line: string;
|
|
78
|
+
last_line: string;
|
|
79
|
+
line_range?: [number, number];
|
|
80
|
+
}>;
|
|
81
|
+
warning?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface PollNextTaskInput {
|
|
84
|
+
agent_id?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface PollNextTaskResult {
|
|
87
|
+
has_task: boolean;
|
|
88
|
+
status?: 'CLAIMED' | 'POINTER_STALE';
|
|
89
|
+
contract?: {
|
|
90
|
+
contract_id: string;
|
|
91
|
+
requester_agent: string;
|
|
92
|
+
target_agent: string;
|
|
93
|
+
task_type: TaskType;
|
|
94
|
+
title: string;
|
|
95
|
+
context_summary: string;
|
|
96
|
+
workspace_root: string;
|
|
97
|
+
pointers: FileFingerprint[];
|
|
98
|
+
contract_schema: Record<string, unknown> | null;
|
|
99
|
+
claimed_at: number;
|
|
100
|
+
exec_ttl_sec: number;
|
|
101
|
+
/** Exclusive lease token issued for this claim session (FC-301). Pass to mutating operations. */
|
|
102
|
+
claim_token?: string;
|
|
103
|
+
};
|
|
104
|
+
stale_error?: {
|
|
105
|
+
contract_id: string;
|
|
106
|
+
reason: string;
|
|
107
|
+
message: string;
|
|
108
|
+
};
|
|
109
|
+
message?: string;
|
|
110
|
+
}
|
|
111
|
+
export interface FulfillContractInput {
|
|
112
|
+
contract_id: string;
|
|
113
|
+
agent_id?: string;
|
|
114
|
+
claim_token?: string;
|
|
115
|
+
result_summary: string;
|
|
116
|
+
structured_output?: Record<string, unknown>;
|
|
117
|
+
artifacts_pointers?: ArtifactPointer[];
|
|
118
|
+
}
|
|
119
|
+
export interface FulfillContractResult {
|
|
120
|
+
ok: boolean;
|
|
121
|
+
contract_id: string;
|
|
122
|
+
status: 'COMPLETED' | 'RETRY_NEEDED' | 'VALIDATION_FAILED' | 'TIMED_OUT' | 'POINTER_STALE';
|
|
123
|
+
retry_count: number;
|
|
124
|
+
max_retries: number;
|
|
125
|
+
toctou_strike?: number;
|
|
126
|
+
max_toctou_strikes?: number;
|
|
127
|
+
dirty_files?: Array<{
|
|
128
|
+
path: string;
|
|
129
|
+
reason: string;
|
|
130
|
+
detail: string;
|
|
131
|
+
}>;
|
|
132
|
+
validation_errors?: string[];
|
|
133
|
+
message: string;
|
|
134
|
+
}
|
|
135
|
+
export interface VerifyContractInput {
|
|
136
|
+
contract_id: string;
|
|
137
|
+
agent_id?: string;
|
|
138
|
+
claim_token?: string;
|
|
139
|
+
}
|
|
140
|
+
export interface VerifyContractResult {
|
|
141
|
+
ok: boolean;
|
|
142
|
+
valid: boolean;
|
|
143
|
+
contract_id: string;
|
|
144
|
+
status: ContractStatus;
|
|
145
|
+
/** True only when status === 'CLAIMED'; file validity alone does not imply fulfillability. */
|
|
146
|
+
fulfillable?: boolean;
|
|
147
|
+
target_agent: string;
|
|
148
|
+
toctou_strike: number;
|
|
149
|
+
max_toctou_strikes: number;
|
|
150
|
+
dirty_files: Array<{
|
|
151
|
+
path: string;
|
|
152
|
+
reason: string;
|
|
153
|
+
detail: string;
|
|
154
|
+
}>;
|
|
155
|
+
message: string;
|
|
156
|
+
}
|
|
157
|
+
export interface ReleaseContractInput {
|
|
158
|
+
contract_id: string;
|
|
159
|
+
agent_id?: string;
|
|
160
|
+
claim_token?: string;
|
|
161
|
+
reason?: string;
|
|
162
|
+
}
|
|
163
|
+
export interface ReleaseContractResult {
|
|
164
|
+
ok: boolean;
|
|
165
|
+
contract_id: string;
|
|
166
|
+
status: 'SUBMITTED' | 'CLAIMED' | 'TIMED_OUT';
|
|
167
|
+
release_count: number;
|
|
168
|
+
max_releases: number;
|
|
169
|
+
message: string;
|
|
170
|
+
}
|
|
171
|
+
export interface ExtendTtlInput {
|
|
172
|
+
contract_id: string;
|
|
173
|
+
agent_id?: string;
|
|
174
|
+
claim_token?: string;
|
|
175
|
+
}
|
|
176
|
+
export interface ExtendTtlResult {
|
|
177
|
+
ok: boolean;
|
|
178
|
+
contract_id: string;
|
|
179
|
+
status: 'CLAIMED' | 'TIMED_OUT';
|
|
180
|
+
claimed_at?: number;
|
|
181
|
+
expires_at?: number;
|
|
182
|
+
extend_count: number;
|
|
183
|
+
max_extends: number;
|
|
184
|
+
message: string;
|
|
185
|
+
}
|
|
186
|
+
export interface FailContractInput {
|
|
187
|
+
contract_id: string;
|
|
188
|
+
agent_id?: string;
|
|
189
|
+
claim_token?: string;
|
|
190
|
+
reason: string;
|
|
191
|
+
}
|
|
192
|
+
export interface FailContractResult {
|
|
193
|
+
ok: boolean;
|
|
194
|
+
contract_id: string;
|
|
195
|
+
status: 'FAILED' | 'TIMED_OUT';
|
|
196
|
+
message: string;
|
|
197
|
+
}
|
|
198
|
+
export interface InspectMeshStateInput {
|
|
199
|
+
contract_id?: string;
|
|
200
|
+
target_agent?: string;
|
|
201
|
+
status?: ContractStatus | 'ACTIVE' | 'ALL';
|
|
202
|
+
limit?: number;
|
|
203
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/glama.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ferrycat",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.3.2",
|
|
4
|
+
"mcpName": "io.github.GuoBug/ferrycat",
|
|
5
|
+
"description": "FerryCat: Contract-driven cross-host AI agent handoff & review bus over MCP and SQLite WAL",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"bin": {
|
|
9
|
+
"ferrycat": "bin/ferrycat.js",
|
|
10
|
+
"ferrycat-cli": "bin/ferrycat-cli.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"bin",
|
|
15
|
+
"README.md",
|
|
16
|
+
"README_zh.md",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"server.json",
|
|
19
|
+
"glama.json"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc",
|
|
23
|
+
"prepack": "npm run build",
|
|
24
|
+
"start": "node --experimental-sqlite dist/index.js",
|
|
25
|
+
"test": "node --experimental-sqlite --import tsx test/run-all.ts"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/GuoBug/FerryCat.git"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/GuoBug/FerryCat#readme",
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/GuoBug/FerryCat/issues"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"mcp",
|
|
37
|
+
"model-context-protocol",
|
|
38
|
+
"multi-agent",
|
|
39
|
+
"agent-handoff",
|
|
40
|
+
"sqlite-wal",
|
|
41
|
+
"antigravity",
|
|
42
|
+
"workbuddy",
|
|
43
|
+
"contract-driven"
|
|
44
|
+
],
|
|
45
|
+
"author": "Guo Qiang (GuoBug) <https://github.com/GuoBug>",
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=22.5.0"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@modelcontextprotocol/sdk": "^1.10.2",
|
|
52
|
+
"ajv": "^8.17.1",
|
|
53
|
+
"zod": "^3.24.2"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/node": "^22.13.0",
|
|
57
|
+
"tsx": "^4.19.3",
|
|
58
|
+
"typescript": "^5.8.2"
|
|
59
|
+
}
|
|
60
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.GuoBug/ferrycat",
|
|
4
|
+
"title": "FerryCat",
|
|
5
|
+
"description": "Contract-driven cross-host AI agent handoff & review bus over MCP and SQLite WAL",
|
|
6
|
+
"version": "0.3.2",
|
|
7
|
+
"repository": {
|
|
8
|
+
"url": "https://github.com/GuoBug/FerryCat",
|
|
9
|
+
"source": "github"
|
|
10
|
+
},
|
|
11
|
+
"packages": [
|
|
12
|
+
{
|
|
13
|
+
"registryType": "npm",
|
|
14
|
+
"identifier": "ferrycat",
|
|
15
|
+
"version": "0.3.2",
|
|
16
|
+
"transport": {
|
|
17
|
+
"type": "stdio"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|