forgedock 1.0.10 → 1.0.11
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 +84 -0
- package/bin/forgedock.mjs +537 -5627
- package/bin/init-enrich-api.mjs +14 -4
- package/bin/tui.mjs +8 -5
- package/commands/forgedock-init.md +498 -317
- package/commands/work-on.md +4 -3
- package/docs/CONFIG.md +19 -0
- package/docs/FORGE-PROTOCOL.md +740 -0
- package/docs/anthropic-devrel-outreach.md +197 -0
- package/docs/articles/devto-how-i-built-an-ai-agent-that-never-forgets.md +165 -0
- package/docs/demo.tape +113 -0
- package/docs/distribution-submissions.md +181 -0
- package/docs/launch/reddit-r-claudeai.md +83 -0
- package/docs/launch/reddit-r-devops.md +80 -0
- package/docs/launch/reddit-r-localllama.md +86 -0
- package/docs/launch/reddit-r-programming.md +81 -0
- package/docs/launch/reddit-r-sideproject.md +84 -0
- package/docs/launch/show-hn.md +84 -0
- package/docs/site/command-reference.md +423 -0
- package/docs/site/forge-annotation-protocol.md +266 -0
- package/docs/site/getting-started.md +168 -0
- package/docs/site/how-it-works.md +191 -0
- package/docs/site/index.md +59 -0
- package/docs/site/vs-manual-workflows.md +167 -0
- package/docs/twitter-launch-thread.md +303 -0
- package/docs/youtube-demo-script.md +297 -0
- package/package.json +1 -1
package/bin/init-enrich-api.mjs
CHANGED
|
@@ -111,12 +111,22 @@ export function parseEnrichedDraft(output, draft) {
|
|
|
111
111
|
// each section must be a plain non-null object. The typeof+null guard
|
|
112
112
|
// rejects null and primitives; Array.isArray() additionally rejects
|
|
113
113
|
// arrays since typeof [] === 'object' would otherwise pass them.
|
|
114
|
+
const isPlainObject = (v) =>
|
|
115
|
+
typeof v === "object" && v !== null && !Array.isArray(v);
|
|
114
116
|
if (
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
!isPlainObject(enriched.project) ||
|
|
118
|
+
!isPlainObject(enriched.paths) ||
|
|
119
|
+
!isPlainObject(enriched.branches) ||
|
|
120
|
+
!isPlainObject(enriched.meta)
|
|
119
121
|
) {
|
|
122
|
+
if (process.env.FORGEDOCK_DEBUG) {
|
|
123
|
+
const failing = ["project", "paths", "branches", "meta"]
|
|
124
|
+
.filter((k) => !isPlainObject(enriched[k]))
|
|
125
|
+
.join(", ");
|
|
126
|
+
console.error(
|
|
127
|
+
` ${dim("[debug]")} api enrichment: parseEnrichedDraft rejected LLM output — missing/invalid sections: ${failing}. Falling back to baseline draft.`,
|
|
128
|
+
);
|
|
129
|
+
}
|
|
120
130
|
return draft;
|
|
121
131
|
}
|
|
122
132
|
return enriched;
|
package/bin/tui.mjs
CHANGED
|
@@ -743,11 +743,14 @@ export function truncateVisible(str, maxWidth) {
|
|
|
743
743
|
if (remaining > 0) {
|
|
744
744
|
result += str.slice(lastIndex, lastIndex + remaining);
|
|
745
745
|
}
|
|
746
|
-
// If truncation occurred
|
|
747
|
-
// append a full reset to prevent color from
|
|
748
|
-
//
|
|
749
|
-
// visible
|
|
750
|
-
|
|
746
|
+
// If truncation occurred (or visible length exactly equals maxWidth) and the
|
|
747
|
+
// result contains any ANSI sequences, append a full reset to prevent color from
|
|
748
|
+
// bleeding into adjacent columns. The guard uses >= rather than > to cover the
|
|
749
|
+
// exact-boundary case: when visible === maxWidth the loop guard (visible < maxWidth)
|
|
750
|
+
// suppresses the original trailing RESET token, so the post-loop guard must fire
|
|
751
|
+
// to close any open sequences. Inputs shorter than maxWidth are unaffected because
|
|
752
|
+
// stripAnsi(str).length < maxWidth makes the condition false.
|
|
753
|
+
if (stripAnsi(str).length >= maxWidth && result.includes("\x1b[")) {
|
|
751
754
|
result += "\x1b[0m";
|
|
752
755
|
}
|
|
753
756
|
return result;
|