@aryacode/dsh-engineering 0.9.0 → 0.9.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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/cordis.patch.yml +1 -1
- package/package.json +1 -1
- package/vendor/resources/LICENSE-CONTENT.md +17 -0
- package/vendor/resources/SOURCE.json +6 -0
- package/vendor/resources/corpus/craft/craft-comments-and-intent.md +29 -0
- package/vendor/resources/corpus/craft/craft-debounce-and-filtering.md +29 -0
- package/vendor/resources/corpus/craft/craft-fault-handling.md +32 -0
- package/vendor/resources/corpus/craft/craft-naming.md +30 -0
- package/vendor/resources/corpus/craft/craft-review-checklist.md +29 -0
- package/vendor/resources/corpus/craft/craft-units-and-ranges.md +32 -0
- package/vendor/resources/corpus/iec/iec-ld-fbd-equivalence.md +31 -0
- package/vendor/resources/corpus/iec/iec-sequences-and-sfc.md +32 -0
- package/vendor/resources/corpus/iec/iec-st-structure.md +33 -0
- package/vendor/resources/corpus/iec/iec-state-machines.md +33 -0
- package/vendor/resources/corpus/iec/iec-task-model.md +31 -0
- package/vendor/resources/corpus/iec/iec-types-and-scaling.md +32 -0
- package/vendor/resources/corpus/optix/optix-alarms-and-trends.md +30 -0
- package/vendor/resources/corpus/optix/optix-bindings-and-expressions.md +30 -0
- package/vendor/resources/corpus/optix/optix-netlogic-usage.md +29 -0
- package/vendor/resources/corpus/optix/optix-ui-structure.md +29 -0
- package/vendor/resources/corpus/rockwell/rockwell-aoi-and-udt.md +32 -0
- package/vendor/resources/corpus/rockwell/rockwell-fault-and-alarm-words.md +31 -0
- package/vendor/resources/corpus/rockwell/rockwell-hmi-handshake.md +33 -0
- package/vendor/resources/corpus/rockwell/rockwell-program-structure.md +32 -0
- package/vendor/resources/corpus/rockwell/rockwell-safety-boundaries.md +31 -0
- package/vendor/resources/corpus/rockwell/rockwell-tag-naming.md +33 -0
- package/vendor/resources/corpus/view/view-alarm-presentation.md +32 -0
- package/vendor/resources/corpus/view/view-colour-and-contrast.md +31 -0
- package/vendor/resources/corpus/view/view-faceplates.md +32 -0
- package/vendor/resources/corpus/view/view-hpm-01.md +33 -0
- package/vendor/resources/corpus/view/view-navigation.md +31 -0
- package/vendor/resources/corpus/view/view-popup-patterns.md +31 -0
- package/vendor/resources/corpus/view/view-screen-hierarchy.md +31 -0
- package/vendor/resources/corpus/yaskawa/yaskawa-cam-and-gear.md +31 -0
- package/vendor/resources/corpus/yaskawa/yaskawa-error-handling.md +31 -0
- package/vendor/resources/corpus/yaskawa/yaskawa-motion-function-blocks.md +32 -0
- package/vendor/resources/corpus/yaskawa/yaskawa-pou-organisation.md +29 -0
- package/vendor/resources/corpus/yaskawa/yaskawa-task-rates.md +30 -0
- package/vendor/resources/index.json +873 -0
- package/vendor/resources/lib/index.js +33 -20
|
@@ -43,32 +43,45 @@ function skillPath() {
|
|
|
43
43
|
* @param config - Row configuration.
|
|
44
44
|
*/
|
|
45
45
|
export function apply(ctx, config = {}) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
// A reference row must never be able to stop the application from booting:
|
|
47
|
+
// in 0.9.0 a row id that collided with a harness service did exactly that.
|
|
48
|
+
// Anything that goes wrong here is reported and skipped.
|
|
49
|
+
try {
|
|
50
|
+
const getService = (service) => (typeof ctx.get === 'function' ? ctx.get(service) : undefined);
|
|
51
|
+
if (config.reference !== false) {
|
|
52
|
+
for (const definition of resourceTools(getService))
|
|
53
|
+
ctx.tools.register(definition);
|
|
54
|
+
}
|
|
55
|
+
ctx.provide?.(PROFILES_SERVICE, { get: getProfile });
|
|
56
|
+
const path = skillPath();
|
|
57
|
+
const skills = getService('skills');
|
|
58
|
+
if (path === undefined || skills?.register === undefined) {
|
|
59
|
+
try {
|
|
60
|
+
ctx.logger?.warn?.('engineering-resources: the engineering-standards skill was not registered; the tools are available.');
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
// A logger that refuses must not turn a missing skill into a crash.
|
|
64
|
+
}
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const content = readFileSync(path, 'utf8').replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n/u, '');
|
|
68
|
+
skills.register({
|
|
69
|
+
...SKILL,
|
|
70
|
+
content,
|
|
71
|
+
path,
|
|
72
|
+
source: 'custom',
|
|
73
|
+
provider: '@aryacode/dsh-engineering',
|
|
74
|
+
invocation: { modelInvocable: true, userInvocable: true },
|
|
75
|
+
});
|
|
50
76
|
}
|
|
51
|
-
|
|
52
|
-
const path = skillPath();
|
|
53
|
-
const skills = getService('skills');
|
|
54
|
-
if (path === undefined || skills?.register === undefined) {
|
|
77
|
+
catch (error) {
|
|
55
78
|
try {
|
|
56
|
-
ctx.logger?.warn?.(
|
|
79
|
+
ctx.logger?.warn?.(`engineering-resources: the row did not mount: ${error instanceof Error ? error.message : String(error)}`);
|
|
57
80
|
}
|
|
58
81
|
catch {
|
|
59
|
-
//
|
|
82
|
+
// Nothing left to report to.
|
|
60
83
|
}
|
|
61
|
-
return;
|
|
62
84
|
}
|
|
63
|
-
const content = readFileSync(path, 'utf8').replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n/u, '');
|
|
64
|
-
skills.register({
|
|
65
|
-
...SKILL,
|
|
66
|
-
content,
|
|
67
|
-
path,
|
|
68
|
-
source: 'custom',
|
|
69
|
-
provider: '@aryacode/dsh-engineering',
|
|
70
|
-
invocation: { modelInvocable: true, userInvocable: true },
|
|
71
|
-
});
|
|
72
85
|
}
|
|
73
86
|
export { getProfile } from "./store.js";
|
|
74
87
|
export { validateProfile, profileId } from "./profile.js";
|