@mmon-co/ncept-default-theory 3.0.11 → 3.0.13

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.
@@ -44,7 +44,7 @@ export interface EvaluationToolInput {
44
44
  readonly input: CatalogArguments;
45
45
  }
46
46
  export interface MaterialToolInput {
47
- readonly op: "add" | "add-many" | "edit" | "remove" | "open" | "command";
47
+ readonly op: "add" | "add-many" | "edit" | "remove" | "open" | "open-many" | "command";
48
48
  /** Existing Playground identities remain the stored Material kinds. */
49
49
  readonly kind: string;
50
50
  readonly input: CatalogArguments;
package/dist/chat.d.ts CHANGED
@@ -14,6 +14,11 @@ type Recommendation = ProductDocument & {
14
14
  readonly raiseWhen: string;
15
15
  readonly documentUrl: string;
16
16
  };
17
+ /** Only an unambiguous official title can identify the intended link. */
18
+ export declare function officialDocumentLinks(ctx: ChatContext<DefaultState>): Map<string, {
19
+ url: string;
20
+ materialUrl: string;
21
+ }>;
17
22
  export declare function documentListing(ctx: ChatContext<DefaultState>): {
18
23
  documents: ProductDocument[];
19
24
  candidates: Recommendation[];
package/dist/chat.js CHANGED
@@ -82,6 +82,22 @@ function recommendableAffordances(ctx, documents) {
82
82
  return [{ ...document, raiseWhen, documentUrl }];
83
83
  });
84
84
  }
85
+ /** Only an unambiguous official title can identify the intended link. */
86
+ export function officialDocumentLinks(ctx) {
87
+ const links = new Map();
88
+ const seen = new Set();
89
+ for (const { node, label, documentId } of officialDocuments(ctx)) {
90
+ if (seen.has(label)) {
91
+ links.delete(label);
92
+ continue;
93
+ }
94
+ seen.add(label);
95
+ const url = docsUrl(ctx, node);
96
+ if (url)
97
+ links.set(label, { url, materialUrl: "/ncept/playgrounds/document?material=" + documentId });
98
+ }
99
+ return links;
100
+ }
85
101
  export function documentListing(ctx) {
86
102
  const documents = officialDocuments(ctx);
87
103
  return { documents, candidates: recommendableAffordances(ctx, documents) };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmon-co/ncept-default-theory",
3
- "version": "3.0.11",
3
+ "version": "3.0.13",
4
4
  "license": "FSL-1.1-ALv2",
5
5
  "repository": {
6
6
  "type": "git",