Skip to content

Commit 4e0026b

Browse files
committed
update md files, update icon
1 parent 4b5464b commit 4e0026b

62 files changed

Lines changed: 1747 additions & 254 deletions

Some content is hidden

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

‎AGENTS.md‎

Lines changed: 26 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,37 @@
11
# Agent Integration Notes for SharpIpp
22

3-
This file is the human-readable integration guide for AI/code agents working in this repository.
4-
It summarizes verified specification coverage, highlights known parity gaps, and defines a safe workflow
5-
for implementing missing IPP/PWG features.
3+
This file provides architectural pointers and development workflows for AI and code agents working in this repository.
64

7-
## Scope and source of truth
5+
## Documentation & Specifications
86

9-
- Primary runtime API surface: `SharpIpp/ISharpIppClient.cs` and `SharpIpp/ISharpIppServer.cs`
10-
- Operation identifiers: `SharpIpp/Protocol/Models/IppOperation.cs`
11-
- Request/response wiring: `SharpIpp/Mapping/Profiles/Requests` and `SharpIpp/Mapping/Profiles/Responses`
12-
- Server dispatch: `SharpIpp/SharpIppServer.cs`
13-
- Validation tests:
14-
- unit: `SharpIpp.Tests.Unit`
15-
- integration: `SharpIpp.Tests.Integration`
16-
- Specification document corpus: `docs/Content/Specification` (includes RFCs and PWG specs through 5100.22-2025)
7+
To avoid duplication, full documentation is maintained in the [`docs`](docs) directory:
8+
- **Client Operations & Examples:** See [`docs/Content/Client/Operations.md`](docs/Content/Client/Operations.md) and individual operation guides in [`docs/Content/Client/`](docs/Content/Client/).
9+
- **Server Implementation:** See [`docs/Content/Server/index.md`](docs/Content/Server/index.md).
10+
- **Client Nuances & Best Practices:** See [`docs/Content/Client/ConfigurationAndBestPractices.md`](docs/Content/Client/ConfigurationAndBestPractices.md).
11+
- **Specification Corpus:** Full RFCs and PWG specifications (through PWG 5100.22-2025) are located in [`docs/Content/Specification/`](docs/Content/Specification/).
1712

18-
## Verified specification coverage snapshot
13+
## Core Source of Truth
1914

20-
- Legacy baseline remains RFC 2911 + CUPS operations (see `README.md`).
21-
- Expanded spec corpus is present under DocFX, including:
22-
- RFC 2911, RFC 8010, RFC 8011
23-
- PWG 5100.x families including 5100.5, 5100.7, 5100.18, and 5100.22
24-
- IPP System Service support from PWG 5100.22-2025 is broadly implemented in client models and mappings.
15+
- **Client Contract:** [`SharpIpp/ISharpIppClient.cs`](SharpIpp/ISharpIppClient.cs) and `SharpIppClient.*.cs`
16+
- **Server Contract & Dispatch:** [`SharpIpp/ISharpIppServer.cs`](SharpIpp/ISharpIppServer.cs) and [`SharpIpp/SharpIppServer.cs`](SharpIpp/SharpIppServer.cs)
17+
- **Operation Enumeration:** [`SharpIpp/Protocol/Models/IppOperation.cs`](SharpIpp/Protocol/Models/IppOperation.cs)
18+
- **Mapping Profiles:** `SharpIpp/Mapping/Profiles/Requests` and `SharpIpp/Mapping/Profiles/Responses`
19+
- **Tests:** `SharpIpp.Tests.Unit` and `SharpIpp.Tests.Integration`
2520

26-
## PWG 5100.22-2025 implementation notes
21+
## Agent Workflow for Spec-Parity Changes
2722

28-
Implemented and wired in the client contract include System Service operations such as:
23+
When adding or updating an IPP operation or attribute, implement parity end-to-end:
2924

