@warlock.js/ai 4.6.0 → 4.7.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/CHANGELOG.md +7 -0
- package/cjs/index.cjs +3 -1
- package/cjs/{src-Bmajk4Qg.cjs → src-DBn2_pbG.cjs} +1 -1
- package/cjs/{src-OZyDYHxm.cjs → src-DTlN47aO.cjs} +552 -17
- package/cjs/src-DTlN47aO.cjs.map +1 -0
- package/esm/agent/agent-input-builder.mjs +1 -0
- package/esm/agent/agent-input-builder.mjs.map +1 -1
- package/esm/contracts/index.d.mts +1 -1
- package/esm/contracts/system-prompt.contract.d.mts +148 -1
- package/esm/contracts/system-prompt.contract.d.mts.map +1 -1
- package/esm/errors/error-code.type.d.mts +1 -1
- package/esm/errors/index.d.mts +1 -0
- package/esm/errors/index.mjs +1 -0
- package/esm/errors/prompt-refinement-error.d.mts +36 -0
- package/esm/errors/prompt-refinement-error.d.mts.map +1 -0
- package/esm/errors/prompt-refinement-error.mjs +27 -0
- package/esm/errors/prompt-refinement-error.mjs.map +1 -0
- package/esm/index.d.mts +4 -2
- package/esm/index.mjs +3 -1
- package/esm/prompts/prompts-manager.d.mts.map +1 -1
- package/esm/prompts/prompts-manager.mjs +1 -1
- package/esm/prompts/prompts-manager.mjs.map +1 -1
- package/esm/prompts/prompts-manager.type.d.mts +15 -0
- package/esm/prompts/prompts-manager.type.d.mts.map +1 -1
- package/esm/prompts/prompts-validate.mjs +0 -0
- package/esm/prompts/prompts-validate.mjs.map +1 -1
- package/esm/system-prompt/index.d.mts +1 -0
- package/esm/system-prompt/index.mjs +1 -0
- package/esm/system-prompt/refined-system-prompt.d.mts +184 -0
- package/esm/system-prompt/refined-system-prompt.d.mts.map +1 -0
- package/esm/system-prompt/refined-system-prompt.mjs +461 -0
- package/esm/system-prompt/refined-system-prompt.mjs.map +1 -0
- package/esm/system-prompt/system-prompt.d.mts +14 -1
- package/esm/system-prompt/system-prompt.d.mts.map +1 -1
- package/esm/system-prompt/system-prompt.mjs +19 -0
- package/esm/system-prompt/system-prompt.mjs.map +1 -1
- package/llms-full.txt +104 -1
- package/llms.txt +2 -1
- package/package.json +3 -3
- package/skills/README.md +4 -0
- package/skills/manage-prompts/SKILL.md +8 -1
- package/skills/refine-prompts/SKILL.md +91 -0
- package/skills/write-system-prompt/SKILL.md +1 -0
- package/cjs/src-OZyDYHxm.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@ All notable changes to `@warlock.js/ai` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
|
|
6
6
|
|
|
7
|
+
## 4.7.0
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **`systemPrompt().refined({ model, criteria, store })`** — the prompt compiler. Humans keep writing human prompt text; the refined wrapper lazily rewrites it into a model-optimized version on first agent use and pins the result like a lockfile (re-compiled only when the source text, refiner model, `criteria`, or recipe version change — never silently). `await refined.refine()` returns the compiled template **string** (placeholders intact — routes / previews / warmup / CI; throws `PromptRefinementError` on failure) and `await refined.refinePrompt()` returns a composable prompt with `meta.refinedFrom` / `meta.refinerModel` provenance (register it to `diff` original vs refined). Placeholder parity is machine-enforced (one repair re-ask, then rejected); the lazy agent path never throws — it warns once and serves the original.
|
|
12
|
+
- **`ai.prompts.validate({ criteria })`** — validate a prompt against your **own** rules. Pass `criteria` (a string or a list of short rules) and, when a `judge` model is supplied, it replaces the built-in quality rubric so the judge's `score` / `issues` reflect your criteria (a failed rule is named in `issues`). Advisory only — never flips the deterministic `ok`; folded into the `judgeCache` key so different rules re-run.
|
|
13
|
+
|
|
7
14
|
## 4.6.0
|
|
8
15
|
|
|
9
16
|
### Added
|
package/cjs/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_src = require('./src-
|
|
2
|
+
const require_src = require('./src-DTlN47aO.cjs');
|
|
3
3
|
const require_matcher_logic = require('./matcher-logic-SBnzYohQ.cjs');
|
|
4
4
|
|
|
5
5
|
exports.AIError = require_src.AIError;
|
|
@@ -42,6 +42,7 @@ exports.PlannerDriftError = require_src.PlannerDriftError;
|
|
|
42
42
|
exports.PlannerFailedError = require_src.PlannerFailedError;
|
|
43
43
|
exports.PlannerPlanInvalidError = require_src.PlannerPlanInvalidError;
|
|
44
44
|
exports.PromptNotFoundError = require_src.PromptNotFoundError;
|
|
45
|
+
exports.PromptRefinementError = require_src.PromptRefinementError;
|
|
45
46
|
exports.PromptValidationError = require_src.PromptValidationError;
|
|
46
47
|
exports.ProviderAuthError = require_src.ProviderAuthError;
|
|
47
48
|
exports.ProviderError = require_src.ProviderError;
|
|
@@ -49,6 +50,7 @@ exports.ProviderRateLimitError = require_src.ProviderRateLimitError;
|
|
|
49
50
|
exports.ProviderTimeoutError = require_src.ProviderTimeoutError;
|
|
50
51
|
exports.QuotaExceededError = require_src.QuotaExceededError;
|
|
51
52
|
exports.REPORT_SCHEMA_VERSION = require_src.REPORT_SCHEMA_VERSION;
|
|
53
|
+
exports.RefinedSystemPrompt = require_src.RefinedSystemPrompt;
|
|
52
54
|
exports.RoutingError = require_src.RoutingError;
|
|
53
55
|
exports.SENSITIVE_HEADERS = require_src.SENSITIVE_HEADERS;
|
|
54
56
|
exports.SSE_DONE = require_src.SSE_DONE;
|
|
@@ -25,6 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
}) : target, mod));
|
|
26
26
|
|
|
27
27
|
//#endregion
|
|
28
|
-
require('./src-
|
|
28
|
+
require('./src-DTlN47aO.cjs');
|
|
29
29
|
let _warlock_js_logger = require("@warlock.js/logger");
|
|
30
30
|
require("openai");
|