@quantiya/codevibe-claude-plugin 2.0.40 → 2.0.42

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.
Files changed (24) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/node_modules/@quantiya/codevibe-core/bin/codevibe-web-mcp-bridge.js +91 -0
  3. package/node_modules/@quantiya/codevibe-core/dist/companion-mode/index.d.ts +1 -0
  4. package/node_modules/@quantiya/codevibe-core/dist/index.d.ts +4 -1
  5. package/node_modules/@quantiya/codevibe-core/dist/index.js +471 -453
  6. package/node_modules/@quantiya/codevibe-core/dist/local-executor/env-scrub.d.ts +10 -0
  7. package/node_modules/@quantiya/codevibe-core/dist/local-executor/implementor-argv.d.ts +34 -1
  8. package/node_modules/@quantiya/codevibe-core/dist/local-executor/index.d.ts +2 -1
  9. package/node_modules/@quantiya/codevibe-core/dist/local-executor/local-executor-impl.d.ts +1 -0
  10. package/node_modules/@quantiya/codevibe-core/dist/local-executor/types.d.ts +1 -0
  11. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/cli.d.ts +1 -1
  12. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/cli.js +2156 -1107
  13. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/command-intent.d.ts +18 -0
  14. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/quorum-loop.d.ts +1 -0
  15. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/team-decompose.d.ts +8 -8
  16. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/web/agent-web-server.d.ts +44 -0
  17. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/web/extract.d.ts +17 -0
  18. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/web/fetch.d.ts +10 -0
  19. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/web/web-extract-worker.d.ts +12 -0
  20. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/web-extract-worker.js +7 -0
  21. package/node_modules/@quantiya/codevibe-core/dist/reviewer/index.d.ts +2 -2
  22. package/node_modules/@quantiya/codevibe-core/dist/substrate-launch/engage-substrate.d.ts +2 -0
  23. package/node_modules/@quantiya/codevibe-core/package.json +3 -2
  24. package/package.json +2 -2
@@ -53,4 +53,22 @@ export declare function extractAllAgentMentionIntents(text: string): AgentMentio
53
53
  export declare function stripLeadingAgentControlToken(text: string): string;
54
54
  export declare function buildCommandIntentEnvelope(intent: AgentMentionIntent): CommandIntentEnvelope;
55
55
  export declare function buildCommandIntentMetadata(text: string): CommandIntentMetadata | undefined;
56
+ /**
57
+ * Detects whether a prompt or brief expresses need for external web browsing or online searching.
58
+ * Used by QuorumLoop to dynamically attach web tools ONLY when needed, preserving full
59
+ * sandboxing for normal non-web tasks.
60
+ *
61
+ * Supports language-agnostic URLs, as well as English, Chinese, and Japanese web search intents.
62
+ */
63
+ export declare function isWebAccessNeeded(text: string): boolean;
64
+ /**
65
+ * Detects whether a prompt expresses intent to create, write, save, or modify local files/reports,
66
+ * as opposed to a purely read-only conversational request.
67
+ * Used as a backstop when classifying or routing web requests so that prompts asking to fetch/search
68
+ * AND write/save to a local file route to `start_task` (implementor execution) instead of desktop `browse`.
69
+ *
70
+ * Designed to handle English, Chinese, Japanese, Korean, European languages, and universal structural patterns
71
+ * (e.g. file targets and shell redirection), while accurately filtering out informational "how-to" / conceptual questions.
72
+ */
73
+ export declare function hasFileMutationIntent(text: string): boolean;
56
74
  export {};
