CSweet.Plugins.Platform.YouTube 0.2.2

dotnet add package CSweet.Plugins.Platform.YouTube --version 0.2.2
                    
NuGet\Install-Package CSweet.Plugins.Platform.YouTube -Version 0.2.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CSweet.Plugins.Platform.YouTube" Version="0.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CSweet.Plugins.Platform.YouTube" Version="0.2.2" />
                    
Directory.Packages.props
<PackageReference Include="CSweet.Plugins.Platform.YouTube" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CSweet.Plugins.Platform.YouTube --version 0.2.2
                    
#r "nuget: CSweet.Plugins.Platform.YouTube, 0.2.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CSweet.Plugins.Platform.YouTube@0.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CSweet.Plugins.Platform.YouTube&version=0.2.2
                    
Install as a Cake Addin
#tool nuget:?package=CSweet.Plugins.Platform.YouTube&version=0.2.2
                    
Install as a Cake Tool

YouTube Connection

com.csweet.connector.youtube · 0.2.2 · .NET 10 · CSweet.Agent.SDK 5.5.0 · protocol 2.4

Upload completion declares /snippet/channelId as authenticated response ownership evidence. The broker must compare it with the approved channel before releasing a result. This declaration does not enable uploads: exact action approval, media provenance, publishing consent and consuming agent/business access remain required. The managed relay also requires separately reviewed service execution policy and package approval. Version 0.2.2 is a new immutable package; do not patch an already approved 0.2.1 manifest/digest or claim this source change publishes a package.

A deterministic integration package, separate from the conversational YouTube Manager. Install once at enterprise scope, then connect accounts, import authorized channels and explicitly grant businesses whole-account or selected-channel access. Agents need narrower independent bindings. The host renders the native management page from this package's accounts declaration; it contains no Google/YouTube application-specific page. Base consent includes openid profile only to obtain the immutable account subject and optional display name from authenticated Google UserInfo. Email is not requested or used as identity proof. Every discovery page is checkpointed; partial inventories never widen business access. One authorization is not a promise that every Brand Account channel is discoverable. Authorize additional channels when Google requires it.

Deployment administrators must configure a vault-backed OAuth profile, the correct verified public callback, enabled APIs, current branding/privacy policies and applicable Google verification/audits. Ordinary channel owners never enter client IDs or secrets. The repository policy documents are a development integration notice; production operators must publish applicable policies on their verified domains. No live-Google or production verification is claimed by fake-provider tests. See the Google deployment and acceptance checklist for operator release gates.

RequestUploadAsync requires both typed video metadata and its retained conversation attachment reference. Read the asset ID from authorized chat history; do not substitute an attachment ID or guess an asset ID. The host verifies the source and live access at preparation and throughout transfer. This closes the former organization-wide asset lookup; older unsourced media plans fail closed.

Implemented operations

Owned playlist reads and conditional metadata edits are available through ReadPlaylistAsync, PreparePlaylistMetadataEdit and RequestPlaylistMetadataEditAsync. The edit preserves untouched title, description and default language, freezes the provider version, and requests a managed approval. It does not change privacy, podcast status, localizations or playlist items. Empty descriptions and language removal must be explicit. The broker checks ownership before sending and before releasing results. YouTubePlaylistEditReconciler distinguishes verified edits, later changes and conflicts; matching text after a lost response never proves success or permits a resend. These are connector contracts, not yet a conversational playlist-edit workflow. Creation, deletion, privacy changes and item mutations remain unfinished. Semantics follow playlists.update. No new YouTube-specific host behavior or SDK changes were needed.

youtube.api.video.metadata.update.v1 edits an existing video's writable snippet through an exact approved conditional PUT. PrepareMetadataEdit preserves untouched title, description, category, tags and default language from a complete authenticated snapshot. Empty tags/description and language removal must be explicit. Missing versions, incomplete snapshots and no-op changes cannot create an edit. The video read now includes its provider ETag and default language. Resource tags are validated and quoted exactly once for the host's protocol-2.3 If-Match guard. The broker independently verifies video ownership before the mutation and response ownership before releasing results. Privacy, audience, disclosure and scheduling are not part of this operation and cannot be changed through its input.

