@deepagents/context 0.29.1 → 0.30.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.
@@ -4,7 +4,10 @@ import type { ContextFragment } from '../fragments.ts';
4
4
  *
5
5
  * A domain-agnostic set of reasoning principles that teach an LLM
6
6
  * how to plan, assess risk, form hypotheses, adapt, and verify before acting.
7
- * Based on advanced prompt engineering research for agentic systems.
7
+ *
8
+ * Adapted from Google's Gemini API prompting strategies documentation.
9
+ *
10
+ * @see https://ai.google.dev/gemini-api/docs/prompting-strategies
8
11
  *
9
12
  * @example
10
13
  * ```ts
@@ -14,4 +17,32 @@ import type { ContextFragment } from '../fragments.ts';
14
17
  * ```
15
18
  */
16
19
  export declare function reasoningFramework(): ContextFragment[];
20
+ /**
21
+ * Pre-return self-critique fragment.
22
+ *
23
+ * Instructs the model to review its output against a set of checks
24
+ * before returning the final response. Reduces hallucination and
25
+ * improves alignment with user intent.
26
+ *
27
+ * Adapted from Google's Gemini API prompting strategies documentation.
28
+ *
29
+ * @see https://ai.google.dev/gemini-api/docs/prompting-strategies
30
+ *
31
+ * @param checks - Validation questions the model asks itself. Defaults to intent, grounding, and format checks.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * import { selfCritique } from '@deepagents/context';
36
+ *
37
+ * // Use defaults
38
+ * context.set(selfCritique());
39
+ *
40
+ * // Custom checks
41
+ * context.set(selfCritique([
42
+ * 'Does the SQL only use tables that exist in the schema?',
43
+ * 'Did I avoid adding columns not requested by the user?',
44
+ * ]));
45
+ * ```
46
+ */
47
+ export declare function selfCritique(checks?: string[]): ContextFragment;
17
48
  //# sourceMappingURL=reasoning.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reasoning.d.ts","sourceRoot":"","sources":["../../../src/lib/fragments/reasoning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIvD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,EAAE,CA+HtD"}
1
+ {"version":3,"file":"reasoning.d.ts","sourceRoot":"","sources":["../../../src/lib/fragments/reasoning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIvD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,EAAE,CA+HtD;AAQD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAC1B,MAAM,GAAE,MAAM,EAAiC,GAC9C,eAAe,CASjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepagents/context",
3
- "version": "0.29.1",
3
+ "version": "0.30.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,13 +38,13 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@ai-sdk/groq": "^3.0.29",
41
- "@deepagents/agent": "0.29.1",
41
+ "@deepagents/agent": "0.30.0",
42
42
  "ai": "^6.0.116",
43
- "bash-tool": "^1.3.14",
43
+ "bash-tool": "^1.3.15",
44
44
  "chalk": "^5.6.0",
45
45
  "dedent": "^1.7.0",
46
46
  "gpt-tokenizer": "^3.4.0",
47
- "just-bash": "^2.10.0",
47
+ "just-bash": "^2.14.0",
48
48
  "lodash-es": "^4.17.21",
49
49
  "nano-spawn": "^2.0.0",
50
50
  "openai": "^6.25.0",