@@ -22,15 +22,16 @@ import (
2222 " os"
2323
2424 " github.com/kitproj/coding-context-cli/pkg/codingcontext"
25+ " github.com/kitproj/coding-context-cli/pkg/codingcontext/taskparams"
2526)
2627
2728func main () {
2829 // Create a new context with options
2930 ctx := codingcontext.New (
3031 codingcontext.WithSearchPaths (" file://." , " file://" +os.Getenv (" HOME" )),
31- codingcontext.WithParams (codingcontext .Params {
32- " issue_number" : " 123" ,
33- " feature" : " authentication" ,
32+ codingcontext.WithParams (taskparams .Params {
33+ " issue_number" : [] string { " 123" } ,
34+ " feature" : [] string { " authentication" } ,
3435 }),
3536 codingcontext.WithLogger (slog.New (slog.NewTextHandler (os.Stderr , nil ))),
3637 )
@@ -63,24 +64,26 @@ import (
6364 " os"
6465
6566 " github.com/kitproj/coding-context-cli/pkg/codingcontext"
67+ " github.com/kitproj/coding-context-cli/pkg/codingcontext/selectors"
68+ " github.com/kitproj/coding-context-cli/pkg/codingcontext/taskparams"
6669)
6770
6871func main () {
6972 // Create selectors for filtering rules
70- selectors := make (codingcontext .Selectors )
71- selectors .SetValue (" language" , " go" )
72- selectors .SetValue (" stage" , " implementation" )
73+ sel := make (selectors .Selectors )
74+ sel .SetValue (" language" , " go" )
75+ sel .SetValue (" stage" , " implementation" )
7376
7477 // Create context with all options
7578 ctx := codingcontext.New (
7679 codingcontext.WithSearchPaths (
7780 " file://." ,
7881 " git::https://github.com/org/repo//path/to/rules" ,
7982 ),
80- codingcontext.WithParams (codingcontext .Params {
81- " issue_number" : " 123" ,
83+ codingcontext.WithParams (taskparams .Params {
84+ " issue_number" : [] string { " 123" } ,
8285 }),
83- codingcontext.WithSelectors (selectors ),
86+ codingcontext.WithSelectors (sel ),
8487 codingcontext.WithAgent (codingcontext.AgentCursor ),
8588 codingcontext.WithResume (false ),
8689 codingcontext.WithUserPrompt (" Additional context or instructions" ),
@@ -232,11 +235,14 @@ Type representing MCP transport protocol (string type):
232235
233236#### ` Params `
234237
235- Map of parameter key-value pairs for template substitution: ` map[string]string `
238+ Map of parameter key-value pairs for template substitution: ` map[string][] string `
236239
237240** Methods:**
238241- ` String() string ` - Returns string representation
239242- ` Set(value string) error ` - Parses and sets key=value pair (implements flag.Value)
243+ - ` Value(key string) string ` - Returns the first value for the given key
244+ - ` Lookup(key string) (string, bool) ` - Returns the first value and whether the key exists
245+ - ` Values(key string) []string ` - Returns all values for the given key
240246
241247#### ` Selectors `
242248
@@ -262,7 +268,7 @@ Types for parsing task content with slash commands:
262268- ` Argument ` - Slash command argument (can be positional or named key=value)
263269
264270** Methods:**
265- - ` (*SlashCommand) Params() map[string]string ` - Returns parsed parameters as map
271+ - ` (*SlashCommand) Params() taskparams.Params ` - Returns parsed parameters as map
266272- ` (*Text) Content() string ` - Returns text content as string
267273- Various ` String() ` methods for formatting each type
268274
@@ -284,8 +290,8 @@ Creates a new Context with the given options.
284290
285291** Options:**
286292- ` WithSearchPaths(paths ...string) ` - Add search paths (supports go-getter URLs)
287- - ` WithParams(params Params) ` - Set parameters for substitution
288- - ` WithSelectors(selectors Selectors) ` - Set selectors for filtering rules
293+ - ` WithParams(params taskparams. Params) ` - Set parameters for substitution (import ` taskparams ` package)
294+ - ` WithSelectors(selectors selectors. Selectors) ` - Set selectors for filtering rules (import ` selectors ` package)
289295- ` WithAgent(agent Agent) ` - Set target agent (excludes that agent's own rules)
290296- ` WithResume(resume bool) ` - Enable resume mode (skips rules)
291297- ` WithUserPrompt(userPrompt string) ` - Set user prompt to append to task
@@ -304,23 +310,25 @@ Parses a markdown file into frontmatter and content. Generic function that works
304310
305311Parses task text content into blocks of text and slash commands.
306312
307- #### ` ParseParams (s string) (Params, error)`
313+ #### ` taskparams.Parse (s string) (taskparams. Params, error)`
308314
309315Parses a string containing key=value pairs with quoted values.
310316
311317** Examples:**
312318``` go
319+ import " github.com/kitproj/coding-context-cli/pkg/codingcontext/taskparams"
320+
313321// Parse quoted key-value pairs
314- params , _ := ParseParams (` key1="value1" key2="value2"` )
315- // Result: map[string]string {"key1": "value1", "key2": "value2"}
322+ params , _ := taskparams. Parse (` key1="value1" key2="value2"` )
323+ // Result: taskparams.Params {"key1": []string{ "value1"} , "key2": []string{ "value2"} }
316324
317325// Parse with spaces in values
318- params , _ := ParseParams (` key1="value with spaces" key2="value2"` )
319- // Result: map[string]string {"key1": "value with spaces", "key2": "value2"}
326+ params , _ := taskparams. Parse (` key1="value with spaces" key2="value2"` )
327+ // Result: taskparams.Params {"key1": []string{ "value with spaces"} , "key2": []string{ "value2"} }
320328
321329// Parse with escaped quotes
322- params , _ := ParseParams (` key1="value with \"escaped\" quotes"` )
323- // Result: map[string]string {"key1": "value with \"escaped\" quotes"}
330+ params , _ := taskparams. Parse (` key1="value with \"escaped\" quotes"` )
331+ // Result: taskparams.Params {"key1": []string{ "value with \"escaped\" quotes"} }
324332```
325333
326334#### ` ParseAgent(s string) (Agent, error) `
0 commit comments