jiva-core 0.3.2 → 0.3.22
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/.github/workflows/npm-publish.yml +31 -0
- package/Dockerfile +12 -7
- package/cloud-run.yaml +1 -1
- package/cloud-run.yaml.template +1 -1
- package/dist/core/client-agent.d.ts +27 -20
- package/dist/core/client-agent.d.ts.map +1 -1
- package/dist/core/client-agent.js +187 -204
- package/dist/core/client-agent.js.map +1 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +8 -3
- package/dist/core/config.js.map +1 -1
- package/dist/interfaces/cli/index.js +18 -0
- package/dist/interfaces/cli/index.js.map +1 -1
- package/dist/interfaces/cli/setup-wizard.js +1 -1
- package/dist/interfaces/cli/setup-wizard.js.map +1 -1
- package/dist/interfaces/http/session-manager.d.ts.map +1 -1
- package/dist/interfaces/http/session-manager.js +15 -7
- package/dist/interfaces/http/session-manager.js.map +1 -1
- package/dist/storage/gcp-bucket-provider.d.ts.map +1 -1
- package/dist/storage/gcp-bucket-provider.js +1 -11
- package/dist/storage/gcp-bucket-provider.js.map +1 -1
- package/package.json +7 -7
- package/.claude/settings.local.json +0 -18
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Build and Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build-and-publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout repository
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Set up Node.js
|
|
17
|
+
uses: actions/setup-node@v4
|
|
18
|
+
with:
|
|
19
|
+
node-version: '20'
|
|
20
|
+
registry-url: 'https://registry.npmjs.org'
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: npm ci --ignore-scripts
|
|
24
|
+
|
|
25
|
+
- name: Build
|
|
26
|
+
run: npm run build
|
|
27
|
+
|
|
28
|
+
- name: Publish to npm
|
|
29
|
+
run: npm publish --access public
|
|
30
|
+
env:
|
|
31
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/Dockerfile
CHANGED
|
@@ -8,8 +8,8 @@ WORKDIR /app
|
|
|
8
8
|
COPY package*.json ./
|
|
9
9
|
COPY tsconfig.json ./
|
|
10
10
|
|
|
11
|
-
# Install dependencies (
|
|
12
|
-
RUN npm ci
|
|
11
|
+
# Install dependencies (skip postinstall/playwright in CI environment)
|
|
12
|
+
RUN npm ci --ignore-scripts
|
|
13
13
|
|
|
14
14
|
# Copy source code
|
|
15
15
|
COPY src ./src
|
|
@@ -28,16 +28,21 @@ RUN apk add --no-cache dumb-init
|
|
|
28
28
|
# Copy package files
|
|
29
29
|
COPY package*.json ./
|
|
30
30
|
|
|
31
|
-
# Install production dependencies only
|
|
32
|
-
RUN npm ci --omit=dev && npm cache clean --force
|
|
31
|
+
# Install production dependencies only (skip postinstall/playwright)
|
|
32
|
+
RUN npm ci --omit=dev --ignore-scripts && npm cache clean --force
|
|
33
|
+
|
|
34
|
+
# Pre-install MCP servers globally so they don't need to be downloaded per-session
|
|
35
|
+
RUN npm install -g @modelcontextprotocol/server-filesystem
|
|
33
36
|
|
|
34
37
|
# Copy built application from builder
|
|
35
38
|
COPY --from=builder /app/dist ./dist
|
|
36
39
|
|
|
37
|
-
# Create
|
|
38
|
-
RUN
|
|
40
|
+
# Create workspace directory and set permissions
|
|
41
|
+
RUN mkdir -p /workspace && \
|
|
42
|
+
addgroup -g 1001 -S nodejs && \
|
|
39
43
|
adduser -S nodejs -u 1001 && \
|
|
40
|
-
chown -R nodejs:nodejs /app
|
|
44
|
+
chown -R nodejs:nodejs /app && \
|
|
45
|
+
chown nodejs:nodejs /workspace
|
|
41
46
|
|
|
42
47
|
USER nodejs
|
|
43
48
|
|
package/cloud-run.yaml
CHANGED
package/cloud-run.yaml.template
CHANGED
|
@@ -35,24 +35,30 @@ export declare class ClientAgent {
|
|
|
35
35
|
private mcpManager;
|
|
36
36
|
private mcpClient;
|
|
37
37
|
private failureCount;
|
|
38
|
-
private
|
|
38
|
+
private _availableTools;
|
|
39
39
|
constructor(orchestrator: ModelOrchestrator, mcpManager: MCPServerManager);
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* with semantic understanding that avoids false positives.
|
|
41
|
+
* Returns all tool names currently available from connected MCP servers.
|
|
42
|
+
* Result is cached after the first call; call resetToolCache() if servers change.
|
|
44
43
|
*/
|
|
45
|
-
private
|
|
44
|
+
private getAvailableTools;
|
|
45
|
+
/** Reset the tool cache (e.g. after MCP server reconnects). */
|
|
46
|
+
resetToolCache(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Find the first available tool whose name contains any of the given substrings.
|
|
49
|
+
* Returns null if no match is found.
|
|
50
|
+
*/
|
|
51
|
+
private findTool;
|
|
46
52
|
/**
|
|
47
|
-
*
|
|
48
|
-
* Determine involvement level based on user request complexity
|
|
53
|
+
* Build a human-readable summary of available tool categories for LLM prompts.
|
|
49
54
|
*/
|
|
50
|
-
|
|
55
|
+
private buildToolContextForPrompt;
|
|
51
56
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
57
|
+
* Use LLM to analyze the task and determine involvement level + requirements.
|
|
58
|
+
* Replaces keyword-based determineInvolvementLevel() and parseRequirements()
|
|
59
|
+
* with semantic understanding that avoids false positives.
|
|
54
60
|
*/
|
|
55
|
-
|
|
61
|
+
private analyzeTaskRequirements;
|
|
56
62
|
/**
|
|
57
63
|
* Validate Worker's work at appropriate involvement level
|
|
58
64
|
*/
|
|
@@ -78,26 +84,27 @@ export declare class ClientAgent {
|
|
|
78
84
|
*/
|
|
79
85
|
private validateOutcome;
|
|
80
86
|
/**
|
|
81
|
-
* Check
|
|
87
|
+
* Check whether a file exists, using whichever MCP tool is available.
|
|
88
|
+
* Tries filesystem read tools first, then falls back to shell.
|
|
82
89
|
*/
|
|
83
90
|
private fileExists;
|
|
84
91
|
/**
|
|
85
92
|
* Use LLM to generate an actionable correction instruction from raw validation issues.
|
|
86
|
-
*
|
|
87
|
-
*
|
|
93
|
+
* Translates internal validation failures into concrete, tool-specific directions
|
|
94
|
+
* for the Worker, referencing only the tools actually available in the system.
|
|
88
95
|
*/
|
|
89
96
|
private generateCorrectionInstruction;
|
|
90
97
|
/**
|
|
91
|
-
* Validate file contents for common issues
|
|
98
|
+
* Validate file contents for common issues, using whichever MCP tool is available.
|
|
92
99
|
*/
|
|
93
100
|
private validateFileContents;
|
|
94
101
|
/**
|
|
95
|
-
*
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Reset failure tracking (for new conversation/session)
|
|
102
|
+
* THOROUGH-level shell-based verification: runs lightweight, read-only shell
|
|
103
|
+
* commands to confirm work was actually done (file sizes, test output presence, etc.).
|
|
104
|
+
* Skips gracefully when no shell tool is available.
|
|
100
105
|
*/
|
|
106
|
+
private validateWithShell;
|
|
107
|
+
/** Reset failure tracking (call at the start of each new conversation/session). */
|
|
101
108
|
resetFailureTracking(): void;
|
|
102
109
|
}
|
|
103
110
|
//# sourceMappingURL=client-agent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-agent.d.ts","sourceRoot":"","sources":["../../src/core/client-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAgBjD,oBAAY,gBAAgB;IAC1B,OAAO,YAAY,CAAM,0BAA0B;IACnD,QAAQ,aAAa,CAAI,mCAAmC;IAC5D,QAAQ,aAAa;CACtB;AAED,MAAM,WAAW,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