@agentic-kit/pi 0.18.1 → 0.19.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/confirm-gate.js +2 -28
- package/esm/confirm-gate.js +2 -28
- package/package.json +3 -3
package/confirm-gate.js
CHANGED
|
@@ -1,38 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createConfirmGate = createConfirmGate;
|
|
4
|
+
const db_tools_1 = require("@agentic-kit/db-tools");
|
|
4
5
|
const harness_1 = require("@agentic-kit/harness");
|
|
5
6
|
function createConfirmGate(options) {
|
|
6
7
|
const gate = (0, harness_1.createConfirmGate)('policy' in options
|
|
7
8
|
? options
|
|
8
|
-
: {
|
|
9
|
-
gatedTools: options.gatedTools,
|
|
10
|
-
isProjectRunnable: async (cwd) => {
|
|
11
|
-
const resolved = await options.resolveProjectContext(cwd);
|
|
12
|
-
return resolved.context !== null;
|
|
13
|
-
},
|
|
14
|
-
hasDataToken: async (cwd) => {
|
|
15
|
-
const resolved = await options.resolveProjectContext(cwd);
|
|
16
|
-
if (!resolved.context)
|
|
17
|
-
return false;
|
|
18
|
-
const token = await options.resolveDataToken(resolved.context);
|
|
19
|
-
return Boolean(token.token);
|
|
20
|
-
},
|
|
21
|
-
resolveTemplatePreview: async (cwd, blueprintName, displayName) => {
|
|
22
|
-
const resolved = await options.resolveProjectContext(cwd);
|
|
23
|
-
if (!resolved.context)
|
|
24
|
-
return undefined;
|
|
25
|
-
const result = await options.createTemplatePreviewTables(resolved.context, blueprintName);
|
|
26
|
-
if (result.tables.length === 0)
|
|
27
|
-
return undefined;
|
|
28
|
-
return {
|
|
29
|
-
kind: 'template',
|
|
30
|
-
displayName,
|
|
31
|
-
blueprintName: result.blueprintName || undefined,
|
|
32
|
-
tables: result.tables,
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
});
|
|
9
|
+
: { gatedTools: options.gatedTools, ...(0, db_tools_1.constructiveGateDeps)(options) });
|
|
36
10
|
return {
|
|
37
11
|
onAgentStart: gate.onAgentStart,
|
|
38
12
|
onToolCall: async (event, ctx) => {
|
package/esm/confirm-gate.js
CHANGED
|
@@ -1,35 +1,9 @@
|
|
|
1
|
+
import { constructiveGateDeps } from '@agentic-kit/db-tools';
|
|
1
2
|
import { createConfirmGate as createHarnessConfirmGate, } from '@agentic-kit/harness';
|
|
2
3
|
export function createConfirmGate(options) {
|
|
3
4
|
const gate = createHarnessConfirmGate('policy' in options
|
|
4
5
|
? options
|
|
5
|
-
: {
|
|
6
|
-
gatedTools: options.gatedTools,
|
|
7
|
-
isProjectRunnable: async (cwd) => {
|
|
8
|
-
const resolved = await options.resolveProjectContext(cwd);
|
|
9
|
-
return resolved.context !== null;
|
|
10
|
-
},
|
|
11
|
-
hasDataToken: async (cwd) => {
|
|
12
|
-
const resolved = await options.resolveProjectContext(cwd);
|
|
13
|
-
if (!resolved.context)
|
|
14
|
-
return false;
|
|
15
|
-
const token = await options.resolveDataToken(resolved.context);
|
|
16
|
-
return Boolean(token.token);
|
|
17
|
-
},
|
|
18
|
-
resolveTemplatePreview: async (cwd, blueprintName, displayName) => {
|
|
19
|
-
const resolved = await options.resolveProjectContext(cwd);
|
|
20
|
-
if (!resolved.context)
|
|
21
|
-
return undefined;
|
|
22
|
-
const result = await options.createTemplatePreviewTables(resolved.context, blueprintName);
|
|
23
|
-
if (result.tables.length === 0)
|
|
24
|
-
return undefined;
|
|
25
|
-
return {
|
|
26
|
-
kind: 'template',
|
|
27
|
-
displayName,
|
|
28
|
-
blueprintName: result.blueprintName || undefined,
|
|
29
|
-
tables: result.tables,
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
});
|
|
6
|
+
: { gatedTools: options.gatedTools, ...constructiveGateDeps(options) });
|
|
33
7
|
return {
|
|
34
8
|
onAgentStart: gate.onAgentStart,
|
|
35
9
|
onToolCall: async (event, ctx) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentic-kit/pi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
5
5
|
"description": "the pi adapter for agentic-kit — Constructive's typed db tools, confirm gate, and the run-log/metering/gate lanes attached to a pi coding-agent session",
|
|
6
6
|
"main": "index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"test:watch": "jest --watch"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@agentic-kit/db-tools": "^0.
|
|
32
|
+
"@agentic-kit/db-tools": "^0.3.0",
|
|
33
33
|
"@agentic-kit/harness": "^0.15.0",
|
|
34
34
|
"@agentic-kit/metering": "^0.3.0",
|
|
35
35
|
"@agentic-kit/run-log": "^0.6.0",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"coding-agent",
|
|
48
48
|
"constructive"
|
|
49
49
|
],
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "e35db12526094b515596ced2dd27a1ec8edd99d5"
|
|
51
51
|
}
|