@@ -690,6 +690,7 @@ export declare class QuorumLoop {
690
690
  * are removed with the task's other per-task state at its terminal cleanup.
691
691
  */
692
692
  private readonly singleTaskContextByTask;
693
+ private readonly webAccessByTask;
693
694
  /**
694
695
  * CP-1.f revise-context fix (dogfood task 2ac68708, 2026-06-11) — the BINDING
695
696
  * user-requested changes for a task, accumulated across ALL revise rounds.
@@ -18,17 +18,17 @@ export declare const WorkItemInputSchema: z.ZodDiscriminatedUnion<"decompose", [
18
18
  access: z.ZodEnum<["write", "read"]>;
19
19
  }, "strip", z.ZodTypeAny, {
20
20
  path: string;
21
- access: "read" | "write";
21
+ access: "write" | "read";
22
22
  }, {
23
23
  path: string;
24
- access: "read" | "write";
24
+ access: "write" | "read";
25
25
  }>, "many">;
26
26
  test_surfaces: z.ZodArray<z.ZodString, "many">;
27
27
  auto_modified_files: z.ZodArray<z.ZodString, "many">;
28
28
  }, "strip", z.ZodTypeAny, {
29
29
  shared_contracts: {
30
30
  path: string;
31
- access: "read" | "write";
31
+ access: "write" | "read";
32
32
  }[];
33
33
  write_paths: string[];
34
34
  test_surfaces: string[];
@@ -36,7 +36,7 @@ export declare const WorkItemInputSchema: z.ZodDiscriminatedUnion<"decompose", [
36
36
  }, {
37
37
  shared_contracts: {
38
38
  path: string;
39
- access: "read" | "write";
39
+ access: "write" | "read";
40
40
  }[];
41
41
  write_paths: string[];
42
42
  test_surfaces: string[];
@@ -50,7 +50,7 @@ export declare const WorkItemInputSchema: z.ZodDiscriminatedUnion<"decompose", [
50
50
  ownershipScope: {
51
51
  shared_contracts: {
52
52
  path: string;
53
- access: "read" | "write";
53
+ access: "write" | "read";
54
54
  }[];
55
55
  write_paths: string[];
56
56
  test_surfaces: string[];
@@ -63,7 +63,7 @@ export declare const WorkItemInputSchema: z.ZodDiscriminatedUnion<"decompose", [
63
63
  ownershipScope: {
64
64
  shared_contracts: {
65
65
  path: string;
66
- access: "read" | "write";
66
+ access: "write" | "read";
67
67
  }[];
68
68
  write_paths: string[];
69
69
  test_surfaces: string[];
@@ -78,7 +78,7 @@ export declare const WorkItemInputSchema: z.ZodDiscriminatedUnion<"decompose", [
78
78
  ownershipScope: {
79
79
  shared_contracts: {
80
80
  path: string;
81
- access: "read" | "write";
81
+ access: "write" | "read";
82
82
  }[];
83
83
  write_paths: string[];
84
84
  test_surfaces: string[];
@@ -94,7 +94,7 @@ export declare const WorkItemInputSchema: z.ZodDiscriminatedUnion<"decompose", [
94
94
  ownershipScope: {
95
95
  shared_contracts: {
96
96
  path: string;
97
- access: "read" | "write";
97
+ access: "write" | "read";
98
98
  }[];
99
99
  write_paths: string[];
100
100
  test_surfaces: string[];
@@ -0,0 +1,44 @@
1
+ import * as fs from 'node:fs';
2
+ import { redactAbsoluteLocalPaths } from '../../planner/local-advisory';
3
+ export { redactAbsoluteLocalPaths };
4
+ export declare const MAX_SEARCHES_PER_TURN = 5;
5
+ export declare const MAX_FETCHES_PER_TURN = 10;
6
+ export declare const MAX_DYNAMIC_FETCH_CHARS = 50000;
7
+ export declare const TRUNCATION_MARKER = "\n\n[Content truncated at 50,000 characters]";
8
+ export interface WebAuditRecord {
9
+ timestamp: string;
10
+ tool: 'codevibe_web_search' | 'codevibe_web_fetch';
11
+ target: string;
12
+ agent: string;
13
+ status: 'ok' | 'error' | 'quota_exceeded' | 'blocked';
14
+ statusCode?: number;
15
+ byteCount?: number;
16
+ durationMs: number;
17
+ provider?: string;
18
+ }
19
+ export interface AgentWebTurnContext {
20
+ turnId: string;
21
+ sessionId: string;
22
+ token: string;
23
+ socketPath: string;
24
+ fallbackDir?: string;
25
+ mcpConfigPath: string;
26
+ close: () => Promise<void>;
27
+ }
28
+ export declare function sanitizeUrlForAudit(rawUrl: string): string;
29
+ export declare function sweepOrphanedFallbackDirs(tmpRoot?: string, deps?: {
30
+ lstat?: typeof fs.lstatSync;
31
+ getuid?: () => number;
32
+ }): void;
33
+ export declare function resolveBridgePath(): string;
34
+ export declare function writeAuditEntry(sessionId: string, record: WebAuditRecord): void;
35
+ export declare function formatFetchedContent(contentType: string, rawBody: string, url: string, signal?: AbortSignal): Promise<{
36
+ title: string;
37
+ content: string;
38
+ }>;
39
+ export declare function startAgentWebTurn(options: {
40
+ sessionId: string;
41
+ turnId?: string;
42
+ agent?: string;
43
+ signal?: AbortSignal;
44
+ }): Promise<AgentWebTurnContext>;
@@ -1,3 +1,13 @@
1
+ export declare class WebExtractTimeoutError extends Error {
2
+ constructor(timeoutMs: number);
3
+ }
4
+ export declare class WebExtractAbortError extends Error {
5
+ constructor();
6
+ }
7
+ export interface WorkerExtractOptions {
8
+ timeoutMs?: number;
9
+ signal?: AbortSignal;
10
+ }
1
11
  export interface ExtractResult {
2
12
  title: string;
3
13
  text: string;
@@ -9,6 +19,13 @@ export declare function __resetExtractCacheForTest(): void;
9
19
  * NEVER throws — returns `{ title:'', text:'' }` on the size cap / load / parse failure.
10
20
  */
11
21
  export declare function htmlToText(html: string): Promise<ExtractResult>;
22
+ export declare const DEFAULT_WORKER_TIMEOUT_MS = 5000;
23
+ export declare function resolveExtractWorkerPath(): string;
24
+ /**
25
+ * Isolated worker-thread parse5 text extraction with bounded wall-clock timeout
26
+ * and abort signal cancellation support.
27
+ */
28
+ export declare function htmlToTextWorker(html: string, options?: WorkerExtractOptions): Promise<ExtractResult>;
12
29
  export interface ExtractQuerySnippetsOptions {
13
30
  maxChars?: number;
14
31
  leadChars?: number;
@@ -26,6 +26,16 @@ export declare function pinnedLookup(frozen: {
26
26
  address: string;
27
27
  family: number;
28
28
  }[]): net.LookupFunction;
29
+ /** Perform ONE guarded GET (no redirect following). Resolves with {status, headers, body|null, location}. */
30
+ export declare function getOnce(url: URL, frozen: {
31
+ address: string;
32
+ family: number;
33
+ }[], signal: AbortSignal | undefined, options?: GuardedFetchOptions): Promise<{
34
+ status: number;
35
+ location?: string;
36
+ contentType: string;
37
+ body?: Buffer;
38
+ }>;
29
39
  /**
30
40
  * Guarded GET with manual redirect following (full guard re-run per hop). Returns
31
41
  * decoded text or throws FetchError. `signal` lets the caller (Esc) abort.
@@ -0,0 +1,12 @@
1
+ export interface WorkerExtractResult {
2
+ title: string;
3
+ text: string;
4
+ }
5
+ export type WorkerMessage = {
6
+ success: true;
7
+ result: WorkerExtractResult;
8
+ } | {
9
+ success: false;
10
+ error: string;
11
+ };
12
+ export declare function extractHtmlTree(html: string): Promise<WorkerExtractResult>;
@@ -0,0 +1,7 @@
1
+ "use strict";var y=Object.create;var g=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var D=(e,t)=>{for(var s in t)g(e,s,{get:t[s],enumerable:!0})},S=(e,t,s,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of _(t))!P.call(e,a)&&a!==s&&g(e,a,{get:()=>t[a],enumerable:!(c=C(t,a))||c.enumerable});return e};var I=(e,t,s)=>(s=e!=null?y(v(e)):{},S(t||!e||!e.__esModule?g(s,"default",{value:e,enumerable:!0}):s,e)),O=e=>S(g({},"__esModule",{value:!0}),e);var U={};D(U,{extractHtmlTree:()=>R});module.exports=O(U);var i=require("node:worker_threads"),W=new Set(["script","style","nav","header","footer","aside","noscript","svg","template","iframe","select","option","button","form","fieldset","menu","datalist","dialog","head","title","meta","link"]),T=new Set(["p","div","br","li","tr","h1","h2","h3","h4","h5","h6","section","article","ul","ol","table","blockquote","pre","hr","td","th"]),A=new Set(["p","br","li","tr","h1","h2","h3","h4","h5","h6"]),b=new Set(["td","th"]),d="",G=` ${d} `,j=new RegExp(`(?:[ \\t]*${d})+[ \\t]*\\n`,"g"),L=new Set(["main","article"]),E="http://www.w3.org/1999/xhtml";function f(e){return typeof e.tagName=="string"}function k(e){return e.nodeName==="#text"}function p(e){let t=e.childNodes;return Array.isArray(t)?t:[]}function H(e){let t=p(e).find(n=>f(n)&&n.tagName==="html");if(!t)return"";let s=p(t).find(n=>f(n)&&n.tagName==="head");if(!s)return"";let c=p(s).find(n=>f(n)&&n.tagName==="title"&&n.namespaceURI===E);if(!c)return"";let a="";for(let n of p(c))k(n)&&(a+=n.value);return a.replace(/\s+/g," ").trim()}async function R(e){let s=(await import("parse5")).parse(e),c=H(s),a=[],n=[],u=0,w=!1,N=l=>{a.push(l),u>0&&n.push(l)},h=p(s).map(l=>({node:l})).reverse();for(;h.length>0;){let l=h.pop(),r=l.node;if(l.exit){if(f(r)){let o=r.tagName.toLowerCase();T.has(o)&&N(b.has(o)?G:A.has(o)?`
2
+ `:" "),L.has(o)&&r.namespaceURI===E&&u>0&&u--}continue}if(k(r)){N(r.value.includes(d)?r.value.split(d).join(""):r.value);continue}if(!f(r))continue;let m=r.tagName.toLowerCase();if(W.has(m))continue;T.has(m)&&N(A.has(m)?`
3
+ `:" "),L.has(m)&&r.namespaceURI===E&&(u++,w=!0),h.push({node:r,exit:!0});let x=p(r);for(let o=x.length-1;o>=0;o--)h.push({node:x[o]})}let M=(w&&n.join("").trim().length>0?n:a).join("").replace(/\u00a0/g," ").replace(/[ \t\f\v]+/g," ").replace(j,`
4
+ `).split(d).join("|").replace(/ *\n[ \n]*/g,`
5
+ `).replace(/\n{3,}/g,`
6
+
7
+ `).trim();return{title:c,text:M}}if(!i.isMainThread&&i.parentPort){let e=i.workerData;e&&typeof e.html=="string"&&R(e.html).then(t=>{i.parentPort.postMessage({success:!0,result:t})}).catch(t=>{i.parentPort.postMessage({success:!1,error:t?.message||String(t)})})}0&&(module.exports={extractHtmlTree});
@@ -7,10 +7,10 @@ export { parseVerdictOutput, VerdictParseErrorClass } from './output-parser.js';
7
7
  export type { RunReviewerOptions, SubprocessError, SubprocessOutcome, } from './subprocess.js';
