@weave_protocol/adapter-antigravity 0.1.0 → 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.
package/dist/types.d.ts CHANGED
@@ -2,34 +2,36 @@
2
2
  * Types for the Google Antigravity adapter.
3
3
  */
4
4
  /**
5
- * Shape of the JSON payload Antigravity sends to a hook on stdin.
6
- * Based on the JSON hook format introduced in Antigravity 2.0, which
7
- * mirrors the Claude Code hook payload shape closely.
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
- session_id?: string;
11
- transcript_path?: string;
12
- cwd?: string;
13
- hook_event_name?: string;
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
- tool_response?: unknown;
25
+ /** @deprecated pre-0.2 assumption; Antigravity sends workspacePaths */
26
+ cwd?: string;
17
27
  }
18
28
  /**
19
- * JSON returned on stdout to control Antigravity's behavior.
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?: 'approve' | 'block';
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
- * NOTE: Antigravity inherits much of its built-in tool naming from the
43
- * Gemini CLI lineage. The list below covers the documented common tools.
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 standard tools.
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
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA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WAAW,CAsBrD,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,30 @@
2
2
  * Types for the Google Antigravity adapter.
3
3
  */
4
4
  /**
5
- * Built-in mappings for Antigravity's standard tools.
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
- // Confirmed from public Antigravity hook docs
14
- Bash: { capability: 'shell_exec', commandField: 'command' },
15
- Edit: { capability: 'file_write', pathField: 'file_path', fsOp: 'write' },
16
- Write: { capability: 'file_write', pathField: 'file_path', fsOp: 'write' },
17
- Read: { capability: 'file_read', pathField: 'file_path', fsOp: 'read' },
18
- // Inherited from Gemini CLI / shared agent harness
19
- MultiEdit: { capability: 'file_write', pathField: 'file_path', fsOp: 'write' },
20
- Glob: { capability: 'file_list', pathField: 'path', fsOp: 'list' },
21
- Grep: { capability: 'file_read', pathField: 'path', fsOp: 'read' },
22
- LS: { capability: 'file_list', pathField: 'path', fsOp: 'list' },
23
- WebFetch: { capability: 'http_request', urlField: 'url' },
24
- WebSearch: { capability: 'web_search' },
25
- // Antigravity-specific / shared
26
- Subagent: { capability: 'subagent' },
27
- Task: { capability: 'subagent' },
28
- RunCode: { capability: 'execute_code' },
29
- Plugin: { capability: 'plugin_invoke' },
9
+ // Antigravity built-in tools (https://antigravity.google/docs/hooks)
10
+ run_command: { capability: 'shell_exec', commandField: 'CommandLine' },
11
+ // Antigravity CLI (agy 1.4.x) file tools, observed live: Path may be relative to the workspace
12
+ read_file: { capability: 'file_read', pathField: 'Path', fsOp: 'read' },
13
+ write_file: { capability: 'file_write', pathField: 'Path', fsOp: 'write' },
14
+ edit_file: { capability: 'file_write', pathField: 'Path', fsOp: 'write' },
15
+ view_file: { capability: 'file_read', pathField: 'AbsolutePath', fsOp: 'read' },
16
+ write_to_file: { capability: 'file_write', pathField: 'TargetFile', fsOp: 'write' },
17
+ replace_file_content: { capability: 'file_write', pathField: 'TargetFile', fsOp: 'write' },
18
+ multi_replace_file_content: { capability: 'file_write', pathField: 'TargetFile', fsOp: 'write' },
19
+ list_dir: { capability: 'file_list', pathField: 'DirectoryPath', fsOp: 'list' },
20
+ find_by_name: { capability: 'file_list', pathField: 'SearchDirectory', fsOp: 'list' },
21
+ grep_search: { capability: 'file_read', pathField: 'SearchPath', fsOp: 'read' },
22
+ read_url_content: { capability: 'http_request', urlField: 'Url' },
23
+ search_web: { capability: 'web_search' },
24
+ invoke_subagent: { capability: 'subagent' },
25
+ define_subagent: { capability: 'subagent' },
26
+ send_message: { capability: 'agent_message' },
27
+ manage_task: { capability: 'task_control' },
28
+ schedule: { capability: 'schedule' },
29
+ generate_image: { capability: 'generate_image' },
30
30
  };
31
31
  //# 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;AA4DH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAgC;IACxD,8CAA8C;IAC9C,IAAI,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE;IAC3D,IAAI,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE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AAE;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.1.0",
3
+ "version": "0.2.1",
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 tests/",
14
+ "test": "npm run build && node --test test/*.test.mjs",
15
15
  "prepublishOnly": "npm run build"
16
16
  },
17
17
  "keywords": [