30-
- `AllocatePrinterResourcesAsync`, `DeallocatePrinterResourcesAsync`
31-
- `CreatePrinterAsync`, `DeletePrinterAsync`, `GetPrintersAsync`, `GetPrinterResourcesAsync`
32-
- `GetSystemAttributesAsync`, `GetSystemSupportedValuesAsync`, `SetSystemAttributesAsync`
33-
- `DisableAllPrintersAsync`, `EnableAllPrintersAsync`, `PauseAllPrintersAsync`, `ResumeAllPrintersAsync`
34-
- `ShutdownOnePrinterAsync`, `StartupOnePrinterAsync`, `ShutdownAllPrintersAsync`, `StartupAllPrintersAsync`
35-
- `RestartSystemAsync`, `RestartOnePrinterAsync`
36-
- `RegisterOutputDeviceAsync`
37-
- System/resource subscription operations (`CreateSystemSubscriptionsAsync`, `CreateResourceSubscriptionsAsync`, etc.)
25+
1. Confirm or add the operation ID in [`IppOperation.cs`](SharpIpp/Protocol/Models/IppOperation.cs).
26+
2. Create request and response model types in `SharpIpp.Models`.
27+
3. Add client contract method in [`ISharpIppClient`](SharpIpp/ISharpIppClient.cs) and implementation in `SharpIppClient.*.cs`.
28+
4. Add request/response AutoMapper profiles.
29+
5. Add server dispatch mapping in [`SharpIppServer.ReceiveRequestAsync`](SharpIpp/SharpIppServer.cs).
30+
6. Add unit and integration tests (mapping, validation, and round-trip tests).
31+
7. Update documentation in [`docs/Content/Client/`](docs/Content/Client/) and [`docs/Content/Client/Operations.md`](docs/Content/Client/Operations.md).
3832

39-
Additional 5100.22 model/mapping support verified:
33+
## Practical Guidance
4034

41-
- `ResourceStatusAttributes.ResourceUuid`
42-
- strong typed collections for system/resource and power-policy/state objects
43-
- collection mapping in `CollectionProfiles` and related response profiles
44-
45-
## Agent workflow for spec-parity changes
46-
47-
When adding or correcting a spec operation/attribute, treat parity as end-to-end:
48-
49-
1. Add/confirm operation id in `IppOperation`.
50-
2. Add request/response model types.
51-
3. Add client contract method in `ISharpIppClient` and implementation in `SharpIppClient.*.cs`.
52-
4. Add request/response profile wiring.
53-
5. Add server dispatch mapping in `SharpIppServer.ReceiveRequestAsync`.
54-
6. Add or update protocol attribute/profile mappings for any new fields.
55-
7. Add tests:
56-
- unit mapping tests
57-
- unit client request-operation mapping tests
58-
- integration request/response roundtrip tests
59-
8. Update docs:
60-
- `docs/Content/Client/Operations.md`
61-
- any relevant specification or API pages
62-
63-
## Practical guidance for agents
64-
65-
- Prefer small, focused patches and keep naming aligned with existing IPP operation style.
66-
- Preserve bidirectional mapping symmetry for new attributes.
67-
- For enum arrays in IPP attributes, ensure both read and write mapping paths are covered.
68-
- Do not assume DocFX pages are fully current; verify behavior from code + tests first.
35+
- Prefer small, focused patches and preserve naming consistency with existing IPP models.
36+
- Maintain bidirectional mapping symmetry (read and write) for all protocol attributes.
37+
- Verify behavior against unit and integration tests before finishing.

