@profoundlogic/coderflow-server 0.2.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/LICENSE.txt +322 -0
- package/README.md +158 -0
- package/dist/LICENSE.txt +322 -0
- package/dist/README.md +158 -0
- package/dist/base-image/Dockerfile +184 -0
- package/dist/base-image/agent-wrapper.sh +143 -0
- package/dist/base-image/apply-local-state.sh +357 -0
- package/dist/base-image/coder-git-credential-helper +307 -0
- package/dist/base-image/entrypoint.sh +942 -0
- package/dist/base-image/ssh_config_template +41 -0
- package/dist/base-image/start-code-server.sh +76 -0
- package/dist/base-image/sync-repos.sh +170 -0
- package/dist/base-image/vscode-extensions.txt +10 -0
- package/dist/base-image/vscode-settings.json +41 -0
- package/dist/coder-server.js +2 -0
- package/dist/config/cli-models.json +45 -0
- package/dist/config/imported-skills.schema.json +83 -0
- package/dist/config/skill-catalog.json +18 -0
- package/dist/config/skill-catalog.schema.json +140 -0
- package/dist/config.js +1 -0
- package/dist/examples/oidc.json.example +11 -0
- package/dist/lib/agent-keepalive.js +1 -0
- package/dist/lib/api-keys.js +1 -0
- package/dist/lib/apiKeys.js +1 -0
- package/dist/lib/auto-judge.js +1 -0
- package/dist/lib/basic-auth.js +1 -0
- package/dist/lib/build-history.js +1 -0
- package/dist/lib/build-output-service.js +1 -0
- package/dist/lib/build-scheduler.js +1 -0
- package/dist/lib/build-service.js +1 -0
- package/dist/lib/claude-oauth-refresh.js +1 -0
- package/dist/lib/cli/build.js +1 -0
- package/dist/lib/cli/config-command.js +1 -0
- package/dist/lib/cli/config.js +1 -0
- package/dist/lib/cli/create-user.js +1 -0
- package/dist/lib/cli/init.js +1 -0
- package/dist/lib/cli/jira.js +1 -0
- package/dist/lib/cli/license.js +1 -0
- package/dist/lib/cli/server-manager.js +1 -0
- package/dist/lib/container-tokens.js +1 -0
- package/dist/lib/data-dir.js +1 -0
- package/dist/lib/deployment-history.js +1 -0
- package/dist/lib/deployment-service.js +1 -0
- package/dist/lib/docker-utils.js +1 -0
- package/dist/lib/email.js +1 -0
- package/dist/lib/emailTemplates.js +1 -0
- package/dist/lib/entitlement.js +1 -0
- package/dist/lib/fetch-utils.js +1 -0
- package/dist/lib/git-provider-service.js +1 -0
- package/dist/lib/git-provider-setup/assets/coderflow_github_app.png +0 -0
- package/dist/lib/git-provider-setup/github-setup-handler.js +1 -0
- package/dist/lib/git-provider-setup/index.js +1 -0
- package/dist/lib/git-provider-setup/setup-factory.js +1 -0
- package/dist/lib/git-provider-setup/setup-interface.js +1 -0
- package/dist/lib/git-providers/azure-devops-provider.js +1 -0
- package/dist/lib/git-providers/github-app-provider.js +1 -0
- package/dist/lib/git-providers/index.js +1 -0
- package/dist/lib/git-providers/provider-factory.js +1 -0
- package/dist/lib/git-providers/provider-interface.js +1 -0
- package/dist/lib/jira-client.js +1 -0
- package/dist/lib/logger.js +1 -0
- package/dist/lib/model-fetcher.js +1 -0
- package/dist/lib/notifications.js +1 -0
- package/dist/lib/oidc-auth.js +1 -0
- package/dist/lib/oidc-device-flow.js +1 -0
- package/dist/lib/passwordTokens.js +1 -0
- package/dist/lib/pin-cascade.js +1 -0
- package/dist/lib/provider-accounts.js +1 -0
- package/dist/lib/provider-oauth.js +1 -0
- package/dist/lib/provider-profile.js +1 -0
- package/dist/lib/provider-token-refresh.js +1 -0
- package/dist/lib/roles.js +1 -0
- package/dist/lib/secrets.js +1 -0
- package/dist/lib/state-capture.js +1 -0
- package/dist/lib/static-files.js +1 -0
- package/dist/lib/task-name-generator.js +1 -0
- package/dist/lib/users.js +1 -0
- package/dist/middleware/requireAuth.js +1 -0
- package/dist/middleware/requireInit.js +1 -0
- package/dist/middleware/requirePermission.js +1 -0
- package/dist/package-lock.json +4151 -0
- package/dist/package.json +50 -0
- package/dist/routes/apiKeys.js +1 -0
- package/dist/routes/auth-oidc.js +1 -0
- package/dist/routes/auth.js +1 -0
- package/dist/routes/build.js +1 -0
- package/dist/routes/containers.js +1 -0
- package/dist/routes/deploy-task.js +1 -0
- package/dist/routes/environment-management.js +1 -0
- package/dist/routes/environments.js +1 -0
- package/dist/routes/external-skills.js +1 -0
- package/dist/routes/git-credentials.js +1 -0
- package/dist/routes/git-provider-setup.js +1 -0
- package/dist/routes/health.js +1 -0
- package/dist/routes/jira.js +1 -0
- package/dist/routes/objective-management.js +1 -0
- package/dist/routes/password.js +1 -0
- package/dist/routes/prompt.js +1 -0
- package/dist/routes/provider-auth.js +1 -0
- package/dist/routes/qa.js +1 -0
- package/dist/routes/settings.js +1 -0
- package/dist/routes/skill-management.js +1 -0
- package/dist/routes/skills.js +1 -0
- package/dist/routes/tasks.js +2 -0
- package/dist/routes/templates.js +1 -0
- package/dist/routes/test-task.js +1 -0
- package/dist/routes/test.js +1 -0
- package/dist/routes/users.js +1 -0
- package/dist/routes/visualizations.js +1 -0
- package/dist/schemas/template-metadata.schema.json +178 -0
- package/dist/scripts/create-user.js +2 -0
- package/dist/shipped-skills/environment-instructions/SKILL.md +154 -0
- package/dist/shipped-skills/environment-templates/SKILL.md +282 -0
- package/dist/shipped-skills/objective-management/SKILL.md +238 -0
- package/dist/shipped-skills/skill-editor/SKILL.md +326 -0
- package/dist/start.js +2 -0
- package/dist/web-ui/public/activity-detail-modal.js +1 -0
- package/dist/web-ui/public/activity-feed.js +1 -0
- package/dist/web-ui/public/activity-formatters.js +1 -0
- package/dist/web-ui/public/agent-event-parser.js +1 -0
- package/dist/web-ui/public/app.js +1 -0
- package/dist/web-ui/public/approve-dialog.js +1 -0
- package/dist/web-ui/public/coderflow-logo-reversed.svg +46 -0
- package/dist/web-ui/public/coderflow-logo.svg +46 -0
- package/dist/web-ui/public/comments-widget.js +1 -0
- package/dist/web-ui/public/docs/.nojekyll +0 -0
- package/dist/web-ui/public/docs/README.md +26 -0
- package/dist/web-ui/public/docs/_sidebar.md +47 -0
- package/dist/web-ui/public/docs/admin/ai-providers.md +132 -0
- package/dist/web-ui/public/docs/admin/email-notifications.md +69 -0
- package/dist/web-ui/public/docs/admin/environments.md +215 -0
- package/dist/web-ui/public/docs/admin/git-providers.md +147 -0
- package/dist/web-ui/public/docs/admin/installation.md +313 -0
- package/dist/web-ui/public/docs/admin/skills.md +35 -0
- package/dist/web-ui/public/docs/admin/sso.md +241 -0
- package/dist/web-ui/public/docs/admin/users-and-roles.md +57 -0
- package/dist/web-ui/public/docs/code/cli.md +102 -0
- package/dist/web-ui/public/docs/code/files-and-editing.md +86 -0
- package/dist/web-ui/public/docs/code/terminal-access.md +110 -0
- package/dist/web-ui/public/docs/code/vscode-extension.md +58 -0
- package/dist/web-ui/public/docs/getting-started/core-concepts.md +129 -0
- package/dist/web-ui/public/docs/getting-started/overview.md +46 -0
- package/dist/web-ui/public/docs/index.html +151 -0
- package/dist/web-ui/public/docs/integrations/custom.md +58 -0
- package/dist/web-ui/public/docs/integrations/ibmi/overview.md +58 -0
- package/dist/web-ui/public/docs/integrations/overview.md +48 -0
- package/dist/web-ui/public/docs/objectives/qa-mode.md +90 -0
- package/dist/web-ui/public/docs/objectives/staged-tasks.md +60 -0
- package/dist/web-ui/public/docs/objectives/working-with-objectives.md +102 -0
- package/dist/web-ui/public/docs/tasks/approval-and-deployment.md +83 -0
- package/dist/web-ui/public/docs/tasks/creating-tasks.md +111 -0
- package/dist/web-ui/public/docs/tasks/judging.md +114 -0
- package/dist/web-ui/public/docs/tasks/providing-feedback.md +41 -0
- package/dist/web-ui/public/docs/tasks/task-groups.md +73 -0
- package/dist/web-ui/public/docs/tasks/winner-selection.md +75 -0
- package/dist/web-ui/public/docs/templates/batch-processing.md +152 -0
- package/dist/web-ui/public/docs/templates/task-templates.md +44 -0
- package/dist/web-ui/public/docs/templates/template-examples.md +93 -0
- package/dist/web-ui/public/docs/testing/profound-automated-testing.md +77 -0
- package/dist/web-ui/public/docs/testing/task-visualizations.md +42 -0
- package/dist/web-ui/public/docs/testing/testing-menu.md +118 -0
- package/dist/web-ui/public/environments.css +3942 -0
- package/dist/web-ui/public/environments.html +1791 -0
- package/dist/web-ui/public/environments.js +1 -0
- package/dist/web-ui/public/favicon-16.png +0 -0
- package/dist/web-ui/public/favicon-32.png +0 -0
- package/dist/web-ui/public/favicon.ico +0 -0
- package/dist/web-ui/public/feedback-widget.css +3133 -0
- package/dist/web-ui/public/feedback-widget.js +1 -0
- package/dist/web-ui/public/git-history.css +2663 -0
- package/dist/web-ui/public/git-history.html +272 -0
- package/dist/web-ui/public/git-history.js +1 -0
- package/dist/web-ui/public/git-status.js +1 -0
- package/dist/web-ui/public/index.html +1459 -0
- package/dist/web-ui/public/index.js +1 -0
- package/dist/web-ui/public/login.html +346 -0
- package/dist/web-ui/public/login.js +1 -0
- package/dist/web-ui/public/markdown-editor.js +1 -0
- package/dist/web-ui/public/markdown-file-editor.js +1 -0
- package/dist/web-ui/public/modal-maximize.js +1 -0
- package/dist/web-ui/public/notifications.js +1 -0
- package/dist/web-ui/public/server-health.js +1 -0
- package/dist/web-ui/public/settings.css +761 -0
- package/dist/web-ui/public/settings.html +1044 -0
- package/dist/web-ui/public/settings.js +1 -0
- package/dist/web-ui/public/setup-password.html +355 -0
- package/dist/web-ui/public/setup-password.js +1 -0
- package/dist/web-ui/public/skills.css +1949 -0
- package/dist/web-ui/public/skills.html +820 -0
- package/dist/web-ui/public/skills.js +1 -0
- package/dist/web-ui/public/sse-client.js +1 -0
- package/dist/web-ui/public/sse-shared-worker.js +1 -0
- package/dist/web-ui/public/styles.css +18614 -0
- package/dist/web-ui/public/task.html +1779 -0
- package/dist/web-ui/public/task.js +1 -0
- package/dist/web-ui/public/terminal.html +45 -0
- package/dist/web-ui/public/terminal.js +1 -0
- package/dist/web-ui/public/theme.js +1 -0
- package/dist/web-ui/public/users.html +298 -0
- package/dist/web-ui/public/users.js +1 -0
- package/dist/web-ui/public/variant-grouping.js +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://profoundlogic.com/schemas/template-metadata.schema.json",
|
|
4
|
+
"title": "Template Metadata Schema",
|
|
5
|
+
"description": "Schema for companion JSON files that define metadata for task templates",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"title": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Override the template title (if not specified, extracted from markdown # heading)"
|
|
11
|
+
},
|
|
12
|
+
"description": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Short description shown in template selection UI"
|
|
15
|
+
},
|
|
16
|
+
"parameters": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"description": "Parameter definitions for template variables",
|
|
19
|
+
"additionalProperties": {
|
|
20
|
+
"$ref": "#/definitions/parameter"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"definitions": {
|
|
25
|
+
"parameter": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"properties": {
|
|
28
|
+
"required": {
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"description": "Whether this parameter is required",
|
|
31
|
+
"default": false
|
|
32
|
+
},
|
|
33
|
+
"description": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "Help text shown in the UI"
|
|
36
|
+
},
|
|
37
|
+
"default": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Default value if not provided"
|
|
40
|
+
},
|
|
41
|
+
"prompt": {
|
|
42
|
+
"$ref": "#/definitions/prompt",
|
|
43
|
+
"description": "Prompt configuration for interactive selection"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"additionalProperties": false
|
|
47
|
+
},
|
|
48
|
+
"prompt": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"required": ["type"],
|
|
51
|
+
"properties": {
|
|
52
|
+
"type": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"enum": ["list", "command", "files"],
|
|
55
|
+
"description": "Type of prompt: 'list' for hard-coded options, 'command' for dynamic generation, 'files' for file/directory listing"
|
|
56
|
+
},
|
|
57
|
+
"label": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"description": "Label shown on the prompt button or dialog"
|
|
60
|
+
},
|
|
61
|
+
"multiSelect": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"description": "Allow multiple selections (only one parameter per template can have this enabled)",
|
|
64
|
+
"default": false
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"allOf": [
|
|
68
|
+
{
|
|
69
|
+
"if": {
|
|
70
|
+
"properties": { "type": { "const": "list" } }
|
|
71
|
+
},
|
|
72
|
+
"then": {
|
|
73
|
+
"properties": {
|
|
74
|
+
"type": { "const": "list" },
|
|
75
|
+
"label": { "type": "string" },
|
|
76
|
+
"multiSelect": { "type": "boolean" },
|
|
77
|
+
"options": {
|
|
78
|
+
"type": "array",
|
|
79
|
+
"description": "Hard-coded list of choices",
|
|
80
|
+
"minItems": 1,
|
|
81
|
+
"items": {
|
|
82
|
+
"$ref": "#/definitions/option"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"required": ["options"],
|
|
87
|
+
"additionalProperties": false
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"if": {
|
|
92
|
+
"properties": { "type": { "const": "command" } }
|
|
93
|
+
},
|
|
94
|
+
"then": {
|
|
95
|
+
"properties": {
|
|
96
|
+
"type": { "const": "command" },
|
|
97
|
+
"label": { "type": "string" },
|
|
98
|
+
"multiSelect": { "type": "boolean" },
|
|
99
|
+
"command": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"description": "Shell command to run in container to generate choices"
|
|
102
|
+
},
|
|
103
|
+
"parser": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"enum": ["json", "lines", "git-branches", "files"],
|
|
106
|
+
"description": "Built-in parser to use for command output",
|
|
107
|
+
"default": "json"
|
|
108
|
+
},
|
|
109
|
+
"repos": {
|
|
110
|
+
"type": "array",
|
|
111
|
+
"description": "Optional list of repo names to update (e.g., ['converter']). If omitted, all environment repos are updated.",
|
|
112
|
+
"items": {
|
|
113
|
+
"type": "string"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"required": ["command"],
|
|
118
|
+
"additionalProperties": false
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"if": {
|
|
123
|
+
"properties": { "type": { "const": "files" } }
|
|
124
|
+
},
|
|
125
|
+
"then": {
|
|
126
|
+
"properties": {
|
|
127
|
+
"type": { "const": "files" },
|
|
128
|
+
"label": { "type": "string" },
|
|
129
|
+
"multiSelect": { "type": "boolean" },
|
|
130
|
+
"path": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"description": "Directory path relative to /workspace"
|
|
133
|
+
},
|
|
134
|
+
"include": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"enum": ["files", "directories", "both"],
|
|
137
|
+
"description": "What to include in the listing",
|
|
138
|
+
"default": "files"
|
|
139
|
+
},
|
|
140
|
+
"pattern": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"description": "Optional glob pattern (e.g., '*.{rpg,rpgle,sqlrpgle}')"
|
|
143
|
+
},
|
|
144
|
+
"repos": {
|
|
145
|
+
"type": "array",
|
|
146
|
+
"description": "Optional list of repo names to update (e.g., ['converter']). If omitted, all environment repos are updated.",
|
|
147
|
+
"items": {
|
|
148
|
+
"type": "string"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"required": ["path"],
|
|
153
|
+
"additionalProperties": false
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
"option": {
|
|
159
|
+
"type": "object",
|
|
160
|
+
"required": ["value"],
|
|
161
|
+
"properties": {
|
|
162
|
+
"value": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"description": "The actual value to use when this option is selected"
|
|
165
|
+
},
|
|
166
|
+
"label": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"description": "Display text for this option (defaults to value if not specified)"
|
|
169
|
+
},
|
|
170
|
+
"description": {
|
|
171
|
+
"type": "string",
|
|
172
|
+
"description": "Additional description text shown in smaller font"
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"additionalProperties": false
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
(function(_0x48cc07,_0x2216a5){const _0x4ccb87={_0x131cd4:0x410,_0x121cf9:0x44e,_0x769548:0x45d,_0x4ab02c:0x430,_0x2fe5cb:0x441,_0x35274c:0x240,_0x298158:0x2a0,_0x2ebed7:0x2a3,_0x1ab624:0x47c,_0x54f751:0x499,_0x5cfc61:0x468,_0x26027e:0x479,_0x8c4e18:0x256,_0x5e3fed:0x24e,_0x221001:0x452,_0xc459d4:0x3fd,_0x5ada48:0x43a,_0x436655:0x293,_0x3c7e88:0x280,_0x5e7eb2:0x2c1,_0x4f0746:0x29f},_0x36edc7={_0x27a923:0x2d1};function _0x3a0db4(_0x138bde,_0x5d3a46,_0xcf5327,_0x4ff9aa){return _0x792e(_0x5d3a46-_0x36edc7._0x27a923,_0x4ff9aa);}function _0x5da951(_0x491256,_0x7b2964,_0x2f7c85,_0x27f296){return _0x792e(_0x7b2964-0xf1,_0x491256);}const _0xf27e25=_0x48cc07();while(!![]){try{const _0x2705a3=-parseInt(_0x5da951(0x28e,0x26e,0x29f,0x29d))/(-0x26f3+0x4*-0x345+0x3408)+parseInt(_0x3a0db4(_0x4ccb87._0x131cd4,0x442,_0x4ccb87._0x121cf9,_0x4ccb87._0x769548))/(-0x977*0x4+-0xb61*0x1+0x313f*0x1)+-parseInt(_0x3a0db4(0x429,_0x4ccb87._0x4ab02c,0x408,_0x4ccb87._0x2fe5cb))/(-0x2298+0x20cc+0x1cf)*(-parseInt(_0x5da951(0x28f,0x263,_0x4ccb87._0x35274c,0x260))/(0x2*0x8ed+0x17ea+-0x29c0))+-parseInt(_0x5da951(_0x4ccb87._0x298158,0x2a9,0x285,_0x4ccb87._0x2ebed7))/(0x13ba+-0x5fb+-0xdba)+parseInt(_0x3a0db4(_0x4ccb87._0x1ab624,_0x4ccb87._0x54f751,_0x4ccb87._0x5cfc61,_0x4ccb87._0x26027e))/(-0x1bfa+-0x240c+0x400c)*(-parseInt(_0x5da951(0x228,_0x4ccb87._0x8c4e18,_0x4ccb87._0x5e3fed,0x279))/(-0x1a03+-0x24f6+0xc*0x540))+-parseInt(_0x3a0db4(_0x4ccb87._0x221001,0x434,_0x4ccb87._0xc459d4,_0x4ccb87._0x5ada48))/(0x3a7*0x1+0x6*0x5d5+0x293*-0xf)*(-parseInt(_0x5da951(_0x4ccb87._0x436655,0x269,0x294,0x277))/(-0x20e*0x13+-0x1ea3+0x45b6))+-parseInt(_0x5da951(0x2c3,0x2a7,_0x4ccb87._0x3c7e88,0x274))/(0x2614+-0x5*0x1d+-0x2579)*(-parseInt(_0x5da951(_0x4ccb87._0x5e7eb2,_0x4ccb87._0x4f0746,0x298,0x2d5))/(-0x1d*0x4c+0x16e3+-0xe3c));if(_0x2705a3===_0x2216a5)break;else _0xf27e25['push'](_0xf27e25['shift']());}catch(_0x43f69a){_0xf27e25['push'](_0xf27e25['shift']());}}}(_0x19ce,0x1d7fb1+0xbd692+-0x1a317a));function _0x792e(_0x432134,_0x563eee){_0x432134=_0x432134-(0xab0+0x2295+0x1*-0x2beb);const _0x2f2b86=_0x19ce();let _0x594e3f=_0x2f2b86[_0x432134];if(_0x792e['JpnTpy']===undefined){var _0x13a75b=function(_0x39cbd4){const _0x2035b6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1286ae='',_0x132c04='';for(let _0x8cfd22=0x4*0x72f+0xd3*-0x2f+-0x1*-0xa01,_0x17912f,_0x173579,_0x3384df=-0xa44+0x5*0x1ea+0xb2;_0x173579=_0x39cbd4['charAt'](_0x3384df++);~_0x173579&&(_0x17912f=_0x8cfd22%(0x1*-0x2450+-0x2a5*-0x7+-0x11d1*-0x1)?_0x17912f*(0x1413+-0x25f8+0x1225)+_0x173579:_0x173579,_0x8cfd22++%(-0x155d+0xfe2+-0x43*-0x15))?_0x1286ae+=String['fromCharCode'](-0xeb8+-0xedf+0x1e96&_0x17912f>>(-(0x107*0x1c+-0x2b*-0x26+0x1*-0x2324)*_0x8cfd22&0xa*-0x277+0xa5e+0xe4e*0x1)):0x129*0xd+-0x2fc+0x1*-0xc19){_0x173579=_0x2035b6['indexOf'](_0x173579);}for(let _0xd8e5f7=-0x85b*-0x2+-0x1c00+0x5a5*0x2,_0x307e36=_0x1286ae['length'];_0xd8e5f7<_0x307e36;_0xd8e5f7++){_0x132c04+='%'+('00'+_0x1286ae['charCodeAt'](_0xd8e5f7)['toString'](-0x1*-0x1c36+0xb*0x55+-0x1fcd))['slice'](-(0x3d6*0x3+-0xe0c+-0x2*-0x146));}return decodeURIComponent(_0x132c04);};_0x792e['IDXsOv']=_0x13a75b,_0x792e['hhCmDE']={},_0x792e['JpnTpy']=!![];}const _0x3a3252=_0x2f2b86[0x5*0x39d+-0x16c+-0x10a5],_0x2265ff=_0x432134+_0x3a3252,_0x8535f9=_0x792e['hhCmDE'][_0x2265ff];return!_0x8535f9?(_0x594e3f=_0x792e['IDXsOv'](_0x594e3f),_0x792e['hhCmDE'][_0x2265ff]=_0x594e3f):_0x594e3f=_0x8535f9,_0x594e3f;}import{createUser,findUserByUsername}from'../lib/users.js';import{logger}from'../lib/logger.js';async function main(){const _0x510609={_0x33d17e:0x82,_0x5c9e92:0x9,_0x321f4e:0x45,_0x1cb591:0x39,_0x3c883b:0x2a,_0x1268f8:0x44,_0x427ae5:0x1c,_0x206594:0x8d,_0x1d79fe:0x80,_0x4ae55a:0x13,_0x24af83:0x87,_0x416337:0x77,_0xd854f2:0x31,_0x289845:0x33,_0x14a4b4:0x2b,_0x163d34:0xb,_0x1d643d:0x20,_0x2f18d4:0x3c,_0x3c20af:0x18,_0x334fe3:0x4c,_0x19df5f:0x54,_0x4c9854:0x4d,_0x51dde3:0x34,_0x565433:0x16,_0x5629f8:0x6e,_0x425fd5:0x2,_0x54ec8c:0x37,_0x4164a7:0x4f,_0x1ad86a:0x50,_0x401fba:0x4b,_0x17fea8:0x17,_0x36d8f6:0x42,_0x3a0913:0x7b,_0x3859b7:0x53,_0x26b102:0x2c,_0x555ca1:0x3b,_0x1551bf:0x38,_0xab7e26:0x33,_0x51863e:0x38,_0x27807d:0x8,_0x45c005:0x4b,_0x3008fd:0x1f,_0x543183:0x2e,_0x310e3e:0x51,_0x127641:0xa,_0x26b6ab:0x63,_0xd06d9c:0x4a,_0x488927:0x3e,_0x13dfa1:0x68,_0xf658d0:0x26,_0x3a768f:0x8,_0x35105b:0x17,_0x44ad75:0x2c,_0x15d5d2:0x81,_0x525267:0x60,_0x585273:0x43,_0x30e1a5:0x9a,_0x5a59b4:0x3d,_0x1f329d:0x9f,_0x3a92de:0x72,_0x36f155:0x2c,_0x42fe2f:0x50,_0x3558d6:0x5a,_0x3aa645:0x70,_0x2092f6:0x6c,_0x142da5:0x3c,_0x2a3646:0x21,_0x226fdb:0x32,_0x16b1f3:0x36,_0x30c383:0x9f,_0x384537:0x52,_0x55b02f:0x5a,_0x39391d:0x15,_0x15ad89:0x2f,_0x557909:0x22,_0x196970:0x58,_0x480327:0x3,_0x5200a7:0x9,_0x57ab59:0x7d,_0x4ba8c:0x75,_0x492dd5:0x1d,_0x4bf0b3:0xf,_0x590b48:0x2f,_0x3dd5ff:0x4a,_0x1ed387:0x65,_0x5550f3:0x35,_0x5d65b3:0x6b,_0x442c6d:0x35,_0x5e42f1:0x1,_0x168127:0x23,_0xc4f504:0x74,_0x2f9504:0xa6,_0x2f89e2:0x7b,_0x1d044d:0x38,_0x450946:0x53,_0xd99096:0x25,_0x490bb7:0x12,_0x51f9d1:0x2b,_0x2d9f0e:0x46,_0x5798c0:0x3c,_0x5b4426:0x43,_0x398fcf:0x3a,_0x103bd5:0x55,_0x410ace:0x14,_0xeb01e6:0x26,_0x5cdfa3:0x38,_0x180894:0x9a,_0x57e610:0x71,_0x4597f2:0x28,_0x5928c8:0x29,_0x4e3283:0x40,_0x3805f7:0x4c,_0x3b012a:0x79,_0x8b89cf:0x2e,_0x1ae43f:0x32,_0x34d772:0x42,_0x29d24d:0x5b,_0x4edc38:0x30,_0x43fa90:0x2e,_0xabd8ac:0x38,_0x2a97f0:0x7a,_0x405ada:0x2b,_0xec257d:0x83,_0x981934:0x50,_0x1ec35e:0xe,_0x353f1d:0x56,_0x3afba9:0x10,_0x488593:0x6e,_0x3ed2fc:0x7b,_0x157fcf:0x62,_0x127c5e:0xc,_0x27778e:0x1e,_0x4b1794:0x19,_0x4f7ec1:0x15,_0x631107:0x5d,_0x57ff76:0x38,_0x1b9e09:0x5b,_0x59e8c5:0x7c,_0x8fb1a6:0x3e,_0x1f84d9:0x5,_0x317251:0x31,_0x120674:0x47,_0x17b5c0:0x9e,_0x19b9a3:0x7,_0x176165:0x5b,_0xfb6165:0x4a,_0x499bb4:0x67,_0x3e2269:0x1b,_0x40fcd9:0x74,_0x3ed853:0x85,_0x58a89c:0x2c,_0x2a0d18:0x9,_0x40e834:0x54,_0x150c13:0x2e,_0xdea129:0x56,_0x223ffe:0x66,_0x3cded5:0x90,_0x51f698:0x4e,_0x21afc3:0x61,_0x1e1c8f:0x57,_0x22af5f:0x69,_0x10edca:0x6,_0x4481b3:0x19,_0xa5289d:0x1d,_0x3597e1:0x6f,_0x40e8a4:0x2f,_0x56932a:0x5c,_0x2557a4:0x60,_0x1015da:0x48,_0x3dffc8:0x38,_0x368c5e:0x3e,_0x2c5f19:0x4b,_0x4421dd:0x1a,_0x1c4165:0x29,_0xe42db5:0x1c,_0x58ff83:0x3e,_0x4ad3a7:0x1c,_0x148d44:0x19,_0x3e9088:0x4,_0x2982da:0x41,_0x5bdc6f:0x2d,_0x3dc00d:0x11,_0x4c8ccf:0x4f,_0x4e3860:0x8,_0x328818:0x12,_0x409a5b:0xc,_0x41aa14:0x2a,_0x1c2f20:0x29,_0x479e2c:0x15,_0x24b5eb:0x1a,_0x111acf:0x38,_0x414f43:0x7b,_0x53e77d:0x64,_0x1baefe:0x5d,_0x4bb352:0x3,_0x5233ba:0x2e,_0x740ba:0x29,_0x1eedc2:0x1d,_0x1596ac:0x27},_0x582add={};_0x582add[_0x1c03ba(0x45,0x1e,_0x510609._0x33d17e,0x55)]='Error:\x20Pas'+_0x1c03ba(_0x510609._0x5c9e92,0x66,_0x510609._0x321f4e,_0x510609._0x1cb591)+_0x1c03ba(_0x510609._0x3c883b,_0x510609._0x1268f8,_0x510609._0x427ae5,0x3f)+_0x1c03ba(0x8a,_0x510609._0x206594,_0x510609._0x1d79fe,0x67)+_0x4e4f16(-_0x510609._0x427ae5,0x2,-0x45,-_0x510609._0x4ae55a)+'.',_0x582add['oATvO']=function(_0x45c7b8,_0x3dc437){return _0x45c7b8<_0x3dc437;},_0x582add['kEDDJ']=_0x1c03ba(_0x510609._0x24af83,0x9d,0xae,_0x510609._0x416337)+_0x4e4f16(-_0x510609._0xd854f2,-_0x510609._0x289845,-_0x510609._0x14a4b4,0x5)+_0x1c03ba(-_0x510609._0x163d34,-_0x510609._0x1d643d,_0x510609._0x2f18d4,_0x510609._0x3c20af)+_0x4e4f16(-0x34,-_0x510609._0x334fe3,-0x9,-0x24)+_0x1c03ba(0x6,0x31,-0xa,0x24)+'il>\x20<name>'+_0x4e4f16(-0x26,-_0x510609._0x19df5f,-0x3f,-0x58)+_0x4e4f16(-0x49,-0x7d,-_0x510609._0x4c9854,-0x12),_0x582add[_0x1c03ba(0x1f,_0x510609._0x51dde3,0xa,_0x510609._0x2f18d4)]=_0x4e4f16(0x4,_0x510609._0x565433,-0x28,-0x34),_0x582add[_0x1c03ba(_0x510609._0x5629f8,_0x510609._0x425fd5,0x9,_0x510609._0x54ec8c)]='\x20\x20username'+_0x1c03ba(_0x510609._0x4164a7,0x1e,_0x510609._0x1ad86a,_0x510609._0x321f4e)+_0x1c03ba(_0x510609._0x401fba,0xb,_0x510609._0x17fea8,_0x510609._0x36d8f6)+'for\x20login',_0x582add[_0x1c03ba(0x36,0x5e,_0x510609._0x3a0913,0x52)]='\x20\x20email\x20\x20\x20'+_0x1c03ba(0x57,-0xb,_0x510609._0x3859b7,0x25)+_0x4e4f16(-_0x510609._0x26b102,0xb,-0x48,-_0x510609._0x555ca1)+'ss',_0x582add[_0x4e4f16(0xf,_0x510609._0x1551bf,_0x510609._0xab7e26,_0x510609._0x51863e)]=_0x4e4f16(-0x15,-0x24,-0x5,_0x510609._0x27807d)+_0x1c03ba(0x42,-0x11,-0x13,0x21)+_0x1c03ba(0x65,0x53,0x6c,_0x510609._0x45c005)+_0x4e4f16(-_0x510609._0x3008fd,-_0x510609._0x543183,-0x2a,-_0x510609._0x310e3e);function _0x4e4f16(_0x5d10bb,_0x44160c,_0x13b58b,_0x4e13b4){return _0x792e(_0x5d10bb- -0x1b8,_0x44160c);}_0x582add[_0x1c03ba(0x46,0x37,_0x510609._0x425fd5,0x1a)]=_0x4e4f16(-0x51,-0x46,-0x44,-0x4b)+_0x4e4f16(_0x510609._0x127641,0x35,-0x2c,-0x11)+_0x1c03ba(_0x510609._0x26b6ab,_0x510609._0xd06d9c,0x28,0x5a)+_0x1c03ba(0x35,0x9e,_0x510609._0x488927,_0x510609._0x13dfa1)+'hed)',_0x582add[_0x4e4f16(-0xb,_0x510609._0xf658d0,-0x23,-_0x510609._0x3a768f)]=_0x4e4f16(-0x30,-0xd,-_0x510609._0x35105b,-0x2b)+_0x1c03ba(_0x510609._0x3c883b,0x4e,0x14,0x41)+_0x1c03ba(-0x4,_0x510609._0x27807d,_0x510609._0x44ad75,0x34)+_0x1c03ba(_0x510609._0x15d5d2,0x36,_0x510609._0x525267,0x59)+_0x1c03ba(_0x510609._0x585273,0x9e,_0x510609._0x30e1a5,0x71)+_0x1c03ba(-_0x510609._0x163d34,_0x510609._0x5a59b4,0x32,0x8),_0x582add[_0x1c03ba(0x6f,0x5c,_0x510609._0x1f329d,_0x510609._0x3a92de)]=_0x1c03ba(0x52,0x42,_0x510609._0x543183,_0x510609._0x36f155),_0x582add['jRYrA']=_0x4e4f16(-0x56,-_0x510609._0x42fe2f,-0x48,-0x51)+_0x4e4f16(-_0x510609._0x3558d6,-0x78,-_0x510609._0x3aa645,-0x51)+'e-user.js\x20'+'admin\x20admi'+'n@example.'+_0x1c03ba(_0x510609._0x15d5d2,0x46,0x3d,_0x510609._0x2092f6)+_0x4e4f16(-_0x510609._0x1ad86a,-0x19,-0x82,-0x45)+'urepass123'+_0x4e4f16(-0x10,-_0x510609._0x142da5,-_0x510609._0x2a3646,-_0x510609._0x226fdb);function _0x1c03ba(_0x3b716f,_0x121649,_0x3d645b,_0xda2fa9){return _0x792e(_0xda2fa9- -0x152,_0x3d645b);}_0x582add[_0x4e4f16(-_0x510609._0x1268f8,-_0x510609._0x16b1f3,-0x41,-0x43)]=_0x1c03ba(0x6b,0x42,_0x510609._0x30c383,0x73),_0x582add[_0x4e4f16(-_0x510609._0x384537,-_0x510609._0x55b02f,-0x80,-0x3a)]='admin',_0x582add[_0x1c03ba(-0x2,_0x510609._0x39391d,0x0,_0x510609._0x15ad89)]=function(_0x5e0aa8,_0x38d42e){return _0x5e0aa8!==_0x38d42e;},_0x582add[_0x4e4f16(-0xf,-0xe,_0x510609._0x557909,0x9)]=_0x1c03ba(0x6b,0x40,0x31,_0x510609._0x196970)+_0x4e4f16(-_0x510609._0x3a768f,-_0x510609._0x480327,_0x510609._0x3c883b,-_0x510609._0x5200a7)+_0x1c03ba(_0x510609._0x57ab59,0x97,_0x510609._0x4ba8c,0x60),_0x582add['FWyED']='User\x20Detai'+_0x4e4f16(-_0x510609._0x4164a7,-0x1e,-_0x510609._0x57ab59,-0x70),_0x582add[_0x4e4f16(-0x16,_0x510609._0x492dd5,-_0x510609._0x492dd5,-0x12)]=_0x1c03ba(0x60,_0x510609._0x4bf0b3,0x31,_0x510609._0x289845)+_0x4e4f16(-0x4a,-_0x510609._0x590b48,-0x3f,-_0x510609._0x3dd5ff)+'\x20in\x20with\x20t'+_0x1c03ba(0x1b,0x1a,0x21,0x44)+_0x4e4f16(-0x48,-_0x510609._0x1ed387,-_0x510609._0x5550f3,-_0x510609._0x5d65b3)+_0x1c03ba(_0x510609._0x442c6d,0x4b,-_0x510609._0x5e42f1,_0x510609._0x168127),_0x582add[_0x4e4f16(-0x3c,-0x16,-0x22,-0x6f)]='SeLvM';const _0x22980e=_0x582add,_0x397bee=process[_0x1c03ba(_0x510609._0xc4f504,_0x510609._0x2f9504,_0x510609._0x2f89e2,0x74)]['slice'](0x1*-0x20e1+0x5*-0x7a+0x2345);_0x22980e[_0x4e4f16(-_0x510609._0x1d044d,-_0x510609._0x450946,-0x2a,-_0x510609._0xd99096)](_0x397bee[_0x1c03ba(-_0x510609._0x490bb7,0xa,_0x510609._0x51f9d1,_0x510609._0x490bb7)],-0x1*0x54a+0x5d2+-0x84)&&(console[_0x1c03ba(_0x510609._0x2d9f0e,0x2c,0x38,_0x510609._0x1d044d)](_0x22980e[_0x4e4f16(-0x1d,-0x2f,-0x51,-0x21)]),console['error'](''),console['error'](_0x22980e['Lztcp']),console[_0x4e4f16(-_0x510609._0x543183,-_0x510609._0x5798c0,-0x49,-_0x510609._0x15ad89)](_0x22980e[_0x4e4f16(-0x2f,-_0x510609._0x5b4426,-_0x510609._0x398fcf,-0x59)]),console[_0x4e4f16(-0x2e,0x5,-_0x510609._0x103bd5,-_0x510609._0xab7e26)](_0x22980e[_0x4e4f16(-_0x510609._0x410ace,0x10,-_0x510609._0xeb01e6,0x5)]),console[_0x1c03ba(0x34,0x13,0x32,_0x510609._0x5cdfa3)](_0x22980e[_0x1c03ba(_0x510609._0x180894,_0x510609._0x15d5d2,_0x510609._0x57e610,_0x510609._0x4ba8c)]),console[_0x1c03ba(_0x510609._0x4597f2,_0x510609._0x5928c8,_0x510609._0x4e3283,0x38)](_0x22980e[_0x4e4f16(-_0x510609._0x3805f7,-0x17,-_0x510609._0x3558d6,-_0x510609._0x3b012a)]),console[_0x4e4f16(-_0x510609._0x8b89cf,-_0x510609._0x1ae43f,-0xd,-_0x510609._0x34d772)](_0x22980e[_0x1c03ba(_0x510609._0x3805f7,0x4a,0x41,_0x510609._0x29d24d)]),console[_0x1c03ba(_0x510609._0x4edc38,0x13,_0x510609._0x43fa90,0x38)](''),console[_0x1c03ba(_0x510609._0x2d9f0e,0x1c,0x45,_0x510609._0xabd8ac)](_0x22980e[_0x1c03ba(0xa6,_0x510609._0x2a97f0,_0x510609._0x180894,_0x510609._0x3a92de)]),console[_0x4e4f16(-_0x510609._0x8b89cf,-0x1,-0x40,-0x43)](_0x22980e[_0x4e4f16(-_0x510609._0x405ada,-0x1e,-0x4e,-0x3c)]),process['exit'](0x61*-0x30+-0x13*-0x83+0x878));const [_0x5de63d,_0x1d0ffb,_0x56680a,_0x1a61e8,_0xeac393=_0x22980e['zdrhM']]=_0x397bee;_0xeac393!==_0x22980e[_0x4e4f16(-0x52,-0x51,-_0x510609._0xec257d,-_0x510609._0x981934)]&&_0x22980e[_0x4e4f16(-0x37,-0x54,-0x54,-_0x510609._0x1ec35e)](_0xeac393,'user')&&(console[_0x1c03ba(_0x510609._0x353f1d,_0x510609._0x3afba9,_0x510609._0x4ae55a,_0x510609._0xabd8ac)](_0x4e4f16(-_0x510609._0x29d24d,-_0x510609._0x4edc38,-_0x510609._0x488593,-0x24)+_0x4e4f16(-_0x510609._0x5e42f1,-0x19,-0x27,-0x19)+'\x22'+_0xeac393+(_0x1c03ba(0x7b,_0x510609._0x3ed2fc,0x65,_0x510609._0x157fcf)+_0x1c03ba(_0x510609._0x3c20af,0x44,_0x510609._0x410ace,0x4c)+_0x1c03ba(0x10,-_0x510609._0x127c5e,_0x510609._0x27778e,_0x510609._0x4b1794))),process[_0x4e4f16(-0x23,-0x35,-0x3d,-_0x510609._0xd99096)](0x1*-0x5ae+-0x2*0xf7c+0x24a7));const _0x237ca3=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;!_0x237ca3[_0x4e4f16(0x9,_0x510609._0x127c5e,-_0x510609._0x4f7ec1,-_0x510609._0x39391d)](_0x1d0ffb)&&(console[_0x1c03ba(_0x510609._0x26b6ab,_0x510609._0x631107,0x37,_0x510609._0x57ff76)](_0x4e4f16(-_0x510609._0x1b9e09,-0x6c,-_0x510609._0x59e8c5,-_0x510609._0x8fb1a6)+_0x4e4f16(_0x510609._0x1f84d9,0x4,-0xd,-_0x510609._0x168127)+_0x1c03ba(0x40,0x3a,0x9,_0x510609._0x317251)+_0x1d0ffb+'\x22.'),process['exit'](0x18b7+0xac6+-0x237c));const _0x3c26e1=/^[a-zA-Z0-9_-]+$/;!_0x3c26e1[_0x1c03ba(_0x510609._0x120674,_0x510609._0x17b5c0,_0x510609._0x398fcf,0x6f)](_0x5de63d)&&(console[_0x4e4f16(-_0x510609._0x8b89cf,_0x510609._0x19b9a3,-0x4c,-0x5d)](_0x4e4f16(-_0x510609._0x176165,-0x49,-0x36,-_0x510609._0x13dfa1)+_0x4e4f16(-0x4b,-0x5a,-_0x510609._0x310e3e,-_0x510609._0x57ab59)+_0x1c03ba(-0xd,_0x510609._0xfb6165,_0x510609._0x410ace,0x28)+_0x5de63d+(_0x1c03ba(0x69,_0x510609._0x59e8c5,_0x510609._0x499bb4,0x4f)+_0x4e4f16(-_0x510609._0x3c20af,-0x4f,-_0x510609._0x3e2269,-_0x510609._0xd99096)+_0x1c03ba(_0x510609._0x40fcd9,0x33,_0x510609._0x3ed853,_0x510609._0x19df5f)+'underscore'+'s,\x20and\x20hyp'+_0x1c03ba(0x5,-0x1,_0x510609._0x58a89c,_0x510609._0x2a0d18))),process['exit'](0xd7+-0x7e9+-0x1*-0x713));_0x1a61e8[_0x4e4f16(-_0x510609._0x40e834,-0x62,-0x68,-0x3b)]<0x2160+0x1f54+0x40ac*-0x1&&(console[_0x4e4f16(-_0x510609._0x150c13,-0x22,-0x1b,-0x57)](_0x22980e[_0x4e4f16(-0x11,-0x16,-0x13,-0x49)]),process[_0x4e4f16(-0x23,-0x21,-_0x510609._0x15ad89,-_0x510609._0xdea129)](0x18b1+-0x25a2+-0x2*-0x679));try{const _0x3228d9=await findUserByUsername(_0x5de63d);_0x3228d9&&(console[_0x1c03ba(0x6f,0x47,0x2a,_0x510609._0x1551bf)](_0x1c03ba(0x26,0x2d,_0x510609._0x490bb7,0x46)+_0x1c03ba(_0x510609._0x223ffe,_0x510609._0x3cded5,_0x510609._0x51f698,_0x510609._0x21afc3)+_0x5de63d+(_0x4e4f16(-_0x510609._0x1e1c8f,-0x2c,-_0x510609._0x120674,-0x46)+_0x1c03ba(0x5d,_0x510609._0x103bd5,0x85,_0x510609._0x22af5f))),process[_0x1c03ba(0x15,_0x510609._0x565433,0xc,_0x510609._0x5b4426)](0x1a0+0xac2+-0x1*0xc61));console[_0x4e4f16(-0x19,-0x4c,0xe,-_0x510609._0x10edca)]('Creating\x20u'+_0x1c03ba(_0x510609._0x168127,0x0,-0x19,0xe)+_0x5de63d+'\x22...');const _0x53f195={};_0x53f195[_0x1c03ba(_0x510609._0x4481b3,_0x510609._0xa5289d,0x65,0x30)]=_0x5de63d,_0x53f195[_0x4e4f16(-0x39,-_0x510609._0x3597e1,-_0x510609._0x4ae55a,-_0x510609._0x40e8a4)]=_0x1d0ffb,_0x53f195['name']=_0x56680a,_0x53f195[_0x4e4f16(-_0x510609._0x56932a,-0x82,-_0x510609._0x2557a4,-_0x510609._0x3aa645)]=_0x1a61e8,_0x53f195[_0x1c03ba(_0x510609._0x3c20af,0x6f,0x69,_0x510609._0x1015da)]=_0xeac393;const _0xec7099=await createUser(_0x53f195);console['log'](''),console['log'](_0x22980e[_0x4e4f16(-0xf,0x1f,-0x44,-0x3b)]),console['log'](''),console['log'](_0x22980e[_0x1c03ba(0x70,0x37,_0x510609._0x3dffc8,_0x510609._0x368c5e)]),console[_0x4e4f16(-0x19,-_0x510609._0x2c5f19,_0x510609._0x480327,0x4)]('\x20\x20ID:\x20\x20\x20\x20\x20'+'\x20\x20'+_0xec7099['id']),console[_0x4e4f16(-0x19,-0x11,-0x51,-0x23)](_0x1c03ba(0x9,0x57,_0x510609._0x4421dd,_0x510609._0x1c4165)+':\x20'+_0xec7099[_0x4e4f16(-0x36,-0x36,-0x5c,-0x33)]),console[_0x4e4f16(-_0x510609._0x4481b3,_0x510609._0x3afba9,-_0x510609._0xe42db5,-_0x510609._0x4c9854)]('\x20\x20Email:\x20\x20'+'\x20\x20'+_0xec7099[_0x4e4f16(-0x39,-_0x510609._0x58ff83,-0x34,-0x66)]),console[_0x1c03ba(0x19,0x52,_0x510609._0x2d9f0e,_0x510609._0x4c9854)](_0x4e4f16(0x7,0x16,_0x510609._0x4ad3a7,-0x17)+'\x20\x20'+_0xec7099['name']),console[_0x4e4f16(-_0x510609._0x148d44,-0x36,-_0x510609._0x3e9088,-_0x510609._0x2982da)](_0x1c03ba(0x76,_0x510609._0x5bdc6f,0x76,_0x510609._0x3859b7)+'\x20\x20'+_0xec7099[_0x4e4f16(-0x1e,_0x510609._0x3dc00d,-0x15,-0x20)]),console[_0x4e4f16(-_0x510609._0x148d44,-_0x510609._0x4c8ccf,-0x30,_0x510609._0x4ad3a7)](''),console[_0x1c03ba(0x1b,_0x510609._0x13dfa1,0x84,_0x510609._0x4c9854)](_0x22980e[_0x1c03ba(0x7d,0x4a,_0x510609._0x54ec8c,_0x510609._0x981934)]);}catch(_0xe23d4c){_0x22980e[_0x4e4f16(-0x37,-_0x510609._0x4e3860,-_0x510609._0x168127,-0x50)](_0x22980e[_0x4e4f16(-0x3c,-0xe,-_0x510609._0x328818,-_0x510609._0xa5289d)],_0x22980e[_0x1c03ba(-_0x510609._0x409a5b,0x5c,_0x510609._0x631107,_0x510609._0x41aa14)])?(_0x48f3ac[_0x1c03ba(0x1d,_0x510609._0x1c2f20,0x22,_0x510609._0x1551bf)](_0x22980e[_0x4e4f16(-0x11,_0x510609._0x409a5b,0xc,-0x20)]),_0x41f65c[_0x4e4f16(-_0x510609._0x168127,_0x510609._0x479e2c,0x13,-0x3)](0xa99+0x1*-0xc87+-0xb*-0x2d)):(logger[_0x1c03ba(_0x510609._0x24b5eb,0x69,0x52,_0x510609._0x111acf)](_0x1c03ba(_0x510609._0x414f43,0x6b,_0x510609._0x53e77d,_0x510609._0x1baefe)+_0x4e4f16(-_0x510609._0x4bb352,_0x510609._0x5233ba,-0x2b,-0x3)+'r',_0xe23d4c),console['error'](_0x4e4f16(-_0x510609._0x740ba,-0x41,-_0x510609._0x1eedc2,-0x17)+_0x1c03ba(_0x510609._0x3558d6,-0x4,0x54,_0x510609._0x1596ac)+_0x4e4f16(-0x7,0x2b,-0x14,-_0x510609._0x4e3860)+'\x20'+_0xe23d4c[_0x4e4f16(_0x510609._0x27807d,0x5,-0x6,0x3)]),process['exit'](0x831+-0xb1e+0x2ee));}}main();function _0x19ce(){const _0x445d99=['mtGZmtC1owXAzeHTzG','rxHHBxbSztO','zw1HAwW','B0fuDK8','qwvnCLa','DxnLCM5HBwu','igzVCM1HDcaI','CI5QCYa8DxnLCG','vgHLihvZzxiGyW','B2XLoIaIywrTAq','zsbZy3jPChrZlW','icbYB2XLicaGia','AMXqy2q','zxjYB3i','C3DVCMqGBxvZDa','BwfPBcbHzgrYzq','ALjzCKe','thP0y3a','rxjYB3i6iezHAq','rLD5ruq','igjLigf0igXLyq','idXWyxnZD29Yza','icaTifvZzxiGCG','ihvZzxjUyw1Lia','zxHPDa','AgvPCIb1C2vYBG','icaTifvUAxf1zq','rxjYB3i6ifvZzq','ihvZzxi','CM9Szq','A0vereO','y3rLCNmGBg9UzW','yw1Lig9MihrOzq','icjHzg1PBIiGBW','Bg9N','EsbSzxr0zxjZla','iI4GvxnLig9UBa','uwL0Dwm','icbUyw1LicaGia','u3HiuKi','icbsB2XLoIaGia','ig51BwjLCNmSia','BunOqxK','igfKBwLU','zhfJtfu','4PYtifvZzxiGy3jL','BIiGB3iGiNvZzq','yxnZD29YzcaODW','qwfVs1K','nJeYmdeXngDZs3zSEq','rMfPBgvKihrVia','yxrLzcbZDwnJzq','yxrLihvZzxiGlq','C3nMDwXSEse','CIaI','iI4GtxvZDcbIzq','y3jLyxrLihvZzq','ntboBMPwC1K','ywXPzcbYB2XLia','oduZnJu2mgP5tNDlvq','C3qGocbJAgfYyq','AwXSigjLigHHCW','zxHPC3rZlG','qxjNDw1LBNrZoG','ywXPzcbLBwfPBa','y29Ticjbzg1PBG','icboyw1LoIaGia','BwvZC2fNzq','DgvZDa','icaTifvZzxiGCa','CIiGkgrLzMf1Ba','DMfAA2u','DxnLCG','yxjNDG','rfH0C00','nMLVEffzBW','vxnHz2u6ig5Vza','DdOGiNvZzxiIkq','AgvUCY4','CgfZC3DVCMq','rxjYB3i6ieLUDG','Axb0CY9JCMvHDa','nZGZndvqtM9kBg4','C2vYici','iIbHBhjLywr5ia','icbUB2rLihnJCG','mtuZmteYBMzRy1nw','BgvUz3rO','mtG0mJK2n2LJuhj0rW','rgTPCNG','icbWyxnZD29Yza','ifvZzxiIihnLyW','Bhm6','y3jLyxrLlxvZzq','CIaIDxnLCIiU','zLz4EKm','ywXPzcb1C2vYBG','yw4GBM93igXVzW','pIbBCM9Szv0','yw1LigfUzcbWyq','otmXnZK2sxjnBNrY','nJr3sgT4sLK','icaTiez1BgWGBG','EMrYAe0','C3n3B3jKlG','BMfTzt4GpgvTyq','icaTifvZzxiGzq','ntmXuvztrLL2','BgvKihrVignYzq','yw1Lici','icbvC2vYBMfTzq','zuPsrNm'];_0x19ce=function(){return _0x445d99;};return _0x19ce();}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Environment Instructions
|
|
3
|
+
description: View and update the environment instructions (AGENTS.md) for this task's environment. Use this when users want to update agent guidelines, coding conventions, or environment-specific instructions.
|
|
4
|
+
argument-hint: view | update
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Environment Instructions Skill
|
|
8
|
+
|
|
9
|
+
This skill allows you to help the user view and update the environment instructions (AGENTS.md) file for the environment this task is running in.
|
|
10
|
+
|
|
11
|
+
**IMPORTANT**: This skill requires explicit user approval before making any changes. Always explain what changes you're proposing and ask the user to confirm before executing.
|
|
12
|
+
|
|
13
|
+
## Available Commands
|
|
14
|
+
|
|
15
|
+
### 1. View Current Instructions (`/environment-instructions view`)
|
|
16
|
+
|
|
17
|
+
Use this to view the current AGENTS.md content for the environment.
|
|
18
|
+
|
|
19
|
+
**When to use:**
|
|
20
|
+
- The user asks to see the current environment instructions
|
|
21
|
+
- You need to understand the existing guidelines before proposing changes
|
|
22
|
+
- The user wants to review what's currently documented
|
|
23
|
+
|
|
24
|
+
**Process:**
|
|
25
|
+
1. Fetch the current AGENTS.md content
|
|
26
|
+
2. Display it to the user
|
|
27
|
+
3. Offer to help with updates if needed
|
|
28
|
+
|
|
29
|
+
### 2. Update Instructions (`/environment-instructions update`)
|
|
30
|
+
|
|
31
|
+
Use this to update the AGENTS.md content based on learnings from this task.
|
|
32
|
+
|
|
33
|
+
**When to use:**
|
|
34
|
+
- The user asks to update environment instructions
|
|
35
|
+
- Discoveries during this task suggest guidelines need refinement
|
|
36
|
+
- New coding conventions or patterns should be documented
|
|
37
|
+
- Important context should be preserved for future tasks
|
|
38
|
+
|
|
39
|
+
**Process:**
|
|
40
|
+
1. Fetch the current instructions
|
|
41
|
+
2. Discuss proposed changes with the user
|
|
42
|
+
3. Only after user approval, submit the update
|
|
43
|
+
|
|
44
|
+
## How It Works
|
|
45
|
+
|
|
46
|
+
This skill communicates with the CoderFlow server via the environment management API. The server URL and task credentials are automatically available in the container environment.
|
|
47
|
+
|
|
48
|
+
### Environment Variables (automatically set):
|
|
49
|
+
- `CODERFLOW_SERVER_URL` - The CoderFlow server URL for API calls
|
|
50
|
+
- `TASK_ID` - This task's ID (for authentication)
|
|
51
|
+
|
|
52
|
+
### API Endpoints:
|
|
53
|
+
- `GET /api/environment-management/instructions` - Fetch current AGENTS.md content
|
|
54
|
+
- `PATCH /api/environment-management/instructions` - Update AGENTS.md content
|
|
55
|
+
|
|
56
|
+
## Usage Examples
|
|
57
|
+
|
|
58
|
+
### Viewing Instructions
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
User: "Show me the current environment instructions"
|
|
62
|
+
|
|
63
|
+
Agent: I'll fetch the current environment instructions for you.
|
|
64
|
+
|
|
65
|
+
[Executes API call]
|
|
66
|
+
|
|
67
|
+
Current AGENTS.md content:
|
|
68
|
+
---
|
|
69
|
+
# Development Guidelines
|
|
70
|
+
|
|
71
|
+
## Code Style
|
|
72
|
+
- Use TypeScript for all new code
|
|
73
|
+
- Follow ESLint configuration
|
|
74
|
+
...
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
Would you like to update any of these instructions?
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Updating Instructions
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
User: "Add a note about our new logging convention"
|
|
84
|
+
|
|
85
|
+
Agent: I'll help you update the environment instructions. Let me first fetch the current content...
|
|
86
|
+
|
|
87
|
+
[Fetches current AGENTS.md]
|
|
88
|
+
|
|
89
|
+
Current content includes guidelines about code style and testing.
|
|
90
|
+
|
|
91
|
+
I propose adding the following section:
|
|
92
|
+
|
|
93
|
+
## Logging Conventions
|
|
94
|
+
- Use the `logger` module for all logging
|
|
95
|
+
- Include structured context with log messages
|
|
96
|
+
- Use appropriate log levels: debug, info, warn, error
|
|
97
|
+
|
|
98
|
+
Would you like me to apply this update? (Please confirm)
|
|
99
|
+
|
|
100
|
+
User: "Yes, add it"
|
|
101
|
+
|
|
102
|
+
Agent: [Executes update via API]
|
|
103
|
+
Updated successfully! Future tasks in this environment will see the new logging conventions.
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Implementation
|
|
107
|
+
|
|
108
|
+
The skill executes shell commands to interact with the CoderFlow API:
|
|
109
|
+
|
|
110
|
+
### Fetch Current Instructions
|
|
111
|
+
```bash
|
|
112
|
+
curl -s "${CODERFLOW_SERVER_URL}/api/environment-management/instructions" \
|
|
113
|
+
-H "X-Task-Id: ${TASK_ID}"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Response:**
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"content": "# Development Guidelines\n\n...",
|
|
120
|
+
"environment": "my-environment",
|
|
121
|
+
"path": "AGENTS.md"
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Update Instructions
|
|
126
|
+
```bash
|
|
127
|
+
curl -s -X PATCH "${CODERFLOW_SERVER_URL}/api/environment-management/instructions" \
|
|
128
|
+
-H "Content-Type: application/json" \
|
|
129
|
+
-H "X-Task-Id: ${TASK_ID}" \
|
|
130
|
+
-d '{
|
|
131
|
+
"content": "# Updated Development Guidelines\n\n..."
|
|
132
|
+
}'
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Response:**
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"success": true,
|
|
139
|
+
"environment": "my-environment",
|
|
140
|
+
"path": "AGENTS.md",
|
|
141
|
+
"updatedAt": "2024-01-15T10:30:00Z",
|
|
142
|
+
"updatedByTaskId": "task-xxx",
|
|
143
|
+
"updatedByUserId": "user-yyy"
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Important Notes
|
|
148
|
+
|
|
149
|
+
1. **User Approval Required**: Never execute updates without explicit user confirmation
|
|
150
|
+
2. **Explain Changes**: Always clearly explain what changes will be made before asking for approval
|
|
151
|
+
3. **Preserve Context**: When updating, preserve any existing context that's still relevant
|
|
152
|
+
4. **Be Specific**: Updates should be clear, actionable guidelines
|
|
153
|
+
5. **Consider Impact**: Remember that changes affect all future tasks in this environment
|
|
154
|
+
6. **Error Handling**: If an API call fails, explain the error to the user and suggest alternatives
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Environment Templates
|
|
3
|
+
description: View and manage task templates for this environment. Use this when users want to create, update, or view templates that define reusable task patterns.
|
|
4
|
+
argument-hint: list | view <name> | update <name> | create <name>
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Environment Templates Skill
|
|
8
|
+
|
|
9
|
+
This skill allows you to help the user manage task templates for the environment this task is running in. Templates define reusable task patterns with pre-configured instructions and parameters.
|
|
10
|
+
|
|
11
|
+
**IMPORTANT**: This skill requires explicit user approval before making any changes. Always explain what changes you're proposing and ask the user to confirm before executing.
|
|
12
|
+
|
|
13
|
+
## Available Commands
|
|
14
|
+
|
|
15
|
+
### 1. List Templates (`/environment-templates list`)
|
|
16
|
+
|
|
17
|
+
List all available templates in the environment.
|
|
18
|
+
|
|
19
|
+
**When to use:**
|
|
20
|
+
- The user wants to see what templates exist
|
|
21
|
+
- You need to understand the template landscape before making changes
|
|
22
|
+
|
|
23
|
+
### 2. View Template (`/environment-templates view <name>`)
|
|
24
|
+
|
|
25
|
+
View a specific template's content and metadata.
|
|
26
|
+
|
|
27
|
+
**When to use:**
|
|
28
|
+
- The user wants to see a template's details
|
|
29
|
+
- You need to understand an existing template before proposing updates
|
|
30
|
+
|
|
31
|
+
### 3. Create Template (`/environment-templates create <name>`)
|
|
32
|
+
|
|
33
|
+
Create a new task template.
|
|
34
|
+
|
|
35
|
+
**When to use:**
|
|
36
|
+
- The user wants to create a reusable task pattern
|
|
37
|
+
- A common task type should be formalized as a template
|
|
38
|
+
- The user identifies a pattern worth capturing
|
|
39
|
+
|
|
40
|
+
### 4. Update Template (`/environment-templates update <name>`)
|
|
41
|
+
|
|
42
|
+
Update an existing template.
|
|
43
|
+
|
|
44
|
+
**When to use:**
|
|
45
|
+
- The user wants to improve an existing template
|
|
46
|
+
- Template instructions need refinement
|
|
47
|
+
- Template parameters need adjustment
|
|
48
|
+
|
|
49
|
+
### 5. Delete Template (`/environment-templates delete <name>`)
|
|
50
|
+
|
|
51
|
+
Remove a template from the environment.
|
|
52
|
+
|
|
53
|
+
**When to use:**
|
|
54
|
+
- A template is no longer needed
|
|
55
|
+
- The user explicitly requests deletion
|
|
56
|
+
|
|
57
|
+
## How It Works
|
|
58
|
+
|
|
59
|
+
This skill communicates with the CoderFlow server via the environment management API.
|
|
60
|
+
|
|
61
|
+
### Environment Variables (automatically set):
|
|
62
|
+
- `CODERFLOW_SERVER_URL` - The CoderFlow server URL for API calls
|
|
63
|
+
- `TASK_ID` - This task's ID (for authentication)
|
|
64
|
+
|
|
65
|
+
### API Endpoints:
|
|
66
|
+
- `GET /api/environment-management/templates` - List all templates
|
|
67
|
+
- `GET /api/environment-management/templates/:name` - Get specific template
|
|
68
|
+
- `PUT /api/environment-management/templates/:name` - Create or update template
|
|
69
|
+
- `DELETE /api/environment-management/templates/:name` - Delete template
|
|
70
|
+
|
|
71
|
+
## Template Structure
|
|
72
|
+
|
|
73
|
+
Templates consist of two files:
|
|
74
|
+
1. **`<name>.md`** - The template content (markdown with instructions)
|
|
75
|
+
2. **`<name>.json`** (optional) - Template metadata (description, parameters)
|
|
76
|
+
|
|
77
|
+
### Metadata JSON Structure
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"description": "Brief description shown in template picker",
|
|
81
|
+
"parameters": [
|
|
82
|
+
{
|
|
83
|
+
"name": "feature_name",
|
|
84
|
+
"label": "Feature Name",
|
|
85
|
+
"type": "string",
|
|
86
|
+
"required": true
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Template Content Syntax
|
|
93
|
+
|
|
94
|
+
**CRITICAL**: Template parameters must use `${parameter_name}` syntax (dollar sign + curly braces), NOT `{{parameter_name}}`.
|
|
95
|
+
|
|
96
|
+
CoderFlow's template rendering engine works in two passes:
|
|
97
|
+
1. **First pass**: Replaces `${variable}` with parameter values
|
|
98
|
+
2. **Second pass**: Processes EJS syntax (e.g., `<%= variable %>`)
|
|
99
|
+
|
|
100
|
+
**Correct syntax:**
|
|
101
|
+
```markdown
|
|
102
|
+
# Task: ${task_name}
|
|
103
|
+
|
|
104
|
+
Create a ${component_type} component with the following features:
|
|
105
|
+
- ${feature_description}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Wrong syntax (will NOT work):**
|
|
109
|
+
```markdown
|
|
110
|
+
# Task: {{task_name}} ❌ WRONG - parameters won't be substituted
|
|
111
|
+
|
|
112
|
+
Create a {{component_type}} component ❌ WRONG
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Alternative (EJS syntax, also works):**
|
|
116
|
+
```markdown
|
|
117
|
+
# Task: <%= task_name %>
|
|
118
|
+
|
|
119
|
+
Create a <%= component_type %> component
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Usage Examples
|
|
123
|
+
|
|
124
|
+
### Listing Templates
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
User: "What templates are available?"
|
|
128
|
+
|
|
129
|
+
Agent: I'll list the available templates for this environment.
|
|
130
|
+
|
|
131
|
+
[Executes API call]
|
|
132
|
+
|
|
133
|
+
Available templates:
|
|
134
|
+
1. **bug-fix** - Template for fixing bugs
|
|
135
|
+
2. **feature-implementation** - Template for implementing new features
|
|
136
|
+
3. **refactor** - Template for code refactoring tasks
|
|
137
|
+
|
|
138
|
+
Would you like to view or modify any of these?
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Creating a Template
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
User: "Create a template for API endpoint tasks"
|
|
145
|
+
|
|
146
|
+
Agent: I'll help you create a new template. What should the template include?
|
|
147
|
+
|
|
148
|
+
User: "It should guide the agent to create RESTful endpoints with proper error handling and tests"
|
|
149
|
+
|
|
150
|
+
Agent: I'll create an "api-endpoint" template with the following content:
|
|
151
|
+
|
|
152
|
+
**Template Content (api-endpoint.md):**
|
|
153
|
+
```markdown
|
|
154
|
+
# API Endpoint Implementation
|
|
155
|
+
|
|
156
|
+
## Task
|
|
157
|
+
Implement a RESTful API endpoint with the following requirements:
|
|
158
|
+
- Follow RESTful conventions
|
|
159
|
+
- Include proper error handling
|
|
160
|
+
- Add input validation
|
|
161
|
+
- Write unit tests
|
|
162
|
+
|
|
163
|
+
## Parameters
|
|
164
|
+
- Endpoint path: ${endpoint_path}
|
|
165
|
+
- HTTP method: ${http_method}
|
|
166
|
+
- Description: ${description}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Template Metadata (api-endpoint.json):**
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"description": "Create a new API endpoint with tests",
|
|
173
|
+
"parameters": [
|
|
174
|
+
{"name": "endpoint_path", "label": "Endpoint Path", "type": "string", "required": true},
|
|
175
|
+
{"name": "http_method", "label": "HTTP Method", "type": "string", "required": true},
|
|
176
|
+
{"name": "description", "label": "Description", "type": "string", "required": false}
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Would you like me to create this template? (Please confirm)
|
|
182
|
+
|
|
183
|
+
User: "Yes, create it"
|
|
184
|
+
|
|
185
|
+
Agent: [Executes API call]
|
|
186
|
+
Template "api-endpoint" created successfully!
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Implementation
|
|
190
|
+
|
|
191
|
+
### List Templates
|
|
192
|
+
```bash
|
|
193
|
+
curl -s "${CODERFLOW_SERVER_URL}/api/environment-management/templates" \
|
|
194
|
+
-H "X-Task-Id: ${TASK_ID}"
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**Response:**
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"templates": [
|
|
201
|
+
{"name": "bug-fix", "filename": "bug-fix.md", "description": "Fix a bug", "hasMetadata": true}
|
|
202
|
+
],
|
|
203
|
+
"environment": "my-environment"
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Get Template
|
|
208
|
+
```bash
|
|
209
|
+
curl -s "${CODERFLOW_SERVER_URL}/api/environment-management/templates/bug-fix" \
|
|
210
|
+
-H "X-Task-Id: ${TASK_ID}"
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
**Response:**
|
|
214
|
+
```json
|
|
215
|
+
{
|
|
216
|
+
"name": "bug-fix",
|
|
217
|
+
"content": "# Bug Fix Template\n\n...",
|
|
218
|
+
"metadata": {"description": "Fix a bug", "parameters": []},
|
|
219
|
+
"environment": "my-environment"
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Create/Update Template
|
|
224
|
+
|
|
225
|
+
**IMPORTANT**: When creating templates with parameters, always use a temporary file to avoid JSON array mangling in bash. Never embed complex JSON with arrays directly in `-d '{...}'`.
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# Create a temporary file with the complete JSON payload
|
|
229
|
+
cat > /tmp/template-payload.json <<'EOF'
|
|
230
|
+
{
|
|
231
|
+
"content": "# API Endpoint Implementation\n\n...",
|
|
232
|
+
"metadata": {
|
|
233
|
+
"description": "Create a new API endpoint",
|
|
234
|
+
"parameters": [
|
|
235
|
+
{"name": "endpoint_path", "label": "Endpoint Path", "type": "string", "required": true},
|
|
236
|
+
{"name": "http_method", "label": "HTTP Method", "type": "string", "required": true},
|
|
237
|
+
{"name": "description", "label": "Description", "type": "string", "required": false}
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
EOF
|
|
242
|
+
|
|
243
|
+
# Use the temp file with curl
|
|
244
|
+
curl -s -X PUT "${CODERFLOW_SERVER_URL}/api/environment-management/templates/api-endpoint" \
|
|
245
|
+
-H "Content-Type: application/json" \
|
|
246
|
+
-H "X-Task-Id: ${TASK_ID}" \
|
|
247
|
+
-d @/tmp/template-payload.json
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**Alternative using heredoc directly:**
|
|
251
|
+
```bash
|
|
252
|
+
curl -s -X PUT "${CODERFLOW_SERVER_URL}/api/environment-management/templates/api-endpoint" \
|
|
253
|
+
-H "Content-Type: application/json" \
|
|
254
|
+
-H "X-Task-Id: ${TASK_ID}" \
|
|
255
|
+
-d @- <<'EOF'
|
|
256
|
+
{
|
|
257
|
+
"content": "# API Endpoint Implementation\n\n...",
|
|
258
|
+
"metadata": {
|
|
259
|
+
"description": "Create a new API endpoint",
|
|
260
|
+
"parameters": [
|
|
261
|
+
{"name": "endpoint_path", "label": "Endpoint Path", "type": "string", "required": true}
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
EOF
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Delete Template
|
|
269
|
+
```bash
|
|
270
|
+
curl -s -X DELETE "${CODERFLOW_SERVER_URL}/api/environment-management/templates/old-template" \
|
|
271
|
+
-H "X-Task-Id: ${TASK_ID}"
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Important Notes
|
|
275
|
+
|
|
276
|
+
1. **User Approval Required**: Never execute changes without explicit user confirmation
|
|
277
|
+
2. **Template Names**: Use lowercase letters, numbers, and hyphens only
|
|
278
|
+
3. **Preserve Existing**: When updating, consider preserving parts that are still relevant
|
|
279
|
+
4. **Document Parameters**: Clearly define what parameters a template accepts
|
|
280
|
+
5. **Test Templates**: Consider testing template content before finalizing
|
|
281
|
+
6. **Impact Awareness**: Remember that templates affect how future tasks are created
|
|
282
|
+
7. **JSON Payload Handling**: When creating templates with parameters, ALWAYS use a temp file (`cat > /tmp/file.json` + `-d @/tmp/file.json`) or heredoc (`-d @- <<'EOF'`). Never use inline `-d '{...}'` with complex nested JSON containing arrays, as bash shell escaping will corrupt the array structure and turn it into an object with numeric keys (0, 1, 2, 3 instead of proper array elements)
|