@weave_protocol/adapter-antigravity 0.1.0 → 0.2.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/README.md +71 -47
- package/dist/cli.js +64 -24
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +30 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +82 -32
- package/dist/config.js.map +1 -1
- package/dist/hook.d.ts +19 -5
- package/dist/hook.d.ts.map +1 -1
- package/dist/hook.js +46 -31
- package/dist/hook.js.map +1 -1
- package/dist/mund.d.ts +93 -0
- package/dist/mund.d.ts.map +1 -0
- package/dist/mund.js +215 -0
- package/dist/mund.js.map +1 -0
- package/dist/types.d.ts +25 -28
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +19 -23
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -2,34 +2,36 @@
|
|
|
2
2
|
* Types for the Google Antigravity adapter.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* JSON Antigravity sends to a hook on stdin (camelCase), per
|
|
6
|
+
* https://antigravity.google/docs/hooks:
|
|
7
|
+
* { toolCall: { name, args }, stepIdx, conversationId, workspacePaths,
|
|
8
|
+
* transcriptPath, artifactDirectoryPath, modelName }
|
|
9
|
+
* The legacy snake_case fields are still read as a fallback.
|
|
8
10
|
*/
|
|
9
11
|
export interface AntigravityHookInput {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
toolCall?: {
|
|
13
|
+
name?: string;
|
|
14
|
+
args?: Record<string, unknown>;
|
|
15
|
+
};
|
|
16
|
+
workspacePaths?: string[];
|
|
17
|
+
conversationId?: string;
|
|
18
|
+
stepIdx?: number;
|
|
19
|
+
transcriptPath?: string;
|
|
20
|
+
modelName?: string;
|
|
21
|
+
/** @deprecated pre-0.2 assumption; Antigravity sends toolCall.name */
|
|
14
22
|
tool_name?: string;
|
|
23
|
+
/** @deprecated pre-0.2 assumption; Antigravity sends toolCall.args */
|
|
15
24
|
tool_input?: Record<string, unknown>;
|
|
16
|
-
|
|
25
|
+
/** @deprecated pre-0.2 assumption; Antigravity sends workspacePaths */
|
|
26
|
+
cwd?: string;
|
|
17
27
|
}
|
|
18
28
|
/**
|
|
19
|
-
* JSON
|
|
20
|
-
*
|
|
21
|
-
* For PreToolUse hooks:
|
|
22
|
-
* - { "decision": "approve" } → auto-approve
|
|
23
|
-
* - { "decision": "block", "reason": "..." } → block the call with reason
|
|
24
|
-
* - {} (or no output) → default behavior
|
|
29
|
+
* JSON a PreToolUse hook returns on stdout. `decision` is required when a
|
|
30
|
+
* hook returns output; printing nothing leaves the call to Antigravity.
|
|
25
31
|
*/
|
|
26
32
|
export interface AntigravityHookOutput {
|
|
27
|
-
decision
|
|
33
|
+
decision: 'allow' | 'auto_approve' | 'deny' | 'ask' | 'force_ask' | 'deny_unless_prior_grant';
|
|
28
34
|
reason?: string;
|
|
29
|
-
continue?: boolean;
|
|
30
|
-
stopReason?: string;
|
|
31
|
-
systemMessage?: string;
|
|
32
|
-
suppressOutput?: boolean;
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
35
37
|
* Hook lifecycle event types in Antigravity 2.0.
|
|
@@ -39,9 +41,8 @@ export type HookType = 'pre-tool-use' | 'post-tool-use' | 'stop' | 'session-star
|
|
|
39
41
|
/**
|
|
40
42
|
* Mapping from Antigravity tool names to their nature.
|
|
41
43
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* Unknown tools fall through with the tool name itself as the capability.
|
|
44
|
+
* Unknown tools (including MCP tools) fall through with the tool name
|
|
45
|
+
* itself as the capability, so WARD.md can name them directly.
|
|
45
46
|
*/
|
|
46
47
|
export interface ToolMapping {
|
|
47
48
|
/** Generic capability name for WARD `## Capabilities`. */
|
|
@@ -56,12 +57,8 @@ export interface ToolMapping {
|
|
|
56
57
|
commandField?: string;
|
|
57
58
|
}
|
|
58
59
|
/**
|
|
59
|
-
* Built-in mappings for Antigravity's
|
|
60
|
-
*
|
|
61
|
-
* Documented tools (Bash/Edit/Write/Read) confirmed from public hook
|
|
62
|
-
* documentation. Others inferred from the shared Gemini CLI / Antigravity
|
|
63
|
-
* harness lineage. Users can also reference these by their raw names
|
|
64
|
-
* in WARD.md directly.
|
|
60
|
+
* Built-in mappings for Antigravity's documented tools and their argument
|
|
61
|
+
* names. WARD.md can also reference any tool by its raw name.
|
|
65
62
|
*/
|
|
66
63
|
export declare const TOOL_MAPPINGS: Record<string, ToolMapping>;
|
|
67
64
|
/**
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IAC7D,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,uEAAuE;IACvE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,OAAO,GAAG,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,yBAAyB,CAAC;IAC9F,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,cAAc,GAAG,eAAe,GAAG,MAAM,GAAG,eAAe,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IACxD,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAkBrD,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;QACX,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;QAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;CACJ"}
|
package/dist/types.js
CHANGED
|
@@ -2,30 +2,26 @@
|
|
|
2
2
|
* Types for the Google Antigravity adapter.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* Built-in mappings for Antigravity's
|
|
6
|
-
*
|
|
7
|
-
* Documented tools (Bash/Edit/Write/Read) confirmed from public hook
|
|
8
|
-
* documentation. Others inferred from the shared Gemini CLI / Antigravity
|
|
9
|
-
* harness lineage. Users can also reference these by their raw names
|
|
10
|
-
* in WARD.md directly.
|
|
5
|
+
* Built-in mappings for Antigravity's documented tools and their argument
|
|
6
|
+
* names. WARD.md can also reference any tool by its raw name.
|
|
11
7
|
*/
|
|
12
8
|
export const TOOL_MAPPINGS = {
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
9
|
+
// Antigravity built-in tools (https://antigravity.google/docs/hooks)
|
|
10
|
+
run_command: { capability: 'shell_exec', commandField: 'CommandLine' },
|
|
11
|
+
view_file: { capability: 'file_read', pathField: 'AbsolutePath', fsOp: 'read' },
|
|
12
|
+
write_to_file: { capability: 'file_write', pathField: 'TargetFile', fsOp: 'write' },
|
|
13
|
+
replace_file_content: { capability: 'file_write', pathField: 'TargetFile', fsOp: 'write' },
|
|
14
|
+
multi_replace_file_content: { capability: 'file_write', pathField: 'TargetFile', fsOp: 'write' },
|
|
15
|
+
list_dir: { capability: 'file_list', pathField: 'DirectoryPath', fsOp: 'list' },
|
|
16
|
+
find_by_name: { capability: 'file_list', pathField: 'SearchDirectory', fsOp: 'list' },
|
|
17
|
+
grep_search: { capability: 'file_read', pathField: 'SearchPath', fsOp: 'read' },
|
|
18
|
+
read_url_content: { capability: 'http_request', urlField: 'Url' },
|
|
19
|
+
search_web: { capability: 'web_search' },
|
|
20
|
+
invoke_subagent: { capability: 'subagent' },
|
|
21
|
+
define_subagent: { capability: 'subagent' },
|
|
22
|
+
send_message: { capability: 'agent_message' },
|
|
23
|
+
manage_task: { capability: 'task_control' },
|
|
24
|
+
schedule: { capability: 'schedule' },
|
|
25
|
+
generate_image: { capability: 'generate_image' },
|
|
30
26
|
};
|
|
31
27
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AA0DH;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAgC;IACxD,qEAAqE;IACrE,WAAW,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE;IACtE,SAAS,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE;IAC/E,aAAa,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE;IACnF,oBAAoB,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE;IAC1F,0BAA0B,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE;IAChG,QAAQ,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE;IAC/E,YAAY,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE;IACrF,WAAW,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE;IAC/E,gBAAgB,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE;IACjE,UAAU,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE;IACxC,eAAe,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE;IAC3C,eAAe,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE;IAC3C,YAAY,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE;IAC7C,WAAW,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE;IAC3C,QAAQ,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE;IACpC,cAAc,EAAE,EAAE,UAAU,EAAE,gBAAgB,EAAE;CACjD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weave_protocol/adapter-antigravity",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Weave Protocol adapter for Google Antigravity - enforces WARD.md policies via Antigravity's PreToolUse hook system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "tsc",
|
|
13
13
|
"dev": "tsc --watch",
|
|
14
|
-
"test": "node --test
|
|
14
|
+
"test": "npm run build && node --test test/*.test.mjs",
|
|
15
15
|
"prepublishOnly": "npm run build"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|