Skip to content

Commit cd91555

Browse files
author
Alem Tuzlak
committed
Merge remote-tracking branch 'origin/main' into docs/langgraph-python-demo-readmes
# Conflicts: # showcase/integrations/ag2/src/app/demos/a2ui-fixed-schema/README.md # showcase/integrations/ag2/src/app/demos/agentic-chat-reasoning/README.md # showcase/integrations/ag2/src/app/demos/chat-slots/README.md # showcase/integrations/ag2/src/app/demos/declarative-gen-ui/README.md # showcase/integrations/ag2/src/app/demos/frontend-tools-async/README.md # showcase/integrations/ag2/src/app/demos/headless-complete/README.md # showcase/integrations/ag2/src/app/demos/hitl-in-app/README.md # showcase/integrations/ag2/src/app/demos/hitl-in-chat/README.md # showcase/integrations/ag2/src/app/demos/mcp-apps/README.md # showcase/integrations/ag2/src/app/demos/readonly-state-agent-context/README.md # showcase/integrations/ag2/src/app/demos/reasoning-default-render/README.md # showcase/integrations/ag2/src/app/demos/tool-rendering-custom-catchall/README.md # showcase/integrations/ag2/src/app/demos/tool-rendering-default-catchall/README.md # showcase/integrations/ag2/src/app/demos/tool-rendering-reasoning-chain/README.md # showcase/integrations/claude-sdk-python/src/app/demos/headless-simple/README.md # showcase/integrations/claude-sdk-python/src/app/demos/prebuilt-popup/README.md # showcase/integrations/claude-sdk-python/src/app/demos/prebuilt-sidebar/README.md # showcase/integrations/crewai-crews/src/app/demos/beautiful-chat/README.md # showcase/integrations/langgraph-fastapi/src/app/demos/gen-ui-interrupt/README.md # showcase/integrations/langgraph-fastapi/src/app/demos/interrupt-headless/README.md # showcase/integrations/langgraph-python/src/app/demos/shared-state-read-write/README.md # showcase/integrations/langgraph-python/src/app/demos/shared-state-read/README.md # showcase/integrations/langgraph-python/src/app/demos/shared-state-streaming/README.md # showcase/integrations/langgraph-python/src/app/demos/subagents/README.md # showcase/shell-docs/src/data/demo-content.json # showcase/shell-dojo/src/data/demo-content.json # showcase/shell/src/data/demo-content.json # showcase/shell/src/data/registry.json
2 parents 152c96e + f3e7b63 commit cd91555

6,743 files changed

Lines changed: 552462 additions & 371573 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,9 @@
55
*.pdf filter=lfs diff=lfs merge=lfs -text
66
*.mp4 filter=lfs diff=lfs merge=lfs -text
77
*.webm filter=lfs diff=lfs merge=lfs -text
8+
*.wav filter=lfs diff=lfs merge=lfs -text
89