‎CONTRIBUTING.md‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,35 @@ git clone https://github.com/danielklecha/SharpIppNext.git
1818
cd SharpIppNext
1919
```
2020

21+
## Repository Structure
22+
23+
The solution is divided into the following projects:
24+
25+
- **[`SharpIpp`](SharpIpp)**: The core IPP protocol library, containing client (`ISharpIppClient`) and server (`ISharpIppServer`) implementations, models, and protocol serialization (targets `netstandard2.0` and `net10.0`).
26+
- **[`SharpIpp.Generators`](SharpIpp.Generators)**: Roslyn incremental source generators (`IIncrementalGenerator`) that produce compile-time object mapping (`SimpleMapper`) and validation routines, ensuring zero-reflection NativeAOT and trimming compatibility (targets `netstandard2.0`).
27+
- **[`SharpIpp.Generators.Tests.Unit`](SharpIpp.Generators.Tests.Unit)**: Unit tests for verifying source generator output and behavior.
28+
- **[`SharpIpp.Tests.Unit`](SharpIpp.Tests.Unit)** & **[`SharpIpp.Tests.Integration`](SharpIpp.Tests.Integration)**: Comprehensive test suites for protocol serialization, mapping symmetry, and end-to-end client/server workflows.
29+
- **`SharpIpp.Samples.*`**: Sample applications demonstrating standard usage, NativeAOT deployment, and UWP integrations.
30+
2131
## How to Contribute
2232

2333
### Building the Project
2434

25-
You can build the project using the .NET CLI:
35+
You can build the entire solution using the .NET CLI:
2636

2737
```bash
2838
dotnet build --configuration Release
2939
```
3040

41+
### Working with Source Generators (`SharpIpp.Generators`)
42+
43+
If you are modifying or extending attributes (`[IppRequest]`, `[IppResponse]`, `[IppAttribute]`) or mapping logic:
44+
45+
- **Target Framework**: `SharpIpp.Generators` targets `netstandard2.0` as required by the Roslyn compiler infrastructure.
46+
- **Testing Generators**: When changing generator logic, add or update tests in [`SharpIpp.Generators.Tests.Unit`](SharpIpp.Generators.Tests.Unit).
47+
- **IDE Caching**: Visual Studio and IDEs may cache generator outputs in background compiler processes. If generated code does not appear to reflect edits immediately, rebuild the solution or restart the IDE Roslyn language server.
48+
49+
3150
### Running Tests
3251

3352
We use MSTest V2 for testing. To run all tests and collect coverage information, use:

‎README.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
[![Docs](https://img.shields.io/badge/project-docs-blue)](https://danielklecha.github.io/SharpIppNext/)
66
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/danielklecha/SharpIppNext/blob/master/LICENSE.txt)
77
[![Coverage Status](https://coveralls.io/repos/github/danielklecha/SharpIppNext/badge.svg?branch=master)](https://coveralls.io/github/danielklecha/SharpIppNext?branch=master)
8-
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/danielklecha/SharpIppNext)
98

109
A .NET Standard library for building Internet Printing Protocol (IPP) clients and servers.
1110

@@ -17,6 +16,8 @@ A .NET Standard library for building Internet Printing Protocol (IPP) clients an
1716
- **Over 70 Supported Operations**: Out-of-the-box methods for standard IPP operations, plus support for sending custom/extended requests via raw message mapping.
1817
- **System Service Support**: Broad support for IPP System Service operations defined in PWG 5100.22-2025, including system and printer resource management, power policies, and subscription operations.
1918
- **Two-Tier Validation**: Recursive model-level validation via a built-in zero-dependency validation engine alongside strict low-level RFC 8011 attribute and octet-limit validation.
19+
- **AOT & Trimming**: Full support for Native AOT compilation and assembly trimming.
20+
- **No Reflection**: Uses static validators and mappers with zero runtime reflection for optimal performance and trim safety.
2021
- **Strong-Named Assembly**: Available in both standard and strong-named NuGet packages.
2122

2223
## Installation
@@ -65,8 +66,10 @@ Console.WriteLine($"Printer State: {response.PrinterAttributes?.PrinterState}");
6566

6667
### Examples
6768

68-
- Examples of the IPP client are included in the solution ([SharpIpp.Samples.Client](https://github.com/danielklecha/SharpIppNext/tree/master/SharpIpp.Samples.Client) and [SharpIpp.Samples.Client.NativeAot](https://github.com/danielklecha/SharpIppNext/tree/master/SharpIpp.Samples.Client.NativeAot)).
69-
- An example of the IPP server is available in the [SharpIppNextServer repository](https://github.com/danielklecha/SharpIppNextServer).
69+
- A basic IPP client example is included in the solution ([SharpIpp.Samples.Client](SharpIpp.Samples.Client)).
70+
- A NativeAOT IPP client example is included in the solution ([SharpIpp.Samples.Client.NativeAot](SharpIpp.Samples.Client.NativeAot)).
71+
- An example of the IPP client is available in the [IppCli repository](https://github.com/danielklecha/IppCli).
72+
- An example of the IPP server is available in the [IppPrinter repository](https://github.com/danielklecha/IppPrinter).
7073

7174
### Setting the IPP Version
7275

‎SECURITY.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
## Supported Versions
44

5-
The following table outlines the support status for security updates. The current active version is `4.x.x`. We do not plan to update older versions. When version `5.0.0` is released, support for `4.x.x` will end.
5+
Security fixes are provided only for the **latest stable release**. Older versions and pre-releases are not supported. When a new release is published, support for previous versions ends immediately.
66

77
| Version | Supported |
88
| ------- | ------------------ |
9-
| 4.x.x | :white_check_mark: |
10-
| < 4.0 | :x: |
9+
| Latest stable release | :white_check_mark: |
10+
| Older releases | :x: |
1111

1212
## Reporting a Vulnerability
1313

‎SharpIpp/SharpIpp.csproj‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<TargetFrameworks>netstandard2.0;net10.0</TargetFrameworks>
44
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
5-
<PackageIcon>ipp256.png</PackageIcon>
5+
<PackageIcon>icon256.png</PackageIcon>
66
<PackageIconUrl />
77
<PackageProjectUrl>https://github.com/danielklecha/SharpIppNext</PackageProjectUrl>
88
<Authors>Daniel Klecha;Evgeny Zelenov</Authors>
@@ -27,7 +27,7 @@
2727
<IsTrimmable>true</IsTrimmable>
2828
</PropertyGroup>
2929
<ItemGroup>
30-
<None Include="..\ipp256.png">
30+
<None Include="..\icon256.png">
3131
<Pack>True</Pack>
3232
<PackagePath></PackagePath>
3333
</None>
Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
11
# Acknowledge-Identify-Printer Example
22

3+
Acknowledges that an identify-printer request was received and acted upon by the output device.
4+
5+
> [!NOTE]
6+
> Specification Reference: **PWG 5100.18 Section 6.2**
7+
38
```csharp
9+
using System;
10+
using System.IO;
11+
using System.Threading.Tasks;
12+
using SharpIpp;
13+
using SharpIpp.Models.Requests;
14+
using SharpIpp.Protocol.Models;
15+
416
var client = new SharpIppClient();
5-
var request = new AcknowledgeIdentifyPrinterRequest();
17+
18+
var request = new AcknowledgeIdentifyPrinterRequest
19+
{
20+
OperationAttributes = new()
21+
{
22+
PrinterUri = new Uri("ipp://localhost:631/printers/my-printer")
23+
}
24+
};
25+
626
var response = await client.AcknowledgeIdentifyPrinterAsync(request);
27+
Console.WriteLine($"Status: {response.StatusCode}");
728
```
29+
Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,31 @@
11
# Add-Document-Images Example
22

3+
Adds pre-processed document images to an existing document in a job.
4+
5+
> [!NOTE]
6+
> Specification Reference: **PWG 5100.5**
7+
38
```csharp
9+
using System;
10+
using System.IO;
11+
using System.Threading.Tasks;
12+
using SharpIpp;
13+
using SharpIpp.Models.Requests;
14+
using SharpIpp.Protocol.Models;
15+
416
var client = new SharpIppClient();
5-
var request = new AddDocumentImagesRequest();
17+
18+
var request = new AddDocumentImagesRequest
19+
{
20+
OperationAttributes = new()
21+
{
22+
PrinterUri = new Uri("ipp://localhost:631/printers/my-printer"),
23+
JobId = 42,
24+
DocumentNumber = 1
25+
}
26+
};
27+
628
var response = await client.AddDocumentImagesAsync(request);
29+
Console.WriteLine($"Status: {response.StatusCode}");
730
```
31+
Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,31 @@
11
# Allocate-Printer-Resources Example
22

3+
Allocates installed resources (fonts, forms, ICC profiles) to a specific printer service.
4+
5+
> [!NOTE]
6+
> Specification Reference: **PWG 5100.22-2025 Section 6.3.2**
7+
38
```csharp
9+
using System;
10+
using System.IO;
11+
using System.Threading.Tasks;
12+
using SharpIpp;
13+
using SharpIpp.Models.Requests;
14+
using SharpIpp.Protocol.Models;
15+
416
var client = new SharpIppClient();
5-
var request = new AllocatePrinterResourcesRequest();
17+
18+
var request = new AllocatePrinterResourcesRequest
19+
{
20+
OperationAttributes = new()
21+
{
22+
SystemUri = new Uri("ipp://localhost:631/system"),
23+
PrinterId = 1,
24+
ResourceIds = [101, 102]
25+
}
26+
};
27+
628
var response = await client.AllocatePrinterResourcesAsync(request);
29+
Console.WriteLine($"Status: {response.StatusCode}");
730
```
31+
Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,30 @@
11
# Cancel-Subscription Example
22

3+
Cancels an existing event notification subscription.
4+
5+
> [!NOTE]
6+
> Specification Reference: **RFC 3995 Section 5.3**
7+
38
```csharp
9+
using System;
10+
using System.IO;
11+
using System.Threading.Tasks;
12+
using SharpIpp;
13+
using SharpIpp.Models.Requests;
14+
using SharpIpp.Protocol.Models;
15+
416
var client = new SharpIppClient();
5-
var request = new CancelSubscriptionRequest();
17+
18+
var request = new CancelSubscriptionRequest
19+
{
20+
OperationAttributes = new()
21+
{
22+
PrinterUri = new Uri("ipp://localhost:631/printers/my-printer"),
23+
NotifySubscriptionId = 10
24+
}
25+
};
26+
627
var response = await client.CancelSubscriptionAsync(request);
28+
Console.WriteLine($"Status: {response.StatusCode}");
729
```
30+

0 commit comments

Comments
 (0)