YouTubeVideoEditReconciler compares saved and current metadata. A received version conflict requires fresh evidence and a new decision. A matching current value after a lost response does not prove that this request succeeded and never triggers an automatic resend. A confirmed result followed by later changes is reported distinctly, never overwritten. Request/read/cancel methods use only managed-action controls. YouTube Manager now connects explicit edit requests to durable drafts, approvals and result checks. Requester-bound clarification and confirmed-conflict follow-ups resume the same agent work with fresh evidence and a new decision; uncertain outcomes still block. Ambiguous title selection, requester handoff and retention remain unfinished. This does not establish real-Google acceptance. Its provider semantics follow videos.update and YouTube's ETag overwrite protection.

YouTubeAnalyticsSnapshot.From validates the fixed official aggregate before reporting: exact unique metric columns, at most one complete row and bounded non-negative numeric values. It preserves provider units and missing data without calculating subscriber net changes, ratios or replacement metrics. No rows means unavailable evidence, never inferred zero activity. This does not establish that all requested dates are available; YouTube may return data only through the latest common available day.

The root manifest declares sixteen narrow read operations: member and membership-level reads; category discovery; setup discovery; channel, video, individual playlist and comment reads; paginated playlist, playlist-item, comment-thread and comment-reply reads; caption metadata; live broadcast and stream status; and an official analytics summary. Normal reads bind the confirmed channel or independently check ownership of the requested video, playlist, broadcast or stream. Responses use fixed field masks and closed schemas. Comment text is untrusted data.

ListVideoCategoriesAsync reads YouTube's category names and assignability for an explicit country and display language. ResolveVideoCategoryAsync resolves one currently assignable display name, never a guessed/default ID. Duplicate IDs or names, malformed records and unexpected continuation tokens fail closed for selection. The catalog is public provider metadata, not evidence of ownership of a channel; its creator channel is deliberately not treated as the connected channel. The operation still requires the independently granted connector capability and base connection scopes. It does not upload or change permission. The conversational agent uses this catalog during its saved upload intake.

The reply mutation is youtube.api.comment.reply.v1. RequestReplyAsync requests an exact host-frozen approval; it never posts directly. The broker independently reads the parent comment's channel before sending the approved reply. Additional content consent and independent consumer grants are required. Request, read and cancel controls preserve opaque action IDs. YouTubeReplyReconciler verifies a durable completed result against the expected parent and text. After an uncertain send it searches at most ten reply pages for matching text authored by the connected channel, retaining only bounded candidate references. Search matches never prove which request posted a reply; absence never proves failure. Unresolved results require manual channel review and remain blocked, with no fresh-key retry or automatic resend.

The second mutation, youtube.api.video.upload.v1, accepts an organization media asset and explicit title, description, category, privacy, audience/disclosure flags and subscriber-notification choice. RequestUploadAsync requests approval; the host's durable resumable-range.v1 worker owns all transfers and session recovery. The connector never receives an upload URL, credential or file bytes. YouTubeUploadReconciler verifies the returned video against the connected channel, rereads its metadata/visibility and distinguishes received media, processing, processed results and failures. Visibility restrictions or changed settings require review, not another upload. An indeterminate action never triggers title searching or a replacement upload. Cancelling applies only before execution. Scheduling is not yet accepted: it needs a host-enforced deadline to prevent a missed schedule turning into an unintended immediate publication. These contracts require the matching host worker and migration. YouTube Manager now connects immediate-upload conversation and attachment intake to these contracts; browser and real-provider acceptance remain outstanding.

YouTubeClient is a typed facade for consuming agents using their existing AgentRuntimeContext.Platform. It never makes network requests or accepts credentials. The connector executable rejects direct capability execution; the protocol-2.3 host materializes and executes the reviewed HTTP mappings. This is intentional: there is no second authenticated HTTP route or connector LLM.

Setup

ListMembersAsync reads one page of at most 25 current members, preserving records with unavailable profiles. Continuation tokens remain internal. ListMembershipLevelsAsync reads configured level names in provider order; an empty successful list is not an eligibility failure. Neither operation accepts a channel selector: the authenticated account selects the channel, and generic host response-ownership checks verify every returned creator channel before releasing records. This requires protocol 2.2. Profile URLs, avatars, prices and revenue are not collected by these operations.

