@ifc-lite/ids-agent 0.0.0-stage → 0.2.1
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/LICENSE +373 -0
- package/README.md +144 -2
- package/dist/bridges.d.ts +163 -0
- package/dist/bridges.d.ts.map +1 -0
- package/dist/bridges.js +6 -0
- package/dist/bridges.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/modes.d.ts +30 -0
- package/dist/modes.d.ts.map +1 -0
- package/dist/modes.js +34 -0
- package/dist/modes.js.map +1 -0
- package/dist/prompts/system-v1.d.ts +19 -0
- package/dist/prompts/system-v1.d.ts.map +1 -0
- package/dist/prompts/system-v1.js +43 -0
- package/dist/prompts/system-v1.js.map +1 -0
- package/dist/proposal/proposal.d.ts +72 -0
- package/dist/proposal/proposal.d.ts.map +1 -0
- package/dist/proposal/proposal.js +60 -0
- package/dist/proposal/proposal.js.map +1 -0
- package/dist/proposal/view-model.d.ts +66 -0
- package/dist/proposal/view-model.d.ts.map +1 -0
- package/dist/proposal/view-model.js +94 -0
- package/dist/proposal/view-model.js.map +1 -0
- package/dist/providers/anthropic.d.ts +45 -0
- package/dist/providers/anthropic.d.ts.map +1 -0
- package/dist/providers/anthropic.js +107 -0
- package/dist/providers/anthropic.js.map +1 -0
- package/dist/providers/openai.d.ts +60 -0
- package/dist/providers/openai.d.ts.map +1 -0
- package/dist/providers/openai.js +92 -0
- package/dist/providers/openai.js.map +1 -0
- package/dist/runner/context.d.ts +21 -0
- package/dist/runner/context.d.ts.map +1 -0
- package/dist/runner/context.js +25 -0
- package/dist/runner/context.js.map +1 -0
- package/dist/runner/loop.d.ts +96 -0
- package/dist/runner/loop.d.ts.map +1 -0
- package/dist/runner/loop.js +194 -0
- package/dist/runner/loop.js.map +1 -0
- package/dist/runner/privacy.d.ts +71 -0
- package/dist/runner/privacy.d.ts.map +1 -0
- package/dist/runner/privacy.js +72 -0
- package/dist/runner/privacy.js.map +1 -0
- package/dist/runner/receipt.d.ts +48 -0
- package/dist/runner/receipt.d.ts.map +1 -0
- package/dist/runner/receipt.js +29 -0
- package/dist/runner/receipt.js.map +1 -0
- package/dist/sandbox/handles.d.ts +22 -0
- package/dist/sandbox/handles.d.ts.map +1 -0
- package/dist/sandbox/handles.js +67 -0
- package/dist/sandbox/handles.js.map +1 -0
- package/dist/sandbox/nodes.d.ts +11 -0
- package/dist/sandbox/nodes.d.ts.map +1 -0
- package/dist/sandbox/nodes.js +38 -0
- package/dist/sandbox/nodes.js.map +1 -0
- package/dist/sandbox/sandbox.d.ts +110 -0
- package/dist/sandbox/sandbox.d.ts.map +1 -0
- package/dist/sandbox/sandbox.js +125 -0
- package/dist/sandbox/sandbox.js.map +1 -0
- package/dist/testing/doubles.d.ts +20 -0
- package/dist/testing/doubles.d.ts.map +1 -0
- package/dist/testing/doubles.js +105 -0
- package/dist/testing/doubles.js.map +1 -0
- package/dist/testing/index.d.ts +8 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +11 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/transports.d.ts +48 -0
- package/dist/testing/transports.d.ts.map +1 -0
- package/dist/testing/transports.js +70 -0
- package/dist/testing/transports.js.map +1 -0
- package/dist/tools/act-tools.d.ts +13 -0
- package/dist/tools/act-tools.d.ts.map +1 -0
- package/dist/tools/act-tools.js +115 -0
- package/dist/tools/act-tools.js.map +1 -0
- package/dist/tools/ask-user.d.ts +3 -0
- package/dist/tools/ask-user.d.ts.map +1 -0
- package/dist/tools/ask-user.js +62 -0
- package/dist/tools/ask-user.js.map +1 -0
- package/dist/tools/bsdd-tools.d.ts +8 -0
- package/dist/tools/bsdd-tools.d.ts.map +1 -0
- package/dist/tools/bsdd-tools.js +64 -0
- package/dist/tools/bsdd-tools.js.map +1 -0
- package/dist/tools/context.d.ts +27 -0
- package/dist/tools/context.d.ts.map +1 -0
- package/dist/tools/context.js +21 -0
- package/dist/tools/context.js.map +1 -0
- package/dist/tools/ids-read.d.ts +26 -0
- package/dist/tools/ids-read.d.ts.map +1 -0
- package/dist/tools/ids-read.js +74 -0
- package/dist/tools/ids-read.js.map +1 -0
- package/dist/tools/index.d.ts +11 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +22 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/model-tools.d.ts +3 -0
- package/dist/tools/model-tools.d.ts.map +1 -0
- package/dist/tools/model-tools.js +100 -0
- package/dist/tools/model-tools.js.map +1 -0
- package/dist/tools/op-schema.d.ts +23 -0
- package/dist/tools/op-schema.d.ts.map +1 -0
- package/dist/tools/op-schema.js +57 -0
- package/dist/tools/op-schema.js.map +1 -0
- package/dist/tools/rank.d.ts +3 -0
- package/dist/tools/rank.d.ts.map +1 -0
- package/dist/tools/rank.js +66 -0
- package/dist/tools/rank.js.map +1 -0
- package/dist/tools/registry.d.ts +59 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +61 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/schema-tools.d.ts +3 -0
- package/dist/tools/schema-tools.d.ts.map +1 -0
- package/dist/tools/schema-tools.js +127 -0
- package/dist/tools/schema-tools.js.map +1 -0
- package/dist/worker-bridge.d.ts +47 -0
- package/dist/worker-bridge.d.ts.map +1 -0
- package/dist/worker-bridge.js +97 -0
- package/dist/worker-bridge.js.map +1 -0
- package/package.json +79 -3
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/**
|
|
5
|
+
* `ids_ask_user`: structured clarification (ADR-008). The model offers 2–4
|
|
6
|
+
* answers, each a ready op batch; the user picks one and that batch is
|
|
7
|
+
* applied to the sandbox like any other. Every choice is checked by the gate
|
|
8
|
+
* BEFORE the user sees it, so the user is never offered an ungrounded
|
|
9
|
+
* answer. Headless runs answer with the first choice.
|
|
10
|
+
*/
|
|
11
|
+
import { checkOps } from '@ifc-lite/ids-authoring';
|
|
12
|
+
import { objectSchema } from './context.js';
|
|
13
|
+
import { agentOpSchema } from './op-schema.js';
|
|
14
|
+
import { applyResult } from './act-tools.js';
|
|
15
|
+
import { defineTool, failure, success } from './registry.js';
|
|
16
|
+
const ASK_USER_MAX_CHOICES = 4;
|
|
17
|
+
const askUser = defineTool({
|
|
18
|
+
name: 'ids_ask_user', group: 'ids', strict: false, readOnly: false,
|
|
19
|
+
description: [
|
|
20
|
+
'Ask the user to choose between 2 to 4 materially different answers, each a ready op batch (may be empty).',
|
|
21
|
+
'Ask only when lookups return two or more candidates that differ in meaning or model counts; otherwise choose and state the assumption in the rationale.',
|
|
22
|
+
'The chosen batch is applied for you; its result is returned.',
|
|
23
|
+
].join(' '),
|
|
24
|
+
inputSchema: objectSchema({
|
|
25
|
+
question: { type: 'string', minLength: 1 },
|
|
26
|
+
choices: {
|
|
27
|
+
type: 'array', minItems: 2,
|
|
28
|
+
items: objectSchema({ label: { type: 'string', minLength: 1 }, rationale: { type: 'string' }, ops: { type: 'array', items: agentOpSchema().op } }, ['label', 'ops']),
|
|
29
|
+
},
|
|
30
|
+
}, ['question', 'choices']),
|
|
31
|
+
defs: agentOpSchema().defs,
|
|
32
|
+
async run(input, ctx) {
|
|
33
|
+
if (input.choices.length > ASK_USER_MAX_CHOICES) {
|
|
34
|
+
return failure('too many choices', { error: `Offer at most ${ASK_USER_MAX_CHOICES} choices.` }, ['ASK:choices']);
|
|
35
|
+
}
|
|
36
|
+
const choices = [];
|
|
37
|
+
for (const [index, choice] of input.choices.entries()) {
|
|
38
|
+
const ops = ctx.sandbox.handles.resolve(choice.ops);
|
|
39
|
+
const gate = checkOps(ops, ctx.sandbox.doc, ctx.gate);
|
|
40
|
+
if (!gate.ok) {
|
|
41
|
+
return failure(`choice ${index} refused by the gate`, {
|
|
42
|
+
error: `Choice ${index} ("${choice.label}") does not pass the gate; fix it before asking.`,
|
|
43
|
+
issues: gate.issues.map((i) => ({ code: i.code, path: i.path, message: i.message, candidates: i.candidates.slice(0, 5).map((c) => c.value) })),
|
|
44
|
+
}, gate.issues.map((i) => `${i.code}:${i.value ?? i.path}`));
|
|
45
|
+
}
|
|
46
|
+
// The gate accepted them, so they are well-formed ops.
|
|
47
|
+
choices.push({ label: choice.label, ...(choice.rationale ? { rationale: choice.rationale } : {}), ops: ops });
|
|
48
|
+
}
|
|
49
|
+
const picked = await ctx.askUser({ id: ctx.callId, question: input.question, choices }, ctx.signal);
|
|
50
|
+
if (picked === null || !choices[picked]) {
|
|
51
|
+
return success('user dismissed the question', { answered: false, note: 'The user did not choose. Record the statement with ids_mark_unresolved (category "ambiguous") or proceed with a stated assumption.' });
|
|
52
|
+
}
|
|
53
|
+
const choice = choices[picked];
|
|
54
|
+
if (choice.ops.length === 0)
|
|
55
|
+
return success(`user chose "${choice.label}"`, { answered: true, choice: picked, label: choice.label, applied: false });
|
|
56
|
+
const outcome = ctx.sandbox.apply(choice.ops, { origin: 'ask_user', rationale: `${input.question} → ${choice.label}`, sources: [] });
|
|
57
|
+
const result = applyResult(outcome, `answer "${choice.label}"`);
|
|
58
|
+
return { ...result, data: { answered: true, choice: picked, label: choice.label, result: result.data } };
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
export const ASK_USER_TOOLS = [askUser];
|
|
62
|
+
//# sourceMappingURL=ask-user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask-user.js","sourceRoot":"","sources":["../../src/tools/ask-user.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAiB,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAE,YAAY,EAA4C,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,aAAa,EAA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AAK,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;IAC3G,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bSDD tools (`05-bsdd.md` §3), over the host's `BsddClient`. Registered only
|
|
3
|
+
* when a client is provided. Only search terms and URIs leave the agent;
|
|
4
|
+
* nothing from the document or the model is sent to the dictionary.
|
|
5
|
+
*/
|
|
6
|
+
import { type IdsAgentTool } from './context.js';
|
|
7
|
+
export declare const BSDD_TOOLS: readonly IdsAgentTool[];
|
|
8
|
+
//# sourceMappingURL=bsdd-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bsdd-tools.d.ts","sourceRoot":"","sources":["../../src/tools/bsdd-tools.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,OAAO,EAA4D,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AA0D3G,eAAO,MAAM,UAAU,EAAE,SAAS,YAAY,EAAgD,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/**
|
|
5
|
+
* bSDD tools (`05-bsdd.md` §3), over the host's `BsddClient`. Registered only
|
|
6
|
+
* when a client is provided. Only search terms and URIs leave the agent;
|
|
7
|
+
* nothing from the document or the model is sent to the dictionary.
|
|
8
|
+
*/
|
|
9
|
+
import { capText, clampLimit, objectSchema } from './context.js';
|
|
10
|
+
import { defineTool, failure, success } from './registry.js';
|
|
11
|
+
function client(ctx) {
|
|
12
|
+
if (!ctx.bsdd)
|
|
13
|
+
throw new Error('bSDD is not available.');
|
|
14
|
+
return ctx.bsdd;
|
|
15
|
+
}
|
|
16
|
+
const URI = { type: 'string', minLength: 1, pattern: '^https?://' };
|
|
17
|
+
const search = defineTool({
|
|
18
|
+
name: 'bsdd_search', group: 'bsdd', strict: true, readOnly: true,
|
|
19
|
+
description: 'Search buildingSMART Data Dictionary classes by text, optionally within one dictionary or related to an IFC entity. Returns class URIs and codes to use as classification values.',
|
|
20
|
+
inputSchema: objectSchema({
|
|
21
|
+
text: { type: 'string', minLength: 1 }, dictionaryUri: URI, relatedIfcEntity: { type: 'string' },
|
|
22
|
+
limit: { type: 'integer', minimum: 1, description: 'At most 20.' },
|
|
23
|
+
}, ['text']),
|
|
24
|
+
async run(input, ctx) {
|
|
25
|
+
const results = await client(ctx).search({ ...input, limit: clampLimit(input.limit, 10, 20) }, ctx.signal);
|
|
26
|
+
return success(`${results.length} bSDD classes for "${input.text}"`, { results: results.slice(0, 20) });
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const classCard = defineTool({
|
|
30
|
+
name: 'bsdd_class', group: 'bsdd', strict: true, readOnly: true,
|
|
31
|
+
description: 'The card of one bSDD class by URI: code, name, dictionary, definition and related IFC entities.',
|
|
32
|
+
inputSchema: objectSchema({ uri: URI }, ['uri']),
|
|
33
|
+
async run(input, ctx) {
|
|
34
|
+
const card = await client(ctx).getClass(input.uri, ctx.signal);
|
|
35
|
+
if (!card)
|
|
36
|
+
return failure('unknown bSDD class', { error: `No bSDD class at ${input.uri}.` }, [`BSDD:${input.uri}`]);
|
|
37
|
+
return success(`bSDD class ${card.code}`, { ...card, ...(card.definition ? { definition: capText(card.definition, 500) } : {}) });
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const properties = defineTool({
|
|
41
|
+
name: 'bsdd_properties', group: 'bsdd', strict: true, readOnly: true,
|
|
42
|
+
description: 'The properties a bSDD class defines: code, name, property set, data type, units and allowed values.',
|
|
43
|
+
inputSchema: objectSchema({ uri: URI }, ['uri']),
|
|
44
|
+
async run(input, ctx) {
|
|
45
|
+
const props = await client(ctx).classProperties(input.uri, ctx.signal);
|
|
46
|
+
return success(`${props.length} bSDD properties`, {
|
|
47
|
+
properties: props.slice(0, 60).map((p) => ({ ...p, ...(p.allowedValues ? { allowedValues: p.allowedValues.slice(0, 40) } : {}),
|
|
48
|
+
...(p.definition ? { definition: capText(p.definition, 200) } : {}) })),
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
const resolveUri = defineTool({
|
|
53
|
+
name: 'bsdd_resolve_uri', group: 'bsdd', strict: true, readOnly: true,
|
|
54
|
+
description: 'Resolve a bSDD URI (class, property or dictionary) to what it identifies.',
|
|
55
|
+
inputSchema: objectSchema({ uri: URI }, ['uri']),
|
|
56
|
+
async run(input, ctx) {
|
|
57
|
+
const resolution = await client(ctx).resolveUri(input.uri, ctx.signal);
|
|
58
|
+
if (resolution.kind === 'unknown')
|
|
59
|
+
return failure('unknown URI', { error: `${input.uri} does not resolve in bSDD.` }, [`BSDD:${input.uri}`]);
|
|
60
|
+
return success(`bSDD ${resolution.kind}`, { ...resolution });
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
export const BSDD_TOOLS = [search, classCard, properties, resolveUri];
|
|
64
|
+
//# sourceMappingURL=bsdd-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bsdd-tools.js","sourceRoot":"","sources":["../../src/tools/bsdd-tools.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAA4C,MAAM,cAAc,CAAC;AAC3G,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7D,SAAS,MAAM,CAAC,GAAqB;IACnC,IAAI,CAAC,GAAG,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACzD,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,C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,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAA4B,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { GateContext } from '@ifc-lite/ids-authoring';
|
|
2
|
+
import type { JsonSchema } from '@ifc-lite/ids-authoring';
|
|
3
|
+
import type { AskUserHandler, BsddClient, ModelBridge } from '../bridges.js';
|
|
4
|
+
import type { Sandbox } from '../sandbox/sandbox.js';
|
|
5
|
+
import type { AgentTool } from './registry.js';
|
|
6
|
+
/** What a tool handler can reach during one call. */
|
|
7
|
+
export interface AgentToolContext {
|
|
8
|
+
readonly sandbox: Sandbox;
|
|
9
|
+
readonly gate: GateContext;
|
|
10
|
+
readonly model?: ModelBridge;
|
|
11
|
+
readonly bsdd?: BsddClient;
|
|
12
|
+
readonly askUser: AskUserHandler;
|
|
13
|
+
readonly signal: AbortSignal;
|
|
14
|
+
/** The provider's id of the call being answered. */
|
|
15
|
+
readonly callId: string;
|
|
16
|
+
}
|
|
17
|
+
export type IdsAgentTool = AgentTool<AgentToolContext>;
|
|
18
|
+
/** IFC versions an IDS specification can name. */
|
|
19
|
+
export declare const IFC_VERSIONS: readonly ["IFC2X3", "IFC4", "IFC4X3_ADD2"];
|
|
20
|
+
export declare const versionSchema: JsonSchema;
|
|
21
|
+
/** A closed object schema (what strict tool use requires). */
|
|
22
|
+
export declare function objectSchema(properties: Record<string, JsonSchema>, required: readonly string[]): JsonSchema;
|
|
23
|
+
/** Clamp a caller-supplied limit; the schema interpreter has no `maximum`. */
|
|
24
|
+
export declare function clampLimit(value: number | undefined, fallback: number, max: number): number;
|
|
25
|
+
/** Cap a string sent to the model (values read from a model are data, never instructions). */
|
|
26
|
+
export declare function capText(value: string, max?: number): string;
|
|
27
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceR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AAM,EAAE,GAAG,SAAM,GAAG,MAAM,CAExD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/** IFC versions an IDS specification can name. */
|
|
5
|
+
export const IFC_VERSIONS = ['IFC2X3', 'IFC4', 'IFC4X3_ADD2'];
|
|
6
|
+
export const versionSchema = { enum: IFC_VERSIONS, description: 'IFC schema version of the specification.' };
|
|
7
|
+
/** A closed object schema (what strict tool use requires). */
|
|
8
|
+
export function objectSchema(properties, required) {
|
|
9
|
+
return { type: 'object', properties, required, additionalProperties: false };
|
|
10
|
+
}
|
|
11
|
+
/** Clamp a caller-supplied limit; the schema interpreter has no `maximum`. */
|
|
12
|
+
export function clampLimit(value, fallback, max) {
|
|
13
|
+
if (value === undefined || !Number.isFinite(value))
|
|
14
|
+
return fallback;
|
|
15
|
+
return Math.max(1, Math.min(max, Math.floor(value)));
|
|
16
|
+
}
|
|
17
|
+
/** Cap a string sent to the model (values read from a model are data, never instructions). */
|
|
18
|
+
export function capText(value, max = 200) {
|
|
19
|
+
return value.length > max ? `${value.slice(0, max)}…` : value;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/tools/context.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAsB/D,kDAAkD;AAClD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAU,CAAC;AAEvE,MAAM,CAAC,MAAM,aAAa,GAAe,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;AAEzH,8DAA8D;AAC9D,MAAM,UAAU,YAAY,CAAC,UAAsC,EAAE,QAA2B;IAC9F,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAC/E,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,UAAU,CAAC,KAAyB,EAAE,QAAgB,EAAE,GAAW;IACjF,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IACpE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,OAAO,CAAC,KAAa,EAAE,GAAG,GAAG,GAAG;IAC9C,OAAO,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type StudioDocument, type Uuid } from '@ifc-lite/ids-authoring';
|
|
2
|
+
import { type IdsAgentTool } from './context.js';
|
|
3
|
+
/** The compact document view used by `ids_read` and by the loop's context block. */
|
|
4
|
+
export declare function summarizeDocument(doc: StudioDocument, specIds?: readonly string[]): {
|
|
5
|
+
title: string;
|
|
6
|
+
specificationCount: number;
|
|
7
|
+
specifications: {
|
|
8
|
+
applicability: {
|
|
9
|
+
facetId: Uuid;
|
|
10
|
+
type: "property" | "entity" | "attribute" | "classification" | "material" | "partOf";
|
|
11
|
+
text: string;
|
|
12
|
+
}[];
|
|
13
|
+
requirements: {
|
|
14
|
+
facetId: Uuid;
|
|
15
|
+
type: "property" | "entity" | "attribute" | "classification" | "material" | "partOf";
|
|
16
|
+
text: string;
|
|
17
|
+
}[];
|
|
18
|
+
identifier?: string | undefined;
|
|
19
|
+
specId: string;
|
|
20
|
+
name: string;
|
|
21
|
+
ifcVersions: import("@ifc-lite/ids").IFCVersion[];
|
|
22
|
+
cardinality: "required" | "optional" | "prohibited";
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
export declare const IDS_READ_TOOLS: readonly IdsAgentTool[];
|
|
26
|
+
//# sourceMappingURL=ids-read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids-read.d.ts","sourceRoot":"","sources":["../../src/tools/ids-read.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAkD,KAAK,cAAc,EAAE,KAAK,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACzH,OAAO,EAAuC,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AA0BtF,oFAAoF;AACpF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE;;;;;qBAJpB,IAAI;;;;;qBAAJ,IAAI;;;;;;;;;;EAmBjE;AAkCD,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAAc,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { describeFacet } from '@ifc-lite/ids-authoring';
|
|
5
|
+
import { objectSchema } from './context.js';
|
|
6
|
+
import { defineTool, success } from './registry.js';
|
|
7
|
+
function cardinality(spec) {
|
|
8
|
+
if (spec.maxOccurs === 0)
|
|
9
|
+
return 'prohibited';
|
|
10
|
+
return (spec.minOccurs ?? 0) > 0 ? 'required' : 'optional';
|
|
11
|
+
}
|
|
12
|
+
function facetLine(facet, section, optionality) {
|
|
13
|
+
return describeFacet(facet, section, optionality ?? 'required', 'en');
|
|
14
|
+
}
|
|
15
|
+
function selected(doc, specIds) {
|
|
16
|
+
const wanted = specIds && specIds.length > 0 ? new Set(specIds) : null;
|
|
17
|
+
return doc.ids.specifications
|
|
18
|
+
.map((spec, i) => ({ spec, nodes: doc.nodes.specs[i] }))
|
|
19
|
+
.filter(({ nodes }) => !wanted || wanted.has(nodes.id));
|
|
20
|
+
}
|
|
21
|
+
function facetEntries(facets, nodes, section, optionalities) {
|
|
22
|
+
return facets.map((facet, i) => ({ facetId: nodes[i]?.id, type: facet.type, text: facetLine(facet, section, optionalities?.[i]) }));
|
|
23
|
+
}
|
|
24
|
+
/** The compact document view used by `ids_read` and by the loop's context block. */
|
|
25
|
+
export function summarizeDocument(doc, specIds) {
|
|
26
|
+
return {
|
|
27
|
+
title: doc.ids.info.title,
|
|
28
|
+
specificationCount: doc.ids.specifications.length,
|
|
29
|
+
specifications: selected(doc, specIds).map(({ spec, nodes }) => ({
|
|
30
|
+
specId: nodes.id,
|
|
31
|
+
name: spec.name,
|
|
32
|
+
ifcVersions: spec.ifcVersions,
|
|
33
|
+
cardinality: cardinality(spec),
|
|
34
|
+
...(spec.identifier ? { identifier: spec.identifier } : {}),
|
|
35
|
+
applicability: facetEntries(spec.applicability.facets, nodes.applicability, 'applicability'),
|
|
36
|
+
requirements: facetEntries(spec.requirements.map((r) => r.facet), nodes.requirements, 'requirements', spec.requirements.map((r) => r.optionality ?? 'required')),
|
|
37
|
+
})),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function fullView(doc, specIds) {
|
|
41
|
+
return {
|
|
42
|
+
info: doc.ids.info,
|
|
43
|
+
specifications: selected(doc, specIds).map(({ spec, nodes }) => ({ nodes, specification: spec })),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function plainView(doc, specIds) {
|
|
47
|
+
const lines = [`IDS "${doc.ids.info.title}"`];
|
|
48
|
+
for (const { spec } of selected(doc, specIds)) {
|
|
49
|
+
lines.push(`- ${spec.name} (${spec.ifcVersions.join(', ')}, ${cardinality(spec)})`);
|
|
50
|
+
for (const f of spec.applicability.facets)
|
|
51
|
+
lines.push(` applies to: ${facetLine(f, 'applicability')}`);
|
|
52
|
+
for (const r of spec.requirements)
|
|
53
|
+
lines.push(` requires: ${facetLine(r.facet, 'requirements', r.optionality ?? 'required')}`);
|
|
54
|
+
}
|
|
55
|
+
return lines.join('\n');
|
|
56
|
+
}
|
|
57
|
+
const idsRead = defineTool({
|
|
58
|
+
name: 'ids_read', group: 'ids', strict: true, readOnly: true,
|
|
59
|
+
description: 'Read the working IDS document. view "summary" lists specifications and facets with their node ids; "full" returns the IDS content of the selected specifications; "plain" returns plain-language sentences.',
|
|
60
|
+
inputSchema: objectSchema({
|
|
61
|
+
view: { enum: ['summary', 'full', 'plain'] },
|
|
62
|
+
specIds: { type: 'array', items: { type: 'string' }, description: 'Restrict to these specification ids.' },
|
|
63
|
+
}, ['view']),
|
|
64
|
+
run(input, ctx) {
|
|
65
|
+
const doc = ctx.sandbox.doc;
|
|
66
|
+
if (input.view === 'plain')
|
|
67
|
+
return success('plain view', { text: plainView(doc, input.specIds) });
|
|
68
|
+
if (input.view === 'full')
|
|
69
|
+
return success('full view', fullView(doc, input.specIds));
|
|
70
|
+
return success('summary view', summarizeDocument(doc, input.specIds));
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
export const IDS_READ_TOOLS = [idsRead];
|
|
74
|
+
//# sourceMappingURL=ids-read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids-read.js","sourceRoot":"","sources":["../../src/tools/ids-read.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAe/D,OAAO,EAAE,aAAa,EAAmE,MAAM,yBAAyB,CAAC;AACzH,OAAO,EAAE,YAAY,EAA4C,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAIpD,SAAS,WAAW,CAAC,IAAsB;IACzC,IAAI,IAAI,CAAC,SAAS,KAAK,CAAC;Q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EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,sCAAsC,EAAE;KAC3G,EAAE,CAAC,MAAM,CAAC,CAAC;IACZ,GAAG,CAAC,KAAK,EAAE,GAAG;QACZ,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC;QAC5B,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO;YAAE,OAAO,OAAO,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAClG,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;YAAE,OAAO,OAAO,CAAC,WAAW,EAAE,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACrF,OAAO,OAAO,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACxE,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** The v1 tool set, assembled per mode and per what the host provides. */
|
|
2
|
+
import type { ModeConfig } from '../modes.js';
|
|
3
|
+
import type { AgentToolContext, IdsAgentTool } from './context.js';
|
|
4
|
+
import { type ToolRegistry } from './registry.js';
|
|
5
|
+
/** Every v1 tool, in the stable order they are offered (prompt caching depends on it). */
|
|
6
|
+
export declare const ALL_TOOLS: readonly IdsAgentTool[];
|
|
7
|
+
export declare function registryFor(mode: ModeConfig, available: {
|
|
8
|
+
model: boolean;
|
|
9
|
+
bsdd: boolean;
|
|
10
|
+
}): ToolRegistry<AgentToolContext>;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAIA,0EAA0E;AAE1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGnE,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAGtE,0FAA0F;AAC1F,eAAO,MAAM,SAAS,EAAE,SAAS,YAAY,EAE5C,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAO1H"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { ACT_TOOLS } from './act-tools.js';
|
|
5
|
+
import { ASK_USER_TOOLS } from './ask-user.js';
|
|
6
|
+
import { BSDD_TOOLS } from './bsdd-tools.js';
|
|
7
|
+
import { IDS_READ_TOOLS } from './ids-read.js';
|
|
8
|
+
import { MODEL_TOOLS } from './model-tools.js';
|
|
9
|
+
import { createToolRegistry } from './registry.js';
|
|
10
|
+
import { SCHEMA_TOOLS } from './schema-tools.js';
|
|
11
|
+
/** Every v1 tool, in the stable order they are offered (prompt caching depends on it). */
|
|
12
|
+
export const ALL_TOOLS = [
|
|
13
|
+
...SCHEMA_TOOLS, ...IDS_READ_TOOLS, ...ACT_TOOLS, ...ASK_USER_TOOLS, ...MODEL_TOOLS, ...BSDD_TOOLS,
|
|
14
|
+
];
|
|
15
|
+
export function registryFor(mode, available) {
|
|
16
|
+
const excluded = new Set(mode.excludeTools ?? []);
|
|
17
|
+
return createToolRegistry(ALL_TOOLS.filter((t) => mode.toolGroups.includes(t.group)
|
|
18
|
+
&& !excluded.has(t.name)
|
|
19
|
+
&& (t.group !== 'model' || available.model)
|
|
20
|
+
&& (t.group !== 'bsdd' || available.bsdd)));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAK/D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAqB,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,0FAA0F;AAC1F,MAAM,CAAC,MAAM,SAAS,GAA4B;IAChD,GAAG,YAAY,EAAE,GAAG,cAAc,EAAE,GAAG,SAAS,EAAE,GAAG,cAAc,EAAE,GAAG,WAAW,EAAE,GAAG,UAAU;CACnG,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,IAAgB,EAAE,SAA4C;IACxF,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;IAClD,OAAO,kBAAkB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAC/C,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;WAC9B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;WACrB,CAAC,CAAC,CAAC,KAAK,KAAK,OAAO,IAAI,SAAS,CAAC,KAAK,CAAC;WACxC,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-tools.d.ts","sourceRoot":"","sources":["../../src/tools/model-tools.ts"],"names":[],"mappings":"AAcA,OAAO,EAA0E,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAgGzH,eAAO,MAAM,WAAW,EAAE,SAAS,YAAY,EAA8C,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { facetFromDraft } from '@ifc-lite/ids-authoring';
|
|
5
|
+
import { capText, clampLimit, objectSchema, IFC_VERSIONS } from './context.js';
|
|
6
|
+
import { agentOpSchema } from './op-schema.js';
|
|
7
|
+
import { defineTool, failure, success } from './registry.js';
|
|
8
|
+
function bridge(ctx) {
|
|
9
|
+
if (!ctx.model)
|
|
10
|
+
throw new Error('No model is loaded.');
|
|
11
|
+
return ctx.model;
|
|
12
|
+
}
|
|
13
|
+
function specFacets(ctx, specId) {
|
|
14
|
+
const index = ctx.sandbox.doc.nodes.specs.findIndex((s) => s.id === specId);
|
|
15
|
+
if (index < 0)
|
|
16
|
+
return null;
|
|
17
|
+
const spec = ctx.sandbox.doc.ids.specifications[index];
|
|
18
|
+
return { applicability: spec.applicability.facets, requirements: spec.requirements.map((r) => r.facet) };
|
|
19
|
+
}
|
|
20
|
+
const stats = defineTool({
|
|
21
|
+
name: 'model_stats', group: 'model', strict: true, readOnly: true,
|
|
22
|
+
description: 'Loaded IFC models: schema, element count, most frequent classes and length unit.',
|
|
23
|
+
inputSchema: objectSchema({}, []),
|
|
24
|
+
async run(_input, ctx) {
|
|
25
|
+
const models = await bridge(ctx).stats(ctx.signal);
|
|
26
|
+
return success(`${models.length} models`, {
|
|
27
|
+
models: models.map((m) => ({ ...m, classes: m.classes.slice(0, 30) })),
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const count = defineTool({
|
|
32
|
+
name: 'model_count', group: 'model', strict: false, readOnly: true,
|
|
33
|
+
description: 'Funnel counts in the loaded models: how many elements remain after each applicability facet. Give a specId (and get its requirement pass/fail preview too) or facets as drafts.',
|
|
34
|
+
inputSchema: objectSchema({
|
|
35
|
+
specId: { type: 'string' },
|
|
36
|
+
applicability: { type: 'array', items: { $ref: '#/$defs/FacetDraft' } },
|
|
37
|
+
ifcVersions: { type: 'array', items: { enum: IFC_VERSIONS } },
|
|
38
|
+
}, []),
|
|
39
|
+
defs: agentOpSchema().defs,
|
|
40
|
+
async run(input, ctx) {
|
|
41
|
+
let query;
|
|
42
|
+
if (input.specId) {
|
|
43
|
+
const facets = specFacets(ctx, input.specId);
|
|
44
|
+
if (!facets)
|
|
45
|
+
return failure('unknown spec', { error: `No specification has id "${input.specId}".` }, [`COUNT:${input.specId}`]);
|
|
46
|
+
query = facets;
|
|
47
|
+
}
|
|
48
|
+
else if (input.applicability && input.applicability.length > 0) {
|
|
49
|
+
query = { applicability: input.applicability.map(facetFromDraft) };
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
return failure('nothing to count', { error: 'Give a specId or at least one applicability facet.' }, ['COUNT:empty']);
|
|
53
|
+
}
|
|
54
|
+
const counts = await bridge(ctx).count({ ...query, ...(input.ifcVersions ? { ifcVersions: input.ifcVersions } : {}) }, ctx.signal);
|
|
55
|
+
return success(`${counts.applicable} applicable`, { ...counts, ...(counts.applicable === 0 ? { warning: 'No element matches; check the applicability against model_stats before finishing.' } : {}) });
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
const distinct = defineTool({
|
|
59
|
+
name: 'model_distinct_values', group: 'model', strict: true, readOnly: true,
|
|
60
|
+
description: 'Distinct values of one property in the loaded models (optionally for one entity), with counts. Capped; long strings are truncated.',
|
|
61
|
+
inputSchema: objectSchema({
|
|
62
|
+
entity: { type: 'string' }, propertySet: { type: 'string', minLength: 1 }, property: { type: 'string', minLength: 1 },
|
|
63
|
+
limit: { type: 'integer', minimum: 1, description: 'At most 50.' },
|
|
64
|
+
}, ['propertySet', 'property']),
|
|
65
|
+
async run(input, ctx) {
|
|
66
|
+
const limit = clampLimit(input.limit, 20, 50);
|
|
67
|
+
const result = await bridge(ctx).distinctValues({ ...input, limit }, ctx.signal);
|
|
68
|
+
const values = result.values.slice(0, limit).map((v) => ({ value: capText(v.value, 120), count: v.count }));
|
|
69
|
+
return success(`${values.length} values of ${input.propertySet}.${input.property}`, {
|
|
70
|
+
values, truncated: result.truncated || result.values.length > limit || values.some((v, i) => v.value !== result.values[i].value),
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
const infer = defineTool({
|
|
75
|
+
name: 'model_infer', group: 'model', strict: true, readOnly: true,
|
|
76
|
+
description: 'Infer applicability and requirement facets from elements: the current selection (selection: "current") or every element of an entity. Each candidate comes with how many examples have it.',
|
|
77
|
+
inputSchema: objectSchema({
|
|
78
|
+
selection: { enum: ['current'] }, entity: { type: 'string' },
|
|
79
|
+
threshold: { type: 'number', minimum: 0, description: 'Share of examples (0..1) that must have a facet; default 1.' },
|
|
80
|
+
}, []),
|
|
81
|
+
async run(input, ctx) {
|
|
82
|
+
if (!input.selection && !input.entity)
|
|
83
|
+
return failure('nothing to infer from', { error: 'Give selection "current" or an entity.' }, ['INFER:empty']);
|
|
84
|
+
const threshold = input.threshold === undefined ? 1 : Math.min(1, input.threshold);
|
|
85
|
+
const result = await bridge(ctx).infer({ ...(input.selection ? { selection: input.selection } : {}), ...(input.entity ? { entity: input.entity } : {}), threshold }, ctx.signal);
|
|
86
|
+
return success(`${result.candidates.length} candidates`, { candidates: result.candidates.slice(0, 40), sampled: result.sampled });
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
const coverage = defineTool({
|
|
90
|
+
name: 'model_coverage', group: 'model', strict: true, readOnly: true,
|
|
91
|
+
description: 'IFC classes in the loaded models that no specification of the working document applies to, by element count.',
|
|
92
|
+
inputSchema: objectSchema({}, []),
|
|
93
|
+
async run(_input, ctx) {
|
|
94
|
+
const applicabilities = ctx.sandbox.doc.ids.specifications.map((s) => s.applicability.facets);
|
|
95
|
+
const classes = await bridge(ctx).coverage({ applicabilities }, ctx.signal);
|
|
96
|
+
return success(`${classes.length} ungoverned classes`, { ungoverned: classes.slice(0, 30) });
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
export const MODEL_TOOLS = [stats, count, distinct, infer, coverage];
|
|
100
|
+
//# sourceMappingURL=model-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-tools.js","sourceRoot":"","sources":["../../src/tools/model-tools.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAW/D,OAAO,EAAE,cAAc,EAAmB,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAA4C,MAAM,cAAc,CAAC;AACzH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAoB,MAAM,eAAe,CAAC;AAE/E,SAAS,MAAM,CAAC,GAAqB;IACnC,IAAI,CAAC,GAAG,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACvD,OAAO,GAAG,CAAC,KAAK,CAAC;AACnB,CAAC;AAED,SAAS,UAAU,CAAC,GAAqB,EAAE,MAAc;IACvD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC;IAC5E,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AAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,eAAe,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QAC5E,OAAO,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,qBAAqB,EAAE,EAAE,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;IAC/F,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAA4B,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The agent's view of the op vocabulary, derived from `getOpJsonSchema()`
|
|
3
|
+
* at load time (never copied by hand):
|
|
4
|
+
*
|
|
5
|
+
* - the fidelity kinds (`*.restore`, `*.patch`) are dropped: the reducer
|
|
6
|
+
* emits them as exact inverses, an author never writes them;
|
|
7
|
+
* - `opId` becomes optional (the sandbox fills it);
|
|
8
|
+
* - a node id may be a handle (`@doors`) as well as a UUID.
|
|
9
|
+
*
|
|
10
|
+
* Everything else, including every payload schema, is the vocabulary's own.
|
|
11
|
+
* The sandbox still validates the RESOLVED ops against the real schema in
|
|
12
|
+
* the gate, so this relaxation cannot let a malformed op through.
|
|
13
|
+
*/
|
|
14
|
+
import { type JsonSchema } from '@ifc-lite/ids-authoring';
|
|
15
|
+
export interface AgentOpSchema {
|
|
16
|
+
/** Schema of one op as the agent may write it: `{ $ref: '#/$defs/AgentOp' }`. */
|
|
17
|
+
op: JsonSchema;
|
|
18
|
+
defs: Record<string, JsonSchema>;
|
|
19
|
+
/** The op kinds the agent may use, in vocabulary order. */
|
|
20
|
+
kinds: string[];
|
|
21
|
+
}
|
|
22
|
+
export declare function agentOpSchema(): AgentOpSchema;
|
|
23
|
+
//# sourceMappingURL=op-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"op-schema.d.ts","sourceRoot":"","sources":["../../src/tools/op-schema.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAM3E,MAAM,WAAW,aAAa;IAC5B,iFAAiF;IACjF,EAAE,EAAE,UAAU,CAAC;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACjC,2DAA2D;IAC3D,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AASD,wBAAgB,aAAa,IAAI,aAAa,CA2B7C"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/**
|
|
5
|
+
* The agent's view of the op vocabulary, derived from `getOpJsonSchema()`
|
|
6
|
+
* at load time (never copied by hand):
|
|
7
|
+
*
|
|
8
|
+
* - the fidelity kinds (`*.restore`, `*.patch`) are dropped: the reducer
|
|
9
|
+
* emits them as exact inverses, an author never writes them;
|
|
10
|
+
* - `opId` becomes optional (the sandbox fills it);
|
|
11
|
+
* - a node id may be a handle (`@doors`) as well as a UUID.
|
|
12
|
+
*
|
|
13
|
+
* Everything else, including every payload schema, is the vocabulary's own.
|
|
14
|
+
* The sandbox still validates the RESOLVED ops against the real schema in
|
|
15
|
+
* the gate, so this relaxation cannot let a malformed op through.
|
|
16
|
+
*/
|
|
17
|
+
import { getOpJsonSchema } from '@ifc-lite/ids-authoring';
|
|
18
|
+
import { FIDELITY_KINDS } from '../sandbox/sandbox.js';
|
|
19
|
+
import { HANDLE_PATTERN } from '../sandbox/handles.js';
|
|
20
|
+
const UUID_BODY = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}';
|
|
21
|
+
function opKind(def) {
|
|
22
|
+
const kind = def.properties?.kind?.const;
|
|
23
|
+
return typeof kind === 'string' ? kind : undefined;
|
|
24
|
+
}
|
|
25
|
+
let cached;
|
|
26
|
+
export function agentOpSchema() {
|
|
27
|
+
if (cached)
|
|
28
|
+
return cached;
|
|
29
|
+
const full = getOpJsonSchema();
|
|
30
|
+
// `getOpJsonSchema` returns plain JSON Schema data built from `JsonSchema` values.
|
|
31
|
+
const source = full.$defs;
|
|
32
|
+
const defs = {};
|
|
33
|
+
const refs = [];
|
|
34
|
+
const kinds = [];
|
|
35
|
+
for (const [name, def] of Object.entries(source)) {
|
|
36
|
+
const kind = name.startsWith('Op_') ? opKind(def) : undefined;
|
|
37
|
+
if (kind === undefined) {
|
|
38
|
+
if (name !== 'StudioOp')
|
|
39
|
+
defs[name] = def;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (FIDELITY_KINDS.has(kind))
|
|
43
|
+
continue;
|
|
44
|
+
defs[name] = { ...def, required: (def.required ?? []).filter((key) => key !== 'opId') };
|
|
45
|
+
refs.push({ $ref: `#/$defs/${name}` });
|
|
46
|
+
kinds.push(kind);
|
|
47
|
+
}
|
|
48
|
+
defs.Uuid = {
|
|
49
|
+
type: 'string',
|
|
50
|
+
pattern: `^(?:${UUID_BODY}|${HANDLE_PATTERN.slice(1, -1)})$`,
|
|
51
|
+
description: 'A node UUID from ids_read, or a handle "@name" for a node created in this run.',
|
|
52
|
+
};
|
|
53
|
+
defs.AgentOp = { oneOf: refs };
|
|
54
|
+
cached = { op: { $ref: '#/$defs/AgentOp' }, defs, kinds };
|
|
55
|
+
return cached;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=op-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"op-schema.js","sourceRoot":"","sources":["../../src/tools/op-schema.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,eAAe,EAAmB,MAAM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