9-
# Shell scripts must retain LF line endings. Windows contributors regenerating
10-
# showcase starters on a Windows checkout (or with autocrlf=true) would
11-
# otherwise silently ship CRLF ``entrypoint.sh`` files that bash in the
12-
# Docker runtime rejects (``bad interpreter: No such file or directory``).
10+
# Shell scripts must retain LF line endings. Windows contributors with
11+
# autocrlf=true would otherwise silently ship CRLF entrypoint.sh files
12+
# that bash in the Docker runtime rejects.
1313
*.sh text eol=lf
14-
15-
# Generated showcase starters — do not edit manually
16-
# Regenerate with: cd showcase/scripts && npx tsx generate-starters.ts
17-
showcase/starters/ag2/** linguist-generated=true
18-
showcase/starters/agno/** linguist-generated=true
19-
showcase/starters/claude-sdk-python/** linguist-generated=true
20-
showcase/starters/claude-sdk-typescript/** linguist-generated=true
21-
showcase/starters/crewai-crews/** linguist-generated=true
22-
showcase/starters/google-adk/** linguist-generated=true
23-
showcase/starters/langgraph-fastapi/** linguist-generated=true
24-
showcase/starters/langgraph-python/** linguist-generated=true
25-
showcase/starters/langgraph-typescript/** linguist-generated=true
26-
showcase/starters/langroid/** linguist-generated=true
27-
showcase/starters/llamaindex/** linguist-generated=true
28-
showcase/starters/mastra/** linguist-generated=true
29-
showcase/starters/ms-agent-dotnet/** linguist-generated=true
30-
showcase/starters/ms-agent-python/** linguist-generated=true
31-
showcase/starters/pydantic-ai/** linguist-generated=true
32-
showcase/starters/spring-ai/** linguist-generated=true
33-
showcase/starters/strands/** linguist-generated=true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ Happy contributing!
3434

3535
- [ ] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md)
3636
- [ ] If the PR changes or adds functionality, I have updated the relevant documentation
37+
- [ ] "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone)
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# Daily audit for GHCR container packages that are unlinked from a source
2+
# repository (`repository: null` on the GHCR API).
3+
#
4+
# WHY THIS EXISTS
5+
# ---------------
6+
# When a GHCR container package is not linked to a repository, workflow
7+
# builds in `CopilotKit/CopilotKit` get `403 Forbidden` on push to GHCR —
8+
# the workflow's `GITHUB_TOKEN` only has package-write permissions when
9+
# the package is linked to the actor's repo. We hit this twice in quick
10+
# succession (`showcase-harness` caught manually after a failed deploy, and
11+
# `showcase-pocketbase` caught by a preemptive scan). There is NO GitHub
12+
# API to programmatically link a package to a repo — it is UI-only — so
13+
# the only way to prevent future surprises is detect drift early via a
14+
# scheduled audit + Slack alert.
15+
#
16+
# This workflow is the operationalization of the lesson captured in
17+
# `feedback_ghcr_new_package_403.md`.
18+
#
19+
# REQUIRED SECRETS
20+
# ----------------
21+
# - ORG_READ_PACKAGES_PAT: a fine-grained PAT with `read:packages` scope,
22+
# org-scoped to `CopilotKit`. The default `secrets.GITHUB_TOKEN` does
23+
# NOT have `read:packages` for the org and cannot list org packages.
24+
# - SLACK_WEBHOOK_GHCR_DRIFT: a CopilotKit-internal Slack incoming-webhook
25+
# URL. Posts to whichever channel the webhook is bound to (intended:
26+
# an internal alerts channel).
27+
#
28+
# If `ORG_READ_PACKAGES_PAT` is unset the workflow fails loudly — drift
29+
# detection silently disabled is worse than no workflow at all.
30+
# If `SLACK_WEBHOOK_GHCR_DRIFT` is unset the workflow logs a warning
31+
# (the audit still runs) so a missing webhook does not mask drift.
32+
#
33+
# EXIT CODES
34+
# ----------
35+
# This workflow exits 0 in all non-error cases (including when drift is
36+
# present). The Slack message IS the alert; failing the workflow on
37+
# drift would create noisy red CI checks on a schedule.
38+
39+
name: GHCR unlinked-package audit
40+
41+
on:
42+
schedule:
43+
# Daily at 14:00 UTC (07:00 PT / 10:00 ET) — low-traffic window,
44+
# well before the US workday's deploy activity.
45+
- cron: "0 14 * * *"
46+
workflow_dispatch: {}
47+
48+
permissions:
49+
contents: read
50+
51+
jobs:
52+
audit:
53+
name: Audit org container packages for unlinked repos
54+
# Hoist the Slack webhook into an env var so step-level `if:`
55+
# expressions can reference it — `secrets.*` is not a valid
56+
# named-value inside `if:` and causes a workflow startup failure.
57+
env:
58+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_GHCR_DRIFT }}
59+
runs-on: ubuntu-latest
60+
timeout-minutes: 5
61+
steps:
62+
- name: Verify ORG_READ_PACKAGES_PAT is set
63+
env:
64+
PAT: ${{ secrets.ORG_READ_PACKAGES_PAT }}
65+
run: |
66+
if [ -z "$PAT" ]; then
67+
echo "::error::ORG_READ_PACKAGES_PAT is not set. This workflow requires a fine-grained PAT with read:packages scope, org-scoped to CopilotKit. See the workflow header comment in .github/workflows/ghcr_unlinked_packages.yml for setup."
68+
exit 1
69+
fi
70+
echo "ORG_READ_PACKAGES_PAT present."
71+
72+
- name: List org container packages and identify unlinked
73+
id: audit
74+
env:
75+
GH_TOKEN: ${{ secrets.ORG_READ_PACKAGES_PAT }}
76+
run: |
77+
set -euo pipefail
78+
79+
# Page through all container packages in the CopilotKit org.
80+
# `--paginate` follows Link headers; per_page=100 minimizes
81+
# request count. `gh api` returns one JSON array per page;
82+
# `--slurp` is unnecessary because gh concatenates pages into
83+
# a single stream when called with `--paginate` on an array
84+
# endpoint.
85+
all_packages_json="$(gh api \
86+
--paginate \
87+
-H "Accept: application/vnd.github+json" \
88+
"/orgs/CopilotKit/packages?package_type=container&per_page=100")"
89+
90+
total="$(echo "$all_packages_json" | jq 'length')"
91+
echo "Total container packages in CopilotKit org: $total"
92+
93+
# Filter for packages where repository is null. Emit a compact
94+
# JSON array of {name, visibility} objects for downstream use.
95+
unlinked_json="$(echo "$all_packages_json" \
96+
| jq -c '[.[] | select(.repository == null) | {name: .name, visibility: .visibility}]')"
97+
98+
unlinked_count="$(echo "$unlinked_json" | jq 'length')"
99+
echo "Unlinked container packages: $unlinked_count"
100+
101+
# Emit outputs for the next step. Use the multiline-output
102+
# delimiter form for the JSON array so jq output with embedded
103+
# special chars survives intact.
104+
{
105+
echo "unlinked_count=$unlinked_count"
106+
echo "unlinked_json<<EOF"
107+
echo "$unlinked_json"
108+
echo "EOF"
109+
} >> "$GITHUB_OUTPUT"
110+
111+
if [ "$unlinked_count" = "0" ]; then
112+
echo "::notice::No GHCR drift — all CopilotKit org container packages are linked to a repository."
113+
else
114+
echo "::warning::Detected $unlinked_count unlinked container package(s):"
115+
echo "$unlinked_json" | jq -r '.[] | " - \(.name) (\(.visibility))"'
116+
fi
117+
118+
- name: Build Slack payload
119+
id: payload
120+
if: steps.audit.outputs.unlinked_count != '0'
121+
env:
122+
UNLINKED_JSON: ${{ steps.audit.outputs.unlinked_json }}
123+
UNLINKED_COUNT: ${{ steps.audit.outputs.unlinked_count }}
124+
RUN_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
125+
run: |
126+
set -euo pipefail
127+
128+
# Build a single `text` field with mrkdwn — keeps the payload
129+
# compatible with both incoming-webhooks and channel webhooks.
130+
# Each unlinked package gets a deep link to its Actions-access
131+
# settings page, where the UI fix lives.
132+
lines="$(echo "$UNLINKED_JSON" | jq -r '.[] | "• <https://github.com/orgs/CopilotKit/packages/container/\(.name)/settings|\(.name)> (\(.visibility))"')"
133+
134+
# Build message via printf — avoids heredoc indentation
135+
# gotchas (closing delimiter must be column-0, which confuses
136+
# YAML linters on `run: |` blocks). mrkdwn renders *bold*,
137+
# _italic_, and <url|label> links.
138+
nl=$'\n'
139+
message=":warning: *GHCR drift detected* — ${UNLINKED_COUNT} container package(s) in the \`CopilotKit\` org are unlinked from a source repository.${nl}${nl}"
140+
message="${message}${lines}${nl}${nl}"
141+
message="${message}*UI fix (per package):* open the settings link above → *Manage Actions access* → *Add Repository* → \`CopilotKit/CopilotKit\` → *Write*.${nl}${nl}"
142+
message="${message}_This drift breaks future workflow builds with \`403 Forbidden\` on push to GHCR. <${RUN_URL}|View audit run>_"
143+
144+
# Emit as a multiline output so the next step can consume it
145+
# without re-quoting through a shell.
146+
{
147+
echo "text<<EOF"
148+
echo "$message"
149+
echo "EOF"
150+
} >> "$GITHUB_OUTPUT"
151+
152+
- name: Notify Slack (drift detected)
153+
if: steps.audit.outputs.unlinked_count != '0' && env.SLACK_WEBHOOK != ''
154+
uses: slackapi/slack-github-action@v2.1.0
155+
with:
156+
webhook: ${{ secrets.SLACK_WEBHOOK_GHCR_DRIFT }}
157+
webhook-type: incoming-webhook
158+
# Wrap the dynamic message via toJSON so quotes/newlines/
159+
# backslashes inside package names or visibility values are
160+
# safely JSON-encoded instead of breaking the payload.
161+
payload: |
162+
{ "text": ${{ toJSON(steps.payload.outputs.text) }} }
163+
164+
- name: Log (no Slack — webhook unset)
165+
if: steps.audit.outputs.unlinked_count != '0' && env.SLACK_WEBHOOK == ''
166+
run: |
167+
echo "::warning::Drift detected but SLACK_WEBHOOK_GHCR_DRIFT is not set; no Slack notification sent. See run logs above for the unlinked package list."
168+
169+
- name: Log (no drift)
170+
if: steps.audit.outputs.unlinked_count == '0'
171+
run: |
172+
echo "No drift — exiting 0."

0 commit comments

Comments
 (0)