Both operations require independent consuming-agent grants and the optional membership consent flow. Google must also enable this restricted API for the channel; its YouTube Partner Manager may need to help. Consent alone does not establish eligibility. Missing permission, provider unavailability and invalid data fail visibly, never as an invented empty membership list. These are bounded current-member reads, not an updates feed, full synchronization, membership mutations or real-provider acceptance.

  1. An enterprise administrator reviews the exact plugin package and grants, approves installation, and lands on the native plugin management page. Installation grants no external account access.
  2. Review the inline privacy notice and base permissions, then choose Connect account to sign in and consent on Google's own page. Optional access is reviewed separately when changing permissions. Deployment profile setup is administrator-only, not a user step.
  3. The plugin's authenticated identity and paginated discovery declarations import only accessible channels. Incomplete imports are resumable and cannot expose a partial inventory as complete.
  4. Accounts group by verified immutable provider subject, not email/name. An additional authorization may be required for a Brand Account channel. Separate accounts never merge on display labels.
  5. An administrator shares selected channels, or explicitly acknowledges future authorized imports when sharing a whole account, with a business. This does not automatically authorize any agent.
  6. A business manager explicitly binds YouTube Manager to one permitted channel and its reviewed abilities. Progressive provider consent, business grants, agent bindings and action approvals remain separate. The management page lists each authorization and its accessible channels.
  7. Removing business access leaves shared tokens connected. Disconnecting an account previews impact, stops external work immediately and queues revocation. Complete data deletion remains a production gate; the page must not claim deletion before all authorized copies have been confirmed removed.

Ordinary users never enter OAuth client credentials. Managed deployments configure the verified com.csweet.google.youtube profile; self-hosted administrators configure it once in the platform vault. Publisher/profile names alone confer no trust.

Not yet complete

This is not the complete approved YouTube Manager release. Scheduling, thumbnails, comment moderation, caption download/upload, live configuration/transitions/chat, membership updates/synchronization, Content ID, quota scheduling, full retention/purge and recovery remain pending. The partner scope set is a reserved requirement, not an enabled tool. Membership consent enables only the two separately granted reads described above. Publishing consent permits the separately granted and reviewed upload operation, not arbitrary channel changes. The agent can revise metadata after an authoritative revision decision and request a new exact approval for the same source video; upload revision does not edit an existing video or change upload files. Existing-video metadata changes use the separate conditional operation described above. The content permission enables caption/live-status reads and the separately approved reply operation.

The host checkpoints paginated account discovery up to the declared resource limit; interrupted or incomplete inventories never silently confirm additional business access. Avatar proxying remains pending. Comment-thread reads do not include all replies; use the separate reply capability with its parent-comment ownership preflight and continuation token. If Google cannot validate the parent comment, the read fails closed; production acceptance of this preflight is still required. Provider-derived counts are returned as official values; revenue and replacement metrics are excluded.

No Google account, public upload, OAuth verification or restricted API eligibility has been tested. A successful fake-provider test is not production acceptance. Do not retire the historical agent until the complete replacement passes acceptance.

Verification

dotnet test
dotnet run --project src/CSweet.Plugins.Platform.YouTube -- --self-test
dotnet pack src/CSweet.Plugins.Platform.YouTube -c Release

For the complete release check, run pwsh scripts/Test-Release.ps1. nuget.org is the authoritative public dependency feed; no local SDK feed or sibling source reference is required. The script packs and inspects the exact manifest, metadata and dependencies, then restores a standalone consumer from that package with a fresh package directory. See RELEASING.md for protected publication and the separate installation/Google acceptance checklist. Tests use AgentTestRuntime and deterministic responses without C-Sweet, Google credentials or a network connection. Host enforcement has separate fake-provider tests in C-Sweet.

Provider references

Membership contracts follow members.list, the member resource, and membershipsLevels.list. The member listing uses all_current; total membership months must not be described as a continuous duration since the current membership began. A changing listing is not a guaranteed point-in-time snapshot.

Category mapping follows videoCategories.list and the category resource. The documented request has region/language filters but no page-token parameter, so the client does not invent one when an incomplete catalog is returned.

The fixed requests follow the official channels, videos, video insertion, playlists, playlist items, comment threads, comment replies, reply creation, captions, live broadcasts, live streams and Analytics reports contracts.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.2 93 11/3/2026
0.2.1 111 10/28/2026