@factorialco/fcode-cli 1.3.0 ā 1.4.0
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/README.md +2 -4
- package/dist/commands/clone.d.ts +3 -3
- package/dist/commands/clone.js +24 -23
- package/dist/config/settings.d.ts +0 -1
- package/dist/config/settings.js +0 -6
- package/dist/core/types.d.ts +2 -0
- package/dist/services/fcode-graphql-client.js +7 -0
- package/oclif.manifest.json +1 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ $ npm install -g @factorialco/fcode-cli
|
|
|
20
20
|
$ fcode COMMAND
|
|
21
21
|
running command...
|
|
22
22
|
$ fcode (--version)
|
|
23
|
-
@factorialco/fcode-cli/1.
|
|
23
|
+
@factorialco/fcode-cli/1.4.0 linux-x64 node-v22.22.3
|
|
24
24
|
$ fcode --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ fcode COMMAND
|
|
@@ -100,14 +100,12 @@ Clone team workspace from cloud
|
|
|
100
100
|
|
|
101
101
|
```
|
|
102
102
|
USAGE
|
|
103
|
-
$ fcode clone [TEAM] [--skipSkillsSetup]
|
|
103
|
+
$ fcode clone [TEAM] [--skipSkillsSetup]
|
|
104
104
|
|
|
105
105
|
ARGUMENTS
|
|
106
106
|
[TEAM] Team name
|
|
107
107
|
|
|
108
108
|
FLAGS
|
|
109
|
-
--autoSkillsSetup Install the Factorial Code agent skills non-interactively (defaults, project scope) instead of
|
|
110
|
-
prompting
|
|
111
109
|
--skipSkillsSetup Skip installation of the Factorial Code agent skills
|
|
112
110
|
|
|
113
111
|
DESCRIPTION
|
package/dist/commands/clone.d.ts
CHANGED
|
@@ -8,18 +8,18 @@ export default class Clone extends Command {
|
|
|
8
8
|
static examples: string[];
|
|
9
9
|
static flags: {
|
|
10
10
|
skipSkillsSetup: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
-
autoSkillsSetup: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
11
|
};
|
|
13
12
|
checkWorkspaceAlreadyCloned(slug: string): Promise<void>;
|
|
14
13
|
checkWorkspaceIsEmpty(slug: string): Promise<void>;
|
|
15
|
-
cloneTeam(origin: TeamOrigin, skipSkillsSetup?: boolean
|
|
14
|
+
cloneTeam(origin: TeamOrigin, skipSkillsSetup?: boolean): Promise<void>;
|
|
16
15
|
createWorkspaceConfig(origin: TeamOrigin): Promise<void>;
|
|
17
16
|
createWorkspaceDatastore(slug: string): void;
|
|
18
17
|
createWorkspaceStorage(slug: string): void;
|
|
19
18
|
createWorkspaceGitIgnore(slug: string): Promise<void>;
|
|
20
19
|
createWorkspaceLocalVariables(slug: string): Promise<void>;
|
|
21
20
|
private skillsInstallHint;
|
|
22
|
-
setupSkills(
|
|
21
|
+
setupSkills(): Promise<void>;
|
|
22
|
+
private installSkills;
|
|
23
23
|
catch(error: any): Promise<void>;
|
|
24
24
|
init(): Promise<void>;
|
|
25
25
|
mkdirWorkspace(slug: string): Promise<void>;
|
package/dist/commands/clone.js
CHANGED
|
@@ -10,7 +10,12 @@ const pull_1 = require("./pull");
|
|
|
10
10
|
const types_1 = require("../core/types");
|
|
11
11
|
const cli_1 = require("../utils/cli");
|
|
12
12
|
const settings_1 = require("../config/settings");
|
|
13
|
-
|
|
13
|
+
// Skill sources installed on clone. `release-sdk` in factorial-api-sdks is a
|
|
14
|
+
// maintainer-only skill, so we pick `factorial-api-sdks` explicitly there.
|
|
15
|
+
const SKILLS_SOURCES = [
|
|
16
|
+
{ repo: 'factorialco/factorial-code-skills', skills: '*' },
|
|
17
|
+
{ repo: 'factorialco/factorial-api-sdks', skills: 'factorial-api-sdks' },
|
|
18
|
+
];
|
|
14
19
|
class Clone extends core_1.Command {
|
|
15
20
|
async checkWorkspaceAlreadyCloned(slug) {
|
|
16
21
|
try {
|
|
@@ -41,7 +46,7 @@ class Clone extends core_1.Command {
|
|
|
41
46
|
});
|
|
42
47
|
}
|
|
43
48
|
}
|
|
44
|
-
async cloneTeam(origin, skipSkillsSetup = false
|
|
49
|
+
async cloneTeam(origin, skipSkillsSetup = false) {
|
|
45
50
|
await this.mkdirWorkspace(origin.slug);
|
|
46
51
|
await this.createWorkspaceConfig(origin);
|
|
47
52
|
await this.createWorkspaceGitIgnore(origin.slug);
|
|
@@ -51,7 +56,7 @@ class Clone extends core_1.Command {
|
|
|
51
56
|
process.chdir(origin.slug);
|
|
52
57
|
await pull_1.default.run([]);
|
|
53
58
|
if (!skipSkillsSetup) {
|
|
54
|
-
await this.setupSkills(
|
|
59
|
+
await this.setupSkills();
|
|
55
60
|
}
|
|
56
61
|
}
|
|
57
62
|
async createWorkspaceConfig(origin) {
|
|
@@ -75,32 +80,35 @@ class Clone extends core_1.Command {
|
|
|
75
80
|
const localVariablesFileName = await globalConfig.getSetting(settings_1.SettingKeys.LOCAL_VARIABLES_FILE_NAME);
|
|
76
81
|
fs.outputFileSync(path.join(slug, localVariablesFileName), '');
|
|
77
82
|
}
|
|
78
|
-
skillsInstallHint() {
|
|
83
|
+
skillsInstallHint(repo, skills) {
|
|
79
84
|
cli_1.default.log('š” Install the Factorial Code agent skills later with:');
|
|
80
|
-
cli_1.default.log(` npx skills add ${
|
|
85
|
+
cli_1.default.log(` npx skills add ${repo} -s '${skills}' -y`);
|
|
81
86
|
}
|
|
82
|
-
async setupSkills(
|
|
87
|
+
async setupSkills() {
|
|
83
88
|
cli_1.default.log('');
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (autoSkillsSetup) {
|
|
90
|
-
skillsArgs.push('-y');
|
|
89
|
+
// The skills CLI only installs to agents it detects; a fresh workspace has no
|
|
90
|
+
// agent directories, so create .claude/ first so Claude Code is always targeted.
|
|
91
|
+
fs.ensureDirSync('.claude');
|
|
92
|
+
for (const source of SKILLS_SOURCES) {
|
|
93
|
+
await this.installSkills(source.repo, source.skills);
|
|
91
94
|
}
|
|
95
|
+
}
|
|
96
|
+
async installSkills(repo, skills) {
|
|
97
|
+
// `npx --yes skills add <repo> -s <skills> -y` ā non-interactive install with
|
|
98
|
+
// the skills CLI defaults: project scope (no -g), symlinked (no --copy).
|
|
99
|
+
const skillsArgs = ['--yes', 'skills', 'add', repo, '-s', skills, '-y'];
|
|
92
100
|
await new Promise((resolve) => {
|
|
93
101
|
const child = (0, node_child_process_1.spawn)('npx', skillsArgs, { stdio: 'inherit' });
|
|
94
102
|
child.on('error', () => {
|
|
95
103
|
// npx not available (or failed to launch) ā don't fail the clone, just tell the user how to do it.
|
|
96
104
|
cli_1.default.log("\nā ļø Couldn't run npx automatically (is Node.js / npx installed?).");
|
|
97
|
-
this.skillsInstallHint();
|
|
105
|
+
this.skillsInstallHint(repo, skills);
|
|
98
106
|
resolve();
|
|
99
107
|
});
|
|
100
108
|
child.on('close', (code) => {
|
|
101
109
|
if (code !== 0) {
|
|
102
110
|
cli_1.default.log("\nā ļø Skill installation didn't complete.");
|
|
103
|
-
this.skillsInstallHint();
|
|
111
|
+
this.skillsInstallHint(repo, skills);
|
|
104
112
|
}
|
|
105
113
|
resolve();
|
|
106
114
|
});
|
|
@@ -167,11 +175,7 @@ class Clone extends core_1.Command {
|
|
|
167
175
|
if (skipSkillsSetup === undefined) {
|
|
168
176
|
skipSkillsSetup = (await new global_1.default().getSetting(settings_1.SettingKeys.SKIP_SKILLS_SETUP)) === 'true';
|
|
169
177
|
}
|
|
170
|
-
|
|
171
|
-
if (autoSkillsSetup === undefined) {
|
|
172
|
-
autoSkillsSetup = (await new global_1.default().getSetting(settings_1.SettingKeys.AUTO_SKILLS_SETUP)) === 'true';
|
|
173
|
-
}
|
|
174
|
-
await this.cloneTeam({ url, slug }, skipSkillsSetup, autoSkillsSetup);
|
|
178
|
+
await this.cloneTeam({ url, slug }, skipSkillsSetup);
|
|
175
179
|
cli_1.default.log(`\nš ${args.team} team workspace cloned successfully!\n`);
|
|
176
180
|
cli_1.default.log(`$ cd ${slug}\n`);
|
|
177
181
|
}
|
|
@@ -183,8 +187,5 @@ Clone.flags = {
|
|
|
183
187
|
skipSkillsSetup: core_1.Flags.boolean({
|
|
184
188
|
description: 'Skip installation of the Factorial Code agent skills',
|
|
185
189
|
}),
|
|
186
|
-
autoSkillsSetup: core_1.Flags.boolean({
|
|
187
|
-
description: 'Install the Factorial Code agent skills non-interactively (defaults, project scope) instead of prompting',
|
|
188
|
-
}),
|
|
189
190
|
};
|
|
190
191
|
exports.default = Clone;
|
|
@@ -4,7 +4,6 @@ export interface SettingDefinition {
|
|
|
4
4
|
description?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare enum SettingKeys {
|
|
7
|
-
AUTO_SKILLS_SETUP = "autoSkillsSetup",
|
|
8
7
|
DISABLE_UPDATE_NOTIFIER = "disableUpdateNotifier",
|
|
9
8
|
IGNORE_PROCESS_VERSIONS = "ignoreProcessVersions",
|
|
10
9
|
IGNORE_WORKSPACE_NOT_EMPTY = "ignoreWorkspaceNotEmpty",
|
package/dist/config/settings.js
CHANGED
|
@@ -4,7 +4,6 @@ exports.SETTINGS_DEFINITIONS = exports.SettingKeys = void 0;
|
|
|
4
4
|
exports.getSettingDefault = getSettingDefault;
|
|
5
5
|
var SettingKeys;
|
|
6
6
|
(function (SettingKeys) {
|
|
7
|
-
SettingKeys["AUTO_SKILLS_SETUP"] = "autoSkillsSetup";
|
|
8
7
|
SettingKeys["DISABLE_UPDATE_NOTIFIER"] = "disableUpdateNotifier";
|
|
9
8
|
SettingKeys["IGNORE_PROCESS_VERSIONS"] = "ignoreProcessVersions";
|
|
10
9
|
SettingKeys["IGNORE_WORKSPACE_NOT_EMPTY"] = "ignoreWorkspaceNotEmpty";
|
|
@@ -29,11 +28,6 @@ exports.SETTINGS_DEFINITIONS = [
|
|
|
29
28
|
default: 'false',
|
|
30
29
|
description: 'Skip Factorial Code agent skills install on clone',
|
|
31
30
|
},
|
|
32
|
-
{
|
|
33
|
-
key: SettingKeys.AUTO_SKILLS_SETUP,
|
|
34
|
-
default: 'false',
|
|
35
|
-
description: 'Install Factorial Code agent skills non-interactively (defaults, project scope) on clone',
|
|
36
|
-
},
|
|
37
31
|
{
|
|
38
32
|
key: SettingKeys.IGNORE_FCODE_RUN_PROCESSES,
|
|
39
33
|
default: 'false',
|
package/dist/core/types.d.ts
CHANGED
|
@@ -103,8 +103,10 @@ export interface ProcessWebhook {
|
|
|
103
103
|
username?: string;
|
|
104
104
|
password?: string;
|
|
105
105
|
}
|
|
106
|
+
export type AppRole = 'INSTALL' | 'SETTINGS' | 'USER_FACING_FORM' | 'NONE';
|
|
106
107
|
export interface ProcessForm {
|
|
107
108
|
enabled: boolean;
|
|
109
|
+
appRole?: AppRole;
|
|
108
110
|
}
|
|
109
111
|
export interface ProcessVisibility {
|
|
110
112
|
isPublic: boolean;
|
|
@@ -43,6 +43,7 @@ const PROCESS_FIELDS = `
|
|
|
43
43
|
settings {
|
|
44
44
|
formSettings {
|
|
45
45
|
enabled
|
|
46
|
+
appRole
|
|
46
47
|
}
|
|
47
48
|
publicationConfig {
|
|
48
49
|
isPublic
|
|
@@ -276,6 +277,9 @@ class FcodeGraphQLClient {
|
|
|
276
277
|
};
|
|
277
278
|
if (process.form) {
|
|
278
279
|
settings.formSettings = { enabled: process.form.enabled };
|
|
280
|
+
if (process.form.appRole) {
|
|
281
|
+
settings.formSettings.appRole = process.form.appRole;
|
|
282
|
+
}
|
|
279
283
|
}
|
|
280
284
|
if (process.visibility) {
|
|
281
285
|
settings.publicationConfig = { isPublic: process.visibility.isPublic };
|
|
@@ -569,6 +573,9 @@ class FcodeGraphQLClient {
|
|
|
569
573
|
}
|
|
570
574
|
if (settings?.formSettings) {
|
|
571
575
|
metadata.form = { enabled: Boolean(settings.formSettings.enabled) };
|
|
576
|
+
if (settings.formSettings.appRole && settings.formSettings.appRole !== 'NONE') {
|
|
577
|
+
metadata.form.appRole = settings.formSettings.appRole;
|
|
578
|
+
}
|
|
572
579
|
}
|
|
573
580
|
if (settings?.publicationConfig) {
|
|
574
581
|
metadata.visibility = { isPublic: Boolean(settings.publicationConfig.isPublic) };
|
package/oclif.manifest.json
CHANGED
|
@@ -41,12 +41,6 @@
|
|
|
41
41
|
"name": "skipSkillsSetup",
|
|
42
42
|
"allowNo": false,
|
|
43
43
|
"type": "boolean"
|
|
44
|
-
},
|
|
45
|
-
"autoSkillsSetup": {
|
|
46
|
-
"description": "Install the Factorial Code agent skills non-interactively (defaults, project scope) instead of prompting",
|
|
47
|
-
"name": "autoSkillsSetup",
|
|
48
|
-
"allowNo": false,
|
|
49
|
-
"type": "boolean"
|
|
50
44
|
}
|
|
51
45
|
},
|
|
52
46
|
"hasDynamicHelp": false,
|
|
@@ -1785,5 +1779,5 @@
|
|
|
1785
1779
|
]
|
|
1786
1780
|
}
|
|
1787
1781
|
},
|
|
1788
|
-
"version": "1.
|
|
1782
|
+
"version": "1.4.0"
|
|
1789
1783
|
}
|