deepclause-sdk 0.0.85 → 0.0.87

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.
@@ -93,6 +93,13 @@ generate_all_strategy_tasks(Request, [Strategy|RestStrategies], [plan{strategy:
93
93
 
94
94
  %% generate_strategy_tasks(+Request, +Strategy, -Steps)
95
95
  generate_strategy_tasks(Request, Strategy, Steps) :-
96
+ ( param(model_info, ModelInfo)
97
+ -> ( get_dict(reasoning, ModelInfo, R), R == true
98
+ -> ReasoningNote = "The execution model supports reasoning. Assign reasoning effort per task: none, low, medium, or high."
99
+ ; ReasoningNote = "The execution model does not support reasoning. Set reasoning to 'none' for all tasks."
100
+ )
101
+ ; ReasoningNote = "Set reasoning to 'none' for all tasks."
102
+ ),
96
103
  task("List 3 to 7 focused execution tasks for this security analysis strategy.
97
104
 
98
105
  Target: {Request}
@@ -100,13 +107,101 @@ Strategy: {Strategy}
100
107
 
101
108
  Each task should be one concrete analysis step. Be specific about what to look for and which files to examine.
102
109
 
103
- Store the list of task descriptions in TaskDescriptions.", list(string(TaskDescriptions))),
104
- build_steps_from_descriptions(TaskDescriptions, Strategy, Steps).
110
+ Available tools (use ONLY these exact names):
111
+ - consult_recipes: Search recipe guidance and conventions
112
+ - search_web: Search the web for advisories, docs, and references
113
+ - search_news: Search recent news for relevant incidents or advisories
114
+ - fetch_url: Fetch a specific advisory or documentation page
115
+ - run_bash: Run grep, find, test, and scanner commands in the workspace
116
+ - ask_user: Ask the user to narrow scope or clarify assumptions
117
+ - inform_user: Send a status update
118
+
119
+ {ReasoningNote}
120
+
121
+ Also specify a recipe query for each task if relevant (NONE otherwise).
122
+
123
+ Return four ordered lists aligned 1:1:
124
+ - TaskDescriptions: plain task descriptions.
125
+ - ToolSpecs: each item must be either ALL or a comma-separated list of exact tool names from the available tools list above.
126
+ - ReasoningSpecs: each item must be exactly one of none, low, medium, high.
127
+ - RecipeSpecs: each item must be either NONE or a recipe query string.
128
+
129
+ Store the ordered task descriptions in TaskDescriptions.
130
+ Store the ordered tool specs in ToolSpecs.
131
+ Store the ordered reasoning specs in ReasoningSpecs.
132
+ Store the ordered recipe specs in RecipeSpecs.", list(string(TaskDescriptions)), list(string(ToolSpecs)), list(string(ReasoningSpecs)), list(string(RecipeSpecs))),
133
+ ( build_steps_from_specs(TaskDescriptions, ToolSpecs, ReasoningSpecs, RecipeSpecs, Steps)
134
+ -> true
135
+ ; fallback_plan_steps_from_strategy(Strategy, Steps)
136
+ ).
137
+
138
+ valid_plan_tool(consult_recipes).
139
+ valid_plan_tool(search_web).
140
+ valid_plan_tool(search_news).
141
+ valid_plan_tool(fetch_url).
142
+ valid_plan_tool(run_bash).
143
+ valid_plan_tool(ask_user).
144
+ valid_plan_tool(inform_user).
145
+
146
+ default_plan_tools([consult_recipes, search_web, search_news, fetch_url, run_bash, ask_user, inform_user]).
147
+
148
+ build_steps_from_specs([], [], [], [], []).
149
+ build_steps_from_specs([Desc|RestDesc], [ToolSpec|RestTools], [ReasoningSpec|RestReasoning], [RecipeSpec|RestRecipes], [plan_step{description: Desc, tools: Tools, reasoning: Reasoning, recipe: Recipe}|RestSteps]) :-
150
+ normalize_tools_spec(ToolSpec, Tools),
151
+ normalize_reasoning_spec(ReasoningSpec, Reasoning),
152
+ normalize_recipe_spec(RecipeSpec, Recipe),
153
+ build_steps_from_specs(RestDesc, RestTools, RestReasoning, RestRecipes, RestSteps).
154
+
155
+ normalize_tools_spec(Raw, Tools) :-
156
+ format(string(Text), "~w", [Raw]),
157
+ string_lower(Text, Lower),
158
+ ( Lower = "all"
159
+ -> default_plan_tools(Tools)
160
+ ; split_string(Text, ",", " []\t\n", Parts0),
161
+ include(non_empty_string, Parts0, Parts),
162
+ findall(ToolAtom,
163
+ ( member(Part, Parts),
164
+ tool_name_string_to_atom(Part, ToolAtom),
165
+ valid_plan_tool(ToolAtom)
166
+ ),
167
+ ValidTools),
168
+ ( ValidTools = []
169
+ -> default_plan_tools(Tools)
170
+ ; Tools = ValidTools
171
+ )
172
+ ).
173
+
174
+ normalize_reasoning_spec(Raw, Reasoning) :-
175
+ format(string(Text), "~w", [Raw]),
176
+ string_lower(Text, Lower),
177
+ normalize_reasoning_label(Lower, Reasoning).
178
+
179
+ normalize_reasoning_label("high", "high").
180
+ normalize_reasoning_label("medium", "medium").
181
+ normalize_reasoning_label("low", "low").
182
+ normalize_reasoning_label("none", "none").
183
+ normalize_reasoning_label(_, "none").
184
+
185
+ normalize_recipe_spec(Raw, Recipe) :-
186
+ format(string(Text0), "~w", [Raw]),
187
+ normalize_space(string(Text), Text0),
188
+ string_lower(Text, Lower),
189
+ ( Lower = ""
190
+ -> Recipe = "none"
191
+ ; Lower = "none"
192
+ -> Recipe = "none"
193
+ ; Recipe = Text
194
+ ).
195
+
196
+ tool_name_string_to_atom(Text, Atom) :-
197
+ string_lower(Text, Lower),
198
+ atom_string(Atom, Lower).
105
199
 
106
- %% build_steps_from_descriptions(+Descriptions, +Strategy, -Steps)
107
- build_steps_from_descriptions([], _, []).
108
- build_steps_from_descriptions([Desc|Rest], Strategy, [plan_step{description: Desc, tools: all, reasoning: "none", recipe: "none"}|RestSteps]) :-
109
- build_steps_from_descriptions(Rest, Strategy, RestSteps).
200
+ non_empty_string(Text) :-
201
+ Text \= "".
202
+
203
+ fallback_plan_steps_from_strategy(Strategy, [plan_step{description: Strategy, tools: Tools, reasoning: "none", recipe: "none"}]) :-
204
+ default_plan_tools(Tools).
110
205
 
111
206
  %% assemble_multi_strategy_dml(+StrategyPlans, -PlanDml)
112
207
  assemble_multi_strategy_dml(StrategyPlans, PlanDml) :-
@@ -156,7 +251,19 @@ build_single_task_line(Step, Num, PrevSum, Line) :-
156
251
  Desc = Step.description,
157
252
  format(string(VarName), "Sum~w", [Num]),
158
253
  format(string(DescWithCtx), "~w. Store your findings summary in ~w.", [Desc, VarName]),
159
- format(string(Line), " task(~q, string(~w)),~n", [DescWithCtx, VarName]).
254
+ Tools = Step.tools,
255
+ Reasoning = Step.reasoning,
256
+ Recipe = Step.recipe,
257
+ format(string(BaseTask), "task(~q, string(~w))", [DescWithCtx, VarName]),
258
+ format(string(WithTools), "with_tools(~w, ~w)", [Tools, BaseTask]),
259
+ ( Reasoning \= "none"
260
+ -> format(string(WithReasoning), "with_reasoning(~n ~w~n , ~w)", [WithTools, Reasoning])
261
+ ; WithReasoning = WithTools
262
+ ),
263
+ ( Recipe \= "none"
264
+ -> format(string(Line), " with_recipe(~n ~w~n , '~w'),~n", [WithReasoning, Recipe])
265
+ ; format(string(Line), " ~w,~n", [WithReasoning])
266
+ ).
160
267
 
161
268
  %% build_review_message(+FilePath, +StrategyPlans, -ReviewMessage)
162
269
  build_review_message(FilePath, StrategyPlans, ReviewMessage) :-
package/dist/types.d.ts CHANGED
@@ -34,6 +34,47 @@ export interface CreateOptions {
34
34
  reasoningBudgetMap?: Record<string, number>;
35
35
  /** Model context window in tokens (from model database) */
36
36
  contextWindow?: number;
37
+ /** Host-provided LLM backend. When set, no provider credentials or environment variables are used. */
38
+ llmBackend?: LLMBackend;
39
+ }
40
+ export interface LLMBackendMessage {
41
+ role: 'system' | 'user' | 'assistant' | 'tool';
42
+ content: string;
43
+ toolCalls?: LLMBackendToolCall[];
44
+ toolCallId?: string;
45
+ toolName?: string;
46
+ /** Opaque host-native message used to preserve provider state across backend calls. */
47
+ providerData?: unknown;
48
+ }
49
+ export interface LLMBackendTool {
50
+ name: string;
51
+ description: string;
52
+ parameters: Record<string, unknown>;
53
+ }
54
+ export interface LLMBackendToolCall {
55
+ id: string;
56
+ name: string;
57
+ arguments: Record<string, unknown>;
58
+ }
59
+ export interface LLMBackendRequest {
60
+ messages: LLMBackendMessage[];
61
+ tools?: LLMBackendTool[];
62
+ temperature?: number;
63
+ maxTokens?: number;
64
+ signal?: AbortSignal;
65
+ /** Receives model text as it becomes available. Backends may emit one final chunk. */
66
+ onText?: (chunk: string) => void;
67
+ }
68
+ export interface LLMBackendResponse {
69
+ text: string;
70
+ toolCalls?: LLMBackendToolCall[];
71
+ usage?: LLMUsage;
72
+ finishReason?: 'stop' | 'length' | 'tool_use' | 'error' | 'aborted';
73
+ /** Opaque host-native assistant message to replay on a subsequent backend call. */
74
+ providerData?: unknown;
75
+ }
76
+ export interface LLMBackend {
77
+ complete(request: LLMBackendRequest): Promise<LLMBackendResponse>;
37
78
  }
38
79
  export type CompactorSourceType = 'inline' | 'file' | 'auto';
39
80
  export type CompactionScope = 'session' | 'loop' | 'run';
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,YAAY,CAAC;IAC5D,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kEAAkE;IAClE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0GAA0G;IAE1G,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IACtD,wEAAwE;IACxE,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,gEAAgE;IAChE,aAAa,CAAC,EAAE,OAAO,mCAAmC,EAAE,aAAa,CAAC;IAC1E,6DAA6D;IAC7D,kBAAkB,CAAC,EAAE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ED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,CAAC,CAAC,SAAS,CAAC;CACzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepclause-sdk",
3
- "version": "0.0.85",
3
+ "version": "0.0.87",
4
4
  "description": "DeepClause CLI Tool, TUI and Typescript SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -54,12 +54,12 @@
54
54
  "@types/node": "^20.0.0",
55
55
  "@typescript-eslint/eslint-plugin": "^7.0.0",
56
56
  "@typescript-eslint/parser": "^7.0.0",
57
- "@vitest/coverage-v8": "^2.0.0",
57
+ "@vitest/coverage-v8": "^4.1.10",
58
58
  "eslint": "^8.57.0",
59
59
  "memfs": "^4.56.10",
60
60
  "tsx": "^4.21.0",
61
61
  "typescript": "^5.5.0",
62
- "vitest": "^2.0.0"
62
+ "vitest": "^4.1.10"
63
63
  },
64
64
  "engines": {
65
65
  "node": ">=18.0.0"
@@ -562,7 +562,7 @@ process_engine_result(output(Text), output, Text, none) :- !.
562
562
  process_engine_result(log(Text), log, Text, none) :- !.
563
563
  process_engine_result(answer(Text), answer, Text, none) :- !.
564
564
  %% Note: Memory and tool scope are now passed in the payload for the agent loop
565
- process_engine_result(request_agent_loop(Desc, Vars, Tools, Memory, ToolScope, ReasoningEffort, RecipeContext), request_agent_loop, '',
565
+ process_engine_result(request_agent_loop(Desc, Vars, Tools, Memory, ToolScope, ReasoningEffort, RecipeContext), request_agent_loop, '',
566
566
  payload{taskDescription: Desc, outputVars: Vars, userTools: Tools, memory: Memory, toolScope: ToolScope, reasoningEffort: ReasoningEffort, recipeContext: RecipeContext}) :- !.
567
567
  %% Legacy 5-arg format (no reasoning/recipe)
568
568
  process_engine_result(request_agent_loop(Desc, Vars, Tools, Memory, ToolScope), request_agent_loop, '',
@@ -779,9 +779,9 @@ get_reasoning_effort(State, Effort) :-
779
779
  %% Recipe Context Helpers
780
780
  %% ============================================================
781
781
 
782
- %% load_recipe_content(+Query, -Content)
783
- load_recipe_content(Query, RecipeContent) :-
784
- exec(consult_recipes(query: Query, max_results: 1), Result),
782
+ %% load_recipe_content(+Query, +StateIn, -StateOut, -Content)
783
+ load_recipe_content(Query, StateIn, StateOut, RecipeContent) :-
784
+ mi_call(exec(consult_recipes(query: Query, max_results: 1), Result), StateIn, StateOut),
785
785
  get_dict(matches, Result, Matches),
786
786
  ( Matches = [Match|_]
787
787
  -> get_dict(content, Match, RecipeContent)
@@ -1484,8 +1484,8 @@ mi_call(with_reasoning(Goal, Effort), StateIn, StateOut) :-
1484
1484
  %% Run Goal with a recipe loaded as transient context (not persisted to memory).
1485
1485
  mi_call(with_recipe(Goal, Query), StateIn, StateOut) :-
1486
1486
  !,
1487
- load_recipe_content(Query, RecipeContent),
1488
- set_recipe_context(StateIn, RecipeContent, ScopedState),
1487
+ load_recipe_content(Query, StateIn, StateAfterRecipeLoad, RecipeContent),
1488
+ set_recipe_context(StateAfterRecipeLoad, RecipeContent, ScopedState),
1489
1489
  mi_call(Goal, ScopedState, StateWithRecipe),
1490
1490
  clear_recipe_context(StateWithRecipe, StateOut).
1491
1491
 
@@ -1,6 +0,0 @@
1
- agent_main :-
2
- param(compact_reason, Reason),
3
- param(compact_source_markdown, SourceMarkdown),
4
- system("You compress older DeepClause task history into a compact working-memory summary. Preserve user goals, decisions, outputs, files, constraints, and unresolved next steps. Keep the answer dense and concise. Return only summary text."),
5
- task("Summarize this prior run history for memory compaction.\n\nReason: {Reason}\n\n{SourceMarkdown}\n\nPreserve:\n- the user's overall goal\n- completed subtasks and important outcomes\n- files, artifacts, commands, or external resources that matter later\n- constraints, assumptions, unresolved issues, and next steps\n\nReturn only the summary text.", string(Summary)),
6
- answer(Summary).
@@ -1,253 +0,0 @@
1
- # swipl-wasm
2
-
3
- SWI-Prolog WebAssembly build as a NPM package. Please see this page
4
- for ongoing progress and information:
5
- <https://swi-prolog.discourse.group/t/swi-prolog-in-the-browser-using-wasm/5650>
6
-
7
- ## Quickly Getting Started
8
-
9
- The easiest way to get started is my importing swipl-wasm into your npm project.
10
- It imported for both node and browser builds as follows:
11
-
12
- script.mjs
13
- ```js
14
- import SWIPL from "swipl-wasm";
15
-
16
- async function main() {
17
- const swipl = await SWIPL({ arguments: ["-q"] });
18
- console.log(swipl.prolog.query("member(X, [a, b, c]).").once().X);
19
- }
20
-
21
- main();
22
- ```
23
-
24
- For those who have not done this before you will first need to [install node and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
25
- After doing this you can make a new project as follows:
26
-
27
- ```bash
28
- # Make the project directory
29
- mkdir my-swipl-project && cd ./my-swipl-project
30
- # Initialise the project
31
- npm init
32
- # Install swipl-wasm
33
- npm i swipl-wasm
34
- ```
35
-
36
- After this place the above code in `script.mjs` in the root of your directory and run `node script.mjs`
37
- to run the script.
38
-
39
- ## Usage
40
-
41
- In browser:
42
-
43
- ```html
44
- <div id="solution"></div>
45
- <script src="/dist/swipl/swipl-web.js"></script>
46
- <script>
47
- (async () => {
48
- const swipl = await SWIPL({
49
- arguments: ["-q"],
50
- locateFile: (path) => {
51
- return `/dist/swipl/${path}`;
52
- },
53
- });
54
- const query = "member(X, [a, b, c]).";
55
- const solutionElement = document.getElementById("solution");
56
- const firstSolution = swipl.prolog.query(query).once().X;
57
- solutionElement.textContent = firstSolution;
58
- })();
59
- </script>
60
- ```
61
-
62
- The function `locateFile` will help the browser to find the necessary
63
- files (`swipl-web.wasm` and `swipl-web.data`). In this case the files
64
- should be served along with `swipl-web.js` under the `/dist/swipl`
65
- directory in the web server.
66
-
67
- You can run this example by executing `npm run test:serve-http` and
68
- visiting <http://localhost:8080/examples/browser.html>.
69
-
70
- In Nodejs:
71
-
72
- ```js
73
- const SWIPL = require("swipl-wasm");
74
-
75
- const swipl = await SWIPL({ arguments: ["-q"] });
76
- console.log(swipl.prolog.query("member(X, [a, b, c]).").once().X);
77
- ```
78
-
79
- You can run this example with `node examples/run-on-node.js`.
80
-
81
- ## Using single-file bundle
82
-
83
- The `swipl-wasm` package comes also with the single-file bundle. This does not
84
- require distributing the `.data` and `.wasm` files which are now embedded into
85
- the `.js` file instead.
86
-
87
- ```html
88
- <div id="solution"></div>
89
- <script src="/dist/swipl/swipl-bundle.js"></script>
90
- <script>
91
- (async () => {
92
- const swipl = await SWIPL({ arguments: ["-q"] });
93
- const query = "member(X, [a, b, c]).";
94
- const solutionElement = document.getElementById("solution");
95
- const firstSolution = swipl.prolog.query(query).once().X;
96
- solutionElement.textContent = firstSolution;
97
- })();
98
- </script>
99
- ```
100
-
101
- ## Generating an image
102
-
103
- Often you will want to bundle a pre-built image of your Prolog file. The easiest way to do this is using the `swipl-generate` command to generate the image. For example in `./examples/generation` the script: `swipl-generate ./max.pl ./dist/max.ts` will generate a file `./dist/max.ts` which contains the image of `./max.pl`. This file can then be imported into your project and used as follows:
104
-
105
- ```ts
106
- import SWIPL from './max';
107
-
108
- async function main() {
109
- const Module = await SWIPL();
110
- const res = Module.prolog.query('max(1, 2, 3).');
111
- console.log(res.next())
112
- }
113
-
114
- main();
115
- ```
116
-
117
- Note that this procedure generates a file which imports directly from `swipl-wasm/dist/loadImageDefault`, so make sure that `swipl-wasm` is a direct dependency in your project rather than a dev dependency.
118
-
119
- To generate the image data without it pre-loaded into `SWIPL` use the `--image-only` flag.
120
-
121
- ## Running JavaScript from Prolog
122
-
123
- This uses `eval`:
124
-
125
- ```js
126
- swipl.prolog
127
- .query("js_run_script(Script)", {
128
- Script: `console.log('hello')`,
129
- })
130
- .once();
131
- ```
132
-
133
- ## Using with Webpack
134
-
135
- [Webpack](https://webpack.js.org/) is a JavaScript and resources
136
- bundler for large-scale frontend projects.
137
-
138
- There is an example Webpack project in `examples/webpack`. It uses
139
- [Asset Modules](https://webpack.js.org/guides/asset-modules/) to "load"
140
- necessary `.data` and `.wasm` files. The location of these files and then
141
- fed to `locateFile` (see above).
142
-
143
- The package `swipl-wasm` is linked into the example. In an actual project
144
- you would declare `swipl-wasm` as a normal dependency.
145
-
146
- To start the example:
147
-
148
- ```
149
- cd examples/webpack
150
- npm install
151
- npm build
152
- npm run server
153
- ```
154
-
155
- and visit <http://127.0.0.1:8080>. You should see the message "Hello world from
156
- Prolog".
157
-
158
-
159
- ## Browser Builds
160
-
161
- For convenience we provide deploy bundled versions of the SWI-Prolog on github pages which can be directly used in an HTML document.
162
-
163
- There is a bundled version for each release - which can be found at the url:
164
- <p align=center>
165
- https://SWI-Prolog.github.io/npm-swipl-wasm/vMajor/vMinor/vPatch/index.js
166
-
167
- for instance v3.3.0 has the url https://SWI-Prolog.github.io/npm-swipl-wasm/3/3/0/index.js. We also have shortcuts for:
168
- - the latest version https://SWI-Prolog.github.io/npm-swipl-wasm/latest/index.js,
169
- - the latest of each major version https://SWI-Prolog.github.io/npm-swipl-wasm/vMajor/latest/index.js, and
170
- - the latest of each minor version https://SWI-Prolog.github.io/npm-swipl-wasm/vMajor/vMinor/latest/index.js
171
-
172
- Available versions can be browsed at https://github.com/SWI-Prolog/npm-swipl-wasm/tree/pages.
173
-
174
- With this approach the following script will work
175
-
176
- ```html
177
- <div id="solution"></div>
178
- <script src="https://SWI-Prolog.github.io/npm-swipl-wasm/3/3/0/index.js"></script>
179
- <script>
180
- (async () => {
181
- const swipl = await SWIPL({ arguments: ["-q"] });
182
- const query = "member(X, [a, b, c]).";
183
- const solutionElement = document.getElementById("solution");
184
- const firstSolution = swipl.prolog.query(query).once().X;
185
- solutionElement.textContent = firstSolution;
186
- })();
187
- </script>
188
- ```
189
-
190
- Dynamic imports are also available with the `dynamic-import.js` import name and can be used as follows:
191
-
192
- ```html
193
- <div id="solution"></div>
194
- <script>
195
- (async () => {
196
- const { SWIPL } = await import("https://SWI-Prolog.github.io/npm-swipl-wasm/3/3/0/dynamic-import.js");
197
- const swipl = await SWIPL({ arguments: ["-q"] });
198
- const query = "member(X, [a, b, c]).";
199
- const solutionElement = document.getElementById("solution");
200
- const firstSolution = swipl.prolog.query(query).once().X;
201
- solutionElement.textContent = firstSolution;
202
- })();
203
- </script>
204
- ```
205
-
206
- ## Build
207
-
208
- The package can be built using npm. Please use npm to
209
- add new dependencies and update package-lock.json file. SWI-Prolog WebAssembly
210
- version is currently built inside Docker with Emscripten.
211
-
212
- ### Development
213
-
214
- To develop with this package, clone the repository and run:
215
-
216
- ```
217
- # Install dependencies
218
- npm ci
219
- # Build the WebAssembly
220
- npm run build
221
- # Run tests
222
- npm t
223
- ```
224
-
225
- *Note* You need Docker and Node 16 or higher to installed build the package.
226
-
227
- ## Versioning
228
-
229
- The package uses its own versioning scheme using semver. It is
230
- detached from the versioning of SWI-Prolog itself.
231
-
232
- To get the underlying SWI-Prolog version:
233
-
234
- ```js
235
- const swipl = await SWIPL({ arguments: ["-q"] });
236
- const version = swipl.prolog
237
- .query("current_prolog_flag(version, Version)")
238
- .once().Version;
239
- ```
240
-
241
- The version is returned as integer `10000 × Major + 100 × Minor + Patch`.
242
-
243
- ## TODO
244
-
245
- - Integrate with SWI-Prolog CI
246
- - TypeScript types for Prolog.js (and the Query interface)
247
- - Use EcmaScript modules as output:
248
- <https://github.com/emscripten-core/emscripten/issues/11792>
249
-
250
- ## License
251
-
252
- Same as SWI-Prolog license, BSD simplified:
253
- <https://github.com/SWI-Prolog/swipl-devel/blob/master/LICENSE>