8
8
  export { runReviewer, SubprocessErrorClass } from './subprocess.js';
9
9
  export type { ClaudeReviewerProviderOptions } from './providers/claude.js';
10
- export { ClaudeReviewerProvider } from './providers/claude.js';
10
+ export { ClaudeReviewerProvider, buildCommand as buildClaudeReviewerCommand } from './providers/claude.js';
11
11
  export type { CodexReviewerProviderOptions } from './providers/codex.js';
12
12
  export { CodexReviewerProvider } from './providers/codex.js';
13
13
  export type { AntigravityReviewerProviderOptions } from './providers/antigravity.js';
14
- export { AntigravityReviewerProvider } from './providers/antigravity.js';
14
+ export { AntigravityReviewerProvider, buildCommand as buildAntigravityReviewerCommand } from './providers/antigravity.js';
15
15
  export { ReviewerRegistry, createSubprocessReviewerRegistry, } from './registry.js';
16
16
  export { MockReviewerSpawner, StaticReviewerMock } from './mocks.js';
@@ -80,6 +80,8 @@ export interface EngageSubstrateInput {
80
80
  claudeScratchHostRoot?: string;
81
81
  /** Safe locale source for the sanitized env (default: none). */
82
82
  localeSource?: Readonly<Record<string, string | undefined>>;
83
+ /** If true, the turn has active web tools (MCP bridge) and runs in reduced-trust mode. */
84
+ webBrowsingActive?: boolean;
83
85
  }
