gestalt-mobile 0.18.0 → 0.18.2

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.
@@ -1,62 +0,0 @@
1
- /*
2
- * Copyright (C) 2026 Dyne.org foundation
3
- * Designed by Denis Roio <jaromil@dyne.org>
4
- * SPDX-License-Identifier: AGPL-3.0-or-later
5
- */
6
- import { execFile } from 'node:child_process';
7
- import { dirname, isAbsolute, join, resolve } from 'node:path';
8
- import { promisify } from 'node:util';
9
- const execute = promisify(execFile);
10
- export const ORG_PLAN_VALIDATION_TIMEOUT_MS = 5_000;
11
- /** Runs the Org Plan skill's own validator without a shell or mutable command text. */
12
- export class OrgPlanCommandValidator {
13
- options;
14
- helpers = new Map();
15
- constructor(options = {}) {
16
- this.options = options;
17
- }
18
- async validate(workspacePath, planPath) {
19
- const helper = await this.helper(workspacePath);
20
- if (!helper)
21
- return false;
22
- try {
23
- await (this.options.execute ?? execute)(helper, ['validate', planPath], {
24
- shell: false,
25
- timeout: ORG_PLAN_VALIDATION_TIMEOUT_MS,
26
- maxBuffer: 64 * 1024,
27
- });
28
- return true;
29
- }
30
- catch {
31
- return false;
32
- }
33
- }
34
- async helper(workspacePath) {
35
- const workspace = resolve(workspacePath);
36
- const cached = this.helpers.get(workspace);
37
- if (cached)
38
- return cached;
39
- const discovered = this.resolveHelper(workspace);
40
- this.helpers.set(workspace, discovered);
41
- const helper = await discovered;
42
- if (!helper)
43
- this.helpers.delete(workspace);
44
- return helper;
45
- }
46
- async resolveHelper(workspacePath) {
47
- if (this.options.helperPath)
48
- return isAbsolute(this.options.helperPath) ? resolve(this.options.helperPath) : null;
49
- if (!this.options.discoverSkills)
50
- return null;
51
- try {
52
- const skills = await this.options.discoverSkills(workspacePath);
53
- const skill = skills.find(({ name }) => name === 'gestalt:org-plan' || name === 'org-plan');
54
- return skill && isAbsolute(skill.path)
55
- ? join(dirname(resolve(skill.path)), 'scripts', 'org-plan')
56
- : null;
57
- }
58
- catch {
59
- return null;
60
- }
61
- }
62
- }