@pillar-ai/sdk 0.1.22 → 0.1.23
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/cli/sync.js +28 -3
- package/dist/core/Pillar.d.ts +4 -10
- package/dist/core/config.d.ts +16 -29
- package/dist/pillar.esm.js +1 -1
- package/dist/tools/types.d.ts +12 -0
- package/package.json +2 -3
package/dist/cli/sync.js
CHANGED
|
@@ -259,6 +259,7 @@ async function scanTools(scanDir) {
|
|
|
259
259
|
tools.push({
|
|
260
260
|
name: obj.name,
|
|
261
261
|
description: obj.description,
|
|
262
|
+
guidance: typeof obj.guidance === "string" ? obj.guidance : void 0,
|
|
262
263
|
type: toolType,
|
|
263
264
|
inputSchema: obj.inputSchema,
|
|
264
265
|
examples: obj.examples,
|
|
@@ -313,13 +314,27 @@ async function scanTools(scanDir) {
|
|
|
313
314
|
}
|
|
314
315
|
return tools;
|
|
315
316
|
}
|
|
317
|
+
function findAgentGuidance(scanDir) {
|
|
318
|
+
const absoluteDir = path.resolve(process.cwd(), scanDir);
|
|
319
|
+
const candidate = path.join(absoluteDir, "AGENT_GUIDANCE.md");
|
|
320
|
+
if (fs.existsSync(candidate)) {
|
|
321
|
+
const content = fs.readFileSync(candidate, "utf-8").trim();
|
|
322
|
+
if (content) {
|
|
323
|
+
console.log(
|
|
324
|
+
`[pillar-sync] Found agent guidance: ${path.relative(process.cwd(), candidate)} (${content.length} chars)`
|
|
325
|
+
);
|
|
326
|
+
return content;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return void 0;
|
|
330
|
+
}
|
|
316
331
|
function normalizeTypeForBackend(type) {
|
|
317
332
|
if (type === "trigger_tool") {
|
|
318
333
|
return "trigger_action";
|
|
319
334
|
}
|
|
320
335
|
return type || "trigger_action";
|
|
321
336
|
}
|
|
322
|
-
function buildManifestFromScan(tools, platform, version, gitSha) {
|
|
337
|
+
function buildManifestFromScan(tools, platform, version, gitSha, agentGuidance) {
|
|
323
338
|
const entries = [];
|
|
324
339
|
for (const tool of tools) {
|
|
325
340
|
const entry = {
|
|
@@ -328,6 +343,8 @@ function buildManifestFromScan(tools, platform, version, gitSha) {
|
|
|
328
343
|
// Normalize trigger_tool → trigger_action for backend API compatibility
|
|
329
344
|
type: normalizeTypeForBackend(tool.type)
|
|
330
345
|
};
|
|
346
|
+
if (tool.guidance)
|
|
347
|
+
entry.guidance = tool.guidance;
|
|
331
348
|
if (tool.examples?.length)
|
|
332
349
|
entry.examples = tool.examples;
|
|
333
350
|
if (tool.autoRun)
|
|
@@ -339,7 +356,7 @@ function buildManifestFromScan(tools, platform, version, gitSha) {
|
|
|
339
356
|
entry.data_schema = tool.inputSchema;
|
|
340
357
|
entries.push(entry);
|
|
341
358
|
}
|
|
342
|
-
|
|
359
|
+
const manifest = {
|
|
343
360
|
platform,
|
|
344
361
|
version,
|
|
345
362
|
gitSha,
|
|
@@ -347,6 +364,10 @@ function buildManifestFromScan(tools, platform, version, gitSha) {
|
|
|
347
364
|
actions: entries
|
|
348
365
|
// Keep 'actions' key for backend API compatibility
|
|
349
366
|
};
|
|
367
|
+
if (agentGuidance) {
|
|
368
|
+
manifest.agentGuidance = agentGuidance;
|
|
369
|
+
}
|
|
370
|
+
return manifest;
|
|
350
371
|
}
|
|
351
372
|
async function main() {
|
|
352
373
|
const args = parseArgs(process.argv.slice(2));
|
|
@@ -391,11 +412,12 @@ async function main() {
|
|
|
391
412
|
}
|
|
392
413
|
const toolCount = scannedTools.length;
|
|
393
414
|
console.log(`[pillar-sync] Found ${toolCount} tools`);
|
|
415
|
+
const agentGuidance = findAgentGuidance(scanDir);
|
|
394
416
|
if (toolCount === 0) {
|
|
395
417
|
console.warn("[pillar-sync] No tools found. Nothing to sync.");
|
|
396
418
|
process.exit(0);
|
|
397
419
|
}
|
|
398
|
-
const manifest = buildManifestFromScan(scannedTools, platform, version, gitSha);
|
|
420
|
+
const manifest = buildManifestFromScan(scannedTools, platform, version, gitSha, agentGuidance);
|
|
399
421
|
console.log(`[pillar-sync] Platform: ${platform}`);
|
|
400
422
|
console.log(`[pillar-sync] Version: ${version}`);
|
|
401
423
|
console.log(`[pillar-sync] Git SHA: ${gitSha || "not available"}`);
|
|
@@ -411,6 +433,9 @@ async function main() {
|
|
|
411
433
|
git_sha: gitSha,
|
|
412
434
|
actions: manifest.actions
|
|
413
435
|
};
|
|
436
|
+
if (manifest.agentGuidance) {
|
|
437
|
+
requestBody.agent_guidance = manifest.agentGuidance;
|
|
438
|
+
}
|
|
414
439
|
const syncUrl = `${apiUrl}/api/admin/configs/${slug}/actions/sync/?async=true`;
|
|
415
440
|
console.log(`[pillar-sync] POST ${syncUrl}`);
|
|
416
441
|
try {
|
package/dist/core/Pillar.d.ts
CHANGED
|
@@ -202,19 +202,13 @@ export declare class Pillar {
|
|
|
202
202
|
setTextSelectionEnabled(enabled: boolean): void;
|
|
203
203
|
/**
|
|
204
204
|
* Enable or disable DOM scanning at runtime.
|
|
205
|
-
*
|
|
206
|
-
* @param
|
|
207
|
-
*
|
|
208
|
-
* @example
|
|
209
|
-
* // Enable DOM scanning
|
|
210
|
-
* pillar.setDOMScanningEnabled(true);
|
|
211
|
-
*
|
|
212
|
-
* // Disable DOM scanning
|
|
213
|
-
* pillar.setDOMScanningEnabled(false);
|
|
205
|
+
* @deprecated DOM scanning is currently disabled and this method has no effect.
|
|
206
|
+
* @param _enabled - Ignored, DOM scanning cannot be enabled
|
|
214
207
|
*/
|
|
215
|
-
setDOMScanningEnabled(
|
|
208
|
+
setDOMScanningEnabled(_enabled: boolean): void;
|
|
216
209
|
/**
|
|
217
210
|
* Whether DOM scanning is currently enabled.
|
|
211
|
+
* @returns Always returns false - DOM scanning is disabled
|
|
218
212
|
*/
|
|
219
213
|
get isDOMScanningEnabled(): boolean;
|
|
220
214
|
/** Currently highlighted element (for cleanup) */
|
package/dist/core/config.d.ts
CHANGED
|
@@ -186,41 +186,24 @@ export interface InteractionHighlightConfig {
|
|
|
186
186
|
*/
|
|
187
187
|
scrollBehavior?: ScrollBehavior;
|
|
188
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* DOM scanning configuration.
|
|
191
|
+
* @internal DOM scanning is currently disabled and not available for configuration.
|
|
192
|
+
*/
|
|
189
193
|
export interface DOMScanningConfig {
|
|
190
|
-
/**
|
|
191
|
-
* Whether DOM scanning is enabled.
|
|
192
|
-
* When enabled, page structure is captured and sent with messages.
|
|
193
|
-
* @default false
|
|
194
|
-
*/
|
|
194
|
+
/** @internal DOM scanning is disabled */
|
|
195
195
|
enabled?: boolean;
|
|
196
|
-
/**
|
|
197
|
-
* Whether to include text content in the scan.
|
|
198
|
-
* @default true
|
|
199
|
-
*/
|
|
196
|
+
/** @internal */
|
|
200
197
|
includeText?: boolean;
|
|
201
|
-
/**
|
|
202
|
-
* Maximum depth to traverse the DOM tree.
|
|
203
|
-
* @default 20
|
|
204
|
-
*/
|
|
198
|
+
/** @internal */
|
|
205
199
|
maxDepth?: number;
|
|
206
|
-
/**
|
|
207
|
-
* Whether to only include visible elements.
|
|
208
|
-
* @default true
|
|
209
|
-
*/
|
|
200
|
+
/** @internal */
|
|
210
201
|
visibleOnly?: boolean;
|
|
211
|
-
/**
|
|
212
|
-
* CSS selector for elements to exclude from scanning.
|
|
213
|
-
* @example '.sidebar, .footer, [data-no-scan]'
|
|
214
|
-
*/
|
|
202
|
+
/** @internal */
|
|
215
203
|
excludeSelector?: string;
|
|
216
|
-
/**
|
|
217
|
-
* Maximum text length before truncation.
|
|
218
|
-
* @default 500
|
|
219
|
-
*/
|
|
204
|
+
/** @internal */
|
|
220
205
|
maxTextLength?: number;
|
|
221
|
-
/**
|
|
222
|
-
* Configuration for highlighting elements during AI interactions.
|
|
223
|
-
*/
|
|
206
|
+
/** Configuration for highlighting elements during AI interactions. */
|
|
224
207
|
interactionHighlight?: InteractionHighlightConfig;
|
|
225
208
|
}
|
|
226
209
|
export interface SuggestionsConfig {
|
|
@@ -356,7 +339,11 @@ export interface PillarConfig {
|
|
|
356
339
|
urlParams?: UrlParamsConfig;
|
|
357
340
|
/** Text selection "Ask AI" popover. */
|
|
358
341
|
textSelection?: TextSelectionConfig;
|
|
359
|
-
/**
|
|
342
|
+
/**
|
|
343
|
+
* DOM scanning for page context.
|
|
344
|
+
* @internal DOM scanning is currently disabled.
|
|
345
|
+
* @deprecated This feature is not available.
|
|
346
|
+
*/
|
|
360
347
|
domScanning?: DOMScanningConfig;
|
|
361
348
|
/** Page-aware suggestions. */
|
|
362
349
|
suggestions?: SuggestionsConfig;
|