84
86
  /**
85
87
  * The substrate-engaged result: the spawn seam runs the agent via
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantiya/codevibe-core",
3
- "version": "2.0.35",
3
+ "version": "2.0.37",
4
4
  "description": "Core library for CodeVibe plugins - shared keychain, crypto, AppSync, and auth functionality",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,12 +11,13 @@
11
11
  "dist/**/*.d.ts",
12
12
  "dist/index.js",
13
13
  "dist/orchestration-shell/cli.js",
14
+ "dist/orchestration-shell/web-extract-worker.js",
14
15
  "bin"
15
16
  ],
16
17
  "scripts": {
17
18
  "typecheck": "tsc --noEmit",
18
19
  "emit-types": "tsc -p tsconfig.types.json --emitDeclarationOnly",
19
- "build": "rm -rf dist && npm run emit-types && esbuild src/index.ts --bundle --platform=node --target=node18 --minify --packages=external --define:__CODEVIBE_TEST_BUILD__=false --outfile=dist/index.js && esbuild src/orchestration-shell/cli.ts --bundle --platform=node --target=node18 --minify-syntax --packages=external --define:__CODEVIBE_TEST_BUILD__=false --outfile=dist/orchestration-shell/cli.js --banner:js=\"#!/usr/bin/env node\" && npm run verify-no-test-hooks && npm run verify-no-test-types",
20
+ "build": "rm -rf dist && npm run emit-types && esbuild src/index.ts --bundle --platform=node --target=node18 --minify --packages=external --define:__CODEVIBE_TEST_BUILD__=false --outfile=dist/index.js && esbuild src/orchestration-shell/cli.ts --bundle --platform=node --target=node18 --minify-syntax --packages=external --define:__CODEVIBE_TEST_BUILD__=false --outfile=dist/orchestration-shell/cli.js --banner:js=\"#!/usr/bin/env node\" && esbuild src/orchestration-shell/web/web-extract-worker.ts --bundle --platform=node --target=node18 --minify --packages=external --outfile=dist/orchestration-shell/web-extract-worker.js && npm run verify-no-test-hooks && npm run verify-no-test-types",
20
21
  "verify-no-test-hooks": "if grep -ERl 'CODEVIBE_TEST_FORCE_QUOTA_FAIL|CODEVIBE_TEST_FORCE_IMPLEMENTOR_AGENT|CODEVIBE_ANCHORED_PUBLICATION_AUTHORITY_ROOT|codevibe-anchored-publications-|cv-publication-authority-vitest-|codevibe\\.test\\.publication-authority-|setPublicationAuthorityRootForTestBuild|__CODEVIBE_TEST_BUILD__|_onBeforeLinkForTesting|_onBeforeSummariesLockForTesting|__codevibe_test_on_before_link|__codevibe_test_on_before_summaries_lock' dist; then echo 'ERROR: a test-only hook leaked into a published artifact (prod-unreachability invariant)'; exit 1; fi; echo 'OK — no test-only hooks in published artifacts'",
21
22
  "verify-no-test-types": "if find dist -type f \\( -path '*/__tests__/*' -o -name '*.test.d.ts' -o -name 'test-publication-authority-setup.d.ts' \\) | grep -q .; then echo 'verify-no-test-types: test declarations present in dist (tsconfig.types.json must exclude test sources)' >&2; exit 1; fi",
22
23
  "clean": "rm -rf dist",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantiya/codevibe-claude-plugin",
3
- "version": "2.0.40",
3
+ "version": "2.0.42",
4
4
  "description": "Control Claude Code from your iPhone and Android — real-time sync, approve file edits, send prompts by voice. Part of CodeVibe.",
5
5
  "main": "dist/server.js",
6
6
  "codevibe": {
@@ -48,7 +48,7 @@
48
48
  "node": ">=22.0.0"
49
49
  },
50
50
  "dependencies": {
51
- "@quantiya/codevibe-core": "^2.0.35",
51
+ "@quantiya/codevibe-core": "^2.0.37",
52
52
  "@quantiya/quorum-core": "^1.0.1",
53
53
  "dotenv": "^16.6.1",
54
54
  "express": "^5.1.0",