@agentic-kit/pi 0.12.0 → 0.13.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.d.ts +10 -1
- package/confirm-gate.js +31 -29
- package/esm/confirm-gate.d.ts +10 -1
- package/esm/confirm-gate.js +31 -29
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/index.d.ts +1 -1
- package/package.json +3 -3
package/confirm-gate.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type GatePolicy } from '@agentic-kit/harness';
|
|
1
2
|
import type { ExtensionContext, ToolCallEvent, ToolCallEventResult } from '@earendil-works/pi-coding-agent';
|
|
2
3
|
import type { resolveDataToken, resolveProjectContext } from './context';
|
|
3
4
|
import type { createTemplatePreviewTables } from './tools/templates';
|
|
@@ -8,8 +9,16 @@ export type ConfirmGateDeps = {
|
|
|
8
9
|
/** Tool names to gate; defaults to the harness's `MUTATING_DB_TOOLS`. */
|
|
9
10
|
gatedTools?: ReadonlySet<string>;
|
|
10
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Constructive's database deps, or a `GatePolicy` of the host's own — a pi
|
|
14
|
+
* host with no Constructive project (a remote coding job gating `bash`) has
|
|
15
|
+
* nothing to give the former.
|
|
16
|
+
*/
|
|
17
|
+
export type ConfirmGateOptions = ConfirmGateDeps | {
|
|
18
|
+
policy: GatePolicy;
|
|
19
|
+
};
|
|
11
20
|
export type ConfirmGate = {
|
|
12
21
|
onAgentStart: () => void;
|
|
13
22
|
onToolCall: (event: ToolCallEvent, ctx: ExtensionContext) => Promise<ToolCallEventResult | undefined>;
|
|
14
23
|
};
|
|
15
|
-
export declare function createConfirmGate(
|
|
24
|
+
export declare function createConfirmGate(options: ConfirmGateOptions): ConfirmGate;
|
package/confirm-gate.js
CHANGED
|
@@ -2,35 +2,37 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createConfirmGate = createConfirmGate;
|
|
4
4
|
const harness_1 = require("@agentic-kit/harness");
|
|
5
|
-
function createConfirmGate(
|
|
6
|
-
const gate = (0, harness_1.createConfirmGate)(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
5
|
+
function createConfirmGate(options) {
|
|
6
|
+
const gate = (0, harness_1.createConfirmGate)('policy' in options
|
|
7
|
+
? 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
|
+
});
|
|
34
36
|
return {
|
|
35
37
|
onAgentStart: gate.onAgentStart,
|
|
36
38
|
onToolCall: async (event, ctx) => {
|
package/esm/confirm-gate.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type GatePolicy } from '@agentic-kit/harness';
|
|
1
2
|
import type { ExtensionContext, ToolCallEvent, ToolCallEventResult } from '@earendil-works/pi-coding-agent';
|
|
2
3
|
import type { resolveDataToken, resolveProjectContext } from './context';
|
|
3
4
|
import type { createTemplatePreviewTables } from './tools/templates';
|
|
@@ -8,8 +9,16 @@ export type ConfirmGateDeps = {
|
|
|
8
9
|
/** Tool names to gate; defaults to the harness's `MUTATING_DB_TOOLS`. */
|
|
9
10
|
gatedTools?: ReadonlySet<string>;
|
|
10
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Constructive's database deps, or a `GatePolicy` of the host's own — a pi
|
|
14
|
+
* host with no Constructive project (a remote coding job gating `bash`) has
|
|
15
|
+
* nothing to give the former.
|
|
16
|
+
*/
|
|
17
|
+
export type ConfirmGateOptions = ConfirmGateDeps | {
|
|
18
|
+
policy: GatePolicy;
|
|
19
|
+
};
|
|
11
20
|
export type ConfirmGate = {
|
|
12
21
|
onAgentStart: () => void;
|
|
13
22
|
onToolCall: (event: ToolCallEvent, ctx: ExtensionContext) => Promise<ToolCallEventResult | undefined>;
|
|
14
23
|
};
|
|
15
|
-
export declare function createConfirmGate(
|
|
24
|
+
export declare function createConfirmGate(options: ConfirmGateOptions): ConfirmGate;
|
package/esm/confirm-gate.js
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
import { createConfirmGate as createHarnessConfirmGate, } from '@agentic-kit/harness';
|
|
2
|
-
export function createConfirmGate(
|
|
3
|
-
const gate = createHarnessConfirmGate(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
export function createConfirmGate(options) {
|
|
3
|
+
const gate = createHarnessConfirmGate('policy' in options
|
|
4
|
+
? 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
|
+
});
|
|
31
33
|
return {
|
|
32
34
|
onAgentStart: gate.onAgentStart,
|
|
33
35
|
onToolCall: async (event, ctx) => {
|
package/esm/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type PiToolsHost } from './host';
|
|
|
3
3
|
export declare const dbTools: ExtensionFactory;
|
|
4
4
|
/** Configure the host and get the extension in one call. */
|
|
5
5
|
export declare function createDbTools(host: PiToolsHost): ExtensionFactory;
|
|
6
|
-
export { type ConfirmGate, type ConfirmGateDeps, createConfirmGate } from './confirm-gate';
|
|
6
|
+
export { type ConfirmGate, type ConfirmGateDeps, type ConfirmGateOptions, createConfirmGate, } from './confirm-gate';
|
|
7
7
|
export { deriveSubdomainEndpoint, type ModulesClient, type ProjectContext, resolveDataToken, resolveProjectContext, } from './context';
|
|
8
8
|
export { type ActiveDataToken, configureHost, type DataAuthBroker, getHost, type HostAccount, type HostBackendConfig, type HostProvisionOverlay, type PiToolsHost, type PreviewToken, } from './host';
|
|
9
9
|
export { loadProvisionManifest, parseProvisionManifest, PROVISION_MANIFEST_FILE, type ProvisionManifest, } from './provision-database/manifest';
|
package/esm/index.js
CHANGED
|
@@ -44,7 +44,7 @@ export function createDbTools(host) {
|
|
|
44
44
|
configureHost(host);
|
|
45
45
|
return dbTools;
|
|
46
46
|
}
|
|
47
|
-
export { createConfirmGate } from './confirm-gate';
|
|
47
|
+
export { createConfirmGate, } from './confirm-gate';
|
|
48
48
|
export { deriveSubdomainEndpoint, resolveDataToken, resolveProjectContext, } from './context';
|
|
49
49
|
export { configureHost, getHost, } from './host';
|
|
50
50
|
export { loadProvisionManifest, parseProvisionManifest, PROVISION_MANIFEST_FILE, } from './provision-database/manifest';
|
package/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type PiToolsHost } from './host';
|
|
|
3
3
|
export declare const dbTools: ExtensionFactory;
|
|
4
4
|
/** Configure the host and get the extension in one call. */
|
|
5
5
|
export declare function createDbTools(host: PiToolsHost): ExtensionFactory;
|
|
6
|
-
export { type ConfirmGate, type ConfirmGateDeps, createConfirmGate } from './confirm-gate';
|
|
6
|
+
export { type ConfirmGate, type ConfirmGateDeps, type ConfirmGateOptions, createConfirmGate, } from './confirm-gate';
|
|
7
7
|
export { deriveSubdomainEndpoint, type ModulesClient, type ProjectContext, resolveDataToken, resolveProjectContext, } from './context';
|
|
8
8
|
export { type ActiveDataToken, configureHost, type DataAuthBroker, getHost, type HostAccount, type HostBackendConfig, type HostProvisionOverlay, type PiToolsHost, type PreviewToken, } from './host';
|
|
9
9
|
export { loadProvisionManifest, parseProvisionManifest, PROVISION_MANIFEST_FILE, type ProvisionManifest, } from './provision-database/manifest';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentic-kit/pi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
5
5
|
"description": "Pi adapter for agentic-kit — the Constructive typed db tools (provision, blueprint, codegen, records, policies, templates) and confirm gate as a pi coding-agent extension",
|
|
6
6
|
"main": "index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"test:watch": "jest --watch"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@agentic-kit/harness": "^0.
|
|
32
|
+
"@agentic-kit/harness": "^0.12.0",
|
|
33
33
|
"@constructive-io/graphql-query": "^4.12.10",
|
|
34
34
|
"@constructive-io/sdk": "^1.11.11",
|
|
35
35
|
"node-type-registry": "^1.16.0",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"coding-agent",
|
|
49
49
|
"constructive"
|
|
50
50
|
],
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "6d4354f47b8bd4d3d1c2bd918a12dcb0315e1931"
|
|
52
52
|
}
|