@agimon-ai/po-help 0.0.0-alpha.104 → 0.0.0-alpha.105

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.
@@ -2,13 +2,160 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
+ let _agimon_ai_po_core_apiContracts = require("@agimon-ai/po-core/apiContracts");
6
+ let typebox = require("typebox");
5
7
  //#region src/schemas/apiContracts.ts
6
- /** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
7
- const apiContracts = (0, require("@agimon-ai/po-core/apiContracts").defineApiContract)({
8
+ const level = typebox.Type.Union([
9
+ typebox.Type.Literal("global"),
10
+ typebox.Type.Literal("workspace"),
11
+ typebox.Type.Literal("session")
12
+ ]);
13
+ const scope = typebox.Type.Object({
14
+ id: typebox.Type.String(),
15
+ level
16
+ });
17
+ const nullableString = typebox.Type.Union([typebox.Type.String(), typebox.Type.Null()]);
18
+ const owner = typebox.Type.Object({
19
+ kind: typebox.Type.Union([
20
+ typebox.Type.Literal("host"),
21
+ typebox.Type.Literal("package"),
22
+ typebox.Type.Literal("unknown")
23
+ ]),
24
+ packageName: nullableString,
25
+ origin: typebox.Type.Union([
26
+ typebox.Type.Literal("po"),
27
+ typebox.Type.Literal("personal"),
28
+ typebox.Type.Literal("unknown")
29
+ ])
30
+ });
31
+ const kind = typebox.Type.Union([typebox.Type.Literal("data"), typebox.Type.Literal("component")]);
32
+ const placement = typebox.Type.Union([typebox.Type.Literal("verified"), typebox.Type.Literal("unverified")]);
33
+ const web = typebox.Type.Object({
34
+ version: typebox.Type.Literal(1),
35
+ slots: typebox.Type.Array(typebox.Type.Object({
36
+ name: typebox.Type.String(),
37
+ scope: level,
38
+ description: typebox.Type.Optional(typebox.Type.String()),
39
+ parent: typebox.Type.Optional(typebox.Type.String()),
40
+ kind
41
+ })),
42
+ fills: typebox.Type.Array(typebox.Type.Object({
43
+ id: typebox.Type.String(),
44
+ slot: nullableString,
45
+ scope: level,
46
+ placement
47
+ })),
48
+ diagnostics: typebox.Type.Array(typebox.Type.String())
49
+ });
50
+ const base = {
51
+ scope,
52
+ scopes: typebox.Type.Array(scope),
53
+ diagnostics: typebox.Type.Array(typebox.Type.String())
54
+ };
55
+ const services = typebox.Type.Object({
56
+ ...base,
57
+ packages: typebox.Type.Array(typebox.Type.Object({
58
+ scope,
59
+ owner,
60
+ web: typebox.Type.Union([web, typebox.Type.Null()])
61
+ })),
62
+ clientPackages: typebox.Type.Optional(typebox.Type.Array(typebox.Type.Object({
63
+ scope,
64
+ owner,
65
+ web: typebox.Type.Union([web, typebox.Type.Null()])
66
+ }))),
67
+ services: typebox.Type.Array(typebox.Type.Object({
68
+ id: typebox.Type.String(),
69
+ name: typebox.Type.String(),
70
+ scope,
71
+ visibleFrom: scope,
72
+ owner,
73
+ public: typebox.Type.Boolean(),
74
+ description: nullableString
75
+ })),
76
+ consumers: typebox.Type.Array(typebox.Type.Object({
77
+ id: typebox.Type.String(),
78
+ name: typebox.Type.String(),
79
+ scope,
80
+ owner
81
+ })),
82
+ edges: typebox.Type.Array(typebox.Type.Object({
83
+ consumer: typebox.Type.String(),
84
+ service: nullableString,
85
+ name: typebox.Type.String(),
86
+ status: typebox.Type.Union([typebox.Type.Literal("resolved"), typebox.Type.Literal("waiting")])
87
+ }))
88
+ });
89
+ const slots = typebox.Type.Object({
90
+ ...base,
91
+ slots: typebox.Type.Array(typebox.Type.Object({
92
+ id: typebox.Type.String(),
93
+ name: typebox.Type.String(),
94
+ scope,
95
+ owner,
96
+ description: nullableString,
97
+ parent: nullableString,
98
+ kind
99
+ })),
100
+ fills: typebox.Type.Array(typebox.Type.Object({
101
+ id: typebox.Type.String(),
102
+ slot: nullableString,
103
+ scope,
104
+ owner,
105
+ placement
106
+ }))
107
+ });
108
+ const brainSimulationSchema = typebox.Type.Object({ enabled: typebox.Type.Boolean() }, { additionalProperties: false });
109
+ const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
8
110
  version: 1,
9
- http: [],
10
111
  sockets: [],
11
- dynamic: []
112
+ dynamic: [],
113
+ http: [...["workspace", "session"].flatMap((scope) => [{
114
+ id: `brain.${scope}.simulation`,
115
+ scope,
116
+ basePath: "brain",
117
+ path: "/simulation",
118
+ method: "GET",
119
+ authentication: "owner",
120
+ description: "Read this exact scope simulation toggle.",
121
+ responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(brainSimulationSchema)
122
+ }, {
123
+ id: `brain.${scope}.setSimulation`,
124
+ scope,
125
+ basePath: "brain",
126
+ path: "/simulation",
127
+ method: "PUT",
128
+ authentication: "owner",
129
+ description: "Set this exact scope simulation toggle without persistence or inheritance.",
130
+ body: {
131
+ required: true,
132
+ contentType: "application/json",
133
+ schema: brainSimulationSchema
134
+ },
135
+ responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(brainSimulationSchema)
136
+ }]), ...[
137
+ "global",
138
+ "workspace",
139
+ "session"
140
+ ].flatMap((scope) => [{
141
+ id: `brain.${scope}.services`,
142
+ scope,
143
+ basePath: "brain",
144
+ path: "/services",
145
+ method: "GET",
146
+ authentication: "owner",
147
+ description: "Read this exact scope and its ancestry service graph.",
148
+ responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(services)
149
+ }, {
150
+ id: `brain.${scope}.slots`,
151
+ scope,
152
+ basePath: "brain",
153
+ path: "/slots",
154
+ method: "GET",
155
+ authentication: "owner",
156
+ description: "Read host slots and metadata from this exact admitted browser mount and its ancestry, with explicit coverage diagnostics for older hosts.",
157
+ responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(slots)
158
+ }])]
12
159
  });
13
160
  //#endregion
14
161
  exports.apiContracts = apiContracts;
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.cjs","names":["defineApiContract"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;;;;AAGA,MAAa,gBAAA,4CAAeA,CAAAA,CAAAA,kBAAAA,CAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
1
+ {"version":3,"file":"apiContracts.cjs","names":["Type","defineApiContract","jsonApiResponses"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses } from '@agimon-ai/po-core/apiContracts';\nimport { Type } from 'typebox';\n\nconst level = Type.Union([Type.Literal('global'), Type.Literal('workspace'), Type.Literal('session')]);\nconst scope = Type.Object({ id: Type.String(), level });\nconst nullableString = Type.Union([Type.String(), Type.Null()]);\nconst owner = Type.Object({\n kind: Type.Union([Type.Literal('host'), Type.Literal('package'), Type.Literal('unknown')]),\n packageName: nullableString,\n origin: Type.Union([Type.Literal('po'), Type.Literal('personal'), Type.Literal('unknown')]),\n});\nconst kind = Type.Union([Type.Literal('data'), Type.Literal('component')]);\nconst placement = Type.Union([Type.Literal('verified'), Type.Literal('unverified')]);\nconst web = Type.Object({\n version: Type.Literal(1),\n slots: Type.Array(\n Type.Object({\n name: Type.String(),\n scope: level,\n description: Type.Optional(Type.String()),\n parent: Type.Optional(Type.String()),\n kind,\n }),\n ),\n fills: Type.Array(Type.Object({ id: Type.String(), slot: nullableString, scope: level, placement })),\n diagnostics: Type.Array(Type.String()),\n});\nconst base = { scope, scopes: Type.Array(scope), diagnostics: Type.Array(Type.String()) };\nconst services = Type.Object({\n ...base,\n packages: Type.Array(Type.Object({ scope, owner, web: Type.Union([web, Type.Null()]) })),\n clientPackages: Type.Optional(Type.Array(Type.Object({ scope, owner, web: Type.Union([web, Type.Null()]) }))),\n services: Type.Array(\n Type.Object({\n id: Type.String(),\n name: Type.String(),\n scope,\n visibleFrom: scope,\n owner,\n public: Type.Boolean(),\n description: nullableString,\n }),\n ),\n consumers: Type.Array(Type.Object({ id: Type.String(), name: Type.String(), scope, owner })),\n edges: Type.Array(\n Type.Object({\n consumer: Type.String(),\n service: nullableString,\n name: Type.String(),\n status: Type.Union([Type.Literal('resolved'), Type.Literal('waiting')]),\n }),\n ),\n});\nconst slots = Type.Object({\n ...base,\n slots: Type.Array(\n Type.Object({\n id: Type.String(),\n name: Type.String(),\n scope,\n owner,\n description: nullableString,\n parent: nullableString,\n kind,\n }),\n ),\n fills: Type.Array(Type.Object({ id: Type.String(), slot: nullableString, scope, owner, placement })),\n});\nexport const brainSimulationSchema = Type.Object({ enabled: Type.Boolean() }, { additionalProperties: false });\n\nexport const apiContracts = defineApiContract({\n version: 1,\n sockets: [],\n dynamic: [],\n http: [\n ...(['workspace', 'session'] as const).flatMap((scope) => [\n {\n id: `brain.${scope}.simulation`,\n scope,\n basePath: 'brain',\n path: '/simulation',\n method: 'GET' as const,\n authentication: 'owner' as const,\n description: 'Read this exact scope simulation toggle.',\n responses: jsonApiResponses(brainSimulationSchema),\n },\n {\n id: `brain.${scope}.setSimulation`,\n scope,\n basePath: 'brain',\n path: '/simulation',\n method: 'PUT' as const,\n authentication: 'owner' as const,\n description: 'Set this exact scope simulation toggle without persistence or inheritance.',\n body: { required: true, contentType: 'application/json' as const, schema: brainSimulationSchema },\n responses: jsonApiResponses(brainSimulationSchema),\n },\n ]),\n ...(['global', 'workspace', 'session'] as const).flatMap((scope) => [\n {\n id: `brain.${scope}.services`,\n scope,\n basePath: 'brain',\n path: '/services',\n method: 'GET' as const,\n authentication: 'owner' as const,\n description: 'Read this exact scope and its ancestry service graph.',\n responses: jsonApiResponses(services),\n },\n {\n id: `brain.${scope}.slots`,\n scope,\n basePath: 'brain',\n path: '/slots',\n method: 'GET' as const,\n authentication: 'owner' as const,\n description:\n 'Read host slots and metadata from this exact admitted browser mount and its ancestry, with explicit coverage diagnostics for older hosts.',\n responses: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SAAS,UAAU,CAClE;EACE,IAAI,SAAS,MAAM;EACnB;EACA,UAAU;EACV,MAAM;EACN,QAAQ;EACR,gBAAgB;EAChB,aAAa;EACb,YAAA,GAAWA,gCAAAA,iBAAAA,CAAiB,QAAQ;CACtC,GACA;EACE,IAAI,SAAS,MAAM;EACnB;EACA,UAAU;EACV,MAAM;EACN,QAAQ;EACR,gBAAgB;EAChB,aACE;EACF,YAAA,GAAWA,gCAAAA,iBAAAA,CAAiB,KAAK;CACnC,CACF,CAAC,CACH;AACF,CAAC"}
@@ -1,5 +1,5 @@
1
+ import { Type } from "typebox";
1
2
  //#region src/schemas/apiContracts.d.ts
2
- /** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
3
3
  export declare const apiContracts: {
4
4
  version: 1;
5
5
  protocols?: Record<string, string> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAGa"}
1
+ {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAsEa"}
@@ -1,11 +1,157 @@
1
- import { defineApiContract } from "@agimon-ai/po-core/apiContracts";
1
+ import { defineApiContract, jsonApiResponses } from "@agimon-ai/po-core/apiContracts";
2
+ import { Type } from "typebox";
2
3
  //#region src/schemas/apiContracts.ts
3
- /** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
4
+ const level = Type.Union([
5
+ Type.Literal("global"),
6
+ Type.Literal("workspace"),
7
+ Type.Literal("session")
8
+ ]);
9
+ const scope = Type.Object({
10
+ id: Type.String(),
11
+ level
12
+ });
13
+ const nullableString = Type.Union([Type.String(), Type.Null()]);
14
+ const owner = Type.Object({
15
+ kind: Type.Union([
16
+ Type.Literal("host"),
17
+ Type.Literal("package"),
18
+ Type.Literal("unknown")
19
+ ]),
20
+ packageName: nullableString,
21
+ origin: Type.Union([
22
+ Type.Literal("po"),
23
+ Type.Literal("personal"),
24
+ Type.Literal("unknown")
25
+ ])
26
+ });
27
+ const kind = Type.Union([Type.Literal("data"), Type.Literal("component")]);
28
+ const placement = Type.Union([Type.Literal("verified"), Type.Literal("unverified")]);
29
+ const web = Type.Object({
30
+ version: Type.Literal(1),
31
+ slots: Type.Array(Type.Object({
32
+ name: Type.String(),
33
+ scope: level,
34
+ description: Type.Optional(Type.String()),
35
+ parent: Type.Optional(Type.String()),
36
+ kind
37
+ })),
38
+ fills: Type.Array(Type.Object({
39
+ id: Type.String(),
40
+ slot: nullableString,
41
+ scope: level,
42
+ placement
43
+ })),
44
+ diagnostics: Type.Array(Type.String())
45
+ });
46
+ const base = {
47
+ scope,
48
+ scopes: Type.Array(scope),
49
+ diagnostics: Type.Array(Type.String())
50
+ };
51
+ const services = Type.Object({
52
+ ...base,
53
+ packages: Type.Array(Type.Object({
54
+ scope,
55
+ owner,
56
+ web: Type.Union([web, Type.Null()])
57
+ })),
58
+ clientPackages: Type.Optional(Type.Array(Type.Object({
59
+ scope,
60
+ owner,
61
+ web: Type.Union([web, Type.Null()])
62
+ }))),
63
+ services: Type.Array(Type.Object({
64
+ id: Type.String(),
65
+ name: Type.String(),
66
+ scope,
67
+ visibleFrom: scope,
68
+ owner,
69
+ public: Type.Boolean(),
70
+ description: nullableString
71
+ })),
72
+ consumers: Type.Array(Type.Object({
73
+ id: Type.String(),
74
+ name: Type.String(),
75
+ scope,
76
+ owner
77
+ })),
78
+ edges: Type.Array(Type.Object({
79
+ consumer: Type.String(),
80
+ service: nullableString,
81
+ name: Type.String(),
82
+ status: Type.Union([Type.Literal("resolved"), Type.Literal("waiting")])
83
+ }))
84
+ });
85
+ const slots = Type.Object({
86
+ ...base,
87
+ slots: Type.Array(Type.Object({
88
+ id: Type.String(),
89
+ name: Type.String(),
90
+ scope,
91
+ owner,
92
+ description: nullableString,
93
+ parent: nullableString,
94
+ kind
95
+ })),
96
+ fills: Type.Array(Type.Object({
97
+ id: Type.String(),
98
+ slot: nullableString,
99
+ scope,
100
+ owner,
101
+ placement
102
+ }))
103
+ });
104
+ const brainSimulationSchema = Type.Object({ enabled: Type.Boolean() }, { additionalProperties: false });
4
105
  const apiContracts = defineApiContract({
5
106
  version: 1,
6
- http: [],
7
107
  sockets: [],
8
- dynamic: []
108
+ dynamic: [],
109
+ http: [...["workspace", "session"].flatMap((scope) => [{
110
+ id: `brain.${scope}.simulation`,
111
+ scope,
112
+ basePath: "brain",
113
+ path: "/simulation",
114
+ method: "GET",
115
+ authentication: "owner",
116
+ description: "Read this exact scope simulation toggle.",
117
+ responses: jsonApiResponses(brainSimulationSchema)
118
+ }, {
119
+ id: `brain.${scope}.setSimulation`,
120
+ scope,
121
+ basePath: "brain",
122
+ path: "/simulation",
123
+ method: "PUT",
124
+ authentication: "owner",
125
+ description: "Set this exact scope simulation toggle without persistence or inheritance.",
126
+ body: {
127
+ required: true,
128
+ contentType: "application/json",
129
+ schema: brainSimulationSchema
130
+ },
131
+ responses: jsonApiResponses(brainSimulationSchema)
132
+ }]), ...[
133
+ "global",
134
+ "workspace",
135
+ "session"
136
+ ].flatMap((scope) => [{
137
+ id: `brain.${scope}.services`,
138
+ scope,
139
+ basePath: "brain",
140
+ path: "/services",
141
+ method: "GET",
142
+ authentication: "owner",
143
+ description: "Read this exact scope and its ancestry service graph.",
144
+ responses: jsonApiResponses(services)
145
+ }, {
146
+ id: `brain.${scope}.slots`,
147
+ scope,
148
+ basePath: "brain",
149
+ path: "/slots",
150
+ method: "GET",
151
+ authentication: "owner",
152
+ description: "Read host slots and metadata from this exact admitted browser mount and its ancestry, with explicit coverage diagnostics for older hosts.",
153
+ responses: jsonApiResponses(slots)
154
+ }])]
9
155
  });
10
156
  //#endregion
11
157
  export { apiContracts, apiContracts as default };
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAa,eAAe,kBAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
1
+ {"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses } from '@agimon-ai/po-core/apiContracts';\nimport { Type } from 'typebox';\n\nconst level = Type.Union([Type.Literal('global'), Type.Literal('workspace'), Type.Literal('session')]);\nconst scope = Type.Object({ id: Type.String(), level });\nconst nullableString = Type.Union([Type.String(), Type.Null()]);\nconst owner = Type.Object({\n kind: Type.Union([Type.Literal('host'), Type.Literal('package'), Type.Literal('unknown')]),\n packageName: nullableString,\n origin: Type.Union([Type.Literal('po'), Type.Literal('personal'), Type.Literal('unknown')]),\n});\nconst kind = Type.Union([Type.Literal('data'), Type.Literal('component')]);\nconst placement = Type.Union([Type.Literal('verified'), Type.Literal('unverified')]);\nconst web = Type.Object({\n version: Type.Literal(1),\n slots: Type.Array(\n Type.Object({\n name: Type.String(),\n scope: level,\n description: Type.Optional(Type.String()),\n parent: Type.Optional(Type.String()),\n kind,\n }),\n ),\n fills: Type.Array(Type.Object({ id: Type.String(), slot: nullableString, scope: level, placement })),\n diagnostics: Type.Array(Type.String()),\n});\nconst base = { scope, scopes: Type.Array(scope), diagnostics: Type.Array(Type.String()) };\nconst services = Type.Object({\n ...base,\n packages: Type.Array(Type.Object({ scope, owner, web: Type.Union([web, Type.Null()]) })),\n clientPackages: Type.Optional(Type.Array(Type.Object({ scope, owner, web: Type.Union([web, Type.Null()]) }))),\n services: Type.Array(\n Type.Object({\n id: Type.String(),\n name: Type.String(),\n scope,\n visibleFrom: scope,\n owner,\n public: Type.Boolean(),\n description: nullableString,\n }),\n ),\n consumers: Type.Array(Type.Object({ id: Type.String(), name: Type.String(), scope, owner })),\n edges: Type.Array(\n Type.Object({\n consumer: Type.String(),\n service: nullableString,\n name: Type.String(),\n status: Type.Union([Type.Literal('resolved'), Type.Literal('waiting')]),\n }),\n ),\n});\nconst slots = Type.Object({\n ...base,\n slots: Type.Array(\n Type.Object({\n id: Type.String(),\n name: Type.String(),\n scope,\n owner,\n description: nullableString,\n parent: nullableString,\n kind,\n }),\n ),\n fills: Type.Array(Type.Object({ id: Type.String(), slot: nullableString, scope, owner, placement })),\n});\nexport const brainSimulationSchema = Type.Object({ enabled: Type.Boolean() }, { additionalProperties: false });\n\nexport const apiContracts = defineApiContract({\n version: 1,\n sockets: [],\n dynamic: [],\n http: [\n ...(['workspace', 'session'] as const).flatMap((scope) => [\n {\n id: `brain.${scope}.simulation`,\n scope,\n basePath: 'brain',\n path: '/simulation',\n method: 'GET' as const,\n authentication: 'owner' as const,\n description: 'Read this exact scope simulation toggle.',\n responses: jsonApiResponses(brainSimulationSchema),\n },\n {\n id: `brain.${scope}.setSimulation`,\n scope,\n basePath: 'brain',\n path: '/simulation',\n method: 'PUT' as const,\n authentication: 'owner' as const,\n description: 'Set this exact scope simulation toggle without persistence or inheritance.',\n body: { required: true, contentType: 'application/json' as const, schema: brainSimulationSchema },\n responses: jsonApiResponses(brainSimulationSchema),\n },\n ]),\n ...(['global', 'workspace', 'session'] as const).flatMap((scope) => [\n {\n id: `brain.${scope}.services`,\n scope,\n basePath: 'brain',\n path: '/services',\n method: 'GET' as const,\n authentication: 'owner' as const,\n description: 'Read this exact scope and its ancestry service graph.',\n responses: jsonApiResponses(services),\n },\n {\n id: `brain.${scope}.slots`,\n scope,\n basePath: 'brain',\n path: '/slots',\n method: 'GET' as const,\n authentication: 'owner' as const,\n description:\n 'Read host slots and metadata from this exact admitted browser mount and its ancestry, with explicit coverage diagnostics for older hosts.',\n responses: jsonApiResponses(slots),\n },\n ]),\n ],\n});\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAM,QAAQ,KAAK,MAAM;C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,CAAC;CACV,MAAM,CACJ,GAAI,CAAC,aAAa,SAAS,CAAC,CAAW,SAAS,UAAU,CACxD;EACE,IAAI,SAAS,MAAM;EACnB;EACA,UAAU;EACV,MAAM;EACN,QAAQ;EACR,gBAAgB;EAChB,aAAa;EACb,WAAW,iBAAiB,qBAAqB;CACnD,GACA;EACE,IAAI,SAAS,MAAM;EACnB;EACA,UAAU;EACV,MAAM;EACN,QAAQ;EACR,gBAAgB;EAChB,aAAa;EACb,MAAM;GAAE,UAAU;GAAM,aAAa;GAA6B,QAAQ;EAAsB;EAChG,WAAW,iBAAiB,qBAAqB;CACnD,CACF,CAAC,GACD,GAAI;EAAC;EAAU;EAAa;CAAS,CAAC,CAAW,SAAS,UAAU,CAClE;EACE,IAAI,SAAS,MAAM;EACnB;EACA,UAAU;EACV,MAAM;EACN,QAAQ;EACR,gBAAgB;EAChB,aAAa;EACb,WAAW,iBAAiB,QAAQ;CACtC,GACA;EACE,IAAI,SAAS,MAAM;EACnB;EACA,UAAU;EACV,MAAM;EACN,QAAQ;EACR,gBAAgB;EAChB,aACE;EACF,WAAW,iBAAiB,KAAK;CACnC,CACF,CAAC,CACH;AACF,CAAC"}
@@ -55,6 +55,7 @@ function parseHelpGuideSet(input) {
55
55
  }
56
56
  const helpGuidesSlot = {
57
57
  slot: "help.guides",
58
+ description: "Contribute a labelled set of searchable plain-text questions and answers to the Help panel.",
58
59
  parse: parseHelpGuideSet
59
60
  };
60
61
  //#endregion