@numericoach/gskills-admin-cli 0.1.4 → 0.1.6
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 +3 -1
- package/dist/gskills-admin.js +26 -9
- package/package.json +1 -1
- package/skills/gskills-admin-cli/SKILL.md +15 -4
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ gskills-admin cache invalidate --instance <instanceId> --scope menu-bundle --yes
|
|
|
41
41
|
Operational helpers are available for the admin-only flows agents should not improvise:
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
gskills-admin feedback send-reply <feedbackId> --subject "GSkills - ..." --body
|
|
44
|
+
gskills-admin feedback send-reply <feedbackId> --subject "GSkills - ..." --body-file ./reply.txt --dry-run --output json
|
|
45
45
|
gskills-admin access grant --user <userId> --type DEFAULT --dry-run --output json
|
|
46
46
|
gskills-admin instances create-plan --output json
|
|
47
47
|
gskills-admin instances create --data '{"name":"Client","URL":"client","licenceType":"STARTER","tokensAllowed":50}' --dry-run --output json
|
|
@@ -51,6 +51,8 @@ gskills-admin org-units-sync google --instance <instanceId> --yes --output json
|
|
|
51
51
|
gskills-admin ambassadors label --instance <instanceId> --language fr --output json
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
Feedback reply bodies are file-based on purpose. Production replies are multi-line, and `send-reply` rejects inline body text to avoid shell parsing surprises.
|
|
55
|
+
|
|
54
56
|
Raw project and analytics data can be read through resources such as `project-data`, `ticket-sla-rules`, `analytics`, `quiz-attempts`, `user-paths`, `chromebook-progress`, and `user-learning-paths`.
|
|
55
57
|
|
|
56
58
|
## Agent skill
|
package/dist/gskills-admin.js
CHANGED
|
@@ -690,7 +690,7 @@ var resourceHelpRows = () => resources.map((resource) => ({
|
|
|
690
690
|
aliases: resource.aliases.join(", ")
|
|
691
691
|
}));
|
|
692
692
|
// ../../src/cli/commands.ts
|
|
693
|
-
import { cp, mkdir as mkdir2, stat } from "node:fs/promises";
|
|
693
|
+
import { cp, mkdir as mkdir2, readFile as readFile2, stat } from "node:fs/promises";
|
|
694
694
|
import { dirname as dirname2, join as join2 } from "node:path";
|
|
695
695
|
import { fileURLToPath } from "node:url";
|
|
696
696
|
var runCommand = async (ctx) => {
|
|
@@ -907,18 +907,28 @@ var runFeedbackCommand = async (action, feedbackId, ctx) => {
|
|
|
907
907
|
if (!hasFlag(ctx, "yes") && !hasFlag(ctx, "dry-run")) {
|
|
908
908
|
throw new CliError("Sending feedback reply email requires --yes or --dry-run", 2);
|
|
909
909
|
}
|
|
910
|
-
const
|
|
911
|
-
const
|
|
910
|
+
const bodyFilePath = getStringFlag(ctx, "body-file");
|
|
911
|
+
const translatedBodyFilePath = getStringFlag(ctx, "translated-body-file");
|
|
912
|
+
if (!bodyFilePath) {
|
|
913
|
+
throw new CliError("Feedback reply emails are multi-line. Use --body-file instead of inline --body.", 2);
|
|
914
|
+
}
|
|
915
|
+
if (getStringFlag(ctx, "translated-body") && !translatedBodyFilePath) {
|
|
916
|
+
throw new CliError("Translated feedback reply emails are multi-line. Use --translated-body-file instead of inline --translated-body.", 2);
|
|
917
|
+
}
|
|
918
|
+
const subject = await getTextFlag(ctx, "subject", "subject-file");
|
|
919
|
+
const body = await getTextFlag(ctx, "body", "body-file");
|
|
920
|
+
const translatedSubject = await getTextFlag(ctx, "translated-subject", "translated-subject-file");
|
|
921
|
+
const translatedBody = await getTextFlag(ctx, "translated-body", "translated-body-file");
|
|
912
922
|
if (!subject || !body)
|
|
913
|
-
throw new CliError("Missing --subject or --body", 2);
|
|
923
|
+
throw new CliError("Missing --subject or --body-file", 2);
|
|
914
924
|
return requestApi("/api/cli/feedback/send-reply", {
|
|
915
925
|
method: "POST",
|
|
916
926
|
body: JSON.stringify({
|
|
917
927
|
feedbackId,
|
|
918
928
|
subject,
|
|
919
929
|
body,
|
|
920
|
-
translatedSubject
|
|
921
|
-
translatedBody
|
|
930
|
+
translatedSubject,
|
|
931
|
+
translatedBody,
|
|
922
932
|
userLanguage: getStringFlag(ctx, "user-language"),
|
|
923
933
|
currentLanguage: getStringFlag(ctx, "current-language") ?? "fr",
|
|
924
934
|
dryRun: hasFlag(ctx, "dry-run")
|
|
@@ -1354,6 +1364,13 @@ var getStringFlag = (ctx, name) => {
|
|
|
1354
1364
|
return value;
|
|
1355
1365
|
return;
|
|
1356
1366
|
};
|
|
1367
|
+
var getTextFlag = async (ctx, inlineName, fileName) => {
|
|
1368
|
+
const filePath = getStringFlag(ctx, fileName);
|
|
1369
|
+
if (filePath) {
|
|
1370
|
+
return readFile2(filePath, "utf8");
|
|
1371
|
+
}
|
|
1372
|
+
return getStringFlag(ctx, inlineName);
|
|
1373
|
+
};
|
|
1357
1374
|
var getNumberFlag = (ctx, name) => {
|
|
1358
1375
|
const value = getStringFlag(ctx, name);
|
|
1359
1376
|
if (!value)
|
|
@@ -1405,7 +1422,7 @@ var schemaHelp = () => ({
|
|
|
1405
1422
|
{ name: "cache invalidate", required: ["--instance"], flags: ["--scope", "--languages", "--yes", "--dry-run"], writes: true },
|
|
1406
1423
|
{ name: "feedback claim", args: ["feedbackId"], flags: ["--dry-run"], writes: true },
|
|
1407
1424
|
{ name: "feedback send-claim", args: ["feedbackId"], flags: ["--recipient-email", "--recipient-name", "--cc", "--subject", "--body", "--yes", "--dry-run"], writes: true },
|
|
1408
|
-
{ name: "feedback send-reply", args: ["feedbackId"], flags: ["--subject", "--body", "--translated-subject", "--translated-body", "--user-language", "--current-language", "--yes", "--dry-run"], writes: true },
|
|
1425
|
+
{ name: "feedback send-reply", args: ["feedbackId"], flags: ["--subject", "--subject-file", "--body-file", "--translated-subject", "--translated-subject-file", "--translated-body-file", "--user-language", "--current-language", "--yes", "--dry-run"], writes: true },
|
|
1409
1426
|
{ name: "access grant", required: ["--user"], flags: ["--type", "--start-at", "--custom-duration-days", "--preferred-language", "--yes", "--dry-run"], writes: true },
|
|
1410
1427
|
{ name: "access revoke-active", required: ["--user"], flags: ["--yes", "--dry-run"], writes: true },
|
|
1411
1428
|
{ name: "instances create-plan", writes: false },
|
|
@@ -1479,8 +1496,8 @@ var cacheHelp = () => ({
|
|
|
1479
1496
|
});
|
|
1480
1497
|
var feedbackHelp = () => ({
|
|
1481
1498
|
usage: [
|
|
1482
|
-
"gskills-admin feedback send-reply <feedbackId> --subject 'GSkills - ...' --body
|
|
1483
|
-
"gskills-admin feedback send-reply <feedbackId> --subject 'GSkills - ...' --body
|
|
1499
|
+
"gskills-admin feedback send-reply <feedbackId> --subject 'GSkills - ...' --body-file ./reply.fr.txt --dry-run",
|
|
1500
|
+
"gskills-admin feedback send-reply <feedbackId> --subject 'GSkills - ...' --body-file ./reply.fr.txt --yes",
|
|
1484
1501
|
"gskills-admin feedback claim <feedbackId> --dry-run",
|
|
1485
1502
|
"gskills-admin feedback claim <feedbackId>",
|
|
1486
1503
|
"gskills-admin feedback send-claim <feedbackId> --recipient-email user@example.com --subject '...' --body '...' --yes"
|
package/package.json
CHANGED
|
@@ -262,15 +262,25 @@ gskills-admin cache invalidate --instance <instanceId> --scope all --yes --outpu
|
|
|
262
262
|
|
|
263
263
|
Use `send-reply` for the normal email available from the feedback detail dialog. It uses the `GSkillsEmail` template, sends to the feedback user, stores a `FeedbackReply`, updates `repliedAt`, and writes admin logs.
|
|
264
264
|
|
|
265
|
+
Production reality from the latest 50 `FeedbackReply` rows checked on 2026-05-13: all reply bodies were multi-line, usually 9-13 lines with paragraph breaks. Translated PT/ES replies were multi-line too. Therefore, real feedback replies must use `--body-file`; never put the body inline in the shell.
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
gskills-admin feedback send-reply <feedbackId> --subject "GSkills - ..." --body-file ./reply.txt --dry-run --output json
|
|
269
|
+
gskills-admin feedback send-reply <feedbackId> --subject "GSkills - ..." --body-file ./reply.txt --yes --output json
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Always answer in the language of the user's feedback or the user's UI language. If the feedback is in English, answer in English. If it is in Portuguese, answer in Portuguese. Do not default to French unless the feedback/user language is French.
|
|
273
|
+
|
|
274
|
+
For same-language replies, pass both language flags with that language:
|
|
275
|
+
|
|
265
276
|
```bash
|
|
266
|
-
gskills-admin feedback send-reply <feedbackId> --subject "GSkills -
|
|
267
|
-
gskills-admin feedback send-reply <feedbackId> --subject "GSkills - ..." --body "Bonjour..." --yes --output json
|
|
277
|
+
gskills-admin feedback send-reply <feedbackId> --subject "GSkills - Reply" --body-file ./reply.en.txt --user-language en --current-language en --dry-run --output json
|
|
268
278
|
```
|
|
269
279
|
|
|
270
|
-
If
|
|
280
|
+
If you intentionally draft in French and provide a translated version, pass the translated fields:
|
|
271
281
|
|
|
272
282
|
```bash
|
|
273
|
-
gskills-admin feedback send-reply <feedbackId> --subject "GSkills -
|
|
283
|
+
gskills-admin feedback send-reply <feedbackId> --subject "GSkills - Réponse" --body-file ./reply.fr.txt --translated-subject "GSkills - Reply" --translated-body-file ./reply.en.txt --user-language en --current-language fr --dry-run --output json
|
|
274
284
|
```
|
|
275
285
|
|
|
276
286
|
The claim commands below are not the normal feedback reply system. They are only for the SLA "ticket pris en charge" flow.
|
|
@@ -285,6 +295,7 @@ gskills-admin feedback send-claim <feedbackId> --recipient-email user@example.co
|
|
|
285
295
|
Rules:
|
|
286
296
|
|
|
287
297
|
- For normal feedback responses, use `send-reply`.
|
|
298
|
+
- For feedback reply bodies, use `--body-file` and `--translated-body-file`; the CLI rejects inline body text for `send-reply`.
|
|
288
299
|
- Dry-run claim first to inspect recipient, CC recipients and draft.
|
|
289
300
|
- Send only after the ticket is claimed by the same CLI user.
|
|
290
301
|
- CC recipients must be allowed by instance SLA flags.
|